@ai-matrx/desktop-protocol 0.1.0 → 0.1.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/CHANGELOG.md +14 -0
- package/README.md +3 -1
- package/dist/client.cjs +42 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +42 -1
- package/dist/client.js.map +1 -1
- package/dist/frame.cjs +12 -0
- package/dist/frame.cjs.map +1 -1
- package/dist/frame.d.cts +11 -1
- package/dist/frame.d.ts +11 -1
- package/dist/frame.js +12 -0
- package/dist/frame.js.map +1 -1
- package/dist/index.cjs +67 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -3
- package/dist/index.d.ts +46 -3
- package/dist/index.js +67 -2
- package/dist/index.js.map +1 -1
- package/dist/{registry-DTcTGycI.d.cts → registry-DJbrsZ4u.d.cts} +42 -1
- package/dist/{registry-DTcTGycI.d.ts → registry-DJbrsZ4u.d.ts} +42 -1
- package/package.json +1 -1
|
@@ -59,6 +59,13 @@ declare const PONG_TEXT: "{\"type\":\"pong\"}";
|
|
|
59
59
|
declare const CloseCode: {
|
|
60
60
|
readonly NORMAL: 1000;
|
|
61
61
|
readonly GOING_AWAY: 1001;
|
|
62
|
+
/** Never sent by anyone: what a socket reports when it drops without a close frame. A relay
|
|
63
|
+
* deploy (every Durable Object restarts) arrives as this — reconnect immediately. */
|
|
64
|
+
readonly ABNORMAL: 1006;
|
|
65
|
+
/** Relay → clients: the device (re)connected, so the core session they spoke to is gone —
|
|
66
|
+
* reconnect, hello, and reattach with since_seq. */
|
|
67
|
+
readonly DEVICE_RECONNECTED: 1012;
|
|
68
|
+
readonly TRY_AGAIN_LATER: 1013;
|
|
62
69
|
readonly AUTH_INVALID: 4001;
|
|
63
70
|
readonly AUTH_FORBIDDEN: 4003;
|
|
64
71
|
readonly DEVICE_NOT_FOUND: 4004;
|
|
@@ -68,6 +75,9 @@ declare const CloseCode: {
|
|
|
68
75
|
readonly PROTOCOL_ERROR: 4400;
|
|
69
76
|
readonly UPGRADE_REQUIRED: 4426;
|
|
70
77
|
};
|
|
78
|
+
/** Every close code above, as a schema (so Python sees the same table). */
|
|
79
|
+
declare const CloseCodeValue: z.ZodLiteral<1000 | 1001 | 1006 | 1012 | 1013 | 4001 | 4003 | 4004 | 4008 | 4009 | 4010 | 4400 | 4426>;
|
|
80
|
+
type CloseCodeValue = z.output<typeof CloseCodeValue>;
|
|
71
81
|
declare const ClientType: z.ZodEnum<{
|
|
72
82
|
screen: "screen";
|
|
73
83
|
web: "web";
|
|
@@ -2324,7 +2334,38 @@ declare const NAMED_SCHEMAS: {
|
|
|
2324
2334
|
}, z.core.$strict>>;
|
|
2325
2335
|
}, z.core.$strict>;
|
|
2326
2336
|
}, z.core.$strict>], "ok">;
|
|
2337
|
+
readonly RelayCallHello: z.ZodObject<{
|
|
2338
|
+
type: z.ZodLiteral<"hello">;
|
|
2339
|
+
id: z.ZodLiteral<"hello">;
|
|
2340
|
+
protocolVersion: z.ZodString;
|
|
2341
|
+
clientType: z.ZodLiteral<"server">;
|
|
2342
|
+
clientVersion: z.ZodString;
|
|
2343
|
+
}, z.core.$strict>;
|
|
2344
|
+
readonly RelayCallEnvelope: z.ZodObject<{
|
|
2345
|
+
id: z.ZodLiteral<"call">;
|
|
2346
|
+
type: z.ZodLiteral<"request">;
|
|
2347
|
+
cap: z.ZodString;
|
|
2348
|
+
op: z.ZodString;
|
|
2349
|
+
params: z.ZodUnknown;
|
|
2350
|
+
}, z.core.$strict>;
|
|
2351
|
+
readonly RelayHopEnvelopeHeader: z.ZodObject<{
|
|
2352
|
+
version: z.ZodLiteral<1>;
|
|
2353
|
+
flags: z.ZodLiteral<0>;
|
|
2354
|
+
channel: z.ZodLiteral<255>;
|
|
2355
|
+
cid: z.ZodInt;
|
|
2356
|
+
sid: z.ZodLiteral<0>;
|
|
2357
|
+
seq: z.ZodLiteral<0>;
|
|
2358
|
+
}, z.core.$strict>;
|
|
2359
|
+
readonly RelayHopConnectionEnd: z.ZodObject<{
|
|
2360
|
+
version: z.ZodLiteral<1>;
|
|
2361
|
+
flags: z.ZodLiteral<1>;
|
|
2362
|
+
channel: z.ZodLiteral<255>;
|
|
2363
|
+
cid: z.ZodInt;
|
|
2364
|
+
sid: z.ZodLiteral<0>;
|
|
2365
|
+
seq: z.ZodLiteral<0>;
|
|
2366
|
+
}, z.core.$strict>;
|
|
2367
|
+
readonly CloseCodeValue: z.ZodLiteral<1000 | 1001 | 1006 | 1012 | 1013 | 4001 | 4003 | 4004 | 4008 | 4009 | 4010 | 4400 | 4426>;
|
|
2327
2368
|
};
|
|
2328
2369
|
type NamedSchemaId = keyof typeof NAMED_SCHEMAS;
|
|
2329
2370
|
|
|
2330
|
-
export {
|
|
2371
|
+
export { ResponseMsg as A, StreamMsg as B, ClientType as C, DesktopProtocolError as D, EndReason as E, HelloMsg as H, Limits as L, NAMED_SCHEMAS as N, type OpName as O, PING_TEXT as P, RelayMsg as R, StreamMeta as S, Welcome as W, type OpParams as a, type OpResult as b, OPS as c, EVENTS as d, CancelMsg as e, ClientToCoreMsg as f, CloseCode as g, CloseCodeValue as h, isDesktopProtocolError as i, CoreToClientMsg as j, CreditMsg as k, EndMsg as l, ErrorCode as m, type ErrorCodeName as n, type ErrorData as o, ErrorMsg as p, ErrorReason as q, type ErrorReasonName as r, EventMsg as s, type EventName as t, type NamedSchemaId as u, OpDescriptor as v, type OpSpec as w, PONG_TEXT as x, ProtocolErrorBody as y, RequestMsg as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/desktop-protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The one wire contract between Matrx 2 (the desktop app) and every client that drives it — phone, web app, extension, server: zod schemas for the envelope and every cap.op, the 16-byte binary frame codec, a reconnecting request/stream/credit/reattach client, React hooks, and a generated JSON Schema + Pydantic twin that CI keeps byte-identical.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|