@tinycloud-ai/tinycloud-cli 0.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.
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@tinycloud-ai/tinycloud-cli",
3
+ "version": "0.1.0",
4
+ "description": "Command-line client for deploying and managing governed, isolated internal apps on Tinycloud.",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "schema",
10
+ "README.md"
11
+ ],
12
+ "bin": {
13
+ "tiny": "./dist/main.js"
14
+ },
15
+ "scripts": {
16
+ "build": "node scripts/build.mjs",
17
+ "prepack": "npm run build"
18
+ },
19
+ "engines": {
20
+ "node": ">=22.18"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/scar-ai/tinycloud.git",
28
+ "directory": "tools/npm-cli"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/scar-ai/tinycloud/issues"
32
+ },
33
+ "homepage": "https://github.com/scar-ai/tinycloud#readme",
34
+ "keywords": [
35
+ "tinycloud",
36
+ "cli",
37
+ "deployment",
38
+ "internal-tools",
39
+ "firecracker",
40
+ "ai-apps"
41
+ ],
42
+ "devDependencies": {
43
+ "@tinycloud/cli": "workspace:*",
44
+ "esbuild": "^0.25.9"
45
+ }
46
+ }
@@ -0,0 +1,234 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.tinycloud.dev/tiny.v1alpha1.json",
4
+ "title": "Tinycloud App manifest",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["apiVersion", "kind", "metadata", "runtime", "access", "lifecycle"],
8
+ "properties": {
9
+ "apiVersion": { "const": "tinycloud.dev/v1alpha1" },
10
+ "kind": { "const": "App" },
11
+ "metadata": { "$ref": "#/$defs/metadata" },
12
+ "runtime": { "$ref": "#/$defs/runtime" },
13
+ "build": { "$ref": "#/$defs/build" },
14
+ "access": { "$ref": "#/$defs/access" },
15
+ "resources": { "$ref": "#/$defs/resources" },
16
+ "capabilities": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/capabilityGrant" } },
17
+ "network": { "$ref": "#/$defs/network" },
18
+ "secrets": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/secretReference" } },
19
+ "lifecycle": { "$ref": "#/$defs/lifecycle" },
20
+ "observability": { "$ref": "#/$defs/observability" }
21
+ },
22
+ "$defs": {
23
+ "duration": { "type": "string", "pattern": "^[1-9][0-9]*(s|m|h|d)$" },
24
+ "name": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,61}[a-z0-9]$" },
25
+ "identifier": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,62}$" },
26
+
27
+ "metadata": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["name", "owner"],
31
+ "properties": {
32
+ "name": { "$ref": "#/$defs/name" },
33
+ "displayName": { "type": "string", "maxLength": 100 },
34
+ "description": { "type": "string", "maxLength": 500 },
35
+ "owner": { "type": "string", "format": "email" },
36
+ "labels": {
37
+ "type": "object",
38
+ "maxProperties": 20,
39
+ "propertyNames": { "type": "string", "pattern": "^[a-z][a-z0-9._-]{0,62}$" },
40
+ "additionalProperties": { "type": "string", "maxLength": 100 }
41
+ }
42
+ }
43
+ },
44
+
45
+ "runtime": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["type", "entrypoint"],
49
+ "properties": {
50
+ "type": { "enum": ["worker", "container"] },
51
+ "language": { "enum": ["typescript", "javascript", "python"] },
52
+ "entrypoint": { "type": "string", "maxLength": 200, "pattern": "^(?!/)(?!.*\\.\\.).+$" },
53
+ "compatibilityDate": { "type": "string", "format": "date" },
54
+ "resources": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "memory": { "type": "string", "pattern": "^[1-9][0-9]*(Mi|Gi)$" },
59
+ "cpuMillis": { "type": "integer", "minimum": 1, "maximum": 4000 },
60
+ "requestTimeout": { "$ref": "#/$defs/duration" },
61
+ "concurrency": { "type": "integer", "minimum": 1, "maximum": 1000 }
62
+ }
63
+ }
64
+ }
65
+ },
66
+
67
+ "build": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "properties": {
71
+ "command": { "type": "string", "maxLength": 300 },
72
+ "output": { "type": "string", "maxLength": 200, "pattern": "^(?!/)(?!.*\\.\\.).+$" },
73
+ "packageManager": { "enum": ["npm", "pnpm", "yarn", "bun"] },
74
+ "lockfileRequired": { "type": "boolean" }
75
+ }
76
+ },
77
+
78
+ "access": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["visibility"],
82
+ "properties": {
83
+ "visibility": { "enum": ["private", "organization", "public"] },
84
+ "requireLogin": { "type": "boolean" },
85
+ "subjects": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/accessSubject" } }
86
+ }
87
+ },
88
+
89
+ "accessSubject": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "properties": {
93
+ "user": { "type": "string", "format": "email" },
94
+ "group": { "$ref": "#/$defs/identifier" },
95
+ "serviceAccount": { "$ref": "#/$defs/identifier" },
96
+ "role": { "enum": ["admin", "editor", "user", "viewer"] }
97
+ },
98
+ "oneOf": [
99
+ { "required": ["user"] },
100
+ { "required": ["group"] },
101
+ { "required": ["serviceAccount"] }
102
+ ]
103
+ },
104
+
105
+ "resources": {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "properties": {
109
+ "database": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["engine"],
113
+ "properties": {
114
+ "engine": { "enum": ["sqlite", "postgres"] },
115
+ "name": { "$ref": "#/$defs/identifier" },
116
+ "migrations": { "type": "string", "maxLength": 200, "pattern": "^(?!/)(?!.*\\.\\.).+$" },
117
+ "retention": { "$ref": "#/$defs/duration" }
118
+ }
119
+ },
120
+ "storage": {
121
+ "type": "array",
122
+ "maxItems": 5,
123
+ "items": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["name"],
127
+ "properties": {
128
+ "name": { "$ref": "#/$defs/identifier" },
129
+ "class": { "enum": ["object"] },
130
+ "maxSize": { "type": "string", "pattern": "^[1-9][0-9]*(Mi|Gi)$" },
131
+ "retention": { "$ref": "#/$defs/duration" }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+
138
+ "capabilityGrant": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": ["name", "connection", "allow"],
142
+ "properties": {
143
+ "name": { "$ref": "#/$defs/identifier" },
144
+ "connection": { "type": "string", "maxLength": 100 },
145
+ "allow": {
146
+ "type": "array",
147
+ "minItems": 1,
148
+ "maxItems": 20,
149
+ "uniqueItems": true,
150
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" }
151
+ },
152
+ "constraints": { "type": "object", "maxProperties": 20 }
153
+ }
154
+ },
155
+
156
+ "network": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "egress": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "mode": { "enum": ["deny", "allowlist"] },
165
+ "allow": {
166
+ "type": "array",
167
+ "maxItems": 20,
168
+ "items": {
169
+ "type": "object",
170
+ "additionalProperties": false,
171
+ "required": ["host"],
172
+ "properties": {
173
+ "host": { "type": "string", "format": "hostname" },
174
+ "ports": { "type": "array", "maxItems": 5, "items": { "type": "integer", "minimum": 1, "maximum": 65535 } }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ },
182
+
183
+ "secretReference": {
184
+ "type": "object",
185
+ "additionalProperties": false,
186
+ "required": ["name", "from"],
187
+ "properties": {
188
+ "name": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,63}$" },
189
+ "from": { "type": "string", "maxLength": 200, "pattern": "^(org|app)/[a-z][a-z0-9-]{0,62}$" },
190
+ "version": { "type": "string", "pattern": "^(latest|[1-9][0-9]*)$" }
191
+ }
192
+ },
193
+
194
+ "lifecycle": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "properties": {
198
+ "sleepAfter": { "type": "string", "pattern": "^[1-9][0-9]*(m|h|d)$" },
199
+ "archiveAfterUnused": { "type": "string", "pattern": "^[1-9][0-9]*d$" },
200
+ "deleteAfterArchived": { "type": "string", "pattern": "^[1-9][0-9]*d$" },
201
+ "previewTtl": { "type": "string", "pattern": "^[1-9][0-9]*(h|d)$" }
202
+ }
203
+ },
204
+
205
+ "observability": {
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "properties": {
209
+ "logLevel": { "enum": ["debug", "info", "warn", "error"] },
210
+ "retention": { "type": "string", "pattern": "^[1-9][0-9]*d$" },
211
+ "traces": {
212
+ "type": "object",
213
+ "additionalProperties": false,
214
+ "properties": { "sampleRate": { "type": "number", "minimum": 0, "maximum": 1 } }
215
+ },
216
+ "alerts": {
217
+ "type": "array",
218
+ "maxItems": 10,
219
+ "items": {
220
+ "type": "object",
221
+ "additionalProperties": false,
222
+ "required": ["type", "threshold"],
223
+ "properties": {
224
+ "type": { "enum": ["errorRate", "latency", "requests"] },
225
+ "threshold": { "type": "number", "minimum": 0 },
226
+ "window": { "$ref": "#/$defs/duration" },
227
+ "notify": { "type": "string", "maxLength": 100 }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }