@labacacia/nps-sdk 1.0.0-alpha.1 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.cn.md +181 -0
- package/CHANGELOG.md +234 -0
- package/LICENSE +0 -0
- package/NOTICE +0 -0
- package/README.cn.md +163 -0
- package/README.md +16 -6
- package/dist/core/anchor-cache.d.ts +0 -0
- package/dist/core/anchor-cache.d.ts.map +0 -0
- package/dist/core/anchor-cache.js +0 -0
- package/dist/core/anchor-cache.js.map +0 -0
- package/dist/core/cache.d.ts +0 -0
- package/dist/core/cache.d.ts.map +0 -0
- package/dist/core/cache.js +0 -0
- package/dist/core/cache.js.map +0 -0
- package/dist/core/canonical-json.d.ts +0 -0
- package/dist/core/canonical-json.d.ts.map +0 -0
- package/dist/core/canonical-json.js +0 -0
- package/dist/core/canonical-json.js.map +0 -0
- package/dist/core/codec.d.ts +0 -0
- package/dist/core/codec.d.ts.map +0 -0
- package/dist/core/codec.js +0 -0
- package/dist/core/codec.js.map +0 -0
- package/dist/core/codecs/index.d.ts +0 -0
- package/dist/core/codecs/index.d.ts.map +0 -0
- package/dist/core/codecs/index.js +0 -0
- package/dist/core/codecs/index.js.map +0 -0
- package/dist/core/codecs/ncp-codec.d.ts +0 -0
- package/dist/core/codecs/ncp-codec.d.ts.map +0 -0
- package/dist/core/codecs/ncp-codec.js +0 -0
- package/dist/core/codecs/ncp-codec.js.map +0 -0
- package/dist/core/codecs/tier1-json-codec.d.ts +0 -0
- package/dist/core/codecs/tier1-json-codec.d.ts.map +0 -0
- package/dist/core/codecs/tier1-json-codec.js +0 -0
- package/dist/core/codecs/tier1-json-codec.js.map +0 -0
- package/dist/core/codecs/tier2-msgpack-codec.d.ts +0 -0
- package/dist/core/codecs/tier2-msgpack-codec.d.ts.map +0 -0
- package/dist/core/codecs/tier2-msgpack-codec.js +0 -0
- package/dist/core/codecs/tier2-msgpack-codec.js.map +0 -0
- package/dist/core/crypto-provider.d.ts +0 -0
- package/dist/core/crypto-provider.d.ts.map +0 -0
- package/dist/core/crypto-provider.js +0 -0
- package/dist/core/crypto-provider.js.map +0 -0
- package/dist/core/exceptions.d.ts +0 -0
- package/dist/core/exceptions.d.ts.map +0 -0
- package/dist/core/exceptions.js +0 -0
- package/dist/core/exceptions.js.map +0 -0
- package/dist/core/frame-header.d.ts +1 -0
- package/dist/core/frame-header.d.ts.map +1 -1
- package/dist/core/frame-header.js +1 -0
- package/dist/core/frame-header.js.map +1 -1
- package/dist/core/frame-registry.d.ts +0 -0
- package/dist/core/frame-registry.d.ts.map +1 -1
- package/dist/core/frame-registry.js +1 -0
- package/dist/core/frame-registry.js.map +1 -1
- package/dist/core/frames.d.ts +3 -0
- package/dist/core/frames.d.ts.map +1 -1
- package/dist/core/frames.js +3 -0
- package/dist/core/frames.js.map +1 -1
- package/dist/core/index.d.ts +6 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +17 -5
- package/dist/core/index.js.map +1 -1
- package/dist/core/registry.d.ts +0 -0
- package/dist/core/registry.d.ts.map +0 -0
- package/dist/core/registry.js +0 -0
- package/dist/core/registry.js.map +0 -0
- package/dist/core/status-codes.d.ts +20 -0
- package/dist/core/status-codes.d.ts.map +1 -1
- package/dist/core/status-codes.js +51 -0
- package/dist/core/status-codes.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ncp/frames/anchor-frame.d.ts +0 -0
- package/dist/ncp/frames/anchor-frame.d.ts.map +0 -0
- package/dist/ncp/frames/anchor-frame.js +0 -0
- package/dist/ncp/frames/anchor-frame.js.map +0 -0
- package/dist/ncp/frames/caps-frame.d.ts +0 -0
- package/dist/ncp/frames/caps-frame.d.ts.map +0 -0
- package/dist/ncp/frames/caps-frame.js +0 -0
- package/dist/ncp/frames/caps-frame.js.map +0 -0
- package/dist/ncp/frames/diff-frame.d.ts +0 -0
- package/dist/ncp/frames/diff-frame.d.ts.map +0 -0
- package/dist/ncp/frames/diff-frame.js +0 -0
- package/dist/ncp/frames/diff-frame.js.map +0 -0
- package/dist/ncp/frames/error-frame.d.ts +0 -0
- package/dist/ncp/frames/error-frame.d.ts.map +0 -0
- package/dist/ncp/frames/error-frame.js +0 -0
- package/dist/ncp/frames/error-frame.js.map +0 -0
- package/dist/ncp/frames/hello-frame.d.ts +0 -0
- package/dist/ncp/frames/hello-frame.d.ts.map +0 -0
- package/dist/ncp/frames/hello-frame.js +0 -0
- package/dist/ncp/frames/hello-frame.js.map +0 -0
- package/dist/ncp/frames/stream-frame.d.ts +0 -0
- package/dist/ncp/frames/stream-frame.d.ts.map +0 -0
- package/dist/ncp/frames/stream-frame.js +0 -0
- package/dist/ncp/frames/stream-frame.js.map +0 -0
- package/dist/ncp/frames.d.ts +25 -0
- package/dist/ncp/frames.d.ts.map +1 -1
- package/dist/ncp/frames.js +61 -0
- package/dist/ncp/frames.js.map +1 -1
- package/dist/ncp/handshake.d.ts +0 -0
- package/dist/ncp/handshake.d.ts.map +0 -0
- package/dist/ncp/handshake.js +0 -0
- package/dist/ncp/handshake.js.map +0 -0
- package/dist/ncp/index.d.ts +1 -0
- package/dist/ncp/index.d.ts.map +1 -1
- package/dist/ncp/index.js +1 -0
- package/dist/ncp/index.js.map +1 -1
- package/dist/ncp/ncp-error-codes.d.ts +5 -0
- package/dist/ncp/ncp-error-codes.d.ts.map +1 -1
- package/dist/ncp/ncp-error-codes.js +27 -0
- package/dist/ncp/ncp-error-codes.js.map +1 -1
- package/dist/ncp/ncp-patch-format.d.ts +0 -0
- package/dist/ncp/ncp-patch-format.d.ts.map +0 -0
- package/dist/ncp/ncp-patch-format.js +0 -0
- package/dist/ncp/ncp-patch-format.js.map +0 -0
- package/dist/ncp/preamble.d.ts +47 -0
- package/dist/ncp/preamble.d.ts.map +1 -0
- package/dist/ncp/preamble.js +74 -0
- package/dist/ncp/preamble.js.map +1 -0
- package/dist/ncp/registry.d.ts +0 -0
- package/dist/ncp/registry.d.ts.map +1 -1
- package/dist/ncp/registry.js +2 -1
- package/dist/ncp/registry.js.map +1 -1
- package/dist/ncp/stream-manager.d.ts +0 -0
- package/dist/ncp/stream-manager.d.ts.map +0 -0
- package/dist/ncp/stream-manager.js +0 -0
- package/dist/ncp/stream-manager.js.map +0 -0
- package/dist/ndp/dns-txt.d.ts +35 -0
- package/dist/ndp/dns-txt.d.ts.map +1 -0
- package/dist/ndp/dns-txt.js +67 -0
- package/dist/ndp/dns-txt.js.map +1 -0
- package/dist/ndp/frames.d.ts +34 -9
- package/dist/ndp/frames.d.ts.map +1 -1
- package/dist/ndp/frames.js +54 -15
- package/dist/ndp/frames.js.map +1 -1
- package/dist/ndp/index.d.ts +3 -0
- package/dist/ndp/index.d.ts.map +1 -1
- package/dist/ndp/index.js +3 -0
- package/dist/ndp/index.js.map +1 -1
- package/dist/ndp/ndp-error-codes.d.ts +25 -0
- package/dist/ndp/ndp-error-codes.d.ts.map +1 -0
- package/dist/ndp/ndp-error-codes.js +48 -0
- package/dist/ndp/ndp-error-codes.js.map +1 -0
- package/dist/ndp/ndp-registry.d.ts +2 -0
- package/dist/ndp/ndp-registry.d.ts.map +1 -1
- package/dist/ndp/ndp-registry.js +25 -0
- package/dist/ndp/ndp-registry.js.map +1 -1
- package/dist/ndp/registry.d.ts +0 -0
- package/dist/ndp/registry.d.ts.map +0 -0
- package/dist/ndp/registry.js +0 -0
- package/dist/ndp/registry.js.map +0 -0
- package/dist/ndp/security.d.ts +8 -0
- package/dist/ndp/security.d.ts.map +1 -0
- package/dist/ndp/security.js +9 -0
- package/dist/ndp/security.js.map +1 -0
- package/dist/ndp/validator.d.ts +0 -0
- package/dist/ndp/validator.d.ts.map +0 -0
- package/dist/ndp/validator.js +0 -0
- package/dist/ndp/validator.js.map +0 -0
- package/dist/nip/acme/client.d.ts +31 -0
- package/dist/nip/acme/client.d.ts.map +1 -0
- package/dist/nip/acme/client.js +136 -0
- package/dist/nip/acme/client.js.map +1 -0
- package/dist/nip/acme/index.d.ts +6 -0
- package/dist/nip/acme/index.d.ts.map +1 -0
- package/dist/nip/acme/index.js +8 -0
- package/dist/nip/acme/index.js.map +1 -0
- package/dist/nip/acme/jws.d.ts +31 -0
- package/dist/nip/acme/jws.d.ts.map +1 -0
- package/dist/nip/acme/jws.js +76 -0
- package/dist/nip/acme/jws.js.map +1 -0
- package/dist/nip/acme/messages.d.ts +71 -0
- package/dist/nip/acme/messages.d.ts.map +1 -0
- package/dist/nip/acme/messages.js +4 -0
- package/dist/nip/acme/messages.js.map +1 -0
- package/dist/nip/acme/server.d.ts +41 -0
- package/dist/nip/acme/server.d.ts.map +1 -0
- package/dist/nip/acme/server.js +458 -0
- package/dist/nip/acme/server.js.map +1 -0
- package/dist/nip/acme/wire.d.ts +19 -0
- package/dist/nip/acme/wire.d.ts.map +1 -0
- package/dist/nip/acme/wire.js +21 -0
- package/dist/nip/acme/wire.js.map +1 -0
- package/dist/nip/assurance-level.d.ts +19 -0
- package/dist/nip/assurance-level.d.ts.map +1 -0
- package/dist/nip/assurance-level.js +38 -0
- package/dist/nip/assurance-level.js.map +1 -0
- package/dist/nip/cert-format.d.ts +5 -0
- package/dist/nip/cert-format.d.ts.map +1 -0
- package/dist/nip/cert-format.js +6 -0
- package/dist/nip/cert-format.js.map +1 -0
- package/dist/nip/error-codes.d.ts +44 -0
- package/dist/nip/error-codes.d.ts.map +1 -0
- package/dist/nip/error-codes.js +97 -0
- package/dist/nip/error-codes.js.map +1 -0
- package/dist/nip/frames.d.ts +19 -1
- package/dist/nip/frames.d.ts.map +1 -1
- package/dist/nip/frames.js +39 -4
- package/dist/nip/frames.js.map +1 -1
- package/dist/nip/identity.d.ts +0 -0
- package/dist/nip/identity.d.ts.map +0 -0
- package/dist/nip/identity.js +0 -0
- package/dist/nip/identity.js.map +0 -0
- package/dist/nip/index.d.ts +7 -0
- package/dist/nip/index.d.ts.map +1 -1
- package/dist/nip/index.js +9 -0
- package/dist/nip/index.js.map +1 -1
- package/dist/nip/registry.d.ts +0 -0
- package/dist/nip/registry.d.ts.map +0 -0
- package/dist/nip/registry.js +0 -0
- package/dist/nip/registry.js.map +0 -0
- package/dist/nip/reputation-client.d.ts +116 -0
- package/dist/nip/reputation-client.d.ts.map +1 -0
- package/dist/nip/reputation-client.js +261 -0
- package/dist/nip/reputation-client.js.map +1 -0
- package/dist/nip/verifier.d.ts +23 -0
- package/dist/nip/verifier.d.ts.map +1 -0
- package/dist/nip/verifier.js +90 -0
- package/dist/nip/verifier.js.map +1 -0
- package/dist/nip/x509/builder.d.ts +35 -0
- package/dist/nip/x509/builder.d.ts.map +1 -0
- package/dist/nip/x509/builder.js +59 -0
- package/dist/nip/x509/builder.js.map +1 -0
- package/dist/nip/x509/index.d.ts +4 -0
- package/dist/nip/x509/index.d.ts.map +1 -0
- package/dist/nip/x509/index.js +6 -0
- package/dist/nip/x509/index.js.map +1 -0
- package/dist/nip/x509/oids.d.ts +16 -0
- package/dist/nip/x509/oids.d.ts.map +1 -0
- package/dist/nip/x509/oids.js +22 -0
- package/dist/nip/x509/oids.js.map +1 -0
- package/dist/nip/x509/verifier.d.ts +26 -0
- package/dist/nip/x509/verifier.d.ts.map +1 -0
- package/dist/nip/x509/verifier.js +171 -0
- package/dist/nip/x509/verifier.js.map +1 -0
- package/dist/nop/client.d.ts +0 -0
- package/dist/nop/client.d.ts.map +0 -0
- package/dist/nop/client.js +0 -0
- package/dist/nop/client.js.map +1 -1
- package/dist/nop/dag-validator.d.ts +15 -0
- package/dist/nop/dag-validator.d.ts.map +1 -0
- package/dist/nop/dag-validator.js +91 -0
- package/dist/nop/dag-validator.js.map +1 -0
- package/dist/nop/frames.d.ts +8 -3
- package/dist/nop/frames.d.ts.map +1 -1
- package/dist/nop/frames.js +21 -6
- package/dist/nop/frames.js.map +1 -1
- package/dist/nop/index.d.ts +3 -0
- package/dist/nop/index.d.ts.map +1 -1
- package/dist/nop/index.js +3 -0
- package/dist/nop/index.js.map +1 -1
- package/dist/nop/models.d.ts +13 -2
- package/dist/nop/models.d.ts.map +1 -1
- package/dist/nop/models.js +9 -0
- package/dist/nop/models.js.map +1 -1
- package/dist/nop/nop-error-codes.d.ts +31 -0
- package/dist/nop/nop-error-codes.d.ts.map +1 -0
- package/dist/nop/nop-error-codes.js +61 -0
- package/dist/nop/nop-error-codes.js.map +1 -0
- package/dist/nop/nop-types.d.ts +0 -0
- package/dist/nop/nop-types.d.ts.map +0 -0
- package/dist/nop/nop-types.js +0 -0
- package/dist/nop/nop-types.js.map +0 -0
- package/dist/nop/orchestrator.d.ts +66 -0
- package/dist/nop/orchestrator.d.ts.map +1 -0
- package/dist/nop/orchestrator.js +229 -0
- package/dist/nop/orchestrator.js.map +1 -0
- package/dist/nop/registry.d.ts +0 -0
- package/dist/nop/registry.d.ts.map +0 -0
- package/dist/nop/registry.js +0 -0
- package/dist/nop/registry.js.map +0 -0
- package/dist/nwp/anchor-client.d.ts +109 -0
- package/dist/nwp/anchor-client.d.ts.map +1 -0
- package/dist/nwp/anchor-client.js +279 -0
- package/dist/nwp/anchor-client.js.map +1 -0
- package/dist/nwp/anchor-server.d.ts +127 -0
- package/dist/nwp/anchor-server.d.ts.map +1 -0
- package/dist/nwp/anchor-server.js +649 -0
- package/dist/nwp/anchor-server.js.map +1 -0
- package/dist/nwp/bridge.d.ts +24 -0
- package/dist/nwp/bridge.d.ts.map +1 -0
- package/dist/nwp/bridge.js +26 -0
- package/dist/nwp/bridge.js.map +1 -0
- package/dist/nwp/cgn.d.ts +19 -0
- package/dist/nwp/cgn.d.ts.map +1 -0
- package/dist/nwp/cgn.js +29 -0
- package/dist/nwp/cgn.js.map +1 -0
- package/dist/nwp/client.d.ts +10 -3
- package/dist/nwp/client.d.ts.map +1 -1
- package/dist/nwp/client.js +58 -7
- package/dist/nwp/client.js.map +1 -1
- package/dist/nwp/frames.d.ts +56 -2
- package/dist/nwp/frames.d.ts.map +1 -1
- package/dist/nwp/frames.js +86 -4
- package/dist/nwp/frames.js.map +1 -1
- package/dist/nwp/http-headers.d.ts +24 -0
- package/dist/nwp/http-headers.d.ts.map +1 -0
- package/dist/nwp/http-headers.js +29 -0
- package/dist/nwp/http-headers.js.map +1 -0
- package/dist/nwp/index.d.ts +9 -0
- package/dist/nwp/index.d.ts.map +1 -1
- package/dist/nwp/index.js +9 -0
- package/dist/nwp/index.js.map +1 -1
- package/dist/nwp/manifest.d.ts +75 -0
- package/dist/nwp/manifest.d.ts.map +1 -0
- package/dist/nwp/manifest.js +5 -0
- package/dist/nwp/manifest.js.map +1 -0
- package/dist/nwp/memory-node-server.d.ts +70 -0
- package/dist/nwp/memory-node-server.d.ts.map +1 -0
- package/dist/nwp/memory-node-server.js +315 -0
- package/dist/nwp/memory-node-server.js.map +1 -0
- package/dist/nwp/nwp-error-codes.d.ts +48 -0
- package/dist/nwp/nwp-error-codes.d.ts.map +1 -0
- package/dist/nwp/nwp-error-codes.js +108 -0
- package/dist/nwp/nwp-error-codes.js.map +1 -0
- package/dist/nwp/registry.d.ts +0 -0
- package/dist/nwp/registry.d.ts.map +0 -0
- package/dist/nwp/registry.js +0 -0
- package/dist/nwp/registry.js.map +0 -0
- package/dist/nwp/reputation.d.ts +37 -0
- package/dist/nwp/reputation.d.ts.map +1 -0
- package/dist/nwp/reputation.js +118 -0
- package/dist/nwp/reputation.js.map +1 -0
- package/dist/setup.d.ts +0 -0
- package/dist/setup.d.ts.map +0 -0
- package/dist/setup.js +0 -0
- package/dist/setup.js.map +0 -0
- package/doc/nps-sdk.core.cn.md +321 -0
- package/doc/nps-sdk.core.md +326 -0
- package/doc/nps-sdk.ncp.cn.md +270 -0
- package/doc/nps-sdk.ncp.md +276 -0
- package/doc/nps-sdk.ndp.cn.md +267 -0
- package/doc/nps-sdk.ndp.md +273 -0
- package/doc/nps-sdk.nip.cn.md +265 -0
- package/doc/nps-sdk.nip.md +272 -0
- package/doc/nps-sdk.nop.cn.md +329 -0
- package/doc/nps-sdk.nop.md +332 -0
- package/doc/nps-sdk.nwp.cn.md +288 -0
- package/doc/nps-sdk.nwp.md +295 -0
- package/doc/overview.cn.md +149 -0
- package/doc/overview.md +153 -0
- package/package.json +33 -4
- package/CONTRIBUTING.md +0 -33
- package/dist/codec-CmHeovTV.d.cts +0 -120
- package/dist/codec-CmHeovTV.d.ts +0 -120
- package/dist/core/index.cjs +0 -371
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -41
- package/dist/frames-B3qLdl_g.d.cts +0 -77
- package/dist/frames-Ff7-ZPUl.d.ts +0 -77
- package/dist/index.cjs +0 -1556
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -21
- package/dist/ncp/index.cjs +0 -188
- package/dist/ncp/index.cjs.map +0 -1
- package/dist/ncp/index.d.cts +0 -6
- package/dist/ndp/index.cjs +0 -252
- package/dist/ndp/index.cjs.map +0 -1
- package/dist/ndp/index.d.cts +0 -86
- package/dist/nip/index.cjs +0 -214
- package/dist/nip/index.cjs.map +0 -1
- package/dist/nip/index.d.cts +0 -65
- package/dist/nop/index.cjs +0 -762
- package/dist/nop/index.cjs.map +0 -1
- package/dist/nop/index.d.cts +0 -155
- package/dist/nwp/index.cjs +0 -658
- package/dist/nwp/index.cjs.map +0 -1
- package/dist/nwp/index.d.cts +0 -65
- package/nip-ca-server/Dockerfile +0 -27
- package/nip-ca-server/README.md +0 -45
- package/nip-ca-server/db/001_init.sql +0 -25
- package/nip-ca-server/docker-compose.yml +0 -29
- package/nip-ca-server/package.json +0 -23
- package/nip-ca-server/src/ca.ts +0 -155
- package/nip-ca-server/src/db.ts +0 -104
- package/nip-ca-server/src/index.ts +0 -157
- package/nip-ca-server/tsconfig.json +0 -13
- package/src/core/anchor-cache.ts +0 -129
- package/src/core/cache.ts +0 -93
- package/src/core/canonical-json.ts +0 -50
- package/src/core/codec.ts +0 -158
- package/src/core/codecs/index.ts +0 -5
- package/src/core/codecs/ncp-codec.ts +0 -170
- package/src/core/codecs/tier1-json-codec.ts +0 -33
- package/src/core/codecs/tier2-msgpack-codec.ts +0 -30
- package/src/core/crypto-provider.ts +0 -47
- package/src/core/exceptions.ts +0 -57
- package/src/core/frame-header.ts +0 -282
- package/src/core/frame-registry.ts +0 -91
- package/src/core/frames.ts +0 -183
- package/src/core/index.ts +0 -10
- package/src/core/registry.ts +0 -28
- package/src/core/status-codes.ts +0 -46
- package/src/index.ts +0 -10
- package/src/ncp/frames/anchor-frame.ts +0 -87
- package/src/ncp/frames/caps-frame.ts +0 -59
- package/src/ncp/frames/diff-frame.ts +0 -69
- package/src/ncp/frames/error-frame.ts +0 -26
- package/src/ncp/frames/hello-frame.ts +0 -50
- package/src/ncp/frames/stream-frame.ts +0 -35
- package/src/ncp/frames.ts +0 -199
- package/src/ncp/handshake.ts +0 -95
- package/src/ncp/index.ts +0 -12
- package/src/ncp/ncp-error-codes.ts +0 -34
- package/src/ncp/ncp-patch-format.ts +0 -16
- package/src/ncp/registry.ts +0 -14
- package/src/ncp/stream-manager.ts +0 -212
- package/src/ndp/frames.ts +0 -124
- package/src/ndp/index.ts +0 -7
- package/src/ndp/ndp-registry.ts +0 -82
- package/src/ndp/registry.ts +0 -12
- package/src/ndp/validator.ts +0 -64
- package/src/nip/frames.ts +0 -106
- package/src/nip/identity.ts +0 -113
- package/src/nip/index.ts +0 -6
- package/src/nip/registry.ts +0 -12
- package/src/nop/client.ts +0 -103
- package/src/nop/frames.ts +0 -181
- package/src/nop/index.ts +0 -7
- package/src/nop/models.ts +0 -79
- package/src/nop/nop-types.ts +0 -208
- package/src/nop/registry.ts +0 -13
- package/src/nwp/client.ts +0 -114
- package/src/nwp/frames.ts +0 -116
- package/src/nwp/index.ts +0 -6
- package/src/nwp/registry.ts +0 -11
- package/src/setup.ts +0 -32
- package/tests/core/anchor-cache.test.ts +0 -242
- package/tests/core/codec.test.ts +0 -205
- package/tests/core/frame-registry.test.ts +0 -46
- package/tests/core.test.ts +0 -327
- package/tests/ncp/diff-binary-bitset.test.ts +0 -107
- package/tests/ncp/e2e-enc-reject.test.ts +0 -93
- package/tests/ncp/err-error-frame.test.ts +0 -152
- package/tests/ncp/frames.test.ts +0 -359
- package/tests/ncp/framing.test.ts +0 -233
- package/tests/ncp/hello-frame.test.ts +0 -122
- package/tests/ncp/inline-anchor.test.ts +0 -88
- package/tests/ncp/security.test.ts +0 -184
- package/tests/ncp/stream-window.test.ts +0 -167
- package/tests/ncp/stream.test.ts +0 -242
- package/tests/ncp/version-negotiation.test.ts +0 -123
- package/tests/ndp.test.ts +0 -271
- package/tests/nip.test.ts +0 -184
- package/tests/nop.test.ts +0 -344
- package/tests/nwp.test.ts +0 -237
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -20
- package/vitest.config.ts +0 -10
package/CHANGELOG.cn.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
[English Version](./CHANGELOG.md) | 中文版
|
|
2
|
+
|
|
3
|
+
# 变更日志 —— TypeScript SDK (`@labacacia/nps-sdk`)
|
|
4
|
+
|
|
5
|
+
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
6
|
+
|
|
7
|
+
在 NPS 达到 v1.0 稳定版之前,套件内所有仓库同步使用同一个预发布版本号。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## [1.0.0-alpha.13] —— 2026-06-03
|
|
12
|
+
|
|
13
|
+
### 新增
|
|
14
|
+
|
|
15
|
+
- **NCP v0.8 — `NopFrame`(0x07)**:新增 keepalive/心跳帧类;`HelloFrame.pingIntervalMs`(默认 `0`);新增 `NCP_KEEPALIVE_TIMEOUT` / `NCP_REKEY_REQUIRED` 错误码。
|
|
16
|
+
- **NWP v0.14 — manifest 版本化**:`manifest_version` 改为 `uint32` 单调递增计数器;新增 `manifest_updated_at`(ISO 8601);`X-NWM-Version` 响应头常量。
|
|
17
|
+
- **NIP v0.10 — `node_roles`**:`IdentFrameOptions.nodeRoles` / `IdentFrame.nodeRoles`(`readonly string[] | null`);新增 `CERT_NODE_ROLES_MISMATCH` 错误码。
|
|
18
|
+
- **NDP v0.9 — spawn schema + 心跳**:`AnnounceFrame.spawn_spec_ref` 改为结构化 `Record<string,unknown>` 对象;`AnnounceFrame.heartbeat_interval_ms`(默认 `60000`);新增 `NDP_ANNOUNCE_STALE` 错误码。
|
|
19
|
+
- **NOP v0.7 — 结果 TTL**:`TaskFrame.resultTtlSeconds`(默认 `3600`);新增 `NOP_TASK_RESULT_EXPIRED` / `NOP_STREAM_NAK_UNRESOLVABLE` 错误码。
|
|
20
|
+
|
|
21
|
+
### 套件同步
|
|
22
|
+
|
|
23
|
+
本版本跟进 NPS 套件 `v1.0.0-alpha.13`。NCP v0.8 / NWP v0.14 / NIP v0.10 / NDP v0.9 / NOP v0.7。
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## [1.0.0-alpha.8] —— 2026-05-28
|
|
28
|
+
|
|
29
|
+
### 套件同步
|
|
30
|
+
|
|
31
|
+
本版本跟进 NPS 套件 `v1.0.0-alpha.8`。
|
|
32
|
+
|
|
33
|
+
套件 alpha.8 亮点:.NET SDK 落地 RFC-0005 `ReputationPolicyEvaluator`;
|
|
34
|
+
cgn_limit 预执行拦截;RFC-0002 与 RFC-0005 晋级为 Accepted。
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [1.0.0-alpha.7] —— 2026-05-17
|
|
39
|
+
|
|
40
|
+
### 新增
|
|
41
|
+
|
|
42
|
+
- **`nip/reputation-client.ts` — `ReputationLogClient`(NPS-RFC-0004 Phase 2)**:基于 fetch 的声誉日志 operator 完整客户端。`submitEntry`、`queryEntries`、`getSth`、`getProof`、`getGossipSth`。`verifyInclusion` 使用 `@noble/hashes/sha256` 在本地执行 RFC 9162 §2.1.3.2 Merkle audit-path 验证。`signEntry` / `verifyEntry` 使用 `@noble/ed25519` 签名验证条目。Wire 类型:`ReputationLogEntry`、`SignedTreeHead`、`InclusionProof`、`ObservationWindow`。`AnchorTopologyError` 携带 `nwpErrorCode` + `npsStatus`。30 条回归测试。从 `@labacacia/nps-sdk/nip` 重新导出。
|
|
43
|
+
|
|
44
|
+
- **`nwp/anchor-client.ts` — `AnchorNodeClient`(NPS-CR-0002)**:基于 fetch 的 Anchor Node 拓扑查询客户端。`getSnapshot`(topology.snapshot)和 `subscribe` async generator(topology.stream NDJSON)。判别联合类型 `TopologyEvent`,包含 `member_joined`、`member_left`、`member_updated`、`anchor_state`、`resync_required` 五种 kind。`AnchorTopologyError` 处理协议错误。24 条回归测试。
|
|
45
|
+
|
|
46
|
+
### 跟随套件
|
|
47
|
+
|
|
48
|
+
本次跟随 NPS 套件 `v1.0.0-alpha.7`。
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## [1.0.0-alpha.6] —— 2026-05-14
|
|
53
|
+
|
|
54
|
+
### 变更
|
|
55
|
+
|
|
56
|
+
- **`nip/x509/oids.ts` — IANA PEN 65715(Breaking,CR-0004)**:`LAB_ACACIA_PEN_ARC` 从 `"1.3.6.1.4.1.99999"` 更新为 `"1.3.6.1.4.1.65715"`。在临时弧下签发的证书必须吊销并重新签发。
|
|
57
|
+
|
|
58
|
+
- **`nwp/index.ts` — 移除 `NwpErrorCodes` 重导出(Breaking)**:从桶文件中移除了 `export * as NwpErrorCodes from "./error-codes.js"`。如需使用,请直接从 `@labacacia/nps-sdk/nwp/error-codes` 导入。
|
|
59
|
+
|
|
60
|
+
- **版本升级至 `1.0.0-alpha.6`** —— 与 NPS 套件 alpha.6 版本同步。
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## [1.0.0-alpha.5] —— 2026-05-01
|
|
65
|
+
|
|
66
|
+
### 新增
|
|
67
|
+
|
|
68
|
+
- **NWP 错误码常量** —— 新增 `NwpErrorCodes` 命名空间,从 `@labacacia/nps-sdk/nwp` 导出,包含全部 30 个 NWP wire 错误码(auth、query、action、task、subscribe、infrastructure、manifest、topology、reserved-type)。此前版本均未提供。
|
|
69
|
+
- **`NpsStatusCodes.NPS_SERVER_UNSUPPORTED`** —— 在 `src/core/status-codes.ts` 新增状态码 `"NPS-SERVER-UNSUPPORTED"`(HTTP 501),符合 spec/status-codes.md alpha.5 更新。
|
|
70
|
+
- **`NDP.resolveWithDns` —— DNS TXT 回退解析** —— 新增 `InMemoryNdpRegistry.resolveWithDns(target, resolver?)`,当内存注册表无匹配时回退查询 `_nps-node.{host}` TXT 记录(NPS-4 §5)。新增 `DnsTxtLookup` 接口 + `SystemDnsTxtLookup`(Node.js `dns.promises`);`parseNpsTxtRecord` + `extractHostFromTarget` 从 `@labacacia/nps-sdk/ndp` 导出。测试数:284 → 294。
|
|
71
|
+
|
|
72
|
+
### 变更
|
|
73
|
+
|
|
74
|
+
- **`AssuranceLevel.fromWire("")` 返回 `Anonymous`** —— `if (wire == null)` 改为 `if (!wire)`,使 `""` 返回 `Anonymous` 而非 `Unknown`(spec §5.1.1 向后兼容修复)。
|
|
75
|
+
- **版本升至 `1.0.0-alpha.5`** —— 与 NPS 套件 alpha.5 同步。
|
|
76
|
+
|
|
77
|
+
### 修复
|
|
78
|
+
|
|
79
|
+
- **`REPUTATION_GOSSIP_FORK` / `REPUTATION_GOSSIP_SIG_INVALID`** —— 向 `src/nip/error-codes.ts` 新增两个 NIP 声誉 gossip 错误码(RFC-0004 Phase 3)。
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## [1.0.0-alpha.4] —— 2026-04-30
|
|
84
|
+
|
|
85
|
+
### 新增
|
|
86
|
+
|
|
87
|
+
- **NPS-RFC-0001 Phase 2 —— NCP 连接前导(TypeScript helper 跟进)。**
|
|
88
|
+
`src/ncp/preamble.ts` 暴露 `writePreamble(stream)` /
|
|
89
|
+
`readPreamble(stream)`,往返字面量 `b"NPS/1.0\n"` 哨兵;
|
|
90
|
+
`tests/ncp/preamble.test.ts` 覆盖。让 TypeScript SDK 与 .NET /
|
|
91
|
+
Python / Go / Java 在 alpha.4 的 preamble helper 持平。
|
|
92
|
+
- **NPS-RFC-0002 Phase A/B —— X.509 NID 证书 + ACME `agent-01`
|
|
93
|
+
(TypeScript 端口)。** 新增 `src/nip/` 子模块:
|
|
94
|
+
- `nip/x509/` —— X.509 NID 证书 builder + verifier
|
|
95
|
+
(`x509.Builder`、`x509.Verifier`)。
|
|
96
|
+
- `nip/acme/` —— ACME `agent-01` 客户端 + 服务端参考实现
|
|
97
|
+
(`AcmeServer`、`AcmeClient`);按 NPS-RFC-0002 Phase B 的 JWS
|
|
98
|
+
签名 wire 包络。
|
|
99
|
+
- `nip/assurance-level.ts` —— Agent 身份保证等级
|
|
100
|
+
(`anonymous` / `attested` / `verified`),承接 NPS-RFC-0003。
|
|
101
|
+
- `nip/cert-format.ts` —— IdentFrame `cert_format` 判别器
|
|
102
|
+
(`v1` Ed25519 vs. `x509`)。
|
|
103
|
+
- `nip/error-codes.ts` —— NIP 错误码命名空间。
|
|
104
|
+
- `nip/verifier.ts` —— dual-trust IdentFrame 验证器(v1 + X.509)。
|
|
105
|
+
- 20 个新测试覆盖 preamble 往返、X.509 签发 + 解析、dual-trust 验证、
|
|
106
|
+
ACME agent-01 全流程。总数:284 tests 全绿(alpha.3 时 264)。
|
|
107
|
+
|
|
108
|
+
### 变更
|
|
109
|
+
|
|
110
|
+
- 分发版本升至 `1.0.0-alpha.4`。
|
|
111
|
+
- `src/nip/frames.ts` —— IdentFrame wire 形状扩展,可携带可选的
|
|
112
|
+
`cert_format` 判别器 + `x509_chain` 字段,与 v1 Ed25519 字段并存。
|
|
113
|
+
alpha.3 写出的 v1 IdentFrame 仍可被 alpha.4 验签。
|
|
114
|
+
|
|
115
|
+
### npm 发布说明
|
|
116
|
+
|
|
117
|
+
- 本仓库 / tag 是 `@labacacia/nps-sdk` `1.0.0-alpha.4` 的权威参考。
|
|
118
|
+
延续 alpha.3 的情况,npm publish 可能需要带 2FA-bypass 的 granular
|
|
119
|
+
access token —— 如果 npm registry 上的版本暂时落后于本仓库 tag,
|
|
120
|
+
以 tag 为准;下一次 registry cut 后 `npm install` 即可解析到本
|
|
121
|
+
commit。
|
|
122
|
+
|
|
123
|
+
### 套件级 alpha.4 要点
|
|
124
|
+
|
|
125
|
+
- **NPS-RFC-0002 X.509 + ACME** —— 完整跨 SDK 端口波(.NET / Java /
|
|
126
|
+
Python / TypeScript / Go / Rust)。
|
|
127
|
+
- **NPS-CR-0002 —— Anchor Node topology 查询** —— `topology.snapshot`
|
|
128
|
+
/ `topology.stream`(.NET 参考 + L2 conformance)。TypeScript 消费
|
|
129
|
+
侧 helper 后续版本跟进。
|
|
130
|
+
- **`nps-registry` SQLite 实仓** + **`nps-ledger` Phase 2**
|
|
131
|
+
(RFC 9162 Merkle + STH + inclusion proof)已在 daemon 仓库交付。
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## [1.0.0-alpha.3] —— 2026-04-25
|
|
136
|
+
|
|
137
|
+
### Changed
|
|
138
|
+
|
|
139
|
+
- 版本升级至 `1.0.0-alpha.3`,与 NPS `v1.0.0-alpha.3` 套件同步。本次 TypeScript SDK 无功能变更。
|
|
140
|
+
- 264 tests, ≥98% 覆盖率仍全绿。
|
|
141
|
+
|
|
142
|
+
### 套件级 alpha.3 要点(各语言 helper 在 alpha.4 跟进)
|
|
143
|
+
|
|
144
|
+
- **NPS-RFC-0001 —— NCP 连接前导**(Accepted)。原生模式连接现以字面量 `b"NPS/1.0\n"`(8 字节)开头。.NET SDK 已落地参考实现;TypeScript helper 在 alpha.4 跟进。
|
|
145
|
+
- **NPS-RFC-0003 —— Agent 身份保证等级**(Accepted)。NIP IdentFrame 与 NWM 新增三态 `assurance_level`(`anonymous`/`attested`/`verified`)。.NET 参考类型已落地;TypeScript 同步在 alpha.4。
|
|
146
|
+
- **NPS-RFC-0004 —— NID 声誉日志(CT 风格)**(Accepted)。append-only Merkle 日志条目结构发布;.NET 参考签名器已落地(并以 `nps-ledger` daemon Phase 1 形态发布)。TypeScript helper 在 alpha.4 跟进。
|
|
147
|
+
- **NPS-CR-0001 —— Anchor / Bridge 节点拆分。** 旧的 "Gateway Node" 角色更名为 **Anchor Node**;"NPS↔外部协议翻译" 单独成为 **Bridge Node** 类型。AnnounceFrame 新增 `node_kind` / `cluster_anchor` / `bridge_protocols`。源代码层面变更落在 `spec/` + .NET 参考实现。
|
|
148
|
+
- **6 个 NPS 常驻 daemon。** NPS-Dev 新建 `daemons/` 目录,定义 `npsd` / `nps-runner` / `nps-gateway` / `nps-registry` / `nps-cloud-ca` / `nps-ledger`;其中 `npsd` 提供 L1 功能性参考实现,其余为 Phase 1 骨架。
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## [1.0.0-alpha.2] —— 2026-04-19
|
|
153
|
+
|
|
154
|
+
### Fixed
|
|
155
|
+
|
|
156
|
+
- **`NpsFrameCodec is not a constructor`** —— `src/core/index.ts` 现显式从 `./codec.js`、`./registry.js`、`./cache.js` 重新导出随包提供的 OOP API(`NpsFrameCodec`、`Tier1JsonCodec`、`Tier2MsgPackCodec`、`FrameRegistry`、`AnchorFrameCache`)。`./codecs/` 下的并行函数式 API 仍可通过直接路径导入,但不再自动导出(与类 API 在 `FrameType` / `EncodingTier` / `FrameHeader` 上冲突)。
|
|
157
|
+
- **缺失的 Ed25519 运行时依赖** —— `@noble/ed25519` 和 `@noble/hashes` 现已声明为运行时依赖。此前已被 `src/nip/identity.ts` 和 `src/ndp/validator.ts` import 但 `package.json` 未声明,导致 npm 消费者安装失败。
|
|
158
|
+
|
|
159
|
+
### Added
|
|
160
|
+
|
|
161
|
+
- **HelloFrame(NCP 0x06)** —— `src/ncp/frames.ts` 新增 `HelloFrame` 类(snake_case toDict/fromDict),在 `ncp/registry.ts` 中注册。`FrameType.HELLO = 0x06` 加入枚举。
|
|
162
|
+
- **subpath exports** —— `package.json` 的 `exports` 映射新增 `./nwp`、`./nip`、`./ndp`、`./nop`(此前仅声明 `.`、`./core`、`./ncp`,但 README 已示例使用全部六个)。
|
|
163
|
+
|
|
164
|
+
### Changed
|
|
165
|
+
|
|
166
|
+
- Node 引擎要求升级到 `>=22.0.0`。
|
|
167
|
+
- 264 测试全绿(此前为 158 通过 + 5 个文件失败 + 1 个测试失败)。
|
|
168
|
+
|
|
169
|
+
### 涵盖模块
|
|
170
|
+
|
|
171
|
+
- core / ncp / nwp / nip / ndp / nop
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## [1.0.0-alpha.1] —— 2026-04-10
|
|
176
|
+
|
|
177
|
+
作为 NPS 套件 `v1.0.0-alpha.1` 的一部分首次公开 alpha。
|
|
178
|
+
|
|
179
|
+
[1.0.0-alpha.7]: https://github.com/labacacia/NPS-sdk-ts/releases/tag/v1.0.0-alpha.7
|
|
180
|
+
[1.0.0-alpha.2]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.2
|
|
181
|
+
[1.0.0-alpha.1]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.1
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
English | [中文版](./CHANGELOG.cn.md)
|
|
2
|
+
|
|
3
|
+
# Changelog — TypeScript SDK (`@labacacia/nps-sdk`)
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
Until NPS reaches v1.0 stable, every repository in the suite is synchronized to the same pre-release version tag.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## [1.0.0-alpha.13] — 2026-06-03
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **NCP v0.8 — `NopFrame` (0x07)**: New keepalive/heartbeat frame class; `HelloFrame.pingIntervalMs` (`number`, default `0`); `NCP_KEEPALIVE_TIMEOUT` / `NCP_REKEY_REQUIRED` error codes.
|
|
16
|
+
- **NWP v0.14 — manifest versioning**: `manifest_version` changed to `uint32` monotonic counter; `manifest_updated_at` (ISO 8601); `X-NWM-Version` response header constant.
|
|
17
|
+
- **NIP v0.10 — `node_roles`**: `IdentFrameOptions.nodeRoles` / `IdentFrame.nodeRoles` (`readonly string[] | null`); `CERT_NODE_ROLES_MISMATCH` error code.
|
|
18
|
+
- **NDP v0.9 — spawn schema + heartbeat**: `AnnounceFrame.spawn_spec_ref` changed to structured `Record<string,unknown>` object (NdpSpawnSpecRef); `AnnounceFrame.heartbeat_interval_ms` (`number`, default `60000`); `NDP_ANNOUNCE_STALE` error code.
|
|
19
|
+
- **NOP v0.7 — result TTL**: `TaskFrame.resultTtlSeconds` (`number`, default `3600`); `NOP_TASK_RESULT_EXPIRED` / `NOP_STREAM_NAK_UNRESOLVABLE` error codes.
|
|
20
|
+
|
|
21
|
+
### Tracking the suite
|
|
22
|
+
|
|
23
|
+
This release tracks NPS suite `v1.0.0-alpha.13`. NCP v0.8 / NWP v0.14 / NIP v0.10 / NDP v0.9 / NOP v0.7.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## [1.0.0-alpha.11] — 2026-05-31
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **NWP — `SubscribeFrame` CR-0006** (Breaking rewrite): Changed from class to interface; wire format updated — `subscriptionId` (UUID v4), `filter` (`Record<string,unknown>?`), `heartbeatIntervalMs` (`number?`), `maxEvents` (`number?`), `cursor` (`string?`). `subscribeFrameToNpsFrame()` / `subscribeFrameFromDict()` standalone helpers. **Wire breaking change vs alpha.8–10.**
|
|
32
|
+
- **NOP — AlignStream ack/NAK**: `AlignStreamFrame` gains `ackSeq` and `nakSeq` (`number?`) for NOP v0.6 sliding-window acknowledgement.
|
|
33
|
+
- **NOP — Saga compensation**: `TaskFrame.compensationPolicy`; `DelegateFrame.targetClusterAnchor`; `AggregateStrategy.WEIGHTED_FIRST_K` / `MERGE_ALL`.
|
|
34
|
+
- **NDP — `GraphFrame` §5** (Breaking rewrite): `NdpGraphNode`, `NdpGraphEdge` interfaces; `GraphFrame` with `graphId`, `nodes`, `edges`, `ttl`, `metadata`. Max 256 nodes / 1024 edges.
|
|
35
|
+
- **NDP — `SecurityProfile`**: `LOCAL_DEV` / `ORG_PRIVATE` / `PUBLIC_FEDERATED` const.
|
|
36
|
+
- **NIP — `IdentFrame.ocspStaple`**: base64url DER OCSP response field; `IdentReputationPolicyHint` interface.
|
|
37
|
+
|
|
38
|
+
### Tracking the suite
|
|
39
|
+
|
|
40
|
+
This release tracks NPS suite `v1.0.0-alpha.11`. NCP v0.7 / NWP v0.13 / NIP v0.9 / NDP v0.8 / NOP v0.6.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## [1.0.0-alpha.10] — 2026-05-28
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **NOP — Saga compensation**: `DagNode` interface with `compensateAction` / `compensateParamsMapping`; `TaskState.COMPENSATING` / `COMPENSATED`; `CompensationPolicy` object.
|
|
49
|
+
- **NDP — `SecurityProfile`**: `LOCAL_DEV` / `ORG_PRIVATE` / `PUBLIC_FEDERATED` const.
|
|
50
|
+
- **NIP — `IdentReputationPolicyHint`**: Reputation policy hint interface; `IdentMetadata` interface.
|
|
51
|
+
|
|
52
|
+
### Tracking the suite
|
|
53
|
+
|
|
54
|
+
This release tracks NPS suite `v1.0.0-alpha.10`.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## [1.0.0-alpha.9] — 2026-05-28
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
|
|
62
|
+
- **NWP — `SubscribeFrame` (0x12)**: Initial `SubscribeFrame` class (pre-CR-0006 format — replaced in alpha.11).
|
|
63
|
+
- **NWP — `ReputationPolicy` / `RepOutcome`**: RFC-0005 reputation types.
|
|
64
|
+
|
|
65
|
+
### Tracking the suite
|
|
66
|
+
|
|
67
|
+
This release tracks NPS suite `v1.0.0-alpha.9`.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## [1.0.0-alpha.8] — 2026-05-28
|
|
72
|
+
|
|
73
|
+
### Tracking the suite
|
|
74
|
+
|
|
75
|
+
This release tracks NPS suite `v1.0.0-alpha.8`.
|
|
76
|
+
|
|
77
|
+
Suite highlights: RFC-0005 `ReputationPolicyEvaluator` in .NET SDK; cgn_limit
|
|
78
|
+
pre-execution enforcement; RFC-0002 and RFC-0005 promoted to Accepted.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## [1.0.0-alpha.7] — 2026-05-17
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- **`nip/reputation-client.ts` — `ReputationLogClient` (NPS-RFC-0004 Phase 2)**: Full fetch-based client for the reputation-log operator API. `submitEntry`, `queryEntries`, `getSth`, `getProof`, `getGossipSth`. `verifyInclusion` performs RFC 9162 §2.1.3.2 Merkle audit-path verification locally using `@noble/hashes/sha256`. `signEntry` / `verifyEntry` sign and verify entries with `@noble/ed25519`. Wire types: `ReputationLogEntry`, `SignedTreeHead`, `InclusionProof`, `ObservationWindow`. `AnchorTopologyError` carries `nwpErrorCode` + `npsStatus`. 30 regression tests. Re-exported from `@labacacia/nps-sdk/nip`.
|
|
87
|
+
|
|
88
|
+
- **`nwp/anchor-client.ts` — `AnchorNodeClient` (NPS-CR-0002)**: Fetch-based client for Anchor Node topology queries. `getSnapshot` (topology.snapshot) and `subscribe` async generator (topology.stream NDJSON). Discriminated-union `TopologyEvent` with kinds: `member_joined`, `member_left`, `member_updated`, `anchor_state`, `resync_required`. `AnchorTopologyError` for protocol errors. 24 regression tests.
|
|
89
|
+
|
|
90
|
+
### Tracking the suite
|
|
91
|
+
|
|
92
|
+
This release tracks NPS suite `v1.0.0-alpha.7`.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## [1.0.0-alpha.6] — 2026-05-14
|
|
97
|
+
|
|
98
|
+
### Changed
|
|
99
|
+
|
|
100
|
+
- **`nip/x509/oids.ts` — IANA PEN 65715 (Breaking, CR-0004)**: `LAB_ACACIA_PEN_ARC` updated from `"1.3.6.1.4.1.99999"` to `"1.3.6.1.4.1.65715"`. Certificates issued under the provisional arc must be revoked and re-issued.
|
|
101
|
+
|
|
102
|
+
- **`nwp/index.ts` — `NwpErrorCodes` re-export removed (Breaking)**: `export * as NwpErrorCodes from "./error-codes.js"` removed from the barrel. Import directly from `@labacacia/nps-sdk/nwp/error-codes` if needed.
|
|
103
|
+
|
|
104
|
+
- **Version bump to `1.0.0-alpha.6`** — synchronized with NPS suite alpha.6 release.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## [1.0.0-alpha.5] — 2026-05-01
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- **NWP error code constants** — new `NwpErrorCodes` namespace exported from `@labacacia/nps-sdk/nwp` with all 30 NWP wire error codes (auth, query, action, task, subscribe, infrastructure, manifest, topology, reserved-type). Missing from previous releases.
|
|
113
|
+
- **`NpsStatusCodes.NPS_SERVER_UNSUPPORTED`** — new status code `"NPS-SERVER-UNSUPPORTED"` (HTTP 501) in `src/core/status-codes.ts`, per spec/status-codes.md alpha.5 update.
|
|
114
|
+
- **`NDP.resolveWithDns` — DNS TXT fallback resolution** — new `InMemoryNdpRegistry.resolveWithDns(target, resolver?)` falls back to `_nps-node.{host}` TXT record lookup (NPS-4 §5) when no in-memory entry matches. New `DnsTxtLookup` interface + `SystemDnsTxtLookup` (Node.js `dns.promises`); `parseNpsTxtRecord` + `extractHostFromTarget` helpers exported from `@labacacia/nps-sdk/ndp`. Tests: 284 → 294.
|
|
115
|
+
|
|
116
|
+
### Changed
|
|
117
|
+
|
|
118
|
+
- **`AssuranceLevel.fromWire("")` returns `Anonymous`** — `if (wire == null)` changed to `if (!wire)` so `""` returns `Anonymous` instead of `Unknown` (spec §5.1.1 backward-compat fix).
|
|
119
|
+
- **Version bump to `1.0.0-alpha.5`** — synchronized with NPS suite alpha.5 release.
|
|
120
|
+
|
|
121
|
+
### Fixed
|
|
122
|
+
|
|
123
|
+
- **`REPUTATION_GOSSIP_FORK` / `REPUTATION_GOSSIP_SIG_INVALID`** — two new NIP reputation gossip error codes added to `src/nip/error-codes.ts` (RFC-0004 Phase 3).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## [1.0.0-alpha.4] — 2026-04-30
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
|
|
131
|
+
- **NPS-RFC-0001 Phase 2 — NCP connection preamble (TypeScript helper
|
|
132
|
+
parity).** `src/ncp/preamble.ts` exposes `writePreamble(stream)` and
|
|
133
|
+
`readPreamble(stream)` round-tripping the literal `b"NPS/1.0\n"`
|
|
134
|
+
sentinel; matched by `tests/ncp/preamble.test.ts`. Brings TypeScript
|
|
135
|
+
in line with the .NET / Python / Go / Java preamble helpers shipped
|
|
136
|
+
at alpha.4.
|
|
137
|
+
- **NPS-RFC-0002 Phase A/B — X.509 NID certificates + ACME `agent-01`
|
|
138
|
+
(TypeScript port).** New surface under `src/nip/`:
|
|
139
|
+
- `nip/x509/` — X.509 NID certificate builder + verifier
|
|
140
|
+
(`x509.Builder`, `x509.Verifier`).
|
|
141
|
+
- `nip/acme/` — ACME `agent-01` client + server reference
|
|
142
|
+
(`AcmeServer`, `AcmeClient`); JWS-signed wire envelope per
|
|
143
|
+
NPS-RFC-0002 Phase B.
|
|
144
|
+
- `nip/assurance-level.ts` — agent identity assurance levels
|
|
145
|
+
(`anonymous` / `attested` / `verified`) per NPS-RFC-0003.
|
|
146
|
+
- `nip/cert-format.ts` — IdentFrame `cert_format` discriminator
|
|
147
|
+
(`v1` Ed25519 vs. `x509`).
|
|
148
|
+
- `nip/error-codes.ts` — NIP error code namespace strings.
|
|
149
|
+
- `nip/verifier.ts` — dual-trust IdentFrame verifier (v1 + X.509).
|
|
150
|
+
- 20 new tests covering preamble round-trip, X.509 issuance + parsing,
|
|
151
|
+
dual-trust verification, and ACME agent-01 round-trip. Total: 284
|
|
152
|
+
tests green (was 264 at alpha.3).
|
|
153
|
+
|
|
154
|
+
### Changed
|
|
155
|
+
|
|
156
|
+
- Distribution version bumped to `1.0.0-alpha.4`.
|
|
157
|
+
- `src/nip/frames.ts` — IdentFrame wire shape extended with optional
|
|
158
|
+
`cert_format` discriminator + `x509_chain` field alongside the
|
|
159
|
+
existing v1 Ed25519 fields. v1 IdentFrames written by alpha.3
|
|
160
|
+
consumers continue to verify unchanged.
|
|
161
|
+
|
|
162
|
+
### Note: npm publish status
|
|
163
|
+
|
|
164
|
+
- This repo / tag is the canonical `1.0.0-alpha.4` reference for
|
|
165
|
+
`@labacacia/nps-sdk`. As at the alpha.3 ship cycle, npm publish
|
|
166
|
+
may require a granular access token with 2FA-bypass enabled — if
|
|
167
|
+
the registry version lags this repo's tag, the tag is the
|
|
168
|
+
authoritative artifact and `npm install` against the next
|
|
169
|
+
registry cut will resolve to this commit.
|
|
170
|
+
|
|
171
|
+
### Suite-wide highlights at alpha.4
|
|
172
|
+
|
|
173
|
+
- **NPS-RFC-0002 X.509 + ACME** — full cross-SDK port wave (.NET /
|
|
174
|
+
Java / Python / TypeScript / Go / Rust). Servers can now issue
|
|
175
|
+
dual-trust IdentFrames (v1 Ed25519 + X.509 leaf cert chained to a
|
|
176
|
+
self-signed root) and self-onboard NIDs over ACME's `agent-01`
|
|
177
|
+
challenge type.
|
|
178
|
+
- **NPS-CR-0002 — Anchor Node topology queries** — `topology.snapshot`
|
|
179
|
+
/ `topology.stream` query types (.NET reference + L2 conformance
|
|
180
|
+
suite). TypeScript consumer-side helpers planned for a later
|
|
181
|
+
release.
|
|
182
|
+
- **`nps-registry` SQLite-backed real registry** + **`nps-ledger`
|
|
183
|
+
Phase 2** (RFC 9162 Merkle + STH + inclusion proofs) shipped in the
|
|
184
|
+
daemon repos.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## [1.0.0-alpha.3] — 2026-04-25
|
|
189
|
+
|
|
190
|
+
### Changed
|
|
191
|
+
|
|
192
|
+
- 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.
|
|
193
|
+
- 264 tests, ≥98% coverage still green.
|
|
194
|
+
|
|
195
|
+
### Suite-wide highlights at alpha.3 (per-language helpers planned for alpha.4)
|
|
196
|
+
|
|
197
|
+
- **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.
|
|
198
|
+
- **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.
|
|
199
|
+
- **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.
|
|
200
|
+
- **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.
|
|
201
|
+
- **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.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## [1.0.0-alpha.2] — 2026-04-19
|
|
206
|
+
|
|
207
|
+
### Fixed
|
|
208
|
+
|
|
209
|
+
- **`NpsFrameCodec is not a constructor`** — `src/core/index.ts` now explicitly re-exports the shipped OOP API (`NpsFrameCodec`, `Tier1JsonCodec`, `Tier2MsgPackCodec`, `FrameRegistry`, `AnchorFrameCache`) from `./codec.js`, `./registry.js`, `./cache.js`. The parallel functional API under `./codecs/` remains reachable by direct path but is no longer auto-exported (it collided on `FrameType` / `EncodingTier` / `FrameHeader`).
|
|
210
|
+
- **Missing Ed25519 runtime deps** — `@noble/ed25519` and `@noble/hashes` are now declared as runtime dependencies. Previously imported by `src/nip/identity.ts` and `src/ndp/validator.ts` but not listed in `package.json`, causing install failures for npm consumers.
|
|
211
|
+
|
|
212
|
+
### Added
|
|
213
|
+
|
|
214
|
+
- **HelloFrame (NCP 0x06)** — new `HelloFrame` class in `src/ncp/frames.ts` with snake_case toDict/fromDict, registered in `ncp/registry.ts`. `FrameType.HELLO = 0x06` added to the enum.
|
|
215
|
+
- **Subpath exports** — `package.json` `exports` map now includes `./nwp`, `./nip`, `./ndp`, `./nop` (previously only `.`, `./core`, `./ncp` were declared even though README documented all six).
|
|
216
|
+
|
|
217
|
+
### Changed
|
|
218
|
+
|
|
219
|
+
- Node engine requirement raised to `>=22.0.0`.
|
|
220
|
+
- 264 tests green (up from 158 previously passing + 5 file failures + 1 test failure).
|
|
221
|
+
|
|
222
|
+
### Covered modules
|
|
223
|
+
|
|
224
|
+
- core / ncp / nwp / nip / ndp / nop
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## [1.0.0-alpha.1] — 2026-04-10
|
|
229
|
+
|
|
230
|
+
First public alpha as part of the NPS suite `v1.0.0-alpha.1` release.
|
|
231
|
+
|
|
232
|
+
[1.0.0-alpha.7]: https://github.com/labacacia/NPS-sdk-ts/releases/tag/v1.0.0-alpha.7
|
|
233
|
+
[1.0.0-alpha.2]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.2
|
|
234
|
+
[1.0.0-alpha.1]: https://github.com/LabAcacia/nps/releases/tag/v1.0.0-alpha.1
|
package/LICENSE
CHANGED
|
File without changes
|
package/NOTICE
CHANGED
|
File without changes
|
package/README.cn.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
[English Version](./README.md) | 中文版
|
|
2
|
+
|
|
3
|
+
# @labacacia/nps-sdk — TypeScript / Node.js
|
|
4
|
+
|
|
5
|
+
面向 **Neural Protocol Suite (NPS)** 的 TypeScript SDK —— 为 AI Agent 设计的协议族。
|
|
6
|
+
属 [LabAcacia](https://github.com/LabAcacia) / INNO LOTUS PTY LTD 开源生态。
|
|
7
|
+
|
|
8
|
+
## 状态
|
|
9
|
+
|
|
10
|
+
**v1.0.0-alpha.13 — RFC-0002 跨 SDK 端口波(第三棒)** · 5 个协议 · 271 个测试 · 覆盖率 ≥ 98%
|
|
11
|
+
|
|
12
|
+
> npm registry 说明:`@labacacia/nps-sdk@1.0.0-alpha.11` 已 deprecated,因为发布到 npm 的 tarball 缺少 `dist/`。该问题已在 `1.0.0-alpha.13` 修复——请安装 `@labacacia/nps-sdk@alpha`(`alpha` dist-tag 现已指向 `1.0.0-alpha.13`)。
|
|
13
|
+
|
|
14
|
+
| 协议 | 类 | 状态 |
|
|
15
|
+
|------|----|------|
|
|
16
|
+
| NCP — Neural Communication Protocol | 帧、编解码器 | ✅ |
|
|
17
|
+
| NWP — Neural Web Protocol | `NwpClient` | ✅ |
|
|
18
|
+
| NIP — Neural Identity Protocol | `NipIdentity`、`NipIdentVerifier`(RFC-0002 §8.1 双信任)、`AssuranceLevel`(RFC-0003)、`nip.x509` + `nip.acme` | ✅ |
|
|
19
|
+
| NDP — Neural Discovery Protocol | `InMemoryNdpRegistry`、`NdpAnnounceValidator` | ✅ |
|
|
20
|
+
| NOP — Neural Orchestration Protocol | `NopClient` | ✅ |
|
|
21
|
+
|
|
22
|
+
**早期新增** —— 完整的 NPS-RFC-0002 X.509 + ACME `agent-01` NID 证书原语:
|
|
23
|
+
|
|
24
|
+
- `nip.x509` —— `issueLeaf` / `issueRoot` / `verify`(基于 `@peculiar/x509` + 原生 Web Crypto Ed25519)。
|
|
25
|
+
- `nip.acme` —— `AcmeClient` + 进程内 `AcmeServer` + JWS / messages helpers(RFC 8555 + RFC 8037 EdDSA)。
|
|
26
|
+
- `IdentFrame` 扩展非破坏性可选构造参数 `assuranceLevel` / `certFormat` / `certChain`;v1 verifier 忽略新字段。
|
|
27
|
+
|
|
28
|
+
## 安装
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @labacacia/nps-sdk@alpha
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> **对等依赖:** Node.js 22+
|
|
35
|
+
|
|
36
|
+
## 快速开始
|
|
37
|
+
|
|
38
|
+
### NWP —— 查询节点
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { NwpClient, QueryFrame } from "@labacacia/nps-sdk/nwp";
|
|
42
|
+
|
|
43
|
+
const client = new NwpClient("http://node.example.com:17433");
|
|
44
|
+
const caps = await client.query(new QueryFrame("sha256:<anchor-id>", { active: true }, 20));
|
|
45
|
+
console.log(caps.count, caps.data);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### NWP —— 流式结果
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
for await (const chunk of client.stream(new QueryFrame("sha256:<anchor-id>"))) {
|
|
52
|
+
console.log(chunk.seq, chunk.data);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### NWP —— 调用 Action
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { ActionFrame } from "@labacacia/nps-sdk/nwp";
|
|
60
|
+
|
|
61
|
+
const result = await client.invoke(new ActionFrame("summarise", { maxTokens: 500 }));
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### NIP —— Ed25519 身份
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { NipIdentity } from "@labacacia/nps-sdk/nip";
|
|
68
|
+
|
|
69
|
+
// 生成并持久化
|
|
70
|
+
const id = NipIdentity.generate();
|
|
71
|
+
id.save("./my-key.json", process.env.KEY_PASS!);
|
|
72
|
+
|
|
73
|
+
// 加载并签名
|
|
74
|
+
const loaded = NipIdentity.load("./my-key.json", process.env.KEY_PASS!);
|
|
75
|
+
const sig = loaded.sign({ action: "announce", nid: "urn:nps:node:example.com:data" });
|
|
76
|
+
const ok = loaded.verify({ action: "announce", nid: "urn:nps:node:example.com:data" }, sig);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### NDP —— 注册表和签名校验
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { InMemoryNdpRegistry, NdpAnnounceValidator } from "@labacacia/nps-sdk/ndp";
|
|
83
|
+
import { AnnounceFrame } from "@labacacia/nps-sdk/ndp";
|
|
84
|
+
|
|
85
|
+
const registry = new InMemoryNdpRegistry();
|
|
86
|
+
const validator = new NdpAnnounceValidator();
|
|
87
|
+
validator.registerPublicKey(nid, identity.pubKeyString);
|
|
88
|
+
|
|
89
|
+
registry.announce(frame);
|
|
90
|
+
const resolved = registry.resolve("nwp://example.com/data/items");
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### NOP —— 提交并等待任务
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { NopClient, TaskFrame } from "@labacacia/nps-sdk/nop";
|
|
97
|
+
|
|
98
|
+
const client = new NopClient("http://orchestrator.example.com:17433");
|
|
99
|
+
const dag = {
|
|
100
|
+
nodes: [{ id: "classify", action: "classify-text", agent: "urn:nps:node:ml.example.com:classifier" }],
|
|
101
|
+
edges: [],
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const taskId = await client.submit(new TaskFrame("my-task-1", dag));
|
|
105
|
+
const status = await client.wait(taskId, { timeoutMs: 30_000 });
|
|
106
|
+
console.log(status.state, status.aggregatedResult);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 包导出
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { ... } from "@labacacia/nps-sdk"; // 全部
|
|
113
|
+
import { ... } from "@labacacia/nps-sdk/core"; // codec、帧、registry、cache
|
|
114
|
+
import { ... } from "@labacacia/nps-sdk/ncp"; // AnchorFrame、CapsFrame、StreamFrame、HelloFrame、…
|
|
115
|
+
import { ... } from "@labacacia/nps-sdk/nwp"; // NwpClient、QueryFrame、ActionFrame
|
|
116
|
+
import { ... } from "@labacacia/nps-sdk/nip"; // NipIdentity、IdentFrame、TrustFrame、RevokeFrame
|
|
117
|
+
import { ... } from "@labacacia/nps-sdk/ndp"; // InMemoryNdpRegistry、NdpAnnounceValidator、AnnounceFrame、…
|
|
118
|
+
import { ... } from "@labacacia/nps-sdk/nop"; // NopClient、NopTaskStatus、TaskFrame、…
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## NCP 编解码
|
|
122
|
+
|
|
123
|
+
编解码层支持双 Tier 编码和对线上字节的直接操作:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { NpsFrameCodec, EncodingTier } from "@labacacia/nps-sdk/core";
|
|
127
|
+
import { createDefaultRegistry } from "@labacacia/nps-sdk";
|
|
128
|
+
|
|
129
|
+
const codec = new NpsFrameCodec(createDefaultRegistry());
|
|
130
|
+
|
|
131
|
+
// 编码(默认 MsgPack)
|
|
132
|
+
const wire = codec.encode(frame);
|
|
133
|
+
|
|
134
|
+
// 编码为 JSON(调试 / 互操作)
|
|
135
|
+
const json = codec.encode(frame, { overrideTier: EncodingTier.JSON });
|
|
136
|
+
|
|
137
|
+
// 解码
|
|
138
|
+
const decoded = codec.decode(wire);
|
|
139
|
+
|
|
140
|
+
// 仅读取帧头,不解码 payload
|
|
141
|
+
const header = NpsFrameCodec.peekHeader(wire);
|
|
142
|
+
console.log(header.frameType, header.isExtended, header.payloadLength);
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 开发
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# 安装
|
|
149
|
+
npm install
|
|
150
|
+
|
|
151
|
+
# 测试
|
|
152
|
+
npm test
|
|
153
|
+
|
|
154
|
+
# 测试 + 覆盖率
|
|
155
|
+
npm run test -- --coverage
|
|
156
|
+
|
|
157
|
+
# 构建(ESM + CJS)
|
|
158
|
+
npm run build
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 许可证
|
|
162
|
+
|
|
163
|
+
Apache 2.0 —— 详见 [LICENSE](https://github.com/labacacia/NPS-Dev/blob/main/LICENSE)。
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
English | [中文版](./README.cn.md)
|
|
2
|
+
|
|
1
3
|
# @labacacia/nps-sdk — TypeScript / Node.js
|
|
2
4
|
|
|
3
5
|
TypeScript SDK for the **Neural Protocol Suite** (NPS) — a protocol suite designed for AI Agents.
|
|
@@ -5,23 +7,31 @@ Part of the [LabAcacia](https://github.com/LabAcacia) / INNO LOTUS PTY LTD open-
|
|
|
5
7
|
|
|
6
8
|
## Status
|
|
7
9
|
|
|
8
|
-
**
|
|
10
|
+
**v1.0.0-alpha.13 — RFC-0002 cross-SDK port (third language)** · 5 protocols · 271 tests · ≥ 98% coverage
|
|
11
|
+
|
|
12
|
+
> npm registry note: `@labacacia/nps-sdk@1.0.0-alpha.11` was deprecated because its published tarball omitted `dist/`. That is fixed in `1.0.0-alpha.13` — install `@labacacia/nps-sdk@alpha` (the `alpha` dist-tag now resolves to `1.0.0-alpha.13`).
|
|
9
13
|
|
|
10
14
|
| Protocol | Class | Status |
|
|
11
15
|
|----------|-------|--------|
|
|
12
16
|
| NCP — Neural Communication Protocol | Framing, codec | ✅ |
|
|
13
17
|
| NWP — Neural Web Protocol | `NwpClient` | ✅ |
|
|
14
|
-
| NIP — Neural Identity Protocol | `NipIdentity` | ✅ |
|
|
18
|
+
| NIP — Neural Identity Protocol | `NipIdentity`, `NipIdentVerifier` (RFC-0002 §8.1 dual-trust), `AssuranceLevel` (RFC-0003), `nip.x509` + `nip.acme` | ✅ |
|
|
15
19
|
| NDP — Neural Discovery Protocol | `InMemoryNdpRegistry`, `NdpAnnounceValidator` | ✅ |
|
|
16
20
|
| NOP — Neural Orchestration Protocol | `NopClient` | ✅ |
|
|
17
21
|
|
|
22
|
+
**Earlier additions** — Full NPS-RFC-0002 X.509 + ACME `agent-01` NID certificate primitives:
|
|
23
|
+
|
|
24
|
+
- `nip.x509` — `issueLeaf` / `issueRoot` / `verify` (built on `@peculiar/x509` + native Web Crypto Ed25519).
|
|
25
|
+
- `nip.acme` — `AcmeClient` + in-process `AcmeServer` + JWS / message helpers (RFC 8555 + EdDSA per RFC 8037).
|
|
26
|
+
- `IdentFrame` extended with non-breaking `assuranceLevel` / `certFormat` / `certChain` constructor options; v1 verifiers ignore the new fields.
|
|
27
|
+
|
|
18
28
|
## Installation
|
|
19
29
|
|
|
20
30
|
```bash
|
|
21
|
-
npm install @labacacia/nps-sdk
|
|
31
|
+
npm install @labacacia/nps-sdk@alpha
|
|
22
32
|
```
|
|
23
33
|
|
|
24
|
-
> **Peer requirement:** Node.js
|
|
34
|
+
> **Peer requirement:** Node.js 22+
|
|
25
35
|
|
|
26
36
|
## Quick Start
|
|
27
37
|
|
|
@@ -101,7 +111,7 @@ console.log(status.state, status.aggregatedResult);
|
|
|
101
111
|
```typescript
|
|
102
112
|
import { ... } from "@labacacia/nps-sdk"; // everything
|
|
103
113
|
import { ... } from "@labacacia/nps-sdk/core"; // codec, frames, registry, cache
|
|
104
|
-
import { ... } from "@labacacia/nps-sdk/ncp"; // AnchorFrame, CapsFrame, StreamFrame, …
|
|
114
|
+
import { ... } from "@labacacia/nps-sdk/ncp"; // AnchorFrame, CapsFrame, StreamFrame, HelloFrame, …
|
|
105
115
|
import { ... } from "@labacacia/nps-sdk/nwp"; // NwpClient, QueryFrame, ActionFrame
|
|
106
116
|
import { ... } from "@labacacia/nps-sdk/nip"; // NipIdentity, IdentFrame, TrustFrame, RevokeFrame
|
|
107
117
|
import { ... } from "@labacacia/nps-sdk/ndp"; // InMemoryNdpRegistry, NdpAnnounceValidator, AnnounceFrame, …
|
|
@@ -150,4 +160,4 @@ node node_modules/tsup/dist/cli-default.js
|
|
|
150
160
|
|
|
151
161
|
## License
|
|
152
162
|
|
|
153
|
-
Apache 2.0 — see [LICENSE](
|
|
163
|
+
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
|
package/dist/core/cache.d.ts
CHANGED
|
File without changes
|
package/dist/core/cache.d.ts.map
CHANGED
|
File without changes
|
package/dist/core/cache.js
CHANGED
|
File without changes
|
package/dist/core/cache.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|