@harnessa-fe/protocol
Advanced tools
+41
-0
@@ -13,2 +13,3 @@ /** | ||
| "node-runtime": "node-runtime"; | ||
| "dashboard-client": "dashboard-client"; | ||
| }>; | ||
@@ -56,2 +57,3 @@ export type PeerRole = z.infer<typeof peerRoleSchema>; | ||
| "node-runtime": "node-runtime"; | ||
| "dashboard-client": "dashboard-client"; | ||
| }>; | ||
@@ -295,2 +297,25 @@ projectId: z.ZodString; | ||
| export type HttpBatch = z.infer<typeof httpBatchSchema>; | ||
| /** | ||
| * Push frame the daemon sends to dashboard-client subscribers when session | ||
| * state changes. Coalesced server-side so a chatty session can't spam | ||
| * every subscriber — see `bridge.ts` for the debounce window. | ||
| * | ||
| * `kind` is a coarse hint; dashboards typically just refetch the | ||
| * affected session's detail rather than diffing event-by-event. | ||
| */ | ||
| export declare const dashboardUpdateFrameSchema: z.ZodObject<{ | ||
| type: z.ZodLiteral<"dashboard.update">; | ||
| id: z.ZodString; | ||
| sessionId: z.ZodOptional<z.ZodString>; | ||
| projectId: z.ZodOptional<z.ZodString>; | ||
| kind: z.ZodEnum<{ | ||
| "session.new": "session.new"; | ||
| "session.update": "session.update"; | ||
| "session.closed": "session.closed"; | ||
| "project.update": "project.update"; | ||
| "export.new": "export.new"; | ||
| }>; | ||
| ts: z.ZodNumber; | ||
| }, z.core.$strip>; | ||
| export type DashboardUpdateFrame = z.infer<typeof dashboardUpdateFrameSchema>; | ||
| export declare const frameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
@@ -304,2 +329,3 @@ type: z.ZodLiteral<"hello">; | ||
| "node-runtime": "node-runtime"; | ||
| "dashboard-client": "dashboard-client"; | ||
| }>; | ||
@@ -432,2 +458,15 @@ projectId: z.ZodString; | ||
| }, z.core.$strip>>; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| type: z.ZodLiteral<"dashboard.update">; | ||
| id: z.ZodString; | ||
| sessionId: z.ZodOptional<z.ZodString>; | ||
| projectId: z.ZodOptional<z.ZodString>; | ||
| kind: z.ZodEnum<{ | ||
| "session.new": "session.new"; | ||
| "session.update": "session.update"; | ||
| "session.closed": "session.closed"; | ||
| "project.update": "project.update"; | ||
| "export.new": "export.new"; | ||
| }>; | ||
| ts: z.ZodNumber; | ||
| }, z.core.$strip>], "type">; | ||
@@ -460,2 +499,3 @@ export type Frame = z.infer<typeof frameSchema>; | ||
| readonly TASKS_RESOLVE: "tasks.resolve"; | ||
| readonly DASHBOARD_OPEN: "dashboard.open"; | ||
| }; | ||
@@ -663,2 +703,3 @@ export type CommandName = typeof COMMAND[keyof typeof COMMAND]; | ||
| maxWidth: z.ZodOptional<z.ZodNumber>; | ||
| backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
| }, z.core.$strip>; | ||
@@ -665,0 +706,0 @@ export type ScreenshotArgs = z.infer<typeof screenshotArgsSchema>; |
+36
-1
@@ -10,3 +10,11 @@ /** | ||
| // ─── Identity ─────────────────────────────────────────────────────────────── | ||
| export const peerRoleSchema = z.enum(['vite-plugin', 'webpack-plugin', 'runtime-client', 'node-runtime']); | ||
| export const peerRoleSchema = z.enum([ | ||
| 'vite-plugin', | ||
| 'webpack-plugin', | ||
| 'runtime-client', | ||
| 'node-runtime', | ||
| // Dashboard SPA subscribes to session.update frames over the same WS. | ||
| // Treated as read-only — never receives commands, never sends events. | ||
| 'dashboard-client', | ||
| ]); | ||
| /** | ||
@@ -238,2 +246,18 @@ * Per-visitor environment snapshot — captured once on hello and re-sent on | ||
| }); | ||
| /** | ||
| * Push frame the daemon sends to dashboard-client subscribers when session | ||
| * state changes. Coalesced server-side so a chatty session can't spam | ||
| * every subscriber — see `bridge.ts` for the debounce window. | ||
| * | ||
| * `kind` is a coarse hint; dashboards typically just refetch the | ||
| * affected session's detail rather than diffing event-by-event. | ||
| */ | ||
| export const dashboardUpdateFrameSchema = z.object({ | ||
| type: z.literal('dashboard.update'), | ||
| id: z.string(), | ||
| sessionId: z.string().optional(), | ||
| projectId: z.string().optional(), | ||
| kind: z.enum(['session.new', 'session.update', 'session.closed', 'project.update', 'export.new']), | ||
| ts: z.number(), | ||
| }); | ||
| export const frameSchema = z.discriminatedUnion('type', [ | ||
@@ -249,2 +273,3 @@ helloFrameSchema, | ||
| queryResponseFrameSchema, | ||
| dashboardUpdateFrameSchema, | ||
| ]); | ||
@@ -277,2 +302,3 @@ // ─── Built-in command names (string consts for cross-package use) ─────────── | ||
| TASKS_RESOLVE: 'tasks.resolve', | ||
| DASHBOARD_OPEN: 'dashboard.open', | ||
| }; | ||
@@ -402,2 +428,11 @@ // ─── Event names ──────────────────────────────────────────────────────────── | ||
| maxWidth: z.number().int().positive().optional(), | ||
| /** | ||
| * CSS color used as the opaque backdrop when the captured element (or | ||
| * page) has a transparent background. Default '#ffffff' so screenshots | ||
| * are never visually blank. | ||
| * | ||
| * Pass `null` to opt back into a transparent capture (only meaningful | ||
| * for PNG/WebP — JPEG has no alpha channel). | ||
| */ | ||
| backgroundColor: z.string().nullable().optional(), | ||
| }); | ||
@@ -404,0 +439,0 @@ export const scrollArgsSchema = z.object({ |
+1
-1
| { | ||
| "name": "@harnessa-fe/protocol", | ||
| "version": "2.0.0", | ||
| "version": "3.0.0", | ||
| "description": "Shared types + Zod schemas across mcp-server, vite-plugin, runtime-client.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+38
-1
@@ -13,3 +13,11 @@ /** | ||
| export const peerRoleSchema = z.enum(['vite-plugin', 'webpack-plugin', 'runtime-client', 'node-runtime']); | ||
| export const peerRoleSchema = z.enum([ | ||
| 'vite-plugin', | ||
| 'webpack-plugin', | ||
| 'runtime-client', | ||
| 'node-runtime', | ||
| // Dashboard SPA subscribes to session.update frames over the same WS. | ||
| // Treated as read-only — never receives commands, never sends events. | ||
| 'dashboard-client', | ||
| ]); | ||
| export type PeerRole = z.infer<typeof peerRoleSchema>; | ||
@@ -279,2 +287,20 @@ | ||
| /** | ||
| * Push frame the daemon sends to dashboard-client subscribers when session | ||
| * state changes. Coalesced server-side so a chatty session can't spam | ||
| * every subscriber — see `bridge.ts` for the debounce window. | ||
| * | ||
| * `kind` is a coarse hint; dashboards typically just refetch the | ||
| * affected session's detail rather than diffing event-by-event. | ||
| */ | ||
| export const dashboardUpdateFrameSchema = z.object({ | ||
| type: z.literal('dashboard.update'), | ||
| id: z.string(), | ||
| sessionId: z.string().optional(), | ||
| projectId: z.string().optional(), | ||
| kind: z.enum(['session.new', 'session.update', 'session.closed', 'project.update', 'export.new']), | ||
| ts: z.number(), | ||
| }); | ||
| export type DashboardUpdateFrame = z.infer<typeof dashboardUpdateFrameSchema>; | ||
| export const frameSchema = z.discriminatedUnion('type', [ | ||
@@ -290,2 +316,3 @@ helloFrameSchema, | ||
| queryResponseFrameSchema, | ||
| dashboardUpdateFrameSchema, | ||
| ]); | ||
@@ -321,2 +348,3 @@ export type Frame = z.infer<typeof frameSchema>; | ||
| TASKS_RESOLVE: 'tasks.resolve', | ||
| DASHBOARD_OPEN: 'dashboard.open', | ||
| } as const; | ||
@@ -507,2 +535,11 @@ | ||
| maxWidth: z.number().int().positive().optional(), | ||
| /** | ||
| * CSS color used as the opaque backdrop when the captured element (or | ||
| * page) has a transparent background. Default '#ffffff' so screenshots | ||
| * are never visually blank. | ||
| * | ||
| * Pass `null` to opt back into a transparent capture (only meaningful | ||
| * for PNG/WebP — JPEG has no alpha channel). | ||
| */ | ||
| backgroundColor: z.string().nullable().optional(), | ||
| }); | ||
@@ -509,0 +546,0 @@ export type ScreenshotArgs = z.infer<typeof screenshotArgsSchema>; |
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
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
98968
4.59%2476
4.74%