@deepseekharness-mobile/protocol 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export declare const ErrorCode: z.ZodEnum<{
3
+ "auth-required": "auth-required";
4
+ "auth-invalid": "auth-invalid";
5
+ "proto-unsupported": "proto-unsupported";
6
+ "not-found": "not-found";
7
+ denied: "denied";
8
+ "rate-limited": "rate-limited";
9
+ "bad-request": "bad-request";
10
+ internal: "internal";
11
+ }>;
12
+ export type ErrorCode = z.infer<typeof ErrorCode>;
13
+ export declare const RemoteError: z.ZodObject<{
14
+ code: z.ZodEnum<{
15
+ "auth-required": "auth-required";
16
+ "auth-invalid": "auth-invalid";
17
+ "proto-unsupported": "proto-unsupported";
18
+ "not-found": "not-found";
19
+ denied: "denied";
20
+ "rate-limited": "rate-limited";
21
+ "bad-request": "bad-request";
22
+ internal: "internal";
23
+ }>;
24
+ message: z.ZodString;
25
+ requestId: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ export type RemoteError = z.infer<typeof RemoteError>;
28
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;;;;;;;EASpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,WAAW;;;;;;;;;;;;;iBAItB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
package/dist/errors.js ADDED
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export const ErrorCode = z.enum([
3
+ 'auth-required',
4
+ 'auth-invalid',
5
+ 'proto-unsupported',
6
+ 'not-found',
7
+ 'denied',
8
+ 'rate-limited',
9
+ 'bad-request',
10
+ 'internal',
11
+ ]);
12
+ export const RemoteError = z.object({
13
+ code: ErrorCode,
14
+ message: z.string(),
15
+ requestId: z.string().optional(),
16
+ });
17
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9B,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,QAAQ;IACR,cAAc;IACd,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from './version.js';
2
+ export * from './errors.js';
3
+ export * from './domain.js';
4
+ export * from './envelope.js';
5
+ export * from './pairing.js';
6
+ export * from './messages.js';
7
+ import { ClientMessage, ServerMessage } from './messages.js';
8
+ export declare function newMessageId(): string;
9
+ export declare function parseClientMessage(raw: string): ClientMessage | undefined;
10
+ export declare function parseServerMessage(raw: string): ServerMessage | undefined;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE7D,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CASzE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CASzE"}
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ export * from './version.js';
2
+ export * from './errors.js';
3
+ export * from './domain.js';
4
+ export * from './envelope.js';
5
+ export * from './pairing.js';
6
+ export * from './messages.js';
7
+ import { ClientMessage, ServerMessage } from './messages.js';
8
+ export function newMessageId() {
9
+ return globalThis.crypto.randomUUID();
10
+ }
11
+ export function parseClientMessage(raw) {
12
+ let value;
13
+ try {
14
+ value = JSON.parse(raw);
15
+ }
16
+ catch {
17
+ return undefined;
18
+ }
19
+ const result = ClientMessage.safeParse(value);
20
+ return result.success ? result.data : undefined;
21
+ }
22
+ export function parseServerMessage(raw) {
23
+ let value;
24
+ try {
25
+ value = JSON.parse(raw);
26
+ }
27
+ catch {
28
+ return undefined;
29
+ }
30
+ const result = ServerMessage.safeParse(value);
31
+ return result.success ? result.data : undefined;
32
+ }
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC"}