@byok-sdk/core 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.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Presence and activity hints (§12.3).
2
+ * Presence hints (§12.3).
3
3
  *
4
- * Both are lossy, TTL-bounded, unsigned, and never authoritative. Expiry means
4
+ * Presence is lossy, TTL-bounded, unsigned, and never authoritative. Expiry means
5
5
  * *absence*, not a stale value: a hint past its TTL is invisible to readers, so
6
6
  * nothing downstream can mistake an old level for a live one.
7
7
  *
@@ -12,9 +12,6 @@
12
12
  * names. A device that looks busy is not evidence that any particular work item
13
13
  * moved anywhere.
14
14
  *
15
- * The activity tail is bounded by count and carries an explicit `dropped`
16
- * counter: lossiness is written into the data instead of being hidden behind a
17
- * stream that pretends to be complete.
18
15
  */
19
16
  import type { TenantId } from './tenant';
20
17
  /** The five presence levels. */
@@ -47,36 +44,6 @@ export interface PresenceHintInput {
47
44
  /** Minimum time between accepted publications for this device. `0` explicitly disables throttling. */
48
45
  readonly minimumIntervalMs: number;
49
46
  }
50
- /** One entry of a task's lossy tail. */
51
- export interface ActivityEntry {
52
- readonly at: string;
53
- readonly detail: string;
54
- }
55
- /**
56
- * A task's bounded tail.
57
- *
58
- * `dropped` counts entries evicted by `capacity`, so a reader can tell the
59
- * difference between "nothing happened" and "we lost the middle".
60
- */
61
- export interface ActivityTail {
62
- readonly tenantId: TenantId;
63
- readonly taskId: string;
64
- readonly entries: readonly ActivityEntry[];
65
- readonly dropped: number;
66
- readonly capacity: number;
67
- readonly expiresAt: string;
68
- }
69
- export interface ActivityAppendInput {
70
- readonly taskId: string;
71
- /** One ProgressBatcher-shaped batch. Empty batches are rejected. */
72
- readonly details: readonly string[];
73
- /** Events the producer dropped before this batch reached the store. */
74
- readonly dropped: number;
75
- /** Tail lifetime. §12.7.5 suggests 5-15 minutes for activity. */
76
- readonly ttlMs: number;
77
- /** Maximum retained entries. Must be a positive integer. */
78
- readonly capacity?: number;
79
- }
80
47
  /**
81
48
  * Presence port. Tenant-first, async.
82
49
  *
@@ -88,16 +55,3 @@ export interface PresenceStore {
88
55
  read(tenant: TenantId, deviceId: string): Promise<PresenceHint | undefined>;
89
56
  list(tenant: TenantId): Promise<readonly PresenceHint[]>;
90
57
  }
91
- /**
92
- * Activity port. Tenant-first, async.
93
- *
94
- * Raises: `activity_capacity_invalid` (non-positive or non-integer capacity —
95
- * an unbounded tail is exactly what this contract exists to prevent),
96
- * `activity_batch_invalid` (empty batch or invalid producer drop count).
97
- */
98
- export interface ActivityStore {
99
- append(tenant: TenantId, input: ActivityAppendInput): Promise<ActivityTail>;
100
- read(tenant: TenantId, taskId: string): Promise<ActivityTail | undefined>;
101
- }
102
- /** Default tail capacity when an append does not specify one. */
103
- export declare const DEFAULT_ACTIVITY_CAPACITY = 50;
package/dist/stores.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  * omission: "move this to another tenant" is the one operation that would make
18
18
  * every cross-tenant assertion in the conformance suite unfalsifiable.
19
19
  */
20
- import type { ActivityStore, PresenceStore } from './presence';
20
+ import type { PresenceStore } from './presence';
21
21
  import type { BoardStore } from './board';
22
22
  import type { MailboxStore } from './mailbox';
23
23
  import type { ObjectStore } from './blob';
@@ -27,7 +27,7 @@ import type { TruthStore } from './truth';
27
27
  /**
28
28
  * Injected time.
29
29
  *
30
- * TTL semantics (presence expiry, activity expiry, reservation expiry) are
30
+ * TTL semantics (presence expiry and reservation expiry) are
31
31
  * behavior the conformance suite has to assert deterministically, which is
32
32
  * impossible against a wall clock. Compositions inject one; nothing in core
33
33
  * calls `Date.now()` directly.
@@ -46,7 +46,6 @@ export interface CoreStores {
46
46
  readonly board: BoardStore;
47
47
  readonly truth: TruthStore;
48
48
  readonly presence: PresenceStore;
49
- readonly activity: ActivityStore;
50
49
  readonly objects: ObjectStore;
51
50
  readonly quota: QuotaStore;
52
51
  /**
@@ -59,5 +58,5 @@ export interface CoreStores {
59
58
  readonly skillPacks: SkillPackStore;
60
59
  }
61
60
  /** Names of the ports in {@link CoreStores}, in contract order. */
62
- export declare const CORE_STORE_NAMES: readonly ['mailbox', 'board', 'truth', 'presence', 'activity', 'objects', 'quota', 'skillPacks'];
61
+ export declare const CORE_STORE_NAMES: readonly ['mailbox', 'board', 'truth', 'presence', 'objects', 'quota', 'skillPacks'];
63
62
  export type CoreStoreName = (typeof CORE_STORE_NAMES)[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "BYOK SDK platform contracts: branded tenant identity, tenant-first store ports, device proof canonicalization, and the composition conformance reference",
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,9 +35,6 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "dependencies": {
39
- "zod": "^4.4.3"
40
- },
41
38
  "scripts": {
42
39
  "build": "tsup && tsc -p tsconfig.build.json",
43
40
  "dev": "tsup --watch",
@@ -45,5 +42,8 @@
45
42
  "test:watch": "vitest",
46
43
  "typecheck": "tsc --noEmit",
47
44
  "clean": "rm -rf dist"
45
+ },
46
+ "dependencies": {
47
+ "zod": "^4.4.3"
48
48
  }
49
- }
49
+ }