@1upvision/protocol 0.1.1 → 0.1.2

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.
@@ -66,6 +66,24 @@ export type ServerMutationRequest = {
66
66
  args?: Record<string, unknown>;
67
67
  };
68
68
  };
69
+ export type ServerSubscribeRequest = {
70
+ jsonrpc: "2.0";
71
+ id: string;
72
+ method: "server.subscribe";
73
+ params: {
74
+ subscriptionId: string;
75
+ name: string;
76
+ args?: Record<string, unknown>;
77
+ };
78
+ };
79
+ export type ServerUnsubscribeRequest = {
80
+ jsonrpc: "2.0";
81
+ id: string;
82
+ method: "server.unsubscribe";
83
+ params: {
84
+ subscriptionId: string;
85
+ };
86
+ };
69
87
  export type EventCallbackNotification = {
70
88
  jsonrpc: "2.0";
71
89
  method: "event.callback";
@@ -96,8 +114,25 @@ export type StorageUpdateNotification = {
96
114
  storage: Record<string, unknown>;
97
115
  };
98
116
  };
99
- export type SandboxToHostMessage = UIRenderNotification | UIReadyNotification | StorageGetRequest | StorageSetRequest | ServerQueryRequest | ServerMutationRequest;
100
- export type HostToSandboxMessage = EventCallbackNotification | LifecycleInitRequest | LifecycleDestroyNotification | StorageUpdateNotification;
117
+ export type ServerSubscriptionUpdateNotification = {
118
+ jsonrpc: "2.0";
119
+ method: "server.subscription.update";
120
+ params: {
121
+ subscriptionId: string;
122
+ data: unknown;
123
+ };
124
+ };
125
+ export type ServerSubscriptionErrorNotification = {
126
+ jsonrpc: "2.0";
127
+ method: "server.subscription.error";
128
+ params: {
129
+ subscriptionId: string;
130
+ error: string;
131
+ message: string;
132
+ };
133
+ };
134
+ export type SandboxToHostMessage = UIRenderNotification | UIReadyNotification | StorageGetRequest | StorageSetRequest | ServerQueryRequest | ServerMutationRequest | ServerSubscribeRequest | ServerUnsubscribeRequest;
135
+ export type HostToSandboxMessage = EventCallbackNotification | LifecycleInitRequest | LifecycleDestroyNotification | StorageUpdateNotification | ServerSubscriptionUpdateNotification | ServerSubscriptionErrorNotification;
101
136
  export declare const JsonRpcRequestSchema: z.ZodObject<{
102
137
  jsonrpc: z.ZodLiteral<"2.0">;
103
138
  id: z.ZodString;
@@ -310,6 +345,68 @@ export declare const ServerMutationRequestSchema: z.ZodObject<{
310
345
  id: string;
311
346
  method: "server.mutation";
312
347
  }>;
348
+ export declare const ServerSubscribeRequestSchema: z.ZodObject<{
349
+ jsonrpc: z.ZodLiteral<"2.0">;
350
+ id: z.ZodString;
351
+ method: z.ZodLiteral<"server.subscribe">;
352
+ params: z.ZodObject<{
353
+ subscriptionId: z.ZodString;
354
+ name: z.ZodString;
355
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ name: string;
358
+ subscriptionId: string;
359
+ args?: Record<string, unknown> | undefined;
360
+ }, {
361
+ name: string;
362
+ subscriptionId: string;
363
+ args?: Record<string, unknown> | undefined;
364
+ }>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ params: {
367
+ name: string;
368
+ subscriptionId: string;
369
+ args?: Record<string, unknown> | undefined;
370
+ };
371
+ jsonrpc: "2.0";
372
+ id: string;
373
+ method: "server.subscribe";
374
+ }, {
375
+ params: {
376
+ name: string;
377
+ subscriptionId: string;
378
+ args?: Record<string, unknown> | undefined;
379
+ };
380
+ jsonrpc: "2.0";
381
+ id: string;
382
+ method: "server.subscribe";
383
+ }>;
384
+ export declare const ServerUnsubscribeRequestSchema: z.ZodObject<{
385
+ jsonrpc: z.ZodLiteral<"2.0">;
386
+ id: z.ZodString;
387
+ method: z.ZodLiteral<"server.unsubscribe">;
388
+ params: z.ZodObject<{
389
+ subscriptionId: z.ZodString;
390
+ }, "strip", z.ZodTypeAny, {
391
+ subscriptionId: string;
392
+ }, {
393
+ subscriptionId: string;
394
+ }>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ params: {
397
+ subscriptionId: string;
398
+ };
399
+ jsonrpc: "2.0";
400
+ id: string;
401
+ method: "server.unsubscribe";
402
+ }, {
403
+ params: {
404
+ subscriptionId: string;
405
+ };
406
+ jsonrpc: "2.0";
407
+ id: string;
408
+ method: "server.unsubscribe";
409
+ }>;
313
410
  export declare const EventCallbackNotificationSchema: z.ZodObject<{
314
411
  jsonrpc: z.ZodLiteral<"2.0">;
315
412
  method: z.ZodLiteral<"event.callback">;
@@ -412,6 +509,67 @@ export declare const StorageUpdateNotificationSchema: z.ZodObject<{
412
509
  jsonrpc: "2.0";
413
510
  method: "storage.update";
414
511
  }>;
512
+ export declare const ServerSubscriptionUpdateNotificationSchema: z.ZodObject<{
513
+ jsonrpc: z.ZodLiteral<"2.0">;
514
+ method: z.ZodLiteral<"server.subscription.update">;
515
+ params: z.ZodObject<{
516
+ subscriptionId: z.ZodString;
517
+ data: z.ZodUnknown;
518
+ }, "strip", z.ZodTypeAny, {
519
+ subscriptionId: string;
520
+ data?: unknown;
521
+ }, {
522
+ subscriptionId: string;
523
+ data?: unknown;
524
+ }>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ params: {
527
+ subscriptionId: string;
528
+ data?: unknown;
529
+ };
530
+ jsonrpc: "2.0";
531
+ method: "server.subscription.update";
532
+ }, {
533
+ params: {
534
+ subscriptionId: string;
535
+ data?: unknown;
536
+ };
537
+ jsonrpc: "2.0";
538
+ method: "server.subscription.update";
539
+ }>;
540
+ export declare const ServerSubscriptionErrorNotificationSchema: z.ZodObject<{
541
+ jsonrpc: z.ZodLiteral<"2.0">;
542
+ method: z.ZodLiteral<"server.subscription.error">;
543
+ params: z.ZodObject<{
544
+ subscriptionId: z.ZodString;
545
+ error: z.ZodString;
546
+ message: z.ZodString;
547
+ }, "strip", z.ZodTypeAny, {
548
+ message: string;
549
+ error: string;
550
+ subscriptionId: string;
551
+ }, {
552
+ message: string;
553
+ error: string;
554
+ subscriptionId: string;
555
+ }>;
556
+ }, "strip", z.ZodTypeAny, {
557
+ params: {
558
+ message: string;
559
+ error: string;
560
+ subscriptionId: string;
561
+ };
562
+ jsonrpc: "2.0";
563
+ method: "server.subscription.error";
564
+ }, {
565
+ params: {
566
+ message: string;
567
+ error: string;
568
+ subscriptionId: string;
569
+ };
570
+ jsonrpc: "2.0";
571
+ method: "server.subscription.error";
572
+ }>;
415
573
  export declare const SandboxToHostMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
416
574
  jsonrpc: z.ZodLiteral<"2.0">;
417
575
  method: z.ZodLiteral<"ui.render">;
@@ -553,6 +711,66 @@ export declare const SandboxToHostMessageSchema: z.ZodDiscriminatedUnion<"method
553
711
  jsonrpc: "2.0";
554
712
  id: string;
555
713
  method: "server.mutation";
714
+ }>, z.ZodObject<{
715
+ jsonrpc: z.ZodLiteral<"2.0">;
716
+ id: z.ZodString;
717
+ method: z.ZodLiteral<"server.subscribe">;
718
+ params: z.ZodObject<{
719
+ subscriptionId: z.ZodString;
720
+ name: z.ZodString;
721
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
722
+ }, "strip", z.ZodTypeAny, {
723
+ name: string;
724
+ subscriptionId: string;
725
+ args?: Record<string, unknown> | undefined;
726
+ }, {
727
+ name: string;
728
+ subscriptionId: string;
729
+ args?: Record<string, unknown> | undefined;
730
+ }>;
731
+ }, "strip", z.ZodTypeAny, {
732
+ params: {
733
+ name: string;
734
+ subscriptionId: string;
735
+ args?: Record<string, unknown> | undefined;
736
+ };
737
+ jsonrpc: "2.0";
738
+ id: string;
739
+ method: "server.subscribe";
740
+ }, {
741
+ params: {
742
+ name: string;
743
+ subscriptionId: string;
744
+ args?: Record<string, unknown> | undefined;
745
+ };
746
+ jsonrpc: "2.0";
747
+ id: string;
748
+ method: "server.subscribe";
749
+ }>, z.ZodObject<{
750
+ jsonrpc: z.ZodLiteral<"2.0">;
751
+ id: z.ZodString;
752
+ method: z.ZodLiteral<"server.unsubscribe">;
753
+ params: z.ZodObject<{
754
+ subscriptionId: z.ZodString;
755
+ }, "strip", z.ZodTypeAny, {
756
+ subscriptionId: string;
757
+ }, {
758
+ subscriptionId: string;
759
+ }>;
760
+ }, "strip", z.ZodTypeAny, {
761
+ params: {
762
+ subscriptionId: string;
763
+ };
764
+ jsonrpc: "2.0";
765
+ id: string;
766
+ method: "server.unsubscribe";
767
+ }, {
768
+ params: {
769
+ subscriptionId: string;
770
+ };
771
+ jsonrpc: "2.0";
772
+ id: string;
773
+ method: "server.unsubscribe";
556
774
  }>]>;
557
775
  export declare const HostToSandboxMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
558
776
  jsonrpc: z.ZodLiteral<"2.0">;
@@ -652,6 +870,65 @@ export declare const HostToSandboxMessageSchema: z.ZodDiscriminatedUnion<"method
652
870
  };
653
871
  jsonrpc: "2.0";
654
872
  method: "storage.update";
873
+ }>, z.ZodObject<{
874
+ jsonrpc: z.ZodLiteral<"2.0">;
875
+ method: z.ZodLiteral<"server.subscription.update">;
876
+ params: z.ZodObject<{
877
+ subscriptionId: z.ZodString;
878
+ data: z.ZodUnknown;
879
+ }, "strip", z.ZodTypeAny, {
880
+ subscriptionId: string;
881
+ data?: unknown;
882
+ }, {
883
+ subscriptionId: string;
884
+ data?: unknown;
885
+ }>;
886
+ }, "strip", z.ZodTypeAny, {
887
+ params: {
888
+ subscriptionId: string;
889
+ data?: unknown;
890
+ };
891
+ jsonrpc: "2.0";
892
+ method: "server.subscription.update";
893
+ }, {
894
+ params: {
895
+ subscriptionId: string;
896
+ data?: unknown;
897
+ };
898
+ jsonrpc: "2.0";
899
+ method: "server.subscription.update";
900
+ }>, z.ZodObject<{
901
+ jsonrpc: z.ZodLiteral<"2.0">;
902
+ method: z.ZodLiteral<"server.subscription.error">;
903
+ params: z.ZodObject<{
904
+ subscriptionId: z.ZodString;
905
+ error: z.ZodString;
906
+ message: z.ZodString;
907
+ }, "strip", z.ZodTypeAny, {
908
+ message: string;
909
+ error: string;
910
+ subscriptionId: string;
911
+ }, {
912
+ message: string;
913
+ error: string;
914
+ subscriptionId: string;
915
+ }>;
916
+ }, "strip", z.ZodTypeAny, {
917
+ params: {
918
+ message: string;
919
+ error: string;
920
+ subscriptionId: string;
921
+ };
922
+ jsonrpc: "2.0";
923
+ method: "server.subscription.error";
924
+ }, {
925
+ params: {
926
+ message: string;
927
+ error: string;
928
+ subscriptionId: string;
929
+ };
930
+ jsonrpc: "2.0";
931
+ method: "server.subscription.error";
655
932
  }>]>;
656
933
  export declare function parseSandboxToHostMessage(data: unknown): SandboxToHostMessage;
657
934
  export declare function parseHostToSandboxMessage(data: unknown): HostToSandboxMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,mBAAmB,CAAC;AAMpF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE;QAAE,IAAI,EAAE,OAAO,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CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOrD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQpD,CAAC;AAMH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOrC,CAAC;AAMH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,CAE7E;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,CAE7E"}
@@ -74,6 +74,24 @@ export const ServerMutationRequestSchema = z.object({
74
74
  args: z.record(z.unknown()).optional(),
75
75
  }),
76
76
  });
77
+ export const ServerSubscribeRequestSchema = z.object({
78
+ jsonrpc: z.literal("2.0"),
79
+ id: z.string(),
80
+ method: z.literal("server.subscribe"),
81
+ params: z.object({
82
+ subscriptionId: z.string(),
83
+ name: z.string(),
84
+ args: z.record(z.unknown()).optional(),
85
+ }),
86
+ });
87
+ export const ServerUnsubscribeRequestSchema = z.object({
88
+ jsonrpc: z.literal("2.0"),
89
+ id: z.string(),
90
+ method: z.literal("server.unsubscribe"),
91
+ params: z.object({
92
+ subscriptionId: z.string(),
93
+ }),
94
+ });
77
95
  // ---------------------------------------------------------------------------
78
96
  // Zod schemas – Host → Sandbox
79
97
  // ---------------------------------------------------------------------------
@@ -107,6 +125,23 @@ export const StorageUpdateNotificationSchema = z.object({
107
125
  storage: z.record(z.unknown()),
108
126
  }),
109
127
  });
128
+ export const ServerSubscriptionUpdateNotificationSchema = z.object({
129
+ jsonrpc: z.literal("2.0"),
130
+ method: z.literal("server.subscription.update"),
131
+ params: z.object({
132
+ subscriptionId: z.string(),
133
+ data: z.unknown(),
134
+ }),
135
+ });
136
+ export const ServerSubscriptionErrorNotificationSchema = z.object({
137
+ jsonrpc: z.literal("2.0"),
138
+ method: z.literal("server.subscription.error"),
139
+ params: z.object({
140
+ subscriptionId: z.string(),
141
+ error: z.string(),
142
+ message: z.string(),
143
+ }),
144
+ });
110
145
  // ---------------------------------------------------------------------------
111
146
  // Discriminated union schemas
112
147
  // ---------------------------------------------------------------------------
@@ -117,12 +152,16 @@ export const SandboxToHostMessageSchema = z.discriminatedUnion("method", [
117
152
  StorageSetRequestSchema,
118
153
  ServerQueryRequestSchema,
119
154
  ServerMutationRequestSchema,
155
+ ServerSubscribeRequestSchema,
156
+ ServerUnsubscribeRequestSchema,
120
157
  ]);
121
158
  export const HostToSandboxMessageSchema = z.discriminatedUnion("method", [
122
159
  EventCallbackNotificationSchema,
123
160
  LifecycleInitRequestSchema,
124
161
  LifecycleDestroyNotificationSchema,
125
162
  StorageUpdateNotificationSchema,
163
+ ServerSubscriptionUpdateNotificationSchema,
164
+ ServerSubscriptionErrorNotificationSchema,
126
165
  ]);
127
166
  // ---------------------------------------------------------------------------
128
167
  // Parsers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1upvision/protocol",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Wire protocol types and Zod schemas for the Vision extension platform",
5
5
  "type": "module",
6
6
  "exports": {