@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
package/CHANGELOG.cn.md CHANGED
@@ -8,75 +8,6 @@
8
8
 
9
9
  ---
10
10
 
11
- ## [1.0.0-alpha.4] —— 2026-04-30
12
-
13
- ### 新增
14
-
15
- - **NPS-RFC-0001 Phase 2 —— NCP 连接前导(TypeScript helper 跟进)。**
16
- `src/ncp/preamble.ts` 暴露 `writePreamble(stream)` /
17
- `readPreamble(stream)`,往返字面量 `b"NPS/1.0\n"` 哨兵;
18
- `tests/ncp/preamble.test.ts` 覆盖。让 TypeScript SDK 与 .NET /
19
- Python / Go / Java 在 alpha.4 的 preamble helper 持平。
20
- - **NPS-RFC-0002 Phase A/B —— X.509 NID 证书 + ACME `agent-01`
21
- (TypeScript 端口)。** 新增 `src/nip/` 子模块:
22
- - `nip/x509/` —— X.509 NID 证书 builder + verifier
23
- (`x509.Builder`、`x509.Verifier`)。
24
- - `nip/acme/` —— ACME `agent-01` 客户端 + 服务端参考实现
25
- (`AcmeServer`、`AcmeClient`);按 NPS-RFC-0002 Phase B 的 JWS
26
- 签名 wire 包络。
27
- - `nip/assurance-level.ts` —— Agent 身份保证等级
28
- (`anonymous` / `attested` / `verified`),承接 NPS-RFC-0003。
29
- - `nip/cert-format.ts` —— IdentFrame `cert_format` 判别器
30
- (`v1` Ed25519 vs. `x509`)。
31
- - `nip/error-codes.ts` —— NIP 错误码命名空间。
32
- - `nip/verifier.ts` —— dual-trust IdentFrame 验证器(v1 + X.509)。
33
- - 20 个新测试覆盖 preamble 往返、X.509 签发 + 解析、dual-trust 验证、
34
- ACME agent-01 全流程。总数:284 tests 全绿(alpha.3 时 264)。
35
-
36
- ### 变更
37
-
38
- - 分发版本升至 `1.0.0-alpha.4`。
39
- - `src/nip/frames.ts` —— IdentFrame wire 形状扩展,可携带可选的
40
- `cert_format` 判别器 + `x509_chain` 字段,与 v1 Ed25519 字段并存。
41
- alpha.3 写出的 v1 IdentFrame 仍可被 alpha.4 验签。
42
-
43
- ### npm 发布说明
44
-
45
- - 本仓库 / tag 是 `@labacacia/nps-sdk` `1.0.0-alpha.4` 的权威参考。
46
- 延续 alpha.3 的情况,npm publish 可能需要带 2FA-bypass 的 granular
47
- access token —— 如果 npm registry 上的版本暂时落后于本仓库 tag,
48
- 以 tag 为准;下一次 registry cut 后 `npm install` 即可解析到本
49
- commit。
50
-
51
- ### 套件级 alpha.4 要点
52
-
53
- - **NPS-RFC-0002 X.509 + ACME** —— 完整跨 SDK 端口波(.NET / Java /
54
- Python / TypeScript / Go / Rust)。
55
- - **NPS-CR-0002 —— Anchor Node topology 查询** —— `topology.snapshot`
56
- / `topology.stream`(.NET 参考 + L2 conformance)。TypeScript 消费
57
- 侧 helper 后续版本跟进。
58
- - **`nps-registry` SQLite 实仓** + **`nps-ledger` Phase 2**
59
- (RFC 9162 Merkle + STH + inclusion proof)已在 daemon 仓库交付。
60
-
61
- ---
62
-
63
- ## [1.0.0-alpha.3] —— 2026-04-25
64
-
65
- ### Changed
66
-
67
- - 版本升级至 `1.0.0-alpha.3`,与 NPS `v1.0.0-alpha.3` 套件同步。本次 TypeScript SDK 无功能变更。
68
- - 264 tests, ≥98% 覆盖率仍全绿。
69
-
70
- ### 套件级 alpha.3 要点(各语言 helper 在 alpha.4 跟进)
71
-
72
- - **NPS-RFC-0001 —— NCP 连接前导**(Accepted)。原生模式连接现以字面量 `b"NPS/1.0\n"`(8 字节)开头。.NET SDK 已落地参考实现;TypeScript helper 在 alpha.4 跟进。
73
- - **NPS-RFC-0003 —— Agent 身份保证等级**(Accepted)。NIP IdentFrame 与 NWM 新增三态 `assurance_level`(`anonymous`/`attested`/`verified`)。.NET 参考类型已落地;TypeScript 同步在 alpha.4。
74
- - **NPS-RFC-0004 —— NID 声誉日志(CT 风格)**(Accepted)。append-only Merkle 日志条目结构发布;.NET 参考签名器已落地(并以 `nps-ledger` daemon Phase 1 形态发布)。TypeScript helper 在 alpha.4 跟进。
75
- - **NPS-CR-0001 —— Anchor / Bridge 节点拆分。** 旧的 "Gateway Node" 角色更名为 **Anchor Node**;"NPS↔外部协议翻译" 单独成为 **Bridge Node** 类型。AnnounceFrame 新增 `node_kind` / `cluster_anchor` / `bridge_protocols`。源代码层面变更落在 `spec/` + .NET 参考实现。
76
- - **6 个 NPS 常驻 daemon。** NPS-Dev 新建 `daemons/` 目录,定义 `npsd` / `nps-runner` / `nps-gateway` / `nps-registry` / `nps-cloud-ca` / `nps-ledger`;其中 `npsd` 提供 L1 功能性参考实现,其余为 Phase 1 骨架。
77
-
78
- ---
79
-
80
11
  ## [1.0.0-alpha.2] —— 2026-04-19
81
12
 
82
13
  ### Fixed
@@ -104,7 +35,5 @@
104
35
 
105
36
  作为 NPS 套件 `v1.0.0-alpha.1` 的一部分首次公开 alpha。
106
37
 
107
- [1.0.0-alpha.4]: https://gitee.com/labacacia/NPS-sdk-ts/releases/tag/v1.0.0-alpha.4
108
- [1.0.0-alpha.3]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.3
109
- [1.0.0-alpha.2]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.2
110
- [1.0.0-alpha.1]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.1
38
+ [1.0.0-alpha.2]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.2
39
+ [1.0.0-alpha.1]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.1
package/CHANGELOG.md CHANGED
@@ -8,84 +8,6 @@ Until NPS reaches v1.0 stable, every repository in the suite is synchronized to
8
8
 
9
9
  ---
10
10
 
11
- ## [1.0.0-alpha.4] — 2026-04-30
12
-
13
- ### Added
14
-
15
- - **NPS-RFC-0001 Phase 2 — NCP connection preamble (TypeScript helper
16
- parity).** `src/ncp/preamble.ts` exposes `writePreamble(stream)` and
17
- `readPreamble(stream)` round-tripping the literal `b"NPS/1.0\n"`
18
- sentinel; matched by `tests/ncp/preamble.test.ts`. Brings TypeScript
19
- in line with the .NET / Python / Go / Java preamble helpers shipped
20
- at alpha.4.
21
- - **NPS-RFC-0002 Phase A/B — X.509 NID certificates + ACME `agent-01`
22
- (TypeScript port).** New surface under `src/nip/`:
23
- - `nip/x509/` — X.509 NID certificate builder + verifier
24
- (`x509.Builder`, `x509.Verifier`).
25
- - `nip/acme/` — ACME `agent-01` client + server reference
26
- (`AcmeServer`, `AcmeClient`); JWS-signed wire envelope per
27
- NPS-RFC-0002 Phase B.
28
- - `nip/assurance-level.ts` — agent identity assurance levels
29
- (`anonymous` / `attested` / `verified`) per NPS-RFC-0003.
30
- - `nip/cert-format.ts` — IdentFrame `cert_format` discriminator
31
- (`v1` Ed25519 vs. `x509`).
32
- - `nip/error-codes.ts` — NIP error code namespace strings.
33
- - `nip/verifier.ts` — dual-trust IdentFrame verifier (v1 + X.509).
34
- - 20 new tests covering preamble round-trip, X.509 issuance + parsing,
35
- dual-trust verification, and ACME agent-01 round-trip. Total: 284
36
- tests green (was 264 at alpha.3).
37
-
38
- ### Changed
39
-
40
- - Distribution version bumped to `1.0.0-alpha.4`.
41
- - `src/nip/frames.ts` — IdentFrame wire shape extended with optional
42
- `cert_format` discriminator + `x509_chain` field alongside the
43
- existing v1 Ed25519 fields. v1 IdentFrames written by alpha.3
44
- consumers continue to verify unchanged.
45
-
46
- ### Note: npm publish status
47
-
48
- - This repo / tag is the canonical `1.0.0-alpha.4` reference for
49
- `@labacacia/nps-sdk`. As at the alpha.3 ship cycle, npm publish
50
- may require a granular access token with 2FA-bypass enabled — if
51
- the registry version lags this repo's tag, the tag is the
52
- authoritative artifact and `npm install` against the next
53
- registry cut will resolve to this commit.
54
-
55
- ### Suite-wide highlights at alpha.4
56
-
57
- - **NPS-RFC-0002 X.509 + ACME** — full cross-SDK port wave (.NET /
58
- Java / Python / TypeScript / Go / Rust). Servers can now issue
59
- dual-trust IdentFrames (v1 Ed25519 + X.509 leaf cert chained to a
60
- self-signed root) and self-onboard NIDs over ACME's `agent-01`
61
- challenge type.
62
- - **NPS-CR-0002 — Anchor Node topology queries** — `topology.snapshot`
63
- / `topology.stream` query types (.NET reference + L2 conformance
64
- suite). TypeScript consumer-side helpers planned for a later
65
- release.
66
- - **`nps-registry` SQLite-backed real registry** + **`nps-ledger`
67
- Phase 2** (RFC 9162 Merkle + STH + inclusion proofs) shipped in the
68
- daemon repos.
69
-
70
- ---
71
-
72
- ## [1.0.0-alpha.3] — 2026-04-25
73
-
74
- ### Changed
75
-
76
- - Version bump to `1.0.0-alpha.3` for suite-wide synchronization with the NPS `v1.0.0-alpha.3` release. No functional changes in the TypeScript SDK at this milestone.
77
- - 264 tests, ≥98% coverage still green.
78
-
79
- ### Suite-wide highlights at alpha.3 (per-language helpers planned for alpha.4)
80
-
81
- - **NPS-RFC-0001 — NCP connection preamble** (Accepted). Native-mode connections now begin with the literal `b"NPS/1.0\n"` (8 bytes). Reference helper landed in the .NET SDK; TypeScript helper deferred to alpha.4.
82
- - **NPS-RFC-0003 — Agent identity assurance levels** (Accepted). NIP IdentFrame and NWM gain a tri-state `assurance_level` (`anonymous`/`attested`/`verified`). Reference types landed in .NET; TypeScript parity deferred to alpha.4.
83
- - **NPS-RFC-0004 — NID reputation log (CT-style)** (Accepted). Append-only Merkle log entry shape published; reference signer landed in .NET (and shipped as the `nps-ledger` daemon Phase 1). TypeScript helpers deferred to alpha.4.
84
- - **NPS-CR-0001 — Anchor / Bridge node split.** The legacy "Gateway Node" role is renamed to **Anchor Node**; the "translate NPS↔external protocol" role is now its own **Bridge Node** type. AnnounceFrame gained `node_kind` / `cluster_anchor` / `bridge_protocols`. Source-of-truth changes are in `spec/` + the .NET reference implementation.
85
- - **6 NPS resident daemons.** New `daemons/` tree in NPS-Dev defines `npsd` / `nps-runner` / `nps-gateway` / `nps-registry` / `nps-cloud-ca` / `nps-ledger`; `npsd` ships an L1-functional reference and the rest ship as Phase 1 skeletons.
86
-
87
- ---
88
-
89
11
  ## [1.0.0-alpha.2] — 2026-04-19
90
12
 
91
13
  ### Fixed
@@ -113,7 +35,5 @@ Until NPS reaches v1.0 stable, every repository in the suite is synchronized to
113
35
 
114
36
  First public alpha as part of the NPS suite `v1.0.0-alpha.1` release.
115
37
 
116
- [1.0.0-alpha.4]: https://github.com/labacacia/NPS-sdk-ts/releases/tag/v1.0.0-alpha.4
117
- [1.0.0-alpha.3]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.3
118
- [1.0.0-alpha.2]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.2
119
- [1.0.0-alpha.1]: https://github.com/LabAcacia/NPS-Dev/releases/tag/v1.0.0-alpha.1
38
+ [1.0.0-alpha.2]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.2
39
+ [1.0.0-alpha.1]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.1
File without changes
package/CONTRIBUTING.md CHANGED
File without changes
package/LICENSE CHANGED
File without changes
package/NOTICE CHANGED
File without changes
package/README.cn.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## 状态
9
9
 
10
- **v1.0.0-alpha.4 — RFC-0002 跨 SDK 端口波(第三棒)** · 5 个协议 · 271 个测试 · 覆盖率 ≥ 98%
10
+ **v1.0.0-alpha.6 — RFC-0002 跨 SDK 端口波(第三棒)** · 5 个协议 · 271 个测试 · 覆盖率 ≥ 98%
11
11
 
12
12
  | 协议 | 类 | 状态 |
13
13
  |------|----|------|
@@ -17,7 +17,7 @@
17
17
  | NDP — Neural Discovery Protocol | `InMemoryNdpRegistry`、`NdpAnnounceValidator` | ✅ |
18
18
  | NOP — Neural Orchestration Protocol | `NopClient` | ✅ |
19
19
 
20
- **alpha.4 新增** —— 完整的 NPS-RFC-0002 X.509 + ACME `agent-01` NID 证书原语:
20
+ **早期新增** —— 完整的 NPS-RFC-0002 X.509 + ACME `agent-01` NID 证书原语:
21
21
 
22
22
  - `nip.x509` —— `issueLeaf` / `issueRoot` / `verify`(基于 `@peculiar/x509` + 原生 Web Crypto Ed25519)。
23
23
  - `nip.acme` —— `AcmeClient` + 进程内 `AcmeServer` + JWS / messages helpers(RFC 8555 + RFC 8037 EdDSA)。
@@ -158,4 +158,4 @@ npm run build
158
158
 
159
159
  ## 许可证
160
160
 
161
- Apache 2.0 —— 详见 [LICENSE](../../LICENSE)。
161
+ Apache 2.0 —— 详见 [LICENSE](https://github.com/labacacia/NPS-Dev/blob/main/LICENSE)。
package/README.md CHANGED
@@ -7,7 +7,7 @@ Part of the [LabAcacia](https://github.com/LabAcacia) / INNO LOTUS PTY LTD open-
7
7
 
8
8
  ## Status
9
9
 
10
- **v1.0.0-alpha.4 — RFC-0002 cross-SDK port (third language)** · 5 protocols · 271 tests · ≥ 98% coverage
10
+ **v1.0.0-alpha.6 — RFC-0002 cross-SDK port (third language)** · 5 protocols · 271 tests · ≥ 98% coverage
11
11
 
12
12
  | Protocol | Class | Status |
13
13
  |----------|-------|--------|
@@ -17,7 +17,7 @@ Part of the [LabAcacia](https://github.com/LabAcacia) / INNO LOTUS PTY LTD open-
17
17
  | NDP — Neural Discovery Protocol | `InMemoryNdpRegistry`, `NdpAnnounceValidator` | ✅ |
18
18
  | NOP — Neural Orchestration Protocol | `NopClient` | ✅ |
19
19
 
20
- **alpha.4 additions** — Full NPS-RFC-0002 X.509 + ACME `agent-01` NID certificate primitives:
20
+ **Earlier additions** — Full NPS-RFC-0002 X.509 + ACME `agent-01` NID certificate primitives:
21
21
 
22
22
  - `nip.x509` — `issueLeaf` / `issueRoot` / `verify` (built on `@peculiar/x509` + native Web Crypto Ed25519).
23
23
  - `nip.acme` — `AcmeClient` + in-process `AcmeServer` + JWS / message helpers (RFC 8555 + EdDSA per RFC 8037).
@@ -158,4 +158,4 @@ node node_modules/tsup/dist/cli-default.js
158
158
 
159
159
  ## License
160
160
 
161
- Apache 2.0 — see [LICENSE](../../LICENSE)
161
+ Apache 2.0 — see [LICENSE](https://github.com/labacacia/NPS-Dev/blob/main/LICENSE)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,6 +19,7 @@ NIP 是 NPS 的 TLS/PKI。本模块暴露三个身份帧
19
19
  - [`RevokeFrame` (0x22)](#revokeframe-0x22)
20
20
  - [`NipIdentity`](#nipidentity)
21
21
  - [规范化 JSON 与签名格式](#规范化-json-与签名格式)
22
+ - [`NipErrorCodes`](#niperrorecodes)
22
23
 
23
24
  ---
24
25
 
@@ -233,3 +234,32 @@ const signed = new IdentFrame(unsigned.nid, unsigned.pubKey, meta, signature)
233
234
  const ok = id.verify(signed.unsignedDict(), signed.signature);
234
235
  // → true
235
236
  ```
237
+
238
+ ---
239
+
240
+ ## `NipErrorCodes`
241
+
242
+ NIP wire 错误码字符串常量。从 `@labacacia/nps-sdk/nip` 导入。
243
+
244
+ ```typescript
245
+ import { NipErrorCodes } from "@labacacia/nps-sdk/nip";
246
+ ```
247
+
248
+ | 常量 | Wire 值 | 起始版本 |
249
+ |------|---------|----------|
250
+ | `NipErrorCodes.IDENT_SIG_INVALID` | `"NIP-IDENT-SIG-INVALID"` | alpha.4 |
251
+ | `NipErrorCodes.IDENT_NID_MISMATCH` | `"NIP-IDENT-NID-MISMATCH"` | alpha.4 |
252
+ | `NipErrorCodes.IDENT_EXPIRED` | `"NIP-IDENT-EXPIRED"` | alpha.4 |
253
+ | `NipErrorCodes.IDENT_REVOKED` | `"NIP-IDENT-REVOKED"` | alpha.4 |
254
+ | `NipErrorCodes.TRUST_CHAIN_BROKEN` | `"NIP-TRUST-CHAIN-BROKEN"` | alpha.4 |
255
+ | `NipErrorCodes.TRUST_SCOPE_VIOLATION` | `"NIP-TRUST-SCOPE-VIOLATION"` | alpha.4 |
256
+ | `NipErrorCodes.ACME_CHALLENGE_FAILED` | `"NIP-ACME-CHALLENGE-FAILED"` | alpha.4 |
257
+ | `NipErrorCodes.ACME_ORDER_EXPIRED` | `"NIP-ACME-ORDER-EXPIRED"` | alpha.4 |
258
+ | `NipErrorCodes.X509_CERT_INVALID` | `"NIP-X509-CERT-INVALID"` | alpha.4 |
259
+ | `NipErrorCodes.X509_CHAIN_UNTRUSTED` | `"NIP-X509-CHAIN-UNTRUSTED"` | alpha.4 |
260
+ | `NipErrorCodes.REPUTATION_LOG_UNREACHABLE` | `"NIP-REPUTATION-LOG-UNREACHABLE"` | alpha.4 |
261
+ | `NipErrorCodes.REPUTATION_GOSSIP_FORK` | `"NIP-REPUTATION-GOSSIP-FORK"` | **alpha.5** |
262
+ | `NipErrorCodes.REPUTATION_GOSSIP_SIG_INVALID` | `"NIP-REPUTATION-GOSSIP-SIG-INVALID"` | **alpha.5** |
263
+
264
+ `REPUTATION_GOSSIP_FORK`:跨节点 STH 一致性检查失败时返回。
265
+ `REPUTATION_GOSSIP_SIG_INVALID`:gossip 交换中对端 STH 签名验证失败时返回。
@@ -19,6 +19,7 @@ AES-256-GCM + PBKDF2-SHA256 key-file encryption.
19
19
  - [`RevokeFrame` (0x22)](#revokeframe-0x22)
20
20
  - [`NipIdentity`](#nipidentity)
21
21
  - [Canonical JSON & signing format](#canonical-json--signing-format)
22
+ - [`NipErrorCodes`](#niperrorecodes)
22
23
 
23
24
  ---
24
25
 
@@ -240,3 +241,32 @@ const signed = new IdentFrame(unsigned.nid, unsigned.pubKey, meta, signature)
240
241
  const ok = id.verify(signed.unsignedDict(), signed.signature);
241
242
  // → true
242
243
  ```
244
+
245
+ ---
246
+
247
+ ## `NipErrorCodes`
248
+
249
+ String constants for NIP wire error codes. Import from `@labacacia/nps-sdk/nip`.
250
+
251
+ ```typescript
252
+ import { NipErrorCodes } from "@labacacia/nps-sdk/nip";
253
+ ```
254
+
255
+ | Constant | Wire value | Since |
256
+ |----------|------------|-------|
257
+ | `NipErrorCodes.IDENT_SIG_INVALID` | `"NIP-IDENT-SIG-INVALID"` | alpha.4 |
258
+ | `NipErrorCodes.IDENT_NID_MISMATCH` | `"NIP-IDENT-NID-MISMATCH"` | alpha.4 |
259
+ | `NipErrorCodes.IDENT_EXPIRED` | `"NIP-IDENT-EXPIRED"` | alpha.4 |
260
+ | `NipErrorCodes.IDENT_REVOKED` | `"NIP-IDENT-REVOKED"` | alpha.4 |
261
+ | `NipErrorCodes.TRUST_CHAIN_BROKEN` | `"NIP-TRUST-CHAIN-BROKEN"` | alpha.4 |
262
+ | `NipErrorCodes.TRUST_SCOPE_VIOLATION` | `"NIP-TRUST-SCOPE-VIOLATION"` | alpha.4 |
263
+ | `NipErrorCodes.ACME_CHALLENGE_FAILED` | `"NIP-ACME-CHALLENGE-FAILED"` | alpha.4 |
264
+ | `NipErrorCodes.ACME_ORDER_EXPIRED` | `"NIP-ACME-ORDER-EXPIRED"` | alpha.4 |
265
+ | `NipErrorCodes.X509_CERT_INVALID` | `"NIP-X509-CERT-INVALID"` | alpha.4 |
266
+ | `NipErrorCodes.X509_CHAIN_UNTRUSTED` | `"NIP-X509-CHAIN-UNTRUSTED"` | alpha.4 |
267
+ | `NipErrorCodes.REPUTATION_LOG_UNREACHABLE` | `"NIP-REPUTATION-LOG-UNREACHABLE"` | alpha.4 |
268
+ | `NipErrorCodes.REPUTATION_GOSSIP_FORK` | `"NIP-REPUTATION-GOSSIP-FORK"` | **alpha.5** |
269
+ | `NipErrorCodes.REPUTATION_GOSSIP_SIG_INVALID` | `"NIP-REPUTATION-GOSSIP-SIG-INVALID"` | **alpha.5** |
270
+
271
+ `REPUTATION_GOSSIP_FORK` is returned when an STH consistency check fails across peers.
272
+ `REPUTATION_GOSSIP_SIG_INVALID` is returned when a peer STH signature fails verification during a gossip exchange.
File without changes
File without changes
@@ -18,6 +18,7 @@ NWP 是 AI 的 HTTP。本模块提供两个 NWP 帧
18
18
  - [`QueryFrame` (0x10)](#queryframe-0x10)
19
19
  - [`ActionFrame` (0x11)](#actionframe-0x11)
20
20
  - [`NwpClient`](#nwpclient)
21
+ - [`NwpErrorCodes`](#nwperrorcodes)
21
22
 
22
23
  ---
23
24
 
@@ -215,3 +216,73 @@ const resp = await nwp.invoke(new ActionFrame(
215
216
  ));
216
217
  // resp 是 AsyncActionResponse
217
218
  ```
219
+
220
+ ---
221
+
222
+ ## `NwpErrorCodes`
223
+
224
+ 30 个 NWP wire 错误码字符串常量(alpha.5 新增)。
225
+
226
+ ```typescript
227
+ import { NwpErrorCodes } from "@labacacia/nps-sdk/nwp";
228
+ ```
229
+
230
+ ### Auth 组(`NWP-AUTH-*`)
231
+
232
+ | 常量 | Wire 值 |
233
+ |------|---------|
234
+ | `NwpErrorCodes.AUTH_NID_SCOPE_VIOLATION` | `"NWP-AUTH-NID-SCOPE-VIOLATION"` |
235
+ | `NwpErrorCodes.AUTH_NID_NOT_TRUSTED` | `"NWP-AUTH-NID-NOT-TRUSTED"` |
236
+ | `NwpErrorCodes.AUTH_NID_EXPIRED` | `"NWP-AUTH-NID-EXPIRED"` |
237
+ | `NwpErrorCodes.AUTH_NID_REVOKED` | `"NWP-AUTH-NID-REVOKED"` |
238
+ | `NwpErrorCodes.AUTH_SIG_INVALID` | `"NWP-AUTH-SIG-INVALID"` |
239
+ | `NwpErrorCodes.AUTH_TOKEN_BUDGET_EXCEEDED` | `"NWP-AUTH-TOKEN-BUDGET-EXCEEDED"` |
240
+ | `NwpErrorCodes.AUTH_RATE_LIMIT` | `"NWP-AUTH-RATE-LIMIT"` |
241
+
242
+ ### Query 组(`NWP-QUERY-*`)
243
+
244
+ | 常量 | Wire 值 |
245
+ |------|---------|
246
+ | `NwpErrorCodes.QUERY_ANCHOR_NOT_FOUND` | `"NWP-QUERY-ANCHOR-NOT-FOUND"` |
247
+ | `NwpErrorCodes.QUERY_ANCHOR_EXPIRED` | `"NWP-QUERY-ANCHOR-EXPIRED"` |
248
+ | `NwpErrorCodes.QUERY_SCHEMA_MISMATCH` | `"NWP-QUERY-SCHEMA-MISMATCH"` |
249
+ | `NwpErrorCodes.QUERY_LIMIT_EXCEEDED` | `"NWP-QUERY-LIMIT-EXCEEDED"` |
250
+ | `NwpErrorCodes.QUERY_DEPTH_EXCEEDED` | `"NWP-QUERY-DEPTH-EXCEEDED"` |
251
+ | `NwpErrorCodes.QUERY_FILTER_INVALID` | `"NWP-QUERY-FILTER-INVALID"` |
252
+ | `NwpErrorCodes.QUERY_VECTOR_UNSUPPORTED` | `"NWP-QUERY-VECTOR-UNSUPPORTED"` |
253
+ | `NwpErrorCodes.QUERY_CURSOR_INVALID` | `"NWP-QUERY-CURSOR-INVALID"` |
254
+
255
+ ### Action、Task、Subscribe、Infrastructure 组
256
+
257
+ | 常量 | Wire 值 |
258
+ |------|---------|
259
+ | `NwpErrorCodes.ACTION_NOT_FOUND` | `"NWP-ACTION-NOT-FOUND"` |
260
+ | `NwpErrorCodes.ACTION_PARAM_INVALID` | `"NWP-ACTION-PARAM-INVALID"` |
261
+ | `NwpErrorCodes.ACTION_IDEMPOTENCY_CONFLICT` | `"NWP-ACTION-IDEMPOTENCY-CONFLICT"` |
262
+ | `NwpErrorCodes.TASK_NOT_FOUND` | `"NWP-TASK-NOT-FOUND"` |
263
+ | `NwpErrorCodes.TASK_ALREADY_COMPLETE` | `"NWP-TASK-ALREADY-COMPLETE"` |
264
+ | `NwpErrorCodes.TASK_TIMEOUT` | `"NWP-TASK-TIMEOUT"` |
265
+ | `NwpErrorCodes.TASK_CANCELLED` | `"NWP-TASK-CANCELLED"` |
266
+ | `NwpErrorCodes.SUBSCRIBE_TOPIC_NOT_FOUND` | `"NWP-SUBSCRIBE-TOPIC-NOT-FOUND"` |
267
+ | `NwpErrorCodes.SUBSCRIBE_ALREADY_ACTIVE` | `"NWP-SUBSCRIBE-ALREADY-ACTIVE"` |
268
+ | `NwpErrorCodes.SUBSCRIBE_QUOTA_EXCEEDED` | `"NWP-SUBSCRIBE-QUOTA-EXCEEDED"` |
269
+ | `NwpErrorCodes.SUBSCRIBE_FILTER_INVALID` | `"NWP-SUBSCRIBE-FILTER-INVALID"` |
270
+ | `NwpErrorCodes.SUBSCRIBE_NOT_FOUND` | `"NWP-SUBSCRIBE-NOT-FOUND"` |
271
+ | `NwpErrorCodes.INFRA_NODE_OVERLOADED` | `"NWP-INFRA-NODE-OVERLOADED"` |
272
+ | `NwpErrorCodes.INFRA_UPSTREAM_TIMEOUT` | `"NWP-INFRA-UPSTREAM-TIMEOUT"` |
273
+ | `NwpErrorCodes.INFRA_UPSTREAM_ERROR` | `"NWP-INFRA-UPSTREAM-ERROR"` |
274
+ | `NwpErrorCodes.INFRA_STORAGE_ERROR` | `"NWP-INFRA-STORAGE-ERROR"` |
275
+ | `NwpErrorCodes.INFRA_CONFIG_ERROR` | `"NWP-INFRA-CONFIG-ERROR"` |
276
+
277
+ ### Manifest、Topology、Reserved 组
278
+
279
+ | 常量 | Wire 值 |
280
+ |------|---------|
281
+ | `NwpErrorCodes.MANIFEST_NOT_FOUND` | `"NWP-MANIFEST-NOT-FOUND"` |
282
+ | `NwpErrorCodes.MANIFEST_PARSE_ERROR` | `"NWP-MANIFEST-PARSE-ERROR"` |
283
+ | `NwpErrorCodes.MANIFEST_VERSION_MISMATCH` | `"NWP-MANIFEST-VERSION-MISMATCH"` |
284
+ | `NwpErrorCodes.TOPOLOGY_UNAUTHORIZED` | `"NWP-TOPOLOGY-UNAUTHORIZED"` |
285
+ | `NwpErrorCodes.TOPOLOGY_NOT_AVAILABLE` | `"NWP-TOPOLOGY-NOT-AVAILABLE"` |
286
+ | `NwpErrorCodes.TOPOLOGY_SNAPSHOT_TOO_LARGE` | `"NWP-TOPOLOGY-SNAPSHOT-TOO-LARGE"` |
287
+ | `NwpErrorCodes.TOPOLOGY_STREAM_INTERRUPTED` | `"NWP-TOPOLOGY-STREAM-INTERRUPTED"` |
288
+ | `NwpErrorCodes.RESERVED_TYPE_UNSUPPORTED` | `"NWP-RESERVED-TYPE-UNSUPPORTED"` |
@@ -19,6 +19,7 @@ action responses.
19
19
  - [`QueryFrame` (0x10)](#queryframe-0x10)
20
20
  - [`ActionFrame` (0x11)](#actionframe-0x11)
21
21
  - [`NwpClient`](#nwpclient)
22
+ - [`NwpErrorCodes`](#nwperrorcodes)
22
23
 
23
24
  ---
24
25
 
@@ -222,3 +223,73 @@ const resp = await nwp.invoke(new ActionFrame(
222
223
  ));
223
224
  // resp is AsyncActionResponse
224
225
  ```
226
+
227
+ ---
228
+
229
+ ## `NwpErrorCodes`
230
+
231
+ String constants for the 30 NWP wire error codes (added in alpha.5).
232
+
233
+ ```typescript
234
+ import { NwpErrorCodes } from "@labacacia/nps-sdk/nwp";
235
+ ```
236
+
237
+ ### Auth group (`NWP-AUTH-*`)
238
+
239
+ | Constant | Wire value |
240
+ |----------|------------|
241
+ | `NwpErrorCodes.AUTH_NID_SCOPE_VIOLATION` | `"NWP-AUTH-NID-SCOPE-VIOLATION"` |
242
+ | `NwpErrorCodes.AUTH_NID_NOT_TRUSTED` | `"NWP-AUTH-NID-NOT-TRUSTED"` |
243
+ | `NwpErrorCodes.AUTH_NID_EXPIRED` | `"NWP-AUTH-NID-EXPIRED"` |
244
+ | `NwpErrorCodes.AUTH_NID_REVOKED` | `"NWP-AUTH-NID-REVOKED"` |
245
+ | `NwpErrorCodes.AUTH_SIG_INVALID` | `"NWP-AUTH-SIG-INVALID"` |
246
+ | `NwpErrorCodes.AUTH_TOKEN_BUDGET_EXCEEDED` | `"NWP-AUTH-TOKEN-BUDGET-EXCEEDED"` |
247
+ | `NwpErrorCodes.AUTH_RATE_LIMIT` | `"NWP-AUTH-RATE-LIMIT"` |
248
+
249
+ ### Query group (`NWP-QUERY-*`)
250
+
251
+ | Constant | Wire value |
252
+ |----------|------------|
253
+ | `NwpErrorCodes.QUERY_ANCHOR_NOT_FOUND` | `"NWP-QUERY-ANCHOR-NOT-FOUND"` |
254
+ | `NwpErrorCodes.QUERY_ANCHOR_EXPIRED` | `"NWP-QUERY-ANCHOR-EXPIRED"` |
255
+ | `NwpErrorCodes.QUERY_SCHEMA_MISMATCH` | `"NWP-QUERY-SCHEMA-MISMATCH"` |
256
+ | `NwpErrorCodes.QUERY_LIMIT_EXCEEDED` | `"NWP-QUERY-LIMIT-EXCEEDED"` |
257
+ | `NwpErrorCodes.QUERY_DEPTH_EXCEEDED` | `"NWP-QUERY-DEPTH-EXCEEDED"` |
258
+ | `NwpErrorCodes.QUERY_FILTER_INVALID` | `"NWP-QUERY-FILTER-INVALID"` |
259
+ | `NwpErrorCodes.QUERY_VECTOR_UNSUPPORTED` | `"NWP-QUERY-VECTOR-UNSUPPORTED"` |
260
+ | `NwpErrorCodes.QUERY_CURSOR_INVALID` | `"NWP-QUERY-CURSOR-INVALID"` |
261
+
262
+ ### Action, Task, Subscribe, Infrastructure groups
263
+
264
+ | Constant | Wire value |
265
+ |----------|------------|
266
+ | `NwpErrorCodes.ACTION_NOT_FOUND` | `"NWP-ACTION-NOT-FOUND"` |
267
+ | `NwpErrorCodes.ACTION_PARAM_INVALID` | `"NWP-ACTION-PARAM-INVALID"` |
268
+ | `NwpErrorCodes.ACTION_IDEMPOTENCY_CONFLICT` | `"NWP-ACTION-IDEMPOTENCY-CONFLICT"` |
269
+ | `NwpErrorCodes.TASK_NOT_FOUND` | `"NWP-TASK-NOT-FOUND"` |
270
+ | `NwpErrorCodes.TASK_ALREADY_COMPLETE` | `"NWP-TASK-ALREADY-COMPLETE"` |
271
+ | `NwpErrorCodes.TASK_TIMEOUT` | `"NWP-TASK-TIMEOUT"` |
272
+ | `NwpErrorCodes.TASK_CANCELLED` | `"NWP-TASK-CANCELLED"` |
273
+ | `NwpErrorCodes.SUBSCRIBE_TOPIC_NOT_FOUND` | `"NWP-SUBSCRIBE-TOPIC-NOT-FOUND"` |
274
+ | `NwpErrorCodes.SUBSCRIBE_ALREADY_ACTIVE` | `"NWP-SUBSCRIBE-ALREADY-ACTIVE"` |
275
+ | `NwpErrorCodes.SUBSCRIBE_QUOTA_EXCEEDED` | `"NWP-SUBSCRIBE-QUOTA-EXCEEDED"` |
276
+ | `NwpErrorCodes.SUBSCRIBE_FILTER_INVALID` | `"NWP-SUBSCRIBE-FILTER-INVALID"` |
277
+ | `NwpErrorCodes.SUBSCRIBE_NOT_FOUND` | `"NWP-SUBSCRIBE-NOT-FOUND"` |
278
+ | `NwpErrorCodes.INFRA_NODE_OVERLOADED` | `"NWP-INFRA-NODE-OVERLOADED"` |
279
+ | `NwpErrorCodes.INFRA_UPSTREAM_TIMEOUT` | `"NWP-INFRA-UPSTREAM-TIMEOUT"` |
280
+ | `NwpErrorCodes.INFRA_UPSTREAM_ERROR` | `"NWP-INFRA-UPSTREAM-ERROR"` |
281
+ | `NwpErrorCodes.INFRA_STORAGE_ERROR` | `"NWP-INFRA-STORAGE-ERROR"` |
282
+ | `NwpErrorCodes.INFRA_CONFIG_ERROR` | `"NWP-INFRA-CONFIG-ERROR"` |
283
+
284
+ ### Manifest, Topology, Reserved groups
285
+
286
+ | Constant | Wire value |
287
+ |----------|------------|
288
+ | `NwpErrorCodes.MANIFEST_NOT_FOUND` | `"NWP-MANIFEST-NOT-FOUND"` |
289
+ | `NwpErrorCodes.MANIFEST_PARSE_ERROR` | `"NWP-MANIFEST-PARSE-ERROR"` |
290
+ | `NwpErrorCodes.MANIFEST_VERSION_MISMATCH` | `"NWP-MANIFEST-VERSION-MISMATCH"` |
291
+ | `NwpErrorCodes.TOPOLOGY_UNAUTHORIZED` | `"NWP-TOPOLOGY-UNAUTHORIZED"` |
292
+ | `NwpErrorCodes.TOPOLOGY_NOT_AVAILABLE` | `"NWP-TOPOLOGY-NOT-AVAILABLE"` |
293
+ | `NwpErrorCodes.TOPOLOGY_SNAPSHOT_TOO_LARGE` | `"NWP-TOPOLOGY-SNAPSHOT-TOO-LARGE"` |
294
+ | `NwpErrorCodes.TOPOLOGY_STREAM_INTERRUPTED` | `"NWP-TOPOLOGY-STREAM-INTERRUPTED"` |
295
+ | `NwpErrorCodes.RESERVED_TYPE_UNSUPPORTED` | `"NWP-RESERVED-TYPE-UNSUPPORTED"` |
File without changes
package/doc/overview.md CHANGED
File without changes
File without changes
@@ -25,7 +25,7 @@ docker compose up -d
25
25
 
26
26
  ## API
27
27
 
28
- Same endpoints as all other NIP CA Server implementations — see [NPS-3 §8](../../spec/NPS-3-NIP.md).
28
+ Same endpoints as all other NIP CA Server implementations — see [NPS-3 §8](https://github.com/labacacia/NPS-Release/blob/main/spec/NPS-3-NIP.md).
29
29
 
30
30
  ## Local Development
31
31
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labacacia/nps-sdk",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "TypeScript SDK for the Neural Protocol Suite (NPS) — NCP, NWP, NIP, NDP, NOP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
File without changes
package/src/core/cache.ts CHANGED
File without changes
File without changes
package/src/core/codec.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/core/index.ts CHANGED
File without changes
File without changes
@@ -27,6 +27,7 @@ export const NpsStatusCodes = {
27
27
  NPS_SERVER_UNAVAILABLE: "NPS-SERVER-UNAVAILABLE",
28
28
  NPS_SERVER_TIMEOUT: "NPS-SERVER-TIMEOUT",
29
29
  NPS_SERVER_ENCODING_UNSUPPORTED: "NPS-SERVER-ENCODING-UNSUPPORTED",
30
+ NPS_SERVER_UNSUPPORTED: "NPS-SERVER-UNSUPPORTED",
30
31
 
31
32
  // Stream
32
33
  NPS_STREAM_SEQ_GAP: "NPS-STREAM-SEQ-GAP",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/ncp/frames.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes