@ccmsg/protocol 1.21.0 โ†’ 1.22.1

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 CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  > ๐Ÿ‡ฏ๐Ÿ‡ต [README-ja.md](./README-ja.md)
4
4
 
5
- The **contract of record** shared by the ccmsg daemon and its web UI. It holds the shape of
6
- every op, event, error code and identifier as a schema, and both sides validate against it.
5
+ The **contract of record** shared by the ccmsg daemon and its web UI. It holds the shape of every op, event, error code and identifier as a schema, and both sides validate against it.
7
6
 
8
- The contract is decided here and the daemon and web UI follow it. Neither side learns the
9
- other's internals by any route that does not pass through it.
7
+ The contract is decided here and the daemon and web UI follow it. Neither side learns the other's internals by any route that does not pass through it.
8
+
9
+ It covers 48 ops over four planes (common, messaging, control, mesh), 13 topics that are each a snapshot plus a stream of changes, one closed union of 21 error codes, and the op attribute table that authorization, capability gating and forwarding all read.
10
10
 
11
11
  ## Install
12
12
 
@@ -24,9 +24,11 @@ OP_ATTRIBUTES["message.send"].roles; // authorization reads the table, not a bra
24
24
  opErrors("session.rename"); // the codes this op may answer with
25
25
  ```
26
26
 
27
+ `@ccmsg/protocol/fixtures` is a second entry point holding a representative JSON of the real wire for every request, reply and topic frame. An implementation's tests read them from here rather than keeping a copy that goes stale.
28
+
27
29
  ## Documentation
28
30
 
29
- - [DESIGN.md](./docs/DESIGN.md) โ€” layers, planes, the op attribute table, and the conventions
31
+ - [DESIGN.md](./docs/DESIGN.md) โ€” the layers, the four planes, the op attribute table, how topics are folded, the item types a transcript is read into, instances and mesh, authenticating a person, and the naming conventions
30
32
 
31
33
  ## License
32
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccmsg/protocol",
3
- "version": "1.21.0",
3
+ "version": "1.22.1",
4
4
  "description": "Wire contract (schema + types + op attribute table) shared by the ccmsg daemon and web UI",
5
5
  "license": "MIT",
6
6
  "author": "kawaz",
package/src/attributes.ts CHANGED
@@ -19,10 +19,10 @@ export interface OpAttributes {
19
19
  readonly roles: readonly Role[];
20
20
  /** Whether the op requires an identity settled by a greeting.
21
21
  *
22
- * On a WebSocket connection the ops that may arrive before one are the three
23
- * greetings and `instance.ping` โ€” a reachability check answers about the
24
- * instance and not about the caller, so there is no identity for it to want.
25
- * The ops carried over HTTP answer before any connection exists, which is
22
+ * On a WebSocket connection the only ops that may arrive before one are the
23
+ * three greetings: a caller that will not say who it is has nothing to be
24
+ * answered, and whether the instance is there is already known once the
25
+ * connection was made. The ops carried over HTTP answer before any connection exists, which is
26
26
  * what `carrier` says; `needs_hello` is false on them because there is no
27
27
  * greeting to have sent, not because they are open on a settled one. */
28
28
  readonly needs_hello: boolean;
@@ -90,7 +90,7 @@ export const OP_ATTRIBUTES = {
90
90
  "instance.ping": {
91
91
  plane: "common",
92
92
  roles: ALL_ROLES,
93
- needs_hello: false,
93
+ needs_hello: true,
94
94
  locality: "cluster",
95
95
  errors: [],
96
96
  },
@@ -7,7 +7,8 @@ import { SessionMetaFields } from "../session-meta.ts";
7
7
  *
8
8
  * It is not signed and proves nothing on its own: it names the peer and says
9
9
  * where its one-off key can be fetched. The proof that binds this connection to
10
- * `iss` follows on a separate exchange (mesh-peer-auth ยง5). */
10
+ * `iss` follows on a separate exchange (the daemon's mesh peer authentication
11
+ * decision). */
11
12
  export const MeshHello = Type.Object(
12
13
  {
13
14
  /** Generation of the mesh handshake format, apart from the protocol
package/src/errors.ts CHANGED
@@ -27,7 +27,7 @@ export const ERROR_CODES = [
27
27
  * in their `errors`, since only an op that queues for a reader has a queue to
28
28
  * fill. */
29
29
  "rate_limited",
30
- // --- rule-derived (op attribute table ยง0) ---
30
+ // --- rule-derived (op attribute table) ---
31
31
  /** The connection's role is outside the op's `roles`. Argument problems stay
32
32
  * on `invalid_args` / `bad_request`. */
33
33
  "forbidden",
@@ -55,7 +55,7 @@ export type InstanceId = Static<typeof InstanceId>;
55
55
  * identifies where an instance lives changing with it, and what lets the HTTP
56
56
  * routes be spelled without stripping a suffix off first.
57
57
  *
58
- * Compared as a whole string, path included (mesh-peer-auth ยง4.2 โ€” one origin
58
+ * Compared as a whole string, path included (one origin
59
59
  * may host several instances, so an origin-level comparison would confuse
60
60
  * them). The trailing slash is required so that comparison is exact: `/ccmsg`
61
61
  * and `/ccmsg/` would otherwise be two spellings of one instance.