clinkx 1.2.0 → 1.3.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 (270) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +4 -2
  3. package/clinkx-workflows/dist/architecture-arena/admission.d.ts +16 -0
  4. package/clinkx-workflows/dist/architecture-arena/admission.js +107 -0
  5. package/clinkx-workflows/dist/architecture-arena/admission.js.map +1 -0
  6. package/clinkx-workflows/dist/architecture-arena/contract.d.ts +1368 -0
  7. package/clinkx-workflows/dist/architecture-arena/contract.js +254 -0
  8. package/clinkx-workflows/dist/architecture-arena/contract.js.map +1 -0
  9. package/clinkx-workflows/dist/architecture-arena/runtime.d.ts +53 -0
  10. package/clinkx-workflows/dist/architecture-arena/runtime.js +511 -0
  11. package/clinkx-workflows/dist/architecture-arena/runtime.js.map +1 -0
  12. package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +17 -1
  13. package/clinkx-workflows/dist/architecture-comparison/admission.js +27 -4
  14. package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -1
  15. package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +59 -62
  16. package/clinkx-workflows/dist/architecture-comparison/contract.js +4 -21
  17. package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -1
  18. package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +4 -3
  19. package/clinkx-workflows/dist/architecture-comparison/runtime.js +22 -67
  20. package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -1
  21. package/clinkx-workflows/dist/artifacts.d.ts +19 -4
  22. package/clinkx-workflows/dist/artifacts.js +16 -7
  23. package/clinkx-workflows/dist/artifacts.js.map +1 -1
  24. package/clinkx-workflows/dist/backend.d.ts +30 -0
  25. package/clinkx-workflows/dist/clink-client.d.ts +8 -2
  26. package/clinkx-workflows/dist/clink-client.js +4 -2
  27. package/clinkx-workflows/dist/clink-client.js.map +1 -1
  28. package/clinkx-workflows/dist/context-preflight.d.ts +6 -0
  29. package/clinkx-workflows/dist/context-preflight.js.map +1 -1
  30. package/clinkx-workflows/dist/council-execution-policy.d.ts +3 -1
  31. package/clinkx-workflows/dist/council-execution-policy.js +4 -0
  32. package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
  33. package/clinkx-workflows/dist/dashboard/contracts.d.ts +586 -586
  34. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +28 -28
  35. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +32 -32
  36. package/clinkx-workflows/dist/dashboard-ui/assets/index-DRId2DVA.js +119 -0
  37. package/clinkx-workflows/dist/dashboard-ui/assets/style-CHAw57y5.css +1 -0
  38. package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
  39. package/clinkx-workflows/dist/delegate-signature.d.ts +4 -3
  40. package/clinkx-workflows/dist/delegate-signature.js +4 -3
  41. package/clinkx-workflows/dist/delegate-signature.js.map +1 -1
  42. package/clinkx-workflows/dist/durable-file.d.ts +69 -0
  43. package/clinkx-workflows/dist/durable-file.js +145 -0
  44. package/clinkx-workflows/dist/durable-file.js.map +1 -0
  45. package/clinkx-workflows/dist/engine.d.ts +42 -7
  46. package/clinkx-workflows/dist/engine.js +196 -24
  47. package/clinkx-workflows/dist/engine.js.map +1 -1
  48. package/clinkx-workflows/dist/ping-pong/admission.d.ts +127 -0
  49. package/clinkx-workflows/dist/ping-pong/admission.js +522 -0
  50. package/clinkx-workflows/dist/ping-pong/admission.js.map +1 -0
  51. package/clinkx-workflows/dist/ping-pong/contract.d.ts +2539 -0
  52. package/clinkx-workflows/dist/ping-pong/contract.js +819 -0
  53. package/clinkx-workflows/dist/ping-pong/contract.js.map +1 -0
  54. package/clinkx-workflows/dist/ping-pong/control.d.ts +67 -0
  55. package/clinkx-workflows/dist/ping-pong/control.js +12 -0
  56. package/clinkx-workflows/dist/ping-pong/control.js.map +1 -0
  57. package/clinkx-workflows/dist/ping-pong/runtime-handle.d.ts +24 -0
  58. package/clinkx-workflows/dist/ping-pong/runtime-handle.js +55 -0
  59. package/clinkx-workflows/dist/ping-pong/runtime-handle.js.map +1 -0
  60. package/clinkx-workflows/dist/ping-pong/runtime.d.ts +235 -0
  61. package/clinkx-workflows/dist/ping-pong/runtime.js +1183 -0
  62. package/clinkx-workflows/dist/ping-pong/runtime.js.map +1 -0
  63. package/clinkx-workflows/dist/ping-pong/settle.d.ts +57 -0
  64. package/clinkx-workflows/dist/ping-pong/settle.js +58 -0
  65. package/clinkx-workflows/dist/ping-pong/settle.js.map +1 -0
  66. package/clinkx-workflows/dist/ping-pong/sidecar.d.ts +65 -0
  67. package/clinkx-workflows/dist/ping-pong/sidecar.js +138 -0
  68. package/clinkx-workflows/dist/ping-pong/sidecar.js.map +1 -0
  69. package/clinkx-workflows/dist/plan-review/publication.d.ts +2 -1
  70. package/clinkx-workflows/dist/plan-review/publication.js +5 -6
  71. package/clinkx-workflows/dist/plan-review/publication.js.map +1 -1
  72. package/clinkx-workflows/dist/plan-review/snapshot.d.ts +3 -2
  73. package/clinkx-workflows/dist/plan-review/snapshot.js +8 -8
  74. package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -1
  75. package/clinkx-workflows/dist/recipe-host.d.ts +315 -0
  76. package/clinkx-workflows/dist/recipe-host.js +183 -0
  77. package/clinkx-workflows/dist/recipe-host.js.map +1 -0
  78. package/clinkx-workflows/dist/recipe-seats.d.ts +96 -0
  79. package/clinkx-workflows/dist/recipe-seats.js +163 -0
  80. package/clinkx-workflows/dist/recipe-seats.js.map +1 -0
  81. package/clinkx-workflows/dist/recipe-shared/evidence.d.ts +67 -0
  82. package/clinkx-workflows/dist/recipe-shared/evidence.js +111 -0
  83. package/clinkx-workflows/dist/recipe-shared/evidence.js.map +1 -0
  84. package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
  85. package/clinkx-workflows/dist/reducers/index.js +30 -0
  86. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  87. package/clinkx-workflows/dist/run-lock-reclaim.d.ts +44 -0
  88. package/clinkx-workflows/dist/run-lock-reclaim.js +86 -0
  89. package/clinkx-workflows/dist/run-lock-reclaim.js.map +1 -0
  90. package/clinkx-workflows/dist/state-schema.d.ts +11 -0
  91. package/clinkx-workflows/dist/state-schema.js +4 -1
  92. package/clinkx-workflows/dist/state-schema.js.map +1 -1
  93. package/clinkx-workflows/dist/state.d.ts +178 -3
  94. package/clinkx-workflows/dist/state.js +618 -83
  95. package/clinkx-workflows/dist/state.js.map +1 -1
  96. package/clinkx-workflows/dist/transport.d.ts +2 -1
  97. package/clinkx-workflows/dist/transport.js +5 -0
  98. package/clinkx-workflows/dist/transport.js.map +1 -1
  99. package/clinkx-workflows/dist/validators/architecture-arena.d.ts +6 -0
  100. package/clinkx-workflows/dist/validators/architecture-arena.js +16 -0
  101. package/clinkx-workflows/dist/validators/architecture-arena.js.map +1 -0
  102. package/clinkx-workflows/dist/validators/index.js +4 -0
  103. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  104. package/clinkx-workflows/dist/validators/ping-pong.d.ts +6 -0
  105. package/clinkx-workflows/dist/validators/ping-pong.js +10 -0
  106. package/clinkx-workflows/dist/validators/ping-pong.js.map +1 -0
  107. package/clinkx-workflows/dist/workflow-tools.d.ts +51 -5
  108. package/clinkx-workflows/dist/workflow-tools.js +785 -34
  109. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  110. package/clinkx-workflows/dist/workflow-verification-contract.d.ts +4 -4
  111. package/clinkx-workflows/templates/architecture-arena/candidate.txt +39 -0
  112. package/clinkx-workflows/templates/architecture-arena/judge.txt +34 -0
  113. package/clinkx-workflows/templates/ping-pong/implement.txt +14 -0
  114. package/clinkx-workflows/templates/ping-pong/remediate.txt +14 -0
  115. package/clinkx-workflows/templates/ping-pong/review.txt +27 -0
  116. package/clinkx-workflows/workflows/architecture-arena.yaml +127 -0
  117. package/clinkx-workflows/workflows/ping-pong.yaml +158 -0
  118. package/dist/context-builder/bundle.js +4 -3
  119. package/dist/context-builder/bundle.js.map +1 -1
  120. package/dist/context-builder/delegate-packet.d.ts +1 -0
  121. package/dist/context-builder/delegate-packet.js +66 -7
  122. package/dist/context-builder/delegate-packet.js.map +1 -1
  123. package/dist/context-builder/delegate-validation.d.ts +12 -3
  124. package/dist/context-builder/delegate-validation.js +23 -13
  125. package/dist/context-builder/delegate-validation.js.map +1 -1
  126. package/dist/context-builder/external-gaps.d.ts +14 -3
  127. package/dist/context-builder/external-gaps.js +124 -18
  128. package/dist/context-builder/external-gaps.js.map +1 -1
  129. package/dist/context-builder/handler.js +108 -191
  130. package/dist/context-builder/handler.js.map +1 -1
  131. package/dist/context-builder/review-coverage.js +27 -1
  132. package/dist/context-builder/review-coverage.js.map +1 -1
  133. package/dist/context-builder/secrets.js +1 -1
  134. package/dist/context-builder/secrets.js.map +1 -1
  135. package/dist/context-builder/versions.d.ts +10 -4
  136. package/dist/context-builder/versions.js +10 -4
  137. package/dist/context-builder/versions.js.map +1 -1
  138. package/dist/context-builder/workflow-runner.js +33 -24
  139. package/dist/context-builder/workflow-runner.js.map +1 -1
  140. package/dist/dashboard-cli.d.ts +2 -0
  141. package/dist/dashboard-cli.js +147 -57
  142. package/dist/dashboard-cli.js.map +1 -1
  143. package/dist/dashboard-companion/client.d.ts +10 -0
  144. package/dist/dashboard-companion/client.js +43 -1
  145. package/dist/dashboard-companion/client.js.map +1 -1
  146. package/dist/dashboard-companion/config.d.ts +19 -1
  147. package/dist/dashboard-companion/config.js +104 -3
  148. package/dist/dashboard-companion/config.js.map +1 -1
  149. package/dist/dashboard-companion/protocol.d.ts +16 -0
  150. package/dist/dashboard-companion/protocol.js +38 -1
  151. package/dist/dashboard-companion/protocol.js.map +1 -1
  152. package/dist/dashboard-companion/workstation-binding.d.ts +69 -0
  153. package/dist/dashboard-companion/workstation-binding.js +192 -0
  154. package/dist/dashboard-companion/workstation-binding.js.map +1 -0
  155. package/dist/dashboard-gateway/admin-cli.d.ts +10 -0
  156. package/dist/dashboard-gateway/admin-cli.js +266 -0
  157. package/dist/dashboard-gateway/admin-cli.js.map +1 -0
  158. package/dist/dashboard-gateway/config.d.ts +50 -0
  159. package/dist/dashboard-gateway/config.js +235 -1
  160. package/dist/dashboard-gateway/config.js.map +1 -1
  161. package/dist/dashboard-gateway/connection-registry.d.ts +100 -0
  162. package/dist/dashboard-gateway/connection-registry.js +228 -0
  163. package/dist/dashboard-gateway/connection-registry.js.map +1 -0
  164. package/dist/dashboard-gateway/control-plane/account-auth.d.ts +78 -0
  165. package/dist/dashboard-gateway/control-plane/account-auth.js +198 -0
  166. package/dist/dashboard-gateway/control-plane/account-auth.js.map +1 -0
  167. package/dist/dashboard-gateway/control-plane/billing.d.ts +264 -0
  168. package/dist/dashboard-gateway/control-plane/billing.js +787 -0
  169. package/dist/dashboard-gateway/control-plane/billing.js.map +1 -0
  170. package/dist/dashboard-gateway/control-plane/contracts.d.ts +1293 -0
  171. package/dist/dashboard-gateway/control-plane/contracts.js +280 -0
  172. package/dist/dashboard-gateway/control-plane/contracts.js.map +1 -0
  173. package/dist/dashboard-gateway/control-plane/cookies.d.ts +13 -0
  174. package/dist/dashboard-gateway/control-plane/cookies.js +46 -0
  175. package/dist/dashboard-gateway/control-plane/cookies.js.map +1 -0
  176. package/dist/dashboard-gateway/control-plane/credentials.d.ts +63 -0
  177. package/dist/dashboard-gateway/control-plane/credentials.js +66 -0
  178. package/dist/dashboard-gateway/control-plane/credentials.js.map +1 -0
  179. package/dist/dashboard-gateway/control-plane/entitlements.d.ts +118 -0
  180. package/dist/dashboard-gateway/control-plane/entitlements.js +329 -0
  181. package/dist/dashboard-gateway/control-plane/entitlements.js.map +1 -0
  182. package/dist/dashboard-gateway/control-plane/errors.d.ts +17 -0
  183. package/dist/dashboard-gateway/control-plane/errors.js +23 -0
  184. package/dist/dashboard-gateway/control-plane/errors.js.map +1 -0
  185. package/dist/dashboard-gateway/control-plane/hosts.d.ts +6 -0
  186. package/dist/dashboard-gateway/control-plane/hosts.js +16 -0
  187. package/dist/dashboard-gateway/control-plane/hosts.js.map +1 -0
  188. package/dist/dashboard-gateway/control-plane/http.d.ts +34 -0
  189. package/dist/dashboard-gateway/control-plane/http.js +331 -0
  190. package/dist/dashboard-gateway/control-plane/http.js.map +1 -0
  191. package/dist/dashboard-gateway/control-plane/schema.d.ts +9 -0
  192. package/dist/dashboard-gateway/control-plane/schema.js +247 -0
  193. package/dist/dashboard-gateway/control-plane/schema.js.map +1 -0
  194. package/dist/dashboard-gateway/control-plane/secrets.d.ts +20 -0
  195. package/dist/dashboard-gateway/control-plane/secrets.js +39 -0
  196. package/dist/dashboard-gateway/control-plane/secrets.js.map +1 -0
  197. package/dist/dashboard-gateway/control-plane/store.d.ts +579 -0
  198. package/dist/dashboard-gateway/control-plane/store.js +1115 -0
  199. package/dist/dashboard-gateway/control-plane/store.js.map +1 -0
  200. package/dist/dashboard-gateway/cookie-boundary.d.ts +60 -0
  201. package/dist/dashboard-gateway/cookie-boundary.js +205 -0
  202. package/dist/dashboard-gateway/cookie-boundary.js.map +1 -0
  203. package/dist/dashboard-gateway/index.js +271 -494
  204. package/dist/dashboard-gateway/index.js.map +1 -1
  205. package/dist/dashboard-gateway/main.js +7 -2
  206. package/dist/dashboard-gateway/main.js.map +1 -1
  207. package/dist/dashboard-gateway/routing.d.ts +43 -0
  208. package/dist/dashboard-gateway/routing.js +65 -0
  209. package/dist/dashboard-gateway/routing.js.map +1 -0
  210. package/dist/dashboard-gateway/tenant-gateway.d.ts +56 -0
  211. package/dist/dashboard-gateway/tenant-gateway.js +989 -0
  212. package/dist/dashboard-gateway/tenant-gateway.js.map +1 -0
  213. package/dist/dashboard-gateway/tenant-main.d.ts +41 -0
  214. package/dist/dashboard-gateway/tenant-main.js +303 -0
  215. package/dist/dashboard-gateway/tenant-main.js.map +1 -0
  216. package/dist/dashboard-gateway/tunnel-errors.d.ts +16 -0
  217. package/dist/dashboard-gateway/tunnel-errors.js +22 -0
  218. package/dist/dashboard-gateway/tunnel-errors.js.map +1 -0
  219. package/dist/dashboard-gateway/tunnel-http.d.ts +21 -0
  220. package/dist/dashboard-gateway/tunnel-http.js +175 -0
  221. package/dist/dashboard-gateway/tunnel-http.js.map +1 -0
  222. package/dist/handler.d.ts +6 -0
  223. package/dist/handler.js +17 -1
  224. package/dist/handler.js.map +1 -1
  225. package/dist/local-clink-backend.d.ts +2 -1
  226. package/dist/local-clink-backend.js +28 -4
  227. package/dist/local-clink-backend.js.map +1 -1
  228. package/dist/parsers/extract.d.ts +19 -1
  229. package/dist/parsers/extract.js +68 -3
  230. package/dist/parsers/extract.js.map +1 -1
  231. package/dist/pipeline.d.ts +17 -1
  232. package/dist/pipeline.js +34 -6
  233. package/dist/pipeline.js.map +1 -1
  234. package/dist/process-group.d.ts +65 -0
  235. package/dist/process-group.js +153 -0
  236. package/dist/process-group.js.map +1 -0
  237. package/dist/progress-report/schema.d.ts +23 -23
  238. package/dist/project-verification/files.js +1 -1
  239. package/dist/project-verification/files.js.map +1 -1
  240. package/dist/project-verification/process.js +23 -44
  241. package/dist/project-verification/process.js.map +1 -1
  242. package/dist/project-verification/service.js +9 -1
  243. package/dist/project-verification/service.js.map +1 -1
  244. package/dist/prompt.d.ts +7 -0
  245. package/dist/prompt.js +18 -1
  246. package/dist/prompt.js.map +1 -1
  247. package/dist/recipe-host/git-trust.d.ts +43 -0
  248. package/dist/recipe-host/git-trust.js +360 -0
  249. package/dist/recipe-host/git-trust.js.map +1 -0
  250. package/dist/recipe-host/git.d.ts +42 -0
  251. package/dist/recipe-host/git.js +207 -0
  252. package/dist/recipe-host/git.js.map +1 -0
  253. package/dist/recipe-host/native-recipe-host.d.ts +127 -0
  254. package/dist/recipe-host/native-recipe-host.js +880 -0
  255. package/dist/recipe-host/native-recipe-host.js.map +1 -0
  256. package/dist/recipe-host/seat-cwd.d.ts +16 -0
  257. package/dist/recipe-host/seat-cwd.js +170 -0
  258. package/dist/recipe-host/seat-cwd.js.map +1 -0
  259. package/dist/runner.d.ts +43 -1
  260. package/dist/runner.js +234 -35
  261. package/dist/runner.js.map +1 -1
  262. package/dist/server.js +9 -1
  263. package/dist/server.js.map +1 -1
  264. package/docs/configuration.md +24 -3
  265. package/docs/engineering-recipes.md +291 -0
  266. package/docs/security.md +84 -0
  267. package/docs/verification/project-checks.md +24 -2
  268. package/package.json +5 -1
  269. package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +0 -115
  270. package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +0 -1
@@ -0,0 +1,1293 @@
1
+ import { z } from "zod";
2
+ export declare const CONTROL_PATH_PREFIX = "/api/control/";
3
+ /** One subscription covers at most this many live workstations. */
4
+ export declare const MAX_WORKSTATIONS = 2;
5
+ /** A workstation API key: the companion's static device credential. */
6
+ export declare const DeviceCredentialSchema: z.ZodString;
7
+ export declare const AccountIdSchema: z.ZodString;
8
+ export declare const TenantIdSchema: z.ZodString;
9
+ export declare const CompanionIdSchema: z.ZodString;
10
+ export declare const CredentialIdSchema: z.ZodString;
11
+ export declare const UtcTimestampSchema: z.ZodString;
12
+ export declare const HttpsUrlSchema: z.ZodEffects<z.ZodString, string, string>;
13
+ export declare const ControlErrorCodeSchema: z.ZodEnum<["unauthenticated", "auth_failed", "forbidden", "not_member", "not_found", "method_not_allowed", "misdirected_request", "credential_revoked", "entitlement_inactive", "context_mismatch", "not_active", "workstation_limit", "workstation_not_found", "workstation_required", "subscription_active", "payload_too_large", "invalid_request", "webhook_signature_invalid", "rate_limited", "outcome_unknown", "store_unavailable", "provider_unavailable", "companion_offline"]>;
14
+ export type ControlErrorCode = z.infer<typeof ControlErrorCodeSchema>;
15
+ export declare const CONTROL_ERROR_HTTP_STATUS: {
16
+ readonly unauthenticated: 401;
17
+ readonly auth_failed: 401;
18
+ readonly forbidden: 403;
19
+ readonly not_member: 403;
20
+ readonly not_found: 404;
21
+ readonly method_not_allowed: 405;
22
+ readonly misdirected_request: 421;
23
+ readonly credential_revoked: 401;
24
+ readonly entitlement_inactive: 402;
25
+ readonly context_mismatch: 409;
26
+ readonly not_active: 409;
27
+ readonly workstation_limit: 409;
28
+ readonly workstation_not_found: 404;
29
+ readonly workstation_required: 400;
30
+ readonly subscription_active: 409;
31
+ readonly payload_too_large: 413;
32
+ readonly invalid_request: 400;
33
+ readonly webhook_signature_invalid: 400;
34
+ readonly rate_limited: 429;
35
+ readonly outcome_unknown: 502;
36
+ readonly store_unavailable: 503;
37
+ readonly provider_unavailable: 503;
38
+ readonly companion_offline: 503;
39
+ };
40
+ export declare const ControlErrorResponseSchema: z.ZodObject<{
41
+ error: z.ZodObject<{
42
+ code: z.ZodEnum<["unauthenticated", "auth_failed", "forbidden", "not_member", "not_found", "method_not_allowed", "misdirected_request", "credential_revoked", "entitlement_inactive", "context_mismatch", "not_active", "workstation_limit", "workstation_not_found", "workstation_required", "subscription_active", "payload_too_large", "invalid_request", "webhook_signature_invalid", "rate_limited", "outcome_unknown", "store_unavailable", "provider_unavailable", "companion_offline"]>;
43
+ message: z.ZodOptional<z.ZodString>;
44
+ }, "strict", z.ZodTypeAny, {
45
+ code: "auth_failed" | "rate_limited" | "payload_too_large" | "forbidden" | "unauthenticated" | "not_member" | "not_found" | "method_not_allowed" | "misdirected_request" | "credential_revoked" | "entitlement_inactive" | "context_mismatch" | "not_active" | "workstation_limit" | "workstation_not_found" | "workstation_required" | "subscription_active" | "invalid_request" | "webhook_signature_invalid" | "outcome_unknown" | "store_unavailable" | "provider_unavailable" | "companion_offline";
46
+ message?: string | undefined;
47
+ }, {
48
+ code: "auth_failed" | "rate_limited" | "payload_too_large" | "forbidden" | "unauthenticated" | "not_member" | "not_found" | "method_not_allowed" | "misdirected_request" | "credential_revoked" | "entitlement_inactive" | "context_mismatch" | "not_active" | "workstation_limit" | "workstation_not_found" | "workstation_required" | "subscription_active" | "invalid_request" | "webhook_signature_invalid" | "outcome_unknown" | "store_unavailable" | "provider_unavailable" | "companion_offline";
49
+ message?: string | undefined;
50
+ }>;
51
+ }, "strict", z.ZodTypeAny, {
52
+ error: {
53
+ code: "auth_failed" | "rate_limited" | "payload_too_large" | "forbidden" | "unauthenticated" | "not_member" | "not_found" | "method_not_allowed" | "misdirected_request" | "credential_revoked" | "entitlement_inactive" | "context_mismatch" | "not_active" | "workstation_limit" | "workstation_not_found" | "workstation_required" | "subscription_active" | "invalid_request" | "webhook_signature_invalid" | "outcome_unknown" | "store_unavailable" | "provider_unavailable" | "companion_offline";
54
+ message?: string | undefined;
55
+ };
56
+ }, {
57
+ error: {
58
+ code: "auth_failed" | "rate_limited" | "payload_too_large" | "forbidden" | "unauthenticated" | "not_member" | "not_found" | "method_not_allowed" | "misdirected_request" | "credential_revoked" | "entitlement_inactive" | "context_mismatch" | "not_active" | "workstation_limit" | "workstation_not_found" | "workstation_required" | "subscription_active" | "invalid_request" | "webhook_signature_invalid" | "outcome_unknown" | "store_unavailable" | "provider_unavailable" | "companion_offline";
59
+ message?: string | undefined;
60
+ };
61
+ }>;
62
+ export type ControlErrorResponse = z.infer<typeof ControlErrorResponseSchema>;
63
+ export declare const WorkspaceSummarySchema: z.ZodObject<{
64
+ id: z.ZodString;
65
+ }, "strict", z.ZodTypeAny, {
66
+ id: string;
67
+ }, {
68
+ id: string;
69
+ }>;
70
+ export type WorkspaceSummary = z.infer<typeof WorkspaceSummarySchema>;
71
+ export declare const MembershipRoleSchema: z.ZodEnum<["owner"]>;
72
+ export declare const AccountSummarySchema: z.ZodObject<{
73
+ id: z.ZodString;
74
+ display_name: z.ZodNullable<z.ZodString>;
75
+ }, "strict", z.ZodTypeAny, {
76
+ id: string;
77
+ display_name: string | null;
78
+ }, {
79
+ id: string;
80
+ display_name: string | null;
81
+ }>;
82
+ export declare const AuthStartRequestSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
83
+ export type AuthStartRequest = z.infer<typeof AuthStartRequestSchema>;
84
+ export declare const AuthStartResponseSchema: z.ZodObject<{
85
+ authorization_url: z.ZodEffects<z.ZodString, string, string>;
86
+ }, "strict", z.ZodTypeAny, {
87
+ authorization_url: string;
88
+ }, {
89
+ authorization_url: string;
90
+ }>;
91
+ export type AuthStartResponse = z.infer<typeof AuthStartResponseSchema>;
92
+ export declare const AuthCallbackQuerySchema: z.ZodEffects<z.ZodObject<{
93
+ state: z.ZodString;
94
+ code: z.ZodOptional<z.ZodString>;
95
+ error: z.ZodOptional<z.ZodString>;
96
+ error_description: z.ZodOptional<z.ZodString>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ state: string;
99
+ error?: string | undefined;
100
+ code?: string | undefined;
101
+ error_description?: string | undefined;
102
+ }, {
103
+ state: string;
104
+ error?: string | undefined;
105
+ code?: string | undefined;
106
+ error_description?: string | undefined;
107
+ }>, {
108
+ state: string;
109
+ error?: string | undefined;
110
+ code?: string | undefined;
111
+ error_description?: string | undefined;
112
+ }, {
113
+ state: string;
114
+ error?: string | undefined;
115
+ code?: string | undefined;
116
+ error_description?: string | undefined;
117
+ }>;
118
+ export type AuthCallbackQuery = z.infer<typeof AuthCallbackQuerySchema>;
119
+ export declare const AuthLogoutRequestSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
120
+ export declare const AuthLogoutResponseSchema: z.ZodObject<{
121
+ logged_out: z.ZodLiteral<true>;
122
+ }, "strict", z.ZodTypeAny, {
123
+ logged_out: true;
124
+ }, {
125
+ logged_out: true;
126
+ }>;
127
+ export type AuthLogoutResponse = z.infer<typeof AuthLogoutResponseSchema>;
128
+ export declare const AuthSessionResponseSchema: z.ZodObject<{
129
+ account: z.ZodObject<{
130
+ id: z.ZodString;
131
+ display_name: z.ZodNullable<z.ZodString>;
132
+ }, "strict", z.ZodTypeAny, {
133
+ id: string;
134
+ display_name: string | null;
135
+ }, {
136
+ id: string;
137
+ display_name: string | null;
138
+ }>;
139
+ expires_at: z.ZodString;
140
+ }, "strict", z.ZodTypeAny, {
141
+ account: {
142
+ id: string;
143
+ display_name: string | null;
144
+ };
145
+ expires_at: string;
146
+ }, {
147
+ account: {
148
+ id: string;
149
+ display_name: string | null;
150
+ };
151
+ expires_at: string;
152
+ }>;
153
+ export type AuthSessionResponse = z.infer<typeof AuthSessionResponseSchema>;
154
+ export declare const SubscriptionStateSchema: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
155
+ export type SubscriptionState = z.infer<typeof SubscriptionStateSchema>;
156
+ export declare const AccessReasonSchema: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
157
+ export declare const EntitlementStatusSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
158
+ access: z.ZodEnum<["granted", "denied"]>;
159
+ reason: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
160
+ subscription_state: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
161
+ access_until: z.ZodNullable<z.ZodString>;
162
+ grace_deadline: z.ZodNullable<z.ZodString>;
163
+ suspended: z.ZodBoolean;
164
+ /** The unexpired operator grant's cutoff, else `null`. */
165
+ grant_until: z.ZodNullable<z.ZodString>;
166
+ last_reconciled_at: z.ZodNullable<z.ZodString>;
167
+ stale: z.ZodBoolean;
168
+ }, "strict", z.ZodTypeAny, {
169
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
170
+ suspended: boolean;
171
+ access: "denied" | "granted";
172
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
173
+ access_until: string | null;
174
+ grace_deadline: string | null;
175
+ grant_until: string | null;
176
+ last_reconciled_at: string | null;
177
+ stale: boolean;
178
+ }, {
179
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
180
+ suspended: boolean;
181
+ access: "denied" | "granted";
182
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
183
+ access_until: string | null;
184
+ grace_deadline: string | null;
185
+ grant_until: string | null;
186
+ last_reconciled_at: string | null;
187
+ stale: boolean;
188
+ }>, {
189
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
190
+ suspended: boolean;
191
+ access: "denied" | "granted";
192
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
193
+ access_until: string | null;
194
+ grace_deadline: string | null;
195
+ grant_until: string | null;
196
+ last_reconciled_at: string | null;
197
+ stale: boolean;
198
+ }, {
199
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
200
+ suspended: boolean;
201
+ access: "denied" | "granted";
202
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
203
+ access_until: string | null;
204
+ grace_deadline: string | null;
205
+ grant_until: string | null;
206
+ last_reconciled_at: string | null;
207
+ stale: boolean;
208
+ }>, {
209
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
210
+ suspended: boolean;
211
+ access: "denied" | "granted";
212
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
213
+ access_until: string | null;
214
+ grace_deadline: string | null;
215
+ grant_until: string | null;
216
+ last_reconciled_at: string | null;
217
+ stale: boolean;
218
+ }, {
219
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
220
+ suspended: boolean;
221
+ access: "denied" | "granted";
222
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
223
+ access_until: string | null;
224
+ grace_deadline: string | null;
225
+ grant_until: string | null;
226
+ last_reconciled_at: string | null;
227
+ stale: boolean;
228
+ }>;
229
+ export type EntitlementStatus = z.infer<typeof EntitlementStatusSchema>;
230
+ export declare const WorkstationLabelSchema: z.ZodString;
231
+ export declare const WorkstationConnectionSchema: z.ZodEffects<z.ZodObject<{
232
+ state: z.ZodEnum<["offline", "online"]>;
233
+ connection_generation: z.ZodNullable<z.ZodNumber>;
234
+ }, "strict", z.ZodTypeAny, {
235
+ state: "offline" | "online";
236
+ connection_generation: number | null;
237
+ }, {
238
+ state: "offline" | "online";
239
+ connection_generation: number | null;
240
+ }>, {
241
+ state: "offline" | "online";
242
+ connection_generation: number | null;
243
+ }, {
244
+ state: "offline" | "online";
245
+ connection_generation: number | null;
246
+ }>;
247
+ export declare const WorkstationSummarySchema: z.ZodObject<{
248
+ companion_id: z.ZodString;
249
+ label: z.ZodString;
250
+ created_at: z.ZodString;
251
+ key_issued_at: z.ZodNullable<z.ZodString>;
252
+ connection: z.ZodEffects<z.ZodObject<{
253
+ state: z.ZodEnum<["offline", "online"]>;
254
+ connection_generation: z.ZodNullable<z.ZodNumber>;
255
+ }, "strict", z.ZodTypeAny, {
256
+ state: "offline" | "online";
257
+ connection_generation: number | null;
258
+ }, {
259
+ state: "offline" | "online";
260
+ connection_generation: number | null;
261
+ }>, {
262
+ state: "offline" | "online";
263
+ connection_generation: number | null;
264
+ }, {
265
+ state: "offline" | "online";
266
+ connection_generation: number | null;
267
+ }>;
268
+ }, "strict", z.ZodTypeAny, {
269
+ companion_id: string;
270
+ connection: {
271
+ state: "offline" | "online";
272
+ connection_generation: number | null;
273
+ };
274
+ created_at: string;
275
+ label: string;
276
+ key_issued_at: string | null;
277
+ }, {
278
+ companion_id: string;
279
+ connection: {
280
+ state: "offline" | "online";
281
+ connection_generation: number | null;
282
+ };
283
+ created_at: string;
284
+ label: string;
285
+ key_issued_at: string | null;
286
+ }>;
287
+ export type WorkstationSummary = z.infer<typeof WorkstationSummarySchema>;
288
+ export declare const WorkspaceReadResponseSchema: z.ZodObject<{
289
+ workspace: z.ZodObject<{
290
+ id: z.ZodString;
291
+ }, "strict", z.ZodTypeAny, {
292
+ id: string;
293
+ }, {
294
+ id: string;
295
+ }>;
296
+ role: z.ZodEnum<["owner"]>;
297
+ entitlement: z.ZodEffects<z.ZodEffects<z.ZodObject<{
298
+ access: z.ZodEnum<["granted", "denied"]>;
299
+ reason: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
300
+ subscription_state: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
301
+ access_until: z.ZodNullable<z.ZodString>;
302
+ grace_deadline: z.ZodNullable<z.ZodString>;
303
+ suspended: z.ZodBoolean;
304
+ /** The unexpired operator grant's cutoff, else `null`. */
305
+ grant_until: z.ZodNullable<z.ZodString>;
306
+ last_reconciled_at: z.ZodNullable<z.ZodString>;
307
+ stale: z.ZodBoolean;
308
+ }, "strict", z.ZodTypeAny, {
309
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
310
+ suspended: boolean;
311
+ access: "denied" | "granted";
312
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
313
+ access_until: string | null;
314
+ grace_deadline: string | null;
315
+ grant_until: string | null;
316
+ last_reconciled_at: string | null;
317
+ stale: boolean;
318
+ }, {
319
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
320
+ suspended: boolean;
321
+ access: "denied" | "granted";
322
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
323
+ access_until: string | null;
324
+ grace_deadline: string | null;
325
+ grant_until: string | null;
326
+ last_reconciled_at: string | null;
327
+ stale: boolean;
328
+ }>, {
329
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
330
+ suspended: boolean;
331
+ access: "denied" | "granted";
332
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
333
+ access_until: string | null;
334
+ grace_deadline: string | null;
335
+ grant_until: string | null;
336
+ last_reconciled_at: string | null;
337
+ stale: boolean;
338
+ }, {
339
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
340
+ suspended: boolean;
341
+ access: "denied" | "granted";
342
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
343
+ access_until: string | null;
344
+ grace_deadline: string | null;
345
+ grant_until: string | null;
346
+ last_reconciled_at: string | null;
347
+ stale: boolean;
348
+ }>, {
349
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
350
+ suspended: boolean;
351
+ access: "denied" | "granted";
352
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
353
+ access_until: string | null;
354
+ grace_deadline: string | null;
355
+ grant_until: string | null;
356
+ last_reconciled_at: string | null;
357
+ stale: boolean;
358
+ }, {
359
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
360
+ suspended: boolean;
361
+ access: "denied" | "granted";
362
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
363
+ access_until: string | null;
364
+ grace_deadline: string | null;
365
+ grant_until: string | null;
366
+ last_reconciled_at: string | null;
367
+ stale: boolean;
368
+ }>;
369
+ /** `false`: the billing routes do not exist and access comes only from operator grants. */
370
+ billing_enabled: z.ZodBoolean;
371
+ max_workstations: z.ZodLiteral<2>;
372
+ workstations: z.ZodArray<z.ZodObject<{
373
+ companion_id: z.ZodString;
374
+ label: z.ZodString;
375
+ created_at: z.ZodString;
376
+ key_issued_at: z.ZodNullable<z.ZodString>;
377
+ connection: z.ZodEffects<z.ZodObject<{
378
+ state: z.ZodEnum<["offline", "online"]>;
379
+ connection_generation: z.ZodNullable<z.ZodNumber>;
380
+ }, "strict", z.ZodTypeAny, {
381
+ state: "offline" | "online";
382
+ connection_generation: number | null;
383
+ }, {
384
+ state: "offline" | "online";
385
+ connection_generation: number | null;
386
+ }>, {
387
+ state: "offline" | "online";
388
+ connection_generation: number | null;
389
+ }, {
390
+ state: "offline" | "online";
391
+ connection_generation: number | null;
392
+ }>;
393
+ }, "strict", z.ZodTypeAny, {
394
+ companion_id: string;
395
+ connection: {
396
+ state: "offline" | "online";
397
+ connection_generation: number | null;
398
+ };
399
+ created_at: string;
400
+ label: string;
401
+ key_issued_at: string | null;
402
+ }, {
403
+ companion_id: string;
404
+ connection: {
405
+ state: "offline" | "online";
406
+ connection_generation: number | null;
407
+ };
408
+ created_at: string;
409
+ label: string;
410
+ key_issued_at: string | null;
411
+ }>, "many">;
412
+ }, "strict", z.ZodTypeAny, {
413
+ role: "owner";
414
+ workspace: {
415
+ id: string;
416
+ };
417
+ entitlement: {
418
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
419
+ suspended: boolean;
420
+ access: "denied" | "granted";
421
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
422
+ access_until: string | null;
423
+ grace_deadline: string | null;
424
+ grant_until: string | null;
425
+ last_reconciled_at: string | null;
426
+ stale: boolean;
427
+ };
428
+ billing_enabled: boolean;
429
+ max_workstations: 2;
430
+ workstations: {
431
+ companion_id: string;
432
+ connection: {
433
+ state: "offline" | "online";
434
+ connection_generation: number | null;
435
+ };
436
+ created_at: string;
437
+ label: string;
438
+ key_issued_at: string | null;
439
+ }[];
440
+ }, {
441
+ role: "owner";
442
+ workspace: {
443
+ id: string;
444
+ };
445
+ entitlement: {
446
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
447
+ suspended: boolean;
448
+ access: "denied" | "granted";
449
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
450
+ access_until: string | null;
451
+ grace_deadline: string | null;
452
+ grant_until: string | null;
453
+ last_reconciled_at: string | null;
454
+ stale: boolean;
455
+ };
456
+ billing_enabled: boolean;
457
+ max_workstations: 2;
458
+ workstations: {
459
+ companion_id: string;
460
+ connection: {
461
+ state: "offline" | "online";
462
+ connection_generation: number | null;
463
+ };
464
+ created_at: string;
465
+ label: string;
466
+ key_issued_at: string | null;
467
+ }[];
468
+ }>;
469
+ export type WorkspaceReadResponse = z.infer<typeof WorkspaceReadResponseSchema>;
470
+ export declare const WorkstationCreateRequestSchema: z.ZodObject<{
471
+ label: z.ZodString;
472
+ }, "strict", z.ZodTypeAny, {
473
+ label: string;
474
+ }, {
475
+ label: string;
476
+ }>;
477
+ export type WorkstationCreateRequest = z.infer<typeof WorkstationCreateRequestSchema>;
478
+ /** The API key is returned exactly once, here or on rotation; no read route ever returns it. */
479
+ export declare const WorkstationCreateResponseSchema: z.ZodObject<{
480
+ workstation: z.ZodObject<{
481
+ companion_id: z.ZodString;
482
+ label: z.ZodString;
483
+ created_at: z.ZodString;
484
+ key_issued_at: z.ZodNullable<z.ZodString>;
485
+ connection: z.ZodEffects<z.ZodObject<{
486
+ state: z.ZodEnum<["offline", "online"]>;
487
+ connection_generation: z.ZodNullable<z.ZodNumber>;
488
+ }, "strict", z.ZodTypeAny, {
489
+ state: "offline" | "online";
490
+ connection_generation: number | null;
491
+ }, {
492
+ state: "offline" | "online";
493
+ connection_generation: number | null;
494
+ }>, {
495
+ state: "offline" | "online";
496
+ connection_generation: number | null;
497
+ }, {
498
+ state: "offline" | "online";
499
+ connection_generation: number | null;
500
+ }>;
501
+ }, "strict", z.ZodTypeAny, {
502
+ companion_id: string;
503
+ connection: {
504
+ state: "offline" | "online";
505
+ connection_generation: number | null;
506
+ };
507
+ created_at: string;
508
+ label: string;
509
+ key_issued_at: string | null;
510
+ }, {
511
+ companion_id: string;
512
+ connection: {
513
+ state: "offline" | "online";
514
+ connection_generation: number | null;
515
+ };
516
+ created_at: string;
517
+ label: string;
518
+ key_issued_at: string | null;
519
+ }>;
520
+ api_key: z.ZodString;
521
+ }, "strict", z.ZodTypeAny, {
522
+ api_key: string;
523
+ workstation: {
524
+ companion_id: string;
525
+ connection: {
526
+ state: "offline" | "online";
527
+ connection_generation: number | null;
528
+ };
529
+ created_at: string;
530
+ label: string;
531
+ key_issued_at: string | null;
532
+ };
533
+ }, {
534
+ api_key: string;
535
+ workstation: {
536
+ companion_id: string;
537
+ connection: {
538
+ state: "offline" | "online";
539
+ connection_generation: number | null;
540
+ };
541
+ created_at: string;
542
+ label: string;
543
+ key_issued_at: string | null;
544
+ };
545
+ }>;
546
+ export type WorkstationCreateResponse = z.infer<typeof WorkstationCreateResponseSchema>;
547
+ export declare const WorkstationRotateRequestSchema: z.ZodObject<{
548
+ companion_id: z.ZodString;
549
+ }, "strict", z.ZodTypeAny, {
550
+ companion_id: string;
551
+ }, {
552
+ companion_id: string;
553
+ }>;
554
+ export type WorkstationRotateRequest = z.infer<typeof WorkstationRotateRequestSchema>;
555
+ export declare const WorkstationRotateResponseSchema: z.ZodObject<{
556
+ companion_id: z.ZodString;
557
+ api_key: z.ZodString;
558
+ revoked_credential_id: z.ZodNullable<z.ZodString>;
559
+ closed_connections: z.ZodNumber;
560
+ }, "strict", z.ZodTypeAny, {
561
+ api_key: string;
562
+ companion_id: string;
563
+ revoked_credential_id: string | null;
564
+ closed_connections: number;
565
+ }, {
566
+ api_key: string;
567
+ companion_id: string;
568
+ revoked_credential_id: string | null;
569
+ closed_connections: number;
570
+ }>;
571
+ export type WorkstationRotateResponse = z.infer<typeof WorkstationRotateResponseSchema>;
572
+ export declare const WorkstationRevokeRequestSchema: z.ZodObject<{
573
+ companion_id: z.ZodString;
574
+ }, "strict", z.ZodTypeAny, {
575
+ companion_id: string;
576
+ }, {
577
+ companion_id: string;
578
+ }>;
579
+ export type WorkstationRevokeRequest = z.infer<typeof WorkstationRevokeRequestSchema>;
580
+ export declare const WorkstationRevokeResponseSchema: z.ZodObject<{
581
+ companion_id: z.ZodString;
582
+ revoked_at: z.ZodString;
583
+ closed_connections: z.ZodNumber;
584
+ }, "strict", z.ZodTypeAny, {
585
+ companion_id: string;
586
+ closed_connections: number;
587
+ revoked_at: string;
588
+ }, {
589
+ companion_id: string;
590
+ closed_connections: number;
591
+ revoked_at: string;
592
+ }>;
593
+ export type WorkstationRevokeResponse = z.infer<typeof WorkstationRevokeResponseSchema>;
594
+ export declare const BillingStatusResponseSchema: z.ZodObject<{
595
+ entitlement: z.ZodEffects<z.ZodEffects<z.ZodObject<{
596
+ access: z.ZodEnum<["granted", "denied"]>;
597
+ reason: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
598
+ subscription_state: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
599
+ access_until: z.ZodNullable<z.ZodString>;
600
+ grace_deadline: z.ZodNullable<z.ZodString>;
601
+ suspended: z.ZodBoolean;
602
+ /** The unexpired operator grant's cutoff, else `null`. */
603
+ grant_until: z.ZodNullable<z.ZodString>;
604
+ last_reconciled_at: z.ZodNullable<z.ZodString>;
605
+ stale: z.ZodBoolean;
606
+ }, "strict", z.ZodTypeAny, {
607
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
608
+ suspended: boolean;
609
+ access: "denied" | "granted";
610
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
611
+ access_until: string | null;
612
+ grace_deadline: string | null;
613
+ grant_until: string | null;
614
+ last_reconciled_at: string | null;
615
+ stale: boolean;
616
+ }, {
617
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
618
+ suspended: boolean;
619
+ access: "denied" | "granted";
620
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
621
+ access_until: string | null;
622
+ grace_deadline: string | null;
623
+ grant_until: string | null;
624
+ last_reconciled_at: string | null;
625
+ stale: boolean;
626
+ }>, {
627
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
628
+ suspended: boolean;
629
+ access: "denied" | "granted";
630
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
631
+ access_until: string | null;
632
+ grace_deadline: string | null;
633
+ grant_until: string | null;
634
+ last_reconciled_at: string | null;
635
+ stale: boolean;
636
+ }, {
637
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
638
+ suspended: boolean;
639
+ access: "denied" | "granted";
640
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
641
+ access_until: string | null;
642
+ grace_deadline: string | null;
643
+ grant_until: string | null;
644
+ last_reconciled_at: string | null;
645
+ stale: boolean;
646
+ }>, {
647
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
648
+ suspended: boolean;
649
+ access: "denied" | "granted";
650
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
651
+ access_until: string | null;
652
+ grace_deadline: string | null;
653
+ grant_until: string | null;
654
+ last_reconciled_at: string | null;
655
+ stale: boolean;
656
+ }, {
657
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
658
+ suspended: boolean;
659
+ access: "denied" | "granted";
660
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
661
+ access_until: string | null;
662
+ grace_deadline: string | null;
663
+ grant_until: string | null;
664
+ last_reconciled_at: string | null;
665
+ stale: boolean;
666
+ }>;
667
+ }, "strict", z.ZodTypeAny, {
668
+ entitlement: {
669
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
670
+ suspended: boolean;
671
+ access: "denied" | "granted";
672
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
673
+ access_until: string | null;
674
+ grace_deadline: string | null;
675
+ grant_until: string | null;
676
+ last_reconciled_at: string | null;
677
+ stale: boolean;
678
+ };
679
+ }, {
680
+ entitlement: {
681
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
682
+ suspended: boolean;
683
+ access: "denied" | "granted";
684
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
685
+ access_until: string | null;
686
+ grace_deadline: string | null;
687
+ grant_until: string | null;
688
+ last_reconciled_at: string | null;
689
+ stale: boolean;
690
+ };
691
+ }>;
692
+ export type BillingStatusResponse = z.infer<typeof BillingStatusResponseSchema>;
693
+ export declare const CheckoutSessionRequestSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
694
+ export declare const CheckoutSessionResponseSchema: z.ZodObject<{
695
+ checkout_url: z.ZodEffects<z.ZodString, string, string>;
696
+ }, "strict", z.ZodTypeAny, {
697
+ checkout_url: string;
698
+ }, {
699
+ checkout_url: string;
700
+ }>;
701
+ export type CheckoutSessionResponse = z.infer<typeof CheckoutSessionResponseSchema>;
702
+ export declare const PortalSessionRequestSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
703
+ export declare const PortalSessionResponseSchema: z.ZodObject<{
704
+ portal_url: z.ZodEffects<z.ZodString, string, string>;
705
+ }, "strict", z.ZodTypeAny, {
706
+ portal_url: string;
707
+ }, {
708
+ portal_url: string;
709
+ }>;
710
+ export type PortalSessionResponse = z.infer<typeof PortalSessionResponseSchema>;
711
+ export declare const StripeWebhookAckSchema: z.ZodObject<{
712
+ received: z.ZodLiteral<true>;
713
+ event_id: z.ZodString;
714
+ duplicate: z.ZodBoolean;
715
+ }, "strict", z.ZodTypeAny, {
716
+ received: true;
717
+ duplicate: boolean;
718
+ event_id: string;
719
+ }, {
720
+ received: true;
721
+ duplicate: boolean;
722
+ event_id: string;
723
+ }>;
724
+ export type StripeWebhookAck = z.infer<typeof StripeWebhookAckSchema>;
725
+ export type ControlAuthority = "none" | "oidc_state" | "account_session" | "workspace_owner" | "stripe_signature";
726
+ export interface ControlRoute {
727
+ readonly method: "GET" | "POST";
728
+ readonly path: string;
729
+ readonly authority: ControlAuthority;
730
+ readonly request: z.ZodTypeAny | null;
731
+ readonly response: z.ZodTypeAny | null;
732
+ }
733
+ /** Every control route, on the single public origin. */
734
+ export declare const CONTROL_ROUTES: {
735
+ readonly authStart: {
736
+ readonly method: "POST";
737
+ readonly path: "/api/control/auth/start";
738
+ readonly authority: "none";
739
+ readonly request: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
740
+ readonly response: z.ZodObject<{
741
+ authorization_url: z.ZodEffects<z.ZodString, string, string>;
742
+ }, "strict", z.ZodTypeAny, {
743
+ authorization_url: string;
744
+ }, {
745
+ authorization_url: string;
746
+ }>;
747
+ };
748
+ readonly authCallback: {
749
+ readonly method: "GET";
750
+ readonly path: "/api/control/auth/callback";
751
+ readonly authority: "oidc_state";
752
+ readonly request: z.ZodEffects<z.ZodObject<{
753
+ state: z.ZodString;
754
+ code: z.ZodOptional<z.ZodString>;
755
+ error: z.ZodOptional<z.ZodString>;
756
+ error_description: z.ZodOptional<z.ZodString>;
757
+ }, "strip", z.ZodTypeAny, {
758
+ state: string;
759
+ error?: string | undefined;
760
+ code?: string | undefined;
761
+ error_description?: string | undefined;
762
+ }, {
763
+ state: string;
764
+ error?: string | undefined;
765
+ code?: string | undefined;
766
+ error_description?: string | undefined;
767
+ }>, {
768
+ state: string;
769
+ error?: string | undefined;
770
+ code?: string | undefined;
771
+ error_description?: string | undefined;
772
+ }, {
773
+ state: string;
774
+ error?: string | undefined;
775
+ code?: string | undefined;
776
+ error_description?: string | undefined;
777
+ }>;
778
+ readonly response: null;
779
+ };
780
+ readonly authLogout: {
781
+ readonly method: "POST";
782
+ readonly path: "/api/control/auth/logout";
783
+ readonly authority: "account_session";
784
+ readonly request: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
785
+ readonly response: z.ZodObject<{
786
+ logged_out: z.ZodLiteral<true>;
787
+ }, "strict", z.ZodTypeAny, {
788
+ logged_out: true;
789
+ }, {
790
+ logged_out: true;
791
+ }>;
792
+ };
793
+ readonly authSession: {
794
+ readonly method: "GET";
795
+ readonly path: "/api/control/auth/session";
796
+ readonly authority: "account_session";
797
+ readonly request: null;
798
+ readonly response: z.ZodObject<{
799
+ account: z.ZodObject<{
800
+ id: z.ZodString;
801
+ display_name: z.ZodNullable<z.ZodString>;
802
+ }, "strict", z.ZodTypeAny, {
803
+ id: string;
804
+ display_name: string | null;
805
+ }, {
806
+ id: string;
807
+ display_name: string | null;
808
+ }>;
809
+ expires_at: z.ZodString;
810
+ }, "strict", z.ZodTypeAny, {
811
+ account: {
812
+ id: string;
813
+ display_name: string | null;
814
+ };
815
+ expires_at: string;
816
+ }, {
817
+ account: {
818
+ id: string;
819
+ display_name: string | null;
820
+ };
821
+ expires_at: string;
822
+ }>;
823
+ };
824
+ readonly workspaceRead: {
825
+ readonly method: "GET";
826
+ readonly path: "/api/control/workspace";
827
+ readonly authority: "workspace_owner";
828
+ readonly request: null;
829
+ readonly response: z.ZodObject<{
830
+ workspace: z.ZodObject<{
831
+ id: z.ZodString;
832
+ }, "strict", z.ZodTypeAny, {
833
+ id: string;
834
+ }, {
835
+ id: string;
836
+ }>;
837
+ role: z.ZodEnum<["owner"]>;
838
+ entitlement: z.ZodEffects<z.ZodEffects<z.ZodObject<{
839
+ access: z.ZodEnum<["granted", "denied"]>;
840
+ reason: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
841
+ subscription_state: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
842
+ access_until: z.ZodNullable<z.ZodString>;
843
+ grace_deadline: z.ZodNullable<z.ZodString>;
844
+ suspended: z.ZodBoolean;
845
+ /** The unexpired operator grant's cutoff, else `null`. */
846
+ grant_until: z.ZodNullable<z.ZodString>;
847
+ last_reconciled_at: z.ZodNullable<z.ZodString>;
848
+ stale: z.ZodBoolean;
849
+ }, "strict", z.ZodTypeAny, {
850
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
851
+ suspended: boolean;
852
+ access: "denied" | "granted";
853
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
854
+ access_until: string | null;
855
+ grace_deadline: string | null;
856
+ grant_until: string | null;
857
+ last_reconciled_at: string | null;
858
+ stale: boolean;
859
+ }, {
860
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
861
+ suspended: boolean;
862
+ access: "denied" | "granted";
863
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
864
+ access_until: string | null;
865
+ grace_deadline: string | null;
866
+ grant_until: string | null;
867
+ last_reconciled_at: string | null;
868
+ stale: boolean;
869
+ }>, {
870
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
871
+ suspended: boolean;
872
+ access: "denied" | "granted";
873
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
874
+ access_until: string | null;
875
+ grace_deadline: string | null;
876
+ grant_until: string | null;
877
+ last_reconciled_at: string | null;
878
+ stale: boolean;
879
+ }, {
880
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
881
+ suspended: boolean;
882
+ access: "denied" | "granted";
883
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
884
+ access_until: string | null;
885
+ grace_deadline: string | null;
886
+ grant_until: string | null;
887
+ last_reconciled_at: string | null;
888
+ stale: boolean;
889
+ }>, {
890
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
891
+ suspended: boolean;
892
+ access: "denied" | "granted";
893
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
894
+ access_until: string | null;
895
+ grace_deadline: string | null;
896
+ grant_until: string | null;
897
+ last_reconciled_at: string | null;
898
+ stale: boolean;
899
+ }, {
900
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
901
+ suspended: boolean;
902
+ access: "denied" | "granted";
903
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
904
+ access_until: string | null;
905
+ grace_deadline: string | null;
906
+ grant_until: string | null;
907
+ last_reconciled_at: string | null;
908
+ stale: boolean;
909
+ }>;
910
+ /** `false`: the billing routes do not exist and access comes only from operator grants. */
911
+ billing_enabled: z.ZodBoolean;
912
+ max_workstations: z.ZodLiteral<2>;
913
+ workstations: z.ZodArray<z.ZodObject<{
914
+ companion_id: z.ZodString;
915
+ label: z.ZodString;
916
+ created_at: z.ZodString;
917
+ key_issued_at: z.ZodNullable<z.ZodString>;
918
+ connection: z.ZodEffects<z.ZodObject<{
919
+ state: z.ZodEnum<["offline", "online"]>;
920
+ connection_generation: z.ZodNullable<z.ZodNumber>;
921
+ }, "strict", z.ZodTypeAny, {
922
+ state: "offline" | "online";
923
+ connection_generation: number | null;
924
+ }, {
925
+ state: "offline" | "online";
926
+ connection_generation: number | null;
927
+ }>, {
928
+ state: "offline" | "online";
929
+ connection_generation: number | null;
930
+ }, {
931
+ state: "offline" | "online";
932
+ connection_generation: number | null;
933
+ }>;
934
+ }, "strict", z.ZodTypeAny, {
935
+ companion_id: string;
936
+ connection: {
937
+ state: "offline" | "online";
938
+ connection_generation: number | null;
939
+ };
940
+ created_at: string;
941
+ label: string;
942
+ key_issued_at: string | null;
943
+ }, {
944
+ companion_id: string;
945
+ connection: {
946
+ state: "offline" | "online";
947
+ connection_generation: number | null;
948
+ };
949
+ created_at: string;
950
+ label: string;
951
+ key_issued_at: string | null;
952
+ }>, "many">;
953
+ }, "strict", z.ZodTypeAny, {
954
+ role: "owner";
955
+ workspace: {
956
+ id: string;
957
+ };
958
+ entitlement: {
959
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
960
+ suspended: boolean;
961
+ access: "denied" | "granted";
962
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
963
+ access_until: string | null;
964
+ grace_deadline: string | null;
965
+ grant_until: string | null;
966
+ last_reconciled_at: string | null;
967
+ stale: boolean;
968
+ };
969
+ billing_enabled: boolean;
970
+ max_workstations: 2;
971
+ workstations: {
972
+ companion_id: string;
973
+ connection: {
974
+ state: "offline" | "online";
975
+ connection_generation: number | null;
976
+ };
977
+ created_at: string;
978
+ label: string;
979
+ key_issued_at: string | null;
980
+ }[];
981
+ }, {
982
+ role: "owner";
983
+ workspace: {
984
+ id: string;
985
+ };
986
+ entitlement: {
987
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
988
+ suspended: boolean;
989
+ access: "denied" | "granted";
990
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
991
+ access_until: string | null;
992
+ grace_deadline: string | null;
993
+ grant_until: string | null;
994
+ last_reconciled_at: string | null;
995
+ stale: boolean;
996
+ };
997
+ billing_enabled: boolean;
998
+ max_workstations: 2;
999
+ workstations: {
1000
+ companion_id: string;
1001
+ connection: {
1002
+ state: "offline" | "online";
1003
+ connection_generation: number | null;
1004
+ };
1005
+ created_at: string;
1006
+ label: string;
1007
+ key_issued_at: string | null;
1008
+ }[];
1009
+ }>;
1010
+ };
1011
+ readonly workstationCreate: {
1012
+ readonly method: "POST";
1013
+ readonly path: "/api/control/workstations";
1014
+ readonly authority: "workspace_owner";
1015
+ readonly request: z.ZodObject<{
1016
+ label: z.ZodString;
1017
+ }, "strict", z.ZodTypeAny, {
1018
+ label: string;
1019
+ }, {
1020
+ label: string;
1021
+ }>;
1022
+ readonly response: z.ZodObject<{
1023
+ workstation: z.ZodObject<{
1024
+ companion_id: z.ZodString;
1025
+ label: z.ZodString;
1026
+ created_at: z.ZodString;
1027
+ key_issued_at: z.ZodNullable<z.ZodString>;
1028
+ connection: z.ZodEffects<z.ZodObject<{
1029
+ state: z.ZodEnum<["offline", "online"]>;
1030
+ connection_generation: z.ZodNullable<z.ZodNumber>;
1031
+ }, "strict", z.ZodTypeAny, {
1032
+ state: "offline" | "online";
1033
+ connection_generation: number | null;
1034
+ }, {
1035
+ state: "offline" | "online";
1036
+ connection_generation: number | null;
1037
+ }>, {
1038
+ state: "offline" | "online";
1039
+ connection_generation: number | null;
1040
+ }, {
1041
+ state: "offline" | "online";
1042
+ connection_generation: number | null;
1043
+ }>;
1044
+ }, "strict", z.ZodTypeAny, {
1045
+ companion_id: string;
1046
+ connection: {
1047
+ state: "offline" | "online";
1048
+ connection_generation: number | null;
1049
+ };
1050
+ created_at: string;
1051
+ label: string;
1052
+ key_issued_at: string | null;
1053
+ }, {
1054
+ companion_id: string;
1055
+ connection: {
1056
+ state: "offline" | "online";
1057
+ connection_generation: number | null;
1058
+ };
1059
+ created_at: string;
1060
+ label: string;
1061
+ key_issued_at: string | null;
1062
+ }>;
1063
+ api_key: z.ZodString;
1064
+ }, "strict", z.ZodTypeAny, {
1065
+ api_key: string;
1066
+ workstation: {
1067
+ companion_id: string;
1068
+ connection: {
1069
+ state: "offline" | "online";
1070
+ connection_generation: number | null;
1071
+ };
1072
+ created_at: string;
1073
+ label: string;
1074
+ key_issued_at: string | null;
1075
+ };
1076
+ }, {
1077
+ api_key: string;
1078
+ workstation: {
1079
+ companion_id: string;
1080
+ connection: {
1081
+ state: "offline" | "online";
1082
+ connection_generation: number | null;
1083
+ };
1084
+ created_at: string;
1085
+ label: string;
1086
+ key_issued_at: string | null;
1087
+ };
1088
+ }>;
1089
+ };
1090
+ readonly workstationRotate: {
1091
+ readonly method: "POST";
1092
+ readonly path: "/api/control/workstations/rotate";
1093
+ readonly authority: "workspace_owner";
1094
+ readonly request: z.ZodObject<{
1095
+ companion_id: z.ZodString;
1096
+ }, "strict", z.ZodTypeAny, {
1097
+ companion_id: string;
1098
+ }, {
1099
+ companion_id: string;
1100
+ }>;
1101
+ readonly response: z.ZodObject<{
1102
+ companion_id: z.ZodString;
1103
+ api_key: z.ZodString;
1104
+ revoked_credential_id: z.ZodNullable<z.ZodString>;
1105
+ closed_connections: z.ZodNumber;
1106
+ }, "strict", z.ZodTypeAny, {
1107
+ api_key: string;
1108
+ companion_id: string;
1109
+ revoked_credential_id: string | null;
1110
+ closed_connections: number;
1111
+ }, {
1112
+ api_key: string;
1113
+ companion_id: string;
1114
+ revoked_credential_id: string | null;
1115
+ closed_connections: number;
1116
+ }>;
1117
+ };
1118
+ readonly workstationRevoke: {
1119
+ readonly method: "POST";
1120
+ readonly path: "/api/control/workstations/revoke";
1121
+ readonly authority: "workspace_owner";
1122
+ readonly request: z.ZodObject<{
1123
+ companion_id: z.ZodString;
1124
+ }, "strict", z.ZodTypeAny, {
1125
+ companion_id: string;
1126
+ }, {
1127
+ companion_id: string;
1128
+ }>;
1129
+ readonly response: z.ZodObject<{
1130
+ companion_id: z.ZodString;
1131
+ revoked_at: z.ZodString;
1132
+ closed_connections: z.ZodNumber;
1133
+ }, "strict", z.ZodTypeAny, {
1134
+ companion_id: string;
1135
+ closed_connections: number;
1136
+ revoked_at: string;
1137
+ }, {
1138
+ companion_id: string;
1139
+ closed_connections: number;
1140
+ revoked_at: string;
1141
+ }>;
1142
+ };
1143
+ readonly billingStatus: {
1144
+ readonly method: "GET";
1145
+ readonly path: "/api/control/billing/status";
1146
+ readonly authority: "workspace_owner";
1147
+ readonly request: null;
1148
+ readonly response: z.ZodObject<{
1149
+ entitlement: z.ZodEffects<z.ZodEffects<z.ZodObject<{
1150
+ access: z.ZodEnum<["granted", "denied"]>;
1151
+ reason: z.ZodEnum<["paid_period", "past_due_grace", "period_ended", "grace_expired", "no_purchase", "payment_pending", "subscription_inactive", "unknown_state", "suspended", "operator_grant"]>;
1152
+ subscription_state: z.ZodEnum<["none", "active", "trialing", "past_due", "incomplete", "incomplete_expired", "unpaid", "canceled", "paused", "unknown"]>;
1153
+ access_until: z.ZodNullable<z.ZodString>;
1154
+ grace_deadline: z.ZodNullable<z.ZodString>;
1155
+ suspended: z.ZodBoolean;
1156
+ /** The unexpired operator grant's cutoff, else `null`. */
1157
+ grant_until: z.ZodNullable<z.ZodString>;
1158
+ last_reconciled_at: z.ZodNullable<z.ZodString>;
1159
+ stale: z.ZodBoolean;
1160
+ }, "strict", z.ZodTypeAny, {
1161
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1162
+ suspended: boolean;
1163
+ access: "denied" | "granted";
1164
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1165
+ access_until: string | null;
1166
+ grace_deadline: string | null;
1167
+ grant_until: string | null;
1168
+ last_reconciled_at: string | null;
1169
+ stale: boolean;
1170
+ }, {
1171
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1172
+ suspended: boolean;
1173
+ access: "denied" | "granted";
1174
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1175
+ access_until: string | null;
1176
+ grace_deadline: string | null;
1177
+ grant_until: string | null;
1178
+ last_reconciled_at: string | null;
1179
+ stale: boolean;
1180
+ }>, {
1181
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1182
+ suspended: boolean;
1183
+ access: "denied" | "granted";
1184
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1185
+ access_until: string | null;
1186
+ grace_deadline: string | null;
1187
+ grant_until: string | null;
1188
+ last_reconciled_at: string | null;
1189
+ stale: boolean;
1190
+ }, {
1191
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1192
+ suspended: boolean;
1193
+ access: "denied" | "granted";
1194
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1195
+ access_until: string | null;
1196
+ grace_deadline: string | null;
1197
+ grant_until: string | null;
1198
+ last_reconciled_at: string | null;
1199
+ stale: boolean;
1200
+ }>, {
1201
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1202
+ suspended: boolean;
1203
+ access: "denied" | "granted";
1204
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1205
+ access_until: string | null;
1206
+ grace_deadline: string | null;
1207
+ grant_until: string | null;
1208
+ last_reconciled_at: string | null;
1209
+ stale: boolean;
1210
+ }, {
1211
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1212
+ suspended: boolean;
1213
+ access: "denied" | "granted";
1214
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1215
+ access_until: string | null;
1216
+ grace_deadline: string | null;
1217
+ grant_until: string | null;
1218
+ last_reconciled_at: string | null;
1219
+ stale: boolean;
1220
+ }>;
1221
+ }, "strict", z.ZodTypeAny, {
1222
+ entitlement: {
1223
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1224
+ suspended: boolean;
1225
+ access: "denied" | "granted";
1226
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1227
+ access_until: string | null;
1228
+ grace_deadline: string | null;
1229
+ grant_until: string | null;
1230
+ last_reconciled_at: string | null;
1231
+ stale: boolean;
1232
+ };
1233
+ }, {
1234
+ entitlement: {
1235
+ reason: "paid_period" | "past_due_grace" | "period_ended" | "grace_expired" | "no_purchase" | "payment_pending" | "subscription_inactive" | "unknown_state" | "suspended" | "operator_grant";
1236
+ suspended: boolean;
1237
+ access: "denied" | "granted";
1238
+ subscription_state: "none" | "incomplete" | "unknown" | "active" | "paused" | "trialing" | "past_due" | "incomplete_expired" | "unpaid" | "canceled";
1239
+ access_until: string | null;
1240
+ grace_deadline: string | null;
1241
+ grant_until: string | null;
1242
+ last_reconciled_at: string | null;
1243
+ stale: boolean;
1244
+ };
1245
+ }>;
1246
+ };
1247
+ readonly billingCheckout: {
1248
+ readonly method: "POST";
1249
+ readonly path: "/api/control/billing/checkout";
1250
+ readonly authority: "workspace_owner";
1251
+ readonly request: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
1252
+ readonly response: z.ZodObject<{
1253
+ checkout_url: z.ZodEffects<z.ZodString, string, string>;
1254
+ }, "strict", z.ZodTypeAny, {
1255
+ checkout_url: string;
1256
+ }, {
1257
+ checkout_url: string;
1258
+ }>;
1259
+ };
1260
+ readonly billingPortal: {
1261
+ readonly method: "POST";
1262
+ readonly path: "/api/control/billing/portal";
1263
+ readonly authority: "workspace_owner";
1264
+ readonly request: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
1265
+ readonly response: z.ZodObject<{
1266
+ portal_url: z.ZodEffects<z.ZodString, string, string>;
1267
+ }, "strict", z.ZodTypeAny, {
1268
+ portal_url: string;
1269
+ }, {
1270
+ portal_url: string;
1271
+ }>;
1272
+ };
1273
+ readonly stripeWebhook: {
1274
+ readonly method: "POST";
1275
+ readonly path: "/api/control/billing/webhook";
1276
+ readonly authority: "stripe_signature";
1277
+ readonly request: null;
1278
+ readonly response: z.ZodObject<{
1279
+ received: z.ZodLiteral<true>;
1280
+ event_id: z.ZodString;
1281
+ duplicate: z.ZodBoolean;
1282
+ }, "strict", z.ZodTypeAny, {
1283
+ received: true;
1284
+ duplicate: boolean;
1285
+ event_id: string;
1286
+ }, {
1287
+ received: true;
1288
+ duplicate: boolean;
1289
+ event_id: string;
1290
+ }>;
1291
+ };
1292
+ };
1293
+ export type ControlRouteName = keyof typeof CONTROL_ROUTES;