@quantiya/codevibe-claude-plugin 1.0.12 → 1.0.13

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 (438) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/package.json +10 -3
  3. package/node_modules/@quantiya/codevibe-core/README.md +0 -179
  4. package/node_modules/@quantiya/codevibe-core/bin/codevibe.js +0 -7
  5. package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +0 -132
  6. package/node_modules/@quantiya/codevibe-core/dist/appsync/index.d.ts +0 -2
  7. package/node_modules/@quantiya/codevibe-core/dist/appsync/queries.d.ts +0 -16
  8. package/node_modules/@quantiya/codevibe-core/dist/auth/auth-cli.d.ts +0 -5
  9. package/node_modules/@quantiya/codevibe-core/dist/auth/auth-service.d.ts +0 -87
  10. package/node_modules/@quantiya/codevibe-core/dist/auth/fetch-helpers.d.ts +0 -11
  11. package/node_modules/@quantiya/codevibe-core/dist/auth/index.d.ts +0 -2
  12. package/node_modules/@quantiya/codevibe-core/dist/config/config.d.ts +0 -53
  13. package/node_modules/@quantiya/codevibe-core/dist/config/index.d.ts +0 -2
  14. package/node_modules/@quantiya/codevibe-core/dist/crypto/crypto-service.d.ts +0 -118
  15. package/node_modules/@quantiya/codevibe-core/dist/crypto/index.d.ts +0 -1
  16. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +0 -14
  17. package/node_modules/@quantiya/codevibe-core/dist/index.js +0 -217
  18. package/node_modules/@quantiya/codevibe-core/dist/keychain/index.d.ts +0 -1
  19. package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-manager.d.ts +0 -125
  20. package/node_modules/@quantiya/codevibe-core/dist/logger/index.d.ts +0 -1
  21. package/node_modules/@quantiya/codevibe-core/dist/logger/logger.d.ts +0 -35
  22. package/node_modules/@quantiya/codevibe-core/dist/prompt-parser.d.ts +0 -39
  23. package/node_modules/@quantiya/codevibe-core/dist/session/index.d.ts +0 -2
  24. package/node_modules/@quantiya/codevibe-core/dist/session/session-resume.d.ts +0 -55
  25. package/node_modules/@quantiya/codevibe-core/dist/types/auth.d.ts +0 -15
  26. package/node_modules/@quantiya/codevibe-core/dist/types/encryption.d.ts +0 -54
  27. package/node_modules/@quantiya/codevibe-core/dist/types/events.d.ts +0 -74
  28. package/node_modules/@quantiya/codevibe-core/dist/types/index.d.ts +0 -4
  29. package/node_modules/@quantiya/codevibe-core/dist/types/session.d.ts +0 -59
  30. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/CHANGELOG.md +0 -274
  31. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/CONTRIBUTING.md +0 -18
  32. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/LICENSE.md +0 -9
  33. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/README.md +0 -466
  34. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/bin/uuid +0 -2
  35. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/index.js +0 -79
  36. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/md5.js +0 -223
  37. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/native.js +0 -11
  38. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/nil.js +0 -8
  39. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/parse.js +0 -45
  40. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/regex.js +0 -8
  41. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/rng.js +0 -25
  42. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/sha1.js +0 -104
  43. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/stringify.js +0 -44
  44. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/v1.js +0 -107
  45. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/v3.js +0 -16
  46. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/v35.js +0 -80
  47. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/v4.js +0 -43
  48. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/v5.js +0 -16
  49. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/validate.js +0 -17
  50. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/commonjs-browser/version.js +0 -21
  51. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/index.js +0 -9
  52. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/md5.js +0 -215
  53. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/native.js +0 -4
  54. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/nil.js +0 -1
  55. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/parse.js +0 -35
  56. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/regex.js +0 -1
  57. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/rng.js +0 -18
  58. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/sha1.js +0 -96
  59. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/stringify.js +0 -33
  60. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/v1.js +0 -95
  61. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/v3.js +0 -4
  62. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/v35.js +0 -66
  63. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/v4.js +0 -29
  64. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/v5.js +0 -4
  65. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/validate.js +0 -7
  66. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-browser/version.js +0 -11
  67. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/index.js +0 -9
  68. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/md5.js +0 -13
  69. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/native.js +0 -4
  70. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/nil.js +0 -1
  71. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/parse.js +0 -35
  72. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/regex.js +0 -1
  73. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/rng.js +0 -12
  74. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/sha1.js +0 -13
  75. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/stringify.js +0 -33
  76. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/v1.js +0 -95
  77. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/v3.js +0 -4
  78. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/v35.js +0 -66
  79. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/v4.js +0 -29
  80. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/v5.js +0 -4
  81. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/validate.js +0 -7
  82. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/esm-node/version.js +0 -11
  83. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/index.js +0 -79
  84. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/md5-browser.js +0 -223
  85. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/md5.js +0 -23
  86. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/native-browser.js +0 -11
  87. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/native.js +0 -15
  88. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/nil.js +0 -8
  89. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/parse.js +0 -45
  90. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/regex.js +0 -8
  91. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/rng-browser.js +0 -25
  92. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/rng.js +0 -24
  93. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/sha1-browser.js +0 -104
  94. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/sha1.js +0 -23
  95. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/stringify.js +0 -44
  96. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/uuid-bin.js +0 -85
  97. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/v1.js +0 -107
  98. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/v3.js +0 -16
  99. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/v35.js +0 -80
  100. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/v4.js +0 -43
  101. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/v5.js +0 -16
  102. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/validate.js +0 -17
  103. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/dist/version.js +0 -21
  104. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/package.json +0 -135
  105. package/node_modules/@quantiya/codevibe-core/node_modules/uuid/wrapper.mjs +0 -10
  106. package/node_modules/@quantiya/codevibe-core/package.json +0 -54
  107. package/node_modules/base64-js/LICENSE +0 -21
  108. package/node_modules/base64-js/README.md +0 -34
  109. package/node_modules/base64-js/base64js.min.js +0 -1
  110. package/node_modules/base64-js/index.d.ts +0 -3
  111. package/node_modules/base64-js/index.js +0 -150
  112. package/node_modules/base64-js/package.json +0 -47
  113. package/node_modules/bl/.travis.yml +0 -17
  114. package/node_modules/bl/BufferList.js +0 -396
  115. package/node_modules/bl/LICENSE.md +0 -13
  116. package/node_modules/bl/README.md +0 -247
  117. package/node_modules/bl/bl.js +0 -84
  118. package/node_modules/bl/package.json +0 -37
  119. package/node_modules/bl/test/convert.js +0 -21
  120. package/node_modules/bl/test/indexOf.js +0 -492
  121. package/node_modules/bl/test/isBufferList.js +0 -32
  122. package/node_modules/bl/test/test.js +0 -869
  123. package/node_modules/buffer/AUTHORS.md +0 -70
  124. package/node_modules/buffer/LICENSE +0 -21
  125. package/node_modules/buffer/README.md +0 -410
  126. package/node_modules/buffer/index.d.ts +0 -186
  127. package/node_modules/buffer/index.js +0 -1817
  128. package/node_modules/buffer/package.json +0 -96
  129. package/node_modules/chownr/LICENSE +0 -15
  130. package/node_modules/chownr/README.md +0 -3
  131. package/node_modules/chownr/chownr.js +0 -167
  132. package/node_modules/chownr/package.json +0 -29
  133. package/node_modules/decompress-response/index.d.ts +0 -22
  134. package/node_modules/decompress-response/index.js +0 -58
  135. package/node_modules/decompress-response/license +0 -9
  136. package/node_modules/decompress-response/package.json +0 -56
  137. package/node_modules/decompress-response/readme.md +0 -48
  138. package/node_modules/deep-extend/CHANGELOG.md +0 -46
  139. package/node_modules/deep-extend/LICENSE +0 -20
  140. package/node_modules/deep-extend/README.md +0 -91
  141. package/node_modules/deep-extend/index.js +0 -1
  142. package/node_modules/deep-extend/lib/deep-extend.js +0 -150
  143. package/node_modules/deep-extend/package.json +0 -62
  144. package/node_modules/detect-libc/LICENSE +0 -201
  145. package/node_modules/detect-libc/README.md +0 -163
  146. package/node_modules/detect-libc/index.d.ts +0 -14
  147. package/node_modules/detect-libc/lib/detect-libc.js +0 -313
  148. package/node_modules/detect-libc/lib/elf.js +0 -39
  149. package/node_modules/detect-libc/lib/filesystem.js +0 -51
  150. package/node_modules/detect-libc/lib/process.js +0 -24
  151. package/node_modules/detect-libc/package.json +0 -44
  152. package/node_modules/end-of-stream/LICENSE +0 -21
  153. package/node_modules/end-of-stream/README.md +0 -54
  154. package/node_modules/end-of-stream/index.js +0 -96
  155. package/node_modules/end-of-stream/package.json +0 -37
  156. package/node_modules/expand-template/.travis.yml +0 -6
  157. package/node_modules/expand-template/LICENSE +0 -21
  158. package/node_modules/expand-template/README.md +0 -43
  159. package/node_modules/expand-template/index.js +0 -26
  160. package/node_modules/expand-template/package.json +0 -29
  161. package/node_modules/expand-template/test.js +0 -67
  162. package/node_modules/fs-constants/LICENSE +0 -21
  163. package/node_modules/fs-constants/README.md +0 -26
  164. package/node_modules/fs-constants/browser.js +0 -1
  165. package/node_modules/fs-constants/index.js +0 -1
  166. package/node_modules/fs-constants/package.json +0 -19
  167. package/node_modules/github-from-package/.travis.yml +0 -4
  168. package/node_modules/github-from-package/LICENSE +0 -18
  169. package/node_modules/github-from-package/example/package.json +0 -8
  170. package/node_modules/github-from-package/example/url.js +0 -3
  171. package/node_modules/github-from-package/index.js +0 -17
  172. package/node_modules/github-from-package/package.json +0 -30
  173. package/node_modules/github-from-package/readme.markdown +0 -53
  174. package/node_modules/github-from-package/test/a.json +0 -8
  175. package/node_modules/github-from-package/test/b.json +0 -5
  176. package/node_modules/github-from-package/test/c.json +0 -5
  177. package/node_modules/github-from-package/test/d.json +0 -7
  178. package/node_modules/github-from-package/test/e.json +0 -5
  179. package/node_modules/github-from-package/test/url.js +0 -19
  180. package/node_modules/ieee754/LICENSE +0 -11
  181. package/node_modules/ieee754/README.md +0 -51
  182. package/node_modules/ieee754/index.d.ts +0 -10
  183. package/node_modules/ieee754/index.js +0 -85
  184. package/node_modules/ieee754/package.json +0 -52
  185. package/node_modules/ini/LICENSE +0 -15
  186. package/node_modules/ini/README.md +0 -102
  187. package/node_modules/ini/ini.js +0 -206
  188. package/node_modules/ini/package.json +0 -33
  189. package/node_modules/keytar/LICENSE.md +0 -20
  190. package/node_modules/keytar/README.md +0 -94
  191. package/node_modules/keytar/binding.gyp +0 -66
  192. package/node_modules/keytar/build/Release/keytar.node +0 -0
  193. package/node_modules/keytar/keytar.d.ts +0 -51
  194. package/node_modules/keytar/lib/keytar.js +0 -43
  195. package/node_modules/keytar/package.json +0 -66
  196. package/node_modules/keytar/src/async.cc +0 -242
  197. package/node_modules/keytar/src/async.h +0 -103
  198. package/node_modules/keytar/src/credentials.h +0 -13
  199. package/node_modules/keytar/src/keytar.h +0 -41
  200. package/node_modules/keytar/src/keytar_mac.cc +0 -296
  201. package/node_modules/keytar/src/keytar_posix.cc +0 -184
  202. package/node_modules/keytar/src/keytar_win.cc +0 -272
  203. package/node_modules/keytar/src/main.cc +0 -139
  204. package/node_modules/mimic-response/index.d.ts +0 -17
  205. package/node_modules/mimic-response/index.js +0 -77
  206. package/node_modules/mimic-response/license +0 -9
  207. package/node_modules/mimic-response/package.json +0 -42
  208. package/node_modules/mimic-response/readme.md +0 -78
  209. package/node_modules/minimist/.eslintrc +0 -29
  210. package/node_modules/minimist/.github/FUNDING.yml +0 -12
  211. package/node_modules/minimist/.nycrc +0 -14
  212. package/node_modules/minimist/CHANGELOG.md +0 -298
  213. package/node_modules/minimist/LICENSE +0 -18
  214. package/node_modules/minimist/README.md +0 -121
  215. package/node_modules/minimist/example/parse.js +0 -4
  216. package/node_modules/minimist/index.js +0 -263
  217. package/node_modules/minimist/package.json +0 -75
  218. package/node_modules/minimist/test/all_bool.js +0 -34
  219. package/node_modules/minimist/test/bool.js +0 -177
  220. package/node_modules/minimist/test/dash.js +0 -43
  221. package/node_modules/minimist/test/default_bool.js +0 -37
  222. package/node_modules/minimist/test/dotted.js +0 -24
  223. package/node_modules/minimist/test/kv_short.js +0 -32
  224. package/node_modules/minimist/test/long.js +0 -33
  225. package/node_modules/minimist/test/num.js +0 -38
  226. package/node_modules/minimist/test/parse.js +0 -209
  227. package/node_modules/minimist/test/parse_modified.js +0 -11
  228. package/node_modules/minimist/test/proto.js +0 -64
  229. package/node_modules/minimist/test/short.js +0 -69
  230. package/node_modules/minimist/test/stop_early.js +0 -17
  231. package/node_modules/minimist/test/unknown.js +0 -104
  232. package/node_modules/minimist/test/whitespace.js +0 -10
  233. package/node_modules/mkdirp-classic/LICENSE +0 -21
  234. package/node_modules/mkdirp-classic/README.md +0 -18
  235. package/node_modules/mkdirp-classic/index.js +0 -98
  236. package/node_modules/mkdirp-classic/package.json +0 -18
  237. package/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +0 -31
  238. package/node_modules/napi-build-utils/LICENSE +0 -21
  239. package/node_modules/napi-build-utils/README.md +0 -52
  240. package/node_modules/napi-build-utils/index.js +0 -214
  241. package/node_modules/napi-build-utils/index.md +0 -0
  242. package/node_modules/napi-build-utils/package.json +0 -42
  243. package/node_modules/node-abi/LICENSE +0 -21
  244. package/node_modules/node-abi/README.md +0 -54
  245. package/node_modules/node-abi/abi_registry.json +0 -439
  246. package/node_modules/node-abi/index.js +0 -179
  247. package/node_modules/node-abi/package.json +0 -45
  248. package/node_modules/node-addon-api/LICENSE.md +0 -13
  249. package/node_modules/node-addon-api/README.md +0 -293
  250. package/node_modules/node-addon-api/common.gypi +0 -21
  251. package/node_modules/node-addon-api/except.gypi +0 -25
  252. package/node_modules/node-addon-api/index.js +0 -11
  253. package/node_modules/node-addon-api/napi-inl.deprecated.h +0 -192
  254. package/node_modules/node-addon-api/napi-inl.h +0 -6209
  255. package/node_modules/node-addon-api/napi.h +0 -2983
  256. package/node_modules/node-addon-api/node_api.gyp +0 -9
  257. package/node_modules/node-addon-api/noexcept.gypi +0 -26
  258. package/node_modules/node-addon-api/nothing.c +0 -0
  259. package/node_modules/node-addon-api/package-support.json +0 -21
  260. package/node_modules/node-addon-api/package.json +0 -399
  261. package/node_modules/node-addon-api/tools/README.md +0 -73
  262. package/node_modules/node-addon-api/tools/check-napi.js +0 -100
  263. package/node_modules/node-addon-api/tools/clang-format.js +0 -68
  264. package/node_modules/node-addon-api/tools/conversion.js +0 -309
  265. package/node_modules/node-addon-api/tools/eslint-format.js +0 -71
  266. package/node_modules/prebuild-install/CHANGELOG.md +0 -131
  267. package/node_modules/prebuild-install/CONTRIBUTING.md +0 -6
  268. package/node_modules/prebuild-install/LICENSE +0 -21
  269. package/node_modules/prebuild-install/README.md +0 -163
  270. package/node_modules/prebuild-install/asset.js +0 -44
  271. package/node_modules/prebuild-install/bin.js +0 -78
  272. package/node_modules/prebuild-install/download.js +0 -142
  273. package/node_modules/prebuild-install/error.js +0 -14
  274. package/node_modules/prebuild-install/help.txt +0 -16
  275. package/node_modules/prebuild-install/index.js +0 -1
  276. package/node_modules/prebuild-install/log.js +0 -33
  277. package/node_modules/prebuild-install/package.json +0 -67
  278. package/node_modules/prebuild-install/proxy.js +0 -35
  279. package/node_modules/prebuild-install/rc.js +0 -64
  280. package/node_modules/prebuild-install/util.js +0 -143
  281. package/node_modules/pump/.github/FUNDING.yml +0 -2
  282. package/node_modules/pump/.travis.yml +0 -5
  283. package/node_modules/pump/LICENSE +0 -21
  284. package/node_modules/pump/README.md +0 -74
  285. package/node_modules/pump/SECURITY.md +0 -5
  286. package/node_modules/pump/empty.js +0 -1
  287. package/node_modules/pump/index.js +0 -86
  288. package/node_modules/pump/package.json +0 -30
  289. package/node_modules/pump/test-browser.js +0 -66
  290. package/node_modules/pump/test-node.js +0 -53
  291. package/node_modules/rc/LICENSE.APACHE2 +0 -15
  292. package/node_modules/rc/LICENSE.BSD +0 -26
  293. package/node_modules/rc/LICENSE.MIT +0 -24
  294. package/node_modules/rc/README.md +0 -227
  295. package/node_modules/rc/browser.js +0 -7
  296. package/node_modules/rc/cli.js +0 -4
  297. package/node_modules/rc/index.js +0 -53
  298. package/node_modules/rc/lib/utils.js +0 -104
  299. package/node_modules/rc/package.json +0 -29
  300. package/node_modules/rc/test/ini.js +0 -16
  301. package/node_modules/rc/test/nested-env-vars.js +0 -50
  302. package/node_modules/rc/test/test.js +0 -59
  303. package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  304. package/node_modules/readable-stream/GOVERNANCE.md +0 -136
  305. package/node_modules/readable-stream/LICENSE +0 -47
  306. package/node_modules/readable-stream/README.md +0 -106
  307. package/node_modules/readable-stream/errors-browser.js +0 -127
  308. package/node_modules/readable-stream/errors.js +0 -116
  309. package/node_modules/readable-stream/experimentalWarning.js +0 -17
  310. package/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
  311. package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
  312. package/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
  313. package/node_modules/readable-stream/lib/_stream_transform.js +0 -190
  314. package/node_modules/readable-stream/lib/_stream_writable.js +0 -641
  315. package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
  316. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
  317. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
  318. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
  319. package/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
  320. package/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
  321. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
  322. package/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
  323. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  324. package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  325. package/node_modules/readable-stream/package.json +0 -68
  326. package/node_modules/readable-stream/readable-browser.js +0 -9
  327. package/node_modules/readable-stream/readable.js +0 -16
  328. package/node_modules/safe-buffer/LICENSE +0 -21
  329. package/node_modules/safe-buffer/README.md +0 -584
  330. package/node_modules/safe-buffer/index.d.ts +0 -187
  331. package/node_modules/safe-buffer/index.js +0 -65
  332. package/node_modules/safe-buffer/package.json +0 -51
  333. package/node_modules/semver/LICENSE +0 -15
  334. package/node_modules/semver/README.md +0 -665
  335. package/node_modules/semver/bin/semver.js +0 -191
  336. package/node_modules/semver/classes/comparator.js +0 -143
  337. package/node_modules/semver/classes/index.js +0 -7
  338. package/node_modules/semver/classes/range.js +0 -557
  339. package/node_modules/semver/classes/semver.js +0 -333
  340. package/node_modules/semver/functions/clean.js +0 -8
  341. package/node_modules/semver/functions/cmp.js +0 -54
  342. package/node_modules/semver/functions/coerce.js +0 -62
  343. package/node_modules/semver/functions/compare-build.js +0 -9
  344. package/node_modules/semver/functions/compare-loose.js +0 -5
  345. package/node_modules/semver/functions/compare.js +0 -7
  346. package/node_modules/semver/functions/diff.js +0 -60
  347. package/node_modules/semver/functions/eq.js +0 -5
  348. package/node_modules/semver/functions/gt.js +0 -5
  349. package/node_modules/semver/functions/gte.js +0 -5
  350. package/node_modules/semver/functions/inc.js +0 -21
  351. package/node_modules/semver/functions/lt.js +0 -5
  352. package/node_modules/semver/functions/lte.js +0 -5
  353. package/node_modules/semver/functions/major.js +0 -5
  354. package/node_modules/semver/functions/minor.js +0 -5
  355. package/node_modules/semver/functions/neq.js +0 -5
  356. package/node_modules/semver/functions/parse.js +0 -18
  357. package/node_modules/semver/functions/patch.js +0 -5
  358. package/node_modules/semver/functions/prerelease.js +0 -8
  359. package/node_modules/semver/functions/rcompare.js +0 -5
  360. package/node_modules/semver/functions/rsort.js +0 -5
  361. package/node_modules/semver/functions/satisfies.js +0 -12
  362. package/node_modules/semver/functions/sort.js +0 -5
  363. package/node_modules/semver/functions/valid.js +0 -8
  364. package/node_modules/semver/index.js +0 -91
  365. package/node_modules/semver/internal/constants.js +0 -37
  366. package/node_modules/semver/internal/debug.js +0 -11
  367. package/node_modules/semver/internal/identifiers.js +0 -29
  368. package/node_modules/semver/internal/lrucache.js +0 -42
  369. package/node_modules/semver/internal/parse-options.js +0 -17
  370. package/node_modules/semver/internal/re.js +0 -223
  371. package/node_modules/semver/package.json +0 -78
  372. package/node_modules/semver/preload.js +0 -4
  373. package/node_modules/semver/range.bnf +0 -16
  374. package/node_modules/semver/ranges/gtr.js +0 -6
  375. package/node_modules/semver/ranges/intersects.js +0 -9
  376. package/node_modules/semver/ranges/ltr.js +0 -6
  377. package/node_modules/semver/ranges/max-satisfying.js +0 -27
  378. package/node_modules/semver/ranges/min-satisfying.js +0 -26
  379. package/node_modules/semver/ranges/min-version.js +0 -63
  380. package/node_modules/semver/ranges/outside.js +0 -82
  381. package/node_modules/semver/ranges/simplify.js +0 -49
  382. package/node_modules/semver/ranges/subset.js +0 -249
  383. package/node_modules/semver/ranges/to-comparators.js +0 -10
  384. package/node_modules/semver/ranges/valid.js +0 -13
  385. package/node_modules/simple-concat/.travis.yml +0 -3
  386. package/node_modules/simple-concat/LICENSE +0 -20
  387. package/node_modules/simple-concat/README.md +0 -44
  388. package/node_modules/simple-concat/index.js +0 -15
  389. package/node_modules/simple-concat/package.json +0 -47
  390. package/node_modules/simple-concat/test/basic.js +0 -41
  391. package/node_modules/simple-get/.github/dependabot.yml +0 -15
  392. package/node_modules/simple-get/.github/workflows/ci.yml +0 -23
  393. package/node_modules/simple-get/LICENSE +0 -20
  394. package/node_modules/simple-get/README.md +0 -333
  395. package/node_modules/simple-get/index.js +0 -108
  396. package/node_modules/simple-get/package.json +0 -67
  397. package/node_modules/string_decoder/LICENSE +0 -48
  398. package/node_modules/string_decoder/README.md +0 -47
  399. package/node_modules/string_decoder/lib/string_decoder.js +0 -296
  400. package/node_modules/string_decoder/package.json +0 -34
  401. package/node_modules/strip-json-comments/index.js +0 -70
  402. package/node_modules/strip-json-comments/license +0 -21
  403. package/node_modules/strip-json-comments/package.json +0 -42
  404. package/node_modules/strip-json-comments/readme.md +0 -64
  405. package/node_modules/tar-fs/.travis.yml +0 -6
  406. package/node_modules/tar-fs/LICENSE +0 -21
  407. package/node_modules/tar-fs/README.md +0 -165
  408. package/node_modules/tar-fs/index.js +0 -363
  409. package/node_modules/tar-fs/package.json +0 -41
  410. package/node_modules/tar-fs/test/fixtures/a/hello.txt +0 -1
  411. package/node_modules/tar-fs/test/fixtures/b/a/test.txt +0 -1
  412. package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
  413. package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
  414. package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
  415. package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
  416. package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
  417. package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
  418. package/node_modules/tar-fs/test/fixtures/e/file +0 -0
  419. package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
  420. package/node_modules/tar-fs/test/index.js +0 -346
  421. package/node_modules/tar-stream/LICENSE +0 -21
  422. package/node_modules/tar-stream/README.md +0 -168
  423. package/node_modules/tar-stream/extract.js +0 -257
  424. package/node_modules/tar-stream/headers.js +0 -295
  425. package/node_modules/tar-stream/index.js +0 -2
  426. package/node_modules/tar-stream/pack.js +0 -255
  427. package/node_modules/tar-stream/package.json +0 -58
  428. package/node_modules/tar-stream/sandbox.js +0 -11
  429. package/node_modules/tunnel-agent/LICENSE +0 -55
  430. package/node_modules/tunnel-agent/README.md +0 -4
  431. package/node_modules/tunnel-agent/index.js +0 -244
  432. package/node_modules/tunnel-agent/package.json +0 -22
  433. package/node_modules/util-deprecate/History.md +0 -16
  434. package/node_modules/util-deprecate/LICENSE +0 -24
  435. package/node_modules/util-deprecate/README.md +0 -53
  436. package/node_modules/util-deprecate/browser.js +0 -67
  437. package/node_modules/util-deprecate/node.js +0 -6
  438. package/node_modules/util-deprecate/package.json +0 -27
@@ -1,217 +0,0 @@
1
- "use strict";var _e=Object.create;var J=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Fe=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var x=(r,e)=>()=>(r&&(e=r(r=0)),e);var me=(r,e)=>{for(var t in e)J(r,t,{get:e[t],enumerable:!0})},ye=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Be(e))!qe.call(r,s)&&s!==t&&J(r,s,{get:()=>e[s],enumerable:!(n=Me(e,s))||n.enumerable});return r};var f=(r,e,t)=>(t=r!=null?_e(Fe(r)):{},ye(e||!r||!r.__esModule?J(t,"default",{value:r,enumerable:!0}):t,r)),He=r=>ye(J({},"__esModule",{value:!0}),r);var v,C,te,Ve,N,b,fe=x(()=>{"use strict";v=f(require("crypto")),C=class extends Error{constructor(e){super(e),this.name="CryptoError"}},te=1,Ve="CodeVibe E2E v1",N=class r{constructor(){}static getInstance(){return r.instance||(r.instance=new r),r.instance}generateKeyPair(){let e=v.createECDH("prime256v1");e.generateKeys();let n=e.getPublicKey().subarray(1).toString("base64");return{privateKey:e.getPrivateKey().toString("base64"),publicKey:n}}generateSessionKey(){return v.randomBytes(32).toString("base64")}deriveSharedKey(e,t){try{let n=v.createECDH("prime256v1"),s=Buffer.from(e,"base64");n.setPrivateKey(s);let i=Buffer.concat([Buffer.from([4]),Buffer.from(t,"base64")]),o=n.computeSecret(i),a=v.hkdfSync("sha256",o,Buffer.alloc(0),Buffer.from(Ve,"utf8"),32);return Buffer.from(a)}catch(n){throw new C(`Failed to derive shared key: ${n}`)}}encryptSessionKey(e,t){let n=this.generateKeyPair(),s=this.deriveSharedKey(n.privateKey,t),i=Buffer.from(e,"base64");return{encryptedKey:this.encrypt(i,s).toString("base64"),ephemeralPublicKey:n.publicKey}}decryptSessionKey(e,t){let n=this.deriveSharedKey(t,e.ephemeralPublicKey),s=Buffer.from(e.encryptedKey,"base64");return this.decrypt(s,n).toString("base64")}encryptContent(e,t){let n=Buffer.from(t,"base64"),s=Buffer.from(e,"utf8");return this.encrypt(s,n).toString("base64")}decryptContent(e,t){let n=Buffer.from(t,"base64"),s=Buffer.from(e,"base64");return this.decrypt(s,n).toString("utf8")}encryptMetadata(e,t){let n=JSON.stringify(e);return this.encryptContent(n,t)}decryptMetadata(e,t){let n=this.decryptContent(e,t);return JSON.parse(n)}encryptData(e,t){let n=Buffer.from(t,"base64");return this.encrypt(e,n)}decryptData(e,t){let n=Buffer.from(t,"base64");return this.decrypt(e,n)}encrypt(e,t){let n=v.randomBytes(12),s=v.createCipheriv("aes-256-gcm",t,n),i=Buffer.concat([s.update(e),s.final()]),o=s.getAuthTag();return Buffer.concat([n,i,o])}decrypt(e,t){let n=e.subarray(0,12),s=e.subarray(e.length-16),i=e.subarray(12,e.length-16),o=v.createDecipheriv("aes-256-gcm",t,n);o.setAuthTag(s);try{return Buffer.concat([o.update(i),o.final()])}catch{throw new C("Decryption failed: Invalid ciphertext or authentication tag")}}serializePrivateKey(e){return e}deserializePrivateKey(e){return e}},b=N.getInstance()});var z=x(()=>{"use strict";fe()});function h(){let r=process.env.ENVIRONMENT;return r==="development"||r==="production"?r:"production"}function Y(r){let e=r||h();return G={...D[e],aws:{...D[e].aws,region:process.env.AWS_REGION||D[e].aws.region,appsyncUrl:process.env.APPSYNC_URL||D[e].aws.appsyncUrl,cognitoUserPoolId:process.env.COGNITO_USER_POOL_ID||D[e].aws.cognitoUserPoolId,cognitoClientId:process.env.COGNITO_CLIENT_ID||D[e].aws.cognitoClientId,cognitoDomain:process.env.COGNITO_DOMAIN||D[e].aws.cognitoDomain}},he=!0,G}function y(){return(!he||!G)&&Y(),G}var F,q,D,G,he,ve=x(()=>{"use strict";F=f(require("os")),q=f(require("path")),D={development:{environment:"development",aws:{region:"us-east-1",appsyncUrl:"https://te6rjr37sbfpjc4fiunmb2tgy4.appsync-api.us-east-1.amazonaws.com/graphql",cognitoUserPoolId:"us-east-1_yVwWDPvvJ",cognitoClientId:"e9r5apv6v5uui3l928r2ris0r",cognitoDomain:"codevibe-development.auth.us-east-1.amazoncognito.com"},keychain:{serviceName:"ai.quantiya.app.codevibe"},server:{port:3456,host:"127.0.0.1",dynamicPort:!0},claude:{command:"claude",defaultTimeout:6e4},codex:{command:"codex",defaultTimeout:6e4,sessionsDir:q.default.join(F.default.homedir(),".codex","sessions"),approvalTimeoutMs:5e3},gemini:{command:"gemini",defaultTimeout:6e4,transcriptDir:q.default.join(F.default.homedir(),".gemini","tmp")}},production:{environment:"production",aws:{region:"us-east-1",appsyncUrl:"https://jwhyxq4sgrgcdosewp5k4ns5ca.appsync-api.us-east-1.amazonaws.com/graphql",cognitoUserPoolId:"us-east-1_mNRO0j5og",cognitoClientId:"5p04dbc9ojptc5r8n7605fg78f",cognitoDomain:"codevibe-production.auth.us-east-1.amazoncognito.com"},keychain:{serviceName:"ai.quantiya.app.codevibe"},server:{port:3456,host:"127.0.0.1",dynamicPort:!0},claude:{command:"claude",defaultTimeout:6e4},codex:{command:"codex",defaultTimeout:6e4,sessionsDir:q.default.join(F.default.homedir(),".codex","sessions"),approvalTimeoutMs:5e3},gemini:{command:"gemini",defaultTimeout:6e4,transcriptDir:q.default.join(F.default.homedir(),".gemini","tmp")}}},G=null,he=!1});var O=x(()=>{"use strict";ve()});function ne(r){return new P(r)}var R,X,be,Se,P,c,we=x(()=>{"use strict";R=f(require("fs")),X=f(require("path")),be=f(require("os")),Se={debug:0,info:1,warn:2,error:3},P=class{constructor(e){this.name=e.name,this.logFile=e.logFile,this.level=e.level||"info",this.enableConsole=e.console??!1,this.logFile&&this.ensureLogDir()}ensureLogDir(){if(this.logFile){let e=X.dirname(this.logFile);R.existsSync(e)||R.mkdirSync(e,{recursive:!0})}}shouldLog(e){return Se[e]>=Se[this.level]}formatMessage(e,t,n){let s=new Date().toISOString(),i=e.toUpperCase().padEnd(5),o=`[${s}] [${i}] [${this.name}] ${t}`;return n!==void 0&&(typeof n=="object"?o+=` ${JSON.stringify(n)}`:o+=` ${n}`),o}log(e,t,n){if(!this.shouldLog(e))return;let s=this.formatMessage(e,t,n);if(this.logFile)try{R.appendFileSync(this.logFile,s+`
2
- `)}catch{}if(this.enableConsole)switch(e){case"error":console.error(s);break;case"warn":console.warn(s);break;default:console.log(s)}}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}setLevel(e){this.level=e}};c=new P({name:"codevibe-core",logFile:X.join(be.tmpdir(),"codevibe-core.log"),level:"info"})});var H=x(()=>{"use strict";we()});var Q,Ee,k,I,re,We,K,g,Ie=x(()=>{"use strict";Q=f(require("os")),Ee=require("uuid"),k=f(require("keytar"));z();O();H();I=class extends Error{constructor(e){super(e),this.name="KeychainError"}},re="device-identity",We="tokens-",K=class r{constructor(){this.deviceIdentity=null;this.sessionKeyCache=new Map;this.isRegistered=!1;this._serviceName=null}get serviceName(){return this._serviceName||(this._serviceName=y().keychain.serviceName),this._serviceName}static getInstance(){return r.instance||(r.instance=new r),r.instance}async getDeviceIdentity(){if(this.deviceIdentity)return this.deviceIdentity;try{let e=await k.getPassword(this.serviceName,re);return e?(this.deviceIdentity=JSON.parse(e),c.info(`[KeychainManager] Loaded device identity: ${this.deviceIdentity.deviceId}`),this.deviceIdentity):null}catch(e){return c.error(`[KeychainManager] Failed to load device identity: ${e}`),null}}async setDeviceIdentity(e){try{await k.setPassword(this.serviceName,re,JSON.stringify(e)),this.deviceIdentity=e,c.info(`[KeychainManager] Saved device identity: ${e.deviceId}`)}catch(t){throw c.error(`[KeychainManager] Failed to save device identity: ${t}`),new I(`Failed to save device identity: ${t}`)}}async getOrCreateDeviceIdentity(){let e=await this.getDeviceIdentity();if(e)return e;let t=b.generateKeyPair();return e={deviceId:(0,Ee.v4)().toUpperCase(),privateKey:t.privateKey,publicKey:t.publicKey,createdAt:new Date().toISOString()},await this.setDeviceIdentity(e),c.info(`[KeychainManager] Generated new device identity: ${e.deviceId}`),e}async getDeviceId(){return(await this.getOrCreateDeviceIdentity()).deviceId}async getDevicePublicKey(){return(await this.getOrCreateDeviceIdentity()).publicKey}async getDevicePrivateKey(){return(await this.getOrCreateDeviceIdentity()).privateKey}async hasDeviceIdentity(){return await this.getDeviceIdentity()!==null}async deleteDeviceIdentity(){try{await k.deletePassword(this.serviceName,re),this.deviceIdentity=null,this.sessionKeyCache.clear(),this.isRegistered=!1,c.info("[KeychainManager] Deleted device identity")}catch(e){throw c.error(`[KeychainManager] Failed to delete device identity: ${e}`),new I(`Failed to delete device identity: ${e}`)}}getTokenAccount(e){return`${We}${e}`}async getTokens(e="production"){try{let t=await k.getPassword(this.serviceName,this.getTokenAccount(e));if(!t)return null;let n=JSON.parse(t);return c.debug(`[KeychainManager] Loaded tokens for ${e}`),n}catch(t){return c.error(`[KeychainManager] Failed to load tokens: ${t}`),null}}async setTokens(e,t="production"){try{await k.setPassword(this.serviceName,this.getTokenAccount(t),JSON.stringify(e)),c.info(`[KeychainManager] Saved tokens for ${t}`,{userId:e.userId,email:e.email})}catch(n){throw c.error(`[KeychainManager] Failed to save tokens: ${n}`),new I(`Failed to save tokens: ${n}`)}}async deleteTokens(e="production"){try{let t=await k.deletePassword(this.serviceName,this.getTokenAccount(e));return t&&c.info(`[KeychainManager] Deleted tokens for ${e}`),t}catch(t){return c.error(`[KeychainManager] Failed to delete tokens: ${t}`),!1}}isTokenExpired(e){return Date.now()>=e.expiresAt-3e5}async getSessionKey(e,t){let n=this.sessionKeyCache.get(e);if(n)return n;if(!t||t.length===0)return null;let s=await this.getDeviceId(),i=t.find(l=>l.deviceId===s);if(!i)return c.warn(`[KeychainManager] Device ${s} not found in encryptedKeys`),null;let o=await this.getDevicePrivateKey(),a=b.decryptSessionKey(i,o);return this.sessionKeyCache.set(e,a),c.info(`[KeychainManager] Decrypted and cached session key for ${e}`),a}createSessionKey(e){let t=b.generateSessionKey(),n=e.map(s=>{let i=b.encryptSessionKey(t,s.publicKey);return{deviceId:s.deviceId,encryptedKey:i.encryptedKey,ephemeralPublicKey:i.ephemeralPublicKey}});return c.info(`[KeychainManager] Created session key for ${e.length} devices`),{sessionKey:t,encryptedKeys:n}}cacheSessionKey(e,t){this.sessionKeyCache.set(e,t)}clearSessionKey(e){this.sessionKeyCache.delete(e)}clearAllSessionKeys(){this.sessionKeyCache.clear()}getIsRegistered(){return this.isRegistered}setIsRegistered(e){this.isRegistered=e}getDeviceName(){return Q.hostname()||"CLI Client"}getDevicePlatform(){let e=Q.platform();return e==="darwin"?"MACOS":e==="linux"?"LINUX":e==="win32"?"WINDOWS":"CLI"}async clearAllData(){await this.deleteDeviceIdentity(),await this.deleteTokens("development"),await this.deleteTokens("production"),this.sessionKeyCache.clear(),this.isRegistered=!1,c.info("[KeychainManager] Cleared all data")}},g=K.getInstance()});var ke={};me(ke,{KeychainError:()=>I,KeychainManager:()=>K,keychainManager:()=>g});var U=x(()=>{"use strict";Ie()});var at={};me(at,{AgentType:()=>De,AppSyncClient:()=>W,AuthService:()=>M,CryptoError:()=>C,CryptoService:()=>N,DeliveryStatus:()=>Ce,ENCRYPTION_VERSION:()=>te,EventSource:()=>se,EventType:()=>Ae,KeychainError:()=>I,KeychainManager:()=>K,Logger:()=>P,SessionStatus:()=>ie,authService:()=>T,createLogger:()=>ne,cryptoService:()=>b,getConfig:()=>y,getEnvironment:()=>h,keychainManager:()=>g,loadConfig:()=>Y,logger:()=>c,mutations:()=>E,normalizeSnapshot:()=>ue,parseInteractivePrompt:()=>Oe,prepareSessionEncryption:()=>ee,queries:()=>$,resumeOrCreateSession:()=>ge,runAuthCli:()=>Z,subscriptions:()=>V});module.exports=He(at);U();z();var oe=f(require("ws")),ae=require("uuid");O();H();U();var Te=f(require("dns")),xe=f(require("fs"));if(je())try{Te.setDefaultResultOrder("ipv4first")}catch{}function je(){if(process.platform!=="linux")return!1;try{let r=xe.readFileSync("/proc/sys/kernel/osrelease","utf8");return/microsoft|wsl/i.test(r)}catch{return!1}}async function L(r,e,t){try{return await fetch(r,e)}catch(n){let s=n?.cause?.code,i=n?.cause?.message,o=s||i||n?.message||"unknown",a=Je(s),l=t?`${t}: `:"",p=`Node ${process.version} on ${process.platform}`,m=[`${l}Cannot reach ${r}`,` Underlying error: ${o}`];a&&m.push(` Suggested fix: ${a}`),m.push(` Platform: ${p}`);let u=new Error(m.join(`
3
- `));throw u.cause=n,u}}function Je(r){if(!r)return null;switch(r){case"ENOTFOUND":case"EAI_AGAIN":return'DNS resolution failed. On WSL Ubuntu, check /etc/resolv.conf, or try running with NODE_OPTIONS="--dns-result-order=ipv4first".';case"ETIMEDOUT":case"ECONNREFUSED":case"ECONNRESET":case"EHOSTUNREACH":case"ENETUNREACH":return`Network unreachable. On WSL Ubuntu, try NODE_OPTIONS="--dns-result-order=ipv4first" (WSL's IPv6 is often broken). If behind a corporate proxy, set HTTPS_PROXY.`;case"CERT_HAS_EXPIRED":case"CERT_NOT_YET_VALID":return"TLS certificate time error \u2014 likely system clock drift. On WSL, run `sudo hwclock -s`, or shut down WSL from PowerShell with `wsl --shutdown` and restart.";case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":case"SELF_SIGNED_CERT_IN_CHAIN":case"UNABLE_TO_VERIFY_LEAF_SIGNATURE":case"DEPTH_ZERO_SELF_SIGNED_CERT":return"Corporate HTTPS proxy detected \u2014 the TLS cert is not trusted by Node. Set NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem, or configure HTTPS_PROXY if a proxy is required.";default:return null}}var $={getSession:`
4
- query GetSession($sessionId: ID!) {
5
- getSession(sessionId: $sessionId) {
6
- sessionId
7
- userId
8
- agentType
9
- projectPath
10
- status
11
- createdAt
12
- updatedAt
13
- metadata
14
- isEncrypted
15
- encryptedKeys {
16
- deviceId
17
- encryptedKey
18
- ephemeralPublicKey
19
- }
20
- creatorDeviceId
21
- encryptionVersion
22
- }
23
- }
24
- `,listEvents:`
25
- query ListEvents($sessionId: ID!, $source: EventSource, $limit: Int) {
26
- listEvents(sessionId: $sessionId, source: $source, limit: $limit) {
27
- items {
28
- eventId
29
- sessionId
30
- type
31
- source
32
- content
33
- timestamp
34
- metadata
35
- promptId
36
- attachments {
37
- id
38
- type
39
- filename
40
- s3Key
41
- size
42
- width
43
- height
44
- isEncrypted
45
- }
46
- deliveryStatus
47
- deliveredAt
48
- executedAt
49
- isEncrypted
50
- }
51
- nextToken
52
- }
53
- }
54
- `,listUserDeviceKeys:`
55
- query ListUserDeviceKeys {
56
- listUserDeviceKeys {
57
- userId
58
- deviceId
59
- publicKey
60
- platform
61
- deviceName
62
- createdAt
63
- lastUsedAt
64
- }
65
- }
66
- `},E={createSession:`
67
- mutation CreateSession($input: CreateSessionInput!) {
68
- createSession(input: $input) {
69
- sessionId
70
- userId
71
- agentType
72
- projectPath
73
- status
74
- createdAt
75
- updatedAt
76
- }
77
- }
78
- `,updateSession:`
79
- mutation UpdateSession($input: UpdateSessionInput!) {
80
- updateSession(input: $input) {
81
- sessionId
82
- status
83
- updatedAt
84
- lastHeartbeatAt
85
- }
86
- }
87
- `,createEvent:`
88
- mutation CreateEvent($input: CreateEventInput!) {
89
- createEvent(input: $input) {
90
- eventId
91
- sessionId
92
- type
93
- source
94
- content
95
- timestamp
96
- metadata
97
- promptId
98
- deliveryStatus
99
- deliveredAt
100
- executedAt
101
- isEncrypted
102
- }
103
- }
104
- `,updateEventStatus:`
105
- mutation UpdateEventStatus($input: UpdateEventStatusInput!) {
106
- updateEventStatus(input: $input) {
107
- eventId
108
- sessionId
109
- type
110
- source
111
- content
112
- timestamp
113
- metadata
114
- promptId
115
- deliveryStatus
116
- deliveredAt
117
- executedAt
118
- }
119
- }
120
- `,registerDeviceKey:`
121
- mutation RegisterDeviceKey($input: RegisterDeviceKeyInput!) {
122
- registerDeviceKey(input: $input) {
123
- userId
124
- deviceId
125
- publicKey
126
- platform
127
- deviceName
128
- createdAt
129
- lastUsedAt
130
- }
131
- }
132
- `,getAttachmentDownloadUrl:`
133
- mutation GetAttachmentDownloadUrl($s3Key: String!) {
134
- getAttachmentDownloadUrl(s3Key: $s3Key) {
135
- downloadUrl
136
- expiresAt
137
- }
138
- }
139
- `},V={onEventCreated:`
140
- subscription OnEventCreated($sessionId: ID!) {
141
- onEventCreated(sessionId: $sessionId) {
142
- eventId
143
- sessionId
144
- type
145
- source
146
- content
147
- timestamp
148
- metadata
149
- promptId
150
- attachments {
151
- id
152
- type
153
- filename
154
- s3Key
155
- size
156
- width
157
- height
158
- isEncrypted
159
- }
160
- deliveryStatus
161
- deliveredAt
162
- executedAt
163
- isEncrypted
164
- }
165
- }
166
- `};var Ae=(a=>(a.USER_PROMPT="USER_PROMPT",a.ASSISTANT_RESPONSE="ASSISTANT_RESPONSE",a.TOOL_USE="TOOL_USE",a.NOTIFICATION="NOTIFICATION",a.INTERACTIVE_PROMPT="INTERACTIVE_PROMPT",a.PROMPT_RESPONSE="PROMPT_RESPONSE",a.REASONING="REASONING",a))(Ae||{}),se=(t=>(t.DESKTOP="DESKTOP",t.MOBILE="MOBILE",t))(se||{}),Ce=(n=>(n.SENT="SENT",n.DELIVERED="DELIVERED",n.EXECUTED="EXECUTED",n))(Ce||{});var ie=(n=>(n.ACTIVE="ACTIVE",n.INACTIVE="INACTIVE",n.PAUSED="PAUSED",n))(ie||{}),De=(n=>(n.CLAUDE="CLAUDE",n.GEMINI="GEMINI",n.CODEX="CODEX",n))(De||{});var _={urgentMaxAttempts:10,baseDelayMs:1e3,maxDelayMs:6e4,backoffMultiplier:2,persistentDelayMs:300*1e3},W=class{constructor(){this.authenticated=!1;this.currentUserId=null;this.currentEmail=null;this.tokens=null;this.activeSubscriptions=new Map;this.heartbeatTimers=new Map;this.environment=h(),c.info("[AppSyncClient] Initialized",{environment:this.environment})}getCurrentUserId(){if(!this.currentUserId)throw new Error("Not authenticated. Call authenticateWithStoredTokens() first.");return this.currentUserId}getCurrentUserEmail(){return this.currentEmail}async authenticateWithStoredTokens(){try{let e=await g.getTokens(this.environment);if(!e)return c.debug("[AppSyncClient] No stored tokens found"),!1;if(c.info("[AppSyncClient] Found stored OAuth tokens",{userId:e.userId,email:e.email,expired:g.isTokenExpired(e)}),g.isTokenExpired(e)){if(c.info("[AppSyncClient] Tokens expired, attempting refresh..."),!await this.refreshTokens(e))return c.warn("[AppSyncClient] Token refresh failed"),!1}else this.tokens=e;return this.currentUserId=this.tokens.userId,this.currentEmail=this.tokens.email,this.authenticated=!0,c.info("[AppSyncClient] Authenticated successfully",{userId:this.currentUserId,email:this.currentEmail}),!0}catch(e){return c.error("[AppSyncClient] Authentication failed:",e),!1}}async refreshTokens(e){try{let t=y(),n=`https://${t.aws.cognitoDomain}/oauth2/token`,s=new URLSearchParams({grant_type:"refresh_token",client_id:t.aws.cognitoClientId,refresh_token:e.refreshToken}),i=await L(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()},"Token refresh");if(!i.ok)return c.error("[AppSyncClient] Token refresh failed",{status:i.status}),!1;let o=await i.json(),a={...e,accessToken:o.access_token,idToken:o.id_token,expiresAt:Date.now()+o.expires_in*1e3};return await g.setTokens(a,this.environment),this.tokens=a,c.info("[AppSyncClient] Tokens refreshed",{expiresAt:new Date(a.expiresAt).toISOString()}),!0}catch(t){return c.error("[AppSyncClient] Token refresh error:",t),!1}}isAuthenticated(){return this.authenticated}signOut(){this.authenticated=!1,this.tokens=null,this.currentUserId=null,this.currentEmail=null,this.cleanupSubscriptions(),c.info("[AppSyncClient] Signed out")}async graphqlRequest(e,t,n=!1){let s=y();if(!this.tokens?.idToken)throw new Error('Not authenticated. Run "codevibe login" first.');let i={"Content-Type":"application/json",Authorization:this.tokens.idToken},o=await L(s.aws.appsyncUrl,{method:"POST",headers:i,body:JSON.stringify({query:e,variables:t})},"AppSync GraphQL request"),a=await o.json();if(o.status===401&&!n&&this.tokens){if(c.info("[AppSyncClient] 401 Unauthorized, refreshing token..."),await this.refreshTokens(this.tokens))return this.graphqlRequest(e,t,!0);throw new Error("Token expired and refresh failed")}if(!o.ok)throw new Error(`GraphQL request failed: ${o.status}`);if(a.errors?.length)throw new Error(`GraphQL error: ${a.errors[0].message}`);return a}async createSession(e){let t={...e,metadata:e.metadata?JSON.stringify(e.metadata):void 0},n=await this.graphqlRequest(E.createSession,{input:t});return c.info("[AppSyncClient] Session created",{sessionId:n.data.createSession.sessionId}),n.data.createSession}async updateSession(e){let t={...e,metadata:e.metadata?JSON.stringify(e.metadata):void 0},n=await this.graphqlRequest(E.updateSession,{input:t});return c.debug("[AppSyncClient] Session updated",{sessionId:n.data.updateSession.sessionId}),n.data.updateSession}async getSession(e){return(await this.graphqlRequest($.getSession,{sessionId:e})).data.getSession}async createEvent(e){let t={...e,metadata:e.metadata?JSON.stringify(e.metadata):void 0},n=await this.graphqlRequest(E.createEvent,{input:t});return c.debug("[AppSyncClient] Event created",{eventId:n.data.createEvent.eventId,type:n.data.createEvent.type}),n.data.createEvent}async updateEventStatus(e){return(await this.graphqlRequest(E.updateEventStatus,{input:e})).data.updateEventStatus}async listEvents(e,t,n){return(await this.graphqlRequest($.listEvents,{sessionId:e,source:t,limit:n})).data.listEvents.items}async listUserDeviceKeys(){return(await this.graphqlRequest($.listUserDeviceKeys,{})).data.listUserDeviceKeys||[]}async registerDeviceKey(e,t,n,s){let i={deviceId:e,publicKey:t,platform:n,deviceName:s};await this.graphqlRequest(E.registerDeviceKey,{input:i}),c.info("[AppSyncClient] Device key registered",{deviceId:e,platform:n})}async getAttachmentDownloadUrl(e){return(await this.graphqlRequest(E.getAttachmentDownloadUrl,{s3Key:e})).data.getAttachmentDownloadUrl}subscribeToEvents(e,t,n){c.info("[AppSyncClient] Subscribing to events",{sessionId:e});let s=this.activeSubscriptions.get(e);s&&(this.cleanupSubscriptionState(s),this.activeSubscriptions.delete(e));let i={ws:null,subscriptionId:(0,ae.v4)(),sessionId:e,onEvent:t,onError:n,reconnectAttempts:0,isReconnecting:!1};return this.activeSubscriptions.set(e,i),this.createSubscription(i),()=>{this.cleanupSubscriptionState(i),this.activeSubscriptions.delete(e)}}buildRealtimeUrl(){let e=y(),t=e.aws.appsyncUrl.replace("https://","wss://").replace("appsync-api","appsync-realtime-api"),n={host:new URL(e.aws.appsyncUrl).host};this.tokens?.idToken&&(n.Authorization=this.tokens.idToken);let s=Buffer.from(JSON.stringify(n)).toString("base64"),i=Buffer.from(JSON.stringify({})).toString("base64");return`${t}?header=${s}&payload=${i}`}createSubscription(e){let{sessionId:t,subscriptionId:n,onEvent:s,onError:i}=e;try{let o=this.buildRealtimeUrl(),a=new oe.default(o,["graphql-ws"]);a.on("open",()=>{c.info("[AppSyncClient] WebSocket connected",{sessionId:t}),a.send(JSON.stringify({type:"connection_init"}))}),a.on("message",l=>{try{let p=JSON.parse(l.toString());switch(p.type){case"connection_ack":this.sendSubscriptionStart(a,e);break;case"start_ack":c.info("[AppSyncClient] Subscription started",{sessionId:t}),e.isReconnecting=!1,e.reconnectAttempts=0,this.startHeartbeat(t);break;case"data":this.resetKeepAliveTimer(e);let m=p.payload?.data?.onEventCreated;m&&m.source==="MOBILE"&&s(m);break;case"ka":this.resetKeepAliveTimer(e);break;case"error":let u=p.payload?.errors?.[0]?.message||"Unknown error";this.handleSubscriptionError(e,new Error(u));break}}catch(p){c.error("[AppSyncClient] Failed to parse message",{error:p})}}),a.on("error",l=>{c.error("[AppSyncClient] WebSocket error",{sessionId:t,error:l.message}),this.handleSubscriptionError(e,l)}),a.on("close",(l,p)=>{c.info("[AppSyncClient] WebSocket closed",{sessionId:t,code:l}),e.keepAliveTimer&&clearTimeout(e.keepAliveTimer),this.activeSubscriptions.has(t)&&this.handleSubscriptionError(e,new Error(`WebSocket closed: ${l}`))}),e.ws=a,this.resetKeepAliveTimer(e)}catch(o){this.handleSubscriptionError(e,o)}}sendSubscriptionStart(e,t){let n=y(),{sessionId:s,subscriptionId:i}=t,o={host:new URL(n.aws.appsyncUrl).host};this.tokens?.idToken&&(o.Authorization=this.tokens.idToken),e.send(JSON.stringify({id:i,type:"start",payload:{data:JSON.stringify({query:V.onEventCreated,variables:{sessionId:s}}),extensions:{authorization:o}}}))}resetKeepAliveTimer(e){e.keepAliveTimer&&clearTimeout(e.keepAliveTimer),e.keepAliveTimer=setTimeout(()=>{this.handleSubscriptionError(e,new Error("Keep-alive timeout"))},300*1e3)}handleSubscriptionError(e,t){let{sessionId:n,onError:s}=e;if(e.isReconnecting||!this.activeSubscriptions.has(n))return;e.isReconnecting=!0,e.reconnectAttempts++,this.stopHeartbeat(n);let i=e.reconnectAttempts<=_.urgentMaxAttempts,o;if(i?o=Math.min(_.baseDelayMs*Math.pow(_.backoffMultiplier,e.reconnectAttempts-1),_.maxDelayMs):(o=_.persistentDelayMs,e.reconnectAttempts===_.urgentMaxAttempts+1&&c.info("[AppSyncClient] Switching to persistent reconnect (every 5min)",{sessionId:n})),c.info("[AppSyncClient] Scheduling reconnect",{sessionId:n,attempt:e.reconnectAttempts,phase:i?"urgent":"persistent",delayMs:o}),e.ws){try{e.ws.close(1e3)}catch{}e.ws=null}e.keepAliveTimer&&clearTimeout(e.keepAliveTimer),e.reconnectTimer=setTimeout(async()=>{if(e.isReconnecting=!1,!!this.activeSubscriptions.has(n)){try{let a=await g.getTokens(this.environment);a&&(g.isTokenExpired(a)?await this.refreshTokens(a)&&c.info("[AppSyncClient] Tokens refreshed before reconnect",{sessionId:n}):this.tokens=a)}catch{c.warn("[AppSyncClient] Token refresh failed before reconnect, using existing tokens",{sessionId:n})}e.subscriptionId=(0,ae.v4)(),this.createSubscription(e)}},o)}cleanupSubscriptionState(e){if(e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.keepAliveTimer&&clearTimeout(e.keepAliveTimer),e.ws){try{e.ws.readyState===oe.default.OPEN&&(e.ws.send(JSON.stringify({id:e.subscriptionId,type:"stop"})),e.ws.close(1e3))}catch{}e.ws=null}}startHeartbeat(e,t=120*1e3){this.stopHeartbeat(e),this.sendHeartbeat(e);let n=setInterval(()=>{this.sendHeartbeat(e)},t);this.heartbeatTimers.set(e,n),c.info("[AppSyncClient] Heartbeat started",{sessionId:e,intervalMs:t})}stopHeartbeat(e){let t=this.heartbeatTimers.get(e);t&&(clearInterval(t),this.heartbeatTimers.delete(e),c.info("[AppSyncClient] Heartbeat stopped",{sessionId:e}))}async sendHeartbeat(e){try{await this.updateSession({sessionId:e,lastHeartbeatAt:new Date().toISOString()}),c.debug("[AppSyncClient] Heartbeat sent",{sessionId:e})}catch(t){c.warn("[AppSyncClient] Heartbeat failed",{sessionId:e,error:t})}}cleanupSubscriptions(){this.activeSubscriptions.forEach(e=>{this.cleanupSubscriptionState(e)}),this.activeSubscriptions.clear(),this.heartbeatTimers.forEach(e=>clearInterval(e)),this.heartbeatTimers.clear()}};var Pe=f(require("crypto")),Ke=f(require("fs")),de=f(require("http")),$e=require("child_process");O();U();H();var j=8080,Ne="/callback",ce=`http://localhost:${j}${Ne}`,M=class r{constructor(){}static getInstance(){return r.instance||(r.instance=new r),r.instance}openBrowser(e){console.log(""),console.log("Opening your browser for sign-in..."),console.log("If your browser does not open automatically, visit this URL manually:"),console.log(` ${e}`),console.log("");let t=this.getBrowserCommands();this.tryBrowserCommand(t,e,0)}getBrowserCommands(){let e=process.platform;if(e==="darwin")return[{cmd:"open",fixedArgs:[]}];if(e==="win32")return[{cmd:"cmd",fixedArgs:["/c","start",""]}];let t=[];return this.isRunningInWSL()&&(t.push({cmd:"wslview",fixedArgs:[]}),t.push({cmd:"cmd.exe",fixedArgs:["/c","start",""]}),t.push({cmd:"powershell.exe",fixedArgs:["-NoProfile","-Command","Start-Process"]})),t.push({cmd:"xdg-open",fixedArgs:[]}),t}isRunningInWSL(){if(process.platform!=="linux")return!1;try{let e=Ke.readFileSync("/proc/sys/kernel/osrelease","utf8");return/microsoft|wsl/i.test(e)}catch{return!1}}tryBrowserCommand(e,t,n){if(n>=e.length){c.debug("[AuthService] No browser-opening command succeeded. User must open the sign-in URL manually (printed to stdout above).");return}let s=e[n],i=[...s.fixedArgs,t],o=!1,a=u=>{o||(o=!0,c.debug(`[AuthService] Browser command '${s.cmd}' ${u}; trying next fallback`),this.tryBrowserCommand(e,t,n+1))},l=u=>{o||(o=!0,c.debug(`[AuthService] Browser command '${s.cmd}' ${u}`))},p;try{p=(0,$e.spawn)(s.cmd,i,{detached:!0,stdio:"ignore"})}catch(u){a(`threw synchronously: ${u?.message||u}`);return}p.on("error",u=>{a(`failed to spawn: ${u?.message||u}`)}),p.on("exit",(u,A)=>{u===0?l("exited successfully"):a(A?`terminated by signal ${A}`:`exited with code ${u}`)}),setTimeout(()=>{l("still running after 3s, assuming success")},3e3).unref(),p.unref()}generateState(){return Pe.randomBytes(32).toString("hex")}buildAuthUrl(e){let t=y(),n=new URLSearchParams({client_id:t.aws.cognitoClientId,response_type:"code",scope:"email openid profile",redirect_uri:ce,state:e});return`https://${t.aws.cognitoDomain}/oauth2/authorize?${n.toString()}`}async exchangeCodeForTokens(e){let t=y(),n=`https://${t.aws.cognitoDomain}/oauth2/token`,s=new URLSearchParams({grant_type:"authorization_code",client_id:t.aws.cognitoClientId,code:e,redirect_uri:ce}),i=await L(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()},"Token exchange");if(!i.ok){let a=await i.text();throw new Error(`Token exchange failed: ${i.status} ${a}`)}let o=await i.json();return{accessToken:o.access_token,idToken:o.id_token,refreshToken:o.refresh_token,expiresIn:o.expires_in}}decodeJwt(e){let t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT");return JSON.parse(Buffer.from(t[1],"base64").toString("utf-8"))}async refreshTokens(e){let t=y(),n=`https://${t.aws.cognitoDomain}/oauth2/token`,s=new URLSearchParams({grant_type:"refresh_token",client_id:t.aws.cognitoClientId,refresh_token:e}),i=await L(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()},"Token refresh");if(!i.ok)throw new Error(`Token refresh failed: ${i.status}`);let o=await i.json();return{accessToken:o.access_token,idToken:o.id_token,expiresIn:o.expires_in}}async login(){let e=await g.getTokens(h());if(e&&!g.isTokenExpired(e))return e;let t=this.generateState(),n=this.buildAuthUrl(t);return new Promise((s,i)=>{let o=de.createServer(async(a,l)=>{if(!a.url?.startsWith(Ne)){l.writeHead(404),l.end("Not found");return}try{let p=new URL(a.url,`http://localhost:${j}`),m=p.searchParams.get("code"),u=p.searchParams.get("state"),A=p.searchParams.get("error");if(A)throw new Error(`OAuth error: ${A}`);if(u!==t)throw new Error("State mismatch");if(!m)throw new Error("No authorization code");let S=await this.exchangeCodeForTokens(m),B=this.decodeJwt(S.idToken),w={accessToken:S.accessToken,idToken:S.idToken,refreshToken:S.refreshToken,expiresAt:Date.now()+S.expiresIn*1e3,userId:B.sub,email:B.email||"unknown"};await g.setTokens(w,h()),l.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),l.end(`
167
- <!DOCTYPE html>
168
- <html>
169
- <head><title>Success</title></head>
170
- <body style="font-family: system-ui; max-width: 600px; margin: 50px auto; text-align: center;">
171
- <h1 style="color: #22c55e;">&#10003; Authentication Successful</h1>
172
- <p>You can close this window.</p>
173
- </body>
174
- </html>
175
- `),setTimeout(()=>{o.close(()=>s(w))},500)}catch(p){let m=String(p?.message||p).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");l.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),l.end(`
176
- <!DOCTYPE html>
177
- <html>
178
- <head><title>Error</title></head>
179
- <body style="font-family: system-ui; max-width: 720px; margin: 50px auto; padding: 0 16px;">
180
- <h1 style="color: #ef4444; text-align: center;">&#10007; Authentication Failed</h1>
181
- <pre style="background: #f4f4f5; padding: 16px; border-radius: 8px; white-space: pre-wrap; word-wrap: break-word; font-size: 13px; line-height: 1.5;">${m}</pre>
182
- <p style="text-align: center; color: #71717a; margin-top: 24px;">You can close this window and try again in your terminal.</p>
183
- </body>
184
- </html>
185
- `),setTimeout(()=>{o.close(()=>i(p))},500)}});o.on("error",a=>{a.code==="EADDRINUSE"?i(new Error(`Port ${j} is in use`)):i(a)}),o.listen(j,"localhost",()=>{c.info("[AuthService] Callback server started"),this.openBrowser(n)}),setTimeout(()=>{o.close(()=>i(new Error("Login timeout")))},120*1e3)})}async logout(){let e=y(),t=await g.deleteTokens(h());return t&&new Promise(n=>{let s=de.createServer((i,o)=>{i.url?.startsWith("/signout")?(o.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),o.end(`
186
- <!DOCTYPE html>
187
- <html>
188
- <head><title>Signed Out</title></head>
189
- <body style="font-family: system-ui; max-width: 600px; margin: 50px auto; text-align: center;">
190
- <h1 style="color: #22c55e;">&#10003; Signed Out</h1>
191
- <p>You can close this window.</p>
192
- </body>
193
- </html>
194
- `),setTimeout(()=>{s.close(()=>n(!0))},500)):(o.writeHead(404),o.end("Not found"))});s.on("error",()=>{n(!0)}),s.listen(j,"localhost",()=>{let i=`https://${e.aws.cognitoDomain}/logout?client_id=${e.aws.cognitoClientId}&logout_uri=${encodeURIComponent(ce.replace("/callback","/signout"))}`;this.openBrowser(i)}),setTimeout(()=>{s.close(()=>n(!0))},30*1e3)})}async getStatus(){let e=await g.getTokens(h());return e?{authenticated:!g.isTokenExpired(e),tokens:e}:{authenticated:!1}}},T=M.getInstance();O();var d={reset:"\x1B[0m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",cyan:"\x1B[36m",dim:"\x1B[2m"};async function ze(){console.log(`${d.cyan}CodeVibe Login${d.reset}
195
- `);try{let r=await T.getStatus();if(r.authenticated&&r.tokens){console.log(`${d.yellow}Already logged in as: ${r.tokens.email}${d.reset}`),console.log(`Token expires: ${new Date(r.tokens.expiresAt).toLocaleString()}`),console.log(`
196
- Run '${d.dim}codevibe logout${d.reset}' to sign out first.`),process.exit(0);return}console.log("Opening browser for authentication..."),console.log(`${d.dim}Waiting for callback...${d.reset}
197
- `);let e=await T.login();e&&(console.log(`
198
- ${d.green}\u2713 Authentication successful!${d.reset}`),console.log(` User: ${e.email}`),console.log(` User ID: ${e.userId}`),console.log(` Expires: ${new Date(e.expiresAt).toLocaleString()}`)),process.exit(0)}catch(r){console.log(`
199
- ${d.red}\u2717 Authentication failed${d.reset}`),console.log(` Error: ${r.message}`),process.exit(1)}}async function Ge(){console.log(`${d.cyan}CodeVibe Logout${d.reset}
200
- `);try{let r=await T.getStatus();if(!r.authenticated){console.log(`${d.yellow}Not logged in.${d.reset}`),process.exit(0);return}let e=r.tokens?.email;await T.logout()?(console.log(`${d.green}\u2713 Logged out successfully.${d.reset}`),console.log(` Previous user: ${e}`),console.log(`
201
- ${d.dim}Clearing browser session...${d.reset}`)):console.log(`${d.red}\u2717 Failed to log out.${d.reset}`),process.exit(0)}catch(r){console.log(`${d.red}\u2717 Logout failed: ${r.message}${d.reset}`),process.exit(1)}}async function Ye(){console.log(`${d.cyan}CodeVibe Auth Status${d.reset}
202
- `);try{let r=await T.getStatus();if(!r.tokens){console.log(`${d.yellow}Not authenticated.${d.reset}`),console.log(`
203
- Run '${d.dim}codevibe login${d.reset}' to sign in.`),process.exit(0);return}let e=!r.authenticated;console.log(e?`${d.yellow}\u26A0 Token expired${d.reset}`:`${d.green}\u2713 Authenticated${d.reset}`),console.log(` User: ${r.tokens.email}`),console.log(` User ID: ${r.tokens.userId}`),console.log(` Expires: ${new Date(r.tokens.expiresAt).toLocaleString()}`),e&&console.log(`
204
- ${d.dim}Token will be refreshed automatically.${d.reset}`),process.exit(0)}catch(r){console.log(`${d.red}\u2717 Status check failed: ${r.message}${d.reset}`),process.exit(1)}}async function Xe(){console.log(`${d.cyan}CodeVibe Reset Device${d.reset}
205
- `),console.log(`${d.red}\u26A0 WARNING: This will delete your device identity.${d.reset}`),console.log(`${d.red} Old encrypted sessions will become inaccessible.${d.reset}
206
- `);let{keychainManager:r}=await Promise.resolve().then(()=>(U(),ke));try{await r.clearAllData(),console.log(`${d.green}\u2713 Device reset complete.${d.reset}`),console.log(` Run '${d.dim}codevibe login${d.reset}' to set up again.`),process.exit(0)}catch(e){console.log(`${d.red}\u2717 Reset failed: ${e.message}${d.reset}`),process.exit(1)}}function Qe(){console.log(`CodeVibe Authentication
207
- `),console.log("Usage:"),console.log(" codevibe login - Sign in via browser"),console.log(" codevibe logout - Sign out"),console.log(" codevibe status - Show auth status"),console.log(" codevibe reset-device - Reset device identity (destructive)"),console.log(`
208
- Environment:`),console.log(' Set ENVIRONMENT env var to "development" or "production" (default)'),console.log(" Example: ENVIRONMENT=development codevibe login")}async function Z(r){let e=h();console.log(`${d.dim}Environment: ${e}${d.reset}
209
- `);let n=r.slice(2).filter(s=>!s.startsWith("--"))[0];switch(n){case"login":await ze();break;case"logout":await Ge();break;case"status":await Ye();break;case"reset-device":await Xe();break;default:Qe(),process.exit(n?1:0)}}require.main===module&&Z(process.argv).catch(r=>{console.error("Error:",r),process.exit(1)});O();H();var Ze=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g;function Oe(r){let e=ue(r);if(!e)return null;let t=et(e);if(t)return t;let n=tt(e);return n||null}function ue(r){return r.replace(/\r/g,`
210
- `).replace(Ze,"").replace(/[│┌┐└┘─├┤┬┴┼╌╎╭╮╯╰║═╔╗╚╝╠╣╦╩╬]/g," ").replace(/[ \t]+\n/g,`
211
- `).replace(/\n{3,}/g,`
212
-
213
- `).trim()}function et(r){let e=r.split(`
214
- `).map(m=>m.trim()),t=nt(e,m=>/\[(?:y\/n|Y\/n|y\/N)\]/.test(m)),n=t>=0?e[t]:null;if(!n)return null;let s=Ue(e,t),i=s.length>0?s.join(`
215
- `):n,o=i.toLowerCase(),a=o.includes("what to change")||o.includes("what should")||o.includes("provide")||o.includes("instructions");return{kind:"yes_no",promptText:i,options:a?[{number:"1",text:"Yes"},{number:"2",text:"No, provide instructions"}]:[{number:"1",text:"Yes"},{number:"2",text:"No"}],submitMap:{1:"y",2:"n"},requiresFollowUpText:a}}function tt(r){let e=r.split(`
216
- `).map(l=>l.trim()),t=rt(e);if(t.length<2)return null;let n=t.map(({line:l})=>Re(l)).filter(l=>!!l),s={};for(let l of n)s[l.number]=l.number;let i=t[0]?.index??-1,o=Ue(e,i-1);return{kind:"numbered",promptText:o.length>0?o.join(`
217
- `):"Select an option",options:n,submitMap:s}}function nt(r,e){for(let t=r.length-1;t>=0;t-=1)if(e(r[t]))return t;return-1}function Re(r){let e=r.match(/^(?:[>›❯▸▶➜➤*●]\s*)?(\d+)\.\s+(.*)$/);return e?{number:e[1],text:e[2]}:null}function rt(r){let e=r.map((n,s)=>({index:s,line:n,parsed:Re(n)})).filter(n=>!!n.parsed);if(e.length===0)return[];let t=[e[e.length-1]];for(let n=e.length-2;n>=0;n-=1){let s=e[n],i=t[0];if(s.index!==i.index-1)break;t.unshift(s)}return t.map(({index:n,line:s})=>({index:n,line:s}))}function Ue(r,e){if(e<0)return[];let t=le(r,e);if(t<0)return[];let{start:n,end:s}=pe(r,t),i=r.slice(n,s+1).filter(Boolean);if(it(i)){let u=st(r,n-1);return u.length>0?u:i}if(n<=1)return i;let o=n-1;if(o=le(r,o),o<0||o===n-1)return i;let{start:a,end:l}=pe(r,o),p=r.slice(a,l+1).filter(Boolean);return p.some(Le)?[...p,...i]:i}function Le(r){return/^(?:would you like to|do you want to|the model would like to|action required|confirm)\b/i.test(r)}function le(r,e){let t=e;for(;t>=0&&!r[t];)t-=1;return t}function pe(r,e){let t=e;for(;t>=0&&r[t];)t-=1;return{start:t+1,end:e}}function st(r,e){let t=[],n=e;for(;n>=0&&t.length<2&&(n=le(r,n),!(n<0));){let{start:i,end:o}=pe(r,n),a=r.slice(i,o+1).filter(Boolean);a.length>0&&t.unshift(a),n=i-1}if(t.length===0)return[];let s=t.findIndex(i=>i.some(Le));return s>=0?t.slice(s).flat():t[t.length-1]}function it(r){return r.length===0?!1:r.filter(ot).length>=Math.max(2,Math.ceil(r.length/2))}function ot(r){return/^\d+\s/.test(r)}z();U();async function ee(r,e,t){try{let n=await e.listUserDeviceKeys();if(n.length===0)return t.info("No device keys found, session will not be encrypted"),null;t.info("Preparing session encryption",{sessionId:r,deviceCount:n.length});let{sessionKey:s,encryptedKeys:i}=g.createSessionKey(n);return t.info("Session encryption prepared",{sessionId:r,deviceCount:i.length}),{sessionKey:s,encryptedKeys:i}}catch(n){return t.warn("Failed to prepare session encryption:",n),null}}async function ge(r,e,t){let{sessionId:n,userId:s,agentType:i,projectPath:o,metadata:a}=r,l=null;try{l=await e.getSession(n)}catch(S){t.warn("Failed to get session (will attempt to create new)",{sessionId:n,error:S})}if(l){t.info("Session exists in backend - reactivating",{sessionId:n,previousStatus:l.status});try{await e.updateSession({sessionId:n,status:"ACTIVE"})}catch(w){t.warn("Failed to reactivate existing session, will continue",{sessionId:n,error:w})}let S=null,B=l.encryptedKeys;if(l.isEncrypted&&B?.length)try{let w=await g.getSessionKey(n,B);w?(S=w,g.cacheSessionKey(n,w),t.info("Session key retrieved for resumed session",{sessionId:n})):t.warn("No encrypted key for this device; proceeding without decryption",{sessionId:n})}catch(w){t.warn("Failed to retrieve session key for resumed session",{sessionId:n,error:w})}return{resumed:!0,sessionKey:S}}let p=await ee(n,e,t),m=o,u=a;p&&(m=b.encryptContent(o,p.sessionKey),u&&Object.keys(u).length>0&&(u={encrypted:b.encryptMetadata(u,p.sessionKey)}),t.info("Session data encrypted",{sessionId:n})),t.info("Creating new session in backend",{sessionId:n,userId:s,agentType:i,isEncrypted:!!p}),await e.createSession({sessionId:n,userId:s,agentType:i,projectPath:m,status:"ACTIVE",metadata:u,isEncrypted:p?!0:void 0,creatorDeviceId:p?await g.getDeviceId():void 0,encryptionVersion:p?1:void 0,encryptedKeys:p?.encryptedKeys});let A=p?.sessionKey||null;return p&&g.cacheSessionKey(n,p.sessionKey),t.info("Session created",{sessionId:n,userId:s,isEncrypted:!!p}),{resumed:!1,sessionKey:A}}0&&(module.exports={AgentType,AppSyncClient,AuthService,CryptoError,CryptoService,DeliveryStatus,ENCRYPTION_VERSION,EventSource,EventType,KeychainError,KeychainManager,Logger,SessionStatus,authService,createLogger,cryptoService,getConfig,getEnvironment,keychainManager,loadConfig,logger,mutations,normalizeSnapshot,parseInteractivePrompt,prepareSessionEncryption,queries,resumeOrCreateSession,runAuthCli,subscriptions});
@@ -1 +0,0 @@
1
- export { KeychainManager, keychainManager, KeychainError } from './keychain-manager';
@@ -1,125 +0,0 @@
1
- import { DeviceIdentity, TokenData, EncryptedSessionKey } from '../types';
2
- /**
3
- * Error class for keychain operations
4
- */
5
- export declare class KeychainError extends Error {
6
- constructor(message: string);
7
- }
8
- /**
9
- * Manages device identity and OAuth tokens using native keychain
10
- */
11
- export declare class KeychainManager {
12
- private static instance;
13
- private deviceIdentity;
14
- private sessionKeyCache;
15
- private isRegistered;
16
- private _serviceName;
17
- private constructor();
18
- /**
19
- * Get the keychain service name (lazy-loaded from config)
20
- */
21
- private get serviceName();
22
- static getInstance(): KeychainManager;
23
- /**
24
- * Get the device identity from keychain
25
- */
26
- getDeviceIdentity(): Promise<DeviceIdentity | null>;
27
- /**
28
- * Set the device identity in keychain
29
- */
30
- setDeviceIdentity(identity: DeviceIdentity): Promise<void>;
31
- /**
32
- * Get or create device identity
33
- */
34
- getOrCreateDeviceIdentity(): Promise<DeviceIdentity>;
35
- /**
36
- * Get device ID (creates identity if needed)
37
- */
38
- getDeviceId(): Promise<string>;
39
- /**
40
- * Get device public key (creates identity if needed)
41
- */
42
- getDevicePublicKey(): Promise<string>;
43
- /**
44
- * Get device private key (creates identity if needed)
45
- */
46
- getDevicePrivateKey(): Promise<string>;
47
- /**
48
- * Check if device identity exists
49
- */
50
- hasDeviceIdentity(): Promise<boolean>;
51
- /**
52
- * Delete device identity (reset device)
53
- */
54
- deleteDeviceIdentity(): Promise<void>;
55
- /**
56
- * Get token account name for environment
57
- */
58
- private getTokenAccount;
59
- /**
60
- * Get OAuth tokens for environment
61
- */
62
- getTokens(environment?: string): Promise<TokenData | null>;
63
- /**
64
- * Save OAuth tokens for environment
65
- */
66
- setTokens(tokens: TokenData, environment?: string): Promise<void>;
67
- /**
68
- * Delete OAuth tokens for environment
69
- */
70
- deleteTokens(environment?: string): Promise<boolean>;
71
- /**
72
- * Check if token is expired
73
- */
74
- isTokenExpired(tokens: TokenData): boolean;
75
- /**
76
- * Get session key for a session, decrypting from encryptedKeys if needed
77
- */
78
- getSessionKey(sessionId: string, encryptedKeys?: EncryptedSessionKey[]): Promise<string | null>;
79
- /**
80
- * Generate and encrypt a new session key for all devices
81
- */
82
- createSessionKey(devicePublicKeys: Array<{
83
- deviceId: string;
84
- publicKey: string;
85
- }>): {
86
- sessionKey: string;
87
- encryptedKeys: EncryptedSessionKey[];
88
- };
89
- /**
90
- * Cache a session key
91
- */
92
- cacheSessionKey(sessionId: string, sessionKey: string): void;
93
- /**
94
- * Clear cached session key
95
- */
96
- clearSessionKey(sessionId: string): void;
97
- /**
98
- * Clear all cached session keys
99
- */
100
- clearAllSessionKeys(): void;
101
- /**
102
- * Get registration status
103
- */
104
- getIsRegistered(): boolean;
105
- /**
106
- * Set registration status
107
- */
108
- setIsRegistered(registered: boolean): void;
109
- /**
110
- * Get device name for registration
111
- */
112
- getDeviceName(): string;
113
- /**
114
- * Get platform for registration
115
- */
116
- getDevicePlatform(): string;
117
- /**
118
- * Clear all data (device identity + all tokens)
119
- */
120
- clearAllData(): Promise<void>;
121
- }
122
- /**
123
- * Export singleton instance
124
- */
125
- export declare const keychainManager: KeychainManager;
@@ -1 +0,0 @@
1
- export { Logger, logger, createLogger } from './logger';
@@ -1,35 +0,0 @@
1
- export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
2
- interface LoggerOptions {
3
- name: string;
4
- logFile?: string;
5
- level?: LogLevel;
6
- console?: boolean;
7
- }
8
- /**
9
- * Simple logger for CodeVibe plugins
10
- */
11
- export declare class Logger {
12
- private name;
13
- private logFile?;
14
- private level;
15
- private enableConsole;
16
- constructor(options: LoggerOptions);
17
- private ensureLogDir;
18
- private shouldLog;
19
- private formatMessage;
20
- private log;
21
- debug(message: string, data?: any): void;
22
- info(message: string, data?: any): void;
23
- warn(message: string, data?: any): void;
24
- error(message: string, data?: any): void;
25
- setLevel(level: LogLevel): void;
26
- }
27
- /**
28
- * Create a logger with custom options
29
- */
30
- export declare function createLogger(options: LoggerOptions): Logger;
31
- /**
32
- * Default shared logger instance
33
- */
34
- export declare const logger: Logger;
35
- export {};
@@ -1,39 +0,0 @@
1
- /**
2
- * Shared prompt parser for interactive terminal prompts.
3
- *
4
- * Parses terminal snapshots (from tmux capture-pane) to extract
5
- * interactive prompt options displayed by CLI tools (Gemini, Codex, etc.).
6
- *
7
- * Used by multiple plugins to dynamically capture options instead of hardcoding.
8
- */
9
- export type PromptKind = 'yes_no' | 'numbered' | 'text';
10
- export interface InteractivePromptOption {
11
- number: string;
12
- text: string;
13
- }
14
- export interface ParsedInteractivePrompt {
15
- kind: PromptKind;
16
- promptText: string;
17
- options: InteractivePromptOption[];
18
- submitMap: Record<string, string>;
19
- requiresFollowUpText?: boolean;
20
- }
21
- /**
22
- * Parse a terminal snapshot to extract interactive prompt options.
23
- *
24
- * Detects two prompt types:
25
- * - Yes/No prompts: [y/n] patterns
26
- * - Numbered prompts: "1. Allow once", "2. Allow for this session", etc.
27
- *
28
- * Returns null if no prompt is detected.
29
- */
30
- export declare function parseInteractivePrompt(snapshot: string): ParsedInteractivePrompt | null;
31
- /**
32
- * Strip ANSI escape codes, box-drawing characters, and normalize whitespace
33
- * from terminal output.
34
- *
35
- * Box-drawing characters (│, ┌, ┐, └, ┘, ─, etc.) are used by TUI apps like
36
- * Gemini CLI to render bordered panels. Stripping them exposes the text content
37
- * so the parser can match option lines inside boxes.
38
- */
39
- export declare function normalizeSnapshot(snapshot: string): string;
@@ -1,2 +0,0 @@
1
- export { resumeOrCreateSession, prepareSessionEncryption } from './session-resume';
2
- export type { ResumeOrCreateSessionInput, ResumeOrCreateSessionResult } from './session-resume';
@@ -1,55 +0,0 @@
1
- /**
2
- * Centralized session resume/create logic for all CodeVibe plugins.
3
- *
4
- * All three plugins (Claude, Codex, Gemini) need the same pattern:
5
- * 1. Check if session exists in backend (getSession)
6
- * 2. If exists: reactivate + restore E2E session key from encryptedKeys
7
- * 3. If not exists: generate encryption keys + create session
8
- *
9
- * This module eliminates the duplication across plugins.
10
- */
11
- import { AppSyncClient } from '../appsync';
12
- import { Logger } from '../logger';
13
- import { AgentType, EncryptedSessionKey } from '../types';
14
- export interface ResumeOrCreateSessionInput {
15
- sessionId: string;
16
- userId: string;
17
- agentType: AgentType;
18
- projectPath: string;
19
- metadata?: Record<string, any>;
20
- }
21
- export interface ResumeOrCreateSessionResult {
22
- /** Whether an existing session was found and reactivated */
23
- resumed: boolean;
24
- /** The E2E session key (for encrypting/decrypting events), or null if no encryption */
25
- sessionKey: string | null;
26
- }
27
- /**
28
- * Prepare E2E encryption for a new session.
29
- *
30
- * Generates a random session key and encrypts it for all registered devices.
31
- * Does NOT cache the session key — callers should cache only after the session
32
- * is successfully created in the backend.
33
- *
34
- * @returns Encryption data or null if no device keys found / error
35
- */
36
- export declare function prepareSessionEncryption(sessionId: string, appSyncClient: AppSyncClient, logger: Logger): Promise<{
37
- sessionKey: string;
38
- encryptedKeys: EncryptedSessionKey[];
39
- } | null>;
40
- /**
41
- * Resume an existing session or create a new one.
42
- *
43
- * Resume path (session exists in backend):
44
- * - Reactivates session (status → ACTIVE)
45
- * - Restores E2E session key from encryptedKeys
46
- *
47
- * Create path (session does not exist):
48
- * - Prepares E2E encryption (generates key, encrypts for all devices)
49
- * - Encrypts projectPath and metadata
50
- * - Creates session in backend
51
- * - Caches session key only after successful creation
52
- *
53
- * @throws Propagates createSession errors (e.g., SESSION_LIMIT_EXCEEDED)
54
- */
55
- export declare function resumeOrCreateSession(input: ResumeOrCreateSessionInput, appSyncClient: AppSyncClient, logger: Logger): Promise<ResumeOrCreateSessionResult>;
@@ -1,15 +0,0 @@
1
- /**
2
- * Stored OAuth tokens
3
- */
4
- export interface TokenData {
5
- accessToken: string;
6
- idToken: string;
7
- refreshToken: string;
8
- expiresAt: number;
9
- userId: string;
10
- email: string;
11
- }
12
- /**
13
- * Environment configuration
14
- */
15
- export type Environment = 'development' | 'production';
@@ -1,54 +0,0 @@
1
- /**
2
- * Encrypted session key for E2E encryption
3
- */
4
- export interface EncryptedSessionKey {
5
- deviceId: string;
6
- encryptedKey: string;
7
- ephemeralPublicKey: string;
8
- }
9
- /**
10
- * Device key stored with backend
11
- */
12
- export interface DeviceKey {
13
- userId: string;
14
- deviceId: string;
15
- publicKey: string;
16
- platform: string;
17
- deviceName?: string;
18
- createdAt: string;
19
- lastUsedAt?: string;
20
- }
21
- /**
22
- * Key pair for ECDH
23
- */
24
- export interface KeyPair {
25
- privateKey: string;
26
- publicKey: string;
27
- }
28
- /**
29
- * Device identity stored in keychain
30
- */
31
- export interface DeviceIdentity {
32
- deviceId: string;
33
- privateKey: string;
34
- publicKey: string;
35
- createdAt: string;
36
- }
37
- /**
38
- * GraphQL input for registering device key
39
- */
40
- export interface RegisterDeviceKeyInput {
41
- deviceId: string;
42
- publicKey: string;
43
- platform: string;
44
- deviceName?: string;
45
- }
46
- /**
47
- * GraphQL input for granting session key
48
- */
49
- export interface GrantSessionKeyInput {
50
- sessionId: string;
51
- deviceId: string;
52
- encryptedKey: string;
53
- ephemeralPublicKey: string;
54
- }