@intentic/sandbox-contract 1.408.1 → 1.410.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 (211) hide show
  1. package/dist/contracts/accounts.contract.d.ts +0 -16
  2. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  3. package/dist/contracts/agent.contract.d.ts +54 -0
  4. package/dist/contracts/agent.contract.d.ts.map +1 -1
  5. package/dist/contracts/agents.contract.d.ts +12 -0
  6. package/dist/contracts/agents.contract.d.ts.map +1 -1
  7. package/dist/contracts/automations.contract.d.ts.map +1 -1
  8. package/dist/contracts/automations.contract.js +1 -0
  9. package/dist/contracts/automations.contract.js.map +1 -1
  10. package/dist/contracts/capabilities.contract.d.ts +504 -8
  11. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  12. package/dist/contracts/capabilities.contract.js +74 -1
  13. package/dist/contracts/capabilities.contract.js.map +1 -1
  14. package/dist/contracts/device.contract.d.ts +23 -0
  15. package/dist/contracts/device.contract.d.ts.map +1 -1
  16. package/dist/contracts/extensions.contract.d.ts +350 -4
  17. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  18. package/dist/contracts/hub.contract.d.ts +121 -0
  19. package/dist/contracts/hub.contract.d.ts.map +1 -0
  20. package/dist/contracts/hub.contract.js +32 -0
  21. package/dist/contracts/hub.contract.js.map +1 -0
  22. package/dist/contracts/needs.contract.d.ts +9 -0
  23. package/dist/contracts/needs.contract.d.ts.map +1 -1
  24. package/dist/contracts/runner.contract.d.ts +288 -250
  25. package/dist/contracts/runner.contract.d.ts.map +1 -1
  26. package/dist/contracts/secrets.contract.d.ts +1 -73
  27. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  28. package/dist/contracts/secrets.contract.js +4 -20
  29. package/dist/contracts/secrets.contract.js.map +1 -1
  30. package/dist/contracts/sessions.contract.d.ts +6 -0
  31. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  32. package/dist/contracts/system.contract.d.ts +27 -0
  33. package/dist/contracts/system.contract.d.ts.map +1 -1
  34. package/dist/events/agent-events.d.ts +26 -0
  35. package/dist/events/agent-events.d.ts.map +1 -1
  36. package/dist/events/agent-events.js +3 -0
  37. package/dist/events/agent-events.js.map +1 -1
  38. package/dist/events/agent-transcript.d.ts +6 -0
  39. package/dist/events/agent-transcript.d.ts.map +1 -1
  40. package/dist/events/prompt-origins.d.ts +54 -0
  41. package/dist/events/prompt-origins.d.ts.map +1 -0
  42. package/dist/events/prompt-origins.js +44 -0
  43. package/dist/events/prompt-origins.js.map +1 -0
  44. package/dist/events/transcript.d.ts +31 -45
  45. package/dist/events/transcript.d.ts.map +1 -1
  46. package/dist/events/transcript.js +3 -27
  47. package/dist/events/transcript.js.map +1 -1
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -2
  51. package/dist/index.js.map +1 -1
  52. package/dist/netd/generated/wire.d.ts +4 -0
  53. package/dist/netd/generated/wire.d.ts.map +1 -1
  54. package/dist/oauth/google-workspace.d.ts +4 -0
  55. package/dist/oauth/google-workspace.d.ts.map +1 -0
  56. package/dist/oauth/google-workspace.js +6 -0
  57. package/dist/oauth/google-workspace.js.map +1 -0
  58. package/dist/policy/failure-codes.d.ts +4 -0
  59. package/dist/policy/failure-codes.d.ts.map +1 -1
  60. package/dist/policy/failure-codes.js +1 -0
  61. package/dist/policy/failure-codes.js.map +1 -1
  62. package/dist/policy/git/git-connections.d.ts +15 -0
  63. package/dist/policy/git/git-connections.d.ts.map +1 -0
  64. package/dist/policy/git/git-connections.js +34 -0
  65. package/dist/policy/git/git-connections.js.map +1 -0
  66. package/dist/policy/org-locks.d.ts +1 -1
  67. package/dist/policy/org-locks.d.ts.map +1 -1
  68. package/dist/policy/org-locks.js +1 -0
  69. package/dist/policy/org-locks.js.map +1 -1
  70. package/dist/protocol/doors/runner-wake.d.ts +46 -0
  71. package/dist/protocol/doors/runner-wake.d.ts.map +1 -0
  72. package/dist/protocol/doors/runner-wake.js +21 -0
  73. package/dist/protocol/doors/runner-wake.js.map +1 -0
  74. package/dist/protocol/raw/raw-json-routes.d.ts +135 -145
  75. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  76. package/dist/protocol/raw/raw-json-routes.js +7 -7
  77. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  78. package/dist/protocol/raw/raw-routes.d.ts +19 -4
  79. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  80. package/dist/protocol/raw/raw-routes.js +8 -4
  81. package/dist/protocol/raw/raw-routes.js.map +1 -1
  82. package/dist/schemas/capabilities.d.ts +8 -24
  83. package/dist/schemas/capabilities.d.ts.map +1 -1
  84. package/dist/schemas/capabilities.js +12 -43
  85. package/dist/schemas/capabilities.js.map +1 -1
  86. package/dist/schemas/certificate-request.d.ts +38 -0
  87. package/dist/schemas/certificate-request.d.ts.map +1 -0
  88. package/dist/schemas/certificate-request.js +18 -0
  89. package/dist/schemas/certificate-request.js.map +1 -0
  90. package/dist/schemas/connection-hub.d.ts +347 -0
  91. package/dist/schemas/connection-hub.d.ts.map +1 -0
  92. package/dist/schemas/connection-hub.js +118 -0
  93. package/dist/schemas/connection-hub.js.map +1 -0
  94. package/dist/schemas/device-move.d.ts +46 -0
  95. package/dist/schemas/device-move.d.ts.map +1 -0
  96. package/dist/schemas/device-move.js +34 -0
  97. package/dist/schemas/device-move.js.map +1 -0
  98. package/dist/schemas/device-sign-in.d.ts +25 -0
  99. package/dist/schemas/device-sign-in.d.ts.map +1 -0
  100. package/dist/schemas/device-sign-in.js +24 -0
  101. package/dist/schemas/device-sign-in.js.map +1 -0
  102. package/dist/schemas/devices.d.ts +50 -0
  103. package/dist/schemas/devices.d.ts.map +1 -1
  104. package/dist/schemas/devices.js +6 -0
  105. package/dist/schemas/devices.js.map +1 -1
  106. package/dist/schemas/diagnostics.d.ts +22 -1
  107. package/dist/schemas/diagnostics.d.ts.map +1 -1
  108. package/dist/schemas/diagnostics.js +13 -1
  109. package/dist/schemas/diagnostics.js.map +1 -1
  110. package/dist/schemas/extension-updates.d.ts +700 -8
  111. package/dist/schemas/extension-updates.d.ts.map +1 -1
  112. package/dist/schemas/git/remote-refs.d.ts +1 -0
  113. package/dist/schemas/git/remote-refs.d.ts.map +1 -1
  114. package/dist/schemas/git/remote-refs.js +5 -0
  115. package/dist/schemas/git/remote-refs.js.map +1 -1
  116. package/dist/schemas/git-installs.d.ts +20 -0
  117. package/dist/schemas/git-installs.d.ts.map +1 -0
  118. package/dist/schemas/git-installs.js +46 -0
  119. package/dist/schemas/git-installs.js.map +1 -0
  120. package/dist/schemas/hosts.d.ts +2 -0
  121. package/dist/schemas/hosts.d.ts.map +1 -1
  122. package/dist/schemas/hosts.js +2 -0
  123. package/dist/schemas/hosts.js.map +1 -1
  124. package/dist/schemas/links.d.ts +89 -21
  125. package/dist/schemas/links.d.ts.map +1 -1
  126. package/dist/schemas/links.js +73 -9
  127. package/dist/schemas/links.js.map +1 -1
  128. package/dist/schemas/mcp-sign-in.d.ts +46 -0
  129. package/dist/schemas/mcp-sign-in.d.ts.map +1 -0
  130. package/dist/schemas/mcp-sign-in.js +54 -0
  131. package/dist/schemas/mcp-sign-in.js.map +1 -0
  132. package/dist/schemas/needs.d.ts +8 -0
  133. package/dist/schemas/needs.d.ts.map +1 -1
  134. package/dist/schemas/needs.js +5 -1
  135. package/dist/schemas/needs.js.map +1 -1
  136. package/dist/schemas/providers/provider-oauth.d.ts +0 -16
  137. package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
  138. package/dist/schemas/providers/provider-oauth.js +0 -4
  139. package/dist/schemas/providers/provider-oauth.js.map +1 -1
  140. package/dist/schemas/sandbox-passwords.d.ts +0 -142
  141. package/dist/schemas/sandbox-passwords.d.ts.map +1 -1
  142. package/dist/schemas/sandbox-passwords.js +1 -33
  143. package/dist/schemas/sandbox-passwords.js.map +1 -1
  144. package/dist/schemas/system.d.ts +4 -0
  145. package/dist/schemas/system.d.ts.map +1 -1
  146. package/dist/schemas/system.js +4 -0
  147. package/dist/schemas/system.js.map +1 -1
  148. package/dist/state/auth-state.d.ts.map +1 -1
  149. package/dist/state/auth-state.js +1 -0
  150. package/dist/state/auth-state.js.map +1 -1
  151. package/dist/state/definition.d.ts +6 -8
  152. package/dist/state/definition.d.ts.map +1 -1
  153. package/dist/text/mentions.d.ts +5 -0
  154. package/dist/text/mentions.d.ts.map +1 -1
  155. package/dist/text/mentions.js +15 -3
  156. package/dist/text/mentions.js.map +1 -1
  157. package/dist/text/transcript-fold.d.ts.map +1 -1
  158. package/dist/text/transcript-fold.js +4 -8
  159. package/dist/text/transcript-fold.js.map +1 -1
  160. package/package.json +5 -5
  161. package/src/contracts/automations.contract.ts +3 -0
  162. package/src/contracts/capabilities.contract.ts +98 -0
  163. package/src/contracts/hub.contract.ts +39 -0
  164. package/src/contracts/secrets.contract.ts +5 -21
  165. package/src/events/agent-events.ts +5 -0
  166. package/src/events/prompt-origins.ts +65 -0
  167. package/src/events/transcript.ts +4 -40
  168. package/src/index.ts +3 -3
  169. package/src/netd/generated/netd-wire.json +24 -0
  170. package/src/netd/generated/wire.ts +8 -2
  171. package/src/oauth/google-workspace.ts +16 -0
  172. package/src/policy/failure-codes.ts +1 -0
  173. package/src/policy/git/git-connections.test.ts +46 -0
  174. package/src/policy/git/git-connections.ts +68 -0
  175. package/src/policy/org-locks.ts +1 -0
  176. package/src/policy/tests/failure-codes.test.ts +3 -1
  177. package/src/protocol/doors/runner-wake.ts +36 -0
  178. package/src/protocol/raw/raw-json-routes.ts +13 -10
  179. package/src/protocol/raw/raw-routes.ts +15 -7
  180. package/src/schemas/capabilities.ts +16 -64
  181. package/src/schemas/certificate-request.ts +28 -0
  182. package/src/schemas/connection-hub.test.ts +28 -0
  183. package/src/schemas/connection-hub.ts +191 -0
  184. package/src/schemas/device-move.ts +54 -0
  185. package/src/schemas/device-sign-in.ts +37 -0
  186. package/src/schemas/devices.ts +11 -0
  187. package/src/schemas/diagnostics.ts +19 -2
  188. package/src/schemas/git/remote-refs.ts +7 -0
  189. package/src/schemas/git-installs.ts +72 -0
  190. package/src/schemas/hosts.ts +4 -0
  191. package/src/schemas/links.ts +108 -14
  192. package/src/schemas/mcp-sign-in.ts +72 -0
  193. package/src/schemas/needs.ts +8 -1
  194. package/src/schemas/providers/provider-oauth.ts +0 -6
  195. package/src/schemas/sandbox-passwords.ts +5 -46
  196. package/src/schemas/system.ts +6 -0
  197. package/src/state/auth-state.ts +3 -0
  198. package/src/text/mentions.test.ts +16 -1
  199. package/src/text/mentions.ts +18 -4
  200. package/src/text/transcript-fold.test.ts +8 -0
  201. package/src/text/transcript-fold.ts +4 -8
  202. package/dist/contracts/sharing.contract.d.ts +0 -58
  203. package/dist/contracts/sharing.contract.d.ts.map +0 -1
  204. package/dist/contracts/sharing.contract.js +0 -41
  205. package/dist/contracts/sharing.contract.js.map +0 -1
  206. package/dist/schemas/providers/account-sharing.d.ts +0 -277
  207. package/dist/schemas/providers/account-sharing.d.ts.map +0 -1
  208. package/dist/schemas/providers/account-sharing.js +0 -68
  209. package/dist/schemas/providers/account-sharing.js.map +0 -1
  210. package/src/contracts/sharing.contract.ts +0 -54
  211. package/src/schemas/providers/account-sharing.ts +0 -123
@@ -0,0 +1,347 @@
1
+ import { z } from "zod";
2
+ export declare const HUB_ENTRY_PREFIX = "CONNECTION_";
3
+ export declare const isHubEntryName: (name: string) => boolean;
4
+ export declare const withoutHubEntries: (copies: Readonly<Record<string, string>>) => Readonly<Record<string, string>>;
5
+ export declare const HUB_HOST_SUFFIX = "connections.invalid";
6
+ export declare const HubCardKindSchema: z.ZodEnum<{
7
+ cli: "cli";
8
+ endpoint: "endpoint";
9
+ mcp: "mcp";
10
+ }>;
11
+ export type HubCardKind = z.infer<typeof HubCardKindSchema>;
12
+ export declare const HUB_ACCOUNT_PROVIDERS: readonly ["cursor", "devin", "zai", "meta"];
13
+ export declare const HubAccountProviderSchema: z.ZodEnum<{
14
+ cursor: "cursor";
15
+ devin: "devin";
16
+ meta: "meta";
17
+ zai: "zai";
18
+ }>;
19
+ export type HubAccountProvider = z.infer<typeof HubAccountProviderSchema>;
20
+ export declare const StaticAccountCopySchema: z.ZodObject<{
21
+ label: z.ZodOptional<z.ZodString>;
22
+ email: z.ZodOptional<z.ZodString>;
23
+ variant: z.ZodOptional<z.ZodString>;
24
+ plan: z.ZodOptional<z.ZodString>;
25
+ apiKey: z.ZodString;
26
+ apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
27
+ backendUrl: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>;
29
+ export type StaticAccountCopy = z.infer<typeof StaticAccountCopySchema>;
30
+ export declare const HubCardItemSchema: z.ZodObject<{
31
+ type: z.ZodLiteral<"card">;
32
+ id: z.ZodString;
33
+ kind: z.ZodEnum<{
34
+ cli: "cli";
35
+ endpoint: "endpoint";
36
+ mcp: "mcp";
37
+ }>;
38
+ connector: z.ZodOptional<z.ZodString>;
39
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
40
+ }, z.core.$strict>;
41
+ export declare const HubAccountItemSchema: z.ZodObject<{
42
+ type: z.ZodLiteral<"account">;
43
+ provider: z.ZodEnum<{
44
+ cursor: "cursor";
45
+ devin: "devin";
46
+ meta: "meta";
47
+ zai: "zai";
48
+ }>;
49
+ account: z.ZodObject<{
50
+ label: z.ZodOptional<z.ZodString>;
51
+ email: z.ZodOptional<z.ZodString>;
52
+ variant: z.ZodOptional<z.ZodString>;
53
+ plan: z.ZodOptional<z.ZodString>;
54
+ apiKey: z.ZodString;
55
+ apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
56
+ backendUrl: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strict>;
59
+ export declare const HubItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ type: z.ZodLiteral<"card">;
61
+ id: z.ZodString;
62
+ kind: z.ZodEnum<{
63
+ cli: "cli";
64
+ endpoint: "endpoint";
65
+ mcp: "mcp";
66
+ }>;
67
+ connector: z.ZodOptional<z.ZodString>;
68
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
69
+ }, z.core.$strict>, z.ZodObject<{
70
+ type: z.ZodLiteral<"account">;
71
+ provider: z.ZodEnum<{
72
+ cursor: "cursor";
73
+ devin: "devin";
74
+ meta: "meta";
75
+ zai: "zai";
76
+ }>;
77
+ account: z.ZodObject<{
78
+ label: z.ZodOptional<z.ZodString>;
79
+ email: z.ZodOptional<z.ZodString>;
80
+ variant: z.ZodOptional<z.ZodString>;
81
+ plan: z.ZodOptional<z.ZodString>;
82
+ apiKey: z.ZodString;
83
+ apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
84
+ backendUrl: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ }, z.core.$strict>], "type">;
87
+ export type HubItem = z.infer<typeof HubItemSchema>;
88
+ export declare const ConnectionEnvelopeSchema: z.ZodObject<{
89
+ intentic: z.ZodLiteral<"connection">;
90
+ v: z.ZodLiteral<1>;
91
+ label: z.ZodString;
92
+ from: z.ZodObject<{
93
+ sandbox: z.ZodString;
94
+ at: z.ZodNumber;
95
+ }, z.core.$strict>;
96
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
+ type: z.ZodLiteral<"card">;
98
+ id: z.ZodString;
99
+ kind: z.ZodEnum<{
100
+ cli: "cli";
101
+ endpoint: "endpoint";
102
+ mcp: "mcp";
103
+ }>;
104
+ connector: z.ZodOptional<z.ZodString>;
105
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
106
+ }, z.core.$strict>, z.ZodObject<{
107
+ type: z.ZodLiteral<"account">;
108
+ provider: z.ZodEnum<{
109
+ cursor: "cursor";
110
+ devin: "devin";
111
+ meta: "meta";
112
+ zai: "zai";
113
+ }>;
114
+ account: z.ZodObject<{
115
+ label: z.ZodOptional<z.ZodString>;
116
+ email: z.ZodOptional<z.ZodString>;
117
+ variant: z.ZodOptional<z.ZodString>;
118
+ plan: z.ZodOptional<z.ZodString>;
119
+ apiKey: z.ZodString;
120
+ apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
121
+ backendUrl: z.ZodOptional<z.ZodString>;
122
+ }, z.core.$strip>;
123
+ }, z.core.$strict>], "type">;
124
+ }, z.core.$strict>;
125
+ export type ConnectionEnvelope = z.infer<typeof ConnectionEnvelopeSchema>;
126
+ export declare const HubWantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
127
+ type: z.ZodLiteral<"card">;
128
+ kind: z.ZodEnum<{
129
+ cli: "cli";
130
+ endpoint: "endpoint";
131
+ mcp: "mcp";
132
+ }>;
133
+ connector: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ type: z.ZodLiteral<"account">;
136
+ provider: z.ZodEnum<{
137
+ cursor: "cursor";
138
+ devin: "devin";
139
+ meta: "meta";
140
+ zai: "zai";
141
+ }>;
142
+ }, z.core.$strict>], "type">;
143
+ export type HubWant = z.infer<typeof HubWantSchema>;
144
+ export declare const hubHostOf: (want: HubWant) => string;
145
+ export declare const wantOfItem: (item: HubItem) => HubWant;
146
+ export declare const hubEntryName: (item: HubItem, tail: string) => string;
147
+ export declare const hubSlug: (value: string) => string;
148
+ export declare const HubTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
149
+ type: z.ZodLiteral<"card">;
150
+ id: z.ZodString;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ type: z.ZodLiteral<"account">;
153
+ provider: z.ZodEnum<{
154
+ cursor: "cursor";
155
+ devin: "devin";
156
+ meta: "meta";
157
+ zai: "zai";
158
+ }>;
159
+ id: z.ZodString;
160
+ }, z.core.$strict>], "type">;
161
+ export type HubTarget = z.infer<typeof HubTargetSchema>;
162
+ export declare const sameHubTarget: (a: HubTarget, b: HubTarget) => boolean;
163
+ export declare const HubComputerSchema: z.ZodObject<{
164
+ machine: z.ZodString;
165
+ online: z.ZodBoolean;
166
+ setUp: z.ZodBoolean;
167
+ locked: z.ZodOptional<z.ZodBoolean>;
168
+ }, z.core.$strip>;
169
+ export type HubComputer = z.infer<typeof HubComputerSchema>;
170
+ export declare const HubHoldingSchema: z.ZodObject<{
171
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
172
+ type: z.ZodLiteral<"card">;
173
+ id: z.ZodString;
174
+ }, z.core.$strict>, z.ZodObject<{
175
+ type: z.ZodLiteral<"account">;
176
+ provider: z.ZodEnum<{
177
+ cursor: "cursor";
178
+ devin: "devin";
179
+ meta: "meta";
180
+ zai: "zai";
181
+ }>;
182
+ id: z.ZodString;
183
+ }, z.core.$strict>], "type">;
184
+ label: z.ZodString;
185
+ want: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
186
+ type: z.ZodLiteral<"card">;
187
+ kind: z.ZodEnum<{
188
+ cli: "cli";
189
+ endpoint: "endpoint";
190
+ mcp: "mcp";
191
+ }>;
192
+ connector: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strict>, z.ZodObject<{
194
+ type: z.ZodLiteral<"account">;
195
+ provider: z.ZodEnum<{
196
+ cursor: "cursor";
197
+ devin: "devin";
198
+ meta: "meta";
199
+ zai: "zai";
200
+ }>;
201
+ }, z.core.$strict>], "type">>;
202
+ reason: z.ZodOptional<z.ZodString>;
203
+ saved: z.ZodOptional<z.ZodObject<{
204
+ entry: z.ZodString;
205
+ machine: z.ZodString;
206
+ at: z.ZodNumber;
207
+ pending: z.ZodBoolean;
208
+ }, z.core.$strip>>;
209
+ from: z.ZodOptional<z.ZodObject<{
210
+ entry: z.ZodString;
211
+ machine: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>;
214
+ export type HubHolding = z.infer<typeof HubHoldingSchema>;
215
+ export declare const HubFailureSchema: z.ZodObject<{
216
+ entry: z.ZodString;
217
+ machine: z.ZodOptional<z.ZodString>;
218
+ message: z.ZodString;
219
+ at: z.ZodNumber;
220
+ }, z.core.$strip>;
221
+ export type HubFailure = z.infer<typeof HubFailureSchema>;
222
+ export declare const HubStateSchema: z.ZodObject<{
223
+ computers: z.ZodArray<z.ZodObject<{
224
+ machine: z.ZodString;
225
+ online: z.ZodBoolean;
226
+ setUp: z.ZodBoolean;
227
+ locked: z.ZodOptional<z.ZodBoolean>;
228
+ }, z.core.$strip>>;
229
+ holdings: z.ZodArray<z.ZodObject<{
230
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
231
+ type: z.ZodLiteral<"card">;
232
+ id: z.ZodString;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ type: z.ZodLiteral<"account">;
235
+ provider: z.ZodEnum<{
236
+ cursor: "cursor";
237
+ devin: "devin";
238
+ meta: "meta";
239
+ zai: "zai";
240
+ }>;
241
+ id: z.ZodString;
242
+ }, z.core.$strict>], "type">;
243
+ label: z.ZodString;
244
+ want: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
245
+ type: z.ZodLiteral<"card">;
246
+ kind: z.ZodEnum<{
247
+ cli: "cli";
248
+ endpoint: "endpoint";
249
+ mcp: "mcp";
250
+ }>;
251
+ connector: z.ZodOptional<z.ZodString>;
252
+ }, z.core.$strict>, z.ZodObject<{
253
+ type: z.ZodLiteral<"account">;
254
+ provider: z.ZodEnum<{
255
+ cursor: "cursor";
256
+ devin: "devin";
257
+ meta: "meta";
258
+ zai: "zai";
259
+ }>;
260
+ }, z.core.$strict>], "type">>;
261
+ reason: z.ZodOptional<z.ZodString>;
262
+ saved: z.ZodOptional<z.ZodObject<{
263
+ entry: z.ZodString;
264
+ machine: z.ZodString;
265
+ at: z.ZodNumber;
266
+ pending: z.ZodBoolean;
267
+ }, z.core.$strip>>;
268
+ from: z.ZodOptional<z.ZodObject<{
269
+ entry: z.ZodString;
270
+ machine: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strip>>;
272
+ }, z.core.$strip>>;
273
+ failures: z.ZodArray<z.ZodObject<{
274
+ entry: z.ZodString;
275
+ machine: z.ZodOptional<z.ZodString>;
276
+ message: z.ZodString;
277
+ at: z.ZodNumber;
278
+ }, z.core.$strip>>;
279
+ }, z.core.$strip>;
280
+ export type HubState = z.infer<typeof HubStateSchema>;
281
+ export declare const HubSaveSchema: z.ZodObject<{
282
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
283
+ type: z.ZodLiteral<"card">;
284
+ id: z.ZodString;
285
+ }, z.core.$strict>, z.ZodObject<{
286
+ type: z.ZodLiteral<"account">;
287
+ provider: z.ZodEnum<{
288
+ cursor: "cursor";
289
+ devin: "devin";
290
+ meta: "meta";
291
+ zai: "zai";
292
+ }>;
293
+ id: z.ZodString;
294
+ }, z.core.$strict>], "type">;
295
+ machine: z.ZodString;
296
+ }, z.core.$strict>;
297
+ export type HubSave = z.infer<typeof HubSaveSchema>;
298
+ export declare const HubSavedSchema: z.ZodObject<{
299
+ entry: z.ZodString;
300
+ machine: z.ZodString;
301
+ pending: z.ZodBoolean;
302
+ }, z.core.$strip>;
303
+ export type HubSaved = z.infer<typeof HubSavedSchema>;
304
+ export declare const HubTakeSchema: z.ZodObject<{
305
+ want: z.ZodDiscriminatedUnion<[z.ZodObject<{
306
+ type: z.ZodLiteral<"card">;
307
+ kind: z.ZodEnum<{
308
+ cli: "cli";
309
+ endpoint: "endpoint";
310
+ mcp: "mcp";
311
+ }>;
312
+ connector: z.ZodOptional<z.ZodString>;
313
+ }, z.core.$strict>, z.ZodObject<{
314
+ type: z.ZodLiteral<"account">;
315
+ provider: z.ZodEnum<{
316
+ cursor: "cursor";
317
+ devin: "devin";
318
+ meta: "meta";
319
+ zai: "zai";
320
+ }>;
321
+ }, z.core.$strict>], "type">;
322
+ why: z.ZodOptional<z.ZodString>;
323
+ }, z.core.$strict>;
324
+ export type HubTake = z.infer<typeof HubTakeSchema>;
325
+ export declare const HubTakenSchema: z.ZodObject<{
326
+ outcome: z.ZodEnum<{
327
+ none: "none";
328
+ taken: "taken";
329
+ waiting: "waiting";
330
+ }>;
331
+ message: z.ZodString;
332
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
333
+ type: z.ZodLiteral<"card">;
334
+ id: z.ZodString;
335
+ }, z.core.$strict>, z.ZodObject<{
336
+ type: z.ZodLiteral<"account">;
337
+ provider: z.ZodEnum<{
338
+ cursor: "cursor";
339
+ devin: "devin";
340
+ meta: "meta";
341
+ zai: "zai";
342
+ }>;
343
+ id: z.ZodString;
344
+ }, z.core.$strict>], "type">>;
345
+ }, z.core.$strip>;
346
+ export type HubTaken = z.infer<typeof HubTakenSchema>;
347
+ //# sourceMappingURL=connection-hub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-hub.d.ts","sourceRoot":"","sources":["../../src/schemas/connection-hub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAC9C,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,OAA0E,CAAC;AAGzH,eAAO,MAAM,iBAAiB,WAAY,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACpB,CAAC;AAKzF,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAIrD,eAAO,MAAM,iBAAiB;;;;EAAqC,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI5D,eAAO,MAAM,qBAAqB,YAAI,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AACjF,eAAO,MAAM,wBAAwB;;;;;EAAgC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,eAAO,MAAM,uBAAuB;;;;;;;;iBAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC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;;;;;;iBAkB3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAG1D,eAAO,MAAM,gBAAgB;;;;;iBAAuG,CAAC;AACrI,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;kBAAsF,CAAC;AACjH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;kBAAyF,CAAC;AACpH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { z } from "zod";
2
+ import { KEYRING_NAME_RE } from "./keyring.js";
3
+ export const HUB_ENTRY_PREFIX = "CONNECTION_";
4
+ export const isHubEntryName = (name) => name.startsWith(HUB_ENTRY_PREFIX) && KEYRING_NAME_RE.test(name);
5
+ export const withoutHubEntries = (copies) => Object.fromEntries(Object.entries(copies).filter(([name]) => !isHubEntryName(name)));
6
+ export const HUB_HOST_SUFFIX = "connections.invalid";
7
+ export const HubCardKindSchema = z.enum(["cli", "mcp", "endpoint"]);
8
+ export const HUB_ACCOUNT_PROVIDERS = ["cursor", "devin", "zai", "meta"];
9
+ export const HubAccountProviderSchema = z.enum(HUB_ACCOUNT_PROVIDERS);
10
+ export const StaticAccountCopySchema = z.object({
11
+ label: z.string().max(200).optional(),
12
+ email: z.string().max(320).optional(),
13
+ variant: z.string().max(100).optional().describe("Which sign-in estate a minted key belongs to (Z.ai's international or mainland plan)."),
14
+ plan: z.string().max(100).optional(),
15
+ apiKey: z.string().min(1).max(8192),
16
+ apiKeyExpiresAtMs: z.number().optional(),
17
+ backendUrl: z.string().max(500).optional(),
18
+ });
19
+ const SLUG_RE = /^[a-z0-9][a-z0-9-]{0,40}$/u;
20
+ export const HubCardItemSchema = z
21
+ .object({
22
+ type: z.literal("card"),
23
+ id: z.string().min(1).max(60).describe("The card's id where it was saved, kept where it is free."),
24
+ kind: HubCardKindSchema,
25
+ connector: z.string().regex(SLUG_RE).optional().describe("A CLI card's connector (its `provider`), which another sandbox asks for it by."),
26
+ config: z.record(z.string(), z.unknown()),
27
+ })
28
+ .strict();
29
+ export const HubAccountItemSchema = z.object({ type: z.literal("account"), provider: HubAccountProviderSchema, account: StaticAccountCopySchema }).strict();
30
+ export const HubItemSchema = z.discriminatedUnion("type", [HubCardItemSchema, HubAccountItemSchema]);
31
+ export const ConnectionEnvelopeSchema = z
32
+ .object({
33
+ intentic: z.literal("connection"),
34
+ v: z.literal(1),
35
+ label: z.string().min(1).max(200).describe("What the connection is called, for the rows that list it."),
36
+ from: z.object({ sandbox: z.string().max(200), at: z.number() }).strict().describe("Where and when it was saved."),
37
+ item: HubItemSchema,
38
+ })
39
+ .strict();
40
+ export const HubWantSchema = z.discriminatedUnion("type", [
41
+ z.object({ type: z.literal("card"), kind: HubCardKindSchema, connector: z.string().regex(SLUG_RE).optional() }).strict(),
42
+ z.object({ type: z.literal("account"), provider: HubAccountProviderSchema }).strict(),
43
+ ]);
44
+ export const hubHostOf = (want) => {
45
+ if (want.type === "account") {
46
+ return `${want.provider}.account.${HUB_HOST_SUFFIX}`;
47
+ }
48
+ return want.kind === "cli" && want.connector !== undefined ? `${hubSlug(want.connector)}.cli.${HUB_HOST_SUFFIX}` : `${want.kind}.${HUB_HOST_SUFFIX}`;
49
+ };
50
+ export const wantOfItem = (item) => {
51
+ if (item.type === "account") {
52
+ return { type: "account", provider: item.provider };
53
+ }
54
+ return item.kind === "cli" && item.connector !== undefined ? { type: "card", kind: item.kind, connector: item.connector } : { type: "card", kind: item.kind };
55
+ };
56
+ export const hubEntryName = (item, tail) => {
57
+ const what = item.type === "account" ? item.provider : (item.connector ?? item.kind);
58
+ const readable = what
59
+ .toUpperCase()
60
+ .replace(/[^A-Z0-9]+/gu, "_")
61
+ .replace(/^_+|_+$/gu, "")
62
+ .slice(0, 40);
63
+ return `${HUB_ENTRY_PREFIX}${readable === "" ? "ITEM" : readable}_${tail.toUpperCase().replace(/[^A-Z0-9]/gu, "")}`;
64
+ };
65
+ export const hubSlug = (value) => value
66
+ .toLowerCase()
67
+ .replace(/[^a-z0-9-]+/gu, "-")
68
+ .replace(/^-+|-+$/gu, "")
69
+ .slice(0, 40) || "x";
70
+ export const HubTargetSchema = z.discriminatedUnion("type", [
71
+ z.object({ type: z.literal("card"), id: z.string().min(1).max(60) }).strict(),
72
+ z.object({ type: z.literal("account"), provider: HubAccountProviderSchema, id: z.string().min(1).max(200) }).strict(),
73
+ ]);
74
+ export const sameHubTarget = (a, b) => a.type === "card" ? b.type === "card" && a.id === b.id : b.type === "account" && a.provider === b.provider && a.id === b.id;
75
+ export const HubComputerSchema = z.object({
76
+ machine: z.string(),
77
+ online: z.boolean(),
78
+ setUp: z.boolean().describe("Its keyring is installed and set up, so it can take a connection in."),
79
+ locked: z.boolean().optional(),
80
+ });
81
+ export const HubHoldingSchema = z.object({
82
+ target: HubTargetSchema,
83
+ label: z.string(),
84
+ want: HubWantSchema.optional().describe("What another sandbox asks with to be offered it. Absent when it cannot go."),
85
+ reason: z.string().optional().describe("Why it cannot go to the hub, in words a person can act on. Absent when it can."),
86
+ saved: z
87
+ .object({
88
+ entry: z.string().regex(KEYRING_NAME_RE),
89
+ machine: z.string(),
90
+ at: z.number(),
91
+ pending: z.boolean().describe("It waits for a yes at the computer (the keyring was locked when it was sent)."),
92
+ })
93
+ .optional()
94
+ .describe("It was saved to the hub from here: which entry, on which computer."),
95
+ from: z
96
+ .object({ entry: z.string(), machine: z.string().optional() })
97
+ .optional()
98
+ .describe("It was made here from a hub entry: which, and the computer that shares it. It goes when that computer stops sharing it."),
99
+ });
100
+ export const HubFailureSchema = z.object({ entry: z.string(), machine: z.string().optional(), message: z.string(), at: z.number() });
101
+ export const HubStateSchema = z.object({
102
+ computers: z.array(HubComputerSchema),
103
+ holdings: z.array(HubHoldingSchema),
104
+ failures: z.array(HubFailureSchema),
105
+ });
106
+ export const HubSaveSchema = z.object({ target: HubTargetSchema, machine: z.string().min(1).max(128) }).strict();
107
+ export const HubSavedSchema = z.object({
108
+ entry: z.string(),
109
+ machine: z.string(),
110
+ pending: z.boolean().describe("It waits for the next unlock at that computer, where the person says yes."),
111
+ });
112
+ export const HubTakeSchema = z.object({ want: HubWantSchema, why: z.string().min(1).max(300).optional() }).strict();
113
+ export const HubTakenSchema = z.object({
114
+ outcome: z.enum(["taken", "waiting", "none"]).describe("Shared and made here; waiting for a yes at the computer; nothing saved there answers it."),
115
+ message: z.string(),
116
+ target: HubTargetSchema.optional().describe("What it was made into here, once taken."),
117
+ });
118
+ //# sourceMappingURL=connection-hub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-hub.js","sourceRoot":"","sources":["../../src/schemas/connection-hub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAc/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC9C,MAAM,C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nC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,0FAA0F,CAAC;IAClJ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACzF,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ export declare const DeviceMovePlanSchema: z.ZodObject<{
3
+ v: z.ZodNumber;
4
+ slug: z.ZodString;
5
+ bytes: z.ZodNumber;
6
+ running: z.ZodOptional<z.ZodBoolean>;
7
+ }, z.core.$loose>;
8
+ export type DeviceMovePlan = z.infer<typeof DeviceMovePlanSchema>;
9
+ export declare const DeviceMoveStepSchema: z.ZodObject<{
10
+ step: z.ZodString;
11
+ plan: z.ZodOptional<z.ZodObject<{
12
+ v: z.ZodNumber;
13
+ slug: z.ZodString;
14
+ bytes: z.ZodNumber;
15
+ running: z.ZodOptional<z.ZodBoolean>;
16
+ }, z.core.$loose>>;
17
+ publicKey: z.ZodOptional<z.ZodString>;
18
+ listen: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ port: z.ZodOptional<z.ZodNumber>;
20
+ reason: z.ZodOptional<z.ZodString>;
21
+ ambiguous: z.ZodOptional<z.ZodBoolean>;
22
+ }, z.core.$loose>;
23
+ export type DeviceMoveStep = z.infer<typeof DeviceMoveStepSchema>;
24
+ export declare const deviceMoveStepOf: (text: string) => DeviceMoveStep | undefined;
25
+ export declare const DeviceSandboxMoveSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ stage: z.ZodOptional<z.ZodEnum<{
28
+ plan: "plan";
29
+ send: "send";
30
+ }>>;
31
+ plan: z.ZodOptional<z.ZodObject<{
32
+ v: z.ZodNumber;
33
+ slug: z.ZodString;
34
+ bytes: z.ZodNumber;
35
+ running: z.ZodOptional<z.ZodBoolean>;
36
+ }, z.core.$loose>>;
37
+ peer: z.ZodOptional<z.ZodString>;
38
+ connect: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
+ listen: z.ZodOptional<z.ZodBoolean>;
40
+ manager: z.ZodOptional<z.ZodEnum<{
41
+ compose: "compose";
42
+ ic: "ic";
43
+ }>>;
44
+ }, z.core.$strict>;
45
+ export type DeviceSandboxMove = z.infer<typeof DeviceSandboxMoveSchema>;
46
+ //# sourceMappingURL=device-move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-move.d.ts","sourceRoot":"","sources":["../../src/schemas/device-move.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;;;;iBAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAU/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,cAAc,GAAG,SAKhE,CAAC;AAOF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;kBAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { parseJsonWith } from "@intentic/base/json";
2
+ import { z } from "zod";
3
+ export const DeviceMovePlanSchema = z.looseObject({
4
+ v: z.number().int(),
5
+ slug: z.string().min(1),
6
+ bytes: z.number().nonnegative(),
7
+ running: z.boolean().optional(),
8
+ });
9
+ export const DeviceMoveStepSchema = z.looseObject({
10
+ step: z.string().min(1),
11
+ plan: DeviceMovePlanSchema.optional(),
12
+ publicKey: z.string().optional(),
13
+ listen: z.array(z.string()).optional(),
14
+ port: z.number().int().positive().optional(),
15
+ reason: z.string().optional(),
16
+ ambiguous: z.boolean().optional(),
17
+ });
18
+ const DEVICE_MOVE_LINE_PREFIX = "intentic-move: ";
19
+ export const deviceMoveStepOf = (text) => {
20
+ if (!text.startsWith(DEVICE_MOVE_LINE_PREFIX)) {
21
+ return undefined;
22
+ }
23
+ return parseJsonWith(text.slice(DEVICE_MOVE_LINE_PREFIX.length), DeviceMoveStepSchema);
24
+ };
25
+ export const DeviceSandboxMoveSchema = z.strictObject({
26
+ id: z.string().regex(/^[0-9a-f]{8,64}$/),
27
+ stage: z.enum(["plan", "send"]).optional(),
28
+ plan: DeviceMovePlanSchema.optional(),
29
+ peer: z.string().min(1).optional().meta({ secret: true }),
30
+ connect: z.array(z.string().min(1)).optional(),
31
+ listen: z.boolean().optional(),
32
+ manager: z.enum(["ic", "compose"]).optional(),
33
+ });
34
+ //# sourceMappingURL=device-move.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-move.js","sourceRoot":"","sources":["../../src/schemas/device-move.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC9C,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9C,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ export declare const DeviceSignInStartSchema: z.ZodObject<{
3
+ flow: z.ZodString;
4
+ userCode: z.ZodString;
5
+ verificationUri: z.ZodString;
6
+ expiresIn: z.ZodNumber;
7
+ }, z.core.$strip>;
8
+ export type DeviceSignInStart = z.infer<typeof DeviceSignInStartSchema>;
9
+ export declare const DeviceSignInWaitInputSchema: z.ZodObject<{
10
+ flow: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export declare const DeviceSignInWaitSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ state: z.ZodLiteral<"waiting">;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ state: z.ZodLiteral<"done">;
16
+ token: z.ZodString;
17
+ who: z.ZodOptional<z.ZodString>;
18
+ granted: z.ZodArray<z.ZodString>;
19
+ bound: z.ZodArray<z.ZodString>;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ state: z.ZodLiteral<"failed">;
22
+ message: z.ZodString;
23
+ }, z.core.$strip>], "state">;
24
+ export type DeviceSignInWait = z.infer<typeof DeviceSignInWaitSchema>;
25
+ //# sourceMappingURL=device-sign-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-sign-in.d.ts","sourceRoot":"","sources":["../../src/schemas/device-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAGxE,eAAO,MAAM,2BAA2B;;iBAAwF,CAAC;AACjI,eAAO,MAAM,sBAAsB;;;;;;;;;;;4BAgBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ export const DeviceSignInStartSchema = z.object({
3
+ flow: z.string().describe("Stands for this sign-in, to wait on. Lapses with the code."),
4
+ userCode: z.string().describe("What the person types on the provider's page."),
5
+ verificationUri: z.string().describe("The provider's own page for it, to open in a new tab."),
6
+ expiresIn: z.number().describe("Seconds until the code lapses."),
7
+ });
8
+ export const DeviceSignInWaitInputSchema = z.object({ flow: z.string().min(1).describe("The sign-in, as its start answered.") });
9
+ export const DeviceSignInWaitSchema = z.discriminatedUnion("state", [
10
+ z.object({ state: z.literal("waiting").describe("Nobody has finished on the provider's page yet. Ask again.") }),
11
+ z.object({
12
+ state: z.literal("done"),
13
+ token: z
14
+ .string()
15
+ .describe("Stands for the refresh token, which never leaves the sandbox. Sent wrapped as a stash marker in the field that declares `signIn`, it installs that token once, while the fields the sign-in is bound to still hold what they held; it lapses after thirty minutes."),
16
+ who: z.string().optional().describe("Who signed in, as the card's own test or the sign-in itself names them."),
17
+ granted: z.array(z.string()).describe("What the provider granted, each permission by its short name (`Mail.Read`)."),
18
+ bound: z
19
+ .array(z.string())
20
+ .describe("The fields the sign-in is only good for as they are now (`refreshToken.boundTo`): changing one before Save needs a new sign-in."),
21
+ }),
22
+ z.object({ state: z.literal("failed"), message: z.string().describe("Why it did not finish, in words a person can act on.") }),
23
+ ]);
24
+ //# sourceMappingURL=device-sign-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-sign-in.js","sourceRoot":"","sources":["../../src/schemas/device-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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