@h-ai/deploy 0.1.0-alpha.55 → 0.1.0-alpha.57
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/README.en.md +243 -0
- package/README.ja.md +243 -0
- package/README.md +123 -3
- package/dist/index.d.ts +119 -2
- package/dist/index.js +906 -125
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,16 +9,112 @@ import { HaiResult, HaiError } from '@h-ai/core';
|
|
|
9
9
|
* @module deploy-config
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
/** SSH 连接配置(docker-ssh Provider 使用 OpenSSH 客户端连接远程主机) */
|
|
13
|
+
declare const SshConfigSchema: z.ZodObject<{
|
|
14
|
+
host: z.ZodString;
|
|
15
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
username: z.ZodString;
|
|
17
|
+
identityFile: z.ZodOptional<z.ZodString>;
|
|
18
|
+
knownHostsFile: z.ZodOptional<z.ZodString>;
|
|
19
|
+
strictHostKeyChecking: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
connectTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/** 端口直出暴露配置 */
|
|
23
|
+
declare const PortExposeSchema: z.ZodObject<{
|
|
24
|
+
type: z.ZodDefault<z.ZodLiteral<"port">>;
|
|
25
|
+
containerPort: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
hostPort: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
/** docker-ssh 部署平台配置 */
|
|
29
|
+
declare const DockerSshProviderConfigSchema: z.ZodObject<{
|
|
30
|
+
type: z.ZodLiteral<"docker-ssh">;
|
|
31
|
+
ssh: z.ZodObject<{
|
|
32
|
+
host: z.ZodString;
|
|
33
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
username: z.ZodString;
|
|
35
|
+
identityFile: z.ZodOptional<z.ZodString>;
|
|
36
|
+
knownHostsFile: z.ZodOptional<z.ZodString>;
|
|
37
|
+
strictHostKeyChecking: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
connectTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
remote: z.ZodDefault<z.ZodObject<{
|
|
41
|
+
baseDir: z.ZodDefault<z.ZodString>;
|
|
42
|
+
runtime: z.ZodDefault<z.ZodEnum<{
|
|
43
|
+
auto: "auto";
|
|
44
|
+
docker: "docker";
|
|
45
|
+
podman: "podman";
|
|
46
|
+
}>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
expose: z.ZodObject<{
|
|
49
|
+
type: z.ZodDefault<z.ZodLiteral<"port">>;
|
|
50
|
+
containerPort: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
hostPort: z.ZodNumber;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
}, z.core.$strip>;
|
|
12
54
|
/** 部署平台配置联合类型(后续可扩展更多平台) */
|
|
13
55
|
declare const ProviderConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
56
|
type: z.ZodLiteral<"vercel">;
|
|
15
57
|
token: z.ZodString;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"docker-ssh">;
|
|
60
|
+
ssh: z.ZodObject<{
|
|
61
|
+
host: z.ZodString;
|
|
62
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
username: z.ZodString;
|
|
64
|
+
identityFile: z.ZodOptional<z.ZodString>;
|
|
65
|
+
knownHostsFile: z.ZodOptional<z.ZodString>;
|
|
66
|
+
strictHostKeyChecking: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
+
connectTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
remote: z.ZodDefault<z.ZodObject<{
|
|
70
|
+
baseDir: z.ZodDefault<z.ZodString>;
|
|
71
|
+
runtime: z.ZodDefault<z.ZodEnum<{
|
|
72
|
+
auto: "auto";
|
|
73
|
+
docker: "docker";
|
|
74
|
+
podman: "podman";
|
|
75
|
+
}>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
expose: z.ZodObject<{
|
|
78
|
+
type: z.ZodDefault<z.ZodLiteral<"port">>;
|
|
79
|
+
containerPort: z.ZodDefault<z.ZodNumber>;
|
|
80
|
+
hostPort: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>;
|
|
16
82
|
}, z.core.$strip>], "type">;
|
|
83
|
+
/** SSH 连接配置(parse 后) */
|
|
84
|
+
type SshConfig = z.infer<typeof SshConfigSchema>;
|
|
85
|
+
/** 端口暴露配置(parse 后) */
|
|
86
|
+
type PortExposeConfig = z.infer<typeof PortExposeSchema>;
|
|
87
|
+
/** docker-ssh 部署平台配置(parse 后) */
|
|
88
|
+
type DockerSshProviderConfig = z.infer<typeof DockerSshProviderConfigSchema>;
|
|
17
89
|
/** 部署模块完整配置 Schema */
|
|
18
90
|
declare const DeployConfigSchema: z.ZodObject<{
|
|
19
91
|
provider: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
92
|
type: z.ZodLiteral<"vercel">;
|
|
21
93
|
token: z.ZodString;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"docker-ssh">;
|
|
96
|
+
ssh: z.ZodObject<{
|
|
97
|
+
host: z.ZodString;
|
|
98
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
username: z.ZodString;
|
|
100
|
+
identityFile: z.ZodOptional<z.ZodString>;
|
|
101
|
+
knownHostsFile: z.ZodOptional<z.ZodString>;
|
|
102
|
+
strictHostKeyChecking: z.ZodDefault<z.ZodBoolean>;
|
|
103
|
+
connectTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
remote: z.ZodDefault<z.ZodObject<{
|
|
106
|
+
baseDir: z.ZodDefault<z.ZodString>;
|
|
107
|
+
runtime: z.ZodDefault<z.ZodEnum<{
|
|
108
|
+
auto: "auto";
|
|
109
|
+
docker: "docker";
|
|
110
|
+
podman: "podman";
|
|
111
|
+
}>>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
expose: z.ZodObject<{
|
|
114
|
+
type: z.ZodDefault<z.ZodLiteral<"port">>;
|
|
115
|
+
containerPort: z.ZodDefault<z.ZodNumber>;
|
|
116
|
+
hostPort: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>;
|
|
22
118
|
}, z.core.$strip>], "type">;
|
|
23
119
|
services: z.ZodOptional<z.ZodObject<{
|
|
24
120
|
db: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -49,6 +145,13 @@ declare const DeployConfigSchema: z.ZodObject<{
|
|
|
49
145
|
accessKeySecret: z.ZodString;
|
|
50
146
|
}, z.core.$strip>], "provisioner">>;
|
|
51
147
|
}, z.core.$strip>>;
|
|
148
|
+
container: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
runtime: z.ZodDefault<z.ZodEnum<{
|
|
150
|
+
auto: "auto";
|
|
151
|
+
docker: "docker";
|
|
152
|
+
podman: "podman";
|
|
153
|
+
}>>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
52
155
|
}, z.core.$strip>;
|
|
53
156
|
/** 部署配置类型(parse 后) */
|
|
54
157
|
type DeployConfig = z.infer<typeof DeployConfigSchema>;
|
|
@@ -70,6 +173,12 @@ declare const HaiDeployError: {
|
|
|
70
173
|
readonly UNSUPPORTED_TYPE: _h_ai_core.HaiErrorDef;
|
|
71
174
|
readonly CONFIG_ERROR: _h_ai_core.HaiErrorDef;
|
|
72
175
|
readonly CREDENTIAL_ERROR: _h_ai_core.HaiErrorDef;
|
|
176
|
+
readonly CONTAINER_RUNTIME_NOT_FOUND: _h_ai_core.HaiErrorDef;
|
|
177
|
+
readonly CONTAINER_BUILD_FAILED: _h_ai_core.HaiErrorDef;
|
|
178
|
+
readonly REMOTE_CONNECT_FAILED: _h_ai_core.HaiErrorDef;
|
|
179
|
+
readonly REMOTE_COMMAND_FAILED: _h_ai_core.HaiErrorDef;
|
|
180
|
+
readonly IMAGE_TRANSFER_FAILED: _h_ai_core.HaiErrorDef;
|
|
181
|
+
readonly HEALTH_CHECK_FAILED: _h_ai_core.HaiErrorDef;
|
|
73
182
|
};
|
|
74
183
|
/**
|
|
75
184
|
* 部署错误接口
|
|
@@ -94,7 +203,7 @@ interface DeployError {
|
|
|
94
203
|
cause?: unknown;
|
|
95
204
|
}
|
|
96
205
|
/** 基础设施服务类型 */
|
|
97
|
-
type ServiceType = 'db' | 'cache' | 'storage' | 'email' | 'sms';
|
|
206
|
+
type ServiceType = 'db' | 'cache' | 'storage' | 'email' | 'sms' | 'vecdb';
|
|
98
207
|
/**
|
|
99
208
|
* 应用扫描结果
|
|
100
209
|
*
|
|
@@ -107,8 +216,12 @@ interface ScanResult {
|
|
|
107
216
|
isSvelteKit: boolean;
|
|
108
217
|
/** 目标平台 adapter 是否已安装(如 @sveltejs/adapter-vercel) */
|
|
109
218
|
adapterInstalled: boolean;
|
|
219
|
+
/** 容器部署所需的 @sveltejs/adapter-node 是否已安装 */
|
|
220
|
+
nodeAdapterInstalled: boolean;
|
|
110
221
|
/** 检测到的模块依赖需要的服务列表 */
|
|
111
222
|
requiredServices: ServiceType[];
|
|
223
|
+
/** 各服务检测到的后端类型(如 db→postgresql/mysql,vecdb→qdrant),用于生成匹配的 sidecar */
|
|
224
|
+
serviceBackends: Partial<Record<ServiceType, string>>;
|
|
112
225
|
/** 构建命令 */
|
|
113
226
|
buildCommand: string;
|
|
114
227
|
}
|
|
@@ -126,6 +239,10 @@ interface DeployResult {
|
|
|
126
239
|
status: 'ready' | 'building' | 'error';
|
|
127
240
|
/** 已设置的环境变量名列表 */
|
|
128
241
|
envVarsSet: string[];
|
|
242
|
+
/** 部署 Provider 名称(如 vercel / docker-ssh),容器部署时返回 */
|
|
243
|
+
provider?: string;
|
|
244
|
+
/** 健康检查结果:passed 表示 HTTP 探测成功,container-only 表示仅确认容器运行 */
|
|
245
|
+
healthCheck?: 'passed' | 'container-only' | 'skipped';
|
|
129
246
|
}
|
|
130
247
|
/**
|
|
131
248
|
* 基础设施开通结果
|
|
@@ -262,4 +379,4 @@ declare const deploy: DeployFunctions;
|
|
|
262
379
|
/** 读取错误中的恢复清单;仅返回明确允许展示的字段。 */
|
|
263
380
|
declare function getDeployRecovery(error: HaiError): DeployRecoveryInfo | undefined;
|
|
264
381
|
|
|
265
|
-
export { type DeployAppOptions, type DeployConfig, type DeployConfigInput, DeployConfigSchema, type DeployCredentialOperations, type DeployError, type DeployFunctions, type DeployRecoveryInfo, type DeployResult, HaiDeployError, ProviderConfigSchema, type ProvisionResult, type ScanResult, type ServiceType, deploy, getDeployRecovery };
|
|
382
|
+
export { type DeployAppOptions, type DeployConfig, type DeployConfigInput, DeployConfigSchema, type DeployCredentialOperations, type DeployError, type DeployFunctions, type DeployRecoveryInfo, type DeployResult, type DockerSshProviderConfig, HaiDeployError, type PortExposeConfig, ProviderConfigSchema, type ProvisionResult, type ScanResult, type ServiceType, type SshConfig, deploy, getDeployRecovery };
|