@quantiya/codevibe-claude-plugin 1.0.37 → 1.0.39

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 (255) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/codevibe-claude +17 -3
  3. package/dist/server.js +8 -7
  4. package/hooks/stop.sh +30 -10
  5. package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +1 -139
  6. package/node_modules/@quantiya/codevibe-core/dist/appsync/queries.d.ts +0 -5
  7. package/node_modules/@quantiya/codevibe-core/dist/auth/auth-telemetry.d.ts +64 -29
  8. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +0 -4
  9. package/node_modules/@quantiya/codevibe-core/dist/index.js +33 -194
  10. package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-manager.d.ts +16 -2
  11. package/node_modules/@quantiya/codevibe-core/dist/session/session-rekey.d.ts +40 -0
  12. package/node_modules/@quantiya/codevibe-core/dist/session/session-resume.d.ts +1 -0
  13. package/node_modules/@quantiya/codevibe-core/dist/types/index.d.ts +0 -2
  14. package/node_modules/@quantiya/codevibe-core/dist/types/session.d.ts +0 -16
  15. package/node_modules/@quantiya/codevibe-core/package.json +1 -1
  16. package/node_modules/body-parser/README.md +18 -18
  17. package/node_modules/body-parser/index.js +6 -15
  18. package/node_modules/body-parser/lib/read.js +17 -20
  19. package/node_modules/body-parser/lib/types/json.js +8 -16
  20. package/node_modules/body-parser/lib/types/raw.js +3 -4
  21. package/node_modules/body-parser/lib/types/text.js +3 -4
  22. package/node_modules/body-parser/lib/types/urlencoded.js +8 -8
  23. package/node_modules/body-parser/lib/utils.js +11 -9
  24. package/node_modules/body-parser/package.json +2 -2
  25. package/node_modules/content-disposition/README.md +7 -8
  26. package/node_modules/content-disposition/index.js +118 -40
  27. package/node_modules/content-disposition/package.json +8 -11
  28. package/node_modules/express/Readme.md +39 -29
  29. package/node_modules/express/lib/application.js +1 -1
  30. package/node_modules/express/lib/request.js +5 -6
  31. package/node_modules/express/lib/response.js +14 -0
  32. package/node_modules/express/lib/utils.js +3 -1
  33. package/node_modules/express/package.json +6 -5
  34. package/node_modules/finalhandler/HISTORY.md +6 -0
  35. package/node_modules/finalhandler/README.md +26 -23
  36. package/node_modules/finalhandler/package.json +13 -9
  37. package/node_modules/graphql/execution/execute.d.ts +14 -1
  38. package/node_modules/graphql/execution/execute.js +63 -13
  39. package/node_modules/graphql/execution/execute.mjs +63 -13
  40. package/node_modules/graphql/execution/subscribe.js +1 -0
  41. package/node_modules/graphql/execution/subscribe.mjs +2 -0
  42. package/node_modules/graphql/execution/values.js +4 -4
  43. package/node_modules/graphql/execution/values.mjs +4 -4
  44. package/node_modules/graphql/index.d.ts +1 -0
  45. package/node_modules/graphql/language/ast.d.ts +10 -1
  46. package/node_modules/graphql/language/ast.js +8 -1
  47. package/node_modules/graphql/language/ast.mjs +8 -1
  48. package/node_modules/graphql/language/directiveLocation.d.ts +1 -0
  49. package/node_modules/graphql/language/directiveLocation.js +1 -0
  50. package/node_modules/graphql/language/directiveLocation.mjs +1 -0
  51. package/node_modules/graphql/language/index.d.ts +1 -0
  52. package/node_modules/graphql/language/kinds.d.ts +1 -0
  53. package/node_modules/graphql/language/kinds.js +1 -0
  54. package/node_modules/graphql/language/kinds.mjs +1 -0
  55. package/node_modules/graphql/language/parser.d.ts +14 -0
  56. package/node_modules/graphql/language/parser.js +33 -0
  57. package/node_modules/graphql/language/parser.mjs +33 -0
  58. package/node_modules/graphql/language/predicates.js +3 -1
  59. package/node_modules/graphql/language/predicates.mjs +5 -1
  60. package/node_modules/graphql/language/printer.js +13 -1
  61. package/node_modules/graphql/language/printer.mjs +13 -1
  62. package/node_modules/graphql/package.json +1 -1
  63. package/node_modules/graphql/type/directives.d.ts +9 -1
  64. package/node_modules/graphql/type/directives.js +10 -1
  65. package/node_modules/graphql/type/directives.mjs +10 -1
  66. package/node_modules/graphql/type/introspection.js +24 -1
  67. package/node_modules/graphql/type/introspection.mjs +24 -1
  68. package/node_modules/graphql/utilities/buildASTSchema.js +4 -0
  69. package/node_modules/graphql/utilities/buildASTSchema.mjs +4 -0
  70. package/node_modules/graphql/utilities/buildClientSchema.js +1 -0
  71. package/node_modules/graphql/utilities/buildClientSchema.mjs +1 -0
  72. package/node_modules/graphql/utilities/coerceInputValue.js +2 -2
  73. package/node_modules/graphql/utilities/coerceInputValue.mjs +2 -2
  74. package/node_modules/graphql/utilities/extendSchema.js +58 -3
  75. package/node_modules/graphql/utilities/extendSchema.mjs +58 -3
  76. package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +16 -0
  77. package/node_modules/graphql/utilities/getIntrospectionQuery.js +31 -38
  78. package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +31 -38
  79. package/node_modules/graphql/utilities/introspectionFromSchema.js +1 -0
  80. package/node_modules/graphql/utilities/introspectionFromSchema.mjs +1 -0
  81. package/node_modules/graphql/utilities/printSchema.js +1 -0
  82. package/node_modules/graphql/utilities/printSchema.mjs +1 -0
  83. package/node_modules/graphql/utilities/valueFromAST.js +12 -2
  84. package/node_modules/graphql/utilities/valueFromAST.mjs +12 -2
  85. package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +4 -0
  86. package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +4 -0
  87. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +12 -0
  88. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +12 -0
  89. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +5 -11
  90. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -11
  91. package/node_modules/graphql/validation/validate.js +12 -0
  92. package/node_modules/graphql/validation/validate.mjs +13 -2
  93. package/node_modules/graphql/version.js +2 -2
  94. package/node_modules/graphql/version.mjs +2 -2
  95. package/node_modules/hasown/CHANGELOG.md +11 -0
  96. package/node_modules/hasown/eslint.config.mjs +6 -0
  97. package/node_modules/hasown/index.d.ts +1 -0
  98. package/node_modules/hasown/package.json +14 -14
  99. package/node_modules/iconv-lite/lib/index.d.ts +114 -26
  100. package/node_modules/iconv-lite/lib/index.js +39 -40
  101. package/node_modules/iconv-lite/package.json +13 -2
  102. package/node_modules/iconv-lite/types/encodings.d.ts +423 -0
  103. package/node_modules/node-abi/abi_registry.json +10 -3
  104. package/node_modules/{semver → node-abi/node_modules/semver}/README.md +19 -4
  105. package/node_modules/{semver → node-abi/node_modules/semver}/bin/semver.js +14 -10
  106. package/node_modules/node-abi/node_modules/semver/functions/truncate.js +48 -0
  107. package/node_modules/{semver → node-abi/node_modules/semver}/index.js +2 -0
  108. package/node_modules/{semver → node-abi/node_modules/semver}/internal/re.js +1 -1
  109. package/node_modules/{semver → node-abi/node_modules/semver}/package.json +3 -3
  110. package/node_modules/{semver → node-abi/node_modules/semver}/range.bnf +5 -4
  111. package/node_modules/node-abi/package.json +1 -1
  112. package/node_modules/path-to-regexp/Readme.md +3 -3
  113. package/node_modules/path-to-regexp/dist/index.d.ts +3 -0
  114. package/node_modules/path-to-regexp/dist/index.js +215 -193
  115. package/node_modules/path-to-regexp/dist/index.js.map +1 -1
  116. package/node_modules/path-to-regexp/package.json +2 -2
  117. package/node_modules/qs/.editorconfig +1 -1
  118. package/node_modules/qs/.github/SECURITY.md +11 -0
  119. package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  120. package/node_modules/qs/CHANGELOG.md +190 -0
  121. package/node_modules/qs/README.md +29 -4
  122. package/node_modules/qs/dist/qs.js +21 -21
  123. package/node_modules/qs/eslint.config.mjs +56 -0
  124. package/node_modules/qs/lib/parse.js +94 -49
  125. package/node_modules/qs/lib/utils.js +85 -11
  126. package/node_modules/qs/package.json +10 -9
  127. package/node_modules/qs/test/parse.js +391 -13
  128. package/node_modules/qs/test/stringify.js +16 -3
  129. package/node_modules/qs/test/utils.js +173 -3
  130. package/node_modules/send/package.json +11 -8
  131. package/node_modules/serve-static/README.md +23 -23
  132. package/node_modules/serve-static/package.json +6 -3
  133. package/node_modules/side-channel-list/CHANGELOG.md +25 -4
  134. package/node_modules/side-channel-list/index.js +1 -3
  135. package/node_modules/side-channel-list/package.json +8 -8
  136. package/node_modules/side-channel-list/test/index.js +50 -0
  137. package/node_modules/uuid/dist/v35.js +3 -0
  138. package/node_modules/uuid/dist/v6.js +3 -0
  139. package/node_modules/uuid/dist-node/v35.js +3 -0
  140. package/node_modules/uuid/dist-node/v6.js +3 -0
  141. package/node_modules/uuid/package.json +1 -1
  142. package/node_modules/ws/index.js +15 -6
  143. package/node_modules/ws/lib/constants.js +1 -0
  144. package/node_modules/ws/lib/permessage-deflate.js +6 -6
  145. package/node_modules/ws/lib/websocket-server.js +10 -6
  146. package/node_modules/ws/lib/websocket.js +19 -14
  147. package/node_modules/ws/package.json +4 -3
  148. package/node_modules/ws/wrapper.mjs +14 -1
  149. package/package.json +2 -2
  150. package/node_modules/@quantiya/codevibe-core/dist/appsync/__tests__/appsync-client.test.d.ts +0 -1
  151. package/node_modules/@quantiya/codevibe-core/dist/audit-keys/__tests__/audit-keys-parity.test.d.ts +0 -1
  152. package/node_modules/@quantiya/codevibe-core/dist/audit-keys/index.d.ts +0 -41
  153. package/node_modules/@quantiya/codevibe-core/dist/auth/__tests__/auth-telemetry.test.d.ts +0 -1
  154. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +0 -1
  155. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +0 -1
  156. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-save.test.d.ts +0 -1
  157. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +0 -1
  158. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-telemetry.test.d.ts +0 -1
  159. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-test-agents.test.d.ts +0 -1
  160. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-types.test.d.ts +0 -1
  161. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-wizard.test.d.ts +0 -1
  162. package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/v1-options.test.d.ts +0 -1
  163. package/node_modules/@quantiya/codevibe-core/dist/orchestration/detect-agents.d.ts +0 -56
  164. package/node_modules/@quantiya/codevibe-core/dist/orchestration/index.d.ts +0 -3
  165. package/node_modules/@quantiya/codevibe-core/dist/orchestration/orchestration-cli.d.ts +0 -12
  166. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-bootstrap.d.ts +0 -146
  167. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-failure-recourse.d.ts +0 -23
  168. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-save.d.ts +0 -47
  169. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-seat-picker.d.ts +0 -72
  170. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-telemetry.d.ts +0 -54
  171. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-test-agents.d.ts +0 -108
  172. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-types.d.ts +0 -140
  173. package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-wizard.d.ts +0 -57
  174. package/node_modules/@quantiya/codevibe-core/dist/orchestration/v1-options.d.ts +0 -108
  175. package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/integration.test.d.ts +0 -1
  176. package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/mocks.test.d.ts +0 -1
  177. package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/output-parser.test.d.ts +0 -1
  178. package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/registry.test.d.ts +0 -1
  179. package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/subprocess.test.d.ts +0 -1
  180. package/node_modules/@quantiya/codevibe-core/dist/reviewer/index.d.ts +0 -15
  181. package/node_modules/@quantiya/codevibe-core/dist/reviewer/mocks.d.ts +0 -80
  182. package/node_modules/@quantiya/codevibe-core/dist/reviewer/output-parser.d.ts +0 -95
  183. package/node_modules/@quantiya/codevibe-core/dist/reviewer/provider.d.ts +0 -153
  184. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/claude-live-smoke.test.d.ts +0 -1
  185. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/claude.test.d.ts +0 -1
  186. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/codex-live-smoke.test.d.ts +0 -1
  187. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/codex.test.d.ts +0 -1
  188. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/gemini-live-smoke.test.d.ts +0 -1
  189. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/gemini.test.d.ts +0 -1
  190. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/claude.d.ts +0 -59
  191. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/codex.d.ts +0 -67
  192. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/common.d.ts +0 -25
  193. package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/gemini.d.ts +0 -108
  194. package/node_modules/@quantiya/codevibe-core/dist/reviewer/registry.d.ts +0 -87
  195. package/node_modules/@quantiya/codevibe-core/dist/reviewer/subprocess.d.ts +0 -117
  196. package/node_modules/@quantiya/codevibe-core/dist/reviewer/types.d.ts +0 -101
  197. package/node_modules/@quantiya/codevibe-core/dist/types/orchestration.d.ts +0 -57
  198. package/node_modules/@quantiya/codevibe-core/dist/types/reviewer.d.ts +0 -67
  199. package/node_modules/content-disposition/HISTORY.md +0 -72
  200. package/node_modules/express/History.md +0 -3858
  201. package/node_modules/hasown/.eslintrc +0 -5
  202. package/node_modules/iconv-lite/Changelog.md +0 -236
  203. package/node_modules/qs/.eslintrc +0 -39
  204. package/node_modules/send/HISTORY.md +0 -580
  205. package/node_modules/serve-static/HISTORY.md +0 -516
  206. /package/node_modules/{semver → node-abi/node_modules/semver}/LICENSE +0 -0
  207. /package/node_modules/{semver → node-abi/node_modules/semver}/classes/comparator.js +0 -0
  208. /package/node_modules/{semver → node-abi/node_modules/semver}/classes/index.js +0 -0
  209. /package/node_modules/{semver → node-abi/node_modules/semver}/classes/range.js +0 -0
  210. /package/node_modules/{semver → node-abi/node_modules/semver}/classes/semver.js +0 -0
  211. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/clean.js +0 -0
  212. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/cmp.js +0 -0
  213. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/coerce.js +0 -0
  214. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare-build.js +0 -0
  215. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare-loose.js +0 -0
  216. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare.js +0 -0
  217. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/diff.js +0 -0
  218. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/eq.js +0 -0
  219. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/gt.js +0 -0
  220. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/gte.js +0 -0
  221. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/inc.js +0 -0
  222. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/lt.js +0 -0
  223. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/lte.js +0 -0
  224. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/major.js +0 -0
  225. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/minor.js +0 -0
  226. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/neq.js +0 -0
  227. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/parse.js +0 -0
  228. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/patch.js +0 -0
  229. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/prerelease.js +0 -0
  230. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/rcompare.js +0 -0
  231. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/rsort.js +0 -0
  232. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/satisfies.js +0 -0
  233. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/sort.js +0 -0
  234. /package/node_modules/{semver → node-abi/node_modules/semver}/functions/valid.js +0 -0
  235. /package/node_modules/{semver → node-abi/node_modules/semver}/internal/constants.js +0 -0
  236. /package/node_modules/{semver → node-abi/node_modules/semver}/internal/debug.js +0 -0
  237. /package/node_modules/{semver → node-abi/node_modules/semver}/internal/identifiers.js +0 -0
  238. /package/node_modules/{semver → node-abi/node_modules/semver}/internal/lrucache.js +0 -0
  239. /package/node_modules/{semver → node-abi/node_modules/semver}/internal/parse-options.js +0 -0
  240. /package/node_modules/{semver → node-abi/node_modules/semver}/preload.js +0 -0
  241. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/gtr.js +0 -0
  242. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/intersects.js +0 -0
  243. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/ltr.js +0 -0
  244. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/max-satisfying.js +0 -0
  245. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/min-satisfying.js +0 -0
  246. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/min-version.js +0 -0
  247. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/outside.js +0 -0
  248. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/simplify.js +0 -0
  249. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/subset.js +0 -0
  250. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/to-comparators.js +0 -0
  251. /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/valid.js +0 -0
  252. /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/index.js +0 -0
  253. /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/license +0 -0
  254. /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/package.json +0 -0
  255. /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/readme.md +0 -0
@@ -37,6 +37,9 @@ class PerMessageDeflate {
37
37
  * acknowledge disabling of client context takeover
38
38
  * @param {Number} [options.concurrencyLimit=10] The number of concurrent
39
39
  * calls to zlib
40
+ * @param {Boolean} [options.isServer=false] Create the instance in either
41
+ * server or client mode
42
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
40
43
  * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
41
44
  * use of a custom server window size
42
45
  * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
@@ -47,16 +50,13 @@ class PerMessageDeflate {
47
50
  * deflate
48
51
  * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
49
52
  * inflate
50
- * @param {Boolean} [isServer=false] Create the instance in either server or
51
- * client mode
52
- * @param {Number} [maxPayload=0] The maximum allowed message length
53
53
  */
54
- constructor(options, isServer, maxPayload) {
55
- this._maxPayload = maxPayload | 0;
54
+ constructor(options) {
56
55
  this._options = options || {};
57
56
  this._threshold =
58
57
  this._options.threshold !== undefined ? this._options.threshold : 1024;
59
- this._isServer = !!isServer;
58
+ this._maxPayload = this._options.maxPayload | 0;
59
+ this._isServer = !!this._options.isServer;
60
60
  this._deflate = null;
61
61
  this._inflate = null;
62
62
 
@@ -11,7 +11,7 @@ const extension = require('./extension');
11
11
  const PerMessageDeflate = require('./permessage-deflate');
12
12
  const subprotocol = require('./subprotocol');
13
13
  const WebSocket = require('./websocket');
14
- const { GUID, kWebSocket } = require('./constants');
14
+ const { CLOSE_TIMEOUT, GUID, kWebSocket } = require('./constants');
15
15
 
16
16
  const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
17
17
 
@@ -38,6 +38,9 @@ class WebSocketServer extends EventEmitter {
38
38
  * pending connections
39
39
  * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
40
40
  * track clients
41
+ * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
42
+ * wait for the closing handshake to finish after `websocket.close()` is
43
+ * called
41
44
  * @param {Function} [options.handleProtocols] A hook to handle protocols
42
45
  * @param {String} [options.host] The hostname where to bind the server
43
46
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
@@ -67,6 +70,7 @@ class WebSocketServer extends EventEmitter {
67
70
  perMessageDeflate: false,
68
71
  handleProtocols: null,
69
72
  clientTracking: true,
73
+ closeTimeout: CLOSE_TIMEOUT,
70
74
  verifyClient: null,
71
75
  noServer: false,
72
76
  backlog: null, // use default (511 as implemented in net.js)
@@ -289,11 +293,11 @@ class WebSocketServer extends EventEmitter {
289
293
  this.options.perMessageDeflate &&
290
294
  secWebSocketExtensions !== undefined
291
295
  ) {
292
- const perMessageDeflate = new PerMessageDeflate(
293
- this.options.perMessageDeflate,
294
- true,
295
- this.options.maxPayload
296
- );
296
+ const perMessageDeflate = new PerMessageDeflate({
297
+ ...this.options.perMessageDeflate,
298
+ isServer: true,
299
+ maxPayload: this.options.maxPayload
300
+ });
297
301
 
298
302
  try {
299
303
  const offers = extension.parse(secWebSocketExtensions);
@@ -18,6 +18,7 @@ const { isBlob } = require('./validation');
18
18
 
19
19
  const {
20
20
  BINARY_TYPES,
21
+ CLOSE_TIMEOUT,
21
22
  EMPTY_BUFFER,
22
23
  GUID,
23
24
  kForOnEventAttribute,
@@ -32,7 +33,6 @@ const {
32
33
  const { format, parse } = require('./extension');
33
34
  const { toBuffer } = require('./buffer-util');
34
35
 
35
- const closeTimeout = 30 * 1000;
36
36
  const kAborted = Symbol('kAborted');
37
37
  const protocolVersions = [8, 13];
38
38
  const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
@@ -88,6 +88,7 @@ class WebSocket extends EventEmitter {
88
88
  initAsClient(this, address, protocols, options);
89
89
  } else {
90
90
  this._autoPong = options.autoPong;
91
+ this._closeTimeout = options.closeTimeout;
91
92
  this._isServer = true;
92
93
  }
93
94
  }
@@ -629,6 +630,8 @@ module.exports = WebSocket;
629
630
  * times in the same tick
630
631
  * @param {Boolean} [options.autoPong=true] Specifies whether or not to
631
632
  * automatically send a pong in response to a ping
633
+ * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to wait
634
+ * for the closing handshake to finish after `websocket.close()` is called
632
635
  * @param {Function} [options.finishRequest] A function which can be used to
633
636
  * customize the headers of each http request before it is sent
634
637
  * @param {Boolean} [options.followRedirects=false] Whether or not to follow
@@ -655,6 +658,7 @@ function initAsClient(websocket, address, protocols, options) {
655
658
  const opts = {
656
659
  allowSynchronousEvents: true,
657
660
  autoPong: true,
661
+ closeTimeout: CLOSE_TIMEOUT,
658
662
  protocolVersion: protocolVersions[1],
659
663
  maxPayload: 100 * 1024 * 1024,
660
664
  skipUTF8Validation: false,
@@ -673,6 +677,7 @@ function initAsClient(websocket, address, protocols, options) {
673
677
  };
674
678
 
675
679
  websocket._autoPong = opts.autoPong;
680
+ websocket._closeTimeout = opts.closeTimeout;
676
681
 
677
682
  if (!protocolVersions.includes(opts.protocolVersion)) {
678
683
  throw new RangeError(
@@ -688,7 +693,7 @@ function initAsClient(websocket, address, protocols, options) {
688
693
  } else {
689
694
  try {
690
695
  parsedUrl = new URL(address);
691
- } catch (e) {
696
+ } catch {
692
697
  throw new SyntaxError(`Invalid URL: ${address}`);
693
698
  }
694
699
  }
@@ -750,11 +755,11 @@ function initAsClient(websocket, address, protocols, options) {
750
755
  opts.timeout = opts.handshakeTimeout;
751
756
 
752
757
  if (opts.perMessageDeflate) {
753
- perMessageDeflate = new PerMessageDeflate(
754
- opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
755
- false,
756
- opts.maxPayload
757
- );
758
+ perMessageDeflate = new PerMessageDeflate({
759
+ ...opts.perMessageDeflate,
760
+ isServer: false,
761
+ maxPayload: opts.maxPayload
762
+ });
758
763
  opts.headers['Sec-WebSocket-Extensions'] = format({
759
764
  [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
760
765
  });
@@ -1290,7 +1295,7 @@ function senderOnError(err) {
1290
1295
  function setCloseTimer(websocket) {
1291
1296
  websocket._closeTimer = setTimeout(
1292
1297
  websocket._socket.destroy.bind(websocket._socket),
1293
- closeTimeout
1298
+ websocket._closeTimeout
1294
1299
  );
1295
1300
  }
1296
1301
 
@@ -1308,23 +1313,23 @@ function socketOnClose() {
1308
1313
 
1309
1314
  websocket._readyState = WebSocket.CLOSING;
1310
1315
 
1311
- let chunk;
1312
-
1313
1316
  //
1314
1317
  // The close frame might not have been received or the `'end'` event emitted,
1315
1318
  // for example, if the socket was destroyed due to an error. Ensure that the
1316
1319
  // `receiver` stream is closed after writing any remaining buffered data to
1317
1320
  // it. If the readable side of the socket is in flowing mode then there is no
1318
- // buffered data as everything has been already written and `readable.read()`
1319
- // will return `null`. If instead, the socket is paused, any possible buffered
1320
- // data will be read as a single chunk.
1321
+ // buffered data as everything has been already written. If instead, the
1322
+ // socket is paused, any possible buffered data will be read as a single
1323
+ // chunk.
1321
1324
  //
1322
1325
  if (
1323
1326
  !this._readableState.endEmitted &&
1324
1327
  !websocket._closeFrameReceived &&
1325
1328
  !websocket._receiver._writableState.errorEmitted &&
1326
- (chunk = websocket._socket.read()) !== null
1329
+ this._readableState.length !== 0
1327
1330
  ) {
1331
+ const chunk = this.read(this._readableState.length);
1332
+
1328
1333
  websocket._receiver.write(chunk);
1329
1334
  }
1330
1335
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws",
3
- "version": "8.18.3",
3
+ "version": "8.20.0",
4
4
  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
5
5
  "keywords": [
6
6
  "HyBi",
@@ -55,12 +55,13 @@
55
55
  }
56
56
  },
57
57
  "devDependencies": {
58
+ "@eslint/js": "^10.0.1",
58
59
  "benchmark": "^2.1.4",
59
60
  "bufferutil": "^4.0.1",
60
- "eslint": "^9.0.0",
61
+ "eslint": "^10.0.1",
61
62
  "eslint-config-prettier": "^10.0.1",
62
63
  "eslint-plugin-prettier": "^5.0.0",
63
- "globals": "^16.0.0",
64
+ "globals": "^17.0.0",
64
65
  "mocha": "^8.4.0",
65
66
  "nyc": "^15.0.0",
66
67
  "prettier": "^3.0.0",
@@ -1,8 +1,21 @@
1
1
  import createWebSocketStream from './lib/stream.js';
2
+ import extension from './lib/extension.js';
3
+ import PerMessageDeflate from './lib/permessage-deflate.js';
2
4
  import Receiver from './lib/receiver.js';
3
5
  import Sender from './lib/sender.js';
6
+ import subprotocol from './lib/subprotocol.js';
4
7
  import WebSocket from './lib/websocket.js';
5
8
  import WebSocketServer from './lib/websocket-server.js';
6
9
 
7
- export { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer };
10
+ export {
11
+ createWebSocketStream,
12
+ extension,
13
+ PerMessageDeflate,
14
+ Receiver,
15
+ Sender,
16
+ subprotocol,
17
+ WebSocket,
18
+ WebSocketServer
19
+ };
20
+
8
21
  export default WebSocket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-claude-plugin",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Control Claude Code from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "node": ">=18.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "@quantiya/codevibe-core": "^1.0.21",
50
+ "@quantiya/codevibe-core": "^1.0.23",
51
51
  "dotenv": "^16.6.1",
52
52
  "express": "^5.1.0",
53
53
  "graphql": "^16.12.0",
@@ -1,41 +0,0 @@
1
- export type Uuid = string;
2
- /**
3
- * `TaskCreated` — one per task lifecycle. Identity: `(task_id, kind)`.
4
- */
5
- export declare function dedupKeyForTaskCreated(taskId: Uuid): string;
6
- /**
7
- * `TaskTerminated` — one per task lifecycle. Identity: `(task_id, kind)`.
8
- */
9
- export declare function dedupKeyForTaskTerminated(taskId: Uuid): string;
10
- /**
11
- * `ProgressEvent` — keyed on `(task_id, kind, caller_event_id)`.
12
- *
13
- * `callerEventId` is REQUIRED (no `Option<&str>` fallback per the
14
- * 2f.2 §5.2 lock). Callers without a stable id must invent one
15
- * (e.g., a UUID at emit time); silently deriving from payload
16
- * bytes would re-introduce the dedup-drift bug the lock prevents.
17
- */
18
- export declare function dedupKeyForProgressEvent(taskId: Uuid, callerEventId: string): string;
19
- /**
20
- * `ToolUse` — keyed on `(task_id, kind, caller_event_id)`. Same
21
- * REQUIRED-not-optional rule as `dedupKeyForProgressEvent`.
22
- */
23
- export declare function dedupKeyForToolUse(taskId: Uuid, callerEventId: string): string;
24
- /**
25
- * `DestructiveActionEscalated` — keyed on `(gate_id, kind, action_id)`.
26
- *
27
- * Multiple destructive actions can be escalated within one gate
28
- * (e.g., a turn that proposes both `rm -rf` and `git push --force`).
29
- * `actionId` is the engine's internal id for the specific
30
- * destructive call (NOT the gate, NOT the round).
31
- */
32
- export declare function dedupKeyForDestructiveActionEscalated(gateId: Uuid, actionId: string): string;
33
- /**
34
- * `FlagBadApproval` — keyed on `(flagged_entry_id, kind)`.
35
- *
36
- * A user flagging the same prior approval twice should dedupe to
37
- * one flag. The Rust formula identifies the flag by the audit
38
- * entry being flagged (not by a synthesized "bad-approval id"
39
- * passed alongside).
40
- */
41
- export declare function dedupKeyForFlagBadApproval(flaggedEntryId: Uuid): string;
@@ -1,56 +0,0 @@
1
- import { Logger } from '../logger';
2
- import { AppSyncClient } from '../appsync';
3
- export type DetectableAgent = 'CLAUDE' | 'GEMINI' | 'CODEX';
4
- /**
5
- * Returns the subset of agents present on PATH. Uses `command -v`
6
- * (POSIX-standard) rather than `which` for portability across macOS
7
- * and Linux. Runs synchronously — the whole probe is <10ms in practice
8
- * even when agents are absent.
9
- *
10
- * Safe to call repeatedly; no caching here because the set of
11
- * installed agents CAN change between plugin launches (user installs
12
- * a new agent) and the caller decides how often to re-probe.
13
- */
14
- export declare function detectInstalledAgents(): DetectableAgent[];
15
- /**
16
- * Detect-and-push convenience for plugin daemon startup. All three
17
- * plugins (Claude, Gemini, Codex) call this once at start(). Runs
18
- * the local PATH probe, then pushes the set to the backend via
19
- * updateAvailableAgents. Idempotent — the backend dedupes and stores.
20
- * Non-fatal on the network failure path (caller should `.catch()`
21
- * and log but not abort startup — Quorum 2.0 auto-enable degrades
22
- * to "use last-pushed agent set" when the mutation fails).
23
- *
24
- * @param client AppSyncClient that's already been authenticated via
25
- * authenticateWithStoredTokens()
26
- * @param log Logger — warn-level when no agents detected, info
27
- * on success
28
- */
29
- export declare function pushDetectedAgents(client: AppSyncClient, log: Pick<Logger, 'info' | 'warn'>): Promise<void>;
30
- /**
31
- * Quorum 2.0 (2f.0.a.6) per-session orchestration CLI override applier.
32
- * All three plugin wrappers (`codevibe-claude`, `codevibe-gemini`,
33
- * `codevibe-codex`) export `CODEVIBE_ORCHESTRATION_OVERRIDE=true|false`
34
- * to the tmux env when the user passes `--orchestration` /
35
- * `--no-orchestration`. The daemon inherits this via the hook env
36
- * chain and calls THIS function after every session-creation site
37
- * to pin the per-session decision — wins outright over the server's
38
- * User.orchestrationEnabledDefault auto-populate.
39
- *
40
- * Called from each plugin's daemon at every session-creation call
41
- * site. Claude has one (handleSessionStart covers new + /resume
42
- * because Claude Code fires SessionStart on /resume). Gemini has
43
- * two (handleSessionStart + switchToResumedSession — /resume doesn't
44
- * fire SessionStart in Gemini). Codex has two (createLaunchSession
45
- * + handleSessionStarted — launch session gets replaced by runtime
46
- * session_meta).
47
- *
48
- * Non-fatal on error — a failed override doesn't block session setup;
49
- * the server's auto-populate decision stands and the user can flip
50
- * the session via mobile toggle after the fact.
51
- *
52
- * @param client AppSyncClient authenticated for the session's owner
53
- * @param sessionId Backend session ID (post-resumeOrCreateSession)
54
- * @param log Logger
55
- */
56
- export declare function applyPerSessionOrchestrationOverride(client: AppSyncClient, sessionId: string, log: Pick<Logger, 'info' | 'warn'>): Promise<void>;
@@ -1,3 +0,0 @@
1
- export { detectInstalledAgents, pushDetectedAgents, applyPerSessionOrchestrationOverride, type DetectableAgent, } from './detect-agents';
2
- export { runOrchestrationCli } from './orchestration-cli';
3
- export { V1_ORCHESTRATION_PROMPT_KIND, V1_ORCHESTRATION_OPTIONS, mapOptionNumberToUserDecisionKind, mapOptionToUserDecisionKind, mapV1KindToWire, type V1OrchestrationOption, type V1UserDecisionKind, } from './v1-options';
@@ -1,12 +0,0 @@
1
- /**
2
- * Dispatch for the `orchestration` subcommand. Called by runAuthCli
3
- * when it sees `argv[2] === 'orchestration'`. Supports five sub-actions:
4
- * enable — set orchestrationEnabledDefault = true
5
- * disable — set orchestrationEnabledDefault = false
6
- * status — print current policy snapshot + installed agents
7
- * configure — interactive wizard (toggle + panel customization)
8
- * setup — Phase 3.a (#190) 3-step locked setup wizard with Test
9
- * My Agents (locked role taxonomy: architecture /
10
- * correctness / security)
11
- */
12
- export declare function runOrchestrationCli(argv: string[]): Promise<void>;
@@ -1,146 +0,0 @@
1
- import { AppSyncClient } from '../appsync/appsync-client.js';
2
- import { DetectableAgent } from './detect-agents.js';
3
- import { CountBucket, WizardEntry, WizardTier } from './setup-types.js';
4
- import type { AgentKind } from '../reviewer/types.js';
5
- import type { UserReviewerPolicySnapshot } from '../types/reviewer.js';
6
- /**
7
- * Thrown by `defaultClientFactory` when `authenticateWithStoredTokens`
8
- * returns false AND the most recent failure kind is `'refresh_network'`
9
- * (transient 5xx / DNS / socket-reset during the Cognito refresh-token
10
- * POST). The wizard's `runBootstrap` catch routes this to
11
- * `subscription_status_network` — same recourse as
12
- * `getSubscriptionStatus` blowing up, but distinct from a genuine
13
- * `not_signed_in` (which we still surface as `not_signed_in` so the
14
- * user is told to re-authenticate).
15
- *
16
- * Stage 2 round-1 Codex M1. The error message is intentionally
17
- * network-shaped so the existing `isNetworkLikeError(message)` regex
18
- * also matches — defense in depth in case a future caller throws this
19
- * outside the bootstrap path.
20
- */
21
- export declare class AuthRefreshNetworkError extends Error {
22
- constructor(cause: string);
23
- }
24
- /**
25
- * Successful bootstrap output. The wizard's state machine consumes
26
- * this to seed Step 1 (seat assignment).
27
- *
28
- * R1/R2 round-1 finding M1+L3+M6 (resolved 2026-05-08): the
29
- * authenticated `client` and the user's `email` are exposed here so
30
- * the wizard can render `✓ Signed in as <email>` per design §1
31
- * lines 47-50 and avoid double-authenticating before save.
32
- */
33
- export interface BootstrapResult {
34
- tier: WizardTier;
35
- /** Pro=2, Max=3. Free can't reach success (tier-gated above). */
36
- seatBudget: number;
37
- /** Lower-cased agent kinds detected on PATH, in canonical order. */
38
- installedAgents: AgentKind[];
39
- /** Pre-bucketed for telemetry; saved here so Step 1's emit doesn't recompute. */
40
- installedAgentsBucket: CountBucket;
41
- /**
42
- * The authenticated AppSyncClient. Wizard reuses this for the save
43
- * step rather than re-running `authenticateWithStoredTokens()` —
44
- * eliminates the auth-evicted-between-bootstrap-and-save telemetry
45
- * gap (R1 round-1 M1) and the wasteful double-auth (R1 round-1 L3).
46
- */
47
- client: AppSyncClient;
48
- /**
49
- * Email of the signed-in user (Cognito `email` claim), or null if
50
- * the claim is not present. Used by the wizard's bootstrap-summary
51
- * UI per design §1 lines 47-50.
52
- */
53
- userEmail: string | null;
54
- /**
55
- * Stage 2 round-1 Codex M2: the user's saved reviewer policy at
56
- * bootstrap time, so the wizard can pre-populate seat-picker
57
- * defaults on a re-run instead of always falling back to the
58
- * tier-default agent / role priority. `null` when the snapshot
59
- * fetch failed (the wizard then proceeds without saved-defaults —
60
- * the canonical priority order is the fallback).
61
- *
62
- * Fetched via the existing `updateAvailableAgents` mutation, which
63
- * is idempotent + already called by every plugin startup
64
- * (`appsync-client.ts:721-724`). The wizard repeating it is safe
65
- * and avoids introducing a new wire contract just to read three
66
- * fields back.
67
- */
68
- savedPolicy: UserReviewerPolicySnapshot | null;
69
- }
70
- /**
71
- * Failure shape — discriminated by `kind`. The wizard surfaces a
72
- * user-facing message and exits with code 1; telemetry is fired by
73
- * `runBootstrap()` before the result is returned (so callers don't
74
- * re-fire on their failure path).
75
- */
76
- export type BootstrapFailure = {
77
- kind: 'tier_gate_free';
78
- tier: 'FREE';
79
- } | {
80
- kind: 'not_signed_in';
81
- } | {
82
- kind: 'subscription_status_network';
83
- cause: string;
84
- } | {
85
- kind: 'no_clis_installed';
86
- };
87
- export type BootstrapOutput = {
88
- ok: true;
89
- result: BootstrapResult;
90
- } | {
91
- ok: false;
92
- failure: BootstrapFailure;
93
- };
94
- /**
95
- * Inputs for `runBootstrap`. Threads the wizard run id through so
96
- * telemetry events stitch by `wizard_run_id`.
97
- *
98
- * `clientFactory` is injected so tests can swap in a mock AppSync
99
- * client; production passes `defaultClientFactory`.
100
- *
101
- * `agentDetector` defaults to `detectInstalledAgents` (the production
102
- * PATH walk) but is swappable for unit tests.
103
- *
104
- * `entry` is threaded in so `runBootstrap` can fire `wizard_started`
105
- * itself — Stage 2 round-1 Codex M3 moved the emit from the wizard
106
- * (where it skipped Free / no_clis users) into bootstrap (where it
107
- * fires post-tier-and-agents-known, before any gate).
108
- */
109
- export interface BootstrapDeps {
110
- wizardRunId: string;
111
- clientFactory: () => Promise<AppSyncClient | null>;
112
- agentDetector: () => DetectableAgent[];
113
- entry: WizardEntry;
114
- }
115
- /**
116
- * Production client factory. Builds an AppSyncClient and authenticates
117
- * with stored tokens. Returns null on `'no_tokens'` /
118
- * `'refresh_auth_rejected'` (the wizard maps both to `not_signed_in`);
119
- * THROWS `AuthRefreshNetworkError` on `'refresh_network'` so the
120
- * wizard's `runBootstrap` catch routes the user to
121
- * `subscription_status_network` instead of mistakenly telling a
122
- * signed-in user to re-login when their refresh-token POST hit a
123
- * transient 5xx.
124
- *
125
- * Stage 2 round-1 Codex M1: pre-fix, `authenticateWithStoredTokens`
126
- * returned false on every error path, including network failures
127
- * inside `callCognitoRefresh`'s catch block; the bootstrap's
128
- * `isNetworkLikeError` check only ran on caught throws and so never
129
- * fired in production for refresh-network failures.
130
- */
131
- export declare function defaultClientFactory(): Promise<AppSyncClient | null>;
132
- /**
133
- * Run Step 0. Emits `wizard_step_started{step:'bootstrap'}` on entry,
134
- * then either `wizard_step_completed` on success OR
135
- * `wizard_step_failed` + `wizard_aborted` on failure. Returns the
136
- * `BootstrapOutput` in either case so the caller can render UX before
137
- * exiting.
138
- *
139
- * Stage 2 round-1 Codex M3: `wizard_started` is emitted from here,
140
- * post-tier-and-agents-known, BEFORE the tier-gate / no-CLIs check.
141
- * Free + no_clis users now fire `wizard_started` (so analytics has
142
- * the funnel-entry numerator); auth/network bootstrap-aborts skip
143
- * `wizard_started` (no tier known) and surface as
144
- * `wizard_aborted{auth_expired | bootstrap_failure}` instead.
145
- */
146
- export declare function runBootstrap(deps: BootstrapDeps): Promise<BootstrapOutput>;
@@ -1,23 +0,0 @@
1
- import type { PickerIO } from './setup-seat-picker.js';
2
- export type Step2Choice = 'retry' | 'save_anyway' | 'exit';
3
- export type Step3Choice = 'retry' | 'exit';
4
- /**
5
- * Render the Step 2 recourse menu after a Test My Agents failure.
6
- * Loops on invalid input. Returns the user's choice. The caller is
7
- * responsible for emitting `wizard_aborted` if `exit` is chosen.
8
- *
9
- * `canSaveAnyway` controls whether the `[s]` option is offered. When
10
- * false (spawn_failure / timeout), only `[r]` and `[x]` are accepted.
11
- */
12
- export declare function askStep2Recourse(io: PickerIO, canSaveAnyway: boolean): Promise<Step2Choice>;
13
- /**
14
- * Render the Step 3 recourse menu after a save failure. The caller's
15
- * retry loop preserves the in-memory `seats` state so retry is free.
16
- *
17
- * `recoverable` honors the §6 outcome table: when false
18
- * (auth_token_expired), `[r]` is suppressed because retry can only
19
- * fail again — the user must re-run `codevibe login` and start a new
20
- * wizard. The recourse menu collapses to a single `[x] exit` choice
21
- * with a re-auth instruction line. (R1 round-1 M3 / R2 round-1 M4.)
22
- */
23
- export declare function askStep3Recourse(io: PickerIO, recoverable?: boolean): Promise<Step3Choice>;
@@ -1,47 +0,0 @@
1
- import type { AppSyncClient } from '../appsync/appsync-client.js';
2
- import { WizardSeatPick, WizardStepFailureReason } from './setup-types.js';
3
- export type SaveResult = {
4
- ok: true;
5
- } | {
6
- ok: false;
7
- reason: WizardStepFailureReason;
8
- /**
9
- * Whether `[r] retry` makes sense for this failure. Network /
10
- * 5xx / throttle are retryable (transient). auth_token_expired
11
- * is NOT retryable in-process — the user must re-run `codevibe
12
- * login` and start a new wizard run.
13
- */
14
- recoverable: boolean;
15
- };
16
- export interface SaveDeps {
17
- wizardRunId: string;
18
- client: AppSyncClient;
19
- seats: WizardSeatPick[];
20
- /**
21
- * Whether the user reached this step via "save anyway" after a
22
- * Test My Agents warning. Drives the wizard_completed.outcome
23
- * value at the wizard's terminal exit (`'ok' | 'saved_after_test_warning'`).
24
- * Not used here — Step 3 just persists; the top-level wizard
25
- * threads the outcome value into the final `wizard_completed` event.
26
- */
27
- savedAfterTestWarning: boolean;
28
- }
29
- /**
30
- * Run Step 3. Emits `wizard_step_started{step:'save'}` on entry,
31
- * `wizard_step_completed` on success, or `wizard_step_failed` with
32
- * the classified reason. Returns a SaveResult the wizard's recourse
33
- * loop consumes.
34
- */
35
- export declare function runSave(deps: SaveDeps): Promise<SaveResult>;
36
- /**
37
- * Classify a thrown error from `updateReviewerPolicy` into one of the
38
- * §7 save-step reason codes. Best-effort matching against the AppSync
39
- * client's error message conventions:
40
- * - 401 / "Unauthorized" / "Token expired" → auth_token_expired
41
- * - 429 / "Throttling" / "Rate exceeded" → update_policy_throttle
42
- * - 5xx / "Internal" / "InternalServerError" → update_policy_5xx
43
- * - everything else (fetch threw, ECONNRESET, DNS) → update_policy_network
44
- *
45
- * Exposed for tests to assert classification mapping.
46
- */
47
- export declare function classifySaveError(err: unknown): WizardStepFailureReason;