@opencode/schema 0.0.0-dev-1361 → 0.0.0-dev-1362

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/dist/space.d.ts CHANGED
@@ -7,7 +7,7 @@ export type Key = typeof Key.Type;
7
7
  /** An opaque string the server stores and sends back unchanged; its format, such as JSON text, is up to the client. */
8
8
  export declare const Value: Schema.String;
9
9
  export type Value = typeof Value.Type;
10
- /** A value always goes out as one event, so a write is capped at 1 MiB of UTF-8. */
10
+ /** A value always goes out as one event, so a write's values are capped at 1 MiB of UTF-8 in total. */
11
11
  export declare const MaxValueBytes: number;
12
12
  export interface Entry extends Schema.Schema.Type<typeof Entry> {
13
13
  }
@@ -15,6 +15,18 @@ export declare const Entry: Schema.Struct<{
15
15
  readonly key: Schema.String;
16
16
  readonly value: Schema.String;
17
17
  }>;
18
+ /** One change of a write: a value sets the space's key, `null` deletes it. */
19
+ export interface Change extends Schema.Schema.Type<typeof Change> {
20
+ }
21
+ export declare const Change: Schema.Struct<{
22
+ readonly space: Schema.String;
23
+ readonly key: Schema.String;
24
+ readonly value: Schema.NullOr<Schema.String>;
25
+ }>;
26
+ /** Changes one write commits at most, across all its spaces. */
27
+ export declare const MaxChanges = 1024;
28
+ /** Spaces one sync, subscribe or unsubscribe names at most. */
29
+ export declare const MaxSpaces = 100;
18
30
  /** Server-issued, per space: every write in a space gets the next revision, and revisions are never reused. */
19
31
  export declare const Revision: Schema.Int;
20
32
  export type Revision = typeof Revision.Type;
@@ -22,7 +34,10 @@ export type Revision = typeof Revision.Type;
22
34
  export declare const Epoch: Schema.String;
23
35
  /** An opaque position in a space, issued by the server. Clients save a page's `cursor` and pass back `next` as is. */
24
36
  export declare const Cursor: Schema.String;
25
- /** A sync page that replaces everything the client held for the space. */
37
+ /**
38
+ * A page of a snapshot, which replaces everything the client held for the space: its entries apply at once, and keys
39
+ * none of the snapshot's pages held are removed after its last one.
40
+ */
26
41
  export interface Snapshot extends Schema.Schema.Type<typeof Snapshot> {
27
42
  }
28
43
  export declare const Snapshot: Schema.Struct<{
package/dist/space.js CHANGED
@@ -11,9 +11,16 @@ export const Key = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength
11
11
  });
12
12
  /** An opaque string the server stores and sends back unchanged; its format, such as JSON text, is up to the client. */
13
13
  export const Value = Schema.String.annotate({ identifier: "Space.Value" });
14
- /** A value always goes out as one event, so a write is capped at 1 MiB of UTF-8. */
14
+ /** A value always goes out as one event, so a write's values are capped at 1 MiB of UTF-8 in total. */
15
15
  export const MaxValueBytes = 1024 * 1024;
16
16
  export const Entry = Schema.Struct({ key: Key, value: Value }).annotate({ identifier: "Space.Entry" });
17
+ export const Change = Schema.Struct({ space: Name, key: Key, value: Schema.NullOr(Value) }).annotate({
18
+ identifier: "Space.Change",
19
+ });
20
+ /** Changes one write commits at most, across all its spaces. */
21
+ export const MaxChanges = 1024;
22
+ /** Spaces one sync, subscribe or unsubscribe names at most. */
23
+ export const MaxSpaces = 100;
17
24
  /** Server-issued, per space: every write in a space gets the next revision, and revisions are never reused. */
18
25
  export const Revision = NonNegativeInt.annotate({ identifier: "Space.Revision" });
19
26
  /** Identifies the database that issued a space's revisions; a revision is only usable with the same epoch. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "0.0.0-dev-1361",
4
+ "version": "0.0.0-dev-1362",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {