@harnessa-fe/protocol
Advanced tools
+57
-0
@@ -236,2 +236,59 @@ /** | ||
| export type QueryResponseFrame = z.infer<typeof queryResponseFrameSchema>; | ||
| export declare const httpBatchSchema: z.ZodObject<{ | ||
| hello: z.ZodObject<{ | ||
| type: z.ZodOptional<z.ZodLiteral<"hello">>; | ||
| id: z.ZodOptional<z.ZodString>; | ||
| projectId: z.ZodString; | ||
| parentProjectId: z.ZodOptional<z.ZodString>; | ||
| displayName: z.ZodOptional<z.ZodString>; | ||
| buildId: z.ZodOptional<z.ZodString>; | ||
| tabId: z.ZodOptional<z.ZodString>; | ||
| sessionId: z.ZodOptional<z.ZodString>; | ||
| visitorId: z.ZodOptional<z.ZodString>; | ||
| userId: z.ZodOptional<z.ZodString>; | ||
| env: z.ZodOptional<z.ZodObject<{ | ||
| userAgent: z.ZodString; | ||
| language: z.ZodString; | ||
| languages: z.ZodArray<z.ZodString>; | ||
| timezone: z.ZodString; | ||
| timezoneOffsetMin: z.ZodNumber; | ||
| screen: z.ZodObject<{ | ||
| width: z.ZodNumber; | ||
| height: z.ZodNumber; | ||
| dpr: z.ZodNumber; | ||
| colorDepth: z.ZodOptional<z.ZodNumber>; | ||
| }, z.core.$strip>; | ||
| viewport: z.ZodObject<{ | ||
| width: z.ZodNumber; | ||
| height: z.ZodNumber; | ||
| }, z.core.$strip>; | ||
| colorScheme: z.ZodEnum<{ | ||
| unknown: "unknown"; | ||
| light: "light"; | ||
| dark: "dark"; | ||
| }>; | ||
| reducedMotion: z.ZodBoolean; | ||
| platform: z.ZodOptional<z.ZodString>; | ||
| }, z.core.$strip>>; | ||
| page: z.ZodOptional<z.ZodObject<{ | ||
| url: z.ZodOptional<z.ZodString>; | ||
| title: z.ZodOptional<z.ZodString>; | ||
| userAgent: z.ZodOptional<z.ZodString>; | ||
| }, z.core.$strip>>; | ||
| role: z.ZodLiteral<"node-runtime">; | ||
| }, z.core.$strip>; | ||
| events: z.ZodArray<z.ZodObject<{ | ||
| type: z.ZodOptional<z.ZodLiteral<"event">>; | ||
| id: z.ZodString; | ||
| tabId: z.ZodOptional<z.ZodString>; | ||
| projectId: z.ZodOptional<z.ZodString>; | ||
| sessionId: z.ZodOptional<z.ZodString>; | ||
| buildId: z.ZodOptional<z.ZodString>; | ||
| visitorId: z.ZodOptional<z.ZodString>; | ||
| name: z.ZodString; | ||
| ts: z.ZodNumber; | ||
| payload: z.ZodOptional<z.ZodUnknown>; | ||
| }, z.core.$strip>>; | ||
| }, z.core.$strip>; | ||
| export type HttpBatch = z.infer<typeof httpBatchSchema>; | ||
| export declare const frameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
@@ -238,0 +295,0 @@ type: z.ZodLiteral<"hello">; |
+9
-0
@@ -228,2 +228,11 @@ /** | ||
| }); | ||
| // ─── HTTP batch transport (Edge Runtime) ──────────────────────────────────── | ||
| // | ||
| // Used by HttpBatchTransport to POST events from Node/Edge environments where | ||
| // a persistent WebSocket is not available. The body carries a hello snapshot | ||
| // plus a batch of event frames — daemon treats it as a stateless hello+events. | ||
| export const httpBatchSchema = z.object({ | ||
| hello: helloFrameSchema.partial({ type: true, id: true }).merge(z.object({ role: z.literal('node-runtime') })), | ||
| events: z.array(eventFrameSchema.partial({ type: true })), | ||
| }); | ||
| export const frameSchema = z.discriminatedUnion('type', [ | ||
@@ -230,0 +239,0 @@ helloFrameSchema, |
+1
-1
| { | ||
| "name": "@harnessa-fe/protocol", | ||
| "version": "0.6.2", | ||
| "version": "0.7.0", | ||
| "description": "Shared types + Zod schemas across mcp-server, vite-plugin, runtime-client.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+14
-0
@@ -264,2 +264,16 @@ /** | ||
| // ─── HTTP batch transport (Edge Runtime) ──────────────────────────────────── | ||
| // | ||
| // Used by HttpBatchTransport to POST events from Node/Edge environments where | ||
| // a persistent WebSocket is not available. The body carries a hello snapshot | ||
| // plus a batch of event frames — daemon treats it as a stateless hello+events. | ||
| export const httpBatchSchema = z.object({ | ||
| hello: helloFrameSchema.partial({ type: true, id: true }).merge( | ||
| z.object({ role: z.literal('node-runtime') }), | ||
| ), | ||
| events: z.array(eventFrameSchema.partial({ type: true })), | ||
| }); | ||
| export type HttpBatch = z.infer<typeof httpBatchSchema>; | ||
| export const frameSchema = z.discriminatedUnion('type', [ | ||
@@ -266,0 +280,0 @@ helloFrameSchema, |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
91485
4.04%2284
3.54%