@ebowwa/codespaces-types 0.1.0 → 1.1.0

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.
Files changed (45) hide show
  1. package/README.md +34 -37
  2. package/dist/{index.d.ts → compile/index.d.ts} +1 -0
  3. package/dist/compile/index.d.ts.map +1 -0
  4. package/dist/{resources.d.ts → compile/resources.d.ts} +1 -0
  5. package/dist/compile/resources.d.ts.map +1 -0
  6. package/dist/{schemas → compile/schemas}/resources.d.ts +5 -4
  7. package/dist/compile/schemas/resources.d.ts.map +1 -0
  8. package/dist/{terminal-websocket.d.ts → compile/terminal-websocket.d.ts} +1 -0
  9. package/dist/compile/terminal-websocket.d.ts.map +1 -0
  10. package/dist/{time.d.ts → compile/time.d.ts} +1 -0
  11. package/dist/compile/time.d.ts.map +1 -0
  12. package/dist/{user → compile/user}/distributions.d.ts +1 -1
  13. package/dist/compile/user/distributions.d.ts.map +1 -0
  14. package/dist/{user → compile/user}/distributions.js +1 -1
  15. package/dist/{validation.d.ts → compile/validation.d.ts} +1 -0
  16. package/dist/compile/validation.d.ts.map +1 -0
  17. package/dist/runtime/ai.d.ts +1336 -0
  18. package/dist/runtime/ai.d.ts.map +1 -0
  19. package/dist/runtime/ai.js +416 -0
  20. package/dist/runtime/api.d.ts +1304 -0
  21. package/dist/runtime/api.d.ts.map +1 -0
  22. package/dist/runtime/api.js +673 -0
  23. package/dist/runtime/database.d.ts +376 -0
  24. package/dist/runtime/database.d.ts.map +1 -0
  25. package/dist/runtime/database.js +91 -0
  26. package/dist/runtime/env.d.ts +121 -0
  27. package/dist/runtime/env.d.ts.map +1 -0
  28. package/dist/runtime/env.js +54 -0
  29. package/dist/runtime/glm.d.ts +17 -0
  30. package/dist/runtime/glm.d.ts.map +1 -0
  31. package/dist/runtime/glm.js +25 -0
  32. package/dist/runtime/index.d.ts +13 -0
  33. package/dist/runtime/index.d.ts.map +1 -0
  34. package/dist/runtime/index.js +12 -0
  35. package/dist/runtime/ssh.d.ts +111 -0
  36. package/dist/runtime/ssh.d.ts.map +1 -0
  37. package/dist/runtime/ssh.js +44 -0
  38. package/package.json +48 -53
  39. package/LICENSE +0 -21
  40. /package/dist/{index.js → compile/index.js} +0 -0
  41. /package/dist/{resources.js → compile/resources.js} +0 -0
  42. /package/dist/{schemas → compile/schemas}/resources.js +0 -0
  43. /package/dist/{terminal-websocket.js → compile/terminal-websocket.js} +0 -0
  44. /package/dist/{time.js → compile/time.js} +0 -0
  45. /package/dist/{validation.js → compile/validation.js} +0 -0
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Zod schemas for Z.AI GLM API
3
+ *
4
+ * Provider-specific schemas for Z.AI (GLM) models.
5
+ * Generic AI schemas (chat messages, streaming, etc.) are in ./ai.ts
6
+ */
7
+ import { z } from "zod";
8
+ // ============================================================================
9
+ // Z.AI GLM MODELS
10
+ // ============================================================================
11
+ /**
12
+ * Available GLM models from Z.AI API
13
+ */
14
+ export const GLMModelSchema = z.enum([
15
+ "GLM-4.7",
16
+ "GLM-4.6",
17
+ "GLM-4.5",
18
+ "GLM-4.5-air",
19
+ ]);
20
+ // ============================================================================
21
+ // EXPORTS
22
+ // ============================================================================
23
+ export default {
24
+ GLMModelSchema,
25
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Central export point for all Zod schemas
3
+ *
4
+ * Note: Hetzner schemas are in app/backend/shared/lib/hetzner/schemas.ts
5
+ * to keep them with the Hetzner client implementation.
6
+ */
7
+ export * from "./api.js";
8
+ export * from "./ai.js";
9
+ export * from "./database.js";
10
+ export * from "./env.js";
11
+ export * from "./glm.js";
12
+ export * from "./ssh.js";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Central export point for all Zod schemas
3
+ *
4
+ * Note: Hetzner schemas are in app/backend/shared/lib/hetzner/schemas.ts
5
+ * to keep them with the Hetzner client implementation.
6
+ */
7
+ export * from "./api.js";
8
+ export * from "./ai.js";
9
+ export * from "./database.js";
10
+ export * from "./env.js";
11
+ export * from "./glm.js";
12
+ export * from "./ssh.js";
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Zod schemas for SSH operations validation
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * SSH connection options schema
7
+ */
8
+ export declare const SSHOptionsSchema: z.ZodObject<{
9
+ host: z.ZodString;
10
+ user: z.ZodDefault<z.ZodString>;
11
+ timeout: z.ZodDefault<z.ZodNumber>;
12
+ port: z.ZodDefault<z.ZodNumber>;
13
+ keyPath: z.ZodOptional<z.ZodString>;
14
+ password: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ user: string;
17
+ timeout: number;
18
+ port: number;
19
+ host: string;
20
+ keyPath?: string | undefined;
21
+ password?: string | undefined;
22
+ }, {
23
+ host: string;
24
+ user?: string | undefined;
25
+ timeout?: number | undefined;
26
+ port?: number | undefined;
27
+ keyPath?: string | undefined;
28
+ password?: string | undefined;
29
+ }>;
30
+ /**
31
+ * SSH command validation schema
32
+ */
33
+ export declare const SSHCommandSchema: z.ZodString;
34
+ /**
35
+ * SCP options schema (extends SSH options)
36
+ */
37
+ export declare const SCPOptionsSchema: z.ZodObject<{
38
+ host: z.ZodString;
39
+ user: z.ZodDefault<z.ZodString>;
40
+ timeout: z.ZodDefault<z.ZodNumber>;
41
+ port: z.ZodDefault<z.ZodNumber>;
42
+ keyPath: z.ZodOptional<z.ZodString>;
43
+ password: z.ZodOptional<z.ZodString>;
44
+ } & {
45
+ source: z.ZodString;
46
+ destination: z.ZodString;
47
+ recursive: z.ZodDefault<z.ZodBoolean>;
48
+ preserve: z.ZodDefault<z.ZodBoolean>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ user: string;
51
+ timeout: number;
52
+ port: number;
53
+ host: string;
54
+ source: string;
55
+ destination: string;
56
+ recursive: boolean;
57
+ preserve: boolean;
58
+ keyPath?: string | undefined;
59
+ password?: string | undefined;
60
+ }, {
61
+ host: string;
62
+ source: string;
63
+ destination: string;
64
+ user?: string | undefined;
65
+ timeout?: number | undefined;
66
+ port?: number | undefined;
67
+ recursive?: boolean | undefined;
68
+ preserve?: boolean | undefined;
69
+ keyPath?: string | undefined;
70
+ password?: string | undefined;
71
+ }>;
72
+ /**
73
+ * Files list options schema
74
+ */
75
+ export declare const FilesListOptionsSchema: z.ZodObject<{
76
+ host: z.ZodString;
77
+ user: z.ZodDefault<z.ZodString>;
78
+ path: z.ZodDefault<z.ZodString>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ user: string;
81
+ path: string;
82
+ host: string;
83
+ }, {
84
+ host: string;
85
+ user?: string | undefined;
86
+ path?: string | undefined;
87
+ }>;
88
+ /**
89
+ * File preview options schema
90
+ */
91
+ export declare const FilePreviewOptionsSchema: z.ZodObject<{
92
+ host: z.ZodString;
93
+ user: z.ZodDefault<z.ZodString>;
94
+ path: z.ZodString;
95
+ }, "strip", z.ZodTypeAny, {
96
+ user: string;
97
+ path: string;
98
+ host: string;
99
+ }, {
100
+ path: string;
101
+ host: string;
102
+ user?: string | undefined;
103
+ }>;
104
+ /**
105
+ * Type exports for TypeScript inference
106
+ */
107
+ export type SSHOptions = z.infer<typeof SSHOptionsSchema>;
108
+ export type SCPOptions = z.infer<typeof SCPOptionsSchema>;
109
+ export type FilesListOptions = z.infer<typeof FilesListOptionsSchema>;
110
+ export type FilePreviewOptions = z.infer<typeof FilePreviewOptionsSchema>;
111
+ //# sourceMappingURL=ssh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../runtime/ssh.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,aAA+C,CAAA;AAE5E;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK3B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AACrE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Zod schemas for SSH operations validation
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * SSH connection options schema
7
+ */
8
+ export const SSHOptionsSchema = z.object({
9
+ host: z.string().min(1, 'Host is required'),
10
+ user: z.string().default('root'),
11
+ timeout: z.number().int().positive().default(5),
12
+ port: z.number().int().positive().max(65535).default(22),
13
+ keyPath: z.string().optional(),
14
+ password: z.string().optional(),
15
+ });
16
+ /**
17
+ * SSH command validation schema
18
+ */
19
+ export const SSHCommandSchema = z.string().min(1, 'Command cannot be empty');
20
+ /**
21
+ * SCP options schema (extends SSH options)
22
+ */
23
+ export const SCPOptionsSchema = SSHOptionsSchema.extend({
24
+ source: z.string().min(1, 'Source is required'),
25
+ destination: z.string().min(1, 'Destination is required'),
26
+ recursive: z.boolean().default(false),
27
+ preserve: z.boolean().default(false),
28
+ });
29
+ /**
30
+ * Files list options schema
31
+ */
32
+ export const FilesListOptionsSchema = z.object({
33
+ host: z.string().min(1, 'Host is required'),
34
+ user: z.string().default('root'),
35
+ path: z.string().default('.'),
36
+ });
37
+ /**
38
+ * File preview options schema
39
+ */
40
+ export const FilePreviewOptionsSchema = z.object({
41
+ host: z.string().min(1, 'Host is required'),
42
+ user: z.string().default('root'),
43
+ path: z.string().min(1, 'Path is required'),
44
+ });
package/package.json CHANGED
@@ -1,68 +1,63 @@
1
1
  {
2
2
  "name": "@ebowwa/codespaces-types",
3
- "version": "0.1.0",
4
- "description": "Shared TypeScript type definitions for Codespaces packages",
5
- "author": "Ebowwa Labs <labs@ebowwa.com>",
6
- "license": "MIT",
3
+ "version": "1.1.0",
4
+ "description": "Shared types and runtime validation schemas for codespaces projects",
7
5
  "type": "module",
8
- "homepage": "https://github.com/ebowwa/codespaces-types#readme",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/ebowwa/codespaces-types.git"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/ebowwa/codespaces-types/issues"
15
- },
16
- "keywords": [
17
- "typescript",
18
- "types",
19
- "codespaces",
20
- "shared"
21
- ],
22
- "files": [
23
- "dist",
24
- "README.md",
25
- "LICENSE"
26
- ],
27
- "scripts": {
28
- "build": "tsc",
29
- "prepublishOnly": "npm run build",
30
- "typecheck": "tsc --noEmit"
31
- },
32
- "dependencies": {
33
- "zod": "^3.24.1"
34
- },
35
- "devDependencies": {
36
- "@types/node": "^22.10.2",
37
- "typescript": "^5.7.2"
38
- },
39
- "engines": {
40
- "node": ">=18.0.0"
41
- },
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
42
8
  "exports": {
43
9
  ".": {
44
10
  "types": "./dist/index.d.ts",
45
11
  "import": "./dist/index.js"
46
12
  },
47
- "./resources": {
48
- "types": "./dist/resources.d.ts",
49
- "import": "./dist/resources.js"
13
+ "./runtime": {
14
+ "types": "./dist/runtime/index.d.ts",
15
+ "import": "./dist/runtime/index.js"
50
16
  },
51
- "./terminal-websocket": {
52
- "types": "./dist/terminal-websocket.d.ts",
53
- "import": "./dist/terminal-websocket.js"
17
+ "./runtime/api": {
18
+ "types": "./dist/runtime/api.d.ts",
19
+ "import": "./dist/runtime/api.js"
54
20
  },
55
- "./time": {
56
- "types": "./dist/time.d.ts",
57
- "import": "./dist/time.js"
21
+ "./runtime/ai": {
22
+ "types": "./dist/runtime/ai.d.ts",
23
+ "import": "./dist/runtime/ai.js"
58
24
  },
59
- "./validation": {
60
- "types": "./dist/validation.d.ts",
61
- "import": "./dist/validation.js"
25
+ "./runtime/database": {
26
+ "types": "./dist/runtime/database.d.ts",
27
+ "import": "./dist/runtime/database.js"
62
28
  },
63
- "./schemas/resources": {
64
- "types": "./dist/schemas/resources.d.ts",
65
- "import": "./dist/schemas/resources.js"
29
+ "./runtime/env": {
30
+ "types": "./dist/runtime/env.d.ts",
31
+ "import": "./dist/runtime/env.js"
32
+ },
33
+ "./runtime/glm": {
34
+ "types": "./dist/runtime/glm.d.ts",
35
+ "import": "./dist/runtime/glm.js"
36
+ },
37
+ "./runtime/ssh": {
38
+ "types": "./dist/runtime/ssh.d.ts",
39
+ "import": "./dist/runtime/ssh.js"
40
+ },
41
+ "./compile": {
42
+ "types": "./dist/compile/index.d.ts",
43
+ "import": "./dist/compile/index.js"
66
44
  }
45
+ },
46
+ "files": [
47
+ "dist"
48
+ ],
49
+ "scripts": {
50
+ "build": "tsc",
51
+ "prepublishOnly": "npm run build"
52
+ },
53
+ "dependencies": {
54
+ "zod": "^3.22.4"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^20.11.0",
58
+ "typescript": "^5.3.3"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
67
62
  }
68
63
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Ebowwa Labs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
File without changes
File without changes
File without changes
File without changes
File without changes