@labacacia/nps-sdk 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (363) hide show
  1. package/CHANGELOG.cn.md +2 -73
  2. package/CHANGELOG.md +2 -82
  3. package/CONTRIBUTING.cn.md +0 -0
  4. package/CONTRIBUTING.md +0 -0
  5. package/LICENSE +0 -0
  6. package/NOTICE +0 -0
  7. package/README.cn.md +3 -3
  8. package/README.md +3 -3
  9. package/doc/nps-sdk.core.cn.md +0 -0
  10. package/doc/nps-sdk.core.md +0 -0
  11. package/doc/nps-sdk.ncp.cn.md +0 -0
  12. package/doc/nps-sdk.ncp.md +0 -0
  13. package/doc/nps-sdk.ndp.cn.md +0 -0
  14. package/doc/nps-sdk.ndp.md +0 -0
  15. package/doc/nps-sdk.nip.cn.md +30 -0
  16. package/doc/nps-sdk.nip.md +30 -0
  17. package/doc/nps-sdk.nop.cn.md +0 -0
  18. package/doc/nps-sdk.nop.md +0 -0
  19. package/doc/nps-sdk.nwp.cn.md +71 -0
  20. package/doc/nps-sdk.nwp.md +71 -0
  21. package/doc/overview.cn.md +0 -0
  22. package/doc/overview.md +0 -0
  23. package/nip-ca-server/Dockerfile +0 -0
  24. package/nip-ca-server/README.md +1 -1
  25. package/nip-ca-server/db/001_init.sql +0 -0
  26. package/nip-ca-server/docker-compose.yml +0 -0
  27. package/nip-ca-server/package.json +0 -0
  28. package/nip-ca-server/src/ca.ts +0 -0
  29. package/nip-ca-server/src/db.ts +0 -0
  30. package/nip-ca-server/src/index.ts +0 -0
  31. package/nip-ca-server/tsconfig.json +0 -0
  32. package/package.json +1 -1
  33. package/src/core/anchor-cache.ts +0 -0
  34. package/src/core/cache.ts +0 -0
  35. package/src/core/canonical-json.ts +0 -0
  36. package/src/core/codec.ts +0 -0
  37. package/src/core/codecs/index.ts +0 -0
  38. package/src/core/codecs/ncp-codec.ts +0 -0
  39. package/src/core/codecs/tier1-json-codec.ts +0 -0
  40. package/src/core/codecs/tier2-msgpack-codec.ts +0 -0
  41. package/src/core/crypto-provider.ts +0 -0
  42. package/src/core/exceptions.ts +0 -0
  43. package/src/core/frame-header.ts +0 -0
  44. package/src/core/frame-registry.ts +0 -0
  45. package/src/core/frames.ts +0 -0
  46. package/src/core/index.ts +0 -0
  47. package/src/core/registry.ts +0 -0
  48. package/src/core/status-codes.ts +1 -0
  49. package/src/ncp/frames/anchor-frame.ts +0 -0
  50. package/src/ncp/frames/caps-frame.ts +0 -0
  51. package/src/ncp/frames/diff-frame.ts +0 -0
  52. package/src/ncp/frames/error-frame.ts +0 -0
  53. package/src/ncp/frames/hello-frame.ts +0 -0
  54. package/src/ncp/frames/stream-frame.ts +0 -0
  55. package/src/ncp/frames.ts +0 -0
  56. package/src/ncp/handshake.ts +0 -0
  57. package/src/ncp/ncp-patch-format.ts +0 -0
  58. package/src/ncp/registry.ts +0 -0
  59. package/src/ncp/stream-manager.ts +0 -0
  60. package/src/ndp/dns-txt.ts +86 -0
  61. package/src/ndp/frames.ts +0 -0
  62. package/src/ndp/index.ts +1 -0
  63. package/src/ndp/ndp-registry.ts +34 -0
  64. package/src/ndp/registry.ts +0 -0
  65. package/src/ndp/validator.ts +0 -0
  66. package/src/nip/assurance-level.ts +6 -1
  67. package/src/nip/error-codes.ts +4 -2
  68. package/src/nip/identity.ts +0 -0
  69. package/src/nip/registry.ts +0 -0
  70. package/src/nip/x509/oids.ts +3 -4
  71. package/src/nop/client.ts +1 -1
  72. package/src/nop/frames.ts +0 -0
  73. package/src/nop/index.ts +0 -0
  74. package/src/nop/models.ts +0 -0
  75. package/src/nop/nop-types.ts +0 -0
  76. package/src/nop/registry.ts +0 -0
  77. package/src/nwp/client.ts +4 -4
  78. package/src/nwp/frames.ts +0 -0
  79. package/src/nwp/index.ts +0 -0
  80. package/src/nwp/registry.ts +0 -0
  81. package/src/setup.ts +0 -0
  82. package/tests/core/anchor-cache.test.ts +0 -0
  83. package/tests/core/codec.test.ts +0 -0
  84. package/tests/core/frame-registry.test.ts +0 -0
  85. package/tests/core.test.ts +0 -0
  86. package/tests/ncp/diff-binary-bitset.test.ts +0 -0
  87. package/tests/ncp/e2e-enc-reject.test.ts +0 -0
  88. package/tests/ncp/err-error-frame.test.ts +0 -0
  89. package/tests/ncp/frames.test.ts +0 -0
  90. package/tests/ncp/framing.test.ts +0 -0
  91. package/tests/ncp/hello-frame.test.ts +0 -0
  92. package/tests/ncp/inline-anchor.test.ts +0 -0
  93. package/tests/ncp/security.test.ts +0 -0
  94. package/tests/ncp/stream-window.test.ts +0 -0
  95. package/tests/ncp/stream.test.ts +0 -0
  96. package/tests/ncp/version-negotiation.test.ts +0 -0
  97. package/tests/ndp.test.ts +106 -0
  98. package/tests/nip.test.ts +0 -0
  99. package/tests/nop.test.ts +0 -0
  100. package/tests/nwp.test.ts +0 -0
  101. package/tsconfig.json +0 -0
  102. package/tsup.config.ts +0 -0
  103. package/vitest.config.ts +0 -0
  104. package/dist/core/anchor-cache.d.ts +0 -42
  105. package/dist/core/anchor-cache.d.ts.map +0 -1
  106. package/dist/core/anchor-cache.js +0 -104
  107. package/dist/core/anchor-cache.js.map +0 -1
  108. package/dist/core/cache.d.ts +0 -14
  109. package/dist/core/cache.d.ts.map +0 -1
  110. package/dist/core/cache.js +0 -80
  111. package/dist/core/cache.js.map +0 -1
  112. package/dist/core/canonical-json.d.ts +0 -12
  113. package/dist/core/canonical-json.d.ts.map +0 -1
  114. package/dist/core/canonical-json.js +0 -44
  115. package/dist/core/canonical-json.js.map +0 -1
  116. package/dist/core/codec.d.ts +0 -32
  117. package/dist/core/codec.d.ts.map +0 -1
  118. package/dist/core/codec.js +0 -119
  119. package/dist/core/codec.js.map +0 -1
  120. package/dist/core/codecs/index.d.ts +0 -4
  121. package/dist/core/codecs/index.d.ts.map +0 -1
  122. package/dist/core/codecs/index.js +0 -6
  123. package/dist/core/codecs/index.js.map +0 -1
  124. package/dist/core/codecs/ncp-codec.d.ts +0 -39
  125. package/dist/core/codecs/ncp-codec.d.ts.map +0 -1
  126. package/dist/core/codecs/ncp-codec.js +0 -93
  127. package/dist/core/codecs/ncp-codec.js.map +0 -1
  128. package/dist/core/codecs/tier1-json-codec.d.ts +0 -10
  129. package/dist/core/codecs/tier1-json-codec.d.ts.map +0 -1
  130. package/dist/core/codecs/tier1-json-codec.js +0 -28
  131. package/dist/core/codecs/tier1-json-codec.js.map +0 -1
  132. package/dist/core/codecs/tier2-msgpack-codec.d.ts +0 -10
  133. package/dist/core/codecs/tier2-msgpack-codec.d.ts.map +0 -1
  134. package/dist/core/codecs/tier2-msgpack-codec.js +0 -26
  135. package/dist/core/codecs/tier2-msgpack-codec.js.map +0 -1
  136. package/dist/core/crypto-provider.d.ts +0 -31
  137. package/dist/core/crypto-provider.d.ts.map +0 -1
  138. package/dist/core/crypto-provider.js +0 -10
  139. package/dist/core/crypto-provider.js.map +0 -1
  140. package/dist/core/exceptions.d.ts +0 -27
  141. package/dist/core/exceptions.d.ts.map +0 -1
  142. package/dist/core/exceptions.js +0 -52
  143. package/dist/core/exceptions.js.map +0 -1
  144. package/dist/core/frame-header.d.ts +0 -87
  145. package/dist/core/frame-header.d.ts.map +0 -1
  146. package/dist/core/frame-header.js +0 -185
  147. package/dist/core/frame-header.js.map +0 -1
  148. package/dist/core/frame-registry.d.ts +0 -35
  149. package/dist/core/frame-registry.d.ts.map +0 -1
  150. package/dist/core/frame-registry.js +0 -63
  151. package/dist/core/frame-registry.js.map +0 -1
  152. package/dist/core/frames.d.ts +0 -81
  153. package/dist/core/frames.d.ts.map +0 -1
  154. package/dist/core/frames.js +0 -154
  155. package/dist/core/frames.js.map +0 -1
  156. package/dist/core/index.d.ts +0 -11
  157. package/dist/core/index.d.ts.map +0 -1
  158. package/dist/core/index.js +0 -22
  159. package/dist/core/index.js.map +0 -1
  160. package/dist/core/registry.d.ts +0 -11
  161. package/dist/core/registry.d.ts.map +0 -1
  162. package/dist/core/registry.js +0 -17
  163. package/dist/core/registry.js.map +0 -1
  164. package/dist/core/status-codes.d.ts +0 -28
  165. package/dist/core/status-codes.d.ts.map +0 -1
  166. package/dist/core/status-codes.js +0 -38
  167. package/dist/core/status-codes.js.map +0 -1
  168. package/dist/index.d.ts +0 -2
  169. package/dist/index.d.ts.map +0 -1
  170. package/dist/index.js +0 -10
  171. package/dist/index.js.map +0 -1
  172. package/dist/ncp/frames/anchor-frame.d.ts +0 -29
  173. package/dist/ncp/frames/anchor-frame.d.ts.map +0 -1
  174. package/dist/ncp/frames/anchor-frame.js +0 -54
  175. package/dist/ncp/frames/anchor-frame.js.map +0 -1
  176. package/dist/ncp/frames/caps-frame.d.ts +0 -29
  177. package/dist/ncp/frames/caps-frame.d.ts.map +0 -1
  178. package/dist/ncp/frames/caps-frame.js +0 -29
  179. package/dist/ncp/frames/caps-frame.js.map +0 -1
  180. package/dist/ncp/frames/diff-frame.d.ts +0 -32
  181. package/dist/ncp/frames/diff-frame.d.ts.map +0 -1
  182. package/dist/ncp/frames/diff-frame.js +0 -37
  183. package/dist/ncp/frames/diff-frame.js.map +0 -1
  184. package/dist/ncp/frames/error-frame.d.ts +0 -16
  185. package/dist/ncp/frames/error-frame.d.ts.map +0 -1
  186. package/dist/ncp/frames/error-frame.js +0 -13
  187. package/dist/ncp/frames/error-frame.js.map +0 -1
  188. package/dist/ncp/frames/hello-frame.d.ts +0 -21
  189. package/dist/ncp/frames/hello-frame.d.ts.map +0 -1
  190. package/dist/ncp/frames/hello-frame.js +0 -25
  191. package/dist/ncp/frames/hello-frame.js.map +0 -1
  192. package/dist/ncp/frames/stream-frame.d.ts +0 -16
  193. package/dist/ncp/frames/stream-frame.d.ts.map +0 -1
  194. package/dist/ncp/frames/stream-frame.js +0 -18
  195. package/dist/ncp/frames/stream-frame.js.map +0 -1
  196. package/dist/ncp/frames.d.ts +0 -94
  197. package/dist/ncp/frames.d.ts.map +0 -1
  198. package/dist/ncp/frames.js +0 -192
  199. package/dist/ncp/frames.js.map +0 -1
  200. package/dist/ncp/handshake.d.ts +0 -30
  201. package/dist/ncp/handshake.d.ts.map +0 -1
  202. package/dist/ncp/handshake.js +0 -80
  203. package/dist/ncp/handshake.js.map +0 -1
  204. package/dist/ncp/index.d.ts +0 -12
  205. package/dist/ncp/index.d.ts.map +0 -1
  206. package/dist/ncp/index.js +0 -14
  207. package/dist/ncp/index.js.map +0 -1
  208. package/dist/ncp/ncp-error-codes.d.ts +0 -23
  209. package/dist/ncp/ncp-error-codes.d.ts.map +0 -1
  210. package/dist/ncp/ncp-error-codes.js +0 -34
  211. package/dist/ncp/ncp-error-codes.js.map +0 -1
  212. package/dist/ncp/ncp-patch-format.d.ts +0 -7
  213. package/dist/ncp/ncp-patch-format.d.ts.map +0 -1
  214. package/dist/ncp/ncp-patch-format.js +0 -13
  215. package/dist/ncp/ncp-patch-format.js.map +0 -1
  216. package/dist/ncp/preamble.d.ts +0 -47
  217. package/dist/ncp/preamble.d.ts.map +0 -1
  218. package/dist/ncp/preamble.js +0 -74
  219. package/dist/ncp/preamble.js.map +0 -1
  220. package/dist/ncp/registry.d.ts +0 -3
  221. package/dist/ncp/registry.d.ts.map +0 -1
  222. package/dist/ncp/registry.js +0 -13
  223. package/dist/ncp/registry.js.map +0 -1
  224. package/dist/ncp/stream-manager.d.ts +0 -57
  225. package/dist/ncp/stream-manager.d.ts.map +0 -1
  226. package/dist/ncp/stream-manager.js +0 -163
  227. package/dist/ncp/stream-manager.js.map +0 -1
  228. package/dist/ndp/frames.d.ts +0 -56
  229. package/dist/ndp/frames.d.ts.map +0 -1
  230. package/dist/ndp/frames.js +0 -87
  231. package/dist/ndp/frames.js.map +0 -1
  232. package/dist/ndp/index.d.ts +0 -5
  233. package/dist/ndp/index.d.ts.map +0 -1
  234. package/dist/ndp/index.js +0 -7
  235. package/dist/ndp/index.js.map +0 -1
  236. package/dist/ndp/ndp-registry.d.ts +0 -11
  237. package/dist/ndp/ndp-registry.d.ts.map +0 -1
  238. package/dist/ndp/ndp-registry.js +0 -79
  239. package/dist/ndp/ndp-registry.js.map +0 -1
  240. package/dist/ndp/registry.d.ts +0 -3
  241. package/dist/ndp/registry.d.ts.map +0 -1
  242. package/dist/ndp/registry.js +0 -10
  243. package/dist/ndp/registry.js.map +0 -1
  244. package/dist/ndp/validator.d.ts +0 -18
  245. package/dist/ndp/validator.d.ts.map +0 -1
  246. package/dist/ndp/validator.js +0 -48
  247. package/dist/ndp/validator.js.map +0 -1
  248. package/dist/nip/acme/client.d.ts +0 -31
  249. package/dist/nip/acme/client.d.ts.map +0 -1
  250. package/dist/nip/acme/client.js +0 -136
  251. package/dist/nip/acme/client.js.map +0 -1
  252. package/dist/nip/acme/index.d.ts +0 -6
  253. package/dist/nip/acme/index.d.ts.map +0 -1
  254. package/dist/nip/acme/index.js +0 -8
  255. package/dist/nip/acme/index.js.map +0 -1
  256. package/dist/nip/acme/jws.d.ts +0 -31
  257. package/dist/nip/acme/jws.d.ts.map +0 -1
  258. package/dist/nip/acme/jws.js +0 -76
  259. package/dist/nip/acme/jws.js.map +0 -1
  260. package/dist/nip/acme/messages.d.ts +0 -71
  261. package/dist/nip/acme/messages.d.ts.map +0 -1
  262. package/dist/nip/acme/messages.js +0 -4
  263. package/dist/nip/acme/messages.js.map +0 -1
  264. package/dist/nip/acme/server.d.ts +0 -41
  265. package/dist/nip/acme/server.d.ts.map +0 -1
  266. package/dist/nip/acme/server.js +0 -458
  267. package/dist/nip/acme/server.js.map +0 -1
  268. package/dist/nip/acme/wire.d.ts +0 -19
  269. package/dist/nip/acme/wire.d.ts.map +0 -1
  270. package/dist/nip/acme/wire.js +0 -21
  271. package/dist/nip/acme/wire.js.map +0 -1
  272. package/dist/nip/assurance-level.d.ts +0 -14
  273. package/dist/nip/assurance-level.d.ts.map +0 -1
  274. package/dist/nip/assurance-level.js +0 -33
  275. package/dist/nip/assurance-level.js.map +0 -1
  276. package/dist/nip/cert-format.d.ts +0 -5
  277. package/dist/nip/cert-format.d.ts.map +0 -1
  278. package/dist/nip/cert-format.js +0 -6
  279. package/dist/nip/cert-format.js.map +0 -1
  280. package/dist/nip/error-codes.d.ts +0 -23
  281. package/dist/nip/error-codes.d.ts.map +0 -1
  282. package/dist/nip/error-codes.js +0 -30
  283. package/dist/nip/error-codes.js.map +0 -1
  284. package/dist/nip/frames.d.ts +0 -53
  285. package/dist/nip/frames.d.ts.map +0 -1
  286. package/dist/nip/frames.js +0 -106
  287. package/dist/nip/frames.js.map +0 -1
  288. package/dist/nip/identity.d.ts +0 -18
  289. package/dist/nip/identity.d.ts.map +0 -1
  290. package/dist/nip/identity.js +0 -94
  291. package/dist/nip/identity.js.map +0 -1
  292. package/dist/nip/index.d.ts +0 -10
  293. package/dist/nip/index.d.ts.map +0 -1
  294. package/dist/nip/index.js +0 -13
  295. package/dist/nip/index.js.map +0 -1
  296. package/dist/nip/registry.d.ts +0 -3
  297. package/dist/nip/registry.d.ts.map +0 -1
  298. package/dist/nip/registry.js +0 -10
  299. package/dist/nip/registry.js.map +0 -1
  300. package/dist/nip/verifier.d.ts +0 -23
  301. package/dist/nip/verifier.d.ts.map +0 -1
  302. package/dist/nip/verifier.js +0 -90
  303. package/dist/nip/verifier.js.map +0 -1
  304. package/dist/nip/x509/builder.d.ts +0 -35
  305. package/dist/nip/x509/builder.d.ts.map +0 -1
  306. package/dist/nip/x509/builder.js +0 -59
  307. package/dist/nip/x509/builder.js.map +0 -1
  308. package/dist/nip/x509/index.d.ts +0 -4
  309. package/dist/nip/x509/index.d.ts.map +0 -1
  310. package/dist/nip/x509/index.js +0 -6
  311. package/dist/nip/x509/index.js.map +0 -1
  312. package/dist/nip/x509/oids.d.ts +0 -17
  313. package/dist/nip/x509/oids.d.ts.map +0 -1
  314. package/dist/nip/x509/oids.js +0 -23
  315. package/dist/nip/x509/oids.js.map +0 -1
  316. package/dist/nip/x509/verifier.d.ts +0 -26
  317. package/dist/nip/x509/verifier.d.ts.map +0 -1
  318. package/dist/nip/x509/verifier.js +0 -171
  319. package/dist/nip/x509/verifier.js.map +0 -1
  320. package/dist/nop/client.d.ts +0 -34
  321. package/dist/nop/client.d.ts.map +0 -1
  322. package/dist/nop/client.js +0 -90
  323. package/dist/nop/client.js.map +0 -1
  324. package/dist/nop/frames.d.ts +0 -65
  325. package/dist/nop/frames.d.ts.map +0 -1
  326. package/dist/nop/frames.js +0 -148
  327. package/dist/nop/frames.js.map +0 -1
  328. package/dist/nop/index.d.ts +0 -5
  329. package/dist/nop/index.d.ts.map +0 -1
  330. package/dist/nop/index.js +0 -7
  331. package/dist/nop/index.js.map +0 -1
  332. package/dist/nop/models.d.ts +0 -58
  333. package/dist/nop/models.d.ts.map +0 -1
  334. package/dist/nop/models.js +0 -50
  335. package/dist/nop/models.js.map +0 -1
  336. package/dist/nop/nop-types.d.ts +0 -136
  337. package/dist/nop/nop-types.d.ts.map +0 -1
  338. package/dist/nop/nop-types.js +0 -44
  339. package/dist/nop/nop-types.js.map +0 -1
  340. package/dist/nop/registry.d.ts +0 -3
  341. package/dist/nop/registry.d.ts.map +0 -1
  342. package/dist/nop/registry.js +0 -11
  343. package/dist/nop/registry.js.map +0 -1
  344. package/dist/nwp/client.d.ts +0 -22
  345. package/dist/nwp/client.d.ts.map +0 -1
  346. package/dist/nwp/client.js +0 -101
  347. package/dist/nwp/client.js.map +0 -1
  348. package/dist/nwp/frames.d.ts +0 -46
  349. package/dist/nwp/frames.d.ts.map +0 -1
  350. package/dist/nwp/frames.js +0 -81
  351. package/dist/nwp/frames.js.map +0 -1
  352. package/dist/nwp/index.d.ts +0 -4
  353. package/dist/nwp/index.d.ts.map +0 -1
  354. package/dist/nwp/index.js +0 -6
  355. package/dist/nwp/index.js.map +0 -1
  356. package/dist/nwp/registry.d.ts +0 -3
  357. package/dist/nwp/registry.d.ts.map +0 -1
  358. package/dist/nwp/registry.js +0 -9
  359. package/dist/nwp/registry.js.map +0 -1
  360. package/dist/setup.d.ts +0 -10
  361. package/dist/setup.d.ts.map +0 -1
  362. package/dist/setup.js +0 -29
  363. package/dist/setup.js.map +0 -1
@@ -1,21 +0,0 @@
1
- export interface HelloFrame {
2
- frame: string;
3
- nps_version: string;
4
- min_version?: string;
5
- supported_encodings: string[];
6
- supported_protocols: string[];
7
- agent_id?: string;
8
- max_frame_payload?: number;
9
- ext_support?: boolean;
10
- max_concurrent_streams?: number;
11
- e2e_enc_algorithms?: string[];
12
- }
13
- /**
14
- * Validate a HelloFrame.
15
- *
16
- * Required fields: nps_version, supported_encodings (non-empty), supported_protocols (non-empty).
17
- *
18
- * @throws {NcpError} NPS-CLIENT-BAD-FRAME if any required field is missing or empty.
19
- */
20
- export declare function validateHelloFrame(frame: HelloFrame): void;
21
- //# sourceMappingURL=hello-frame.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hello-frame.d.ts","sourceRoot":"","sources":["../../../src/ncp/frames/hello-frame.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAqB1D"}
@@ -1,25 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // Copyright (c) 2026 LabAcacia / INNO LOTUS PTY LTD
3
- //
4
- // HelloFrame (0x06) — Native-mode client handshake
5
- // NPS-1 §4.6
6
- import { NcpError } from "../../core/frame-header.js";
7
- /**
8
- * Validate a HelloFrame.
9
- *
10
- * Required fields: nps_version, supported_encodings (non-empty), supported_protocols (non-empty).
11
- *
12
- * @throws {NcpError} NPS-CLIENT-BAD-FRAME if any required field is missing or empty.
13
- */
14
- export function validateHelloFrame(frame) {
15
- if (!frame.nps_version) {
16
- throw new NcpError("NPS-CLIENT-BAD-FRAME", "HelloFrame missing required field: nps_version");
17
- }
18
- if (!frame.supported_encodings || frame.supported_encodings.length === 0) {
19
- throw new NcpError("NPS-CLIENT-BAD-FRAME", "HelloFrame missing required field: supported_encodings (must be non-empty)");
20
- }
21
- if (!frame.supported_protocols || frame.supported_protocols.length === 0) {
22
- throw new NcpError("NPS-CLIENT-BAD-FRAME", "HelloFrame missing required field: supported_protocols (must be non-empty)");
23
- }
24
- }
25
- //# sourceMappingURL=hello-frame.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hello-frame.js","sourceRoot":"","sources":["../../../src/ncp/frames/hello-frame.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AACpD,EAAE;AACF,mDAAmD;AACnD,aAAa;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAetD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAiB;IAClD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAChB,sBAAsB,EACtB,gDAAgD,CACjD,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,KAAK,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,QAAQ,CAChB,sBAAsB,EACtB,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,KAAK,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,QAAQ,CAChB,sBAAsB,EACtB,4EAA4E,CAC7E,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,16 +0,0 @@
1
- export interface StreamFrame {
2
- frame: string;
3
- stream_id: string;
4
- seq: number;
5
- is_last: boolean;
6
- anchor_ref?: string;
7
- data: unknown[];
8
- window_size?: number;
9
- error_code?: string;
10
- }
11
- /**
12
- * Validate stream_id is a valid UUID v4.
13
- * @throws {NcpError} NPS-CLIENT-BAD-FRAME if stream_id is not a valid UUID v4.
14
- */
15
- export declare function validateStreamFrame(frame: StreamFrame): void;
16
- //# sourceMappingURL=stream-frame.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-frame.d.ts","sourceRoot":"","sources":["../../../src/ncp/frames/stream-frame.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAO5D"}
@@ -1,18 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // Copyright (c) 2026 LabAcacia / INNO LOTUS PTY LTD
3
- //
4
- // StreamFrame (0x03) — Streaming data chunks with flow control
5
- // NPS-1 §4.3
6
- import { NcpError } from "../../core/frame-header.js";
7
- // UUID v4 format: xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx
8
- const UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
9
- /**
10
- * Validate stream_id is a valid UUID v4.
11
- * @throws {NcpError} NPS-CLIENT-BAD-FRAME if stream_id is not a valid UUID v4.
12
- */
13
- export function validateStreamFrame(frame) {
14
- if (!UUID_V4_RE.test(frame.stream_id)) {
15
- throw new NcpError("NPS-CLIENT-BAD-FRAME", `stream_id "${frame.stream_id}" is not a valid UUID v4`);
16
- }
17
- }
18
- //# sourceMappingURL=stream-frame.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-frame.js","sourceRoot":"","sources":["../../../src/ncp/frames/stream-frame.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AACpD,EAAE;AACF,+DAA+D;AAC/D,aAAa;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAatD,4DAA4D;AAC5D,MAAM,UAAU,GACd,wEAAwE,CAAC;AAE3E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAkB;IACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,QAAQ,CAChB,sBAAsB,EACtB,cAAc,KAAK,CAAC,SAAS,0BAA0B,CACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,94 +0,0 @@
1
- import { EncodingTier, FrameType } from "../core/frames.js";
2
- import type { NpsFrame } from "../core/codec.js";
3
- export interface SchemaField {
4
- name: string;
5
- type: string;
6
- semantic?: string;
7
- nullable?: boolean;
8
- }
9
- export interface FrameSchema {
10
- fields: readonly SchemaField[];
11
- }
12
- export declare class AnchorFrame implements NpsFrame {
13
- readonly anchorId: string;
14
- readonly schema: FrameSchema;
15
- readonly ttl: number;
16
- readonly frameType = FrameType.ANCHOR;
17
- readonly preferredTier = EncodingTier.MSGPACK;
18
- constructor(anchorId: string, schema: FrameSchema, ttl?: number);
19
- toDict(): Record<string, unknown>;
20
- static fromDict(data: Record<string, unknown>): AnchorFrame;
21
- }
22
- export interface JsonPatchOperation {
23
- op: string;
24
- path: string;
25
- value?: unknown;
26
- }
27
- export declare class DiffFrame implements NpsFrame {
28
- readonly anchorRef: string;
29
- readonly baseSeq: number;
30
- readonly patch: readonly JsonPatchOperation[];
31
- readonly entityId?: string | undefined;
32
- readonly frameType = FrameType.DIFF;
33
- readonly preferredTier = EncodingTier.MSGPACK;
34
- constructor(anchorRef: string, baseSeq: number, patch: readonly JsonPatchOperation[], entityId?: string | undefined);
35
- toDict(): Record<string, unknown>;
36
- static fromDict(data: Record<string, unknown>): DiffFrame;
37
- }
38
- export declare class StreamFrame implements NpsFrame {
39
- readonly streamId: string;
40
- readonly seq: number;
41
- readonly isLast: boolean;
42
- readonly data: readonly Record<string, unknown>[];
43
- readonly anchorRef?: string | undefined;
44
- readonly windowSize?: number | undefined;
45
- readonly frameType = FrameType.STREAM;
46
- readonly preferredTier = EncodingTier.MSGPACK;
47
- constructor(streamId: string, seq: number, isLast: boolean, data: readonly Record<string, unknown>[], anchorRef?: string | undefined, windowSize?: number | undefined);
48
- toDict(): Record<string, unknown>;
49
- static fromDict(data: Record<string, unknown>): StreamFrame;
50
- }
51
- export declare class CapsFrame implements NpsFrame {
52
- readonly anchorRef: string;
53
- readonly count: number;
54
- readonly data: readonly Record<string, unknown>[];
55
- readonly nextCursor?: string | undefined;
56
- readonly tokenEst?: number | undefined;
57
- readonly cached?: boolean | undefined;
58
- readonly tokenizerUsed?: string | undefined;
59
- readonly frameType = FrameType.CAPS;
60
- readonly preferredTier = EncodingTier.MSGPACK;
61
- constructor(anchorRef: string, count: number, data: readonly Record<string, unknown>[], nextCursor?: string | undefined, tokenEst?: number | undefined, cached?: boolean | undefined, tokenizerUsed?: string | undefined);
62
- toDict(): Record<string, unknown>;
63
- static fromDict(data: Record<string, unknown>): CapsFrame;
64
- }
65
- export declare class ErrorFrame implements NpsFrame {
66
- readonly status: string;
67
- readonly error: string;
68
- readonly message?: string | undefined;
69
- readonly details?: Record<string, unknown> | undefined;
70
- readonly frameType = FrameType.ERROR;
71
- readonly preferredTier = EncodingTier.MSGPACK;
72
- constructor(status: string, error: string, message?: string | undefined, details?: Record<string, unknown> | undefined);
73
- toDict(): Record<string, unknown>;
74
- static fromDict(data: Record<string, unknown>): ErrorFrame;
75
- }
76
- export declare class HelloFrame implements NpsFrame {
77
- readonly npsVersion: string;
78
- readonly supportedEncodings: readonly string[];
79
- readonly supportedProtocols: readonly string[];
80
- minVersion?: string | undefined;
81
- agentId?: string | undefined;
82
- maxFramePayload: number;
83
- extSupport: boolean;
84
- maxConcurrentStreams: number;
85
- e2eEncAlgorithms?: readonly string[] | undefined;
86
- readonly frameType = FrameType.HELLO;
87
- readonly preferredTier = EncodingTier.JSON;
88
- static readonly DEFAULT_MAX_FRAME_PAYLOAD = 65535;
89
- static readonly DEFAULT_MAX_CONCURRENT_STREAMS = 32;
90
- constructor(npsVersion: string, supportedEncodings: readonly string[], supportedProtocols: readonly string[], minVersion?: string | undefined, agentId?: string | undefined, maxFramePayload?: number, extSupport?: boolean, maxConcurrentStreams?: number, e2eEncAlgorithms?: readonly string[] | undefined);
91
- toDict(): Record<string, unknown>;
92
- static fromDict(data: Record<string, unknown>): HelloFrame;
93
- }
94
- //# sourceMappingURL=frames.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/ncp/frames.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAO,MAAM,CAAC;IAClB,IAAI,EAAO,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CAChC;AAID,qBAAa,WAAY,YAAW,QAAQ;aAKxB,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAI,WAAW;aACrB,GAAG,EAA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AAA;IAGzD,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAcjC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU;CAa3D"}
@@ -1,192 +0,0 @@
1
- // Copyright 2026 INNO LOTUS PTY LTD
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { EncodingTier, FrameType } from "../core/frames.js";
4
- // ── AnchorFrame ───────────────────────────────────────────────────────────────
5
- export class AnchorFrame {
6
- anchorId;
7
- schema;
8
- ttl;
9
- frameType = FrameType.ANCHOR;
10
- preferredTier = EncodingTier.MSGPACK;
11
- constructor(anchorId, schema, ttl = 3600) {
12
- this.anchorId = anchorId;
13
- this.schema = schema;
14
- this.ttl = ttl;
15
- }
16
- toDict() {
17
- return {
18
- anchor_id: this.anchorId,
19
- schema: { fields: this.schema.fields.map((f) => ({ ...f })) },
20
- ttl: this.ttl,
21
- };
22
- }
23
- static fromDict(data) {
24
- const schemaRaw = data["schema"];
25
- return new AnchorFrame(data["anchor_id"], { fields: schemaRaw.fields }, data["ttl"] ?? 3600);
26
- }
27
- }
28
- // ── DiffFrame ─────────────────────────────────────────────────────────────────
29
- export class DiffFrame {
30
- anchorRef;
31
- baseSeq;
32
- patch;
33
- entityId;
34
- frameType = FrameType.DIFF;
35
- preferredTier = EncodingTier.MSGPACK;
36
- constructor(anchorRef, baseSeq, patch, entityId) {
37
- this.anchorRef = anchorRef;
38
- this.baseSeq = baseSeq;
39
- this.patch = patch;
40
- this.entityId = entityId;
41
- }
42
- toDict() {
43
- return {
44
- anchor_ref: this.anchorRef,
45
- base_seq: this.baseSeq,
46
- patch: this.patch.map((p) => ({ ...p })),
47
- entity_id: this.entityId ?? null,
48
- };
49
- }
50
- static fromDict(data) {
51
- return new DiffFrame(data["anchor_ref"], data["base_seq"], data["patch"], data["entity_id"] ?? undefined);
52
- }
53
- }
54
- // ── StreamFrame ───────────────────────────────────────────────────────────────
55
- export class StreamFrame {
56
- streamId;
57
- seq;
58
- isLast;
59
- data;
60
- anchorRef;
61
- windowSize;
62
- frameType = FrameType.STREAM;
63
- preferredTier = EncodingTier.MSGPACK;
64
- constructor(streamId, seq, isLast, data, anchorRef, windowSize) {
65
- this.streamId = streamId;
66
- this.seq = seq;
67
- this.isLast = isLast;
68
- this.data = data;
69
- this.anchorRef = anchorRef;
70
- this.windowSize = windowSize;
71
- }
72
- toDict() {
73
- return {
74
- stream_id: this.streamId,
75
- seq: this.seq,
76
- is_last: this.isLast,
77
- data: this.data,
78
- anchor_ref: this.anchorRef ?? null,
79
- window_size: this.windowSize ?? null,
80
- };
81
- }
82
- static fromDict(data) {
83
- return new StreamFrame(data["stream_id"], data["seq"], data["is_last"], data["data"], data["anchor_ref"] ?? undefined, data["window_size"] ?? undefined);
84
- }
85
- }
86
- // ── CapsFrame ─────────────────────────────────────────────────────────────────
87
- export class CapsFrame {
88
- anchorRef;
89
- count;
90
- data;
91
- nextCursor;
92
- tokenEst;
93
- cached;
94
- tokenizerUsed;
95
- frameType = FrameType.CAPS;
96
- preferredTier = EncodingTier.MSGPACK;
97
- constructor(anchorRef, count, data, nextCursor, tokenEst, cached, tokenizerUsed) {
98
- this.anchorRef = anchorRef;
99
- this.count = count;
100
- this.data = data;
101
- this.nextCursor = nextCursor;
102
- this.tokenEst = tokenEst;
103
- this.cached = cached;
104
- this.tokenizerUsed = tokenizerUsed;
105
- }
106
- toDict() {
107
- return {
108
- anchor_ref: this.anchorRef,
109
- count: this.count,
110
- data: this.data,
111
- next_cursor: this.nextCursor ?? null,
112
- token_est: this.tokenEst ?? null,
113
- cached: this.cached ?? null,
114
- tokenizer_used: this.tokenizerUsed ?? null,
115
- };
116
- }
117
- static fromDict(data) {
118
- return new CapsFrame(data["anchor_ref"], data["count"], data["data"], data["next_cursor"] ?? undefined, data["token_est"] ?? undefined, data["cached"] ?? undefined, data["tokenizer_used"] ?? undefined);
119
- }
120
- }
121
- // ── ErrorFrame ────────────────────────────────────────────────────────────────
122
- export class ErrorFrame {
123
- status;
124
- error;
125
- message;
126
- details;
127
- frameType = FrameType.ERROR;
128
- preferredTier = EncodingTier.MSGPACK;
129
- constructor(status, error, message, details) {
130
- this.status = status;
131
- this.error = error;
132
- this.message = message;
133
- this.details = details;
134
- }
135
- toDict() {
136
- return {
137
- status: this.status,
138
- error: this.error,
139
- message: this.message ?? null,
140
- details: this.details ?? null,
141
- };
142
- }
143
- static fromDict(data) {
144
- return new ErrorFrame(data["status"], data["error"], data["message"] ?? undefined, data["details"] ?? undefined);
145
- }
146
- }
147
- // ── HelloFrame ────────────────────────────────────────────────────────────────
148
- // NPS-1 §4.6 — Native-mode handshake (0x06). Always Tier-1 JSON: encoding
149
- // is not yet negotiated when this frame is sent.
150
- export class HelloFrame {
151
- npsVersion;
152
- supportedEncodings;
153
- supportedProtocols;
154
- minVersion;
155
- agentId;
156
- maxFramePayload;
157
- extSupport;
158
- maxConcurrentStreams;
159
- e2eEncAlgorithms;
160
- frameType = FrameType.HELLO;
161
- preferredTier = EncodingTier.JSON;
162
- static DEFAULT_MAX_FRAME_PAYLOAD = 0xFFFF;
163
- static DEFAULT_MAX_CONCURRENT_STREAMS = 32;
164
- constructor(npsVersion, supportedEncodings, supportedProtocols, minVersion, agentId, maxFramePayload = HelloFrame.DEFAULT_MAX_FRAME_PAYLOAD, extSupport = false, maxConcurrentStreams = HelloFrame.DEFAULT_MAX_CONCURRENT_STREAMS, e2eEncAlgorithms) {
165
- this.npsVersion = npsVersion;
166
- this.supportedEncodings = supportedEncodings;
167
- this.supportedProtocols = supportedProtocols;
168
- this.minVersion = minVersion;
169
- this.agentId = agentId;
170
- this.maxFramePayload = maxFramePayload;
171
- this.extSupport = extSupport;
172
- this.maxConcurrentStreams = maxConcurrentStreams;
173
- this.e2eEncAlgorithms = e2eEncAlgorithms;
174
- }
175
- toDict() {
176
- return {
177
- nps_version: this.npsVersion,
178
- supported_encodings: [...this.supportedEncodings],
179
- supported_protocols: [...this.supportedProtocols],
180
- min_version: this.minVersion ?? null,
181
- agent_id: this.agentId ?? null,
182
- max_frame_payload: this.maxFramePayload,
183
- ext_support: this.extSupport,
184
- max_concurrent_streams: this.maxConcurrentStreams,
185
- e2e_enc_algorithms: this.e2eEncAlgorithms ? [...this.e2eEncAlgorithms] : null,
186
- };
187
- }
188
- static fromDict(data) {
189
- return new HelloFrame(data["nps_version"], data["supported_encodings"] ?? [], data["supported_protocols"] ?? [], data["min_version"] ?? undefined, data["agent_id"] ?? undefined, data["max_frame_payload"] ?? HelloFrame.DEFAULT_MAX_FRAME_PAYLOAD, data["ext_support"] ?? false, data["max_concurrent_streams"] ?? HelloFrame.DEFAULT_MAX_CONCURRENT_STREAMS, data["e2e_enc_algorithms"] ?? undefined);
190
- }
191
- }
192
- //# sourceMappingURL=frames.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/ncp/frames.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgB5D,iFAAiF;AAEjF,MAAM,OAAO,WAAW;IAKJ;IACA;IACA;IANT,SAAS,GAAO,SAAS,CAAC,MAAM,CAAC;IACjC,aAAa,GAAG,YAAY,CAAC,OAAO,CAAC;IAE9C,YACkB,QAAgB,EAChB,MAAqB,EACrB,MAAmB,IAAI;QAFvB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAe;QACrB,QAAG,GAAH,GAAG,CAAoB;IACtC,CAAC;IAEJ,MAAM;QACJ,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,MAAM,EAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE;YAChE,GAAG,EAAQ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version and server.nps_version
5
- * (component-wise — "0.9" < "0.10" < "1.0").
6
- * If the effective client minimum (min_version ?? nps_version) > server.nps_version,
7
- * the versions are incompatible.
8
- *
9
- * Spec: NPS-1 §2.6
10
- */
11
- export declare function negotiateVersion(client: {
12
- nps_version: string;
13
- min_version?: string;
14
- }, server: {
15
- nps_version: string;
16
- }): {
17
- session_version: string;
18
- compatible: boolean;
19
- error_code?: string;
20
- };
21
- /**
22
- * Negotiate the encoding between client and server preferred lists.
23
- *
24
- * Returns the first mutually supported encoding, preferring "msgpack" over "json".
25
- * Returns null if there is no intersection.
26
- */
27
- export declare function negotiateEncoding(client: string[], server: string[]): {
28
- encoding: string | null;
29
- };
30
- //# sourceMappingURL=handshake.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/ncp/handshake.ts"],"names":[],"mappings":"AAgCA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAmBvE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,MAAM,EAAE,GACf;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAmB7B"}
@@ -1,80 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // Copyright (c) 2026 LabAcacia / INNO LOTUS PTY LTD
3
- //
4
- // Handshake — Version negotiation and encoding negotiation
5
- // NPS-1 §2.6
6
- /**
7
- * Parse a "major.minor" (optionally "major.minor.patch") version string into a
8
- * tuple of numeric components. Invalid parts become NaN which makes subsequent
9
- * comparisons return false in both directions (safe failure).
10
- */
11
- function parseVersion(v) {
12
- return v.split(".").map((p) => Number.parseInt(p, 10));
13
- }
14
- /**
15
- * Numeric component-wise comparison of two version strings.
16
- * Returns negative if a < b, zero if equal, positive if a > b.
17
- * Avoids the lexicographic pitfall where "0.9" > "0.10".
18
- */
19
- function compareVersions(a, b) {
20
- const partsA = parseVersion(a);
21
- const partsB = parseVersion(b);
22
- const len = Math.max(partsA.length, partsB.length);
23
- for (let i = 0; i < len; i += 1) {
24
- const x = partsA[i] ?? 0;
25
- const y = partsB[i] ?? 0;
26
- if (x !== y)
27
- return x - y;
28
- }
29
- return 0;
30
- }
31
- /**
32
- * Negotiate the session NPS version between client and server.
33
- *
34
- * Session version = numeric min of client.nps_version and server.nps_version
35
- * (component-wise — "0.9" < "0.10" < "1.0").
36
- * If the effective client minimum (min_version ?? nps_version) > server.nps_version,
37
- * the versions are incompatible.
38
- *
39
- * Spec: NPS-1 §2.6
40
- */
41
- export function negotiateVersion(client, server) {
42
- const clientMin = client.min_version ?? client.nps_version;
43
- const serverVersion = server.nps_version;
44
- if (compareVersions(clientMin, serverVersion) > 0) {
45
- return {
46
- session_version: serverVersion,
47
- compatible: false,
48
- error_code: "NCP-VERSION-INCOMPATIBLE",
49
- };
50
- }
51
- // Session version = component-wise min of client.nps_version and server.nps_version
52
- const sessionVersion = compareVersions(client.nps_version, serverVersion) <= 0
53
- ? client.nps_version
54
- : serverVersion;
55
- return { session_version: sessionVersion, compatible: true };
56
- }
57
- /**
58
- * Negotiate the encoding between client and server preferred lists.
59
- *
60
- * Returns the first mutually supported encoding, preferring "msgpack" over "json".
61
- * Returns null if there is no intersection.
62
- */
63
- export function negotiateEncoding(client, server) {
64
- const serverSet = new Set(server);
65
- // Prefer msgpack over json (and over any other encoding)
66
- if (client.includes("msgpack") && serverSet.has("msgpack")) {
67
- return { encoding: "msgpack" };
68
- }
69
- if (client.includes("json") && serverSet.has("json")) {
70
- return { encoding: "json" };
71
- }
72
- // Fall back to first intersection in client-preference order
73
- for (const enc of client) {
74
- if (serverSet.has(enc)) {
75
- return { encoding: enc };
76
- }
77
- }
78
- return { encoding: null };
79
- }
80
- //# sourceMappingURL=handshake.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../src/ncp/handshake.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AACpD,EAAE;AACF,2DAA2D;AAC3D,aAAa;AAEb;;;;GAIG;AACH,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,CAAS,EAAE,CAAS;IAC3C,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAqD,EACrD,MAA+B;IAE/B,MAAM,SAAS,GAAG,MAAM,C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EAAE,CAAC;AAC5B,CAAC"}
@@ -1,12 +0,0 @@
1
- export * from "./frames/anchor-frame.js";
2
- export * from "./frames/caps-frame.js";
3
- export * from "./frames/diff-frame.js";
4
- export * from "./frames/error-frame.js";
5
- export * from "./frames/hello-frame.js";
6
- export * from "./frames/stream-frame.js";
7
- export * from "./ncp-error-codes.js";
8
- export * from "./ncp-patch-format.js";
9
- export * from "./handshake.js";
10
- export * from "./stream-manager.js";
11
- export * from "./preamble.js";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ncp/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
package/dist/ncp/index.js DELETED
@@ -1,14 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // Copyright (c) 2026 LabAcacia / INNO LOTUS PTY LTD
3
- export * from "./frames/anchor-frame.js";
4
- export * from "./frames/caps-frame.js";
5
- export * from "./frames/diff-frame.js";
6
- export * from "./frames/error-frame.js";
7
- export * from "./frames/hello-frame.js";
8
- export * from "./frames/stream-frame.js";
9
- export * from "./ncp-error-codes.js";
10
- export * from "./ncp-patch-format.js";
11
- export * from "./handshake.js";
12
- export * from "./stream-manager.js";
13
- export * from "./preamble.js";
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ncp/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
@@ -1,23 +0,0 @@
1
- export declare const NCP_ERROR_CODES: {
2
- readonly NCP_FRAME_PARSE_ERROR: "NCP-FRAME-PARSE-ERROR";
3
- readonly NCP_FRAME_INCOMPLETE: "NCP-FRAME-INCOMPLETE";
4
- readonly NCP_PREAMBLE_INVALID: "NCP-PREAMBLE-INVALID";
5
- readonly NCP_FRAME_UNKNOWN_TYPE: "NCP-FRAME-UNKNOWN-TYPE";
6
- readonly NCP_FRAME_PAYLOAD_TOO_LARGE: "NCP-FRAME-PAYLOAD-TOO-LARGE";
7
- readonly NCP_FRAME_FLAGS_INVALID: "NCP-FRAME-FLAGS-INVALID";
8
- readonly NCP_ANCHOR_NOT_FOUND: "NCP-ANCHOR-NOT-FOUND";
9
- readonly NCP_ANCHOR_SCHEMA_INVALID: "NCP-ANCHOR-SCHEMA-INVALID";
10
- readonly NCP_ANCHOR_ID_MISMATCH: "NCP-ANCHOR-ID-MISMATCH";
11
- readonly NCP_ANCHOR_STALE: "NCP-ANCHOR-STALE";
12
- readonly NCP_STREAM_SEQ_GAP: "NCP-STREAM-SEQ-GAP";
13
- readonly NCP_STREAM_NOT_FOUND: "NCP-STREAM-NOT-FOUND";
14
- readonly NCP_STREAM_LIMIT_EXCEEDED: "NCP-STREAM-LIMIT-EXCEEDED";
15
- readonly NCP_STREAM_WINDOW_OVERFLOW: "NCP-STREAM-WINDOW-OVERFLOW";
16
- readonly NCP_ENCODING_UNSUPPORTED: "NCP-ENCODING-UNSUPPORTED";
17
- readonly NCP_DIFF_FORMAT_UNSUPPORTED: "NCP-DIFF-FORMAT-UNSUPPORTED";
18
- readonly NCP_VERSION_INCOMPATIBLE: "NCP-VERSION-INCOMPATIBLE";
19
- readonly NCP_ENC_NOT_NEGOTIATED: "NCP-ENC-NOT-NEGOTIATED";
20
- readonly NCP_ENC_AUTH_FAILED: "NCP-ENC-AUTH-FAILED";
21
- };
22
- export type NcpErrorCode = typeof NCP_ERROR_CODES[keyof typeof NCP_ERROR_CODES];
23
- //# sourceMappingURL=ncp-error-codes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ncp-error-codes.d.ts","sourceRoot":"","sources":["../../src/ncp/ncp-error-codes.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;CAuBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
@@ -1,34 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // Copyright (c) 2026 LabAcacia / INNO LOTUS PTY LTD
3
- //
4
- // NCP Error Codes — All v0.4 protocol error codes
5
- // NPS-1 §6 + §7.4
6
- //
7
- // Implementation-only codes (NCP_FRAME_PARSE_ERROR, NCP_FRAME_INCOMPLETE) cover
8
- // wire-layer parse failures not in spec §6. See test/ncp_test_results.md spec
9
- // question 2 for the proposal to register them upstream.
10
- export const NCP_ERROR_CODES = {
11
- // Implementation-only codes (not in spec §6 — see test_results.md spec question 2)
12
- NCP_FRAME_PARSE_ERROR: "NCP-FRAME-PARSE-ERROR",
13
- NCP_FRAME_INCOMPLETE: "NCP-FRAME-INCOMPLETE",
14
- // NPS-RFC-0001 — native-mode preamble
15
- NCP_PREAMBLE_INVALID: "NCP-PREAMBLE-INVALID",
16
- // Spec-defined codes
17
- NCP_FRAME_UNKNOWN_TYPE: "NCP-FRAME-UNKNOWN-TYPE",
18
- NCP_FRAME_PAYLOAD_TOO_LARGE: "NCP-FRAME-PAYLOAD-TOO-LARGE",
19
- NCP_FRAME_FLAGS_INVALID: "NCP-FRAME-FLAGS-INVALID",
20
- NCP_ANCHOR_NOT_FOUND: "NCP-ANCHOR-NOT-FOUND",
21
- NCP_ANCHOR_SCHEMA_INVALID: "NCP-ANCHOR-SCHEMA-INVALID",
22
- NCP_ANCHOR_ID_MISMATCH: "NCP-ANCHOR-ID-MISMATCH",
23
- NCP_ANCHOR_STALE: "NCP-ANCHOR-STALE",
24
- NCP_STREAM_SEQ_GAP: "NCP-STREAM-SEQ-GAP",
25
- NCP_STREAM_NOT_FOUND: "NCP-STREAM-NOT-FOUND",
26
- NCP_STREAM_LIMIT_EXCEEDED: "NCP-STREAM-LIMIT-EXCEEDED",
27
- NCP_STREAM_WINDOW_OVERFLOW: "NCP-STREAM-WINDOW-OVERFLOW",
28
- NCP_ENCODING_UNSUPPORTED: "NCP-ENCODING-UNSUPPORTED",
29
- NCP_DIFF_FORMAT_UNSUPPORTED: "NCP-DIFF-FORMAT-UNSUPPORTED",
30
- NCP_VERSION_INCOMPATIBLE: "NCP-VERSION-INCOMPATIBLE",
31
- NCP_ENC_NOT_NEGOTIATED: "NCP-ENC-NOT-NEGOTIATED",
32
- NCP_ENC_AUTH_FAILED: "NCP-ENC-AUTH-FAILED",
33
- };
34
- //# sourceMappingURL=ncp-error-codes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ncp-error-codes.js","sourceRoot":"","sources":["../../src/ncp/ncp-error-codes.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AACpD,EAAE;AACF,kDAAkD;AAClD,kBAAkB;AAClB,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,yDAAyD;AAEzD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,mFAAmF;IACnF,qBAAqB,EAAE,uBAAuB;IAC9C,oBAAoB,EAAE,sBAAsB;IAC5C,sCAAsC;IACtC,oBAAoB,EAAE,sBAAsB;IAC5C,qBAAqB;IACrB,sBAAsB,EAAE,wBAAwB;IAChD,2BAA2B,EAAE,6BAA6B;IAC1D,uBAAuB,EAAE,yBAAyB;IAClD,oBAAoB,EAAE,sBAAsB;IAC5C,yBAAyB,EAAE,2BAA2B;IACtD,sBAAsB,EAAE,wBAAwB;IAChD,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IACxC,oBAAoB,EAAE,sBAAsB;IAC5C,yBAAyB,EAAE,2BAA2B;IACtD,0BAA0B,EAAE,4BAA4B;IACxD,wBAAwB,EAAE,0BAA0B;IACpD,2BAA2B,EAAE,6BAA6B;IAC1D,wBAAwB,EAAE,0BAA0B;IACpD,sBAAsB,EAAE,wBAAwB;IAChD,mBAAmB,EAAE,qBAAqB;CAClC,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const PATCH_FORMAT: {
2
- readonly JSON_PATCH: "json_patch";
3
- readonly BINARY_BITSET: "binary_bitset";
4
- };
5
- export type PatchFormat = typeof PATCH_FORMAT[keyof typeof PATCH_FORMAT];
6
- export declare function isValidPatchFormat(v: unknown): v is PatchFormat;
7
- //# sourceMappingURL=ncp-patch-format.d.ts.map