@mininglamp-oss/octo-runtime 1.1.5 → 1.1.7

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 (282) hide show
  1. package/apps/cli/dist/adapter-configurations.d.ts +4 -0
  2. package/apps/cli/dist/adapter-configurations.js +102 -0
  3. package/apps/cli/dist/build-info.json +2 -2
  4. package/apps/cli/dist/command-tree.js +1 -1
  5. package/apps/cli/dist/logs.js +8 -4
  6. package/apps/cli/dist/main.js +11 -5
  7. package/apps/cli/dist/output.js +5 -0
  8. package/apps/cli/dist/playboard.js +3 -2
  9. package/dist/public/dsh.d.ts +1 -1
  10. package/dist/public/dsh.js +1 -1
  11. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
  12. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  13. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +9 -1
  14. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +17 -0
  15. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  16. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +20 -2
  17. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  18. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +32 -2
  19. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +3 -0
  20. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  21. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +19 -6
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +8 -1
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +32 -2
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-CFKMMCO6.js} +6 -4
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-LO34KB7D.js} +1 -1
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-V5W6ZTYC.js +151 -0
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +5 -3
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +3 -1
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +17 -3
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +8 -6
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +2 -1
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +4 -3
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +9 -1
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +10 -6
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +9 -1
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +9 -1
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +9 -1
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.d.ts +2 -1
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +12 -40
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +22 -2
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +422 -135
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +6 -2
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +2 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +9 -1
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +9 -1
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +19 -5
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +15 -8
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +20 -2
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  71. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  74. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +1 -1
  75. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
  76. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +11 -5
  77. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
  79. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
  80. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.d.ts +2 -1
  81. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.js +102 -52
  82. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +8 -3
  83. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +5 -3
  84. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +4 -3
  85. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +9 -4
  86. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +2 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
  88. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +9 -6
  89. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
  90. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  91. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  93. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
  95. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
  96. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
  97. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  98. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
  99. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
  100. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
  101. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
  102. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  103. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  104. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.d.ts +17 -1
  105. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +22 -6
  106. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.d.ts +3 -0
  107. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.js +27 -0
  108. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +462 -228
  109. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.d.ts +5 -2
  110. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.js +42 -4
  111. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +5 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.d.ts +15 -0
  113. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.js +28 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +16 -5
  115. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +4 -5
  116. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +12 -9
  117. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +1 -0
  118. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +7 -5
  119. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.d.ts +15 -0
  120. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.js +36 -0
  121. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.d.ts +2 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.js +10 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +5 -2
  124. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +39 -22
  125. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
  128. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
  129. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +14 -1
  130. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +4 -0
  131. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +7 -1
  132. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.js +265 -38
  133. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.d.ts +4 -0
  134. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +5 -5
  135. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +7 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +19 -2
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.d.ts +3 -1
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +4 -3
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.d.ts +0 -12
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js +5 -3
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +2 -1
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +8 -6
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.d.ts +3 -0
  144. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.js +2 -2
  145. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.d.ts +2 -2
  146. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.js +27 -15
  147. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +17 -1
  148. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +217 -50
  149. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +2 -4
  150. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.d.ts +3 -2
  151. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.js +41 -12
  152. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.d.ts +2 -6
  153. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +53 -82
  154. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.d.ts +12 -0
  155. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.js +133 -0
  156. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.d.ts +21 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.js +76 -0
  158. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +0 -2
  159. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +0 -2
  160. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.d.ts +16 -0
  161. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.js +74 -0
  162. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.d.ts +4 -0
  163. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.js +19 -0
  164. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.d.ts +7 -0
  165. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.js +90 -0
  166. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +39 -2
  167. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.d.ts +6 -0
  168. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.js +60 -0
  169. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +2 -1
  170. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +20 -8
  171. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  172. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +10 -2
  173. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +14 -1
  174. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.js +2 -3
  175. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  176. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  177. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.d.ts +3 -2
  178. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +11 -4
  179. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +2 -0
  180. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
  181. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  182. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +8 -1
  183. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -1
  184. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
  185. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +18 -0
  186. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +3 -0
  187. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +6 -0
  188. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +14 -0
  189. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  190. package/node_modules/iconv-lite/LICENSE +21 -0
  191. package/node_modules/iconv-lite/README.md +138 -0
  192. package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  193. package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  194. package/node_modules/iconv-lite/encodings/index.js +23 -0
  195. package/node_modules/iconv-lite/encodings/internal.js +218 -0
  196. package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  197. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  198. package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
  199. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  200. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  201. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  202. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  203. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  204. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  205. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  206. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  207. package/node_modules/iconv-lite/encodings/utf16.js +187 -0
  208. package/node_modules/iconv-lite/encodings/utf32.js +314 -0
  209. package/node_modules/iconv-lite/encodings/utf7.js +283 -0
  210. package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  211. package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  212. package/node_modules/iconv-lite/lib/index.d.ts +129 -0
  213. package/node_modules/iconv-lite/lib/index.js +182 -0
  214. package/node_modules/iconv-lite/lib/streams.js +105 -0
  215. package/node_modules/iconv-lite/package.json +70 -0
  216. package/node_modules/iconv-lite/types/encodings.d.ts +425 -0
  217. package/node_modules/safer-buffer/LICENSE +21 -0
  218. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  219. package/node_modules/safer-buffer/Readme.md +156 -0
  220. package/node_modules/safer-buffer/dangerous.js +58 -0
  221. package/node_modules/safer-buffer/package.json +34 -0
  222. package/node_modules/safer-buffer/safer.js +77 -0
  223. package/node_modules/safer-buffer/tests.js +406 -0
  224. package/node_modules/semver/LICENSE +15 -0
  225. package/node_modules/semver/README.md +680 -0
  226. package/node_modules/semver/bin/semver.js +195 -0
  227. package/node_modules/semver/classes/comparator.js +143 -0
  228. package/node_modules/semver/classes/index.js +7 -0
  229. package/node_modules/semver/classes/range.js +577 -0
  230. package/node_modules/semver/classes/semver.js +350 -0
  231. package/node_modules/semver/functions/clean.js +8 -0
  232. package/node_modules/semver/functions/cmp.js +54 -0
  233. package/node_modules/semver/functions/coerce.js +62 -0
  234. package/node_modules/semver/functions/compare-build.js +9 -0
  235. package/node_modules/semver/functions/compare-loose.js +5 -0
  236. package/node_modules/semver/functions/compare.js +7 -0
  237. package/node_modules/semver/functions/diff.js +60 -0
  238. package/node_modules/semver/functions/eq.js +5 -0
  239. package/node_modules/semver/functions/gt.js +5 -0
  240. package/node_modules/semver/functions/gte.js +5 -0
  241. package/node_modules/semver/functions/inc.js +21 -0
  242. package/node_modules/semver/functions/lt.js +5 -0
  243. package/node_modules/semver/functions/lte.js +5 -0
  244. package/node_modules/semver/functions/major.js +5 -0
  245. package/node_modules/semver/functions/minor.js +5 -0
  246. package/node_modules/semver/functions/neq.js +5 -0
  247. package/node_modules/semver/functions/parse.js +18 -0
  248. package/node_modules/semver/functions/patch.js +5 -0
  249. package/node_modules/semver/functions/prerelease.js +8 -0
  250. package/node_modules/semver/functions/rcompare.js +5 -0
  251. package/node_modules/semver/functions/rsort.js +5 -0
  252. package/node_modules/semver/functions/satisfies.js +12 -0
  253. package/node_modules/semver/functions/sort.js +5 -0
  254. package/node_modules/semver/functions/truncate.js +48 -0
  255. package/node_modules/semver/functions/valid.js +8 -0
  256. package/node_modules/semver/index.js +93 -0
  257. package/node_modules/semver/internal/constants.js +37 -0
  258. package/node_modules/semver/internal/debug.js +11 -0
  259. package/node_modules/semver/internal/identifiers.js +29 -0
  260. package/node_modules/semver/internal/lrucache.js +42 -0
  261. package/node_modules/semver/internal/parse-options.js +17 -0
  262. package/node_modules/semver/internal/re.js +223 -0
  263. package/node_modules/semver/package.json +78 -0
  264. package/node_modules/semver/preload.js +4 -0
  265. package/node_modules/semver/range.bnf +17 -0
  266. package/node_modules/semver/ranges/gtr.js +6 -0
  267. package/node_modules/semver/ranges/intersects.js +9 -0
  268. package/node_modules/semver/ranges/ltr.js +6 -0
  269. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  270. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  271. package/node_modules/semver/ranges/min-version.js +63 -0
  272. package/node_modules/semver/ranges/outside.js +82 -0
  273. package/node_modules/semver/ranges/simplify.js +49 -0
  274. package/node_modules/semver/ranges/subset.js +249 -0
  275. package/node_modules/semver/ranges/to-comparators.js +10 -0
  276. package/node_modules/semver/ranges/valid.js +13 -0
  277. package/package.json +33 -27
  278. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  279. package/packages/octo-runtime-protocol/schema/protocol.schema.json +57 -1
  280. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-G5PWGRL5.js +0 -209
  281. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
  282. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
@@ -0,0 +1,406 @@
1
+ /* eslint-disable node/no-deprecated-api */
2
+
3
+ 'use strict'
4
+
5
+ var test = require('tape')
6
+
7
+ var buffer = require('buffer')
8
+
9
+ var index = require('./')
10
+ var safer = require('./safer')
11
+ var dangerous = require('./dangerous')
12
+
13
+ /* Inheritance tests */
14
+
15
+ test('Default is Safer', function (t) {
16
+ t.equal(index, safer)
17
+ t.notEqual(safer, dangerous)
18
+ t.notEqual(index, dangerous)
19
+ t.end()
20
+ })
21
+
22
+ test('Is not a function', function (t) {
23
+ [index, safer, dangerous].forEach(function (impl) {
24
+ t.equal(typeof impl, 'object')
25
+ t.equal(typeof impl.Buffer, 'object')
26
+ });
27
+ [buffer].forEach(function (impl) {
28
+ t.equal(typeof impl, 'object')
29
+ t.equal(typeof impl.Buffer, 'function')
30
+ })
31
+ t.end()
32
+ })
33
+
34
+ test('Constructor throws', function (t) {
35
+ [index, safer, dangerous].forEach(function (impl) {
36
+ t.throws(function () { impl.Buffer() })
37
+ t.throws(function () { impl.Buffer(0) })
38
+ t.throws(function () { impl.Buffer('a') })
39
+ t.throws(function () { impl.Buffer('a', 'utf-8') })
40
+ t.throws(function () { return new impl.Buffer() })
41
+ t.throws(function () { return new impl.Buffer(0) })
42
+ t.throws(function () { return new impl.Buffer('a') })
43
+ t.throws(function () { return new impl.Buffer('a', 'utf-8') })
44
+ })
45
+ t.end()
46
+ })
47
+
48
+ test('Safe methods exist', function (t) {
49
+ [index, safer, dangerous].forEach(function (impl) {
50
+ t.equal(typeof impl.Buffer.alloc, 'function', 'alloc')
51
+ t.equal(typeof impl.Buffer.from, 'function', 'from')
52
+ })
53
+ t.end()
54
+ })
55
+
56
+ test('Unsafe methods exist only in Dangerous', function (t) {
57
+ [index, safer].forEach(function (impl) {
58
+ t.equal(typeof impl.Buffer.allocUnsafe, 'undefined')
59
+ t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined')
60
+ });
61
+ [dangerous].forEach(function (impl) {
62
+ t.equal(typeof impl.Buffer.allocUnsafe, 'function')
63
+ t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function')
64
+ })
65
+ t.end()
66
+ })
67
+
68
+ test('Generic methods/properties are defined and equal', function (t) {
69
+ ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) {
70
+ [index, safer, dangerous].forEach(function (impl) {
71
+ t.equal(impl.Buffer[method], buffer.Buffer[method], method)
72
+ t.notEqual(typeof impl.Buffer[method], 'undefined', method)
73
+ })
74
+ })
75
+ t.end()
76
+ })
77
+
78
+ test('Built-in buffer static methods/properties are inherited', function (t) {
79
+ Object.keys(buffer).forEach(function (method) {
80
+ if (method === 'SlowBuffer' || method === 'Buffer') return;
81
+ [index, safer, dangerous].forEach(function (impl) {
82
+ t.equal(impl[method], buffer[method], method)
83
+ t.notEqual(typeof impl[method], 'undefined', method)
84
+ })
85
+ })
86
+ t.end()
87
+ })
88
+
89
+ test('Built-in Buffer static methods/properties are inherited', function (t) {
90
+ Object.keys(buffer.Buffer).forEach(function (method) {
91
+ if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
92
+ [index, safer, dangerous].forEach(function (impl) {
93
+ t.equal(impl.Buffer[method], buffer.Buffer[method], method)
94
+ t.notEqual(typeof impl.Buffer[method], 'undefined', method)
95
+ })
96
+ })
97
+ t.end()
98
+ })
99
+
100
+ test('.prototype property of Buffer is inherited', function (t) {
101
+ [index, safer, dangerous].forEach(function (impl) {
102
+ t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype')
103
+ t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype')
104
+ })
105
+ t.end()
106
+ })
107
+
108
+ test('All Safer methods are present in Dangerous', function (t) {
109
+ Object.keys(safer).forEach(function (method) {
110
+ if (method === 'Buffer') return;
111
+ [index, safer, dangerous].forEach(function (impl) {
112
+ t.equal(impl[method], safer[method], method)
113
+ if (method !== 'kStringMaxLength') {
114
+ t.notEqual(typeof impl[method], 'undefined', method)
115
+ }
116
+ })
117
+ })
118
+ Object.keys(safer.Buffer).forEach(function (method) {
119
+ [index, safer, dangerous].forEach(function (impl) {
120
+ t.equal(impl.Buffer[method], safer.Buffer[method], method)
121
+ t.notEqual(typeof impl.Buffer[method], 'undefined', method)
122
+ })
123
+ })
124
+ t.end()
125
+ })
126
+
127
+ test('Safe methods from Dangerous methods are present in Safer', function (t) {
128
+ Object.keys(dangerous).forEach(function (method) {
129
+ if (method === 'Buffer') return;
130
+ [index, safer, dangerous].forEach(function (impl) {
131
+ t.equal(impl[method], dangerous[method], method)
132
+ if (method !== 'kStringMaxLength') {
133
+ t.notEqual(typeof impl[method], 'undefined', method)
134
+ }
135
+ })
136
+ })
137
+ Object.keys(dangerous.Buffer).forEach(function (method) {
138
+ if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
139
+ [index, safer, dangerous].forEach(function (impl) {
140
+ t.equal(impl.Buffer[method], dangerous.Buffer[method], method)
141
+ t.notEqual(typeof impl.Buffer[method], 'undefined', method)
142
+ })
143
+ })
144
+ t.end()
145
+ })
146
+
147
+ /* Behaviour tests */
148
+
149
+ test('Methods return Buffers', function (t) {
150
+ [index, safer, dangerous].forEach(function (impl) {
151
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0)))
152
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10)))
153
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a')))
154
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10)))
155
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x')))
156
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab')))
157
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('')))
158
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string')))
159
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8')))
160
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64')))
161
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3])))
162
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3]))))
163
+ t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([])))
164
+ });
165
+ ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
166
+ t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0)))
167
+ t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10)))
168
+ })
169
+ t.end()
170
+ })
171
+
172
+ test('Constructor is buffer.Buffer', function (t) {
173
+ [index, safer, dangerous].forEach(function (impl) {
174
+ t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer)
175
+ t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer)
176
+ t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer)
177
+ t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer)
178
+ t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer)
179
+ t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer)
180
+ t.equal(impl.Buffer.from('').constructor, buffer.Buffer)
181
+ t.equal(impl.Buffer.from('string').constructor, buffer.Buffer)
182
+ t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer)
183
+ t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer)
184
+ t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer)
185
+ t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer)
186
+ t.equal(impl.Buffer.from([]).constructor, buffer.Buffer)
187
+ });
188
+ [0, 10, 100].forEach(function (arg) {
189
+ t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer)
190
+ t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor)
191
+ })
192
+ t.end()
193
+ })
194
+
195
+ test('Invalid calls throw', function (t) {
196
+ [index, safer, dangerous].forEach(function (impl) {
197
+ t.throws(function () { impl.Buffer.from(0) })
198
+ t.throws(function () { impl.Buffer.from(10) })
199
+ t.throws(function () { impl.Buffer.from(10, 'utf-8') })
200
+ t.throws(function () { impl.Buffer.from('string', 'invalid encoding') })
201
+ t.throws(function () { impl.Buffer.from(-10) })
202
+ t.throws(function () { impl.Buffer.from(1e90) })
203
+ t.throws(function () { impl.Buffer.from(Infinity) })
204
+ t.throws(function () { impl.Buffer.from(-Infinity) })
205
+ t.throws(function () { impl.Buffer.from(NaN) })
206
+ t.throws(function () { impl.Buffer.from(null) })
207
+ t.throws(function () { impl.Buffer.from(undefined) })
208
+ t.throws(function () { impl.Buffer.from() })
209
+ t.throws(function () { impl.Buffer.from({}) })
210
+ t.throws(function () { impl.Buffer.alloc('') })
211
+ t.throws(function () { impl.Buffer.alloc('string') })
212
+ t.throws(function () { impl.Buffer.alloc('string', 'utf-8') })
213
+ t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') })
214
+ t.throws(function () { impl.Buffer.alloc(-10) })
215
+ t.throws(function () { impl.Buffer.alloc(1e90) })
216
+ t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) })
217
+ t.throws(function () { impl.Buffer.alloc(Infinity) })
218
+ t.throws(function () { impl.Buffer.alloc(-Infinity) })
219
+ t.throws(function () { impl.Buffer.alloc(null) })
220
+ t.throws(function () { impl.Buffer.alloc(undefined) })
221
+ t.throws(function () { impl.Buffer.alloc() })
222
+ t.throws(function () { impl.Buffer.alloc([]) })
223
+ t.throws(function () { impl.Buffer.alloc([0, 42, 3]) })
224
+ t.throws(function () { impl.Buffer.alloc({}) })
225
+ });
226
+ ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
227
+ t.throws(function () { dangerous.Buffer[method]('') })
228
+ t.throws(function () { dangerous.Buffer[method]('string') })
229
+ t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') })
230
+ t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) })
231
+ t.throws(function () { dangerous.Buffer[method](Infinity) })
232
+ if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) {
233
+ t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0')
234
+ } else {
235
+ t.throws(function () { dangerous.Buffer[method](-10) })
236
+ t.throws(function () { dangerous.Buffer[method](-1e90) })
237
+ t.throws(function () { dangerous.Buffer[method](-Infinity) })
238
+ }
239
+ t.throws(function () { dangerous.Buffer[method](null) })
240
+ t.throws(function () { dangerous.Buffer[method](undefined) })
241
+ t.throws(function () { dangerous.Buffer[method]() })
242
+ t.throws(function () { dangerous.Buffer[method]([]) })
243
+ t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) })
244
+ t.throws(function () { dangerous.Buffer[method]({}) })
245
+ })
246
+ t.end()
247
+ })
248
+
249
+ test('Buffers have appropriate lengths', function (t) {
250
+ [index, safer, dangerous].forEach(function (impl) {
251
+ t.equal(impl.Buffer.alloc(0).length, 0)
252
+ t.equal(impl.Buffer.alloc(10).length, 10)
253
+ t.equal(impl.Buffer.from('').length, 0)
254
+ t.equal(impl.Buffer.from('string').length, 6)
255
+ t.equal(impl.Buffer.from('string', 'utf-8').length, 6)
256
+ t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11)
257
+ t.equal(impl.Buffer.from([0, 42, 3]).length, 3)
258
+ t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3)
259
+ t.equal(impl.Buffer.from([]).length, 0)
260
+ });
261
+ ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
262
+ t.equal(dangerous.Buffer[method](0).length, 0)
263
+ t.equal(dangerous.Buffer[method](10).length, 10)
264
+ })
265
+ t.end()
266
+ })
267
+
268
+ test('Buffers have appropriate lengths (2)', function (t) {
269
+ t.equal(index.Buffer.alloc, safer.Buffer.alloc)
270
+ t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
271
+ var ok = true;
272
+ [ safer.Buffer.alloc,
273
+ dangerous.Buffer.allocUnsafe,
274
+ dangerous.Buffer.allocUnsafeSlow
275
+ ].forEach(function (method) {
276
+ for (var i = 0; i < 1e2; i++) {
277
+ var length = Math.round(Math.random() * 1e5)
278
+ var buf = method(length)
279
+ if (!buffer.Buffer.isBuffer(buf)) ok = false
280
+ if (buf.length !== length) ok = false
281
+ }
282
+ })
283
+ t.ok(ok)
284
+ t.end()
285
+ })
286
+
287
+ test('.alloc(size) is zero-filled and has correct length', function (t) {
288
+ t.equal(index.Buffer.alloc, safer.Buffer.alloc)
289
+ t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
290
+ var ok = true
291
+ for (var i = 0; i < 1e2; i++) {
292
+ var length = Math.round(Math.random() * 2e6)
293
+ var buf = index.Buffer.alloc(length)
294
+ if (!buffer.Buffer.isBuffer(buf)) ok = false
295
+ if (buf.length !== length) ok = false
296
+ var j
297
+ for (j = 0; j < length; j++) {
298
+ if (buf[j] !== 0) ok = false
299
+ }
300
+ buf.fill(1)
301
+ for (j = 0; j < length; j++) {
302
+ if (buf[j] !== 1) ok = false
303
+ }
304
+ }
305
+ t.ok(ok)
306
+ t.end()
307
+ })
308
+
309
+ test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) {
310
+ ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
311
+ var ok = true
312
+ for (var i = 0; i < 1e2; i++) {
313
+ var length = Math.round(Math.random() * 2e6)
314
+ var buf = dangerous.Buffer[method](length)
315
+ if (!buffer.Buffer.isBuffer(buf)) ok = false
316
+ if (buf.length !== length) ok = false
317
+ buf.fill(0, 0, length)
318
+ var j
319
+ for (j = 0; j < length; j++) {
320
+ if (buf[j] !== 0) ok = false
321
+ }
322
+ buf.fill(1, 0, length)
323
+ for (j = 0; j < length; j++) {
324
+ if (buf[j] !== 1) ok = false
325
+ }
326
+ }
327
+ t.ok(ok, method)
328
+ })
329
+ t.end()
330
+ })
331
+
332
+ test('.alloc(size, fill) is `fill`-filled', function (t) {
333
+ t.equal(index.Buffer.alloc, safer.Buffer.alloc)
334
+ t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
335
+ var ok = true
336
+ for (var i = 0; i < 1e2; i++) {
337
+ var length = Math.round(Math.random() * 2e6)
338
+ var fill = Math.round(Math.random() * 255)
339
+ var buf = index.Buffer.alloc(length, fill)
340
+ if (!buffer.Buffer.isBuffer(buf)) ok = false
341
+ if (buf.length !== length) ok = false
342
+ for (var j = 0; j < length; j++) {
343
+ if (buf[j] !== fill) ok = false
344
+ }
345
+ }
346
+ t.ok(ok)
347
+ t.end()
348
+ })
349
+
350
+ test('.alloc(size, fill) is `fill`-filled', function (t) {
351
+ t.equal(index.Buffer.alloc, safer.Buffer.alloc)
352
+ t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
353
+ var ok = true
354
+ for (var i = 0; i < 1e2; i++) {
355
+ var length = Math.round(Math.random() * 2e6)
356
+ var fill = Math.round(Math.random() * 255)
357
+ var buf = index.Buffer.alloc(length, fill)
358
+ if (!buffer.Buffer.isBuffer(buf)) ok = false
359
+ if (buf.length !== length) ok = false
360
+ for (var j = 0; j < length; j++) {
361
+ if (buf[j] !== fill) ok = false
362
+ }
363
+ }
364
+ t.ok(ok)
365
+ t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97))
366
+ t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98))
367
+
368
+ var tmp = new buffer.Buffer(2)
369
+ tmp.fill('ok')
370
+ if (tmp[1] === tmp[0]) {
371
+ // Outdated Node.js
372
+ t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo'))
373
+ } else {
374
+ t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko'))
375
+ }
376
+ t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok'))
377
+
378
+ t.end()
379
+ })
380
+
381
+ test('safer.Buffer.from returns results same as Buffer constructor', function (t) {
382
+ [index, safer, dangerous].forEach(function (impl) {
383
+ t.deepEqual(impl.Buffer.from(''), new buffer.Buffer(''))
384
+ t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string'))
385
+ t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8'))
386
+ t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64'))
387
+ t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3]))
388
+ t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3])))
389
+ t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([]))
390
+ })
391
+ t.end()
392
+ })
393
+
394
+ test('safer.Buffer.from returns consistent results', function (t) {
395
+ [index, safer, dangerous].forEach(function (impl) {
396
+ t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0))
397
+ t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0))
398
+ t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0))
399
+ t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string'))
400
+ t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103]))
401
+ t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string')))
402
+ t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree'))
403
+ t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree'))
404
+ })
405
+ t.end()
406
+ })
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.