@moltzap/protocol 2026.503.4 → 2026.504.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/dist/brands.d.ts +11 -0
- package/dist/brands.d.ts.map +1 -0
- package/dist/brands.js +14 -0
- package/dist/brands.js.map +1 -0
- package/dist/helpers.d.ts +29 -26
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +34 -16
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/ajv.d.ts +5 -0
- package/dist/internal/ajv.d.ts.map +1 -0
- package/dist/internal/ajv.js +22 -0
- package/dist/internal/ajv.js.map +1 -0
- package/dist/notification.d.ts +14 -0
- package/dist/notification.d.ts.map +1 -0
- package/dist/notification.js +11 -0
- package/dist/notification.js.map +1 -0
- package/dist/rpc-errors.d.ts +30 -0
- package/dist/rpc-errors.d.ts.map +1 -0
- package/dist/rpc-errors.js +23 -0
- package/dist/rpc-errors.js.map +1 -0
- package/dist/rpc-groups.d.ts +120 -0
- package/dist/rpc-groups.d.ts.map +1 -0
- package/dist/rpc-groups.js +131 -0
- package/dist/rpc-groups.js.map +1 -0
- package/dist/rpc-registry.d.ts +1143 -203
- package/dist/rpc-registry.d.ts.map +1 -1
- package/dist/rpc-registry.js +11 -23
- package/dist/rpc-registry.js.map +1 -1
- package/dist/rpc.d.ts +26 -5
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +21 -11
- package/dist/rpc.js.map +1 -1
- package/dist/schema/apps.d.ts +13 -26
- package/dist/schema/apps.d.ts.map +1 -1
- package/dist/schema/apps.js +2 -13
- package/dist/schema/apps.js.map +1 -1
- package/dist/schema/contacts.d.ts +6 -2
- package/dist/schema/contacts.d.ts.map +1 -1
- package/dist/schema/conversations.d.ts +15 -5
- package/dist/schema/conversations.d.ts.map +1 -1
- package/dist/schema/delivery.d.ts +9 -3
- package/dist/schema/delivery.d.ts.map +1 -1
- package/dist/schema/errors.d.ts +0 -4
- package/dist/schema/errors.d.ts.map +1 -1
- package/dist/schema/errors.js +0 -4
- package/dist/schema/errors.js.map +1 -1
- package/dist/schema/frames.d.ts +48 -51
- package/dist/schema/frames.d.ts.map +1 -1
- package/dist/schema/frames.js +28 -50
- package/dist/schema/frames.js.map +1 -1
- package/dist/schema/identity.d.ts +17 -9
- package/dist/schema/identity.d.ts.map +1 -1
- package/dist/schema/index.d.ts +3 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -4
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/internal-frames.d.ts +10 -0
- package/dist/schema/internal-frames.d.ts.map +1 -0
- package/dist/schema/internal-frames.js +5 -0
- package/dist/schema/internal-frames.js.map +1 -0
- package/dist/schema/invites.d.ts +6 -2
- package/dist/schema/invites.d.ts.map +1 -1
- package/dist/schema/json-rpc.d.ts +27 -0
- package/dist/schema/json-rpc.d.ts.map +1 -0
- package/dist/schema/json-rpc.js +32 -0
- package/dist/schema/json-rpc.js.map +1 -0
- package/dist/schema/messages.d.ts +15 -5
- package/dist/schema/messages.d.ts.map +1 -1
- package/dist/schema/methods/apps.d.ts +131 -105
- package/dist/schema/methods/apps.d.ts.map +1 -1
- package/dist/schema/methods/apps.js +4 -57
- package/dist/schema/methods/apps.js.map +1 -1
- package/dist/schema/methods/auth.d.ts +62 -34
- package/dist/schema/methods/auth.d.ts.map +1 -1
- package/dist/schema/methods/contacts.d.ts +27 -9
- package/dist/schema/methods/contacts.d.ts.map +1 -1
- package/dist/schema/methods/conversations.d.ts +91 -18
- package/dist/schema/methods/conversations.d.ts.map +1 -1
- package/dist/schema/methods/conversations.js +2 -2
- package/dist/schema/methods/conversations.js.map +1 -1
- package/dist/schema/methods/messages.d.ts +39 -13
- package/dist/schema/methods/messages.d.ts.map +1 -1
- package/dist/schema/methods/presence.d.ts +6 -2
- package/dist/schema/methods/presence.d.ts.map +1 -1
- package/dist/schema/notifications.d.ts +752 -0
- package/dist/schema/notifications.d.ts.map +1 -0
- package/dist/schema/notifications.js +155 -0
- package/dist/schema/notifications.js.map +1 -0
- package/dist/schema/presence.d.ts +3 -1
- package/dist/schema/presence.d.ts.map +1 -1
- package/dist/schema/primitives.d.ts +21 -5
- package/dist/schema/primitives.d.ts.map +1 -1
- package/dist/schema/primitives.js +6 -0
- package/dist/schema/primitives.js.map +1 -1
- package/dist/test-fixtures/seed-data.d.ts +0 -1388
- package/dist/test-fixtures/seed-data.d.ts.map +1 -1
- package/dist/test-fixtures/seed-data.js +0 -987
- package/dist/test-fixtures/seed-data.js.map +1 -1
- package/dist/testing/agent-registration.d.ts +3 -1
- package/dist/testing/agent-registration.d.ts.map +1 -1
- package/dist/testing/agent-registration.js +2 -14
- package/dist/testing/agent-registration.js.map +1 -1
- package/dist/testing/arbitraries/frames.d.ts +2 -2
- package/dist/testing/arbitraries/frames.d.ts.map +1 -1
- package/dist/testing/arbitraries/frames.js +7 -6
- package/dist/testing/arbitraries/frames.js.map +1 -1
- package/dist/testing/arbitraries/index.d.ts +1 -1
- package/dist/testing/arbitraries/index.d.ts.map +1 -1
- package/dist/testing/arbitraries/index.js +1 -1
- package/dist/testing/arbitraries/index.js.map +1 -1
- package/dist/testing/arbitraries/rpc.d.ts +3 -2
- package/dist/testing/arbitraries/rpc.d.ts.map +1 -1
- package/dist/testing/arbitraries/rpc.js +1 -0
- package/dist/testing/arbitraries/rpc.js.map +1 -1
- package/dist/testing/codec.d.ts +13 -11
- package/dist/testing/codec.d.ts.map +1 -1
- package/dist/testing/codec.js +30 -45
- package/dist/testing/codec.js.map +1 -1
- package/dist/testing/conformance/__divergence_proofs__/executable-proof-helpers.d.ts.map +1 -1
- package/dist/testing/conformance/__divergence_proofs__/executable-proof-helpers.js +10 -3
- package/dist/testing/conformance/__divergence_proofs__/executable-proof-helpers.js.map +1 -1
- package/dist/testing/conformance/_helpers.d.ts +6 -6
- package/dist/testing/conformance/_helpers.d.ts.map +1 -1
- package/dist/testing/conformance/_helpers.js +6 -7
- package/dist/testing/conformance/_helpers.js.map +1 -1
- package/dist/testing/conformance/adversity.d.ts.map +1 -1
- package/dist/testing/conformance/adversity.js +14 -31
- package/dist/testing/conformance/adversity.js.map +1 -1
- package/dist/testing/conformance/boundary.d.ts +1 -1
- package/dist/testing/conformance/boundary.d.ts.map +1 -1
- package/dist/testing/conformance/boundary.js +13 -18
- package/dist/testing/conformance/boundary.js.map +1 -1
- package/dist/testing/conformance/client/_fixtures.d.ts +7 -5
- package/dist/testing/conformance/client/_fixtures.d.ts.map +1 -1
- package/dist/testing/conformance/client/_fixtures.js +17 -8
- package/dist/testing/conformance/client/_fixtures.js.map +1 -1
- package/dist/testing/conformance/client/adversity.d.ts.map +1 -1
- package/dist/testing/conformance/client/adversity.js +8 -7
- package/dist/testing/conformance/client/adversity.js.map +1 -1
- package/dist/testing/conformance/client/boundary.d.ts +2 -2
- package/dist/testing/conformance/client/boundary.d.ts.map +1 -1
- package/dist/testing/conformance/client/boundary.js +13 -12
- package/dist/testing/conformance/client/boundary.js.map +1 -1
- package/dist/testing/conformance/client/delivery.d.ts +5 -5
- package/dist/testing/conformance/client/delivery.d.ts.map +1 -1
- package/dist/testing/conformance/client/delivery.js +53 -55
- package/dist/testing/conformance/client/delivery.js.map +1 -1
- package/dist/testing/conformance/client/index.d.ts +2 -2
- package/dist/testing/conformance/client/index.d.ts.map +1 -1
- package/dist/testing/conformance/client/index.js +1 -1
- package/dist/testing/conformance/client/index.js.map +1 -1
- package/dist/testing/conformance/client/rpc-semantics.d.ts.map +1 -1
- package/dist/testing/conformance/client/rpc-semantics.js +13 -22
- package/dist/testing/conformance/client/rpc-semantics.js.map +1 -1
- package/dist/testing/conformance/client/runner.d.ts +25 -24
- package/dist/testing/conformance/client/runner.d.ts.map +1 -1
- package/dist/testing/conformance/client/runner.js +20 -22
- package/dist/testing/conformance/client/runner.js.map +1 -1
- package/dist/testing/conformance/client/schema-conformance.d.ts +8 -8
- package/dist/testing/conformance/client/schema-conformance.d.ts.map +1 -1
- package/dist/testing/conformance/client/schema-conformance.js +34 -34
- package/dist/testing/conformance/client/schema-conformance.js.map +1 -1
- package/dist/testing/conformance/client/suite.js +2 -2
- package/dist/testing/conformance/client/suite.js.map +1 -1
- package/dist/testing/conformance/delivery.d.ts.map +1 -1
- package/dist/testing/conformance/delivery.js +58 -54
- package/dist/testing/conformance/delivery.js.map +1 -1
- package/dist/testing/conformance/dispatcher-concurrency.js +12 -12
- package/dist/testing/conformance/dispatcher-concurrency.js.map +1 -1
- package/dist/testing/conformance/presence.d.ts.map +1 -1
- package/dist/testing/conformance/presence.js +32 -23
- package/dist/testing/conformance/presence.js.map +1 -1
- package/dist/testing/conformance/rpc-semantics.d.ts +12 -12
- package/dist/testing/conformance/rpc-semantics.d.ts.map +1 -1
- package/dist/testing/conformance/rpc-semantics.js +43 -41
- package/dist/testing/conformance/rpc-semantics.js.map +1 -1
- package/dist/testing/conformance/schema-conformance.d.ts +3 -40
- package/dist/testing/conformance/schema-conformance.d.ts.map +1 -1
- package/dist/testing/conformance/schema-conformance.js +38 -244
- package/dist/testing/conformance/schema-conformance.js.map +1 -1
- package/dist/testing/conformance/suite.d.ts.map +1 -1
- package/dist/testing/conformance/suite.js +5 -9
- package/dist/testing/conformance/suite.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/models/dispatch.d.ts +5 -5
- package/dist/testing/models/dispatch.d.ts.map +1 -1
- package/dist/testing/models/dispatch.js +1 -18
- package/dist/testing/models/dispatch.js.map +1 -1
- package/dist/testing/models/state.d.ts +2 -2
- package/dist/testing/models/state.d.ts.map +1 -1
- package/dist/testing/test-client.d.ts +36 -44
- package/dist/testing/test-client.d.ts.map +1 -1
- package/dist/testing/test-client.js +117 -105
- package/dist/testing/test-client.js.map +1 -1
- package/dist/testing/test-server.d.ts +5 -5
- package/dist/testing/test-server.d.ts.map +1 -1
- package/dist/testing/test-server.js +4 -4
- package/dist/testing/test-server.js.map +1 -1
- package/dist/types.d.ts +3 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validators.d.ts +357 -101
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +22 -30
- package/dist/validators.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/schema/events.d.ts +0 -213
- package/dist/schema/events.d.ts.map +0 -1
- package/dist/schema/events.js +0 -122
- package/dist/schema/events.js.map +0 -1
- package/dist/schema/methods/push.d.ts +0 -21
- package/dist/schema/methods/push.d.ts.map +0 -1
- package/dist/schema/methods/push.js +0 -28
- package/dist/schema/methods/push.js.map +0 -1
- package/dist/schema/surfaces.d.ts +0 -55
- package/dist/schema/surfaces.d.ts.map +0 -1
- package/dist/schema/surfaces.js +0 -55
- package/dist/schema/surfaces.js.map +0 -1
package/dist/schema/frames.d.ts
CHANGED
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
import { type Static } from "@sinclair/typebox";
|
|
2
|
+
export { JSON_RPC_VERSION, JsonRpcIdSchema } from "./json-rpc.js";
|
|
2
3
|
/**
|
|
3
|
-
* Direction
|
|
4
|
-
*
|
|
5
|
-
* `c2s` (client→server) and `s2c` (server→client) request-id pools live in
|
|
6
|
-
* disjoint pending maps keyed on `(side, type)`. The `direction` field is
|
|
7
|
-
* required so wire-level inspection can route without re-deriving who
|
|
8
|
-
* originated a frame. Events remain s2c-only and do NOT carry a
|
|
9
|
-
* `direction` field — they're not request/response.
|
|
10
|
-
*
|
|
11
|
-
* Implemented as `Type.Union([Type.Literal, ...])` rather than the
|
|
12
|
-
* `stringEnum` helper because `Value.Check` — used by
|
|
13
|
-
* `packages/protocol/src/testing/codec.ts` for the conformance round-trip
|
|
14
|
-
* — requires a native TypeBox `[Kind]` on every node, and `stringEnum`
|
|
15
|
-
* produces a `Type.Unsafe` node that `Value.Check` rejects with
|
|
16
|
-
* `"Unknown type"`. AJV strict mode accepts the resulting `anyOf` shape.
|
|
17
|
-
*/
|
|
18
|
-
export declare const FrameDirectionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"c2s">, import("@sinclair/typebox").TLiteral<"s2c">]>;
|
|
19
|
-
export type FrameDirection = Static<typeof FrameDirectionSchema>;
|
|
20
|
-
/**
|
|
21
|
-
* Bidirectional request envelope.
|
|
22
|
-
*
|
|
23
|
-
* - `direction: "c2s"` — client-initiated RPC. Routed on the server to the
|
|
24
|
-
* existing `RpcRouter` dispatcher.
|
|
25
|
-
* - `direction: "s2c"` — server-initiated RPC. Routed on the client to the
|
|
26
|
-
* per-method handler registry registered via
|
|
27
|
-
* `MoltZapWsClient.handleServerRpc` / `TestClient.handleServerRpc`.
|
|
4
|
+
* JSON-RPC 2.0 Request object. Direction is derived from the local peer role
|
|
5
|
+
* and socket path, not carried on the wire.
|
|
28
6
|
*/
|
|
29
7
|
export declare const RequestFrameSchema: import("@sinclair/typebox").TObject<{
|
|
30
8
|
jsonrpc: import("@sinclair/typebox").TLiteral<"2.0">;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
method: import("@sinclair/typebox").TString
|
|
9
|
+
id: import("@sinclair/typebox").TString & {
|
|
10
|
+
static: import("../brands.js").BrandedString<"JsonRpcStringId">;
|
|
11
|
+
};
|
|
12
|
+
method: import("@sinclair/typebox").TString & {
|
|
13
|
+
static: import("../brands.js").BrandedString<"JsonRpcMethod">;
|
|
14
|
+
};
|
|
35
15
|
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
36
|
-
traceparent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
16
|
}>;
|
|
38
17
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* - `direction: "c2s"` — server's reply to a client-initiated request. Routed
|
|
42
|
-
* on the client to the c2s pending map keyed by `id`.
|
|
43
|
-
* - `direction: "s2c"` — client's reply to a server-initiated request. Routed
|
|
44
|
-
* on the server to the per-connection s2c pending map keyed by `id`.
|
|
18
|
+
* JSON-RPC 2.0 Response object. Success and error are modeled as a union so
|
|
19
|
+
* a well-typed response cannot carry both `result` and `error`.
|
|
45
20
|
*/
|
|
46
|
-
export declare const ResponseFrameSchema: import("@sinclair/typebox").TObject<{
|
|
21
|
+
export declare const ResponseFrameSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
47
22
|
jsonrpc: import("@sinclair/typebox").TLiteral<"2.0">;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString & {
|
|
24
|
+
static: import("../brands.js").BrandedString<"JsonRpcStringId">;
|
|
25
|
+
}, import("@sinclair/typebox").TNumber & {
|
|
26
|
+
static: import("../brands.js").BrandedNumber<"JsonRpcNumberId">;
|
|
27
|
+
}, import("@sinclair/typebox").TNull]>;
|
|
28
|
+
result: import("@sinclair/typebox").TUnknown;
|
|
29
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
30
|
+
jsonrpc: import("@sinclair/typebox").TLiteral<"2.0">;
|
|
31
|
+
id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString & {
|
|
32
|
+
static: import("../brands.js").BrandedString<"JsonRpcStringId">;
|
|
33
|
+
}, import("@sinclair/typebox").TNumber & {
|
|
34
|
+
static: import("../brands.js").BrandedNumber<"JsonRpcNumberId">;
|
|
35
|
+
}, import("@sinclair/typebox").TNull]>;
|
|
36
|
+
error: import("@sinclair/typebox").TObject<{
|
|
53
37
|
code: import("@sinclair/typebox").TInteger;
|
|
54
38
|
message: import("@sinclair/typebox").TString;
|
|
55
39
|
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
56
|
-
}
|
|
57
|
-
}>;
|
|
58
|
-
|
|
40
|
+
}>;
|
|
41
|
+
}>]>;
|
|
42
|
+
/**
|
|
43
|
+
* JSON-RPC 2.0 Notification object. MoltZap notification delivery uses this
|
|
44
|
+
* shape: the notification name is the JSON-RPC `method`, and the payload is
|
|
45
|
+
* `params`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const NotificationFrameSchema: import("@sinclair/typebox").TObject<{
|
|
59
48
|
jsonrpc: import("@sinclair/typebox").TLiteral<"2.0">;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
method: import("@sinclair/typebox").TString & {
|
|
50
|
+
static: import("../brands.js").BrandedString<"JsonRpcMethod">;
|
|
51
|
+
};
|
|
52
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
63
53
|
}>;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
declare const frameBrand: unique symbol;
|
|
55
|
+
type FrameBrand<Kind extends string> = {
|
|
56
|
+
readonly [frameBrand]: Kind;
|
|
57
|
+
};
|
|
58
|
+
type RawRequestFrame = Static<typeof RequestFrameSchema>;
|
|
59
|
+
type RawResponseFrame = Static<typeof ResponseFrameSchema>;
|
|
60
|
+
type RawNotificationFrame = Static<typeof NotificationFrameSchema>;
|
|
61
|
+
export type RequestFrame = RawRequestFrame & FrameBrand<"RequestFrame">;
|
|
62
|
+
export type ResponseFrame = RawResponseFrame & FrameBrand<"ResponseFrame">;
|
|
63
|
+
export type NotificationFrame = RawNotificationFrame & FrameBrand<"NotificationFrame">;
|
|
67
64
|
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/schema/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/schema/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOtD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;EAQ9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;IAiB9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;EAOnC,CAAC;AAEF,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AACxC,KAAK,UAAU,CAAC,IAAI,SAAS,MAAM,IAAI;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEvE,KAAK,eAAe,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACzD,KAAK,gBAAgB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC3D,KAAK,oBAAoB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAClD,UAAU,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/schema/frames.js
CHANGED
|
@@ -1,63 +1,41 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { RpcErrorSchema } from "./errors.js";
|
|
3
|
+
import { JsonRpcIdSchema, JsonRpcMethodSchema, JsonRpcStringIdSchema, } from "./json-rpc.js";
|
|
4
|
+
export { JSON_RPC_VERSION, JsonRpcIdSchema } from "./json-rpc.js";
|
|
3
5
|
/**
|
|
4
|
-
* Direction
|
|
5
|
-
*
|
|
6
|
-
* `c2s` (client→server) and `s2c` (server→client) request-id pools live in
|
|
7
|
-
* disjoint pending maps keyed on `(side, type)`. The `direction` field is
|
|
8
|
-
* required so wire-level inspection can route without re-deriving who
|
|
9
|
-
* originated a frame. Events remain s2c-only and do NOT carry a
|
|
10
|
-
* `direction` field — they're not request/response.
|
|
11
|
-
*
|
|
12
|
-
* Implemented as `Type.Union([Type.Literal, ...])` rather than the
|
|
13
|
-
* `stringEnum` helper because `Value.Check` — used by
|
|
14
|
-
* `packages/protocol/src/testing/codec.ts` for the conformance round-trip
|
|
15
|
-
* — requires a native TypeBox `[Kind]` on every node, and `stringEnum`
|
|
16
|
-
* produces a `Type.Unsafe` node that `Value.Check` rejects with
|
|
17
|
-
* `"Unknown type"`. AJV strict mode accepts the resulting `anyOf` shape.
|
|
18
|
-
*/
|
|
19
|
-
export const FrameDirectionSchema = Type.Union([
|
|
20
|
-
Type.Literal("c2s"),
|
|
21
|
-
Type.Literal("s2c"),
|
|
22
|
-
]);
|
|
23
|
-
/**
|
|
24
|
-
* Bidirectional request envelope.
|
|
25
|
-
*
|
|
26
|
-
* - `direction: "c2s"` — client-initiated RPC. Routed on the server to the
|
|
27
|
-
* existing `RpcRouter` dispatcher.
|
|
28
|
-
* - `direction: "s2c"` — server-initiated RPC. Routed on the client to the
|
|
29
|
-
* per-method handler registry registered via
|
|
30
|
-
* `MoltZapWsClient.handleServerRpc` / `TestClient.handleServerRpc`.
|
|
6
|
+
* JSON-RPC 2.0 Request object. Direction is derived from the local peer role
|
|
7
|
+
* and socket path, not carried on the wire.
|
|
31
8
|
*/
|
|
32
9
|
export const RequestFrameSchema = Type.Object({
|
|
33
10
|
jsonrpc: Type.Literal("2.0"),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
id: Type.String(),
|
|
37
|
-
method: Type.String(),
|
|
11
|
+
id: JsonRpcStringIdSchema,
|
|
12
|
+
method: JsonRpcMethodSchema,
|
|
38
13
|
params: Type.Optional(Type.Unknown()),
|
|
39
|
-
traceparent: Type.Optional(Type.String()),
|
|
40
14
|
}, { additionalProperties: false });
|
|
41
15
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* - `direction: "c2s"` — server's reply to a client-initiated request. Routed
|
|
45
|
-
* on the client to the c2s pending map keyed by `id`.
|
|
46
|
-
* - `direction: "s2c"` — client's reply to a server-initiated request. Routed
|
|
47
|
-
* on the server to the per-connection s2c pending map keyed by `id`.
|
|
16
|
+
* JSON-RPC 2.0 Response object. Success and error are modeled as a union so
|
|
17
|
+
* a well-typed response cannot carry both `result` and `error`.
|
|
48
18
|
*/
|
|
49
|
-
export const ResponseFrameSchema = Type.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
19
|
+
export const ResponseFrameSchema = Type.Union([
|
|
20
|
+
Type.Object({
|
|
21
|
+
jsonrpc: Type.Literal("2.0"),
|
|
22
|
+
id: JsonRpcIdSchema,
|
|
23
|
+
result: Type.Unknown(),
|
|
24
|
+
}, { additionalProperties: false }),
|
|
25
|
+
Type.Object({
|
|
26
|
+
jsonrpc: Type.Literal("2.0"),
|
|
27
|
+
id: JsonRpcIdSchema,
|
|
28
|
+
error: RpcErrorSchema,
|
|
29
|
+
}, { additionalProperties: false }),
|
|
30
|
+
]);
|
|
31
|
+
/**
|
|
32
|
+
* JSON-RPC 2.0 Notification object. MoltZap notification delivery uses this
|
|
33
|
+
* shape: the notification name is the JSON-RPC `method`, and the payload is
|
|
34
|
+
* `params`.
|
|
35
|
+
*/
|
|
36
|
+
export const NotificationFrameSchema = Type.Object({
|
|
58
37
|
jsonrpc: Type.Literal("2.0"),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
data: Type.Optional(Type.Unknown()),
|
|
38
|
+
method: JsonRpcMethodSchema,
|
|
39
|
+
params: Type.Optional(Type.Unknown()),
|
|
62
40
|
}, { additionalProperties: false });
|
|
63
41
|
//# sourceMappingURL=frames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/schema/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/schema/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAC3C;IACE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5B,EAAE,EAAE,qBAAqB;IACzB,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;CACtC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5C,IAAI,CAAC,MAAM,CACT;QACE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC5B,EAAE,EAAE,eAAe;QACnB,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;KACvB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC;IACD,IAAI,CAAC,MAAM,CACT;QACE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC5B,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,cAAc;KACtB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC;CACF,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAChD;IACE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;CACtC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC"}
|
|
@@ -5,8 +5,12 @@ export declare const AgentMetadataSchema: import("@sinclair/typebox").TObject<{
|
|
|
5
5
|
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const AgentSchema: import("@sinclair/typebox").TObject<{
|
|
8
|
-
id: import("@sinclair/typebox").TString
|
|
9
|
-
|
|
8
|
+
id: import("@sinclair/typebox").TString & {
|
|
9
|
+
static: import("../brands.js").BrandedString<"AgentId">;
|
|
10
|
+
};
|
|
11
|
+
ownerUserId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
12
|
+
static: import("../brands.js").BrandedString<"UserId">;
|
|
13
|
+
}>;
|
|
10
14
|
name: import("@sinclair/typebox").TString;
|
|
11
15
|
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
16
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -24,19 +28,23 @@ export declare const AgentSchema: import("@sinclair/typebox").TObject<{
|
|
|
24
28
|
createdAt: import("@sinclair/typebox").TString;
|
|
25
29
|
}>;
|
|
26
30
|
export declare const AgentCardSchema: import("@sinclair/typebox").TObject<{
|
|
31
|
+
id: import("@sinclair/typebox").TString & {
|
|
32
|
+
static: import("../brands.js").BrandedString<"AgentId">;
|
|
33
|
+
};
|
|
27
34
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
28
|
-
id: import("@sinclair/typebox").TString;
|
|
29
|
-
ownerUserId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
30
|
-
name: import("@sinclair/typebox").TString;
|
|
31
|
-
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
-
agentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
33
|
-
static: "OpenClaw" | "NanoClaw";
|
|
34
|
-
}>;
|
|
35
35
|
metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
36
36
|
purpose: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
37
37
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
38
38
|
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
|
|
39
39
|
}>>;
|
|
40
|
+
name: import("@sinclair/typebox").TString;
|
|
41
|
+
ownerUserId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
42
|
+
static: import("../brands.js").BrandedString<"UserId">;
|
|
43
|
+
}>;
|
|
44
|
+
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
45
|
+
agentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
46
|
+
static: "OpenClaw" | "NanoClaw";
|
|
47
|
+
}>;
|
|
40
48
|
status: import("@sinclair/typebox").TString & {
|
|
41
49
|
static: "pending_claim" | "active" | "suspended";
|
|
42
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/schema/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,mBAAmB;;;;EAO/B,CAAC;AAEF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/schema/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,mBAAmB;;;;EAO/B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAE1B,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAC/C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ConversationId, MessageId, ContactId, InviteToken, } from "./primitives.js";
|
|
1
|
+
export { UserId, AgentId, ConversationId, MessageId, ContactId, userId, agentId, conversationId, messageId, contactId, InviteToken, } from "./primitives.js";
|
|
2
2
|
export * from "./identity.js";
|
|
3
3
|
export * from "./contacts.js";
|
|
4
4
|
export * from "./conversations.js";
|
|
@@ -7,17 +7,16 @@ export * from "./logical-clock.js";
|
|
|
7
7
|
export * from "./invites.js";
|
|
8
8
|
export * from "./presence.js";
|
|
9
9
|
export * from "./delivery.js";
|
|
10
|
+
export * from "./json-rpc.js";
|
|
10
11
|
export * from "./frames.js";
|
|
11
12
|
export * from "./errors.js";
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./events.js";
|
|
13
|
+
export * from "./notifications.js";
|
|
14
14
|
export * from "./methods/auth.js";
|
|
15
15
|
export * from "./methods/contacts.js";
|
|
16
16
|
export * from "./methods/conversations.js";
|
|
17
17
|
export * from "./methods/messages.js";
|
|
18
18
|
export * from "./methods/invites.js";
|
|
19
19
|
export * from "./methods/presence.js";
|
|
20
|
-
export * from "./methods/push.js";
|
|
21
20
|
export * from "./apps.js";
|
|
22
21
|
export * from "./methods/apps.js";
|
|
23
22
|
export * from "./methods/system.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,EACN,OAAO,EACP,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/dist/schema/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ConversationId, MessageId, ContactId, InviteToken, } from "./primitives.js";
|
|
1
|
+
export { UserId, AgentId, ConversationId, MessageId, ContactId, userId, agentId, conversationId, messageId, contactId, InviteToken, } from "./primitives.js";
|
|
2
2
|
export * from "./identity.js";
|
|
3
3
|
export * from "./contacts.js";
|
|
4
4
|
export * from "./conversations.js";
|
|
@@ -7,17 +7,16 @@ export * from "./logical-clock.js";
|
|
|
7
7
|
export * from "./invites.js";
|
|
8
8
|
export * from "./presence.js";
|
|
9
9
|
export * from "./delivery.js";
|
|
10
|
+
export * from "./json-rpc.js";
|
|
10
11
|
export * from "./frames.js";
|
|
11
12
|
export * from "./errors.js";
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./events.js";
|
|
13
|
+
export * from "./notifications.js";
|
|
14
14
|
export * from "./methods/auth.js";
|
|
15
15
|
export * from "./methods/contacts.js";
|
|
16
16
|
export * from "./methods/conversations.js";
|
|
17
17
|
export * from "./methods/messages.js";
|
|
18
18
|
export * from "./methods/invites.js";
|
|
19
19
|
export * from "./methods/presence.js";
|
|
20
|
-
export * from "./methods/push.js";
|
|
21
20
|
export * from "./apps.js";
|
|
22
21
|
export * from "./methods/apps.js";
|
|
23
22
|
export * from "./methods/system.js";
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,EACN,OAAO,EACP,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Static } from "@sinclair/typebox";
|
|
2
|
+
import type { NotificationFrame, RequestFrame, ResponseFrame } from "./frames.js";
|
|
3
|
+
import { NotificationFrameSchema, RequestFrameSchema, ResponseFrameSchema } from "./frames.js";
|
|
4
|
+
export type RawRequestFrame = Static<typeof RequestFrameSchema>;
|
|
5
|
+
export type RawResponseFrame = Static<typeof ResponseFrameSchema>;
|
|
6
|
+
export type RawNotificationFrame = Static<typeof NotificationFrameSchema>;
|
|
7
|
+
export declare const brandRequestFrame: <T extends RawRequestFrame>(frame: T) => T & RequestFrame;
|
|
8
|
+
export declare const brandResponseFrame: <T extends RawResponseFrame>(frame: T) => T & ResponseFrame;
|
|
9
|
+
export declare const brandNotificationFrame: <T extends RawNotificationFrame>(frame: T) => T & NotificationFrame;
|
|
10
|
+
//# sourceMappingURL=internal-frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-frames.d.ts","sourceRoot":"","sources":["../../src/schema/internal-frames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,eAAe,EACzD,OAAO,CAAC,KACP,CAAC,GAAG,YAAyC,CAAC;AAEjD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,gBAAgB,EAC3D,OAAO,CAAC,KACP,CAAC,GAAG,aAA2C,CAAC;AAEnD,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,oBAAoB,EACnE,OAAO,CAAC,KACP,CAAC,GAAG,iBAAmD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NotificationFrameSchema, RequestFrameSchema, ResponseFrameSchema, } from "./frames.js";
|
|
2
|
+
export const brandRequestFrame = (frame) => frame;
|
|
3
|
+
export const brandResponseFrame = (frame) => frame;
|
|
4
|
+
export const brandNotificationFrame = (frame) => frame;
|
|
5
|
+
//# sourceMappingURL=internal-frames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-frames.js","sourceRoot":"","sources":["../../src/schema/internal-frames.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAMrB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAQ,EACU,EAAE,CAAC,KAAyB,CAAC;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAQ,EACW,EAAE,CAAC,KAA0B,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAQ,EACe,EAAE,CAAC,KAA8B,CAAC"}
|
package/dist/schema/invites.d.ts
CHANGED
|
@@ -7,13 +7,17 @@ export declare const InviteStatusEnum: import("@sinclair/typebox").TString & {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const InviteSchema: import("@sinclair/typebox").TObject<{
|
|
9
9
|
id: import("@sinclair/typebox").TString;
|
|
10
|
-
inviterId: import("@sinclair/typebox").TString
|
|
10
|
+
inviterId: import("@sinclair/typebox").TString & {
|
|
11
|
+
static: import("../brands.js").BrandedString<"UserId">;
|
|
12
|
+
};
|
|
11
13
|
token: import("@sinclair/typebox").TString;
|
|
12
14
|
type: import("@sinclair/typebox").TString & {
|
|
13
15
|
static: "group" | "contact";
|
|
14
16
|
};
|
|
15
17
|
targetPhone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
-
conversationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString
|
|
18
|
+
conversationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
19
|
+
static: import("../brands.js").BrandedString<"ConversationId">;
|
|
20
|
+
}>;
|
|
17
21
|
status: import("@sinclair/typebox").TString & {
|
|
18
22
|
static: "pending" | "accepted" | "expired";
|
|
19
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invites.d.ts","sourceRoot":"","sources":["../../src/schema/invites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,cAAc;;CAAmC,CAAC;AAC/D,eAAO,MAAM,gBAAgB;;CAAiD,CAAC;AAE/E,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"invites.d.ts","sourceRoot":"","sources":["../../src/schema/invites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,cAAc;;CAAmC,CAAC;AAC/D,eAAO,MAAM,gBAAgB;;CAAiD,CAAC;AAE/E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAaxB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Static } from "@sinclair/typebox";
|
|
2
|
+
import { Brand } from "effect";
|
|
3
|
+
export declare const JSON_RPC_VERSION: "2.0";
|
|
4
|
+
export declare const JsonRpcStringIdSchema: import("@sinclair/typebox").TString & {
|
|
5
|
+
static: import("../brands.js").BrandedString<"JsonRpcStringId">;
|
|
6
|
+
};
|
|
7
|
+
export declare const JsonRpcNumberIdSchema: import("@sinclair/typebox").TNumber & {
|
|
8
|
+
static: import("../brands.js").BrandedNumber<"JsonRpcNumberId">;
|
|
9
|
+
};
|
|
10
|
+
export declare const JsonRpcIdSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString & {
|
|
11
|
+
static: import("../brands.js").BrandedString<"JsonRpcStringId">;
|
|
12
|
+
}, import("@sinclair/typebox").TNumber & {
|
|
13
|
+
static: import("../brands.js").BrandedNumber<"JsonRpcNumberId">;
|
|
14
|
+
}, import("@sinclair/typebox").TNull]>;
|
|
15
|
+
export declare const JsonRpcMethodSchema: import("@sinclair/typebox").TString & {
|
|
16
|
+
static: import("../brands.js").BrandedString<"JsonRpcMethod">;
|
|
17
|
+
};
|
|
18
|
+
export type JsonRpcStringId = Static<typeof JsonRpcStringIdSchema>;
|
|
19
|
+
export type JsonRpcNumberId = Static<typeof JsonRpcNumberIdSchema>;
|
|
20
|
+
export type JsonRpcId = Static<typeof JsonRpcIdSchema>;
|
|
21
|
+
export type JsonRpcMethod<Name extends string = string> = Name & Brand.Brand<"JsonRpcMethod">;
|
|
22
|
+
export declare const jsonRpcStringId: (id: string) => JsonRpcStringId;
|
|
23
|
+
export declare const jsonRpcNumberId: (id: number) => JsonRpcNumberId;
|
|
24
|
+
export declare const jsonRpcMethod: <const Name extends string>(method: Name) => JsonRpcMethod<Name>;
|
|
25
|
+
export declare function jsonRpcIdFromWire(value: unknown): JsonRpcId;
|
|
26
|
+
export declare function isJsonRpcStringId(id: JsonRpcId): id is JsonRpcStringId;
|
|
27
|
+
//# sourceMappingURL=json-rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-rpc.d.ts","sourceRoot":"","sources":["../../src/schema/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG/B,eAAO,MAAM,gBAAgB,EAAG,KAAc,CAAC;AAE/C,eAAO,MAAM,qBAAqB;;CAAmC,CAAC;AACtE,eAAO,MAAM,qBAAqB;;CAAmC,CAAC;AACtE,eAAO,MAAM,eAAe;;;;sCAI1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;CAE9B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,GAC5D,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AAM/B,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,eACnB,CAAC;AAC3B,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,eACnB,CAAC;AAC3B,eAAO,MAAM,aAAa,GAAI,KAAK,CAAC,IAAI,SAAS,MAAM,EACrD,QAAQ,IAAI,KACX,aAAa,CAAC,IAAI,CAAsD,CAAC;AAE5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAM3D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,GAAG,EAAE,IAAI,eAAe,CAEtE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Brand } from "effect";
|
|
3
|
+
import { brandedNumber, brandedString } from "../brands.js";
|
|
4
|
+
export const JSON_RPC_VERSION = "2.0";
|
|
5
|
+
export const JsonRpcStringIdSchema = brandedString("JsonRpcStringId");
|
|
6
|
+
export const JsonRpcNumberIdSchema = brandedNumber("JsonRpcNumberId");
|
|
7
|
+
export const JsonRpcIdSchema = Type.Union([
|
|
8
|
+
JsonRpcStringIdSchema,
|
|
9
|
+
JsonRpcNumberIdSchema,
|
|
10
|
+
Type.Null(),
|
|
11
|
+
]);
|
|
12
|
+
export const JsonRpcMethodSchema = brandedString("JsonRpcMethod", {
|
|
13
|
+
minLength: 1,
|
|
14
|
+
});
|
|
15
|
+
const JsonRpcStringIdBrand = Brand.nominal();
|
|
16
|
+
const JsonRpcNumberIdBrand = Brand.nominal();
|
|
17
|
+
const JsonRpcMethodBrand = Brand.nominal();
|
|
18
|
+
export const jsonRpcStringId = (id) => JsonRpcStringIdBrand(id);
|
|
19
|
+
export const jsonRpcNumberId = (id) => JsonRpcNumberIdBrand(id);
|
|
20
|
+
export const jsonRpcMethod = (method) => JsonRpcMethodBrand(method);
|
|
21
|
+
export function jsonRpcIdFromWire(value) {
|
|
22
|
+
if (typeof value === "string")
|
|
23
|
+
return jsonRpcStringId(value);
|
|
24
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
25
|
+
return jsonRpcNumberId(value);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
export function isJsonRpcStringId(id) {
|
|
30
|
+
return typeof id === "string";
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=json-rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-rpc.js","sourceRoot":"","sources":["../../src/schema/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC;IACxC,qBAAqB;IACrB,qBAAqB;IACrB,IAAI,CAAC,IAAI,EAAE;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,EAAE;IAChE,SAAS,EAAE,CAAC;CACb,CAAC,CAAC;AAQH,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,EAAmB,CAAC;AAC9D,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,EAAmB,CAAC;AAC9D,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,EAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAmB,EAAE,CAC7D,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAmB,EAAE,CAC7D,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAY,EACS,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAwB,CAAC;AAE5E,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAa;IAC7C,OAAO,OAAO,EAAE,KAAK,QAAQ,CAAC;AAChC,CAAC"}
|
|
@@ -30,10 +30,18 @@ export declare const PartSchema: import("@sinclair/typebox").TUnion<[import("@si
|
|
|
30
30
|
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
31
31
|
}>]>;
|
|
32
32
|
export declare const MessageSchema: import("@sinclair/typebox").TObject<{
|
|
33
|
-
id: import("@sinclair/typebox").TString
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
id: import("@sinclair/typebox").TString & {
|
|
34
|
+
static: import("../brands.js").BrandedString<"MessageId">;
|
|
35
|
+
};
|
|
36
|
+
conversationId: import("@sinclair/typebox").TString & {
|
|
37
|
+
static: import("../brands.js").BrandedString<"ConversationId">;
|
|
38
|
+
};
|
|
39
|
+
senderId: import("@sinclair/typebox").TString & {
|
|
40
|
+
static: import("../brands.js").BrandedString<"AgentId">;
|
|
41
|
+
};
|
|
42
|
+
replyToId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
43
|
+
static: import("../brands.js").BrandedString<"MessageId">;
|
|
44
|
+
}>;
|
|
37
45
|
parts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
38
46
|
type: import("@sinclair/typebox").TLiteral<"text">;
|
|
39
47
|
text: import("@sinclair/typebox").TString;
|
|
@@ -48,7 +56,9 @@ export declare const MessageSchema: import("@sinclair/typebox").TObject<{
|
|
|
48
56
|
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
49
57
|
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
50
58
|
}>]>>;
|
|
51
|
-
taggedEntities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString
|
|
59
|
+
taggedEntities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString & {
|
|
60
|
+
static: import("../brands.js").BrandedString<"AgentId">;
|
|
61
|
+
}>>;
|
|
52
62
|
patchedBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
53
63
|
createdAt: import("@sinclair/typebox").TString;
|
|
54
64
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/schema/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,cAAc;;;EAM1B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;EAO3B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;EAS1B,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;IAIrB,CAAC;AAEH,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/schema/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,cAAc;;;EAM1B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;EAO3B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;EAS1B,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;IAIrB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACrD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACrD,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAC7C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC"}
|