@opendatalabs/vana-sdk 3.22.0 → 3.23.0-pr.211.3227174
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/README.md +57 -0
- package/dist/auth/errors.cjs +1 -1
- package/dist/auth/web3-signed.cjs +1 -1
- package/dist/crypto/envelope/job-stream.test.d.ts +1 -0
- package/dist/crypto/envelope/job.cjs +818 -0
- package/dist/crypto/envelope/job.cjs.map +1 -0
- package/dist/crypto/envelope/job.d.ts +139 -0
- package/dist/crypto/envelope/job.js +792 -0
- package/dist/crypto/envelope/job.js.map +1 -0
- package/dist/direct/access-request-client.cjs +5 -1
- package/dist/direct/access-request-client.cjs.map +1 -1
- package/dist/direct/access-request-client.js +4 -0
- package/dist/direct/access-request-client.js.map +1 -1
- package/dist/direct/connect-flow.cjs +43 -1
- package/dist/direct/connect-flow.cjs.map +1 -1
- package/dist/direct/connect-flow.d.ts +12 -0
- package/dist/direct/connect-flow.js +43 -1
- package/dist/direct/connect-flow.js.map +1 -1
- package/dist/direct/controller.cjs +1 -1
- package/dist/direct/errors.cjs +1 -1
- package/dist/direct/personal-server-read.cjs +2 -2
- package/dist/direct/types.cjs.map +1 -1
- package/dist/direct/types.d.ts +7 -0
- package/dist/direct/types.js.map +1 -1
- package/dist/direct/use-direct-vana-connect.cjs +2 -1
- package/dist/direct/use-direct-vana-connect.cjs.map +1 -1
- package/dist/direct/use-direct-vana-connect.d.ts +3 -1
- package/dist/direct/use-direct-vana-connect.js +2 -1
- package/dist/direct/use-direct-vana-connect.js.map +1 -1
- package/dist/error-entry-points.test.d.ts +1 -0
- package/dist/errors.cjs +84 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +133 -0
- package/dist/errors.js +73 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.browser.d.ts +3 -0
- package/dist/index.browser.js +1143 -434
- package/dist/index.browser.js.map +4 -4
- package/dist/index.node.cjs +1801 -631
- package/dist/index.node.cjs.map +4 -4
- package/dist/index.node.d.ts +4 -0
- package/dist/index.node.js +1762 -522
- package/dist/index.node.js.map +4 -4
- package/dist/protocol/data-point-deletion.cjs +1 -1
- package/dist/protocol/derivative-questions.cjs +1 -1
- package/dist/protocol/derivative-status.cjs +1 -1
- package/dist/protocol/fixtures/moksha-identity.json +20 -0
- package/dist/protocol/gateway.cjs +1 -1
- package/dist/protocol/identity.cjs +224 -0
- package/dist/protocol/identity.cjs.map +1 -0
- package/dist/protocol/identity.d.ts +193 -0
- package/dist/protocol/identity.js +188 -0
- package/dist/protocol/identity.js.map +1 -0
- package/dist/protocol/identity.test.d.ts +1 -0
- package/dist/protocol/identity.vector.test.d.ts +1 -0
- package/dist/protocol/jobs-client.cjs +551 -0
- package/dist/protocol/jobs-client.cjs.map +1 -0
- package/dist/protocol/jobs-client.d.ts +169 -0
- package/dist/protocol/jobs-client.js +558 -0
- package/dist/protocol/jobs-client.js.map +1 -0
- package/dist/protocol/jobs-client.test.d.ts +1 -0
- package/dist/protocol/jobs.cjs +64 -0
- package/dist/protocol/jobs.cjs.map +1 -0
- package/dist/protocol/jobs.d.ts +193 -0
- package/dist/protocol/jobs.js +31 -0
- package/dist/protocol/jobs.js.map +1 -0
- package/dist/protocol/jobs.test.d.ts +1 -0
- package/dist/protocol/lineage.cjs +1 -1
- package/dist/protocol/personal-server-data.cjs +1 -1
- package/dist/protocol/personal-server-write.cjs +1 -1
- package/dist/protocol/write-request.cjs +1 -1
- package/dist/protocol/write-signer.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js.map +1 -1
- package/dist/session-relay/client.cjs +1 -1
- package/dist/session-relay/errors.cjs +1 -1
- package/dist/session-relay/index.cjs +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -92,6 +92,63 @@ const decrypted = await ecies.decrypt(recipientPrivateKey, encrypted);
|
|
|
92
92
|
|
|
93
93
|
The browser entry exposes the same surface as `BrowserECIESProvider`.
|
|
94
94
|
|
|
95
|
+
### Sealed job result format v2
|
|
96
|
+
|
|
97
|
+
Job result objects use a hybrid envelope so the enclave can encrypt large bodies
|
|
98
|
+
without retaining a plaintext-sized ECIES intermediate. The Node and browser
|
|
99
|
+
entries export `sealJobResultStream` and `openJobResultStream`; the existing
|
|
100
|
+
buffered `sealJobResult` and `openJobResult` APIs drive the same format for
|
|
101
|
+
callers that already hold the complete body.
|
|
102
|
+
|
|
103
|
+
All integers below are unsigned big-endian. The stored object is:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
uint8 formatVersion (= 2)
|
|
107
|
+
uint32 wrappedKeyLength
|
|
108
|
+
wrappedKey[wrappedKeyLength]
|
|
109
|
+
frame[0] || frame[1] || ... || finalFrame
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`wrappedKey` uses the existing ECIES wire encoding
|
|
113
|
+
`iv(16) || ephemeralPublicKey(65) || ciphertext || mac(32)`. Its authenticated
|
|
114
|
+
plaintext is:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
contentKey(32) || noncePrefix(12) || uint32 metadataLength || metadata JSON
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The metadata JSON is canonical (recursively key-sorted), capped at 4 KiB, and
|
|
121
|
+
contains exactly `v`, `jobId`, `scope`, `version`, and `contentType`. Each body
|
|
122
|
+
frame is:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
uint32 encryptedLength || uint8 flags || AES-GCM ciphertext || tag(16)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The only defined flag is bit value `0x01`, which marks the final frame.
|
|
129
|
+
Non-final plaintext chunks are exactly 1 MiB; the final chunk is 0 through
|
|
130
|
+
1 MiB, so an empty result still has one authenticated final frame. AES-256-GCM
|
|
131
|
+
uses the wrapped content key. A chunk nonce is the 12-byte nonce prefix with
|
|
132
|
+
its final big-endian uint32 XORed with the zero-based chunk index.
|
|
133
|
+
|
|
134
|
+
Every frame authenticates this AAD:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
uint8 formatVersion
|
|
138
|
+
|| uint32 metadataLength
|
|
139
|
+
|| metadata JSON
|
|
140
|
+
|| uint32 chunkIndex
|
|
141
|
+
|| uint8 flags
|
|
142
|
+
|| uint32 plaintextLength
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The metadata, index, final marker, and length therefore cannot be changed, and
|
|
146
|
+
frames cannot be reordered, omitted, or appended without authentication
|
|
147
|
+
failing. The streaming sealer retains only fixed-size chunk buffers regardless
|
|
148
|
+
of total payload size; a local 50 MiB probe measured about 5 MiB of peak
|
|
149
|
+
`arrayBuffers` growth, versus the payload-sized plaintext, ciphertext, and
|
|
150
|
+
ECIES intermediates required by the previous buffered format.
|
|
151
|
+
|
|
95
152
|
### Upload a file via the storage manager
|
|
96
153
|
|
|
97
154
|
```typescript
|
package/dist/auth/errors.cjs
CHANGED
|
@@ -23,7 +23,7 @@ __export(errors_exports, {
|
|
|
23
23
|
MissingAuthError: () => MissingAuthError
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(errors_exports);
|
|
26
|
-
var import_errors = require("../errors");
|
|
26
|
+
var import_errors = require("../errors.cjs");
|
|
27
27
|
class MissingAuthError extends import_errors.VanaError {
|
|
28
28
|
constructor(message = "Missing authentication", details) {
|
|
29
29
|
super(message, "MISSING_AUTH");
|
|
@@ -24,7 +24,7 @@ __export(web3_signed_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(web3_signed_exports);
|
|
25
25
|
var import_viem = require("viem");
|
|
26
26
|
var import_encoding = require("../utils/encoding");
|
|
27
|
-
var import_errors = require("./errors");
|
|
27
|
+
var import_errors = require("./errors.cjs");
|
|
28
28
|
var import_web3_signed_builder = require("./web3-signed-builder");
|
|
29
29
|
const WEB3_SIGNED_PREFIX = "Web3Signed ";
|
|
30
30
|
const CLOCK_SKEW_SECONDS = 60;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|