@byok-sdk/cloud 0.2.0 → 0.3.0
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 +18 -0
- package/dist/auth/verify.d.ts +1 -20
- package/dist/capabilities.d.ts +18 -0
- package/dist/cloud.d.ts +19 -2
- package/dist/composition/in-memory.d.ts +9 -1
- package/dist/errors.d.ts +3 -5
- package/dist/handlers/skill-packs.d.ts +33 -0
- package/dist/handlers/truth.d.ts +2 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +149 -84
- package/dist/index.js.map +1 -1
- package/dist/stores/in-memory/index.d.ts +0 -1
- package/dist/stores/ports.d.ts +1 -16
- package/dist/tenant-stores.d.ts +0 -4
- package/package.json +3 -3
- package/dist/stores/in-memory/sequence.d.ts +0 -11
|
@@ -14,7 +14,6 @@ export { BLOB_URL_TTL_MS, InMemoryBlobContentProxy, InMemoryCloudBlobStore, crea
|
|
|
14
14
|
export type { InMemoryBlobs, InMemoryBlobStoreOptions } from './blobs';
|
|
15
15
|
export { DEDUP_RING_CAPACITY, InMemoryInboundDedupStore } from './dedup';
|
|
16
16
|
export { InMemoryDeviceDirectory } from './device-directory';
|
|
17
|
-
export { InMemoryDeviceSequenceStore } from './sequence';
|
|
18
17
|
export { InMemoryNonceStore, NONCE_TTL_MS } from './nonces';
|
|
19
18
|
export { InMemoryPairingCodeStore } from './pairing-codes';
|
|
20
19
|
export { InMemoryRequestReceiptStore } from './receipts';
|
package/dist/stores/ports.d.ts
CHANGED
|
@@ -191,20 +191,6 @@ export interface ProofRequestReceiptStore {
|
|
|
191
191
|
}>;
|
|
192
192
|
get(tenant: TenantId, deviceId: string, requestId: string): Promise<ProofRequestReceipt | undefined>;
|
|
193
193
|
}
|
|
194
|
-
/**
|
|
195
|
-
* The daemon's redelivery cursor is the envelope-level `seq`, which has to be
|
|
196
|
-
* baked into the envelope BEFORE it can be handed to `MailboxStore.append` —
|
|
197
|
-
* the mailbox transports opaque bytes and cannot number an envelope it is
|
|
198
|
-
* being given. So the delivery number is allocated here first, and the
|
|
199
|
-
* enqueue path then asserts the mailbox agreed (`mailbox_seq_mismatch`)
|
|
200
|
-
* rather than letting two counters drift apart silently.
|
|
201
|
-
*
|
|
202
|
-
* A port rather than a counter held by the composition, so no handler-adjacent
|
|
203
|
-
* module carries mutable state (S3.5 boxes 14-15).
|
|
204
|
-
*/
|
|
205
|
-
export interface DeviceSequenceStore {
|
|
206
|
-
next(tenant: TenantId, deviceId: string): Promise<number>;
|
|
207
|
-
}
|
|
208
194
|
export interface BlobDeclaration {
|
|
209
195
|
readonly size: number;
|
|
210
196
|
readonly contentType: string;
|
|
@@ -300,10 +286,9 @@ export interface CloudStores {
|
|
|
300
286
|
readonly tasks: TaskAttemptStore;
|
|
301
287
|
readonly receipts: RequestReceiptStore;
|
|
302
288
|
readonly proofReceipts: ProofRequestReceiptStore;
|
|
303
|
-
readonly sequence: DeviceSequenceStore;
|
|
304
289
|
readonly blobs: CloudBlobStore;
|
|
305
290
|
readonly rateLimiter: InboundRateLimiter;
|
|
306
291
|
}
|
|
307
292
|
/** Names of the ports in {@link CloudStores}, in contract order. */
|
|
308
|
-
export declare const CLOUD_STORE_NAMES: readonly ['devices', 'pairingCodes', 'nonces', 'dedup', 'tasks', 'receipts', 'proofReceipts', '
|
|
293
|
+
export declare const CLOUD_STORE_NAMES: readonly ['devices', 'pairingCodes', 'nonces', 'dedup', 'tasks', 'receipts', 'proofReceipts', 'blobs', 'rateLimiter'];
|
|
309
294
|
export type CloudStoreName = (typeof CLOUD_STORE_NAMES)[number];
|
package/dist/tenant-stores.d.ts
CHANGED
|
@@ -94,9 +94,6 @@ export interface TenantBoundQuota {
|
|
|
94
94
|
finalizeReservation(input: StorageFinalizeInput): Promise<StorageFinalizeResult>;
|
|
95
95
|
abortReservation(reservationId: string): Promise<StorageReservation>;
|
|
96
96
|
}
|
|
97
|
-
export interface TenantBoundSequence {
|
|
98
|
-
next(deviceId: string): Promise<number>;
|
|
99
|
-
}
|
|
100
97
|
export interface TenantBoundRateLimiter {
|
|
101
98
|
consume(deviceId: string): Promise<boolean>;
|
|
102
99
|
}
|
|
@@ -113,7 +110,6 @@ export interface TenantStores {
|
|
|
113
110
|
readonly receipts: TenantBoundReceipts;
|
|
114
111
|
readonly blobs: TenantBoundBlobs;
|
|
115
112
|
readonly quota: TenantBoundQuota;
|
|
116
|
-
readonly sequence: TenantBoundSequence;
|
|
117
113
|
readonly rateLimiter: TenantBoundRateLimiter;
|
|
118
114
|
}
|
|
119
115
|
/** Every naked store a composition supplies. Only {@link tenantStoresFor} reads this. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byok-sdk/cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "BYOK SDK hosted device surface: stateless frozen-v1 HTTP handlers over tenant-first @byok-sdk/core ports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"hono": "^4.12.30",
|
|
40
40
|
"zod": "^4.4.3",
|
|
41
|
-
"@byok-sdk/
|
|
42
|
-
"@byok-sdk/
|
|
41
|
+
"@byok-sdk/core": "0.3.0",
|
|
42
|
+
"@byok-sdk/protocol": "0.3.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsup && tsc -p tsconfig.build.json",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory {@link DeviceSequenceStore}: a monotonic per-(tenant, device)
|
|
3
|
-
* delivery counter starting at 1, matching what a mailbox numbers its first
|
|
4
|
-
* row.
|
|
5
|
-
*/
|
|
6
|
-
import { type TenantId } from '@byok-sdk/core';
|
|
7
|
-
import type { DeviceSequenceStore } from '../ports';
|
|
8
|
-
export declare class InMemoryDeviceSequenceStore implements DeviceSequenceStore {
|
|
9
|
-
#private;
|
|
10
|
-
next(tenant: TenantId, deviceId: string): Promise<number>;
|
|
11
|
-
}
|