@gricha/perry 0.3.20 → 0.3.22

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.
@@ -17,10 +17,14 @@ import { deleteOpencodeSession } from '../sessions/agents/opencode-storage';
17
17
  import { SessionIndex } from '../worker/session-index';
18
18
  import { sessionManager } from '../session-manager';
19
19
  const WorkspaceStatusSchema = z.enum(['running', 'stopped', 'creating', 'error']);
20
+ const PortMappingSchema = z.object({
21
+ host: z.number().int().min(1).max(65535),
22
+ container: z.number().int().min(1).max(65535),
23
+ });
20
24
  const WorkspacePortsSchema = z.object({
21
25
  ssh: z.number(),
22
26
  http: z.number().optional(),
23
- forwards: z.array(z.number()).optional(),
27
+ forwards: z.array(PortMappingSchema).optional(),
24
28
  });
25
29
  const WorkspaceInfoSchema = z.object({
26
30
  name: z.string(),
@@ -225,7 +229,7 @@ export function createRouter(ctx) {
225
229
  });
226
230
  const getPortForwards = os
227
231
  .input(z.object({ name: z.string() }))
228
- .output(z.object({ forwards: z.array(z.number()) }))
232
+ .output(z.object({ forwards: z.array(PortMappingSchema) }))
229
233
  .handler(async ({ input }) => {
230
234
  try {
231
235
  const forwards = await ctx.workspaces.getPortForwards(input.name);
@@ -236,7 +240,7 @@ export function createRouter(ctx) {
236
240
  }
237
241
  });
238
242
  const setPortForwards = os
239
- .input(z.object({ name: z.string(), forwards: z.array(z.number().int().min(1).max(65535)) }))
243
+ .input(z.object({ name: z.string(), forwards: z.array(PortMappingSchema) }))
240
244
  .output(WorkspaceInfoSchema)
241
245
  .handler(async ({ input }) => {
242
246
  try {