@mininglamp-oss/octo-runtime 0.0.0-stage → 1.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 (1725) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +35 -2
  3. package/apps/cli/README.md +244 -0
  4. package/apps/cli/dist/build-info.json +4 -0
  5. package/apps/cli/dist/daemon-output.d.ts +1 -0
  6. package/apps/cli/dist/daemon-output.js +49 -0
  7. package/apps/cli/dist/default_adapters.json +65 -0
  8. package/apps/cli/dist/extras.d.ts +6 -0
  9. package/apps/cli/dist/extras.js +56 -0
  10. package/apps/cli/dist/help.d.ts +16 -0
  11. package/apps/cli/dist/help.js +167 -0
  12. package/apps/cli/dist/index.d.ts +2 -0
  13. package/apps/cli/dist/index.js +9 -0
  14. package/apps/cli/dist/main.d.ts +19 -0
  15. package/apps/cli/dist/main.js +478 -0
  16. package/apps/cli/dist/playboard.d.ts +9 -0
  17. package/apps/cli/dist/playboard.js +118 -0
  18. package/apps/cli/dist/service-control.d.ts +16 -0
  19. package/apps/cli/dist/service-control.js +49 -0
  20. package/apps/cli/dist/state.d.ts +68 -0
  21. package/apps/cli/dist/state.js +284 -0
  22. package/apps/cli/dist/temporary-daemon.d.ts +11 -0
  23. package/apps/cli/dist/temporary-daemon.js +109 -0
  24. package/apps/daemon/dist/index.d.ts +2 -0
  25. package/apps/daemon/dist/index.js +134 -0
  26. package/apps/daemon/dist/launcher.d.ts +2 -0
  27. package/apps/daemon/dist/launcher.js +52 -0
  28. package/apps/daemon/dist/openclaw.d.ts +15 -0
  29. package/apps/daemon/dist/openclaw.js +234 -0
  30. package/apps/daemon/dist/runtime-options.d.ts +9 -0
  31. package/apps/daemon/dist/runtime-options.js +58 -0
  32. package/apps/daemon/dist/server.d.ts +1 -0
  33. package/apps/daemon/dist/server.js +1 -0
  34. package/dist/public/extra.d.ts +4 -0
  35. package/dist/public/extra.js +2 -0
  36. package/dist/public/protocol.d.ts +3 -0
  37. package/dist/public/protocol.js +1 -0
  38. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.d.ts +120 -0
  39. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +380 -0
  40. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +15 -0
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +55 -0
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +494 -0
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +16 -0
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +69 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.js +433 -0
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +16 -0
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +129 -0
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +796 -0
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +15 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +53 -0
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +236 -0
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +16 -0
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +97 -0
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +2334 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/environment.d.ts +3 -0
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/environment.js +44 -0
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +64 -0
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +141 -0
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.d.ts +8 -0
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.js +36 -0
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +15 -0
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +11 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.js +9 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +14 -0
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/execution-preparation.d.ts +33 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/execution-preparation.js +93 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/experience.d.ts +6 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/experience.js +140 -0
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/host-run-service.d.ts +44 -0
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/host-run-service.js +293 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/index.d.ts +70 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/index.js +913 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/model-input.d.ts +5 -0
  74. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/model-input.js +52 -0
  75. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/process.d.ts +31 -0
  76. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/process.js +86 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/rpc.d.ts +59 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/rpc.js +578 -0
  79. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/runner.d.ts +2 -0
  80. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/runner.js +98 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/runtime-configuration.d.ts +2 -0
  82. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/runtime-configuration.js +93 -0
  83. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/serve.d.ts +10 -0
  84. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/serve.js +48 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/socket-server.d.ts +21 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/socket-server.js +255 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/watchdog.d.ts +49 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/dist/watchdog.js +366 -0
  89. package/node_modules/@mininglamp-oss/octo-runtime-adapter-host/package.json +37 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +11 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.js +8 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +14 -0
  93. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +23 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.js +21 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +14 -0
  96. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.d.ts +45 -0
  97. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +303 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +81 -0
  99. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +975 -0
  100. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/local-gateway.d.ts +25 -0
  101. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/local-gateway.js +172 -0
  102. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/parser.d.ts +87 -0
  103. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/parser.js +355 -0
  104. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +16 -0
  105. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +88 -0
  106. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +336 -0
  107. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +16 -0
  108. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +23 -0
  109. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.js +20 -0
  110. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +14 -0
  111. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +23 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.js +20 -0
  113. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +14 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/acp-tool.d.ts +15 -0
  115. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/acp-tool.js +63 -0
  116. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/acp-turn.d.ts +13 -0
  117. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/acp-turn.js +149 -0
  118. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +13 -0
  119. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.js +1 -0
  120. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/actmode.d.ts +5 -0
  121. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/actmode.js +8 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.d.ts +25 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +353 -0
  124. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/bounded-lines.d.ts +9 -0
  125. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/bounded-lines.js +79 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.d.ts +5 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.js +15 -0
  128. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/hourly-log.d.ts +21 -0
  129. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/hourly-log.js +196 -0
  130. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +122 -0
  131. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +289 -0
  132. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/line-limit.d.ts +3 -0
  133. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/line-limit.js +27 -0
  134. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.d.ts +6 -0
  135. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.js +66 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/native.d.ts +26 -0
  137. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/native.js +181 -0
  138. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-cleanup.d.ts +11 -0
  139. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-cleanup.js +72 -0
  140. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.d.ts +1 -0
  141. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +29 -0
  142. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.d.ts +12 -0
  143. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +46 -0
  144. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.d.ts +1 -0
  145. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +29 -0
  146. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.d.ts +15 -0
  147. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +136 -0
  148. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +17 -0
  149. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +63 -0
  150. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +822 -0
  151. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +36 -0
  152. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +154 -0
  153. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +15 -0
  154. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +4 -0
  155. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/daemon-output.d.ts +1 -0
  156. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/daemon-output.js +49 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/default_adapters.json +65 -0
  158. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.d.ts +6 -0
  159. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +56 -0
  160. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.d.ts +16 -0
  161. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +167 -0
  162. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.d.ts +2 -0
  163. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +9 -0
  164. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +19 -0
  165. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +478 -0
  166. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +9 -0
  167. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +118 -0
  168. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.d.ts +16 -0
  169. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.js +49 -0
  170. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.d.ts +68 -0
  171. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +284 -0
  172. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/temporary-daemon.d.ts +11 -0
  173. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/temporary-daemon.js +109 -0
  174. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +19 -0
  175. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/context.d.ts +7 -0
  176. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/context.js +84 -0
  177. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/index.d.ts +2 -0
  178. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/index.js +2 -0
  179. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/invoke-input.d.ts +7 -0
  180. package/node_modules/@mininglamp-oss/octo-runtime-core/dist/invoke-input.js +140 -0
  181. package/node_modules/@mininglamp-oss/octo-runtime-core/package.json +14 -0
  182. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.d.ts +31 -0
  183. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.js +196 -0
  184. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/errors.d.ts +27 -0
  185. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/errors.js +18 -0
  186. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/index.d.ts +17 -0
  187. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/index.js +42 -0
  188. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.d.ts +37 -0
  189. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.js +312 -0
  190. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.d.ts +11 -0
  191. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.js +71 -0
  192. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/systemd.d.ts +37 -0
  193. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/systemd.js +278 -0
  194. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/types.d.ts +218 -0
  195. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/types.js +8 -0
  196. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.d.ts +44 -0
  197. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +414 -0
  198. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +17 -0
  199. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/context-loader.d.ts +30 -0
  200. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/context-loader.js +158 -0
  201. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/extra-config.d.ts +13 -0
  202. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/extra-config.js +95 -0
  203. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/extras.d.ts +64 -0
  204. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/extras.js +364 -0
  205. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/index.d.ts +9 -0
  206. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/index.js +9 -0
  207. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/invocation-manifest.d.ts +26 -0
  208. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/invocation-manifest.js +176 -0
  209. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/modules.d.ts +55 -0
  210. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/modules.js +138 -0
  211. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/adapter-host.d.ts +1 -0
  212. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/adapter-host.js +33 -0
  213. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/daemon-runtime.d.ts +37 -0
  214. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/daemon-runtime.js +623 -0
  215. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/errors.d.ts +8 -0
  216. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/errors.js +17 -0
  217. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/home.d.ts +49 -0
  218. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/home.js +266 -0
  219. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/identity.d.ts +11 -0
  220. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/identity.js +28 -0
  221. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/index.d.ts +8 -0
  222. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/index.js +9 -0
  223. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/local-extras.d.ts +12 -0
  224. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/local-extras.js +133 -0
  225. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/run-stream.d.ts +14 -0
  226. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/run-stream.js +206 -0
  227. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/runner.d.ts +2 -0
  228. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/runner.js +103 -0
  229. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/runtime-contract.d.ts +36 -0
  230. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/runtime-contract.js +57 -0
  231. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/supervisor.d.ts +23 -0
  232. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/supervisor.js +245 -0
  233. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/types.d.ts +116 -0
  234. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/types.js +1 -0
  235. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/version.d.ts +1 -0
  236. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime/version.js +1 -0
  237. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime-endpoint.d.ts +2 -0
  238. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/runtime-endpoint.js +9 -0
  239. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/server.d.ts +67 -0
  240. package/node_modules/@mininglamp-oss/octo-runtime-daemon/dist/server.js +808 -0
  241. package/node_modules/@mininglamp-oss/octo-runtime-daemon/package.json +52 -0
  242. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/index.d.ts +2 -0
  243. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/index.js +134 -0
  244. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/launcher.d.ts +2 -0
  245. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/launcher.js +52 -0
  246. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/openclaw.d.ts +15 -0
  247. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/openclaw.js +234 -0
  248. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/runtime-options.d.ts +9 -0
  249. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/runtime-options.js +58 -0
  250. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/server.d.ts +1 -0
  251. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/dist/server.js +1 -0
  252. package/node_modules/@mininglamp-oss/octo-runtime-daemon-app/package.json +33 -0
  253. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +395 -0
  254. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.d.ts +11 -0
  255. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +852 -0
  256. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +36 -0
  257. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.js +93 -0
  258. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +129 -0
  259. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.js +1 -0
  260. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/daemon-module.d.ts +8 -0
  261. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/daemon-module.js +64 -0
  262. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/dispatcher.d.ts +15 -0
  263. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/dispatcher.js +85 -0
  264. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.d.ts +14 -0
  265. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.js +88 -0
  266. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/text-send.d.ts +19 -0
  267. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/text-send.js +86 -0
  268. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +12 -0
  269. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +133 -0
  270. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +34 -0
  271. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +269 -0
  272. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.d.ts +3 -0
  273. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.js +25 -0
  274. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.d.ts +3 -0
  275. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +73 -0
  276. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/index.d.ts +17 -0
  277. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/index.js +13 -0
  278. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.d.ts +9 -0
  279. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +133 -0
  280. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/manager.d.ts +12 -0
  281. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/manager.js +94 -0
  282. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.d.ts +23 -0
  283. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.js +1 -0
  284. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/delivery-notice.d.ts +5 -0
  285. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/delivery-notice.js +35 -0
  286. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +61 -0
  287. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.js +358 -0
  288. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/typing.d.ts +16 -0
  289. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/typing.js +83 -0
  290. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.d.ts +128 -0
  291. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +225 -0
  292. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +57 -0
  293. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +184 -0
  294. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.d.ts +105 -0
  295. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +130 -0
  296. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.d.ts +60 -0
  297. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js +114 -0
  298. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/events.d.ts +51 -0
  299. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/events.js +79 -0
  300. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +25 -0
  301. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +119 -0
  302. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/index.d.ts +13 -0
  303. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/index.js +13 -0
  304. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.d.ts +89 -0
  305. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.js +173 -0
  306. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/rules.d.ts +84 -0
  307. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/rules.js +109 -0
  308. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/types.d.ts +87 -0
  309. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/types.js +45 -0
  310. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.d.ts +5 -0
  311. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +22 -0
  312. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-action.d.ts +20 -0
  313. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-action.js +75 -0
  314. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.d.ts +21 -0
  315. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.js +61 -0
  316. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/cards.d.ts +7 -0
  317. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/cards.js +40 -0
  318. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +43 -0
  319. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +407 -0
  320. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.d.ts +10 -0
  321. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +52 -0
  322. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.d.ts +19 -0
  323. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.js +132 -0
  324. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.d.ts +16 -0
  325. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +203 -0
  326. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/image-input.d.ts +6 -0
  327. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/image-input.js +162 -0
  328. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/interaction-card.d.ts +4 -0
  329. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/interaction-card.js +112 -0
  330. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +12 -0
  331. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +63 -0
  332. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-content.d.ts +6 -0
  333. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-content.js +117 -0
  334. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.d.ts +13 -0
  335. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.js +50 -0
  336. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.d.ts +34 -0
  337. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +354 -0
  338. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/resources.d.ts +6 -0
  339. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/resources.js +63 -0
  340. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +30 -0
  341. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +431 -0
  342. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +33 -0
  343. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/config-schema.json +276 -0
  344. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.d.ts +11 -0
  345. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +603 -0
  346. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/session-store.d.ts +33 -0
  347. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/session-store.js +93 -0
  348. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/contracts.d.ts +89 -0
  349. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/contracts.js +1 -0
  350. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/daemon-module.d.ts +8 -0
  351. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/daemon-module.js +64 -0
  352. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/delivery/dispatcher.d.ts +15 -0
  353. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/delivery/dispatcher.js +68 -0
  354. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/execution/dispatcher.d.ts +12 -0
  355. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/execution/dispatcher.js +95 -0
  356. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.d.ts +3 -0
  357. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +72 -0
  358. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/index.d.ts +10 -0
  359. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/index.js +6 -0
  360. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/lifecycle/configuration.d.ts +6 -0
  361. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/lifecycle/configuration.js +109 -0
  362. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/lifecycle/manager.d.ts +12 -0
  363. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/lifecycle/manager.js +73 -0
  364. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.d.ts +23 -0
  365. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.js +1 -0
  366. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/presentation/run-projector.d.ts +45 -0
  367. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/presentation/run-projector.js +258 -0
  368. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.d.ts +21 -0
  369. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.js +125 -0
  370. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/connection.d.ts +53 -0
  371. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/connection.js +219 -0
  372. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/stream-session.d.ts +10 -0
  373. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/stream-session.js +52 -0
  374. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +31 -0
  375. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/config-schema.json +134 -0
  376. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.d.ts +3 -0
  377. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +425 -0
  378. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.d.ts +22 -0
  379. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.js +80 -0
  380. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-B6Yp4xkI.js +76 -0
  381. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-CYTpqItx.css +1 -0
  382. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +3 -0
  383. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +24 -0
  384. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/actmode.d.ts +4 -0
  385. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/actmode.js +36 -0
  386. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +6 -0
  387. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +5 -0
  388. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.d.ts +11 -0
  389. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.js +33 -0
  390. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-configuration.d.ts +5 -0
  391. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-configuration.js +58 -0
  392. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-hash.d.ts +2 -0
  393. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-hash.js +5 -0
  394. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +27 -0
  395. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +556 -0
  396. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.d.ts +3 -0
  397. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.js +80 -0
  398. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/experience.d.ts +4 -0
  399. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/experience.js +166 -0
  400. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +69 -0
  401. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +436 -0
  402. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +2774 -0
  403. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.js +6 -0
  404. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +117 -0
  405. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +682 -0
  406. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +120 -0
  407. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +164 -0
  408. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-size.d.ts +3 -0
  409. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-size.js +10 -0
  410. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/json-size.d.ts +2 -0
  411. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/json-size.js +91 -0
  412. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.d.ts +3 -0
  413. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.js +9 -0
  414. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/multimodal.d.ts +15 -0
  415. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/multimodal.js +166 -0
  416. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/notification.d.ts +2 -0
  417. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/notification.js +137 -0
  418. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +20 -0
  419. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +241 -0
  420. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/runtime-selection.d.ts +3 -0
  421. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/runtime-selection.js +68 -0
  422. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +16 -0
  423. package/node_modules/@types/debug/LICENSE +21 -0
  424. package/node_modules/@types/debug/README.md +69 -0
  425. package/node_modules/@types/debug/index.d.ts +50 -0
  426. package/node_modules/@types/debug/package.json +58 -0
  427. package/node_modules/@types/mdast/LICENSE +21 -0
  428. package/node_modules/@types/mdast/README.md +15 -0
  429. package/node_modules/@types/mdast/index.d.ts +1123 -0
  430. package/node_modules/@types/mdast/package.json +47 -0
  431. package/node_modules/@types/ms/LICENSE +21 -0
  432. package/node_modules/@types/ms/README.md +82 -0
  433. package/node_modules/@types/ms/index.d.ts +63 -0
  434. package/node_modules/@types/ms/package.json +26 -0
  435. package/node_modules/@types/unist/LICENSE +21 -0
  436. package/node_modules/@types/unist/README.md +15 -0
  437. package/node_modules/@types/unist/index.d.ts +119 -0
  438. package/node_modules/@types/unist/package.json +60 -0
  439. package/node_modules/ajv/.runkit_example.js +23 -0
  440. package/node_modules/ajv/LICENSE +22 -0
  441. package/node_modules/ajv/README.md +207 -0
  442. package/node_modules/ajv/dist/2019.d.ts +19 -0
  443. package/node_modules/ajv/dist/2019.js +61 -0
  444. package/node_modules/ajv/dist/2019.js.map +1 -0
  445. package/node_modules/ajv/dist/2020.d.ts +19 -0
  446. package/node_modules/ajv/dist/2020.js +55 -0
  447. package/node_modules/ajv/dist/2020.js.map +1 -0
  448. package/node_modules/ajv/dist/ajv.d.ts +18 -0
  449. package/node_modules/ajv/dist/ajv.js +50 -0
  450. package/node_modules/ajv/dist/ajv.js.map +1 -0
  451. package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
  452. package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
  453. package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  454. package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
  455. package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
  456. package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  457. package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
  458. package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  459. package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  460. package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
  461. package/node_modules/ajv/dist/compile/errors.js +123 -0
  462. package/node_modules/ajv/dist/compile/errors.js.map +1 -0
  463. package/node_modules/ajv/dist/compile/index.d.ts +80 -0
  464. package/node_modules/ajv/dist/compile/index.js +242 -0
  465. package/node_modules/ajv/dist/compile/index.js.map +1 -0
  466. package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
  467. package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
  468. package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
  469. package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
  470. package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
  471. package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
  472. package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
  473. package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
  474. package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
  475. package/node_modules/ajv/dist/compile/names.d.ts +20 -0
  476. package/node_modules/ajv/dist/compile/names.js +28 -0
  477. package/node_modules/ajv/dist/compile/names.js.map +1 -0
  478. package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
  479. package/node_modules/ajv/dist/compile/ref_error.js +12 -0
  480. package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  481. package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
  482. package/node_modules/ajv/dist/compile/resolve.js +155 -0
  483. package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  484. package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
  485. package/node_modules/ajv/dist/compile/rules.js +26 -0
  486. package/node_modules/ajv/dist/compile/rules.js.map +1 -0
  487. package/node_modules/ajv/dist/compile/util.d.ts +40 -0
  488. package/node_modules/ajv/dist/compile/util.js +178 -0
  489. package/node_modules/ajv/dist/compile/util.js.map +1 -0
  490. package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
  491. package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
  492. package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  493. package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
  494. package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  495. package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  496. package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
  497. package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
  498. package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  499. package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
  500. package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
  501. package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  502. package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
  503. package/node_modules/ajv/dist/compile/validate/index.js +520 -0
  504. package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  505. package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
  506. package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
  507. package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  508. package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
  509. package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
  510. package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  511. package/node_modules/ajv/dist/core.d.ts +174 -0
  512. package/node_modules/ajv/dist/core.js +618 -0
  513. package/node_modules/ajv/dist/core.js.map +1 -0
  514. package/node_modules/ajv/dist/jtd.d.ts +47 -0
  515. package/node_modules/ajv/dist/jtd.js +72 -0
  516. package/node_modules/ajv/dist/jtd.js.map +1 -0
  517. package/node_modules/ajv/dist/refs/data.json +13 -0
  518. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
  519. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
  520. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
  521. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
  522. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
  523. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
  524. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
  525. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  526. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
  527. package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
  528. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
  529. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
  530. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
  531. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
  532. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
  533. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
  534. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  535. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  536. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  537. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
  538. package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
  539. package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
  540. package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
  541. package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
  542. package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
  543. package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
  544. package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
  545. package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
  546. package/node_modules/ajv/dist/runtime/equal.js +7 -0
  547. package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  548. package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
  549. package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
  550. package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
  551. package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
  552. package/node_modules/ajv/dist/runtime/quote.js +30 -0
  553. package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
  554. package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
  555. package/node_modules/ajv/dist/runtime/re2.js +6 -0
  556. package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
  557. package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
  558. package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
  559. package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
  560. package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
  561. package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
  562. package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  563. package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
  564. package/node_modules/ajv/dist/runtime/uri.js +6 -0
  565. package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  566. package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
  567. package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
  568. package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  569. package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
  570. package/node_modules/ajv/dist/standalone/index.js +90 -0
  571. package/node_modules/ajv/dist/standalone/index.js.map +1 -0
  572. package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
  573. package/node_modules/ajv/dist/standalone/instance.js +35 -0
  574. package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
  575. package/node_modules/ajv/dist/types/index.d.ts +183 -0
  576. package/node_modules/ajv/dist/types/index.js +3 -0
  577. package/node_modules/ajv/dist/types/index.js.map +1 -0
  578. package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
  579. package/node_modules/ajv/dist/types/json-schema.js +3 -0
  580. package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
  581. package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
  582. package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
  583. package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
  584. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
  585. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
  586. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  587. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
  588. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
  589. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  590. package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
  591. package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
  592. package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  593. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
  594. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
  595. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  596. package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
  597. package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
  598. package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  599. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
  600. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
  601. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  602. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
  603. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
  604. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
  605. package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
  606. package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
  607. package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  608. package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
  609. package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
  610. package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  611. package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
  612. package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
  613. package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  614. package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
  615. package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
  616. package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  617. package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
  618. package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
  619. package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  620. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
  621. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
  622. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  623. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
  624. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
  625. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  626. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
  627. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
  628. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  629. package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
  630. package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  631. package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  632. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
  633. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
  634. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  635. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
  636. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
  637. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  638. package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
  639. package/node_modules/ajv/dist/vocabularies/code.js +131 -0
  640. package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  641. package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
  642. package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
  643. package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  644. package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
  645. package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
  646. package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  647. package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
  648. package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
  649. package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  650. package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
  651. package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
  652. package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  653. package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
  654. package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
  655. package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  656. package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
  657. package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
  658. package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
  659. package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
  660. package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
  661. package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  662. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
  663. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
  664. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
  665. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
  666. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
  667. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
  668. package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
  669. package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
  670. package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
  671. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
  672. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
  673. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
  674. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
  675. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
  676. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
  677. package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
  678. package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
  679. package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
  680. package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
  681. package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
  682. package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  683. package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
  684. package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
  685. package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  686. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
  687. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
  688. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
  689. package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
  690. package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
  691. package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
  692. package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
  693. package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
  694. package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
  695. package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
  696. package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
  697. package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
  698. package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
  699. package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
  700. package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
  701. package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
  702. package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
  703. package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
  704. package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
  705. package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
  706. package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
  707. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
  708. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
  709. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
  710. package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
  711. package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
  712. package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
  713. package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
  714. package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
  715. package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
  716. package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
  717. package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
  718. package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
  719. package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
  720. package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
  721. package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
  722. package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
  723. package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
  724. package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
  725. package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
  726. package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
  727. package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  728. package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
  729. package/node_modules/ajv/dist/vocabularies/next.js +8 -0
  730. package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
  731. package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
  732. package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
  733. package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
  734. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
  735. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
  736. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
  737. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
  738. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
  739. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
  740. package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
  741. package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
  742. package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  743. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
  744. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
  745. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
  746. package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
  747. package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
  748. package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  749. package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
  750. package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
  751. package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  752. package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
  753. package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
  754. package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
  755. package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
  756. package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
  757. package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  758. package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
  759. package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
  760. package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  761. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
  762. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
  763. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  764. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
  765. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
  766. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  767. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
  768. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
  769. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  770. package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
  771. package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
  772. package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  773. package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
  774. package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
  775. package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  776. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
  777. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
  778. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  779. package/node_modules/ajv/lib/2019.ts +81 -0
  780. package/node_modules/ajv/lib/2020.ts +75 -0
  781. package/node_modules/ajv/lib/ajv.ts +70 -0
  782. package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
  783. package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
  784. package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
  785. package/node_modules/ajv/lib/compile/errors.ts +184 -0
  786. package/node_modules/ajv/lib/compile/index.ts +324 -0
  787. package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
  788. package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
  789. package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
  790. package/node_modules/ajv/lib/compile/names.ts +27 -0
  791. package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
  792. package/node_modules/ajv/lib/compile/resolve.ts +149 -0
  793. package/node_modules/ajv/lib/compile/rules.ts +50 -0
  794. package/node_modules/ajv/lib/compile/util.ts +213 -0
  795. package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
  796. package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
  797. package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
  798. package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
  799. package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
  800. package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
  801. package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
  802. package/node_modules/ajv/lib/core.ts +892 -0
  803. package/node_modules/ajv/lib/jtd.ts +132 -0
  804. package/node_modules/ajv/lib/refs/data.json +13 -0
  805. package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
  806. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
  807. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
  808. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
  809. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
  810. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  811. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
  812. package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
  813. package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
  814. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
  815. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
  816. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
  817. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  818. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  819. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  820. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
  821. package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
  822. package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
  823. package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
  824. package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
  825. package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
  826. package/node_modules/ajv/lib/runtime/equal.ts +7 -0
  827. package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
  828. package/node_modules/ajv/lib/runtime/quote.ts +31 -0
  829. package/node_modules/ajv/lib/runtime/re2.ts +6 -0
  830. package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
  831. package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
  832. package/node_modules/ajv/lib/runtime/uri.ts +6 -0
  833. package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
  834. package/node_modules/ajv/lib/standalone/index.ts +100 -0
  835. package/node_modules/ajv/lib/standalone/instance.ts +36 -0
  836. package/node_modules/ajv/lib/types/index.ts +244 -0
  837. package/node_modules/ajv/lib/types/json-schema.ts +187 -0
  838. package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
  839. package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
  840. package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
  841. package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
  842. package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
  843. package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
  844. package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
  845. package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
  846. package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
  847. package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
  848. package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
  849. package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
  850. package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
  851. package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
  852. package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
  853. package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
  854. package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
  855. package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
  856. package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
  857. package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
  858. package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
  859. package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
  860. package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
  861. package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
  862. package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
  863. package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
  864. package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
  865. package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
  866. package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
  867. package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
  868. package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
  869. package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
  870. package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
  871. package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
  872. package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
  873. package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
  874. package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
  875. package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
  876. package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
  877. package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
  878. package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
  879. package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
  880. package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
  881. package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
  882. package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
  883. package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
  884. package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
  885. package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
  886. package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
  887. package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
  888. package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
  889. package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
  890. package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
  891. package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
  892. package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
  893. package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
  894. package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
  895. package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
  896. package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
  897. package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
  898. package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
  899. package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
  900. package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
  901. package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
  902. package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
  903. package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
  904. package/node_modules/ajv/package.json +126 -0
  905. package/node_modules/character-entities/index.d.ts +6 -0
  906. package/node_modules/character-entities/index.js +2132 -0
  907. package/node_modules/character-entities/license +22 -0
  908. package/node_modules/character-entities/package.json +78 -0
  909. package/node_modules/character-entities/readme.md +152 -0
  910. package/node_modules/debug/LICENSE +20 -0
  911. package/node_modules/debug/README.md +481 -0
  912. package/node_modules/debug/package.json +64 -0
  913. package/node_modules/debug/src/browser.js +272 -0
  914. package/node_modules/debug/src/common.js +292 -0
  915. package/node_modules/debug/src/index.js +10 -0
  916. package/node_modules/debug/src/node.js +263 -0
  917. package/node_modules/decode-named-character-reference/index.d.ts +13 -0
  918. package/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
  919. package/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
  920. package/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
  921. package/node_modules/decode-named-character-reference/index.dom.js +32 -0
  922. package/node_modules/decode-named-character-reference/index.js +19 -0
  923. package/node_modules/decode-named-character-reference/license +22 -0
  924. package/node_modules/decode-named-character-reference/package.json +90 -0
  925. package/node_modules/decode-named-character-reference/readme.md +136 -0
  926. package/node_modules/dequal/dist/index.js +86 -0
  927. package/node_modules/dequal/dist/index.min.js +1 -0
  928. package/node_modules/dequal/dist/index.mjs +84 -0
  929. package/node_modules/dequal/index.d.ts +1 -0
  930. package/node_modules/dequal/license +21 -0
  931. package/node_modules/dequal/lite/index.d.ts +1 -0
  932. package/node_modules/dequal/lite/index.js +31 -0
  933. package/node_modules/dequal/lite/index.min.js +1 -0
  934. package/node_modules/dequal/lite/index.mjs +29 -0
  935. package/node_modules/dequal/package.json +57 -0
  936. package/node_modules/dequal/readme.md +112 -0
  937. package/node_modules/devlop/lib/default.js +9 -0
  938. package/node_modules/devlop/lib/development.d.ts +84 -0
  939. package/node_modules/devlop/lib/development.js +238 -0
  940. package/node_modules/devlop/license +22 -0
  941. package/node_modules/devlop/package.json +80 -0
  942. package/node_modules/devlop/readme.md +360 -0
  943. package/node_modules/fast-deep-equal/LICENSE +21 -0
  944. package/node_modules/fast-deep-equal/README.md +96 -0
  945. package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
  946. package/node_modules/fast-deep-equal/es6/index.js +72 -0
  947. package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
  948. package/node_modules/fast-deep-equal/es6/react.js +79 -0
  949. package/node_modules/fast-deep-equal/index.d.ts +4 -0
  950. package/node_modules/fast-deep-equal/index.js +46 -0
  951. package/node_modules/fast-deep-equal/package.json +61 -0
  952. package/node_modules/fast-deep-equal/react.d.ts +2 -0
  953. package/node_modules/fast-deep-equal/react.js +53 -0
  954. package/node_modules/fast-uri/.gitattributes +2 -0
  955. package/node_modules/fast-uri/.github/dependabot.yml +13 -0
  956. package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
  957. package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
  958. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
  959. package/node_modules/fast-uri/LICENSE +30 -0
  960. package/node_modules/fast-uri/README.md +152 -0
  961. package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
  962. package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
  963. package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
  964. package/node_modules/fast-uri/benchmark/package.json +17 -0
  965. package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
  966. package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
  967. package/node_modules/fast-uri/eslint.config.js +6 -0
  968. package/node_modules/fast-uri/index.js +631 -0
  969. package/node_modules/fast-uri/lib/schemes.js +272 -0
  970. package/node_modules/fast-uri/lib/utils.js +747 -0
  971. package/node_modules/fast-uri/package.json +68 -0
  972. package/node_modules/fast-uri/test/ajv.test.js +43 -0
  973. package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  974. package/node_modules/fast-uri/test/equal.test.js +145 -0
  975. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +503 -0
  976. package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
  977. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  978. package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  979. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  980. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  981. package/node_modules/fast-uri/test/parse.test.js +327 -0
  982. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  983. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  984. package/node_modules/fast-uri/test/resolve.test.js +87 -0
  985. package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
  986. package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  987. package/node_modules/fast-uri/test/security-normalization.test.js +178 -0
  988. package/node_modules/fast-uri/test/security.test.js +431 -0
  989. package/node_modules/fast-uri/test/serialize.test.js +151 -0
  990. package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
  991. package/node_modules/fast-uri/test/uri-js.test.js +912 -0
  992. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  993. package/node_modules/fast-uri/test/util.test.js +38 -0
  994. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  995. package/node_modules/fast-uri/tsconfig.json +9 -0
  996. package/node_modules/fast-uri/types/index.d.ts +60 -0
  997. package/node_modules/fast-uri/types/index.test-d.ts +17 -0
  998. package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
  999. package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
  1000. package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
  1001. package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
  1002. package/node_modules/json-schema-traverse/LICENSE +21 -0
  1003. package/node_modules/json-schema-traverse/README.md +95 -0
  1004. package/node_modules/json-schema-traverse/index.d.ts +40 -0
  1005. package/node_modules/json-schema-traverse/index.js +93 -0
  1006. package/node_modules/json-schema-traverse/package.json +43 -0
  1007. package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
  1008. package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
  1009. package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
  1010. package/node_modules/json5/LICENSE.md +23 -0
  1011. package/node_modules/json5/README.md +282 -0
  1012. package/node_modules/json5/dist/index.js +1737 -0
  1013. package/node_modules/json5/dist/index.min.js +1 -0
  1014. package/node_modules/json5/dist/index.min.mjs +1 -0
  1015. package/node_modules/json5/dist/index.mjs +1426 -0
  1016. package/node_modules/json5/lib/cli.js +152 -0
  1017. package/node_modules/json5/lib/index.d.ts +4 -0
  1018. package/node_modules/json5/lib/index.js +9 -0
  1019. package/node_modules/json5/lib/parse.d.ts +15 -0
  1020. package/node_modules/json5/lib/parse.js +1114 -0
  1021. package/node_modules/json5/lib/register.js +13 -0
  1022. package/node_modules/json5/lib/require.js +4 -0
  1023. package/node_modules/json5/lib/stringify.d.ts +89 -0
  1024. package/node_modules/json5/lib/stringify.js +261 -0
  1025. package/node_modules/json5/lib/unicode.d.ts +3 -0
  1026. package/node_modules/json5/lib/unicode.js +4 -0
  1027. package/node_modules/json5/lib/util.d.ts +5 -0
  1028. package/node_modules/json5/lib/util.js +35 -0
  1029. package/node_modules/json5/package.json +72 -0
  1030. package/node_modules/mdast-util-from-markdown/dev/index.d.ts +23 -0
  1031. package/node_modules/mdast-util-from-markdown/dev/index.js +2 -0
  1032. package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts +53 -0
  1033. package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map +1 -0
  1034. package/node_modules/mdast-util-from-markdown/dev/lib/index.js +1455 -0
  1035. package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +321 -0
  1036. package/node_modules/mdast-util-from-markdown/dev/lib/types.js +2 -0
  1037. package/node_modules/mdast-util-from-markdown/index.d.ts +23 -0
  1038. package/node_modules/mdast-util-from-markdown/index.js +2 -0
  1039. package/node_modules/mdast-util-from-markdown/lib/index.d.ts +53 -0
  1040. package/node_modules/mdast-util-from-markdown/lib/index.d.ts.map +1 -0
  1041. package/node_modules/mdast-util-from-markdown/lib/index.js +1270 -0
  1042. package/node_modules/mdast-util-from-markdown/lib/types.d.ts +321 -0
  1043. package/node_modules/mdast-util-from-markdown/lib/types.js +2 -0
  1044. package/node_modules/mdast-util-from-markdown/license +22 -0
  1045. package/node_modules/mdast-util-from-markdown/package.json +98 -0
  1046. package/node_modules/mdast-util-from-markdown/readme.md +549 -0
  1047. package/node_modules/mdast-util-to-string/index.d.ts +2 -0
  1048. package/node_modules/mdast-util-to-string/index.js +5 -0
  1049. package/node_modules/mdast-util-to-string/lib/index.d.ts +31 -0
  1050. package/node_modules/mdast-util-to-string/lib/index.js +108 -0
  1051. package/node_modules/mdast-util-to-string/license +22 -0
  1052. package/node_modules/mdast-util-to-string/package.json +78 -0
  1053. package/node_modules/mdast-util-to-string/readme.md +218 -0
  1054. package/node_modules/micromark/dev/index.d.ts +82 -0
  1055. package/node_modules/micromark/dev/index.d.ts.map +1 -0
  1056. package/node_modules/micromark/dev/index.js +68 -0
  1057. package/node_modules/micromark/dev/lib/compile.d.ts +16 -0
  1058. package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
  1059. package/node_modules/micromark/dev/lib/compile.js +1162 -0
  1060. package/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
  1061. package/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
  1062. package/node_modules/micromark/dev/lib/constructs.js +101 -0
  1063. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
  1064. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
  1065. package/node_modules/micromark/dev/lib/create-tokenizer.js +718 -0
  1066. package/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
  1067. package/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
  1068. package/node_modules/micromark/dev/lib/initialize/content.js +99 -0
  1069. package/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
  1070. package/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
  1071. package/node_modules/micromark/dev/lib/initialize/document.js +449 -0
  1072. package/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
  1073. package/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
  1074. package/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
  1075. package/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
  1076. package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
  1077. package/node_modules/micromark/dev/lib/initialize/text.js +248 -0
  1078. package/node_modules/micromark/dev/lib/parse.d.ts +10 -0
  1079. package/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
  1080. package/node_modules/micromark/dev/lib/parse.js +58 -0
  1081. package/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
  1082. package/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
  1083. package/node_modules/micromark/dev/lib/postprocess.js +19 -0
  1084. package/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
  1085. package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
  1086. package/node_modules/micromark/dev/lib/preprocess.js +139 -0
  1087. package/node_modules/micromark/dev/stream.d.ts +35 -0
  1088. package/node_modules/micromark/dev/stream.d.ts.map +1 -0
  1089. package/node_modules/micromark/dev/stream.js +270 -0
  1090. package/node_modules/micromark/index.d.ts +82 -0
  1091. package/node_modules/micromark/index.d.ts.map +1 -0
  1092. package/node_modules/micromark/index.js +60 -0
  1093. package/node_modules/micromark/lib/compile.d.ts +16 -0
  1094. package/node_modules/micromark/lib/compile.d.ts.map +1 -0
  1095. package/node_modules/micromark/lib/compile.js +1068 -0
  1096. package/node_modules/micromark/lib/constructs.d.ts +73 -0
  1097. package/node_modules/micromark/lib/constructs.d.ts.map +1 -0
  1098. package/node_modules/micromark/lib/constructs.js +85 -0
  1099. package/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
  1100. package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
  1101. package/node_modules/micromark/lib/create-tokenizer.js +613 -0
  1102. package/node_modules/micromark/lib/initialize/content.d.ts +4 -0
  1103. package/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
  1104. package/node_modules/micromark/lib/initialize/content.js +79 -0
  1105. package/node_modules/micromark/lib/initialize/document.d.ts +10 -0
  1106. package/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
  1107. package/node_modules/micromark/lib/initialize/document.js +370 -0
  1108. package/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
  1109. package/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
  1110. package/node_modules/micromark/lib/initialize/flow.js +58 -0
  1111. package/node_modules/micromark/lib/initialize/text.d.ts +8 -0
  1112. package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
  1113. package/node_modules/micromark/lib/initialize/text.js +216 -0
  1114. package/node_modules/micromark/lib/parse.d.ts +10 -0
  1115. package/node_modules/micromark/lib/parse.d.ts.map +1 -0
  1116. package/node_modules/micromark/lib/parse.js +56 -0
  1117. package/node_modules/micromark/lib/postprocess.d.ts +9 -0
  1118. package/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
  1119. package/node_modules/micromark/lib/postprocess.js +18 -0
  1120. package/node_modules/micromark/lib/preprocess.d.ts +13 -0
  1121. package/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
  1122. package/node_modules/micromark/lib/preprocess.js +112 -0
  1123. package/node_modules/micromark/license +22 -0
  1124. package/node_modules/micromark/package.json +87 -0
  1125. package/node_modules/micromark/readme.md +488 -0
  1126. package/node_modules/micromark/stream.d.ts +35 -0
  1127. package/node_modules/micromark/stream.d.ts.map +1 -0
  1128. package/node_modules/micromark/stream.js +256 -0
  1129. package/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
  1130. package/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
  1131. package/node_modules/micromark-core-commonmark/dev/index.js +22 -0
  1132. package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
  1133. package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
  1134. package/node_modules/micromark-core-commonmark/dev/lib/attention.js +294 -0
  1135. package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
  1136. package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
  1137. package/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
  1138. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
  1139. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
  1140. package/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
  1141. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
  1142. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
  1143. package/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
  1144. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
  1145. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
  1146. package/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
  1147. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
  1148. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
  1149. package/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
  1150. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
  1151. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
  1152. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +472 -0
  1153. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
  1154. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
  1155. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +178 -0
  1156. package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
  1157. package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
  1158. package/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
  1159. package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
  1160. package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
  1161. package/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
  1162. package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
  1163. package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
  1164. package/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
  1165. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
  1166. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
  1167. package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
  1168. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
  1169. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
  1170. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +229 -0
  1171. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
  1172. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
  1173. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +938 -0
  1174. package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
  1175. package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
  1176. package/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
  1177. package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
  1178. package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
  1179. package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +658 -0
  1180. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
  1181. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
  1182. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +119 -0
  1183. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
  1184. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
  1185. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +71 -0
  1186. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
  1187. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
  1188. package/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
  1189. package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
  1190. package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
  1191. package/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
  1192. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
  1193. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  1194. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
  1195. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
  1196. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
  1197. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +213 -0
  1198. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
  1199. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
  1200. package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
  1201. package/node_modules/micromark-core-commonmark/index.d.ts +23 -0
  1202. package/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
  1203. package/node_modules/micromark-core-commonmark/index.js +22 -0
  1204. package/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
  1205. package/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
  1206. package/node_modules/micromark-core-commonmark/lib/attention.js +231 -0
  1207. package/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
  1208. package/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
  1209. package/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
  1210. package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
  1211. package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
  1212. package/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
  1213. package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
  1214. package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
  1215. package/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
  1216. package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
  1217. package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
  1218. package/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
  1219. package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
  1220. package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
  1221. package/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
  1222. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
  1223. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
  1224. package/node_modules/micromark-core-commonmark/lib/code-fenced.js +422 -0
  1225. package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
  1226. package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
  1227. package/node_modules/micromark-core-commonmark/lib/code-indented.js +159 -0
  1228. package/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
  1229. package/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
  1230. package/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
  1231. package/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
  1232. package/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
  1233. package/node_modules/micromark-core-commonmark/lib/content.js +163 -0
  1234. package/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
  1235. package/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
  1236. package/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
  1237. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
  1238. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
  1239. package/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
  1240. package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
  1241. package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
  1242. package/node_modules/micromark-core-commonmark/lib/heading-atx.js +191 -0
  1243. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
  1244. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
  1245. package/node_modules/micromark-core-commonmark/lib/html-flow.js +827 -0
  1246. package/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
  1247. package/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
  1248. package/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
  1249. package/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
  1250. package/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
  1251. package/node_modules/micromark-core-commonmark/lib/label-end.js +561 -0
  1252. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
  1253. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
  1254. package/node_modules/micromark-core-commonmark/lib/label-start-image.js +110 -0
  1255. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
  1256. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
  1257. package/node_modules/micromark-core-commonmark/lib/label-start-link.js +63 -0
  1258. package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
  1259. package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
  1260. package/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
  1261. package/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
  1262. package/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
  1263. package/node_modules/micromark-core-commonmark/lib/list.js +213 -0
  1264. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
  1265. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  1266. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
  1267. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
  1268. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
  1269. package/node_modules/micromark-core-commonmark/lib/setext-underline.js +187 -0
  1270. package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
  1271. package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
  1272. package/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
  1273. package/node_modules/micromark-core-commonmark/license +22 -0
  1274. package/node_modules/micromark-core-commonmark/package.json +62 -0
  1275. package/node_modules/micromark-core-commonmark/readme.md +171 -0
  1276. package/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
  1277. package/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
  1278. package/node_modules/micromark-factory-destination/dev/index.js +255 -0
  1279. package/node_modules/micromark-factory-destination/index.d.ts +42 -0
  1280. package/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
  1281. package/node_modules/micromark-factory-destination/index.js +206 -0
  1282. package/node_modules/micromark-factory-destination/license +22 -0
  1283. package/node_modules/micromark-factory-destination/package.json +57 -0
  1284. package/node_modules/micromark-factory-destination/readme.md +234 -0
  1285. package/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
  1286. package/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
  1287. package/node_modules/micromark-factory-label/dev/index.js +172 -0
  1288. package/node_modules/micromark-factory-label/index.d.ts +37 -0
  1289. package/node_modules/micromark-factory-label/index.d.ts.map +1 -0
  1290. package/node_modules/micromark-factory-label/index.js +148 -0
  1291. package/node_modules/micromark-factory-label/license +22 -0
  1292. package/node_modules/micromark-factory-label/package.json +60 -0
  1293. package/node_modules/micromark-factory-label/readme.md +224 -0
  1294. package/node_modules/micromark-factory-space/dev/index.d.ts +60 -0
  1295. package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
  1296. package/node_modules/micromark-factory-space/dev/index.js +122 -0
  1297. package/node_modules/micromark-factory-space/index.d.ts +60 -0
  1298. package/node_modules/micromark-factory-space/index.d.ts.map +1 -0
  1299. package/node_modules/micromark-factory-space/index.js +116 -0
  1300. package/node_modules/micromark-factory-space/license +22 -0
  1301. package/node_modules/micromark-factory-space/package.json +46 -0
  1302. package/node_modules/micromark-factory-space/readme.md +225 -0
  1303. package/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
  1304. package/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
  1305. package/node_modules/micromark-factory-title/dev/index.js +169 -0
  1306. package/node_modules/micromark-factory-title/index.d.ts +36 -0
  1307. package/node_modules/micromark-factory-title/index.d.ts.map +1 -0
  1308. package/node_modules/micromark-factory-title/index.js +158 -0
  1309. package/node_modules/micromark-factory-title/license +22 -0
  1310. package/node_modules/micromark-factory-title/package.json +58 -0
  1311. package/node_modules/micromark-factory-title/readme.md +229 -0
  1312. package/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
  1313. package/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
  1314. package/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
  1315. package/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
  1316. package/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
  1317. package/node_modules/micromark-factory-whitespace/index.js +44 -0
  1318. package/node_modules/micromark-factory-whitespace/license +22 -0
  1319. package/node_modules/micromark-factory-whitespace/package.json +57 -0
  1320. package/node_modules/micromark-factory-whitespace/readme.md +205 -0
  1321. package/node_modules/micromark-util-character/dev/index.d.ts +195 -0
  1322. package/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
  1323. package/node_modules/micromark-util-character/dev/index.js +252 -0
  1324. package/node_modules/micromark-util-character/index.d.ts +195 -0
  1325. package/node_modules/micromark-util-character/index.d.ts.map +1 -0
  1326. package/node_modules/micromark-util-character/index.js +246 -0
  1327. package/node_modules/micromark-util-character/license +22 -0
  1328. package/node_modules/micromark-util-character/package.json +57 -0
  1329. package/node_modules/micromark-util-character/readme.md +446 -0
  1330. package/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
  1331. package/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
  1332. package/node_modules/micromark-util-chunked/dev/index.js +89 -0
  1333. package/node_modules/micromark-util-chunked/index.d.ts +41 -0
  1334. package/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
  1335. package/node_modules/micromark-util-chunked/index.js +81 -0
  1336. package/node_modules/micromark-util-chunked/license +22 -0
  1337. package/node_modules/micromark-util-chunked/package.json +57 -0
  1338. package/node_modules/micromark-util-chunked/readme.md +219 -0
  1339. package/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
  1340. package/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
  1341. package/node_modules/micromark-util-classify-character/dev/index.js +38 -0
  1342. package/node_modules/micromark-util-classify-character/index.d.ts +18 -0
  1343. package/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
  1344. package/node_modules/micromark-util-classify-character/index.js +27 -0
  1345. package/node_modules/micromark-util-classify-character/license +22 -0
  1346. package/node_modules/micromark-util-classify-character/package.json +59 -0
  1347. package/node_modules/micromark-util-classify-character/readme.md +205 -0
  1348. package/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
  1349. package/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
  1350. package/node_modules/micromark-util-combine-extensions/index.js +143 -0
  1351. package/node_modules/micromark-util-combine-extensions/license +22 -0
  1352. package/node_modules/micromark-util-combine-extensions/package.json +52 -0
  1353. package/node_modules/micromark-util-combine-extensions/readme.md +201 -0
  1354. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
  1355. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
  1356. package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
  1357. package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
  1358. package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
  1359. package/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
  1360. package/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
  1361. package/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
  1362. package/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
  1363. package/node_modules/micromark-util-decode-string/dev/index.d.ts +14 -0
  1364. package/node_modules/micromark-util-decode-string/dev/index.d.ts.map +1 -0
  1365. package/node_modules/micromark-util-decode-string/dev/index.js +53 -0
  1366. package/node_modules/micromark-util-decode-string/index.d.ts +14 -0
  1367. package/node_modules/micromark-util-decode-string/index.d.ts.map +1 -0
  1368. package/node_modules/micromark-util-decode-string/index.js +45 -0
  1369. package/node_modules/micromark-util-decode-string/license +22 -0
  1370. package/node_modules/micromark-util-decode-string/package.json +63 -0
  1371. package/node_modules/micromark-util-decode-string/readme.md +179 -0
  1372. package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
  1373. package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
  1374. package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
  1375. package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
  1376. package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
  1377. package/node_modules/micromark-util-edit-map/index.js +225 -0
  1378. package/node_modules/micromark-util-edit-map/license +22 -0
  1379. package/node_modules/micromark-util-edit-map/package.json +48 -0
  1380. package/node_modules/micromark-util-edit-map/readme.md +234 -0
  1381. package/node_modules/micromark-util-encode/index.d.ts +14 -0
  1382. package/node_modules/micromark-util-encode/index.d.ts.map +1 -0
  1383. package/node_modules/micromark-util-encode/index.js +33 -0
  1384. package/node_modules/micromark-util-encode/license +22 -0
  1385. package/node_modules/micromark-util-encode/package.json +47 -0
  1386. package/node_modules/micromark-util-encode/readme.md +176 -0
  1387. package/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
  1388. package/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
  1389. package/node_modules/micromark-util-html-tag-name/index.js +93 -0
  1390. package/node_modules/micromark-util-html-tag-name/license +22 -0
  1391. package/node_modules/micromark-util-html-tag-name/package.json +47 -0
  1392. package/node_modules/micromark-util-html-tag-name/readme.md +193 -0
  1393. package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
  1394. package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
  1395. package/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
  1396. package/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
  1397. package/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
  1398. package/node_modules/micromark-util-normalize-identifier/index.js +33 -0
  1399. package/node_modules/micromark-util-normalize-identifier/license +22 -0
  1400. package/node_modules/micromark-util-normalize-identifier/package.json +58 -0
  1401. package/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
  1402. package/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
  1403. package/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
  1404. package/node_modules/micromark-util-resolve-all/index.js +32 -0
  1405. package/node_modules/micromark-util-resolve-all/license +22 -0
  1406. package/node_modules/micromark-util-resolve-all/package.json +48 -0
  1407. package/node_modules/micromark-util-resolve-all/readme.md +238 -0
  1408. package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
  1409. package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
  1410. package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
  1411. package/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
  1412. package/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
  1413. package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
  1414. package/node_modules/micromark-util-sanitize-uri/license +22 -0
  1415. package/node_modules/micromark-util-sanitize-uri/package.json +59 -0
  1416. package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
  1417. package/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
  1418. package/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
  1419. package/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
  1420. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
  1421. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
  1422. package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
  1423. package/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
  1424. package/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
  1425. package/node_modules/micromark-util-subtokenize/index.js +228 -0
  1426. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
  1427. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
  1428. package/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
  1429. package/node_modules/micromark-util-subtokenize/license +22 -0
  1430. package/node_modules/micromark-util-subtokenize/package.json +60 -0
  1431. package/node_modules/micromark-util-subtokenize/readme.md +181 -0
  1432. package/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
  1433. package/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
  1434. package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
  1435. package/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
  1436. package/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
  1437. package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
  1438. package/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
  1439. package/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
  1440. package/node_modules/micromark-util-symbol/lib/default.js +4 -0
  1441. package/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
  1442. package/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
  1443. package/node_modules/micromark-util-symbol/lib/types.js +453 -0
  1444. package/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
  1445. package/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
  1446. package/node_modules/micromark-util-symbol/lib/values.js +109 -0
  1447. package/node_modules/micromark-util-symbol/license +22 -0
  1448. package/node_modules/micromark-util-symbol/package.json +43 -0
  1449. package/node_modules/micromark-util-symbol/readme.md +168 -0
  1450. package/node_modules/micromark-util-types/index.d.ts +1315 -0
  1451. package/node_modules/micromark-util-types/index.js +2 -0
  1452. package/node_modules/micromark-util-types/license +22 -0
  1453. package/node_modules/micromark-util-types/package.json +37 -0
  1454. package/node_modules/micromark-util-types/readme.md +151 -0
  1455. package/node_modules/ms/index.js +162 -0
  1456. package/node_modules/ms/license.md +21 -0
  1457. package/node_modules/ms/package.json +38 -0
  1458. package/node_modules/ms/readme.md +59 -0
  1459. package/node_modules/require-from-string/index.js +34 -0
  1460. package/node_modules/require-from-string/license +21 -0
  1461. package/node_modules/require-from-string/package.json +28 -0
  1462. package/node_modules/require-from-string/readme.md +56 -0
  1463. package/node_modules/unist-util-stringify-position/index.d.ts +1 -0
  1464. package/node_modules/unist-util-stringify-position/index.js +1 -0
  1465. package/node_modules/unist-util-stringify-position/lib/index.d.ts +61 -0
  1466. package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
  1467. package/node_modules/unist-util-stringify-position/license +22 -0
  1468. package/node_modules/unist-util-stringify-position/package.json +80 -0
  1469. package/node_modules/unist-util-stringify-position/readme.md +206 -0
  1470. package/node_modules/ws/LICENSE +20 -0
  1471. package/node_modules/ws/README.md +548 -0
  1472. package/node_modules/ws/browser.js +8 -0
  1473. package/node_modules/ws/index.js +22 -0
  1474. package/node_modules/ws/lib/buffer-util.js +131 -0
  1475. package/node_modules/ws/lib/constants.js +19 -0
  1476. package/node_modules/ws/lib/event-target.js +292 -0
  1477. package/node_modules/ws/lib/extension.js +203 -0
  1478. package/node_modules/ws/lib/limiter.js +55 -0
  1479. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  1480. package/node_modules/ws/lib/receiver.js +743 -0
  1481. package/node_modules/ws/lib/sender.js +607 -0
  1482. package/node_modules/ws/lib/stream.js +161 -0
  1483. package/node_modules/ws/lib/subprotocol.js +62 -0
  1484. package/node_modules/ws/lib/validation.js +152 -0
  1485. package/node_modules/ws/lib/websocket-server.js +562 -0
  1486. package/node_modules/ws/lib/websocket.js +1407 -0
  1487. package/node_modules/ws/package.json +74 -0
  1488. package/node_modules/ws/wrapper.mjs +21 -0
  1489. package/node_modules/yaml/LICENSE +13 -0
  1490. package/node_modules/yaml/README.md +172 -0
  1491. package/node_modules/yaml/bin.mjs +11 -0
  1492. package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  1493. package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  1494. package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  1495. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  1496. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  1497. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  1498. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  1499. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  1500. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  1501. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  1502. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +226 -0
  1503. package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  1504. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  1505. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  1506. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  1507. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  1508. package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  1509. package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  1510. package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  1511. package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  1512. package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  1513. package/node_modules/yaml/browser/dist/errors.js +57 -0
  1514. package/node_modules/yaml/browser/dist/index.js +17 -0
  1515. package/node_modules/yaml/browser/dist/log.js +11 -0
  1516. package/node_modules/yaml/browser/dist/nodes/Alias.js +118 -0
  1517. package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  1518. package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  1519. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  1520. package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  1521. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  1522. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  1523. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  1524. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  1525. package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  1526. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  1527. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  1528. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  1529. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  1530. package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  1531. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  1532. package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  1533. package/node_modules/yaml/browser/dist/public-api.js +102 -0
  1534. package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  1535. package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  1536. package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  1537. package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  1538. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  1539. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  1540. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  1541. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  1542. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  1543. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  1544. package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  1545. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  1546. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  1547. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  1548. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  1549. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  1550. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  1551. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  1552. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  1553. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  1554. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  1555. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  1556. package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  1557. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  1558. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  1559. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  1560. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  1561. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  1562. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  1563. package/node_modules/yaml/browser/dist/util.js +11 -0
  1564. package/node_modules/yaml/browser/dist/visit.js +233 -0
  1565. package/node_modules/yaml/browser/index.js +5 -0
  1566. package/node_modules/yaml/browser/package.json +3 -0
  1567. package/node_modules/yaml/dist/cli.d.ts +8 -0
  1568. package/node_modules/yaml/dist/cli.mjs +201 -0
  1569. package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  1570. package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  1571. package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  1572. package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  1573. package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  1574. package/node_modules/yaml/dist/compose/compose-node.js +112 -0
  1575. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  1576. package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  1577. package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  1578. package/node_modules/yaml/dist/compose/composer.js +224 -0
  1579. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  1580. package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  1581. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  1582. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  1583. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  1584. package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  1585. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  1586. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  1587. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  1588. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  1589. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  1590. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +228 -0
  1591. package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  1592. package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  1593. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  1594. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  1595. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  1596. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  1597. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  1598. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  1599. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  1600. package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  1601. package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  1602. package/node_modules/yaml/dist/doc/Document.js +337 -0
  1603. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  1604. package/node_modules/yaml/dist/doc/anchors.js +76 -0
  1605. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  1606. package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  1607. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  1608. package/node_modules/yaml/dist/doc/createNode.js +90 -0
  1609. package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  1610. package/node_modules/yaml/dist/doc/directives.js +178 -0
  1611. package/node_modules/yaml/dist/errors.d.ts +21 -0
  1612. package/node_modules/yaml/dist/errors.js +62 -0
  1613. package/node_modules/yaml/dist/index.d.ts +25 -0
  1614. package/node_modules/yaml/dist/index.js +50 -0
  1615. package/node_modules/yaml/dist/log.d.ts +3 -0
  1616. package/node_modules/yaml/dist/log.js +19 -0
  1617. package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  1618. package/node_modules/yaml/dist/nodes/Alias.js +120 -0
  1619. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  1620. package/node_modules/yaml/dist/nodes/Collection.js +151 -0
  1621. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  1622. package/node_modules/yaml/dist/nodes/Node.js +40 -0
  1623. package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  1624. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  1625. package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  1626. package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  1627. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  1628. package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  1629. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  1630. package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  1631. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  1632. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  1633. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  1634. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  1635. package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  1636. package/node_modules/yaml/dist/nodes/toJS.js +39 -0
  1637. package/node_modules/yaml/dist/options.d.ts +350 -0
  1638. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  1639. package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  1640. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  1641. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  1642. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  1643. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  1644. package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  1645. package/node_modules/yaml/dist/parse/cst.js +112 -0
  1646. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  1647. package/node_modules/yaml/dist/parse/lexer.js +723 -0
  1648. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  1649. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  1650. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  1651. package/node_modules/yaml/dist/parse/parser.js +980 -0
  1652. package/node_modules/yaml/dist/public-api.d.ts +44 -0
  1653. package/node_modules/yaml/dist/public-api.js +107 -0
  1654. package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  1655. package/node_modules/yaml/dist/schema/Schema.js +39 -0
  1656. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  1657. package/node_modules/yaml/dist/schema/common/map.js +19 -0
  1658. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  1659. package/node_modules/yaml/dist/schema/common/null.js +17 -0
  1660. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  1661. package/node_modules/yaml/dist/schema/common/seq.js +19 -0
  1662. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  1663. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  1664. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  1665. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  1666. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  1667. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  1668. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  1669. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  1670. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  1671. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  1672. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  1673. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  1674. package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  1675. package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  1676. package/node_modules/yaml/dist/schema/tags.js +99 -0
  1677. package/node_modules/yaml/dist/schema/types.d.ts +92 -0
  1678. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  1679. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  1680. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  1681. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  1682. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  1683. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  1684. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  1685. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  1686. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  1687. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  1688. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  1689. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  1690. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  1691. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  1692. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  1693. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  1694. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  1695. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  1696. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  1697. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  1698. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  1699. package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  1700. package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  1701. package/node_modules/yaml/dist/stringify/stringify.js +132 -0
  1702. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  1703. package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  1704. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  1705. package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  1706. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  1707. package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  1708. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  1709. package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  1710. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  1711. package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  1712. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  1713. package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  1714. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  1715. package/node_modules/yaml/dist/test-events.js +134 -0
  1716. package/node_modules/yaml/dist/util.d.ts +16 -0
  1717. package/node_modules/yaml/dist/util.js +28 -0
  1718. package/node_modules/yaml/dist/visit.d.ts +102 -0
  1719. package/node_modules/yaml/dist/visit.js +236 -0
  1720. package/node_modules/yaml/package.json +97 -0
  1721. package/node_modules/yaml/util.js +2 -0
  1722. package/package.json +183 -4
  1723. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +395 -0
  1724. package/packages/octo-runtime-extra-channel-wecom/config-schema.json +276 -0
  1725. package/packages/octo-runtime-extra-webui/config-schema.json +134 -0
@@ -0,0 +1,2334 @@
1
+ import { actmodeEvidence, invocationEnvs, mapReasoningEffort } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
+ import { canonicalTerminalStatus, classifyFailure, contextHash, contextActmode, assertJsonByteLimit, INVOKE_REQUEST_MAX_BYTES, hasImageInput, providerInputParts, PROVIDER_DIAGNOSTIC_MAX_BYTES } from "@mininglamp-oss/octo-runtime-protocol";
3
+ import { codexEnvironmentConfig } from "./environment.js";
4
+ import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
5
+ /**
6
+ * Codex app-server transport and event adaptation layer.
7
+ *
8
+ * Unlike the one-way NDJSON of `codex exec --json`, the app-server uses
9
+ * bidirectional JSON-RPC 2.0 over stdin/stdout: Octo Runtime both sends
10
+ * initialize/thread/turn requests and must respond to approval/elicitation
11
+ * requests that Codex sends back. That is why this does not reuse the generic
12
+ * JSON CLI helper, but instead maintains a request pending map, notification
13
+ * parser, cancellation and process-reaping state.
14
+ *
15
+ * This module upholds four key invariants:
16
+ * - the provider session becomes visible to the Core only after turn/start
17
+ * succeeds;
18
+ * - each invocation publishes at most one run.* terminal;
19
+ * - only notifications for the current active thread are consumed, avoiding
20
+ * crosstalk;
21
+ * - all pending RPCs and subprocess resources eventually converge via
22
+ * close()/finally.
23
+ */
24
+ import { sanitizePublicValue, DriverQueue, watchLineLimit } from "@mininglamp-oss/octo-runtime-adapter-sdk";
25
+ import { protocolError } from "@mininglamp-oss/octo-runtime-protocol";
26
+ import { spawn } from "node:child_process";
27
+ import { createHash } from "node:crypto";
28
+ import { createInterface } from "node:readline";
29
+ const APP_SERVER_REQUEST_TIMEOUT_MS = 30_000;
30
+ // R06b:EOF 宽限 250 ms + 共享 TERM/KILL 确认 600 ms,位于默认 Host 1 秒预算内。
31
+ const APP_SERVER_CLOSE_GRACE_MS = 250;
32
+ const FINALIZATION_TIMEOUT_MS = 15_000;
33
+ const FINALIZATION_INTERRUPT_GRACE_MS = 2_000;
34
+ // Keep only the tail of stderr, balancing error diagnosability against the memory ceiling of a long-lived process.
35
+ const STDERR_TAIL_LIMIT = 64 * 1024;
36
+ /** A JSON-RPC error the app-server explicitly returned, preserving method, code and raw data. */
37
+ export class CodexAppServerRpcError extends Error {
38
+ method;
39
+ code;
40
+ data;
41
+ constructor(method, code, message, data) {
42
+ super(`${method}: ${message}`);
43
+ this.method = method;
44
+ this.code = code;
45
+ this.data = data;
46
+ this.name = "CodexAppServerRpcError";
47
+ }
48
+ }
49
+ /** Error for when the subprocess exits without producing a run terminal, preserving exit code/signal. */
50
+ export class CodexAppServerProcessError extends Error {
51
+ exit;
52
+ constructor(message, exit) {
53
+ super(message);
54
+ this.exit = exit;
55
+ this.name = "CodexAppServerProcessError";
56
+ }
57
+ }
58
+ /** Production always uses the stdio transport; other injected args are only for a test server. */
59
+ export function buildCodexAppServerArgs() {
60
+ return ["app-server", "--listen", "stdio://"];
61
+ }
62
+ /**
63
+ * Execute one Octo Runtime invocation and convert the native Codex event stream
64
+ * into CanonicalEvents.
65
+ *
66
+ * This is the top-level protocol state machine: initialize -> thread
67
+ * resume/start -> turn/start -> stream. The function itself drives "phase
68
+ * advancement" and resume fallback; CodexAppServerClient owns wire I/O and
69
+ * normalizeCodexEvent handles the pure per-notification conversion.
70
+ */
71
+ export async function* runCodexAppServerTurn({ request, spec, spawnFn = defaultSpawn, context, onInteractionResponder, onNativeResponder }) {
72
+ const requestTimeoutMs = appServerRequestTimeout(request);
73
+ const interactive = request.approvalMode !== "full_access";
74
+ let client = new CodexAppServerClient(spec, spawnFn, requestTimeoutMs, interactive, request, context);
75
+ onInteractionResponder?.((response) => client.respondInteraction(response));
76
+ onNativeResponder?.((response) => client.respondNative(response));
77
+ let terminal = false;
78
+ let executionFailure;
79
+ try {
80
+ throwIfAborted(request.signal);
81
+ // Phase 1: negotiate the experimental app-server API first; no thread request is sent until initialize completes.
82
+ try {
83
+ await initializeClient(client);
84
+ }
85
+ catch (error) {
86
+ if (!isInitializeTimeout(error) || request.signal?.aborted)
87
+ throw error;
88
+ onInteractionResponder?.(undefined);
89
+ await client.close();
90
+ throwIfAborted(request.signal);
91
+ client = new CodexAppServerClient(spec, spawnFn, requestTimeoutMs, interactive, request, context);
92
+ onInteractionResponder?.((response) => client.respondInteraction(response));
93
+ onNativeResponder?.((response) => client.respondNative(response));
94
+ await initializeClient(client);
95
+ }
96
+ client.notify("initialized");
97
+ let environmentConfig;
98
+ if (Object.keys(invocationEnvs(request)).length || spec.mcpServers) {
99
+ const result = recordValue(await client.request("config/read", { includeLayers: false, cwd: request.workdir }));
100
+ const config = recordValue(result?.config);
101
+ if (!config)
102
+ throw new Error("CONTEXT_ENVS_UNAVAILABLE: provider effective configuration is missing");
103
+ const nativeServers = recordValue(config.mcp_servers) ?? {};
104
+ for (const name of Object.keys(spec.mcpServers ?? {})) {
105
+ if (Object.hasOwn(nativeServers, name))
106
+ throw Object.assign(new Error(`MCP_SERVER_NAME_CONFLICT: ${name}`), {
107
+ code: "MCP_SERVER_NAME_CONFLICT"
108
+ });
109
+ }
110
+ environmentConfig = codexEnvironmentConfig(request, {
111
+ ...config,
112
+ mcp_servers: { ...nativeServers, ...spec.mcpServers }
113
+ });
114
+ if (spec.mcpServers) {
115
+ const forwarding = recordValue(environmentConfig.mcp_servers) ?? {};
116
+ // config/read is a read model: optional nulls cannot be round-tripped as overrides.
117
+ environmentConfig.mcp_servers = {
118
+ ...forwarding,
119
+ ...Object.fromEntries(Object.entries(spec.mcpServers).map(([name, server]) => [
120
+ name,
121
+ { ...server, ...recordValue(forwarding[name]) }
122
+ ]))
123
+ };
124
+ }
125
+ }
126
+ // Phase 2: providerSession.sessionId is the Codex thread ID, kept opaque to the Core.
127
+ const requestedSessionId = request.providerSession?.sessionId;
128
+ let resumeFallback;
129
+ let resumed = false;
130
+ let threadResult;
131
+ if (requestedSessionId) {
132
+ try {
133
+ threadResult = await client.request("thread/resume", threadParams(request, {
134
+ threadId: requestedSessionId,
135
+ ...(context?.protocolMode !== "native" ? { excludeTurns: true } : {})
136
+ }, environmentConfig));
137
+ resumed = true;
138
+ }
139
+ catch (error) {
140
+ // A failed resume does not abort this turn; record a low-cardinality reason and fall back to a fresh thread.
141
+ resumeFallback = rpcFailureReason(error);
142
+ }
143
+ }
144
+ if (!threadResult) {
145
+ threadResult = await client.request("thread/start", threadParams(request, { sessionStartSource: "startup" }, environmentConfig));
146
+ }
147
+ let threadId = extractThreadId(threadResult);
148
+ if (!threadId)
149
+ throw new Error("codex thread start/resume returned no thread id");
150
+ client.setActiveThread(threadId);
151
+ const requestedMode = contextActmode(request.context);
152
+ let collaborationMode;
153
+ let effectiveMode;
154
+ if (requestedMode !== undefined) {
155
+ const modes = recordValue(await client.request("collaborationMode/list", {}));
156
+ const available = Array.isArray(modes?.data) ? modes.data.map(recordValue) : [];
157
+ effectiveMode = available.some((mode) => mode?.mode === requestedMode)
158
+ ? requestedMode
159
+ : "default";
160
+ if (!available.some((mode) => mode?.mode === effectiveMode))
161
+ throw new Error("ACTMODE_UNSUPPORTED: Codex did not advertise a default collaboration mode");
162
+ const thread = recordValue(threadResult);
163
+ const model = request.agentConfig.model ?? stringValue(thread?.model);
164
+ if (!model)
165
+ throw new Error("ACTMODE_UNCONFIRMED: Codex omitted its effective model");
166
+ collaborationMode = {
167
+ mode: effectiveMode,
168
+ settings: {
169
+ model,
170
+ reasoning_effort: mapReasoningEffort("codex", request.agentConfig.effort) ??
171
+ thread?.reasoningEffort ??
172
+ null,
173
+ developer_instructions: null
174
+ }
175
+ };
176
+ }
177
+ let turnResult;
178
+ try {
179
+ turnResult = await client.request("turn/start", {
180
+ ...turnParams(request, threadId, resumeFallback !== undefined),
181
+ ...(collaborationMode ? { collaborationMode } : {})
182
+ });
183
+ }
184
+ catch (error) {
185
+ // Some corrupt sessions pass thread/resume but only reveal the missing rollout at turn/start.
186
+ if (!resumed || !isThreadNotFound(error))
187
+ throw error;
188
+ resumeFallback = "turn_start_thread_not_found";
189
+ resumed = false;
190
+ threadResult = await client.request("thread/start", threadParams(request, { sessionStartSource: "startup" }, environmentConfig));
191
+ threadId = extractThreadId(threadResult);
192
+ if (!threadId) {
193
+ throw new Error("codex fresh fallback returned no thread id", { cause: error });
194
+ }
195
+ client.setActiveThread(threadId);
196
+ turnResult = await client.request("turn/start", {
197
+ ...turnParams(request, threadId, true),
198
+ ...(collaborationMode ? { collaborationMode } : {})
199
+ });
200
+ }
201
+ const turnId = extractTurnId(turnResult);
202
+ if (turnId)
203
+ client.setActiveTurn(turnId);
204
+ context?.reportActivity?.({ kind: "turn_started", method: "turn_start" });
205
+ if (requestedMode !== undefined && effectiveMode !== undefined)
206
+ yield actmodeEvidence({
207
+ requested: requestedMode,
208
+ effective: effectiveMode,
209
+ status: effectiveMode === requestedMode ? "applied" : "fallback",
210
+ nativeMode: effectiveMode,
211
+ ...(effectiveMode !== requestedMode ? { reason: "provider_unsupported" } : {})
212
+ }, context?.protocolMode);
213
+ // Must come after turn/start: otherwise the Core would persist a provider session that cannot be executed.
214
+ const session = {
215
+ protocolVersion: 2,
216
+ type: "session.update",
217
+ payload: {
218
+ providerSession: {
219
+ sessionId: threadId,
220
+ resumable: true,
221
+ ...(resumed ? { resumeOutcome: "resumed" } : {}),
222
+ ...(resumeFallback
223
+ ? {
224
+ resumeOutcome: "fresh_fallback",
225
+ resumeFallback,
226
+ contextInputVariant: request.freshFallbackModelInputParts || request.freshFallbackModelInput
227
+ ? "recovery"
228
+ : "primary"
229
+ }
230
+ : {})
231
+ }
232
+ }
233
+ };
234
+ yield context?.protocolMode === "native"
235
+ ? {
236
+ kind: "control",
237
+ control: { type: "evidence", name: "session", payload: session.payload }
238
+ }
239
+ : session;
240
+ for await (const event of client.events()) {
241
+ if ("kind" in event) {
242
+ terminal ||=
243
+ event.kind === "control" &&
244
+ event.control.type === "state" &&
245
+ event.control.state !== "running";
246
+ yield event;
247
+ if (terminal)
248
+ break;
249
+ continue;
250
+ }
251
+ // The thread RPC response already produced the authoritative initial
252
+ // update. Later lifecycle outcomes (such as compaction) must pass through.
253
+ if (event.type === "session.update" &&
254
+ event.payload.providerSession?.sessionId === threadId &&
255
+ event.payload.providerSession.resumeOutcome === undefined) {
256
+ continue;
257
+ }
258
+ terminal ||= isTerminalEvent(event);
259
+ yield event;
260
+ if (terminal)
261
+ break;
262
+ }
263
+ if (!terminal) {
264
+ // Ending without a terminal in the queue is a protocol/process anomaly and must not be disguised as success.
265
+ const exit = await client.exit();
266
+ throw new CodexAppServerProcessError(client.processErrorMessage(exit), exit);
267
+ }
268
+ }
269
+ catch (error) {
270
+ executionFailure = error;
271
+ if (context?.protocolMode === "native") {
272
+ yield* client.bufferedEvents();
273
+ throw error;
274
+ }
275
+ if (!terminal) {
276
+ // AbortSignal takes priority in deciding cancelled semantics; all other errors project uniformly to provider run.failed.
277
+ if (request.signal?.aborted) {
278
+ yield {
279
+ protocolVersion: 2,
280
+ type: "run.cancelled",
281
+ payload: { reason: String(request.signal.reason ?? "cancelled") }
282
+ };
283
+ }
284
+ else {
285
+ const code = stringErrorCode(error);
286
+ yield {
287
+ protocolVersion: 2,
288
+ type: "run.failed",
289
+ payload: {
290
+ message: client.errorMessage(error),
291
+ adapterType: "codex",
292
+ ...(code ? { code } : {}),
293
+ ...(error instanceof CodexAppServerRpcError
294
+ ? {
295
+ error: {
296
+ code: error.code,
297
+ message: error.message,
298
+ ...(error.data === undefined ? {} : { data: error.data })
299
+ }
300
+ }
301
+ : {}),
302
+ ...(code === "RPC_TIMEOUT"
303
+ ? {
304
+ timeoutStage: "rpc",
305
+ timeoutReason: "rpc_timeout",
306
+ timeoutMs: requestTimeoutMs
307
+ }
308
+ : {})
309
+ }
310
+ };
311
+ }
312
+ }
313
+ }
314
+ finally {
315
+ // close() handles RPC/stdio/process; spec.cleanup handles any caller-owned resources.
316
+ onInteractionResponder?.(undefined);
317
+ onNativeResponder?.(undefined);
318
+ await closeClientAndResources(client, spec, executionFailure);
319
+ }
320
+ }
321
+ async function closeClientAndResources(client, spec, executionFailure) {
322
+ try {
323
+ await client.close();
324
+ }
325
+ catch (cleanupError) {
326
+ // R06b:清理失败不能覆盖原始执行失败,也不能阻止调用方资源释放。
327
+ if (executionFailure !== undefined)
328
+ throw new AggregateError([executionFailure, cleanupError], "Codex execution and process cleanup failed", { cause: cleanupError });
329
+ throw cleanupError;
330
+ }
331
+ finally {
332
+ await spec.cleanup?.();
333
+ }
334
+ }
335
+ function initializeClient(client) {
336
+ return client.request("initialize", {
337
+ clientInfo: {
338
+ name: "@mininglamp-oss/octo-runtime-adapter-codex",
339
+ version: "0.1.0"
340
+ },
341
+ capabilities: {
342
+ experimentalApi: true,
343
+ requestAttestation: false,
344
+ optOutNotificationMethods: ["mcpServer/startupStatus/updated", "remoteControl/status/changed"]
345
+ }
346
+ });
347
+ }
348
+ function isInitializeTimeout(error) {
349
+ return (error instanceof Error &&
350
+ /^codex app-server initialize timed out after \d+ms$/.test(error.message));
351
+ }
352
+ function stringErrorCode(error) {
353
+ return error !== null &&
354
+ typeof error === "object" &&
355
+ "code" in error &&
356
+ typeof error.code === "string"
357
+ ? error.code
358
+ : undefined;
359
+ }
360
+ /**
361
+ * Purely map one app-server notification into zero or more canonical events.
362
+ *
363
+ * The convenience function maps one isolated notification. Live invocations use
364
+ * CodexEventNormalizer below so related reasoning, tool, and answer items share a
365
+ * stable model-step id across notification boundaries.
366
+ */
367
+ export function normalizeCodexEvent(native) {
368
+ return new CodexEventNormalizer().normalize(native);
369
+ }
370
+ /**
371
+ * Reconstruct Codex model rounds from its item stream.
372
+ *
373
+ * Codex does not publish OpenCode-style step_start/step_finish frames. A model
374
+ * round therefore starts with the first reasoning/plan/answer item after a tool
375
+ * batch and finishes when that model response requests tools or completes its
376
+ * answer. Consecutive tool items share the same round.
377
+ */
378
+ export class CodexEventNormalizer {
379
+ #turnId;
380
+ #round = 0;
381
+ #planRevision = 0;
382
+ #noticeNumber = 0;
383
+ #attempt = 1;
384
+ #diagnosticReported = false;
385
+ #activeStepId;
386
+ #toolBatchStepId;
387
+ #itemSteps = new Map();
388
+ #itemChannels = new Map();
389
+ normalize(native) {
390
+ const params = native.params ?? {};
391
+ switch (native.method) {
392
+ case "turn/plan/updated": {
393
+ const plan = Array.isArray(params.plan) ? params.plan : [];
394
+ return [
395
+ {
396
+ protocolVersion: 2,
397
+ type: "plan.updated",
398
+ payload: {
399
+ planId: "codex:plan",
400
+ revision: ++this.#planRevision,
401
+ explanation: typeof params.explanation === "string" ? params.explanation.slice(0, 4096) : null,
402
+ steps: plan.slice(0, 200).map((value) => {
403
+ const step = recordValue(value) ?? {};
404
+ const status = step.status === "inProgress"
405
+ ? "in_progress"
406
+ : step.status === "completed"
407
+ ? "completed"
408
+ : "pending";
409
+ return {
410
+ text: typeof step.step === "string" ? step.step.slice(0, 4096) : "",
411
+ status
412
+ };
413
+ })
414
+ }
415
+ }
416
+ ];
417
+ }
418
+ case "item/mcpToolCall/progress": {
419
+ const id = itemId(params);
420
+ return id && typeof params.message === "string"
421
+ ? [
422
+ {
423
+ protocolVersion: 2,
424
+ type: "tool_call.progress",
425
+ payload: { id, progress: { message: params.message.slice(0, 4096) } }
426
+ }
427
+ ]
428
+ : [];
429
+ }
430
+ case "model/rerouted":
431
+ return typeof params.fromModel === "string" && typeof params.toModel === "string"
432
+ ? [
433
+ {
434
+ protocolVersion: 2,
435
+ type: "run.notice",
436
+ payload: {
437
+ noticeId: `codex:notice:${++this.#noticeNumber}`,
438
+ code: "model_rerouted",
439
+ severity: "info",
440
+ params: {
441
+ fromModel: params.fromModel.slice(0, 191),
442
+ toModel: params.toModel.slice(0, 191)
443
+ }
444
+ }
445
+ }
446
+ ]
447
+ : [];
448
+ case "thread/started": {
449
+ const threadId = stringValue(params.threadId) ||
450
+ stringValue(recordValue(params.thread)?.id) ||
451
+ stringValue(recordValue(params.thread)?.sessionId);
452
+ return threadId
453
+ ? [
454
+ {
455
+ protocolVersion: 2,
456
+ type: "session.update",
457
+ payload: { providerSession: { sessionId: threadId, resumable: true } }
458
+ }
459
+ ]
460
+ : [];
461
+ }
462
+ case "thread/compacted": {
463
+ const threadId = stringValue(params.threadId) ||
464
+ stringValue(recordValue(params.thread)?.id) ||
465
+ stringValue(recordValue(params.thread)?.sessionId);
466
+ return threadId
467
+ ? [
468
+ {
469
+ protocolVersion: 2,
470
+ type: "run.notice",
471
+ payload: {
472
+ noticeId: `codex:notice:${++this.#noticeNumber}`,
473
+ code: "context_compacted",
474
+ severity: "info",
475
+ params: {}
476
+ }
477
+ },
478
+ {
479
+ protocolVersion: 2,
480
+ type: "session.update",
481
+ payload: {
482
+ providerSession: {
483
+ sessionId: threadId,
484
+ resumable: true,
485
+ resumeOutcome: "compacted"
486
+ }
487
+ }
488
+ }
489
+ ]
490
+ : [];
491
+ }
492
+ case "turn/started":
493
+ this.#beginTurn(params);
494
+ return [];
495
+ case "item/agentMessage/delta":
496
+ return textDelta(params, this.#channelFor(params), undefined, undefined, this.#stepFor(params));
497
+ case "item/reasoning/summaryTextDelta":
498
+ return textDelta(params, "analysis", "public_summary", "item/reasoning/summaryTextDelta", this.#stepFor(params));
499
+ case "item/reasoning/textDelta":
500
+ return textDelta(params, "analysis", "private_reasoning", "item/reasoning/textDelta", this.#stepFor(params));
501
+ case "item/plan/delta":
502
+ return textDelta(params, "analysis", "public_plan", "item/plan/delta", this.#stepFor(params));
503
+ case "item/commandExecution/outputDelta":
504
+ case "item/fileChange/outputDelta": {
505
+ const id = itemId(params);
506
+ const delta = stringValue(params.delta);
507
+ const stepId = this.#stepFor(params);
508
+ return id && delta
509
+ ? [
510
+ {
511
+ protocolVersion: 2,
512
+ type: "tool_call.delta",
513
+ payload: { id, outputDelta: delta, ...(stepId ? { stepId } : {}) }
514
+ }
515
+ ]
516
+ : [];
517
+ }
518
+ case "thread/tokenUsage/updated":
519
+ return usageEvents(params);
520
+ case "item/started":
521
+ return this.#itemStarted(params);
522
+ case "item/completed":
523
+ return this.#itemCompleted(params);
524
+ case "turn/completed":
525
+ return [
526
+ ...this.#finishActiveStep(turnStepStatus(recordValue(params.turn)), "stop"),
527
+ ...turnCompletedEvents(recordValue(params.turn))
528
+ ];
529
+ case "error": {
530
+ if (params.willRetry === true)
531
+ return [
532
+ {
533
+ protocolVersion: 2,
534
+ type: "run.notice",
535
+ payload: {
536
+ noticeId: `codex:notice:${++this.#noticeNumber}`,
537
+ code: "retry_scheduled",
538
+ severity: "warning",
539
+ params: { attempt: (this.#attempt = Math.min(this.#attempt + 1, 65535)) }
540
+ }
541
+ }
542
+ ];
543
+ // ErrorNotification is an in-turn diagnostic. Codex may still recover
544
+ // after a failed tool and emit more items; turn/completed is the only
545
+ // authoritative turn terminal.
546
+ const finished = this.#finishActiveStep("failed", "error");
547
+ if (this.#diagnosticReported)
548
+ return finished;
549
+ this.#diagnosticReported = true;
550
+ const error = recordValue(params.error);
551
+ // 分类只使用 Provider 结构化证据;文本仅经脱敏后供业务展示。
552
+ const failure = classifyFailure(codexFailureDetails(error), {
553
+ stage: "provider.invoke",
554
+ defaultDomain: "provider",
555
+ source: { component: "octo-runtime", adapter: "codex" }
556
+ });
557
+ const safeMessage = String(sanitizePublicValue((stringValue(error?.message) || stringValue(params.message)).trim() ||
558
+ "Codex reported an in-turn error"));
559
+ let message = "";
560
+ let bytes = 0;
561
+ for (const character of safeMessage) {
562
+ const size = Buffer.byteLength(character);
563
+ if (bytes + size > PROVIDER_DIAGNOSTIC_MAX_BYTES)
564
+ break;
565
+ message += character;
566
+ bytes += size;
567
+ }
568
+ return [
569
+ ...finished,
570
+ {
571
+ protocolVersion: 2,
572
+ type: "run.notice",
573
+ payload: {
574
+ noticeId: `codex:notice:${++this.#noticeNumber}`,
575
+ code: "provider_diagnostic",
576
+ severity: "warning",
577
+ params: {
578
+ adapter: "codex",
579
+ diagnosticId: failure.diagnosticId,
580
+ category: failure.category,
581
+ message
582
+ }
583
+ }
584
+ }
585
+ ];
586
+ }
587
+ default: {
588
+ if (isToolArgsDeltaMethod(native.method)) {
589
+ const id = itemId(params);
590
+ const delta = stringValue(params.delta);
591
+ const stepId = this.#stepFor(params);
592
+ return id && delta
593
+ ? [
594
+ {
595
+ protocolVersion: 2,
596
+ type: "tool_call.delta",
597
+ payload: { id, argsDelta: delta, ...(stepId ? { stepId } : {}) }
598
+ }
599
+ ]
600
+ : [];
601
+ }
602
+ return [];
603
+ }
604
+ }
605
+ }
606
+ #beginTurn(params) {
607
+ const turnId = notificationTurnId(params);
608
+ if (!turnId || turnId === this.#turnId)
609
+ return;
610
+ this.#turnId = turnId;
611
+ this.#round = 0;
612
+ this.#activeStepId = undefined;
613
+ this.#toolBatchStepId = undefined;
614
+ this.#itemSteps.clear();
615
+ this.#itemChannels.clear();
616
+ }
617
+ #itemStarted(params) {
618
+ const item = recordValue(params.item);
619
+ if (!item)
620
+ return [];
621
+ const id = stringValue(item.id);
622
+ const tool = toolDescriptor(item);
623
+ if (tool) {
624
+ const prefix = [];
625
+ let stepId = this.#toolBatchStepId;
626
+ if (!stepId) {
627
+ const started = this.#ensureActiveStep(params);
628
+ prefix.push(...started.events);
629
+ stepId = started.stepId;
630
+ }
631
+ if (id && stepId)
632
+ this.#itemSteps.set(id, stepId);
633
+ const events = itemStartedEvents(item, stepId);
634
+ if (this.#activeStepId === stepId) {
635
+ this.#toolBatchStepId = stepId;
636
+ events.push(...this.#finishActiveStep("completed", "tool-calls"));
637
+ }
638
+ return [...prefix, ...events];
639
+ }
640
+ const type = stringValue(item.type);
641
+ if (type === "contextCompaction" && id)
642
+ return [
643
+ {
644
+ protocolVersion: 2,
645
+ type: "activity.started",
646
+ payload: {
647
+ activityId: `codex:compaction:${id}`,
648
+ kind: "compacting",
649
+ subject: { type: "run" },
650
+ source: "provider",
651
+ info: {}
652
+ }
653
+ }
654
+ ];
655
+ if (type !== "reasoning" && type !== "plan" && type !== "agentMessage")
656
+ return [];
657
+ this.#toolBatchStepId = undefined;
658
+ const started = this.#ensureActiveStep(params);
659
+ if (id) {
660
+ this.#itemSteps.set(id, started.stepId);
661
+ if (type === "agentMessage")
662
+ this.#itemChannels.set(id, agentMessageChannel(item));
663
+ }
664
+ return [...started.events, ...itemStartedEvents(item, started.stepId)];
665
+ }
666
+ #itemCompleted(params) {
667
+ const item = recordValue(params.item);
668
+ if (!item)
669
+ return [];
670
+ const id = stringValue(item.id);
671
+ if (stringValue(item.type) === "contextCompaction" && id) {
672
+ const threadId = stringValue(params.threadId);
673
+ return [
674
+ {
675
+ protocolVersion: 2,
676
+ type: "activity.finished",
677
+ payload: { activityId: `codex:compaction:${id}`, status: "completed" }
678
+ },
679
+ {
680
+ protocolVersion: 2,
681
+ type: "run.notice",
682
+ payload: {
683
+ noticeId: `codex:compaction:${id}`,
684
+ code: "context_compacted",
685
+ severity: "info",
686
+ params: {}
687
+ }
688
+ },
689
+ ...(threadId
690
+ ? [
691
+ {
692
+ protocolVersion: 2,
693
+ type: "session.update",
694
+ payload: {
695
+ providerSession: {
696
+ sessionId: threadId,
697
+ resumable: true,
698
+ resumeOutcome: "compacted"
699
+ }
700
+ }
701
+ }
702
+ ]
703
+ : [])
704
+ ];
705
+ }
706
+ const stepId = id ? this.#itemSteps.get(id) : undefined;
707
+ const channel = id ? this.#itemChannels.get(id) : undefined;
708
+ const events = itemCompletedEvents(item, stepId, channel);
709
+ if (stringValue(item.type) === "agentMessage" &&
710
+ (channel ?? agentMessageChannel(item)) === "final" &&
711
+ stepId === this.#activeStepId) {
712
+ events.push(...this.#finishActiveStep("completed", "stop"));
713
+ }
714
+ return events;
715
+ }
716
+ #ensureActiveStep(params) {
717
+ this.#beginTurn(params);
718
+ if (this.#activeStepId)
719
+ return { stepId: this.#activeStepId, events: [] };
720
+ const turnId = notificationTurnId(params) || this.#turnId || "turn";
721
+ const stepId = `codex:${turnId}:round:${++this.#round}`;
722
+ this.#activeStepId = stepId;
723
+ return {
724
+ stepId,
725
+ events: [{ protocolVersion: 2, type: "model_step.started", payload: { stepId } }]
726
+ };
727
+ }
728
+ #finishActiveStep(status, finishReason) {
729
+ const stepId = this.#activeStepId;
730
+ if (!stepId)
731
+ return [];
732
+ this.#activeStepId = undefined;
733
+ return [
734
+ {
735
+ protocolVersion: 2,
736
+ type: "model_step.finished",
737
+ payload: { stepId, status: canonicalTerminalStatus(status), finishReason }
738
+ }
739
+ ];
740
+ }
741
+ #stepFor(params) {
742
+ const id = itemId(params);
743
+ return id ? this.#itemSteps.get(id) : undefined;
744
+ }
745
+ #channelFor(params) {
746
+ const id = itemId(params);
747
+ return id ? (this.#itemChannels.get(id) ?? "final") : "final";
748
+ }
749
+ }
750
+ function interactionKind(method) {
751
+ switch (method) {
752
+ case "item/commandExecution/requestApproval":
753
+ case "execCommandApproval":
754
+ case "item/fileChange/requestApproval":
755
+ case "applyPatchApproval":
756
+ case "item/permissions/requestApproval":
757
+ return "approval";
758
+ case "item/tool/requestUserInput":
759
+ return "question";
760
+ case "mcpServer/elicitation/request":
761
+ return "elicitation";
762
+ default:
763
+ return undefined;
764
+ }
765
+ }
766
+ /** Keep provider-owned request ids opaque while producing a short, ASCII database key. */
767
+ function codexInteractionId(id, invocationId, sequence) {
768
+ return `codex:${createHash("sha256")
769
+ .update(JSON.stringify([invocationId, id, sequence]))
770
+ .digest("hex")}`;
771
+ }
772
+ function automaticServerRequestResult(method) {
773
+ switch (method) {
774
+ case "item/commandExecution/requestApproval":
775
+ case "item/fileChange/requestApproval":
776
+ return { decision: "accept" };
777
+ case "execCommandApproval":
778
+ case "applyPatchApproval":
779
+ return { decision: "approved" };
780
+ default:
781
+ return undefined;
782
+ }
783
+ }
784
+ function displaySafeInteractionRequest(method, params) {
785
+ const request = { provider: "codex", method };
786
+ for (const key of ["itemId", "approvalId", "reason", "command", "cwd", "grantRoot"]) {
787
+ if (params[key] !== undefined && params[key] !== null)
788
+ request[key] = boundedJson(params[key]);
789
+ }
790
+ if (method === "execCommandApproval" && Array.isArray(params.command)) {
791
+ request.command = boundedJson(params.command);
792
+ }
793
+ if (method === "applyPatchApproval") {
794
+ const changes = recordValue(params.fileChanges);
795
+ if (changes)
796
+ request.files = Object.keys(changes)
797
+ .slice(0, 100)
798
+ .map((value) => boundedString(value));
799
+ }
800
+ if (method === "item/permissions/requestApproval") {
801
+ request.permissions = boundedJson(params.permissions);
802
+ }
803
+ if (method === "item/tool/requestUserInput") {
804
+ request.questions = Array.isArray(params.questions)
805
+ ? params.questions.slice(0, 50).map((question) => {
806
+ const value = recordValue(question) ?? {};
807
+ return {
808
+ id: boundedString(value.id),
809
+ header: boundedString(value.header),
810
+ question: boundedString(value.question),
811
+ isOther: value.isOther === true,
812
+ isSecret: value.isSecret === true,
813
+ options: Array.isArray(value.options)
814
+ ? value.options.slice(0, 50).map((option) => {
815
+ const entry = recordValue(option) ?? {};
816
+ return {
817
+ label: boundedString(entry.label),
818
+ description: boundedString(entry.description)
819
+ };
820
+ })
821
+ : null
822
+ };
823
+ })
824
+ : [];
825
+ }
826
+ if (method === "mcpServer/elicitation/request") {
827
+ for (const key of ["serverName", "mode", "title", "description", "message", "url"]) {
828
+ if (params[key] !== undefined && params[key] !== null)
829
+ request[key] = boundedString(params[key]);
830
+ }
831
+ if (params.requestedSchema !== undefined)
832
+ request.requestedSchema = boundedJson(params.requestedSchema);
833
+ // Provider `_meta` and user-verification challenges are deliberately not projected.
834
+ }
835
+ return sanitizePublicValue(request);
836
+ }
837
+ function providerInteractionReply(pending, response) {
838
+ const { method, params } = pending;
839
+ switch (method) {
840
+ case "item/commandExecution/requestApproval":
841
+ case "item/fileChange/requestApproval":
842
+ return { result: { decision: approvalDecision(response, false) } };
843
+ case "execCommandApproval":
844
+ case "applyPatchApproval":
845
+ return { result: { decision: approvalDecision(response, true) } };
846
+ case "item/permissions/requestApproval": {
847
+ requireApprovalOutcome(response);
848
+ return {
849
+ result: {
850
+ permissions: response.outcome === "accepted" ? requestedPermissionGrant(params) : {},
851
+ scope: "turn"
852
+ }
853
+ };
854
+ }
855
+ case "mcpServer/elicitation/request":
856
+ if (response.outcome === "declined" || response.outcome === "cancelled") {
857
+ return {
858
+ result: {
859
+ action: response.outcome === "declined" ? "decline" : "cancel",
860
+ content: null,
861
+ _meta: null
862
+ }
863
+ };
864
+ }
865
+ if (response.outcome !== "accepted" && response.outcome !== "answered") {
866
+ throw new Error("unsupported elicitation outcome");
867
+ }
868
+ return { result: { action: "accept", content: jsonValue(response.value), _meta: null } };
869
+ case "item/tool/requestUserInput":
870
+ if (response.outcome === "declined" || response.outcome === "cancelled") {
871
+ return {
872
+ error: {
873
+ code: -32001,
874
+ message: response.outcome === "declined" ? "user declined input" : "user cancelled input"
875
+ }
876
+ };
877
+ }
878
+ if (response.outcome !== "answered") {
879
+ throw new Error(`request_user_input requires answered outcome, received: ${response.outcome}`);
880
+ }
881
+ return { result: { answers: questionAnswers(params, response.value) } };
882
+ default:
883
+ throw new Error(`unsupported codex interaction method: ${method}`);
884
+ }
885
+ }
886
+ function requireApprovalOutcome(response) {
887
+ if (response.outcome === "answered") {
888
+ throw new Error("approval interaction does not accept answered outcome");
889
+ }
890
+ }
891
+ function approvalDecision(response, legacy) {
892
+ requireApprovalOutcome(response);
893
+ if (legacy) {
894
+ if (response.outcome === "accepted")
895
+ return "approved";
896
+ if (response.outcome === "cancelled")
897
+ return "abort";
898
+ return { denied: { rejection: responseReason(response.value) } };
899
+ }
900
+ if (response.outcome === "accepted")
901
+ return "accept";
902
+ return response.outcome === "cancelled" ? "cancel" : "decline";
903
+ }
904
+ function requestedPermissionGrant(params) {
905
+ const requested = recordValue(params.permissions);
906
+ if (!requested)
907
+ return {};
908
+ return {
909
+ ...(recordValue(requested.network) ? { network: requested.network } : {}),
910
+ ...(recordValue(requested.fileSystem) ? { fileSystem: requested.fileSystem } : {})
911
+ };
912
+ }
913
+ function questionAnswers(params, value) {
914
+ const outer = recordValue(value);
915
+ const source = recordValue(outer?.answers) ?? outer;
916
+ if (!source)
917
+ throw new TypeError("request_user_input response value must be an answer object");
918
+ const questions = Array.isArray(params.questions) ? params.questions : [];
919
+ const entries = [];
920
+ for (const question of questions) {
921
+ const id = stringValue(recordValue(question)?.id);
922
+ if (!id)
923
+ continue;
924
+ const raw = source[id];
925
+ const wrapped = recordValue(raw);
926
+ const answers = typeof raw === "string"
927
+ ? [raw]
928
+ : Array.isArray(raw)
929
+ ? raw.filter((item) => typeof item === "string")
930
+ : Array.isArray(wrapped?.answers)
931
+ ? wrapped.answers.filter((item) => typeof item === "string")
932
+ : [];
933
+ if (answers.length === 0)
934
+ throw new TypeError(`missing answer for Codex question: ${id}`);
935
+ entries.push([id, { answers }]);
936
+ }
937
+ if (entries.length === 0)
938
+ throw new TypeError("request_user_input contained no answerable questions");
939
+ return Object.fromEntries(entries);
940
+ }
941
+ function responseReason(value) {
942
+ if (typeof value === "string" && value.trim())
943
+ return boundedString(value, 1_000);
944
+ const reason = stringValue(recordValue(value)?.reason);
945
+ return reason ? boundedString(reason, 1_000) : "declined by user";
946
+ }
947
+ function jsonValue(value) {
948
+ if (value === undefined)
949
+ return null;
950
+ try {
951
+ const encoded = JSON.stringify(value);
952
+ if (encoded === undefined)
953
+ throw new TypeError("value is not JSON serializable");
954
+ return JSON.parse(encoded);
955
+ }
956
+ catch (error) {
957
+ throw new TypeError("interaction response value must be JSON serializable", { cause: error });
958
+ }
959
+ }
960
+ function boundedString(value, limit = 8_192) {
961
+ const text = typeof value === "string" ? value : "";
962
+ return text.length <= limit ? text : `${text.slice(0, limit)}...[truncated]`;
963
+ }
964
+ function boundedJson(value, depth = 0) {
965
+ if (value === null || typeof value === "boolean" || typeof value === "number")
966
+ return value;
967
+ if (typeof value === "string")
968
+ return boundedString(value);
969
+ if (depth >= 6)
970
+ return "[truncated]";
971
+ if (Array.isArray(value))
972
+ return value.slice(0, 100).map((item) => boundedJson(item, depth + 1));
973
+ const record = recordValue(value);
974
+ if (!record)
975
+ return boundedString(value);
976
+ return Object.fromEntries(Object.entries(record)
977
+ .slice(0, 100)
978
+ .map(([key, item]) => [boundedString(key, 256), boundedJson(item, depth + 1)]));
979
+ }
980
+ /**
981
+ * JSON-RPC client for a single invocation, backed by a single app-server subprocess.
982
+ *
983
+ * Three kinds of frame may interleave on stdout:
984
+ * 1. a response carrying id + result/error, which settles a Promise in #pending;
985
+ * 2. a notification with no id, which is converted and pushed into #queue;
986
+ * 3. a server request carrying id + method, which the adapter must respond to.
987
+ *
988
+ * This class does not decide the resume/fresh strategy; it only owns the wire,
989
+ * the process and the active thread/turn state.
990
+ */
991
+ class CodexAppServerClient {
992
+ invocation;
993
+ context;
994
+ #child;
995
+ #cleanupProcess;
996
+ #closePromise;
997
+ #reader;
998
+ #removeLineGuard;
999
+ #queue = new DriverQueue();
1000
+ #normalizer;
1001
+ #native;
1002
+ #pending = new Map();
1003
+ #interactions = new Map();
1004
+ #nativeRequestIds = new Set();
1005
+ #requestTimeoutMs;
1006
+ #interactive;
1007
+ #signal;
1008
+ #exitPromise;
1009
+ #resolveExit = () => undefined;
1010
+ #nextId = 1;
1011
+ #nextInteractionId = 1;
1012
+ #stderr = "";
1013
+ #closed = false;
1014
+ #transportFailure;
1015
+ #closing = false;
1016
+ #exited = false;
1017
+ #terminal = false;
1018
+ #activeThreadId;
1019
+ #activeTurnId;
1020
+ #lastUsage = -1;
1021
+ #seenItems = new Set();
1022
+ #abortTimer;
1023
+ #finalizationTimer;
1024
+ #finalizationGraceTimer;
1025
+ #finalizationTimedOut = false;
1026
+ #finalizationTimeoutMs = FINALIZATION_TIMEOUT_MS;
1027
+ #openItems = new Set();
1028
+ #clearFinalizationTimer() {
1029
+ if (this.#finalizationTimer)
1030
+ clearTimeout(this.#finalizationTimer);
1031
+ this.#finalizationTimer = undefined;
1032
+ }
1033
+ #finalizationFailure() {
1034
+ if (this.#native)
1035
+ return {
1036
+ kind: "control",
1037
+ control: {
1038
+ type: "error",
1039
+ code: "HOST_EXECUTION_FAILED",
1040
+ message: "CODEX_FINALIZATION_TIMEOUT"
1041
+ }
1042
+ };
1043
+ return {
1044
+ protocolVersion: 2,
1045
+ type: "run.failed",
1046
+ payload: {
1047
+ code: "CODEX_FINALIZATION_TIMEOUT",
1048
+ adapterType: "codex",
1049
+ message: "Codex final answer completed but the turn did not finish before the finalization deadline",
1050
+ timeoutStage: "rpc",
1051
+ timeoutReason: "rpc_timeout",
1052
+ timeoutMs: this.#finalizationTimeoutMs
1053
+ }
1054
+ };
1055
+ }
1056
+ #watchFinalization(method, params) {
1057
+ if (this.#terminal || this.#closed || this.#finalizationTimedOut)
1058
+ return;
1059
+ if (method === "turn/completed") {
1060
+ this.#clearFinalizationTimer();
1061
+ return;
1062
+ }
1063
+ if (method === "item/started") {
1064
+ const id = stringValue(recordValue(params.item)?.id);
1065
+ if (id)
1066
+ this.#openItems.add(id);
1067
+ this.#clearFinalizationTimer();
1068
+ return;
1069
+ }
1070
+ if (method === "error" || method.endsWith("Delta") || method.endsWith("/delta")) {
1071
+ this.#clearFinalizationTimer();
1072
+ return;
1073
+ }
1074
+ if (method !== "item/completed")
1075
+ return;
1076
+ const item = recordValue(params.item);
1077
+ const id = stringValue(item?.id);
1078
+ if (id)
1079
+ this.#openItems.delete(id);
1080
+ if (item?.type !== "agentMessage" ||
1081
+ item.phase !== "final_answer" ||
1082
+ params.threadId !== this.#activeThreadId ||
1083
+ notificationTurnId(params) !== this.#activeTurnId ||
1084
+ this.#openItems.size ||
1085
+ this.#interactions.size ||
1086
+ !this.#activeThreadId ||
1087
+ !this.#activeTurnId)
1088
+ return;
1089
+ this.#clearFinalizationTimer();
1090
+ const configured = recordValue(this.invocation.agentConfig.providerOptions)?.finalizationTimeoutMs;
1091
+ const timeoutMs = typeof configured === "number" && Number.isFinite(configured) && configured > 0
1092
+ ? configured
1093
+ : FINALIZATION_TIMEOUT_MS;
1094
+ this.#finalizationTimeoutMs = timeoutMs;
1095
+ this.#finalizationTimer = setTimeout(() => {
1096
+ this.#finalizationTimedOut = true;
1097
+ // RPC acknowledgement is not a turn terminal; await the notification separately.
1098
+ this.#finalizationGraceTimer = setTimeout(() => {
1099
+ if (this.#terminal || this.#closed)
1100
+ return;
1101
+ this.#terminal = true;
1102
+ this.#queue.push(this.#finalizationFailure());
1103
+ if (this.#native)
1104
+ this.#queue.push({ kind: "control", control: { type: "state", state: "failed" } });
1105
+ this.#queue.close();
1106
+ }, FINALIZATION_INTERRUPT_GRACE_MS);
1107
+ void this.request("turn/interrupt", { threadId: this.#activeThreadId, turnId: this.#activeTurnId }, FINALIZATION_INTERRUPT_GRACE_MS).catch(() => undefined);
1108
+ }, timeoutMs);
1109
+ }
1110
+ /**
1111
+ * Cancellation follows a "converge host events first, then best-effort notify
1112
+ * the provider" order.
1113
+ *
1114
+ * The queue immediately publishes the sole run.cancelled so the UI need not wait
1115
+ * for a Codex response; if the thread/turn IDs are known, turn/interrupt is
1116
+ * sent in the background. After 250ms the same bounded cleanup used by close()
1117
+ * starts even if the consumer has stopped reading the cancellation terminal.
1118
+ */
1119
+ #abortListener = () => {
1120
+ if (this.#closed || this.#terminal)
1121
+ return;
1122
+ this.#terminal = true;
1123
+ this.#clearFinalizationTimer();
1124
+ this.#invalidateInteractions("run_cancelled");
1125
+ if (this.#native)
1126
+ this.#queue.push({ kind: "control", control: { type: "state", state: "cancelled" } });
1127
+ else
1128
+ this.#queue.push({
1129
+ protocolVersion: 2,
1130
+ type: "run.cancelled",
1131
+ payload: { reason: String(this.#signal?.reason ?? "cancelled") }
1132
+ });
1133
+ this.#queue.close();
1134
+ if (this.#activeThreadId && this.#activeTurnId) {
1135
+ void this.request("turn/interrupt", {
1136
+ threadId: this.#activeThreadId,
1137
+ turnId: this.#activeTurnId
1138
+ }, 1_000).catch(() => undefined);
1139
+ }
1140
+ this.#abortTimer = setTimeout(() => {
1141
+ // 观察异步失败以免产生 unhandled rejection;close 仍等待同一 Promise 并返回失败。
1142
+ void this.#cleanupProcess().catch((error) => this.#handleProcessError(error));
1143
+ }, APP_SERVER_CLOSE_GRACE_MS);
1144
+ this.#abortTimer.unref?.();
1145
+ };
1146
+ constructor(spec, spawnFn, requestTimeoutMs, interactive, invocation, context) {
1147
+ this.invocation = invocation;
1148
+ this.context = context;
1149
+ this.#native = context?.protocolMode === "native";
1150
+ if (!this.#native)
1151
+ this.#normalizer = new CodexEventNormalizer();
1152
+ this.#requestTimeoutMs = requestTimeoutMs;
1153
+ this.#interactive = interactive;
1154
+ const signal = invocation.signal;
1155
+ this.#signal = signal;
1156
+ this.#exitPromise = new Promise((resolve) => {
1157
+ this.#resolveExit = resolve;
1158
+ });
1159
+ this.#child = spawnFn(spec.command, spec.args, { cwd: spec.cwd, env: spec.env });
1160
+ this.#cleanupProcess = createProcessCleanup(this.#child, {
1161
+ // 只有 production defaultSpawn 明确拥有独立组;注入的 child 不推定拥有组。
1162
+ processGroup: isolatedProcessGroups.has(this.#child)
1163
+ });
1164
+ // The app-server protocol requires one JSON-RPC frame per line; readline handles chunk boundaries.
1165
+ const transportLimit = !this.#native && hasImageInput(invocation) ? INVOKE_REQUEST_MAX_BYTES : 256 * 1024;
1166
+ this.#removeLineGuard = watchLineLimit(this.#child.stdout, transportLimit, (error) => {
1167
+ this.#reader.close();
1168
+ this.#child.stdout.destroy();
1169
+ this.#handleProcessError(error);
1170
+ signalProcessTree(this.#child, "SIGTERM");
1171
+ });
1172
+ this.#reader = createInterface({ input: this.#child.stdout });
1173
+ this.#reader.on("line", (line) => this.#handleLine(line));
1174
+ this.#child.stderr.setEncoding("utf8");
1175
+ this.#child.stderr.on("data", (chunk) => {
1176
+ this.#stderr = (this.#stderr + chunk.toString()).slice(-STDERR_TAIL_LIMIT);
1177
+ });
1178
+ // spawn error and normal/abnormal close are watched separately, but both ultimately reject pending RPCs and close the event stream.
1179
+ // S01(Jerry-Xin R05 同类):write 回调不能代替流 error 监听。
1180
+ // .octospec/tasks/pr1-yujiawei-review/assessment.md
1181
+ for (const source of [
1182
+ this.#child,
1183
+ this.#child.stdin,
1184
+ this.#child.stdout,
1185
+ this.#child.stderr,
1186
+ this.#reader
1187
+ ]) {
1188
+ source.on("error", (error) => this.#handleProcessError(error));
1189
+ }
1190
+ this.#child.once("close", (code, exitSignal) => this.#handleExit({ code, signal: exitSignal }));
1191
+ if (signal?.aborted)
1192
+ queueMicrotask(this.#abortListener);
1193
+ else
1194
+ signal?.addEventListener("abort", this.#abortListener, { once: true });
1195
+ }
1196
+ setActiveThread(threadId) {
1197
+ this.#activeThreadId = threadId;
1198
+ }
1199
+ setActiveTurn(turnId) {
1200
+ this.#activeTurnId = turnId;
1201
+ }
1202
+ events() {
1203
+ return this.#queue;
1204
+ }
1205
+ bufferedEvents() {
1206
+ return this.#queue.drain();
1207
+ }
1208
+ /** Accept only a provider reply to a pending request in this invocation. */
1209
+ async respondNative(response) {
1210
+ if (!this.#native || this.#closed || this.#exited || this.#terminal)
1211
+ throw protocolError("INTERACTION_NOT_ACTIVE");
1212
+ const entry = [...this.#interactions.entries()].find(([, value]) => value.rpcId === response.requestId);
1213
+ if (!entry)
1214
+ throw protocolError("INTERACTION_NOT_ACTIVE");
1215
+ const [interactionId, pending] = entry;
1216
+ if (pending.responding || pending.expiresAt <= Date.now())
1217
+ throw protocolError("INTERACTION_NOT_ACTIVE");
1218
+ const payload = response.payload;
1219
+ if (payload.id !== pending.rpcId ||
1220
+ payload.jsonrpc !== "2.0" ||
1221
+ Object.hasOwn(payload, "result") === Object.hasOwn(payload, "error") ||
1222
+ Object.keys(payload).some((key) => !["jsonrpc", "id", "result", "error"].includes(key)))
1223
+ throw protocolError("NATIVE_RESPONSE_INVALID");
1224
+ const result = recordValue(payload.result);
1225
+ const error = recordValue(payload.error);
1226
+ if (error) {
1227
+ if (!Number.isSafeInteger(error.code) || typeof error.message !== "string")
1228
+ throw protocolError("NATIVE_RESPONSE_INVALID");
1229
+ }
1230
+ else if (!result)
1231
+ throw protocolError("NATIVE_RESPONSE_INVALID");
1232
+ else if (interactionKind(pending.method) === "approval") {
1233
+ const legacy = pending.method === "execCommandApproval" || pending.method === "applyPatchApproval";
1234
+ const decisions = legacy ? ["approved", "abort"] : ["accept", "decline", "cancel"];
1235
+ if (Object.keys(result).some((key) => key !== "decision") ||
1236
+ !(decisions.includes(String(result.decision)) ||
1237
+ (legacy && recordValue(recordValue(result.decision)?.denied))))
1238
+ throw protocolError("NATIVE_RESPONSE_INVALID");
1239
+ }
1240
+ else if (pending.method === "item/tool/requestUserInput") {
1241
+ questionAnswers(pending.params, result);
1242
+ }
1243
+ else if (pending.method === "mcpServer/elicitation/request") {
1244
+ if (!["accept", "decline", "cancel"].includes(String(result.action)))
1245
+ throw protocolError("NATIVE_RESPONSE_INVALID");
1246
+ }
1247
+ else
1248
+ throw protocolError("NATIVE_METHOD_UNSUPPORTED");
1249
+ pending.responding = true;
1250
+ await new Promise((resolve, reject) => this.#write(payload, (error) => {
1251
+ this.#invalidateInteractions("response_delivery_failed");
1252
+ this.#queue.fail(error);
1253
+ signalProcessTree(this.#child, "SIGTERM");
1254
+ reject(error);
1255
+ }, () => {
1256
+ if (!this.#interactions.has(interactionId)) {
1257
+ reject(protocolError("INTERACTION_NOT_ACTIVE"));
1258
+ return;
1259
+ }
1260
+ clearTimeout(pending.timer);
1261
+ this.#interactions.delete(interactionId);
1262
+ this.#interactionState(interactionId, pending.rpcId, "resolved");
1263
+ resolve();
1264
+ }));
1265
+ }
1266
+ #interactionState(interactionId, requestId, status, reasonCode) {
1267
+ this.#queue.push(this.#native
1268
+ ? { kind: "control", control: { type: "interaction", requestId, status } }
1269
+ : {
1270
+ protocolVersion: 2,
1271
+ type: "interaction.resolved",
1272
+ payload: {
1273
+ interactionId,
1274
+ executionInstanceId: this.invocation.invocationId,
1275
+ status,
1276
+ ...(reasonCode ? { reasonCode } : {}),
1277
+ ...(reasonCode === "full_access_policy" ? { outcome: "accepted" } : {})
1278
+ }
1279
+ });
1280
+ }
1281
+ /** Resume one provider reverse request after the durable Worker response reaches this invocation. */
1282
+ respondInteraction(response) {
1283
+ if (this.#closed || this.#exited || this.#terminal) {
1284
+ return Promise.reject(new Error("codex interaction is no longer active"));
1285
+ }
1286
+ const pending = this.#interactions.get(response.interactionId);
1287
+ if (!pending) {
1288
+ return Promise.reject(new Error(`unknown codex interaction: ${response.interactionId}`));
1289
+ }
1290
+ if (pending.expiresAt <= Date.now())
1291
+ return Promise.reject(new Error("INTERACTION_EXPIRED"));
1292
+ if (pending.responding) {
1293
+ return Promise.reject(new Error(`codex interaction response is already in flight: ${response.interactionId}`));
1294
+ }
1295
+ let reply;
1296
+ try {
1297
+ reply = providerInteractionReply(pending, response);
1298
+ }
1299
+ catch (error) {
1300
+ return Promise.reject(error instanceof Error ? error : new Error(String(error)));
1301
+ }
1302
+ pending.responding = true;
1303
+ return new Promise((resolve, reject) => {
1304
+ this.#write({ jsonrpc: "2.0", id: pending.rpcId, ...reply }, (error) => {
1305
+ pending.responding = false;
1306
+ reject(error);
1307
+ }, () => {
1308
+ if (!this.#interactions.has(response.interactionId)) {
1309
+ reject(new Error("INTERACTION_NOT_ACTIVE"));
1310
+ return;
1311
+ }
1312
+ clearTimeout(pending.timer);
1313
+ this.#interactions.delete(response.interactionId);
1314
+ this.#queue.push({
1315
+ protocolVersion: 2,
1316
+ type: "interaction.resolved",
1317
+ payload: {
1318
+ interactionId: response.interactionId,
1319
+ executionInstanceId: this.invocation.invocationId,
1320
+ status: "resolved",
1321
+ outcome: response.outcome
1322
+ }
1323
+ });
1324
+ resolve();
1325
+ });
1326
+ });
1327
+ }
1328
+ exit() {
1329
+ return this.#exitPromise;
1330
+ }
1331
+ request(method, params, timeoutMs = this.#requestTimeoutMs, onWritten, requestId) {
1332
+ if (this.#transportFailure)
1333
+ return Promise.reject(this.#transportFailure);
1334
+ if (this.#closed || this.#exited) {
1335
+ return Promise.reject(new Error("codex app-server is closed"));
1336
+ }
1337
+ const id = requestId ?? this.reserveRequestId();
1338
+ if (this.#pending.has(id)) {
1339
+ return Promise.reject(new Error(`codex app-server request id ${String(id)} is already pending`));
1340
+ }
1341
+ return new Promise((resolve, reject) => {
1342
+ // Register pending before writing stdin, so a synchronous reply from a test server/local process cannot arrive first.
1343
+ const timer = setTimeout(() => {
1344
+ if (!this.#pending.delete(id))
1345
+ return;
1346
+ reject(Object.assign(new Error(`codex app-server ${method} timed out after ${timeoutMs}ms`), {
1347
+ code: "RPC_TIMEOUT",
1348
+ timeoutStage: "rpc",
1349
+ timeoutReason: "rpc_timeout",
1350
+ timeoutMs
1351
+ }));
1352
+ }, timeoutMs);
1353
+ this.#pending.set(id, { method, resolve, reject, timer });
1354
+ // onWritten is deliberately passed through to #write instead of running
1355
+ // before it; callers use it as the transport-written observation boundary.
1356
+ this.#write({ jsonrpc: "2.0", id, method, params }, (error) => {
1357
+ const pending = this.#pending.get(id);
1358
+ if (!pending)
1359
+ return;
1360
+ this.#pending.delete(id);
1361
+ clearTimeout(pending.timer);
1362
+ pending.reject(error);
1363
+ }, onWritten);
1364
+ });
1365
+ }
1366
+ /** Allocate the exact JSON-RPC id a subsequent request will put on the wire. */
1367
+ reserveRequestId() {
1368
+ return this.#nextId++;
1369
+ }
1370
+ notify(method, params) {
1371
+ this.#write({
1372
+ jsonrpc: "2.0",
1373
+ method,
1374
+ ...(params === undefined ? {} : { params })
1375
+ });
1376
+ }
1377
+ /**
1378
+ * R06b:父进程退出只结束 EOF 等待,不能代替本次受管组清理完成。
1379
+ * 重复 close 共享同一结果;保留已接纳终态,清理失败继续向调用方抛出。
1380
+ * .octospec/tasks/pr1-yujiawei-review/second-review.md
1381
+ */
1382
+ close() {
1383
+ return (this.#closePromise ??= (async () => {
1384
+ this.#closed = true;
1385
+ this.#clearFinalizationTimer();
1386
+ if (this.#finalizationGraceTimer)
1387
+ clearTimeout(this.#finalizationGraceTimer);
1388
+ this.#closing = true;
1389
+ this.#signal?.removeEventListener("abort", this.#abortListener);
1390
+ if (this.#abortTimer)
1391
+ clearTimeout(this.#abortTimer);
1392
+ this.#reader.close();
1393
+ this.#removeLineGuard();
1394
+ this.#rejectPending(new Error("codex app-server closed"));
1395
+ this.#invalidateInteractions("execution_lost");
1396
+ try {
1397
+ if (!this.#exited) {
1398
+ this.#child.stdin.end();
1399
+ await waitForExit(this.#exitPromise, APP_SERVER_CLOSE_GRACE_MS);
1400
+ }
1401
+ }
1402
+ finally {
1403
+ // 即使 leader 早已退出或 EOF 已成功,仍确认后代消失并按需升级 KILL。
1404
+ await this.#cleanupProcess();
1405
+ }
1406
+ })());
1407
+ }
1408
+ errorMessage(error) {
1409
+ const raw = error instanceof Error ? error.message : String(error);
1410
+ return this.#stderr.trim() ? `${raw}\n\n[codex stderr]\n${this.#stderr.trim()}` : raw;
1411
+ }
1412
+ processErrorMessage(exit) {
1413
+ const base = exit.signal
1414
+ ? `codex app-server exited on ${exit.signal}`
1415
+ : `codex app-server exited with code ${exit.code ?? -1}`;
1416
+ return this.#stderr.trim() ? `${base}: ${this.#stderr.trim()}` : base;
1417
+ }
1418
+ /** Dispatch one stdout frame. Ordering of the checks matters: a response may also lack a method. */
1419
+ #handleLine(line) {
1420
+ const message = parseRecord(line);
1421
+ if (Buffer.byteLength(line) > 256 * 1024 && !this.#isBoundedInputEcho(message)) {
1422
+ const error = new Error("STREAM_EVENT_TOO_LARGE");
1423
+ this.#rejectPending(error);
1424
+ this.#queue.fail(error);
1425
+ signalProcessTree(this.#child, "SIGTERM");
1426
+ return;
1427
+ }
1428
+ if (!message)
1429
+ return;
1430
+ const id = rpcId(message.id);
1431
+ if (id !== undefined && ("result" in message || "error" in message)) {
1432
+ this.#handleResponse(id, message);
1433
+ return;
1434
+ }
1435
+ const method = stringValue(message.method);
1436
+ if (!method)
1437
+ return;
1438
+ if (id !== undefined) {
1439
+ this.#handleServerRequest(id, method, recordValue(message.params) ?? {}, message);
1440
+ return;
1441
+ }
1442
+ const params = recordValue(message.params) ?? {};
1443
+ if (this.#native &&
1444
+ ((!this.#activeThreadId && method !== "thread/started") ||
1445
+ (this.#activeThreadId &&
1446
+ !params.threadId &&
1447
+ !recordValue(params.thread)?.id &&
1448
+ !notificationTurnId(params))))
1449
+ return;
1450
+ if (!this.#acceptNotification(params))
1451
+ return;
1452
+ this.#reportNotificationActivity(method, params);
1453
+ this.#watchFinalization(method, params);
1454
+ if (this.#native) {
1455
+ this.#queue.push({ kind: "native", messageKind: "notification", payload: message });
1456
+ if (method === "turn/completed") {
1457
+ this.#invalidateInteractions("run_terminal");
1458
+ this.#terminal = true;
1459
+ this.#clearFinalizationTimer();
1460
+ if (this.#finalizationGraceTimer)
1461
+ clearTimeout(this.#finalizationGraceTimer);
1462
+ const status = recordValue(params.turn)?.status;
1463
+ this.#queue.push({
1464
+ kind: "control",
1465
+ control: {
1466
+ type: "state",
1467
+ state: status === "completed"
1468
+ ? "completed"
1469
+ : status === "interrupted"
1470
+ ? "cancelled"
1471
+ : "failed"
1472
+ }
1473
+ });
1474
+ this.#queue.close();
1475
+ }
1476
+ return;
1477
+ }
1478
+ this.context?.reportConversion?.();
1479
+ for (const event of this.#normalizer.normalize({ method, params })) {
1480
+ if (isTerminalEvent(event)) {
1481
+ this.#invalidateInteractions("run_terminal");
1482
+ this.#terminal = true;
1483
+ this.#clearFinalizationTimer();
1484
+ if (this.#finalizationGraceTimer)
1485
+ clearTimeout(this.#finalizationGraceTimer);
1486
+ this.#queue.push(this.#finalizationTimedOut && event.type !== "run.completed"
1487
+ ? this.#finalizationFailure()
1488
+ : event);
1489
+ this.#queue.close();
1490
+ }
1491
+ else
1492
+ this.#queue.push(event);
1493
+ }
1494
+ }
1495
+ #isBoundedInputEcho(message) {
1496
+ if (this.#native || !message)
1497
+ return false;
1498
+ const method = stringValue(message.method);
1499
+ const id = rpcId(message.id);
1500
+ const pending = id === undefined ? undefined : this.#pending.get(id);
1501
+ const item = recordValue(recordValue(message.params)?.item);
1502
+ const carrier = ((method === "item/started" || method === "item/completed") &&
1503
+ item?.type === "userMessage") ||
1504
+ ["turn/started", "turn/completed", "codex/event/user_message"].includes(method ?? "") ||
1505
+ (pending && ["thread/start", "thread/resume", "turn/start"].includes(pending.method));
1506
+ if (!carrier)
1507
+ return false;
1508
+ const images = new Set([
1509
+ ...(this.invocation.modelInputParts ?? []),
1510
+ ...(this.invocation.freshFallbackModelInputParts ?? [])
1511
+ ]
1512
+ .filter((part) => part.type === "image")
1513
+ .map((part) => `data:${part.mimeType};base64,${part.data}`));
1514
+ let matched = false;
1515
+ // Only identical submitted image URLs are exempt from canonical event sizing.
1516
+ // The original provider message still reaches the normalizer unchanged.
1517
+ const withoutEcho = (value, depth = 0) => {
1518
+ if (depth > 64)
1519
+ throw new Error("JSON_DEPTH_EXCEEDED");
1520
+ if (typeof value === "string" && images.has(value)) {
1521
+ matched = true;
1522
+ return "[submitted image]";
1523
+ }
1524
+ if (Array.isArray(value))
1525
+ return value.map((item) => withoutEcho(item, depth + 1));
1526
+ if (value && typeof value === "object")
1527
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, withoutEcho(item, depth + 1)]));
1528
+ return value;
1529
+ };
1530
+ try {
1531
+ assertJsonByteLimit(withoutEcho(message), 256 * 1024, "STREAM_EVENT_TOO_LARGE");
1532
+ return matched;
1533
+ }
1534
+ catch {
1535
+ return false;
1536
+ }
1537
+ }
1538
+ #handleResponse(id, message) {
1539
+ // A late response arriving after timeout has no pending entry; drop it so it cannot pollute the next request.
1540
+ const pending = this.#pending.get(id);
1541
+ if (!pending)
1542
+ return;
1543
+ if (this.#native &&
1544
+ ["thread/start", "thread/resume", "turn/start", "turn/interrupt"].includes(pending.method))
1545
+ this.#queue.push({ kind: "native", messageKind: "response", payload: message });
1546
+ this.#pending.delete(id);
1547
+ clearTimeout(pending.timer);
1548
+ this.context?.reportActivity?.({ kind: "transport_response", method: "rpc_response" });
1549
+ const error = recordValue(message.error);
1550
+ if (error) {
1551
+ pending.reject(new CodexAppServerRpcError(pending.method, numberValue(error.code) ?? -32000, stringValue(error.message) || "unknown app-server error", error.data));
1552
+ return;
1553
+ }
1554
+ pending.resolve(message.result);
1555
+ }
1556
+ #handleServerRequest(id, method, params, message) {
1557
+ this.#clearFinalizationTimer();
1558
+ const kind = interactionKind(method);
1559
+ if (!kind) {
1560
+ this.#rejectServerRequest(id, method);
1561
+ return;
1562
+ }
1563
+ if (this.#terminal || this.#closed || this.#exited) {
1564
+ this.#write({
1565
+ jsonrpc: "2.0",
1566
+ id,
1567
+ error: { code: -32000, message: "invocation is no longer active" }
1568
+ });
1569
+ return;
1570
+ }
1571
+ if (this.#native &&
1572
+ (!this.#acceptNotification(params) ||
1573
+ this.#nativeRequestIds.has(id) ||
1574
+ this.#nativeRequestIds.size >= 4096)) {
1575
+ this.#write({
1576
+ jsonrpc: "2.0",
1577
+ id,
1578
+ error: { code: -32600, message: "request does not belong to a new active interaction" }
1579
+ });
1580
+ return;
1581
+ }
1582
+ if (this.#native)
1583
+ this.#nativeRequestIds.add(id);
1584
+ if (method === "item/permissions/requestApproval") {
1585
+ this.#rejectServerRequest(id, method);
1586
+ this.#queue.fail(new Error("APPROVAL_GRANT_SCOPE_UNSUPPORTED"));
1587
+ return;
1588
+ }
1589
+ if (this.#interactions.size >= 16) {
1590
+ this.#rejectServerRequest(id, method);
1591
+ this.#queue.fail(new Error("APPROVAL_PENDING_LIMIT_EXCEEDED"));
1592
+ return;
1593
+ }
1594
+ const interactionId = codexInteractionId(id, this.invocation.invocationId, this.#nextInteractionId++);
1595
+ if ([...this.#interactions.values()].some((pending) => pending.rpcId === id)) {
1596
+ this.#write({
1597
+ jsonrpc: "2.0",
1598
+ id,
1599
+ error: { code: -32600, message: "duplicate provider interaction id" }
1600
+ });
1601
+ return;
1602
+ }
1603
+ const expiresAt = Date.now() + 600_000;
1604
+ const timer = setTimeout(() => {
1605
+ this.#interactions.delete(interactionId);
1606
+ this.#interactionState(interactionId, id, "expired", "approval_timeout");
1607
+ this.#rejectServerRequest(id, method);
1608
+ this.#queue.fail(new Error("INTERACTION_EXPIRED"));
1609
+ }, 600_000);
1610
+ timer.unref?.();
1611
+ this.#interactions.set(interactionId, {
1612
+ rpcId: id,
1613
+ method,
1614
+ params,
1615
+ responding: false,
1616
+ timer,
1617
+ expiresAt
1618
+ });
1619
+ if (this.#native) {
1620
+ this.#queue.push({ kind: "native", messageKind: "request", payload: message });
1621
+ this.#queue.push({
1622
+ kind: "control",
1623
+ control: { type: "interaction", requestId: id, status: "pending", expiresAt }
1624
+ });
1625
+ }
1626
+ else {
1627
+ const display = displaySafeInteractionRequest(method, params);
1628
+ this.#queue.push({
1629
+ protocolVersion: 2,
1630
+ type: "interaction.requested",
1631
+ payload: {
1632
+ interactionId,
1633
+ kind,
1634
+ executionInstanceId: this.invocation.invocationId,
1635
+ expiresAt: new Date(expiresAt).toISOString(),
1636
+ request: kind === "approval"
1637
+ ? {
1638
+ schema: "octo.approval-request/v1",
1639
+ policy: {
1640
+ mode: this.invocation.approvalMode,
1641
+ hash: contextHash(this.invocation.context)
1642
+ },
1643
+ operation: {
1644
+ kind: method.includes("fileChange") || method === "applyPatchApproval"
1645
+ ? "file_change"
1646
+ : "command_execution",
1647
+ summary: typeof display.command === "string" && display.command
1648
+ ? Array.from(display.command).slice(0, 500).join("")
1649
+ : "Approve provider operation",
1650
+ ...(typeof params.itemId === "string" ? { toolCallId: params.itemId } : {})
1651
+ },
1652
+ requestedPermissions: [],
1653
+ allowedOutcomes: ["accepted", "declined", "cancelled"],
1654
+ grantScope: "request",
1655
+ providerDetails: display
1656
+ }
1657
+ : display
1658
+ }
1659
+ });
1660
+ }
1661
+ if (!this.#interactive && kind === "approval") {
1662
+ const automatic = automaticServerRequestResult(method);
1663
+ if (automatic === undefined) {
1664
+ this.#rejectServerRequest(id, method);
1665
+ this.#invalidateInteractions("approval_mapping_unsupported");
1666
+ this.#queue.fail(new Error("APPROVAL_OPERATION_UNSUPPORTED"));
1667
+ return;
1668
+ }
1669
+ this.#interactions.get(interactionId).responding = true;
1670
+ this.#write({ jsonrpc: "2.0", id, result: automatic }, (error) => {
1671
+ this.#invalidateInteractions("response_delivery_failed");
1672
+ this.#queue.fail(error);
1673
+ }, () => {
1674
+ const pending = this.#interactions.get(interactionId);
1675
+ if (!pending)
1676
+ return;
1677
+ clearTimeout(pending.timer);
1678
+ this.#interactions.delete(interactionId);
1679
+ this.#interactionState(interactionId, id, "resolved", "full_access_policy");
1680
+ });
1681
+ }
1682
+ }
1683
+ #rejectServerRequest(id, method) {
1684
+ // Unknown server requests must be answered with an error, otherwise Codex waits forever on that JSON-RPC ID.
1685
+ this.#write({
1686
+ jsonrpc: "2.0",
1687
+ id,
1688
+ error: { code: -32601, message: `unhandled server request: ${method}` }
1689
+ });
1690
+ }
1691
+ #write(message, onError, onWritten) {
1692
+ if (this.#transportFailure) {
1693
+ onError?.(this.#transportFailure);
1694
+ return;
1695
+ }
1696
+ if (this.#closed || this.#exited) {
1697
+ onError?.(new Error("codex app-server is closed"));
1698
+ return;
1699
+ }
1700
+ let line;
1701
+ try {
1702
+ line = `${JSON.stringify(message)}\n`;
1703
+ }
1704
+ catch (error) {
1705
+ onError?.(error instanceof Error ? error : new Error(String(error)));
1706
+ return;
1707
+ }
1708
+ this.#child.stdin.write(line, (error) => {
1709
+ // Writable completion means local acceptance of the bytes. Only a later
1710
+ // frame with the same JSON-RPC id can acknowledge a request.
1711
+ if (error)
1712
+ onError?.(error);
1713
+ else
1714
+ onWritten?.();
1715
+ });
1716
+ }
1717
+ #acceptNotification(params) {
1718
+ // During initialize there is no active thread yet, so global notifications are allowed; afterward other threads are filtered out.
1719
+ if (!this.#activeThreadId)
1720
+ return true;
1721
+ const threadId = stringValue(params.threadId);
1722
+ if (threadId && threadId !== this.#activeThreadId)
1723
+ return false;
1724
+ const turnId = notificationTurnId(params);
1725
+ return !this.#activeTurnId || !turnId || turnId === this.#activeTurnId;
1726
+ }
1727
+ #reportNotificationActivity(method, params) {
1728
+ if (this.#terminal || !this.#activeThreadId)
1729
+ return;
1730
+ const turnId = notificationTurnId(params);
1731
+ if (!this.#activeTurnId && method === "turn/started" && turnId)
1732
+ this.setActiveTurn(turnId);
1733
+ if (!this.#activeTurnId)
1734
+ return;
1735
+ // Progress must belong to this turn. Thread-scoped token usage is a
1736
+ // documented exception and is accepted only when its total advances.
1737
+ if (turnId !== this.#activeTurnId && method !== "thread/tokenUsage/updated")
1738
+ return;
1739
+ if (method === "error" && params.willRetry === true) {
1740
+ this.context?.reportActivity?.({ kind: "retry_notice", method: "retry" });
1741
+ }
1742
+ else if (method === "thread/tokenUsage/updated") {
1743
+ if (stringValue(params.threadId) !== this.#activeThreadId)
1744
+ return;
1745
+ const total = recordValue(recordValue(params.tokenUsage)?.total);
1746
+ const tokens = numberValue(total?.totalTokens);
1747
+ if (tokens !== undefined && Number.isSafeInteger(tokens) && tokens > this.#lastUsage) {
1748
+ this.#lastUsage = tokens;
1749
+ this.context?.reportActivity?.({ kind: "turn_progress", method: "usage" });
1750
+ }
1751
+ }
1752
+ else if ([
1753
+ "item/agentMessage/delta",
1754
+ "item/reasoning/summaryTextDelta",
1755
+ "item/reasoning/textDelta",
1756
+ "item/plan/delta"
1757
+ ].includes(method) &&
1758
+ stringValue(params.delta)) {
1759
+ this.context?.reportActivity?.({ kind: "turn_progress", method: "text_delta" });
1760
+ }
1761
+ else if ((((["item/commandExecution/outputDelta", "item/fileChange/outputDelta"].includes(method) ||
1762
+ isToolArgsDeltaMethod(method)) &&
1763
+ stringValue(params.delta)) ||
1764
+ (method === "item/mcpToolCall/progress" && stringValue(params.message))) &&
1765
+ itemId(params)) {
1766
+ this.context?.reportActivity?.({
1767
+ kind: "turn_progress",
1768
+ method: "tool_delta",
1769
+ toolCallId: itemId(params)
1770
+ });
1771
+ }
1772
+ else if (method === "item/started" || method === "item/completed") {
1773
+ const item = recordValue(params.item);
1774
+ const id = stringValue(item?.id);
1775
+ if (!id ||
1776
+ !item ||
1777
+ !(["agentMessage", "reasoning", "plan"].includes(stringValue(item.type)) ||
1778
+ toolDescriptor(item)))
1779
+ return;
1780
+ const key = `${method}:${id}`;
1781
+ if (this.#seenItems.has(key))
1782
+ return;
1783
+ if (this.#seenItems.size >= 4096)
1784
+ this.#seenItems.delete(this.#seenItems.values().next().value);
1785
+ this.#seenItems.add(key);
1786
+ this.context?.reportActivity?.({
1787
+ kind: "turn_progress",
1788
+ method: "item_lifecycle",
1789
+ ...(toolDescriptor(item)
1790
+ ? { toolCallId: id, toolState: method === "item/started" ? "started" : "completed" }
1791
+ : {})
1792
+ });
1793
+ }
1794
+ }
1795
+ #handleProcessError(error) {
1796
+ if (this.#transportFailure)
1797
+ return;
1798
+ this.#transportFailure = error;
1799
+ this.#reader.close();
1800
+ this.#clearFinalizationTimer();
1801
+ this.#rejectPending(error);
1802
+ this.#invalidateInteractions("execution_lost");
1803
+ if (!this.#closing && !this.#terminal)
1804
+ this.#queue.fail(error);
1805
+ }
1806
+ #handleExit(exit) {
1807
+ this.#clearFinalizationTimer();
1808
+ if (this.#exited)
1809
+ return;
1810
+ this.#exited = true;
1811
+ this.#resolveExit(exit);
1812
+ const error = new CodexAppServerProcessError(this.processErrorMessage(exit), exit);
1813
+ this.#rejectPending(error);
1814
+ this.#invalidateInteractions("execution_lost");
1815
+ if (!this.#closing && !this.#terminal)
1816
+ this.#queue.fail(error);
1817
+ }
1818
+ #invalidateInteractions(reasonCode) {
1819
+ for (const [interactionId, pending] of this.#interactions) {
1820
+ clearTimeout(pending.timer);
1821
+ this.#interactionState(interactionId, pending.rpcId, "invalidated", reasonCode);
1822
+ }
1823
+ this.#interactions.clear();
1824
+ }
1825
+ #rejectPending(error) {
1826
+ for (const pending of this.#pending.values()) {
1827
+ clearTimeout(pending.timer);
1828
+ pending.reject(error);
1829
+ }
1830
+ this.#pending.clear();
1831
+ }
1832
+ }
1833
+ function defaultSpawn(command, args, options) {
1834
+ const child = spawn(command, [...args], {
1835
+ cwd: options.cwd,
1836
+ env: options.env,
1837
+ stdio: ["pipe", "pipe", "pipe"],
1838
+ detached: process.platform !== "win32",
1839
+ windowsHide: process.platform === "win32"
1840
+ });
1841
+ if (process.platform !== "win32")
1842
+ isolatedProcessGroups.add(child);
1843
+ return child;
1844
+ }
1845
+ const isolatedProcessGroups = new WeakSet();
1846
+ function signalProcessTree(child, signal) {
1847
+ if (isolatedProcessGroups.has(child) && child.pid !== undefined) {
1848
+ try {
1849
+ process.kill(-child.pid, signal);
1850
+ return;
1851
+ }
1852
+ catch (error) {
1853
+ if (error.code !== "ESRCH")
1854
+ throw error;
1855
+ }
1856
+ }
1857
+ child.kill(signal);
1858
+ }
1859
+ /** Shared params for thread/start and thread/resume; the permission policy is fixed at the thread level. */
1860
+ function threadParams(request, extra, environmentConfig) {
1861
+ return {
1862
+ ...extra,
1863
+ cwd: request.workdir,
1864
+ ...(request.agentConfig.model ? { model: request.agentConfig.model } : {}),
1865
+ sandbox: codexSandbox(request),
1866
+ // Dynamic MCP tools are untrusted until Codex asks the client to approve them. `never`
1867
+ // rejects those calls before the existing reverse-request handler can answer them.
1868
+ approvalPolicy: request.approvalMode === "assisted" ? "on-request" : "untrusted",
1869
+ ...(environmentConfig ? { config: environmentConfig } : {}),
1870
+ ...(extra.threadId ? {} : { developerInstructions: request.controlInstructions })
1871
+ };
1872
+ }
1873
+ /**
1874
+ * turn/start carries this turn's input plus the per-turn overridable model,
1875
+ * effort and reasoning summary. The summary must be sent explicitly: setting only
1876
+ * effort still consumes reasoning tokens, but the app-server does not guarantee
1877
+ * publishing summaryTextDelta, so a UI might see only an empty analysis lifecycle.
1878
+ */
1879
+ function turnParams(request, threadId, freshFallback = false) {
1880
+ const effort = mapReasoningEffort("codex", request.agentConfig.effort);
1881
+ return {
1882
+ threadId,
1883
+ input: [
1884
+ ...providerInputParts(request, freshFallback).map((part) => part.type === "image"
1885
+ ? { type: "image", url: `data:${part.mimeType};base64,${part.data}` }
1886
+ : { type: "text", text: part.text, text_elements: [] })
1887
+ ],
1888
+ cwd: request.workdir,
1889
+ ...(request.agentConfig.model ? { model: request.agentConfig.model } : {}),
1890
+ ...(effort ? { effort } : {}),
1891
+ summary: codexReasoningSummary(request)
1892
+ };
1893
+ }
1894
+ /**
1895
+ * The app-server will not automatically publish reasoning summary deltas just
1896
+ * because effort was set. Chat requests auto by default; callers can tighten or
1897
+ * disable it via providerOptions.reasoningSummary.
1898
+ */
1899
+ function codexReasoningSummary(request) {
1900
+ const configured = recordValue(request.agentConfig.providerOptions)?.reasoningSummary;
1901
+ const value = typeof configured === "string" ? configured : "auto";
1902
+ if (!["auto", "concise", "detailed", "none"].includes(value)) {
1903
+ throw new Error(`unsupported Codex reasoning summary: ${value}`);
1904
+ }
1905
+ return value;
1906
+ }
1907
+ function codexSandbox(request) {
1908
+ const value = request.approvalMode === "full_access"
1909
+ ? "danger-full-access"
1910
+ : (request.agentConfig.sandbox ?? "workspace-write");
1911
+ if (!["read-only", "workspace-write", "danger-full-access"].includes(value)) {
1912
+ throw new Error(`unsupported Codex sandbox mode: ${value}`);
1913
+ }
1914
+ if (request.approvalMode !== "full_access" && value === "danger-full-access")
1915
+ throw new Error("APPROVAL_SANDBOX_CONFLICT");
1916
+ return value;
1917
+ }
1918
+ function appServerRequestTimeout(request) {
1919
+ const configured = recordValue(request.agentConfig.providerOptions)?.appServerRequestTimeoutMs;
1920
+ return typeof configured === "number" && Number.isFinite(configured) && configured > 0
1921
+ ? configured
1922
+ : APP_SERVER_REQUEST_TIMEOUT_MS;
1923
+ }
1924
+ /**
1925
+ * Text deltas preserve provider arrival order. Analysis deltas additionally carry
1926
+ * an adapter-signed exposure classification so a presentation can fail closed.
1927
+ */
1928
+ function textDelta(params, channel, exposure, nativeEvent, stepId) {
1929
+ const text = stringValue(params.delta);
1930
+ if (!text)
1931
+ return [];
1932
+ const id = itemId(params);
1933
+ return [
1934
+ {
1935
+ protocolVersion: 2,
1936
+ type: "message.delta",
1937
+ payload: {
1938
+ text,
1939
+ channel,
1940
+ ...(id ? { messageId: id } : {}),
1941
+ ...(stepId ? { stepId } : {}),
1942
+ ...(exposure && nativeEvent
1943
+ ? {
1944
+ exposure,
1945
+ provenance: { provider: "codex", nativeEvent }
1946
+ }
1947
+ : {})
1948
+ }
1949
+ }
1950
+ ];
1951
+ }
1952
+ /** usage carries both this turn's increment (last) and the provider cumulative value (total). */
1953
+ function usageEvents(params) {
1954
+ const tokenUsage = recordValue(params.tokenUsage);
1955
+ const last = recordValue(tokenUsage?.last);
1956
+ const total = recordValue(tokenUsage?.total);
1957
+ if (!last && !total)
1958
+ return [];
1959
+ return [
1960
+ {
1961
+ protocolVersion: 2,
1962
+ type: "usage.update",
1963
+ payload: {
1964
+ ...(last ?? total ?? {}),
1965
+ ...(total ? { cumulative: total } : {}),
1966
+ ...(typeof tokenUsage?.modelContextWindow === "number"
1967
+ ? { modelContextWindow: tokenUsage.modelContextWindow }
1968
+ : {})
1969
+ }
1970
+ }
1971
+ ];
1972
+ }
1973
+ /** item started only creates the lifecycle object; it does not guess the final output here. */
1974
+ function itemStartedEvents(item, stepId) {
1975
+ if (!item)
1976
+ return [];
1977
+ const type = stringValue(item.type);
1978
+ const id = stringValue(item.id);
1979
+ if (type === "agentMessage") {
1980
+ const channel = agentMessageChannel(item);
1981
+ return [
1982
+ {
1983
+ protocolVersion: 2,
1984
+ type: "message.create",
1985
+ payload: {
1986
+ role: "assistant",
1987
+ status: "streaming",
1988
+ channel,
1989
+ ...(id ? { messageId: id } : {}),
1990
+ ...(stepId ? { stepId } : {})
1991
+ }
1992
+ }
1993
+ ];
1994
+ }
1995
+ if (type === "reasoning" || type === "plan") {
1996
+ const exposure = type === "plan" ? "public_plan" : "unknown";
1997
+ return [
1998
+ {
1999
+ protocolVersion: 2,
2000
+ type: "message.create",
2001
+ payload: {
2002
+ role: "assistant",
2003
+ status: "streaming",
2004
+ channel: "analysis",
2005
+ exposure,
2006
+ provenance: { provider: "codex", nativeEvent: "item/started" },
2007
+ ...(id ? { messageId: id } : {}),
2008
+ ...(stepId ? { stepId } : {})
2009
+ }
2010
+ }
2011
+ ];
2012
+ }
2013
+ const tool = toolDescriptor(item);
2014
+ return tool
2015
+ ? [
2016
+ {
2017
+ protocolVersion: 2,
2018
+ type: "tool_call.create",
2019
+ payload: {
2020
+ status: "running",
2021
+ id: tool.id,
2022
+ name: tool.name,
2023
+ args: tool.args,
2024
+ ...(stepId ? { stepId } : {})
2025
+ }
2026
+ }
2027
+ ]
2028
+ : [];
2029
+ }
2030
+ /** item completed closes the corresponding message/tool lifecycle and attaches the provider's final snapshot. */
2031
+ function itemCompletedEvents(item, stepId, knownChannel) {
2032
+ if (!item)
2033
+ return [];
2034
+ const type = stringValue(item.type);
2035
+ const id = stringValue(item.id);
2036
+ if (type === "agentMessage") {
2037
+ const channel = knownChannel ?? agentMessageChannel(item);
2038
+ return [
2039
+ {
2040
+ protocolVersion: 2,
2041
+ type: "message.update",
2042
+ payload: {
2043
+ role: "assistant",
2044
+ status: "completed",
2045
+ channel,
2046
+ ...(id ? { messageId: id } : {}),
2047
+ ...(stepId ? { stepId } : {}),
2048
+ ...(typeof item.text === "string" ? { text: item.text } : {})
2049
+ }
2050
+ }
2051
+ ];
2052
+ }
2053
+ if (type === "reasoning" || type === "plan") {
2054
+ const exposure = type === "plan" ? "public_plan" : "public_summary";
2055
+ const text = type === "plan" ? stringValue(item.text) : stringArray(item.summary).join("\n") || undefined;
2056
+ return [
2057
+ {
2058
+ protocolVersion: 2,
2059
+ type: "message.update",
2060
+ payload: {
2061
+ role: "assistant",
2062
+ status: "completed",
2063
+ channel: "analysis",
2064
+ exposure,
2065
+ provenance: { provider: "codex", nativeEvent: "item/completed" },
2066
+ ...(id ? { messageId: id } : {}),
2067
+ ...(stepId ? { stepId } : {}),
2068
+ ...(text ? { text } : {})
2069
+ }
2070
+ }
2071
+ ];
2072
+ }
2073
+ const tool = toolDescriptor(item);
2074
+ if (!tool)
2075
+ return [];
2076
+ return [
2077
+ {
2078
+ protocolVersion: 2,
2079
+ type: "tool_call.update",
2080
+ payload: {
2081
+ id: tool.id,
2082
+ status: canonicalTerminalStatus(toolStatus(item)),
2083
+ output: toolOutput(item),
2084
+ ...(stepId ? { stepId } : {}),
2085
+ ...(typeof item.exitCode === "number" ? { exitCode: item.exitCode } : {})
2086
+ }
2087
+ }
2088
+ ];
2089
+ }
2090
+ // Codex exposes its UI phase on agentMessage items. Normalize that provider
2091
+ // detail here so every downstream consumer sees only the shared channel model.
2092
+ function agentMessageChannel(item) {
2093
+ return stringValue(item?.phase) === "commentary" ? "commentary" : "final";
2094
+ }
2095
+ /** One-to-one mapping from a Codex turn terminal to an Octo Runtime run terminal. */
2096
+ function turnCompletedEvents(turn) {
2097
+ const status = stringValue(turn?.status);
2098
+ if (status === "interrupted") {
2099
+ return [{ protocolVersion: 2, type: "run.cancelled", payload: { reason: "interrupted" } }];
2100
+ }
2101
+ if (status === "failed") {
2102
+ const error = recordValue(turn?.error);
2103
+ return [
2104
+ {
2105
+ protocolVersion: 2,
2106
+ type: "run.failed",
2107
+ payload: {
2108
+ message: stringValue(error?.message) || "Codex turn failed",
2109
+ ...codexFailureDetails(error),
2110
+ ...(error ? { error } : {})
2111
+ }
2112
+ }
2113
+ ];
2114
+ }
2115
+ return [{ protocolVersion: 2, type: "run.completed", payload: {} }];
2116
+ }
2117
+ /** 仅转换 Provider 的结构化故障事实;是否自动重跑由 Extra 决定。 */
2118
+ function codexFailureDetails(error) {
2119
+ const info = error?.codexErrorInfo;
2120
+ if (info === "rateLimitExceeded")
2121
+ return { httpStatus: 429 };
2122
+ if (info === "serverOverloaded")
2123
+ return { httpStatus: 503 };
2124
+ if (info === "internalServerError")
2125
+ return { httpStatus: 500 };
2126
+ if (info === "unauthorized")
2127
+ return { httpStatus: 401 };
2128
+ if (info === "usageLimitExceeded")
2129
+ return { code: "PROVIDER_QUOTA_EXHAUSTED" };
2130
+ const detail = recordValue(info);
2131
+ for (const kind of [
2132
+ "httpConnectionFailed",
2133
+ "responseStreamConnectionFailed",
2134
+ "responseStreamDisconnected",
2135
+ "responseTooManyFailedAttempts"
2136
+ ]) {
2137
+ const value = recordValue(detail?.[kind]);
2138
+ if (!value)
2139
+ continue;
2140
+ const status = numberValue(value.httpStatusCode);
2141
+ return {
2142
+ ...(status === undefined || status >= 500 || status === 429
2143
+ ? { code: "PROVIDER_UNAVAILABLE" }
2144
+ : {}),
2145
+ ...(status !== undefined ? { httpStatus: status } : {})
2146
+ };
2147
+ }
2148
+ return {};
2149
+ }
2150
+ /**
2151
+ * Flatten the various Codex items into an Octo Runtime tool descriptor.
2152
+ *
2153
+ * name is the cross-provider display/lookup key; args preserve the structured raw
2154
+ * fields as much as possible. An unknown item returns undefined rather than
2155
+ * impersonating a tool, avoiding the Core persisting an unexplainable lifecycle.
2156
+ */
2157
+ function toolDescriptor(item) {
2158
+ const id = stringValue(item.id);
2159
+ if (!id)
2160
+ return undefined;
2161
+ switch (stringValue(item.type)) {
2162
+ case "commandExecution":
2163
+ return {
2164
+ id,
2165
+ name: "exec_command",
2166
+ args: {
2167
+ command: stringValue(item.command),
2168
+ ...(stringValue(item.cwd) ? { cwd: stringValue(item.cwd) } : {})
2169
+ }
2170
+ };
2171
+ case "fileChange":
2172
+ return { id, name: "apply_patch", args: { changes: item.changes ?? [] } };
2173
+ case "mcpToolCall": {
2174
+ const server = stringValue(item.server);
2175
+ const tool = stringValue(item.tool) || "tool";
2176
+ return {
2177
+ id,
2178
+ name: server ? `mcp__${server}__${tool}` : tool,
2179
+ args: recordValue(item.arguments) ?? { value: item.arguments }
2180
+ };
2181
+ }
2182
+ case "dynamicToolCall": {
2183
+ const namespace = stringValue(item.namespace);
2184
+ const tool = stringValue(item.tool) || "tool";
2185
+ return {
2186
+ id,
2187
+ name: namespace ? `${namespace}__${tool}` : tool,
2188
+ args: recordValue(item.arguments) ?? { value: item.arguments }
2189
+ };
2190
+ }
2191
+ case "collabAgentToolCall":
2192
+ return { id, name: stringValue(item.tool) || "collab_agent", args: { ...item } };
2193
+ case "webSearch":
2194
+ return { id, name: "web_search", args: { ...item } };
2195
+ case "imageView":
2196
+ return { id, name: "view_image", args: { path: item.path } };
2197
+ case "imageGeneration":
2198
+ return { id, name: "image_generation", args: { ...item } };
2199
+ case "sleep":
2200
+ return { id, name: "sleep", args: { ...item } };
2201
+ default:
2202
+ return undefined;
2203
+ }
2204
+ }
2205
+ /** Codex uses inProgress; the Octo Runtime canonical contract uses running. */
2206
+ function toolStatus(item) {
2207
+ const status = stringValue(item.status);
2208
+ if (status === "inProgress")
2209
+ return "running";
2210
+ if (status === "failed" && isRipgrepNoMatch(item))
2211
+ return "completed";
2212
+ return status || "completed";
2213
+ }
2214
+ /** ripgrep uses exit 1 for a successful search with no matches, not an execution error. */
2215
+ function isRipgrepNoMatch(item) {
2216
+ if (stringValue(item.type) !== "commandExecution" || item.exitCode !== 1)
2217
+ return false;
2218
+ if (stringValue(item.aggregatedOutput).trim() !== "")
2219
+ return false;
2220
+ let command = stringValue(item.command).trim();
2221
+ const wrapped = command.match(/^(?:\S+\/)?(?:sh|bash|zsh)\s+-\S*c\s+(["'])([\s\S]*)\1$/);
2222
+ if (wrapped)
2223
+ command = wrapped[2].trim();
2224
+ const finalCommand = command.split("&&").at(-1)?.trim() ?? "";
2225
+ return /^(?:command\s+)?(?:[^\s"'`]+\/)?rg(?:\s|$)/.test(finalCommand);
2226
+ }
2227
+ /** Extract compact output for common tools; other tools keep the full item as a forward-compatible fallback. */
2228
+ function toolOutput(item) {
2229
+ switch (stringValue(item.type)) {
2230
+ case "commandExecution":
2231
+ return item.aggregatedOutput ?? "";
2232
+ case "fileChange":
2233
+ return item.changes ?? [];
2234
+ case "mcpToolCall":
2235
+ return item.error ?? item.result ?? null;
2236
+ case "dynamicToolCall":
2237
+ return item.contentItems ?? null;
2238
+ default:
2239
+ return item;
2240
+ }
2241
+ }
2242
+ // Response shapes differ slightly across app-server versions, so the ID extractor accepts both top-level and nested fields.
2243
+ function extractThreadId(value) {
2244
+ const result = recordValue(value);
2245
+ const thread = recordValue(result?.thread);
2246
+ return (stringValue(result?.threadId) ||
2247
+ stringValue(result?.sessionId) ||
2248
+ stringValue(thread?.id) ||
2249
+ stringValue(thread?.sessionId));
2250
+ }
2251
+ function extractTurnId(value) {
2252
+ const result = recordValue(value);
2253
+ return stringValue(result?.turnId) || stringValue(recordValue(result?.turn)?.id);
2254
+ }
2255
+ function itemId(params) {
2256
+ return (stringValue(params.itemId) ||
2257
+ stringValue(params.callId) ||
2258
+ stringValue(recordValue(params.item)?.id));
2259
+ }
2260
+ function notificationTurnId(params) {
2261
+ return stringValue(params.turnId) || stringValue(recordValue(params.turn)?.id);
2262
+ }
2263
+ function turnStepStatus(turn) {
2264
+ switch (stringValue(turn?.status)) {
2265
+ case "failed":
2266
+ return "failed";
2267
+ case "interrupted":
2268
+ return "cancelled";
2269
+ default:
2270
+ return "completed";
2271
+ }
2272
+ }
2273
+ function isToolArgsDeltaMethod(method) {
2274
+ // Only accept known item namespaces, to avoid misprojecting an unrelated delta as tool arguments.
2275
+ return /^item\/(?:functionCall|toolCall|mcpToolCall|dynamicToolCall)\/(?:argumentsDelta|argsDelta|inputDelta|parametersDelta)$/.test(method);
2276
+ }
2277
+ function isTerminalEvent(event) {
2278
+ return (event.type === "run.completed" || event.type === "run.failed" || event.type === "run.cancelled");
2279
+ }
2280
+ function isThreadNotFound(error) {
2281
+ return error instanceof Error && /thread not found/i.test(error.message);
2282
+ }
2283
+ function rpcFailureReason(error) {
2284
+ // The side channel stores only a low-cardinality classification, not the full provider error which may contain paths/credentials, into the session.
2285
+ const message = error instanceof Error ? error.message : String(error);
2286
+ return /rollout path/i.test(message) ? "rollout_path_missing" : "resume_rejected";
2287
+ }
2288
+ function throwIfAborted(signal) {
2289
+ if (!signal?.aborted)
2290
+ return;
2291
+ throw signal.reason instanceof Error
2292
+ ? signal.reason
2293
+ : new Error(String(signal.reason ?? "cancelled"));
2294
+ }
2295
+ function parseRecord(line) {
2296
+ try {
2297
+ return recordValue(JSON.parse(line));
2298
+ }
2299
+ catch {
2300
+ // Occasional non-protocol text on stdout must not blow up the whole run; real diagnostics are still appended to the error from stderr.
2301
+ return undefined;
2302
+ }
2303
+ }
2304
+ function recordValue(value) {
2305
+ return value !== null && typeof value === "object" && !Array.isArray(value)
2306
+ ? value
2307
+ : undefined;
2308
+ }
2309
+ function stringValue(value) {
2310
+ return typeof value === "string" ? value : "";
2311
+ }
2312
+ function numberValue(value) {
2313
+ return typeof value === "number" && Number.isFinite(value) ? value : undefined;
2314
+ }
2315
+ function stringArray(value) {
2316
+ return Array.isArray(value)
2317
+ ? value.filter((item) => typeof item === "string")
2318
+ : [];
2319
+ }
2320
+ function rpcId(value) {
2321
+ return typeof value === "string" || typeof value === "number" ? value : undefined;
2322
+ }
2323
+ async function waitForExit(exit, timeoutMs) {
2324
+ let timer;
2325
+ return Promise.race([
2326
+ exit.then(() => true),
2327
+ new Promise((resolve) => {
2328
+ timer = setTimeout(() => resolve(false), timeoutMs);
2329
+ })
2330
+ ]).finally(() => {
2331
+ if (timer)
2332
+ clearTimeout(timer);
2333
+ });
2334
+ }