@gestaltrun/dsh-workspace-bundle 0.1.0 → 0.1.1

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 (39) hide show
  1. package/README.i18n.yaml +6 -6
  2. package/README.md +28 -8
  3. package/README.zh.md +28 -8
  4. package/lib/index.js +1737 -237
  5. package/lib/types/agent-config-contract/agent-configs.d.ts +621 -0
  6. package/lib/types/agent-config-contract/agent-configs.js +68 -0
  7. package/lib/types/agent-config-contract/cs-hosting.d.ts +1333 -0
  8. package/lib/types/agent-config-contract/cs-hosting.js +163 -0
  9. package/lib/types/agent-config-contract/errors.d.ts +224 -0
  10. package/lib/types/agent-config-contract/errors.js +202 -0
  11. package/lib/types/agent-config-contract/ids.d.ts +65 -0
  12. package/lib/types/agent-config-contract/ids.js +35 -0
  13. package/lib/types/agent-config-contract/route.d.ts +56 -0
  14. package/lib/types/agent-config-contract/route.js +1 -0
  15. package/lib/types/agent-config-contract/test-account-claim.d.ts +24 -0
  16. package/lib/types/agent-config-contract/test-account-claim.js +5 -0
  17. package/lib/types/agent-config-format.d.ts +5 -4
  18. package/lib/types/agent-config-format.js +7 -4
  19. package/lib/types/agent-config-observation.d.ts +64 -0
  20. package/lib/types/agent-config-observation.js +448 -0
  21. package/lib/types/agent-config-source.d.ts +31 -5
  22. package/lib/types/agent-config-source.js +175 -32
  23. package/lib/types/agent-config-types.d.ts +33 -0
  24. package/lib/types/bundled-agent-config.d.ts +29 -0
  25. package/lib/types/bundled-agent-config.js +47 -0
  26. package/lib/types/definition.d.ts +18 -4
  27. package/lib/types/definition.js +10 -2
  28. package/lib/types/index.d.ts +9 -1
  29. package/lib/types/index.js +5 -1
  30. package/lib/types/local-host-identity.d.ts +65 -0
  31. package/lib/types/local-host-identity.js +87 -0
  32. package/lib/types/local-host-replacement.d.ts +49 -0
  33. package/lib/types/local-host-replacement.js +112 -0
  34. package/lib/types/provider.d.ts +7 -1
  35. package/lib/types/provider.js +117 -19
  36. package/lib/types/types.d.ts +4 -1
  37. package/locale/en.json +1 -1
  38. package/locale/zh.json +1 -1
  39. package/package.json +17 -13
@@ -0,0 +1,1333 @@
1
+ /** 客服托管权、租约与运行状态检查点契约。子账号归属使用本服务 UserId。 @module */
2
+ import { z } from 'zod';
3
+ /** 旺旺账号的稳定、不透明标识;不作昵称或大小写归一化。 */
4
+ export declare const WangwangAccountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
5
+ export type WangwangAccountId = z.infer<typeof WangwangAccountId>;
6
+ /** 本机安装标识,由 Host 产生并持久保存。 */
7
+ export declare const InstallationId: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
8
+ export type InstallationId = z.infer<typeof InstallationId>;
9
+ /** 云端沙箱标识,不限定执行器的标识格式。 */
10
+ export declare const SandboxId: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
11
+ export type SandboxId = z.infer<typeof SandboxId>;
12
+ /** 持有者种类参与匹配,相同文本的安装与沙箱不是同一持有者。 */
13
+ export declare const HostingHolder: z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ kind: z.ZodLiteral<"installation">;
15
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ kind: z.ZodLiteral<"sandbox">;
18
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
19
+ }, z.core.$strip>], "kind">;
20
+ export type HostingHolder = z.infer<typeof HostingHolder>;
21
+ /** 单调递增的 CAS 代次,JSON 安全整数。 */
22
+ export declare const HostingEpoch: z.ZodNumber;
23
+ export declare const HostingLeaseParams: z.ZodObject<{
24
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
25
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
26
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
27
+ }, z.core.$strip>;
28
+ /** 禁止通过查询串指定身份或客户端时间。 */
29
+ export declare const HostingLeaseQuery: z.ZodObject<{}, z.core.$strict>;
30
+ /** 未开通不保存记录,调用方按本地既有行为继续运行。 */
31
+ export declare const HostingNotEnabled: z.ZodObject<{
32
+ cloudEnabled: z.ZodLiteral<false>;
33
+ serverTime: z.ZodISODateTime;
34
+ }, z.core.$strip>;
35
+ /** 有效性以 serverTime 为准;到期记录保留持有者与 epoch 供 CAS 接管。 */
36
+ export declare const HostingEnabled: z.ZodObject<{
37
+ cloudEnabled: z.ZodLiteral<true>;
38
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
39
+ kind: z.ZodLiteral<"installation">;
40
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"sandbox">;
43
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
44
+ }, z.core.$strip>], "kind">>;
45
+ epoch: z.ZodNumber;
46
+ state: z.ZodEnum<{
47
+ unheld: "unheld";
48
+ active: "active";
49
+ expired: "expired";
50
+ }>;
51
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
52
+ remainingSeconds: z.ZodNumber;
53
+ serverTime: z.ZodISODateTime;
54
+ updatedAt: z.ZodISODateTime;
55
+ }, z.core.$strip>;
56
+ export declare const HostingLeaseResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
+ cloudEnabled: z.ZodLiteral<false>;
58
+ serverTime: z.ZodISODateTime;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ cloudEnabled: z.ZodLiteral<true>;
61
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
62
+ kind: z.ZodLiteral<"installation">;
63
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ kind: z.ZodLiteral<"sandbox">;
66
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
67
+ }, z.core.$strip>], "kind">>;
68
+ epoch: z.ZodNumber;
69
+ state: z.ZodEnum<{
70
+ unheld: "unheld";
71
+ active: "active";
72
+ expired: "expired";
73
+ }>;
74
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
75
+ remainingSeconds: z.ZodNumber;
76
+ serverTime: z.ZodISODateTime;
77
+ updatedAt: z.ZodISODateTime;
78
+ }, z.core.$strip>], "cloudEnabled">;
79
+ export type HostingLeaseResponse = z.infer<typeof HostingLeaseResponse>;
80
+ /** 取得只允许无持有者或已到期;expectedEpoch 必须匹配,成功后加一。 */
81
+ export declare const AcquireHostingLeaseRequest: z.ZodObject<{
82
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
83
+ kind: z.ZodLiteral<"installation">;
84
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"sandbox">;
87
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
88
+ }, z.core.$strip>], "kind">;
89
+ expectedEpoch: z.ZodNumber;
90
+ }, z.core.$strict>;
91
+ /** 云端首次开通只接受当前沙箱;不携带 epoch,也不接受本机安装。 */
92
+ export declare const FirstEnableHostingLeaseRequest: z.ZodObject<{
93
+ holder: z.ZodObject<{
94
+ kind: z.ZodLiteral<"sandbox">;
95
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
96
+ }, z.core.$strict>;
97
+ }, z.core.$strict>;
98
+ /** 续约和释放验证完整持有者与当前 epoch;过期续约拒绝。 */
99
+ export declare const HostingLeaseOwnerRequest: z.ZodObject<{
100
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
101
+ kind: z.ZodLiteral<"installation">;
102
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ kind: z.ZodLiteral<"sandbox">;
105
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
106
+ }, z.core.$strip>], "kind">;
107
+ epoch: z.ZodNumber;
108
+ }, z.core.$strict>;
109
+ /** 交接要求源租约有效;目标获得新 epoch 与完整 TTL。 */
110
+ export declare const HandoffHostingLeaseRequest: z.ZodObject<{
111
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
+ kind: z.ZodLiteral<"installation">;
113
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ kind: z.ZodLiteral<"sandbox">;
116
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
117
+ }, z.core.$strip>], "kind">;
118
+ epoch: z.ZodNumber;
119
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
120
+ kind: z.ZodLiteral<"installation">;
121
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
122
+ }, z.core.$strip>, z.ZodObject<{
123
+ kind: z.ZodLiteral<"sandbox">;
124
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
125
+ }, z.core.$strip>], "kind">;
126
+ }, z.core.$strict>;
127
+ /** 只能查询当前店铺租户中本人的旺旺账号托管权。本账号无记录但同一用户已有 active 持有者时返回该持有者。 */
128
+ export declare const getHostingLease: {
129
+ readonly method: "get";
130
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease";
131
+ readonly summary: "查询本人托管权";
132
+ readonly auth: "tenant";
133
+ readonly request: {
134
+ readonly params: z.ZodObject<{
135
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
136
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
137
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
138
+ }, z.core.$strip>;
139
+ readonly query: z.ZodObject<{}, z.core.$strict>;
140
+ };
141
+ readonly responses: {
142
+ readonly 200: {
143
+ readonly description: "托管权状态。本账号没有记录但同一用户在其他旺旺账号上已有未过期的 active 持有者时,返回该持有者且 cloudEnabled=true。本账号已有未开通记录,或没有其他 active 持有者时,返回 cloudEnabled=false,不创建记录";
144
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
145
+ cloudEnabled: z.ZodLiteral<false>;
146
+ serverTime: z.ZodISODateTime;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ cloudEnabled: z.ZodLiteral<true>;
149
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
150
+ kind: z.ZodLiteral<"installation">;
151
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ kind: z.ZodLiteral<"sandbox">;
154
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
155
+ }, z.core.$strip>], "kind">>;
156
+ epoch: z.ZodNumber;
157
+ state: z.ZodEnum<{
158
+ unheld: "unheld";
159
+ active: "active";
160
+ expired: "expired";
161
+ }>;
162
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
163
+ remainingSeconds: z.ZodNumber;
164
+ serverTime: z.ZodISODateTime;
165
+ updatedAt: z.ZodISODateTime;
166
+ }, z.core.$strip>], "cloudEnabled">;
167
+ readonly headers: {
168
+ readonly 'Cache-Control': {
169
+ readonly description: "租约状态不得缓存";
170
+ readonly schema: z.ZodLiteral<"no-store">;
171
+ };
172
+ };
173
+ };
174
+ };
175
+ readonly problems: {
176
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
177
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
178
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
179
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
180
+ };
181
+ };
182
+ /** 同一用户在其他旺旺账号上已有 active 持有者时回答 HOSTING_HELD,不创建记录。本账号未开通且没有其他 active 持有者时仍返回 cloudEnabled=false。 */
183
+ export declare const acquireHostingLease: {
184
+ readonly method: "post";
185
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/acquire";
186
+ readonly summary: "CAS 取得托管租约";
187
+ readonly auth: "tenant";
188
+ readonly request: {
189
+ readonly params: z.ZodObject<{
190
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
191
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
192
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
193
+ }, z.core.$strip>;
194
+ readonly query: z.ZodObject<{}, z.core.$strict>;
195
+ readonly body: z.ZodObject<{
196
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
197
+ kind: z.ZodLiteral<"installation">;
198
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
199
+ }, z.core.$strip>, z.ZodObject<{
200
+ kind: z.ZodLiteral<"sandbox">;
201
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
202
+ }, z.core.$strip>], "kind">;
203
+ expectedEpoch: z.ZodNumber;
204
+ }, z.core.$strict>;
205
+ };
206
+ readonly responses: {
207
+ readonly 200: {
208
+ readonly description: "托管权状态。同一用户在其他旺旺账号上已有 active 持有者时回答 HOSTING_HELD,不创建记录。本账号未开通且没有其他 active 持有者时返回 cloudEnabled=false,不创建记录";
209
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
210
+ cloudEnabled: z.ZodLiteral<false>;
211
+ serverTime: z.ZodISODateTime;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ cloudEnabled: z.ZodLiteral<true>;
214
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
215
+ kind: z.ZodLiteral<"installation">;
216
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ kind: z.ZodLiteral<"sandbox">;
219
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
220
+ }, z.core.$strip>], "kind">>;
221
+ epoch: z.ZodNumber;
222
+ state: z.ZodEnum<{
223
+ unheld: "unheld";
224
+ active: "active";
225
+ expired: "expired";
226
+ }>;
227
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
228
+ remainingSeconds: z.ZodNumber;
229
+ serverTime: z.ZodISODateTime;
230
+ updatedAt: z.ZodISODateTime;
231
+ }, z.core.$strip>], "cloudEnabled">;
232
+ readonly headers: {
233
+ readonly 'Cache-Control': {
234
+ readonly description: "租约状态不得缓存";
235
+ readonly schema: z.ZodLiteral<"no-store">;
236
+ };
237
+ };
238
+ };
239
+ };
240
+ readonly problems: {
241
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED"];
242
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
243
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
244
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
245
+ };
246
+ };
247
+ /** 没有租约记录时创建 cloudEnabled 的沙箱租约;已有记录拒绝,不抢占。同一用户在其他旺旺账号上已有 active 持有者时回答 HOSTING_HELD,不插入。 */
248
+ export declare const firstEnableHostingLease: {
249
+ readonly method: "post";
250
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/first-enable";
251
+ readonly summary: "云端沙箱首次开通本人托管权";
252
+ readonly auth: "tenant";
253
+ readonly request: {
254
+ readonly params: z.ZodObject<{
255
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
256
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
257
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
258
+ }, z.core.$strip>;
259
+ readonly query: z.ZodObject<{}, z.core.$strict>;
260
+ readonly body: z.ZodObject<{
261
+ holder: z.ZodObject<{
262
+ kind: z.ZodLiteral<"sandbox">;
263
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
264
+ }, z.core.$strict>;
265
+ }, z.core.$strict>;
266
+ };
267
+ readonly responses: {
268
+ readonly 200: {
269
+ readonly description: "已开通的托管权。没有租约记录且同一用户没有其他 active 持有者时创建沙箱持有的 active 租约;同一沙箱重复调用不改变 epoch、持有者或到期时间";
270
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
271
+ cloudEnabled: z.ZodLiteral<false>;
272
+ serverTime: z.ZodISODateTime;
273
+ }, z.core.$strip>, z.ZodObject<{
274
+ cloudEnabled: z.ZodLiteral<true>;
275
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
276
+ kind: z.ZodLiteral<"installation">;
277
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
278
+ }, z.core.$strip>, z.ZodObject<{
279
+ kind: z.ZodLiteral<"sandbox">;
280
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
281
+ }, z.core.$strip>], "kind">>;
282
+ epoch: z.ZodNumber;
283
+ state: z.ZodEnum<{
284
+ unheld: "unheld";
285
+ active: "active";
286
+ expired: "expired";
287
+ }>;
288
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
289
+ remainingSeconds: z.ZodNumber;
290
+ serverTime: z.ZodISODateTime;
291
+ updatedAt: z.ZodISODateTime;
292
+ }, z.core.$strip>], "cloudEnabled">;
293
+ readonly headers: {
294
+ readonly 'Cache-Control': {
295
+ readonly description: "租约状态不得缓存";
296
+ readonly schema: z.ZodLiteral<"no-store">;
297
+ };
298
+ };
299
+ };
300
+ };
301
+ readonly problems: {
302
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH", "CLOUD_NOT_ELIGIBLE", "SANDBOX_SESSION_UNBOUND"];
303
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
304
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
305
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
306
+ };
307
+ };
308
+ /** 已交接或首次开通给沙箱的同一 epoch,在采用及续约时重新确认旧实例退出,成功保持该 epoch。没有租约行,或未完成与锁内判断一致的前任观察时,沙箱续约拒绝且不更新。 */
309
+ export declare const renewHostingLease: {
310
+ readonly method: "post";
311
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/renew";
312
+ readonly summary: "续约本人托管权";
313
+ readonly auth: "tenant";
314
+ readonly request: {
315
+ readonly params: z.ZodObject<{
316
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
317
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
318
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
319
+ }, z.core.$strip>;
320
+ readonly query: z.ZodObject<{}, z.core.$strict>;
321
+ readonly body: z.ZodObject<{
322
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
323
+ kind: z.ZodLiteral<"installation">;
324
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
325
+ }, z.core.$strip>, z.ZodObject<{
326
+ kind: z.ZodLiteral<"sandbox">;
327
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
328
+ }, z.core.$strip>], "kind">;
329
+ epoch: z.ZodNumber;
330
+ }, z.core.$strict>;
331
+ };
332
+ readonly responses: {
333
+ readonly 200: {
334
+ readonly description: "已续约的托管权。本机持有者未开通时返回 cloudEnabled=false 且不创建记录;沙箱持有者没有租约行,或前任观察与锁内判断不一致时不刷新租约";
335
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
336
+ cloudEnabled: z.ZodLiteral<false>;
337
+ serverTime: z.ZodISODateTime;
338
+ }, z.core.$strip>, z.ZodObject<{
339
+ cloudEnabled: z.ZodLiteral<true>;
340
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
341
+ kind: z.ZodLiteral<"installation">;
342
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
343
+ }, z.core.$strip>, z.ZodObject<{
344
+ kind: z.ZodLiteral<"sandbox">;
345
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
346
+ }, z.core.$strip>], "kind">>;
347
+ epoch: z.ZodNumber;
348
+ state: z.ZodEnum<{
349
+ unheld: "unheld";
350
+ active: "active";
351
+ expired: "expired";
352
+ }>;
353
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
354
+ remainingSeconds: z.ZodNumber;
355
+ serverTime: z.ZodISODateTime;
356
+ updatedAt: z.ZodISODateTime;
357
+ }, z.core.$strip>], "cloudEnabled">;
358
+ readonly headers: {
359
+ readonly 'Cache-Control': {
360
+ readonly description: "租约状态不得缓存";
361
+ readonly schema: z.ZodLiteral<"no-store">;
362
+ };
363
+ };
364
+ };
365
+ };
366
+ readonly problems: {
367
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH", "SANDBOX_SESSION_UNBOUND"];
368
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED", "PLACEMENT_KEY_NOT_READY", "PREDECESSOR_STILL_RUNNING"];
369
+ readonly 503: readonly ["SERVICE_UNAVAILABLE", "PREDECESSOR_EXIT_UNKNOWN"];
370
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
371
+ };
372
+ };
373
+ /** 释放推进 epoch 并清空持有者;到期的当前持有者也可释放。 */
374
+ export declare const releaseHostingLease: {
375
+ readonly method: "post";
376
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/release";
377
+ readonly summary: "释放本人托管权";
378
+ readonly auth: "tenant";
379
+ readonly request: {
380
+ readonly params: z.ZodObject<{
381
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
382
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
383
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
384
+ }, z.core.$strip>;
385
+ readonly query: z.ZodObject<{}, z.core.$strict>;
386
+ readonly body: z.ZodObject<{
387
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
388
+ kind: z.ZodLiteral<"installation">;
389
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
390
+ }, z.core.$strip>, z.ZodObject<{
391
+ kind: z.ZodLiteral<"sandbox">;
392
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
393
+ }, z.core.$strip>], "kind">;
394
+ epoch: z.ZodNumber;
395
+ }, z.core.$strict>;
396
+ };
397
+ readonly responses: {
398
+ readonly 200: {
399
+ readonly description: "托管权状态;未开通的操作同样返回 cloudEnabled=false,不创建记录";
400
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
401
+ cloudEnabled: z.ZodLiteral<false>;
402
+ serverTime: z.ZodISODateTime;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ cloudEnabled: z.ZodLiteral<true>;
405
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
406
+ kind: z.ZodLiteral<"installation">;
407
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
408
+ }, z.core.$strip>, z.ZodObject<{
409
+ kind: z.ZodLiteral<"sandbox">;
410
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
411
+ }, z.core.$strip>], "kind">>;
412
+ epoch: z.ZodNumber;
413
+ state: z.ZodEnum<{
414
+ unheld: "unheld";
415
+ active: "active";
416
+ expired: "expired";
417
+ }>;
418
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
419
+ remainingSeconds: z.ZodNumber;
420
+ serverTime: z.ZodISODateTime;
421
+ updatedAt: z.ZodISODateTime;
422
+ }, z.core.$strip>], "cloudEnabled">;
423
+ readonly headers: {
424
+ readonly 'Cache-Control': {
425
+ readonly description: "租约状态不得缓存";
426
+ readonly schema: z.ZodLiteral<"no-store">;
427
+ };
428
+ };
429
+ };
430
+ };
431
+ readonly problems: {
432
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
433
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
434
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
435
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
436
+ };
437
+ };
438
+ export declare const handoffHostingLease: {
439
+ readonly method: "post";
440
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/handoff";
441
+ readonly summary: "CAS 交接本人托管权";
442
+ readonly auth: "tenant";
443
+ readonly request: {
444
+ readonly params: z.ZodObject<{
445
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
446
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
447
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
448
+ }, z.core.$strip>;
449
+ readonly query: z.ZodObject<{}, z.core.$strict>;
450
+ readonly body: z.ZodObject<{
451
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
452
+ kind: z.ZodLiteral<"installation">;
453
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ kind: z.ZodLiteral<"sandbox">;
456
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
457
+ }, z.core.$strip>], "kind">;
458
+ epoch: z.ZodNumber;
459
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
460
+ kind: z.ZodLiteral<"installation">;
461
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
462
+ }, z.core.$strip>, z.ZodObject<{
463
+ kind: z.ZodLiteral<"sandbox">;
464
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
465
+ }, z.core.$strip>], "kind">;
466
+ }, z.core.$strict>;
467
+ };
468
+ readonly responses: {
469
+ readonly 200: {
470
+ readonly description: "托管权状态;未开通的操作同样返回 cloudEnabled=false,不创建记录";
471
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
472
+ cloudEnabled: z.ZodLiteral<false>;
473
+ serverTime: z.ZodISODateTime;
474
+ }, z.core.$strip>, z.ZodObject<{
475
+ cloudEnabled: z.ZodLiteral<true>;
476
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
477
+ kind: z.ZodLiteral<"installation">;
478
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
479
+ }, z.core.$strip>, z.ZodObject<{
480
+ kind: z.ZodLiteral<"sandbox">;
481
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
482
+ }, z.core.$strip>], "kind">>;
483
+ epoch: z.ZodNumber;
484
+ state: z.ZodEnum<{
485
+ unheld: "unheld";
486
+ active: "active";
487
+ expired: "expired";
488
+ }>;
489
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
490
+ remainingSeconds: z.ZodNumber;
491
+ serverTime: z.ZodISODateTime;
492
+ updatedAt: z.ZodISODateTime;
493
+ }, z.core.$strip>], "cloudEnabled">;
494
+ readonly headers: {
495
+ readonly 'Cache-Control': {
496
+ readonly description: "租约状态不得缓存";
497
+ readonly schema: z.ZodLiteral<"no-store">;
498
+ };
499
+ };
500
+ };
501
+ };
502
+ readonly problems: {
503
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED"];
504
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
505
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
506
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
507
+ };
508
+ };
509
+ /** 一条消息流的不透明游标。同一次上报里 streamId 不可重复,不含消息正文。 */
510
+ export declare const HostingStreamCursor: z.ZodObject<{
511
+ streamId: z.ZodString;
512
+ cursor: z.ZodString;
513
+ }, z.core.$strict>;
514
+ export type HostingStreamCursor = z.infer<typeof HostingStreamCursor>;
515
+ /** 各消息流游标,最多 64 条。 */
516
+ export declare const HostingStreamCursors: z.ZodArray<z.ZodObject<{
517
+ streamId: z.ZodString;
518
+ cursor: z.ZodString;
519
+ }, z.core.$strict>>;
520
+ export type HostingStreamCursors = z.infer<typeof HostingStreamCursors>;
521
+ /** 已提交事件的 sha256,不是正文摘要。 */
522
+ export declare const HostingCheckpointSession: z.ZodObject<{
523
+ id: z.ZodString;
524
+ eventCount: z.ZodNumber;
525
+ digest: z.ZodString;
526
+ }, z.core.$strict>;
527
+ export type HostingCheckpointSession = z.infer<typeof HostingCheckpointSession>;
528
+ /** running 正在自动接待,draining 正在排空,stopped 已停止自动接待,unavailable 无法确认仍在接待。 */
529
+ export declare const HostingCheckpointStatus: z.ZodEnum<{
530
+ running: "running";
531
+ draining: "draining";
532
+ stopped: "stopped";
533
+ unavailable: "unavailable";
534
+ }>;
535
+ export type HostingCheckpointStatus = z.infer<typeof HostingCheckpointStatus>;
536
+ /** 规范 SemVer 2.0,最多 200 字符,保留预发布和构建元数据,不接受前缀或空白。 */
537
+ export declare const AgentConfigSemver: z.ZodString;
538
+ /** 与 Host Agent 配置错误分类对齐;查询失败与作用域变化不计采用拒绝。 */
539
+ export declare const AgentConfigErrorCode: z.ZodEnum<{
540
+ AGENT_CONFIG_QUERY_FAILED: "AGENT_CONFIG_QUERY_FAILED";
541
+ AGENT_CONFIG_INVALID: "AGENT_CONFIG_INVALID";
542
+ AGENT_CONFIG_INCOMPATIBLE: "AGENT_CONFIG_INCOMPATIBLE";
543
+ AGENT_CONFIG_DIGEST_MISMATCH: "AGENT_CONFIG_DIGEST_MISMATCH";
544
+ AGENT_CONFIG_DOWNLOAD_FAILED: "AGENT_CONFIG_DOWNLOAD_FAILED";
545
+ AGENT_CONFIG_APPLY_FAILED: "AGENT_CONFIG_APPLY_FAILED";
546
+ AGENT_CONFIG_SCOPE_CHANGED: "AGENT_CONFIG_SCOPE_CHANGED";
547
+ }>;
548
+ export type AgentConfigErrorCode = z.infer<typeof AgentConfigErrorCode>;
549
+ /** 仅包含固定码与已知时的被拒版本,不包含消息、路径、URL 或凭据。 */
550
+ export declare const AgentConfigRejection: z.ZodObject<{
551
+ code: z.ZodEnum<{
552
+ AGENT_CONFIG_QUERY_FAILED: "AGENT_CONFIG_QUERY_FAILED";
553
+ AGENT_CONFIG_INVALID: "AGENT_CONFIG_INVALID";
554
+ AGENT_CONFIG_INCOMPATIBLE: "AGENT_CONFIG_INCOMPATIBLE";
555
+ AGENT_CONFIG_DIGEST_MISMATCH: "AGENT_CONFIG_DIGEST_MISMATCH";
556
+ AGENT_CONFIG_DOWNLOAD_FAILED: "AGENT_CONFIG_DOWNLOAD_FAILED";
557
+ AGENT_CONFIG_APPLY_FAILED: "AGENT_CONFIG_APPLY_FAILED";
558
+ AGENT_CONFIG_SCOPE_CHANGED: "AGENT_CONFIG_SCOPE_CHANGED";
559
+ }>;
560
+ version: z.ZodOptional<z.ZodString>;
561
+ }, z.core.$strict>;
562
+ export type AgentConfigRejection = z.infer<typeof AgentConfigRejection>;
563
+ /**
564
+ * 某个旺旺账号的最新运行状态检查点。revision 从 1 起,跨 epoch 单调递增,不随代次重置。
565
+ * reportedAt 是服务端记下的上报时间,调用方用它判断是否过期。旧检查点不能作为补发依据。
566
+ */
567
+ export declare const HostingCheckpoint: z.ZodObject<{
568
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
569
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
570
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
571
+ epoch: z.ZodNumber;
572
+ revision: z.ZodNumber;
573
+ streamCursors: z.ZodArray<z.ZodObject<{
574
+ streamId: z.ZodString;
575
+ cursor: z.ZodString;
576
+ }, z.core.$strict>>;
577
+ session: z.ZodNullable<z.ZodObject<{
578
+ id: z.ZodString;
579
+ eventCount: z.ZodNumber;
580
+ digest: z.ZodString;
581
+ }, z.core.$strict>>;
582
+ pendingCount: z.ZodNumber;
583
+ unknownSendCount: z.ZodNumber;
584
+ status: z.ZodEnum<{
585
+ running: "running";
586
+ draining: "draining";
587
+ stopped: "stopped";
588
+ unavailable: "unavailable";
589
+ }>;
590
+ hostVersion: z.ZodString;
591
+ reportedAt: z.ZodISODateTime;
592
+ }, z.core.$strict>;
593
+ export type HostingCheckpoint = z.infer<typeof HostingCheckpoint>;
594
+ /**
595
+ * 上报当前检查点。expectedRevision 为 0 表示尚无记录,否则必须等于当前 revision。
596
+ * 只接受 held 且 epoch 匹配的托管租约;未开通、未持有或 epoch 不同为 HOSTING_EPOCH_MISMATCH。
597
+ * revision 不匹配或加一后超出安全整数为 HOSTING_REVISION_MISMATCH,且不修改记录。限制开关关闭时不比较持有者;开启时本地请求必须提供与模块名册一致的 holder。
598
+ */
599
+ export declare const ReportHostingCheckpointRequest: z.ZodObject<{
600
+ holder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
601
+ kind: z.ZodLiteral<"installation">;
602
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
603
+ }, z.core.$strip>, z.ZodObject<{
604
+ kind: z.ZodLiteral<"sandbox">;
605
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
606
+ }, z.core.$strip>], "kind">>;
607
+ epoch: z.ZodNumber;
608
+ expectedRevision: z.ZodNumber;
609
+ streamCursors: z.ZodArray<z.ZodObject<{
610
+ streamId: z.ZodString;
611
+ cursor: z.ZodString;
612
+ }, z.core.$strict>>;
613
+ session: z.ZodNullable<z.ZodObject<{
614
+ id: z.ZodString;
615
+ eventCount: z.ZodNumber;
616
+ digest: z.ZodString;
617
+ }, z.core.$strict>>;
618
+ pendingCount: z.ZodNumber;
619
+ unknownSendCount: z.ZodNumber;
620
+ status: z.ZodEnum<{
621
+ running: "running";
622
+ draining: "draining";
623
+ stopped: "stopped";
624
+ unavailable: "unavailable";
625
+ }>;
626
+ hostVersion: z.ZodString;
627
+ agentConfigVersion: z.ZodOptional<z.ZodString>;
628
+ hostAgentConfigApiVersion: z.ZodOptional<z.ZodString>;
629
+ agentConfigBlocked: z.ZodOptional<z.ZodBoolean>;
630
+ agentConfigRejection: z.ZodOptional<z.ZodNullable<z.ZodObject<{
631
+ code: z.ZodEnum<{
632
+ AGENT_CONFIG_QUERY_FAILED: "AGENT_CONFIG_QUERY_FAILED";
633
+ AGENT_CONFIG_INVALID: "AGENT_CONFIG_INVALID";
634
+ AGENT_CONFIG_INCOMPATIBLE: "AGENT_CONFIG_INCOMPATIBLE";
635
+ AGENT_CONFIG_DIGEST_MISMATCH: "AGENT_CONFIG_DIGEST_MISMATCH";
636
+ AGENT_CONFIG_DOWNLOAD_FAILED: "AGENT_CONFIG_DOWNLOAD_FAILED";
637
+ AGENT_CONFIG_APPLY_FAILED: "AGENT_CONFIG_APPLY_FAILED";
638
+ AGENT_CONFIG_SCOPE_CHANGED: "AGENT_CONFIG_SCOPE_CHANGED";
639
+ }>;
640
+ version: z.ZodOptional<z.ZodString>;
641
+ }, z.core.$strict>>>;
642
+ }, z.core.$strict>;
643
+ export type ReportHostingCheckpointRequest = z.infer<typeof ReportHostingCheckpointRequest>;
644
+ /** 读取本人该旺旺账号的最新检查点。没有记录时 404,不把缺失当成可补发的空游标。 */
645
+ export declare const getHostingCheckpoint: {
646
+ readonly method: "get";
647
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/checkpoint";
648
+ readonly summary: "读取本人运行状态检查点";
649
+ readonly auth: "tenant";
650
+ readonly request: {
651
+ readonly params: z.ZodObject<{
652
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
653
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
654
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
655
+ }, z.core.$strip>;
656
+ readonly query: z.ZodObject<{}, z.core.$strict>;
657
+ };
658
+ readonly responses: {
659
+ readonly 200: {
660
+ readonly description: "最新运行状态与游标。reportedAt 为上报时间,调用方据此判断是否过期;旧检查点不能作为补发依据";
661
+ readonly schema: z.ZodObject<{
662
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
663
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
664
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
665
+ epoch: z.ZodNumber;
666
+ revision: z.ZodNumber;
667
+ streamCursors: z.ZodArray<z.ZodObject<{
668
+ streamId: z.ZodString;
669
+ cursor: z.ZodString;
670
+ }, z.core.$strict>>;
671
+ session: z.ZodNullable<z.ZodObject<{
672
+ id: z.ZodString;
673
+ eventCount: z.ZodNumber;
674
+ digest: z.ZodString;
675
+ }, z.core.$strict>>;
676
+ pendingCount: z.ZodNumber;
677
+ unknownSendCount: z.ZodNumber;
678
+ status: z.ZodEnum<{
679
+ running: "running";
680
+ draining: "draining";
681
+ stopped: "stopped";
682
+ unavailable: "unavailable";
683
+ }>;
684
+ hostVersion: z.ZodString;
685
+ reportedAt: z.ZodISODateTime;
686
+ }, z.core.$strict>;
687
+ readonly headers: {
688
+ readonly 'Cache-Control': {
689
+ readonly description: "检查点不得缓存";
690
+ readonly schema: z.ZodLiteral<"no-store">;
691
+ };
692
+ };
693
+ };
694
+ };
695
+ readonly problems: {
696
+ readonly 404: readonly ["NOT_FOUND"];
697
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
698
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
699
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
700
+ readonly 409: readonly ["TENANT_NOT_CURRENT"];
701
+ };
702
+ };
703
+ /** 当前持有者上报。本机会话与沙箱会话都只按租约 epoch 判断,旧 epoch 或旧 revision 被拒绝。 */
704
+ export declare const reportHostingCheckpoint: {
705
+ readonly method: "post";
706
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/checkpoint";
707
+ readonly summary: "CAS 上报本人运行状态检查点";
708
+ readonly auth: "tenant";
709
+ readonly request: {
710
+ readonly params: z.ZodObject<{
711
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
712
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
713
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
714
+ }, z.core.$strip>;
715
+ readonly query: z.ZodObject<{}, z.core.$strict>;
716
+ readonly body: z.ZodObject<{
717
+ holder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
718
+ kind: z.ZodLiteral<"installation">;
719
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
720
+ }, z.core.$strip>, z.ZodObject<{
721
+ kind: z.ZodLiteral<"sandbox">;
722
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
723
+ }, z.core.$strip>], "kind">>;
724
+ epoch: z.ZodNumber;
725
+ expectedRevision: z.ZodNumber;
726
+ streamCursors: z.ZodArray<z.ZodObject<{
727
+ streamId: z.ZodString;
728
+ cursor: z.ZodString;
729
+ }, z.core.$strict>>;
730
+ session: z.ZodNullable<z.ZodObject<{
731
+ id: z.ZodString;
732
+ eventCount: z.ZodNumber;
733
+ digest: z.ZodString;
734
+ }, z.core.$strict>>;
735
+ pendingCount: z.ZodNumber;
736
+ unknownSendCount: z.ZodNumber;
737
+ status: z.ZodEnum<{
738
+ running: "running";
739
+ draining: "draining";
740
+ stopped: "stopped";
741
+ unavailable: "unavailable";
742
+ }>;
743
+ hostVersion: z.ZodString;
744
+ agentConfigVersion: z.ZodOptional<z.ZodString>;
745
+ hostAgentConfigApiVersion: z.ZodOptional<z.ZodString>;
746
+ agentConfigBlocked: z.ZodOptional<z.ZodBoolean>;
747
+ agentConfigRejection: z.ZodOptional<z.ZodNullable<z.ZodObject<{
748
+ code: z.ZodEnum<{
749
+ AGENT_CONFIG_QUERY_FAILED: "AGENT_CONFIG_QUERY_FAILED";
750
+ AGENT_CONFIG_INVALID: "AGENT_CONFIG_INVALID";
751
+ AGENT_CONFIG_INCOMPATIBLE: "AGENT_CONFIG_INCOMPATIBLE";
752
+ AGENT_CONFIG_DIGEST_MISMATCH: "AGENT_CONFIG_DIGEST_MISMATCH";
753
+ AGENT_CONFIG_DOWNLOAD_FAILED: "AGENT_CONFIG_DOWNLOAD_FAILED";
754
+ AGENT_CONFIG_APPLY_FAILED: "AGENT_CONFIG_APPLY_FAILED";
755
+ AGENT_CONFIG_SCOPE_CHANGED: "AGENT_CONFIG_SCOPE_CHANGED";
756
+ }>;
757
+ version: z.ZodOptional<z.ZodString>;
758
+ }, z.core.$strict>>>;
759
+ }, z.core.$strict>;
760
+ };
761
+ readonly responses: {
762
+ readonly 200: {
763
+ readonly description: "最新运行状态与游标。reportedAt 为上报时间,调用方据此判断是否过期;旧检查点不能作为补发依据";
764
+ readonly schema: z.ZodObject<{
765
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
766
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
767
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
768
+ epoch: z.ZodNumber;
769
+ revision: z.ZodNumber;
770
+ streamCursors: z.ZodArray<z.ZodObject<{
771
+ streamId: z.ZodString;
772
+ cursor: z.ZodString;
773
+ }, z.core.$strict>>;
774
+ session: z.ZodNullable<z.ZodObject<{
775
+ id: z.ZodString;
776
+ eventCount: z.ZodNumber;
777
+ digest: z.ZodString;
778
+ }, z.core.$strict>>;
779
+ pendingCount: z.ZodNumber;
780
+ unknownSendCount: z.ZodNumber;
781
+ status: z.ZodEnum<{
782
+ running: "running";
783
+ draining: "draining";
784
+ stopped: "stopped";
785
+ unavailable: "unavailable";
786
+ }>;
787
+ hostVersion: z.ZodString;
788
+ reportedAt: z.ZodISODateTime;
789
+ }, z.core.$strict>;
790
+ readonly headers: {
791
+ readonly 'Cache-Control': {
792
+ readonly description: "检查点不得缓存";
793
+ readonly schema: z.ZodLiteral<"no-store">;
794
+ };
795
+ };
796
+ };
797
+ };
798
+ readonly problems: {
799
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_REVISION_MISMATCH", "HOSTING_HOLDER_MISMATCH", "LOCAL_HOST_REPLACED"];
800
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
801
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
802
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
803
+ };
804
+ };
805
+ export declare const CS_HOSTING_ROUTES: readonly [{
806
+ readonly method: "get";
807
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease";
808
+ readonly summary: "查询本人托管权";
809
+ readonly auth: "tenant";
810
+ readonly request: {
811
+ readonly params: z.ZodObject<{
812
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
813
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
814
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
815
+ }, z.core.$strip>;
816
+ readonly query: z.ZodObject<{}, z.core.$strict>;
817
+ };
818
+ readonly responses: {
819
+ readonly 200: {
820
+ readonly description: "托管权状态。本账号没有记录但同一用户在其他旺旺账号上已有未过期的 active 持有者时,返回该持有者且 cloudEnabled=true。本账号已有未开通记录,或没有其他 active 持有者时,返回 cloudEnabled=false,不创建记录";
821
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
822
+ cloudEnabled: z.ZodLiteral<false>;
823
+ serverTime: z.ZodISODateTime;
824
+ }, z.core.$strip>, z.ZodObject<{
825
+ cloudEnabled: z.ZodLiteral<true>;
826
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
827
+ kind: z.ZodLiteral<"installation">;
828
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
829
+ }, z.core.$strip>, z.ZodObject<{
830
+ kind: z.ZodLiteral<"sandbox">;
831
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
832
+ }, z.core.$strip>], "kind">>;
833
+ epoch: z.ZodNumber;
834
+ state: z.ZodEnum<{
835
+ unheld: "unheld";
836
+ active: "active";
837
+ expired: "expired";
838
+ }>;
839
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
840
+ remainingSeconds: z.ZodNumber;
841
+ serverTime: z.ZodISODateTime;
842
+ updatedAt: z.ZodISODateTime;
843
+ }, z.core.$strip>], "cloudEnabled">;
844
+ readonly headers: {
845
+ readonly 'Cache-Control': {
846
+ readonly description: "租约状态不得缓存";
847
+ readonly schema: z.ZodLiteral<"no-store">;
848
+ };
849
+ };
850
+ };
851
+ };
852
+ readonly problems: {
853
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
854
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
855
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
856
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
857
+ };
858
+ }, {
859
+ readonly method: "post";
860
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/acquire";
861
+ readonly summary: "CAS 取得托管租约";
862
+ readonly auth: "tenant";
863
+ readonly request: {
864
+ readonly params: z.ZodObject<{
865
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
866
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
867
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
868
+ }, z.core.$strip>;
869
+ readonly query: z.ZodObject<{}, z.core.$strict>;
870
+ readonly body: z.ZodObject<{
871
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
872
+ kind: z.ZodLiteral<"installation">;
873
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
874
+ }, z.core.$strip>, z.ZodObject<{
875
+ kind: z.ZodLiteral<"sandbox">;
876
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
877
+ }, z.core.$strip>], "kind">;
878
+ expectedEpoch: z.ZodNumber;
879
+ }, z.core.$strict>;
880
+ };
881
+ readonly responses: {
882
+ readonly 200: {
883
+ readonly description: "托管权状态。同一用户在其他旺旺账号上已有 active 持有者时回答 HOSTING_HELD,不创建记录。本账号未开通且没有其他 active 持有者时返回 cloudEnabled=false,不创建记录";
884
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
885
+ cloudEnabled: z.ZodLiteral<false>;
886
+ serverTime: z.ZodISODateTime;
887
+ }, z.core.$strip>, z.ZodObject<{
888
+ cloudEnabled: z.ZodLiteral<true>;
889
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
890
+ kind: z.ZodLiteral<"installation">;
891
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
892
+ }, z.core.$strip>, z.ZodObject<{
893
+ kind: z.ZodLiteral<"sandbox">;
894
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
895
+ }, z.core.$strip>], "kind">>;
896
+ epoch: z.ZodNumber;
897
+ state: z.ZodEnum<{
898
+ unheld: "unheld";
899
+ active: "active";
900
+ expired: "expired";
901
+ }>;
902
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
903
+ remainingSeconds: z.ZodNumber;
904
+ serverTime: z.ZodISODateTime;
905
+ updatedAt: z.ZodISODateTime;
906
+ }, z.core.$strip>], "cloudEnabled">;
907
+ readonly headers: {
908
+ readonly 'Cache-Control': {
909
+ readonly description: "租约状态不得缓存";
910
+ readonly schema: z.ZodLiteral<"no-store">;
911
+ };
912
+ };
913
+ };
914
+ };
915
+ readonly problems: {
916
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED"];
917
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
918
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
919
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
920
+ };
921
+ }, {
922
+ readonly method: "post";
923
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/first-enable";
924
+ readonly summary: "云端沙箱首次开通本人托管权";
925
+ readonly auth: "tenant";
926
+ readonly request: {
927
+ readonly params: z.ZodObject<{
928
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
929
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
930
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
931
+ }, z.core.$strip>;
932
+ readonly query: z.ZodObject<{}, z.core.$strict>;
933
+ readonly body: z.ZodObject<{
934
+ holder: z.ZodObject<{
935
+ kind: z.ZodLiteral<"sandbox">;
936
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
937
+ }, z.core.$strict>;
938
+ }, z.core.$strict>;
939
+ };
940
+ readonly responses: {
941
+ readonly 200: {
942
+ readonly description: "已开通的托管权。没有租约记录且同一用户没有其他 active 持有者时创建沙箱持有的 active 租约;同一沙箱重复调用不改变 epoch、持有者或到期时间";
943
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
944
+ cloudEnabled: z.ZodLiteral<false>;
945
+ serverTime: z.ZodISODateTime;
946
+ }, z.core.$strip>, z.ZodObject<{
947
+ cloudEnabled: z.ZodLiteral<true>;
948
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
949
+ kind: z.ZodLiteral<"installation">;
950
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
951
+ }, z.core.$strip>, z.ZodObject<{
952
+ kind: z.ZodLiteral<"sandbox">;
953
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
954
+ }, z.core.$strip>], "kind">>;
955
+ epoch: z.ZodNumber;
956
+ state: z.ZodEnum<{
957
+ unheld: "unheld";
958
+ active: "active";
959
+ expired: "expired";
960
+ }>;
961
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
962
+ remainingSeconds: z.ZodNumber;
963
+ serverTime: z.ZodISODateTime;
964
+ updatedAt: z.ZodISODateTime;
965
+ }, z.core.$strip>], "cloudEnabled">;
966
+ readonly headers: {
967
+ readonly 'Cache-Control': {
968
+ readonly description: "租约状态不得缓存";
969
+ readonly schema: z.ZodLiteral<"no-store">;
970
+ };
971
+ };
972
+ };
973
+ };
974
+ readonly problems: {
975
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH", "CLOUD_NOT_ELIGIBLE", "SANDBOX_SESSION_UNBOUND"];
976
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
977
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
978
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
979
+ };
980
+ }, {
981
+ readonly method: "post";
982
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/renew";
983
+ readonly summary: "续约本人托管权";
984
+ readonly auth: "tenant";
985
+ readonly request: {
986
+ readonly params: z.ZodObject<{
987
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
988
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
989
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
990
+ }, z.core.$strip>;
991
+ readonly query: z.ZodObject<{}, z.core.$strict>;
992
+ readonly body: z.ZodObject<{
993
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
994
+ kind: z.ZodLiteral<"installation">;
995
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
996
+ }, z.core.$strip>, z.ZodObject<{
997
+ kind: z.ZodLiteral<"sandbox">;
998
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
999
+ }, z.core.$strip>], "kind">;
1000
+ epoch: z.ZodNumber;
1001
+ }, z.core.$strict>;
1002
+ };
1003
+ readonly responses: {
1004
+ readonly 200: {
1005
+ readonly description: "已续约的托管权。本机持有者未开通时返回 cloudEnabled=false 且不创建记录;沙箱持有者没有租约行,或前任观察与锁内判断不一致时不刷新租约";
1006
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1007
+ cloudEnabled: z.ZodLiteral<false>;
1008
+ serverTime: z.ZodISODateTime;
1009
+ }, z.core.$strip>, z.ZodObject<{
1010
+ cloudEnabled: z.ZodLiteral<true>;
1011
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1012
+ kind: z.ZodLiteral<"installation">;
1013
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1014
+ }, z.core.$strip>, z.ZodObject<{
1015
+ kind: z.ZodLiteral<"sandbox">;
1016
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1017
+ }, z.core.$strip>], "kind">>;
1018
+ epoch: z.ZodNumber;
1019
+ state: z.ZodEnum<{
1020
+ unheld: "unheld";
1021
+ active: "active";
1022
+ expired: "expired";
1023
+ }>;
1024
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
1025
+ remainingSeconds: z.ZodNumber;
1026
+ serverTime: z.ZodISODateTime;
1027
+ updatedAt: z.ZodISODateTime;
1028
+ }, z.core.$strip>], "cloudEnabled">;
1029
+ readonly headers: {
1030
+ readonly 'Cache-Control': {
1031
+ readonly description: "租约状态不得缓存";
1032
+ readonly schema: z.ZodLiteral<"no-store">;
1033
+ };
1034
+ };
1035
+ };
1036
+ };
1037
+ readonly problems: {
1038
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH", "SANDBOX_SESSION_UNBOUND"];
1039
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED", "PLACEMENT_KEY_NOT_READY", "PREDECESSOR_STILL_RUNNING"];
1040
+ readonly 503: readonly ["SERVICE_UNAVAILABLE", "PREDECESSOR_EXIT_UNKNOWN"];
1041
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
1042
+ };
1043
+ }, {
1044
+ readonly method: "post";
1045
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/release";
1046
+ readonly summary: "释放本人托管权";
1047
+ readonly auth: "tenant";
1048
+ readonly request: {
1049
+ readonly params: z.ZodObject<{
1050
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1051
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1052
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1053
+ }, z.core.$strip>;
1054
+ readonly query: z.ZodObject<{}, z.core.$strict>;
1055
+ readonly body: z.ZodObject<{
1056
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
1057
+ kind: z.ZodLiteral<"installation">;
1058
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1059
+ }, z.core.$strip>, z.ZodObject<{
1060
+ kind: z.ZodLiteral<"sandbox">;
1061
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1062
+ }, z.core.$strip>], "kind">;
1063
+ epoch: z.ZodNumber;
1064
+ }, z.core.$strict>;
1065
+ };
1066
+ readonly responses: {
1067
+ readonly 200: {
1068
+ readonly description: "托管权状态;未开通的操作同样返回 cloudEnabled=false,不创建记录";
1069
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1070
+ cloudEnabled: z.ZodLiteral<false>;
1071
+ serverTime: z.ZodISODateTime;
1072
+ }, z.core.$strip>, z.ZodObject<{
1073
+ cloudEnabled: z.ZodLiteral<true>;
1074
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1075
+ kind: z.ZodLiteral<"installation">;
1076
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1077
+ }, z.core.$strip>, z.ZodObject<{
1078
+ kind: z.ZodLiteral<"sandbox">;
1079
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1080
+ }, z.core.$strip>], "kind">>;
1081
+ epoch: z.ZodNumber;
1082
+ state: z.ZodEnum<{
1083
+ unheld: "unheld";
1084
+ active: "active";
1085
+ expired: "expired";
1086
+ }>;
1087
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
1088
+ remainingSeconds: z.ZodNumber;
1089
+ serverTime: z.ZodISODateTime;
1090
+ updatedAt: z.ZodISODateTime;
1091
+ }, z.core.$strip>], "cloudEnabled">;
1092
+ readonly headers: {
1093
+ readonly 'Cache-Control': {
1094
+ readonly description: "租约状态不得缓存";
1095
+ readonly schema: z.ZodLiteral<"no-store">;
1096
+ };
1097
+ };
1098
+ };
1099
+ };
1100
+ readonly problems: {
1101
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
1102
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
1103
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
1104
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED"];
1105
+ };
1106
+ }, {
1107
+ readonly method: "post";
1108
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/lease/handoff";
1109
+ readonly summary: "CAS 交接本人托管权";
1110
+ readonly auth: "tenant";
1111
+ readonly request: {
1112
+ readonly params: z.ZodObject<{
1113
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1114
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1115
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1116
+ }, z.core.$strip>;
1117
+ readonly query: z.ZodObject<{}, z.core.$strict>;
1118
+ readonly body: z.ZodObject<{
1119
+ holder: z.ZodDiscriminatedUnion<[z.ZodObject<{
1120
+ kind: z.ZodLiteral<"installation">;
1121
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1122
+ }, z.core.$strip>, z.ZodObject<{
1123
+ kind: z.ZodLiteral<"sandbox">;
1124
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1125
+ }, z.core.$strip>], "kind">;
1126
+ epoch: z.ZodNumber;
1127
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
1128
+ kind: z.ZodLiteral<"installation">;
1129
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1130
+ }, z.core.$strip>, z.ZodObject<{
1131
+ kind: z.ZodLiteral<"sandbox">;
1132
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1133
+ }, z.core.$strip>], "kind">;
1134
+ }, z.core.$strict>;
1135
+ };
1136
+ readonly responses: {
1137
+ readonly 200: {
1138
+ readonly description: "托管权状态;未开通的操作同样返回 cloudEnabled=false,不创建记录";
1139
+ readonly schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1140
+ cloudEnabled: z.ZodLiteral<false>;
1141
+ serverTime: z.ZodISODateTime;
1142
+ }, z.core.$strip>, z.ZodObject<{
1143
+ cloudEnabled: z.ZodLiteral<true>;
1144
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1145
+ kind: z.ZodLiteral<"installation">;
1146
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1147
+ }, z.core.$strip>, z.ZodObject<{
1148
+ kind: z.ZodLiteral<"sandbox">;
1149
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1150
+ }, z.core.$strip>], "kind">>;
1151
+ epoch: z.ZodNumber;
1152
+ state: z.ZodEnum<{
1153
+ unheld: "unheld";
1154
+ active: "active";
1155
+ expired: "expired";
1156
+ }>;
1157
+ leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
1158
+ remainingSeconds: z.ZodNumber;
1159
+ serverTime: z.ZodISODateTime;
1160
+ updatedAt: z.ZodISODateTime;
1161
+ }, z.core.$strip>], "cloudEnabled">;
1162
+ readonly headers: {
1163
+ readonly 'Cache-Control': {
1164
+ readonly description: "租约状态不得缓存";
1165
+ readonly schema: z.ZodLiteral<"no-store">;
1166
+ };
1167
+ };
1168
+ };
1169
+ };
1170
+ readonly problems: {
1171
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_HELD", "HOSTING_HOLDER_MISMATCH", "HOSTING_LEASE_EXPIRED", "LOCAL_HOST_REPLACED"];
1172
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
1173
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
1174
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
1175
+ };
1176
+ }, {
1177
+ readonly method: "get";
1178
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/checkpoint";
1179
+ readonly summary: "读取本人运行状态检查点";
1180
+ readonly auth: "tenant";
1181
+ readonly request: {
1182
+ readonly params: z.ZodObject<{
1183
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1184
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1185
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1186
+ }, z.core.$strip>;
1187
+ readonly query: z.ZodObject<{}, z.core.$strict>;
1188
+ };
1189
+ readonly responses: {
1190
+ readonly 200: {
1191
+ readonly description: "最新运行状态与游标。reportedAt 为上报时间,调用方据此判断是否过期;旧检查点不能作为补发依据";
1192
+ readonly schema: z.ZodObject<{
1193
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1194
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1195
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1196
+ epoch: z.ZodNumber;
1197
+ revision: z.ZodNumber;
1198
+ streamCursors: z.ZodArray<z.ZodObject<{
1199
+ streamId: z.ZodString;
1200
+ cursor: z.ZodString;
1201
+ }, z.core.$strict>>;
1202
+ session: z.ZodNullable<z.ZodObject<{
1203
+ id: z.ZodString;
1204
+ eventCount: z.ZodNumber;
1205
+ digest: z.ZodString;
1206
+ }, z.core.$strict>>;
1207
+ pendingCount: z.ZodNumber;
1208
+ unknownSendCount: z.ZodNumber;
1209
+ status: z.ZodEnum<{
1210
+ running: "running";
1211
+ draining: "draining";
1212
+ stopped: "stopped";
1213
+ unavailable: "unavailable";
1214
+ }>;
1215
+ hostVersion: z.ZodString;
1216
+ reportedAt: z.ZodISODateTime;
1217
+ }, z.core.$strict>;
1218
+ readonly headers: {
1219
+ readonly 'Cache-Control': {
1220
+ readonly description: "检查点不得缓存";
1221
+ readonly schema: z.ZodLiteral<"no-store">;
1222
+ };
1223
+ };
1224
+ };
1225
+ };
1226
+ readonly problems: {
1227
+ readonly 404: readonly ["NOT_FOUND"];
1228
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
1229
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
1230
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
1231
+ readonly 409: readonly ["TENANT_NOT_CURRENT"];
1232
+ };
1233
+ }, {
1234
+ readonly method: "post";
1235
+ readonly path: "/v1/tenants/{tenantId}/cs-hosting/users/{userId}/accounts/{accountId}/checkpoint";
1236
+ readonly summary: "CAS 上报本人运行状态检查点";
1237
+ readonly auth: "tenant";
1238
+ readonly request: {
1239
+ readonly params: z.ZodObject<{
1240
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1241
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1242
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1243
+ }, z.core.$strip>;
1244
+ readonly query: z.ZodObject<{}, z.core.$strict>;
1245
+ readonly body: z.ZodObject<{
1246
+ holder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1247
+ kind: z.ZodLiteral<"installation">;
1248
+ id: z.core.$ZodBranded<z.ZodUUID, "InstallationId", "out">;
1249
+ }, z.core.$strip>, z.ZodObject<{
1250
+ kind: z.ZodLiteral<"sandbox">;
1251
+ id: z.core.$ZodBranded<z.ZodString, "SandboxId", "out">;
1252
+ }, z.core.$strip>], "kind">>;
1253
+ epoch: z.ZodNumber;
1254
+ expectedRevision: z.ZodNumber;
1255
+ streamCursors: z.ZodArray<z.ZodObject<{
1256
+ streamId: z.ZodString;
1257
+ cursor: z.ZodString;
1258
+ }, z.core.$strict>>;
1259
+ session: z.ZodNullable<z.ZodObject<{
1260
+ id: z.ZodString;
1261
+ eventCount: z.ZodNumber;
1262
+ digest: z.ZodString;
1263
+ }, z.core.$strict>>;
1264
+ pendingCount: z.ZodNumber;
1265
+ unknownSendCount: z.ZodNumber;
1266
+ status: z.ZodEnum<{
1267
+ running: "running";
1268
+ draining: "draining";
1269
+ stopped: "stopped";
1270
+ unavailable: "unavailable";
1271
+ }>;
1272
+ hostVersion: z.ZodString;
1273
+ agentConfigVersion: z.ZodOptional<z.ZodString>;
1274
+ hostAgentConfigApiVersion: z.ZodOptional<z.ZodString>;
1275
+ agentConfigBlocked: z.ZodOptional<z.ZodBoolean>;
1276
+ agentConfigRejection: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1277
+ code: z.ZodEnum<{
1278
+ AGENT_CONFIG_QUERY_FAILED: "AGENT_CONFIG_QUERY_FAILED";
1279
+ AGENT_CONFIG_INVALID: "AGENT_CONFIG_INVALID";
1280
+ AGENT_CONFIG_INCOMPATIBLE: "AGENT_CONFIG_INCOMPATIBLE";
1281
+ AGENT_CONFIG_DIGEST_MISMATCH: "AGENT_CONFIG_DIGEST_MISMATCH";
1282
+ AGENT_CONFIG_DOWNLOAD_FAILED: "AGENT_CONFIG_DOWNLOAD_FAILED";
1283
+ AGENT_CONFIG_APPLY_FAILED: "AGENT_CONFIG_APPLY_FAILED";
1284
+ AGENT_CONFIG_SCOPE_CHANGED: "AGENT_CONFIG_SCOPE_CHANGED";
1285
+ }>;
1286
+ version: z.ZodOptional<z.ZodString>;
1287
+ }, z.core.$strict>>>;
1288
+ }, z.core.$strict>;
1289
+ };
1290
+ readonly responses: {
1291
+ readonly 200: {
1292
+ readonly description: "最新运行状态与游标。reportedAt 为上报时间,调用方据此判断是否过期;旧检查点不能作为补发依据";
1293
+ readonly schema: z.ZodObject<{
1294
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
1295
+ userId: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
1296
+ accountId: z.core.$ZodBranded<z.ZodString, "WangwangAccountId", "out">;
1297
+ epoch: z.ZodNumber;
1298
+ revision: z.ZodNumber;
1299
+ streamCursors: z.ZodArray<z.ZodObject<{
1300
+ streamId: z.ZodString;
1301
+ cursor: z.ZodString;
1302
+ }, z.core.$strict>>;
1303
+ session: z.ZodNullable<z.ZodObject<{
1304
+ id: z.ZodString;
1305
+ eventCount: z.ZodNumber;
1306
+ digest: z.ZodString;
1307
+ }, z.core.$strict>>;
1308
+ pendingCount: z.ZodNumber;
1309
+ unknownSendCount: z.ZodNumber;
1310
+ status: z.ZodEnum<{
1311
+ running: "running";
1312
+ draining: "draining";
1313
+ stopped: "stopped";
1314
+ unavailable: "unavailable";
1315
+ }>;
1316
+ hostVersion: z.ZodString;
1317
+ reportedAt: z.ZodISODateTime;
1318
+ }, z.core.$strict>;
1319
+ readonly headers: {
1320
+ readonly 'Cache-Control': {
1321
+ readonly description: "检查点不得缓存";
1322
+ readonly schema: z.ZodLiteral<"no-store">;
1323
+ };
1324
+ };
1325
+ };
1326
+ };
1327
+ readonly problems: {
1328
+ readonly 409: readonly ["TENANT_NOT_CURRENT", "HOSTING_EPOCH_MISMATCH", "HOSTING_REVISION_MISMATCH", "HOSTING_HOLDER_MISMATCH", "LOCAL_HOST_REPLACED"];
1329
+ readonly 503: readonly ["SERVICE_UNAVAILABLE"];
1330
+ readonly 401: readonly ["SESSION_REQUIRED", "SESSION_EXPIRED"];
1331
+ readonly 403: readonly ["NO_CURRENT_TENANT", "NOT_A_MEMBER", "HOSTING_UNAVAILABLE", "HOSTING_USER_MISMATCH"];
1332
+ };
1333
+ }];