@ebowwa/codespaces-types 1.4.0 → 1.4.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.
@@ -1,94 +1,68 @@
1
- "use strict";
2
- /**
3
- * Zod schemas for database operations validation
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PluginsUpdateSchema = exports.ActivityUpdateSchema = exports.EnvironmentMetadataSchema = exports.ActivePortSchema = void 0;
7
- var zod_1 = require("zod");
8
- /**
9
- * Active port schema
10
- */
11
- exports.ActivePortSchema = zod_1.z.object({
12
- port: zod_1.z.number().int().min(1).max(65535),
13
- protocol: zod_1.z.enum(["tcp", "udp"]),
14
- service: zod_1.z.string().optional(),
15
- state: zod_1.z.enum(["open", "closed", "filtered"]),
1
+ // @bun
2
+ // runtime/database.ts
3
+ import { z } from "zod";
4
+ var ActivePortSchema = z.object({
5
+ port: z.number().int().min(1).max(65535),
6
+ protocol: z.enum(["tcp", "udp"]),
7
+ service: z.string().optional(),
8
+ state: z.enum(["open", "closed", "filtered"])
16
9
  });
17
- /**
18
- * Environment metadata schema for database operations
19
- */
20
- exports.EnvironmentMetadataSchema = zod_1.z.object({
21
- id: zod_1.z.string(),
22
- description: zod_1.z.string().optional(),
23
- project: zod_1.z.string().optional(),
24
- owner: zod_1.z.string().optional(),
25
- purpose: zod_1.z.string().optional(),
26
- environmentType: zod_1.z
27
- .enum(["development", "staging", "production", "testing"])
28
- .optional(),
29
- hoursActive: zod_1.z.number().min(0).optional(),
30
- lastActive: zod_1.z.string().datetime().optional(),
31
- activePorts: zod_1.z.array(exports.ActivePortSchema).optional(),
32
- sshKeyPath: zod_1.z.string().optional(), // Path to SSH private key for terminal connections
33
- bootstrapStatus: zod_1.z.enum(["bootstrapping", "ready", "failed"]).optional(), // Cloud-init bootstrap status
34
- permissions: zod_1.z
35
- .object({
36
- seedConfig: zod_1.z
37
- .object({
38
- sourceEnvironmentId: zod_1.z.string().optional(),
39
- dependencySnapshot: zod_1.z.string().optional(),
40
- setupScript: zod_1.z.string().optional(),
41
- })
42
- .optional(),
43
- logins: zod_1.z
44
- .object({
45
- github: zod_1.z
46
- .object({
47
- enabled: zod_1.z.boolean(),
48
- username: zod_1.z.string().optional(),
49
- tokenScopes: zod_1.z.array(zod_1.z.string()).optional(),
50
- })
51
- .optional(),
52
- doppler: zod_1.z
53
- .object({
54
- enabled: zod_1.z.boolean(),
55
- project: zod_1.z.string().optional(),
56
- config: zod_1.z.string().optional(),
57
- })
58
- .optional(),
59
- tailscale: zod_1.z
60
- .object({
61
- enabled: zod_1.z.boolean(),
62
- authKey: zod_1.z.string().optional(),
63
- hostname: zod_1.z.string().optional(),
64
- })
65
- .optional(),
66
- })
67
- .optional(),
68
- vpns: zod_1.z
69
- .array(zod_1.z.object({
70
- name: zod_1.z.string(),
71
- type: zod_1.z.enum(["wireguard", "openvpn", "tailscale"]),
72
- config: zod_1.z.string(),
73
- connected: zod_1.z.boolean(),
74
- }))
75
- .optional(),
76
- plugins: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
77
- })
78
- .optional(),
79
- updatedAt: zod_1.z.string().datetime().optional(),
10
+ var EnvironmentMetadataSchema = z.object({
11
+ id: z.string(),
12
+ description: z.string().optional(),
13
+ project: z.string().optional(),
14
+ owner: z.string().optional(),
15
+ purpose: z.string().optional(),
16
+ environmentType: z.enum(["development", "staging", "production", "testing"]).optional(),
17
+ hoursActive: z.number().min(0).optional(),
18
+ lastActive: z.string().datetime().optional(),
19
+ activePorts: z.array(ActivePortSchema).optional(),
20
+ sshKeyPath: z.string().optional(),
21
+ bootstrapStatus: z.enum(["bootstrapping", "ready", "failed"]).optional(),
22
+ permissions: z.object({
23
+ seedConfig: z.object({
24
+ sourceEnvironmentId: z.string().optional(),
25
+ dependencySnapshot: z.string().optional(),
26
+ setupScript: z.string().optional()
27
+ }).optional(),
28
+ logins: z.object({
29
+ github: z.object({
30
+ enabled: z.boolean(),
31
+ username: z.string().optional(),
32
+ tokenScopes: z.array(z.string()).optional()
33
+ }).optional(),
34
+ doppler: z.object({
35
+ enabled: z.boolean(),
36
+ project: z.string().optional(),
37
+ config: z.string().optional()
38
+ }).optional(),
39
+ tailscale: z.object({
40
+ enabled: z.boolean(),
41
+ authKey: z.string().optional(),
42
+ hostname: z.string().optional()
43
+ }).optional()
44
+ }).optional(),
45
+ vpns: z.array(z.object({
46
+ name: z.string(),
47
+ type: z.enum(["wireguard", "openvpn", "tailscale"]),
48
+ config: z.string(),
49
+ connected: z.boolean()
50
+ })).optional(),
51
+ plugins: z.record(z.string(), z.any()).optional()
52
+ }).optional(),
53
+ updatedAt: z.string().datetime().optional()
80
54
  });
81
- /**
82
- * Activity update schema
83
- */
84
- exports.ActivityUpdateSchema = zod_1.z.object({
85
- hoursActive: zod_1.z.number().min(0).optional(),
86
- lastActive: zod_1.z.string().datetime().optional(),
87
- activePorts: zod_1.z.array(exports.ActivePortSchema).optional(),
55
+ var ActivityUpdateSchema = z.object({
56
+ hoursActive: z.number().min(0).optional(),
57
+ lastActive: z.string().datetime().optional(),
58
+ activePorts: z.array(ActivePortSchema).optional()
88
59
  });
89
- /**
90
- * Plugins update schema
91
- */
92
- exports.PluginsUpdateSchema = zod_1.z.object({
93
- plugins: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
60
+ var PluginsUpdateSchema = z.object({
61
+ plugins: z.record(z.string(), z.any()).optional()
94
62
  });
63
+ export {
64
+ PluginsUpdateSchema,
65
+ EnvironmentMetadataSchema,
66
+ ActivityUpdateSchema,
67
+ ActivePortSchema
68
+ };
package/runtime/env.js CHANGED
@@ -1,63 +1,40 @@
1
- "use strict";
2
- /**
3
- * Zod schemas for environment variable validation
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EnvSchema = exports.AIEnvSchema = exports.ServerEnvSchema = void 0;
7
- exports.validateEnv = validateEnv;
8
- exports.validateServerEnv = validateServerEnv;
9
- exports.validateAIEnv = validateAIEnv;
10
- var zod_1 = require("zod");
11
- /**
12
- * Server environment variables schema
13
- */
14
- exports.ServerEnvSchema = zod_1.z.object({
15
- TEMP_UPLOAD_DIR: zod_1.z.string().optional().default('/tmp/cheapspaces-uploads'),
16
- HETZNER_API_TOKEN: zod_1.z.string().min(1).optional(),
1
+ // @bun
2
+ // runtime/env.ts
3
+ import { z } from "zod";
4
+ var ServerEnvSchema = z.object({
5
+ TEMP_UPLOAD_DIR: z.string().optional().default("/tmp/cheapspaces-uploads"),
6
+ HETZNER_API_TOKEN: z.string().min(1).optional()
17
7
  });
18
- /**
19
- * AI client environment variables schema
20
- * At least one API key must be provided
21
- */
22
- exports.AIEnvSchema = zod_1.z
23
- .object({
24
- Z_AI_API_KEY: zod_1.z.string().min(1).optional(),
25
- ZAI_API_KEY: zod_1.z.string().min(1).optional(),
26
- GLM_API_KEY: zod_1.z.string().min(1).optional(),
27
- })
28
- .refine(function (data) { return data.Z_AI_API_KEY || data.ZAI_API_KEY || data.GLM_API_KEY; }, {
29
- message: 'At least one AI API key must be provided (Z_AI_API_KEY, ZAI_API_KEY, or GLM_API_KEY)',
8
+ var AIEnvSchema = z.object({
9
+ Z_AI_API_KEY: z.string().min(1).optional(),
10
+ ZAI_API_KEY: z.string().min(1).optional(),
11
+ GLM_API_KEY: z.string().min(1).optional()
12
+ }).refine((data) => data.Z_AI_API_KEY || data.ZAI_API_KEY || data.GLM_API_KEY, {
13
+ message: "At least one AI API key must be provided (Z_AI_API_KEY, ZAI_API_KEY, or GLM_API_KEY)"
30
14
  });
31
- /**
32
- * Full environment variables schema
33
- */
34
- exports.EnvSchema = zod_1.z.object({
35
- TEMP_UPLOAD_DIR: zod_1.z.string().optional().default('/tmp/cheapspaces-uploads'),
36
- HETZNER_API_TOKEN: zod_1.z.string().min(1).optional(),
37
- Z_AI_API_KEY: zod_1.z.string().min(1).optional(),
38
- ZAI_API_KEY: zod_1.z.string().min(1).optional(),
39
- GLM_API_KEY: zod_1.z.string().min(1).optional(),
40
- }).refine(function (data) { return data.Z_AI_API_KEY || data.ZAI_API_KEY || data.GLM_API_KEY; }, {
41
- message: 'At least one AI API key must be provided (Z_AI_API_KEY, ZAI_API_KEY, or GLM_API_KEY)',
15
+ var EnvSchema = z.object({
16
+ TEMP_UPLOAD_DIR: z.string().optional().default("/tmp/cheapspaces-uploads"),
17
+ HETZNER_API_TOKEN: z.string().min(1).optional(),
18
+ Z_AI_API_KEY: z.string().min(1).optional(),
19
+ ZAI_API_KEY: z.string().min(1).optional(),
20
+ GLM_API_KEY: z.string().min(1).optional()
21
+ }).refine((data) => data.Z_AI_API_KEY || data.ZAI_API_KEY || data.GLM_API_KEY, {
22
+ message: "At least one AI API key must be provided (Z_AI_API_KEY, ZAI_API_KEY, or GLM_API_KEY)"
42
23
  });
43
- /**
44
- * Validate and parse environment variables
45
- */
46
- function validateEnv(env) {
47
- if (env === void 0) { env = process.env; }
48
- return exports.EnvSchema.safeParse(env);
24
+ function validateEnv(env = process.env) {
25
+ return EnvSchema.safeParse(env);
49
26
  }
50
- /**
51
- * Validate and parse server environment variables
52
- */
53
- function validateServerEnv(env) {
54
- if (env === void 0) { env = process.env; }
55
- return exports.ServerEnvSchema.safeParse(env);
27
+ function validateServerEnv(env = process.env) {
28
+ return ServerEnvSchema.safeParse(env);
56
29
  }
57
- /**
58
- * Validate and parse AI environment variables
59
- */
60
- function validateAIEnv(env) {
61
- if (env === void 0) { env = process.env; }
62
- return exports.AIEnvSchema.safeParse(env);
30
+ function validateAIEnv(env = process.env) {
31
+ return AIEnvSchema.safeParse(env);
63
32
  }
33
+ export {
34
+ validateServerEnv,
35
+ validateEnv,
36
+ validateAIEnv,
37
+ ServerEnvSchema,
38
+ EnvSchema,
39
+ AIEnvSchema
40
+ };
package/runtime/glm.js CHANGED
@@ -1,28 +1,16 @@
1
- "use strict";
2
- /**
3
- * Zod schemas for Z.AI GLM API
4
- *
5
- * Provider-specific schemas for Z.AI (GLM) models.
6
- * Generic AI schemas (chat messages, streaming, etc.) are in ./ai.ts
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.GLMModelSchema = void 0;
10
- var zod_1 = require("zod");
11
- // ============================================================================
12
- // Z.AI GLM MODELS
13
- // ============================================================================
14
- /**
15
- * Available GLM models from Z.AI API
16
- */
17
- exports.GLMModelSchema = zod_1.z.enum([
18
- "GLM-4.7",
19
- "GLM-4.6",
20
- "GLM-4.5",
21
- "GLM-4.5-air",
1
+ // @bun
2
+ // runtime/glm.ts
3
+ import { z } from "zod";
4
+ var GLMModelSchema = z.enum([
5
+ "GLM-4.7",
6
+ "GLM-4.6",
7
+ "GLM-4.5",
8
+ "GLM-4.5-air"
22
9
  ]);
23
- // ============================================================================
24
- // EXPORTS
25
- // ============================================================================
26
- exports.default = {
27
- GLMModelSchema: exports.GLMModelSchema,
10
+ var glm_default = {
11
+ GLMModelSchema
12
+ };
13
+ export {
14
+ glm_default as default,
15
+ GLMModelSchema
28
16
  };