@byok-sdk/cloud 0.4.0 → 0.4.2

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.
@@ -0,0 +1,9 @@
1
+ import type { Clock, TenantId } from '@byok-sdk/core';
2
+ import { type ActivityAppendInput, type ActivityStore, type ActivityTail } from '../../activity';
3
+ export declare class InMemoryActivityStore implements ActivityStore {
4
+ #private;
5
+ private readonly clock;
6
+ constructor(clock: Clock);
7
+ append(tenant: TenantId, input: ActivityAppendInput): Promise<ActivityTail>;
8
+ read(tenant: TenantId, taskId: string): Promise<ActivityTail | undefined>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Clock, TenantId } from '@byok-sdk/core';
2
+ import { type ApprovalTimelineAppendInput, type ApprovalTimelineStore, type ApprovalTimelineTail } from '../../approval-timeline';
3
+ export declare class InMemoryApprovalTimelineStore implements ApprovalTimelineStore {
4
+ #private;
5
+ private readonly clock;
6
+ constructor(clock: Clock);
7
+ append(tenant: TenantId, input: ApprovalTimelineAppendInput): Promise<ApprovalTimelineTail>;
8
+ read(tenant: TenantId, taskId: string): Promise<ApprovalTimelineTail | undefined>;
9
+ }
@@ -19,6 +19,8 @@ export { InMemoryPairingCodeStore } from './pairing-codes';
19
19
  export { InMemoryRequestReceiptStore } from './receipts';
20
20
  export { InMemoryProofRequestReceiptStore } from './proof-receipts';
21
21
  export { InMemoryTaskAttemptStore } from './task-attempts';
22
+ export { InMemoryActivityStore } from './activity';
23
+ export { InMemoryApprovalTimelineStore } from './approval-timeline';
22
24
  /**
23
25
  * The port bundle plus the byte proxy, in the shape `createInMemoryCoreStores`
24
26
  * already uses: the composition is an object with a `stores` field, not the
@@ -35,6 +35,8 @@
35
35
  * bytes (see the blobs section below).
36
36
  */
37
37
  import type { StorageReservation, TenantId } from '@byok-sdk/core';
38
+ import type { ActivityStore } from '../activity';
39
+ import type { ApprovalTimelineStore } from '../approval-timeline';
38
40
  export interface DeviceRecord {
39
41
  readonly tenantId: TenantId;
40
42
  readonly productId: string;
@@ -279,6 +281,8 @@ export interface InboundRateLimiter {
279
281
  * bundle can stay all-or-nothing while byte proxying stays optional.
280
282
  */
281
283
  export interface CloudStores {
284
+ readonly activity: ActivityStore;
285
+ readonly approvals: ApprovalTimelineStore;
282
286
  readonly devices: DeviceDirectory;
283
287
  readonly pairingCodes: PairingCodeStore;
284
288
  readonly nonces: NonceStore;
@@ -289,6 +293,6 @@ export interface CloudStores {
289
293
  readonly blobs: CloudBlobStore;
290
294
  readonly rateLimiter: InboundRateLimiter;
291
295
  }
292
- /** Names of the ports in {@link CloudStores}, in contract order. */
293
- export declare const CLOUD_STORE_NAMES: readonly ['devices', 'pairingCodes', 'nonces', 'dedup', 'tasks', 'receipts', 'proofReceipts', 'blobs', 'rateLimiter'];
296
+ /** Names of every port in {@link CloudStores}, in contract order. */
297
+ export declare const CLOUD_STORE_NAMES: readonly ['activity', 'approvals', 'devices', 'pairingCodes', 'nonces', 'dedup', 'tasks', 'receipts', 'proofReceipts', 'blobs', 'rateLimiter'];
294
298
  export type CloudStoreName = (typeof CLOUD_STORE_NAMES)[number];
@@ -21,7 +21,9 @@
21
21
  * presigned blob calls) are deliberately absent from this surface: a
22
22
  * device-facing handler must not be able to reach them.
23
23
  */
24
- import { type ActivityAppendInput, type ActivityTail, type BoardClaimInput, type BoardItem, type BoardItemInput, type BoardListQuery, type BoardPage, type BoardStatusUpdateInput, type BoardUnclaimInput, type CoreStores, type MailboxAdvanceCursorInput, type MailboxAppendInput, type MailboxCursorState, type MailboxMessage, type MailboxPage, type MailboxReadQuery, type Principal, type PresenceHint, type PresenceHintInput, type StorageFinalizeInput, type StorageFinalizeResult, type StorageReservation, type StorageReservationInput, type TenantId } from '@byok-sdk/core';
24
+ import { type BoardClaimInput, type BoardItem, type BoardItemInput, type BoardListQuery, type BoardPage, type BoardStatusUpdateInput, type BoardUnclaimInput, type CoreStores, type MailboxAdvanceCursorInput, type MailboxAppendInput, type MailboxCursorState, type MailboxMessage, type MailboxPage, type MailboxReadQuery, type Principal, type PresenceHint, type PresenceHintInput, type StorageFinalizeInput, type StorageFinalizeResult, type StorageReservation, type StorageReservationInput, type TenantId } from '@byok-sdk/core';
25
+ import type { ActivityAppendInput, ActivityTail } from './activity';
26
+ import type { ApprovalTimelineAppendInput, ApprovalTimelineTail } from './approval-timeline';
25
27
  import type { BlobObservation, CloudStores, DeviceRecord, RequestReceipt, TaskAttempt, TaskAttemptStatus } from './stores/ports';
26
28
  export interface TenantBoundMailbox {
27
29
  append(input: MailboxAppendInput): Promise<MailboxMessage>;
@@ -47,6 +49,10 @@ export interface TenantBoundActivity {
47
49
  append(input: ActivityAppendInput): Promise<ActivityTail>;
48
50
  read(taskId: string): Promise<ActivityTail | undefined>;
49
51
  }
52
+ export interface TenantBoundApprovalTimeline {
53
+ append(input: ApprovalTimelineAppendInput): Promise<ApprovalTimelineTail>;
54
+ read(taskId: string): Promise<ApprovalTimelineTail | undefined>;
55
+ }
50
56
  export interface TenantBoundDevices {
51
57
  get(deviceId: string): Promise<DeviceRecord | undefined>;
52
58
  list(): Promise<readonly DeviceRecord[]>;
@@ -104,6 +110,7 @@ export interface TenantStores {
104
110
  readonly board: TenantBoundBoard;
105
111
  readonly presence: TenantBoundPresence;
106
112
  readonly activity: TenantBoundActivity;
113
+ readonly approvals: TenantBoundApprovalTimeline;
107
114
  readonly devices: TenantBoundDevices;
108
115
  readonly tasks: TenantBoundTaskAttempts;
109
116
  readonly dedup: TenantBoundDedup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/cloud",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
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",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "homepage": "https://github.com/Ancienttwo/byok-sdk#readme",
16
16
  "engines": {
17
- "node": ">=22.19.0"
17
+ "node": ">=22.22.0"
18
18
  },
19
19
  "sideEffects": false,
20
20
  "main": "./dist/index.js",
@@ -35,12 +35,6 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "dependencies": {
39
- "hono": "^4.12.30",
40
- "zod": "^4.4.3",
41
- "@byok-sdk/core": "0.4.0",
42
- "@byok-sdk/protocol": "0.4.0"
43
- },
44
38
  "scripts": {
45
39
  "build": "tsup && tsc -p tsconfig.build.json",
46
40
  "dev": "tsup --watch",
@@ -48,5 +42,11 @@
48
42
  "test:watch": "vitest",
49
43
  "typecheck": "tsc --noEmit",
50
44
  "clean": "rm -rf dist"
45
+ },
46
+ "dependencies": {
47
+ "@byok-sdk/core": "0.4.2",
48
+ "@byok-sdk/protocol": "0.4.2",
49
+ "hono": "^4.12.30",
50
+ "zod": "^4.4.3"
51
51
  }
52
- }
52
+ }