@intentic/sandbox-contract 1.409.0 → 1.410.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) 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 +5 -0
  4. package/dist/contracts/agent.contract.d.ts.map +1 -1
  5. package/dist/contracts/capabilities.contract.d.ts +0 -12
  6. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  7. package/dist/contracts/hub.contract.d.ts +121 -0
  8. package/dist/contracts/hub.contract.d.ts.map +1 -0
  9. package/dist/contracts/hub.contract.js +32 -0
  10. package/dist/contracts/hub.contract.js.map +1 -0
  11. package/dist/contracts/secrets.contract.d.ts +1 -73
  12. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  13. package/dist/contracts/secrets.contract.js +4 -20
  14. package/dist/contracts/secrets.contract.js.map +1 -1
  15. package/dist/events/sandbox-notice.d.ts +1 -0
  16. package/dist/events/sandbox-notice.d.ts.map +1 -1
  17. package/dist/events/sandbox-notice.js +1 -1
  18. package/dist/events/sandbox-notice.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +2 -2
  22. package/dist/index.js.map +1 -1
  23. package/dist/protocol/doors/runner-wake.d.ts +46 -0
  24. package/dist/protocol/doors/runner-wake.d.ts.map +1 -0
  25. package/dist/protocol/doors/runner-wake.js +21 -0
  26. package/dist/protocol/doors/runner-wake.js.map +1 -0
  27. package/dist/protocol/raw/raw-json-routes.d.ts +14 -145
  28. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  29. package/dist/protocol/raw/raw-json-routes.js +1 -6
  30. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  31. package/dist/protocol/raw/raw-routes.d.ts +4 -16
  32. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  33. package/dist/protocol/raw/raw-routes.js +1 -4
  34. package/dist/protocol/raw/raw-routes.js.map +1 -1
  35. package/dist/schemas/agent.d.ts +3 -0
  36. package/dist/schemas/agent.d.ts.map +1 -1
  37. package/dist/schemas/agent.js +4 -0
  38. package/dist/schemas/agent.js.map +1 -1
  39. package/dist/schemas/capabilities.d.ts +0 -8
  40. package/dist/schemas/capabilities.d.ts.map +1 -1
  41. package/dist/schemas/capabilities.js +0 -4
  42. package/dist/schemas/capabilities.js.map +1 -1
  43. package/dist/schemas/connection-hub.d.ts +347 -0
  44. package/dist/schemas/connection-hub.d.ts.map +1 -0
  45. package/dist/schemas/connection-hub.js +118 -0
  46. package/dist/schemas/connection-hub.js.map +1 -0
  47. package/dist/schemas/diagnostics.d.ts +22 -1
  48. package/dist/schemas/diagnostics.d.ts.map +1 -1
  49. package/dist/schemas/diagnostics.js +13 -1
  50. package/dist/schemas/diagnostics.js.map +1 -1
  51. package/dist/schemas/links.d.ts +0 -21
  52. package/dist/schemas/links.d.ts.map +1 -1
  53. package/dist/schemas/links.js +1 -9
  54. package/dist/schemas/links.js.map +1 -1
  55. package/dist/schemas/providers/plan-limits.d.ts +5 -0
  56. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  57. package/dist/schemas/providers/plan-limits.js +4 -0
  58. package/dist/schemas/providers/plan-limits.js.map +1 -1
  59. package/dist/schemas/providers/provider-oauth.d.ts +0 -16
  60. package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
  61. package/dist/schemas/providers/provider-oauth.js +0 -4
  62. package/dist/schemas/providers/provider-oauth.js.map +1 -1
  63. package/dist/schemas/sandbox-passwords.d.ts +0 -142
  64. package/dist/schemas/sandbox-passwords.d.ts.map +1 -1
  65. package/dist/schemas/sandbox-passwords.js +1 -33
  66. package/dist/schemas/sandbox-passwords.js.map +1 -1
  67. package/dist/state/auth-state.d.ts.map +1 -1
  68. package/dist/state/auth-state.js +1 -0
  69. package/dist/state/auth-state.js.map +1 -1
  70. package/dist/state/definition.d.ts +0 -8
  71. package/dist/state/definition.d.ts.map +1 -1
  72. package/dist/text/notice-rows.d.ts.map +1 -1
  73. package/dist/text/notice-rows.js +1 -0
  74. package/dist/text/notice-rows.js.map +1 -1
  75. package/package.json +5 -5
  76. package/src/contracts/hub.contract.ts +39 -0
  77. package/src/contracts/secrets.contract.ts +5 -21
  78. package/src/events/sandbox-notice.ts +5 -4
  79. package/src/index.ts +3 -3
  80. package/src/protocol/doors/runner-wake.ts +36 -0
  81. package/src/protocol/raw/raw-json-routes.ts +0 -10
  82. package/src/protocol/raw/raw-routes.ts +2 -7
  83. package/src/schemas/agent.ts +8 -0
  84. package/src/schemas/capabilities.ts +0 -6
  85. package/src/schemas/connection-hub.test.ts +28 -0
  86. package/src/schemas/connection-hub.ts +191 -0
  87. package/src/schemas/diagnostics.ts +19 -2
  88. package/src/schemas/links.ts +4 -15
  89. package/src/schemas/providers/plan-limits.ts +6 -0
  90. package/src/schemas/providers/provider-oauth.ts +0 -6
  91. package/src/schemas/sandbox-passwords.ts +5 -46
  92. package/src/state/auth-state.ts +3 -0
  93. package/src/text/notice-rows.ts +2 -0
  94. package/dist/contracts/sharing.contract.d.ts +0 -58
  95. package/dist/contracts/sharing.contract.d.ts.map +0 -1
  96. package/dist/contracts/sharing.contract.js +0 -41
  97. package/dist/contracts/sharing.contract.js.map +0 -1
  98. package/dist/schemas/providers/account-sharing.d.ts +0 -277
  99. package/dist/schemas/providers/account-sharing.d.ts.map +0 -1
  100. package/dist/schemas/providers/account-sharing.js +0 -68
  101. package/dist/schemas/providers/account-sharing.js.map +0 -1
  102. package/src/contracts/sharing.contract.ts +0 -54
  103. package/src/schemas/providers/account-sharing.ts +0 -123
@@ -1,277 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ShareModeSchema: z.ZodEnum<{
3
- copy: "copy";
4
- lend: "lend";
5
- no: "no";
6
- }>;
7
- export type ShareMode = z.infer<typeof ShareModeSchema>;
8
- export declare const SharedAccountRefSchema: z.ZodObject<{
9
- provider: z.ZodString;
10
- account: z.ZodOptional<z.ZodString>;
11
- }, z.core.$strip>;
12
- export type SharedAccountRef = z.infer<typeof SharedAccountRefSchema>;
13
- export declare const sameSharedRef: (a: SharedAccountRef, b: SharedAccountRef) => boolean;
14
- export declare const ShareableAccountSchema: z.ZodObject<{
15
- provider: z.ZodString;
16
- account: z.ZodOptional<z.ZodString>;
17
- label: z.ZodString;
18
- email: z.ZodOptional<z.ZodString>;
19
- mode: z.ZodEnum<{
20
- copy: "copy";
21
- lend: "lend";
22
- no: "no";
23
- }>;
24
- reason: z.ZodOptional<z.ZodString>;
25
- }, z.core.$strip>;
26
- export type ShareableAccount = z.infer<typeof ShareableAccountSchema>;
27
- export declare const ShareableAccountsSchema: z.ZodObject<{
28
- sandbox: z.ZodString;
29
- accounts: z.ZodArray<z.ZodObject<{
30
- provider: z.ZodString;
31
- account: z.ZodOptional<z.ZodString>;
32
- label: z.ZodString;
33
- email: z.ZodOptional<z.ZodString>;
34
- mode: z.ZodEnum<{
35
- copy: "copy";
36
- lend: "lend";
37
- no: "no";
38
- }>;
39
- reason: z.ZodOptional<z.ZodString>;
40
- }, z.core.$strip>>;
41
- }, z.core.$strip>;
42
- export type ShareableAccounts = z.infer<typeof ShareableAccountsSchema>;
43
- export declare const StaticAccountCopySchema: z.ZodObject<{
44
- label: z.ZodOptional<z.ZodString>;
45
- email: z.ZodOptional<z.ZodString>;
46
- variant: z.ZodOptional<z.ZodString>;
47
- plan: z.ZodOptional<z.ZodString>;
48
- apiKey: z.ZodString;
49
- apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
50
- backendUrl: z.ZodOptional<z.ZodString>;
51
- }, z.core.$strip>;
52
- export type StaticAccountCopy = z.infer<typeof StaticAccountCopySchema>;
53
- export declare const AccountCopySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
- kind: z.ZodLiteral<"account">;
55
- account: z.ZodObject<{
56
- label: z.ZodOptional<z.ZodString>;
57
- email: z.ZodOptional<z.ZodString>;
58
- variant: z.ZodOptional<z.ZodString>;
59
- plan: z.ZodOptional<z.ZodString>;
60
- apiKey: z.ZodString;
61
- apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
62
- backendUrl: z.ZodOptional<z.ZodString>;
63
- }, z.core.$strip>;
64
- }, z.core.$strip>, z.ZodObject<{
65
- kind: z.ZodLiteral<"endpoint">;
66
- id: z.ZodString;
67
- config: z.ZodObject<{
68
- baseUrl: z.ZodURL;
69
- protocol: z.ZodDefault<z.ZodEnum<{
70
- anthropic: "anthropic";
71
- openai: "openai";
72
- }>>;
73
- apiKey: z.ZodOptional<z.ZodString>;
74
- headers: z.ZodOptional<z.ZodString>;
75
- }, z.core.$strip>;
76
- }, z.core.$strip>], "kind">;
77
- export type AccountCopy = z.infer<typeof AccountCopySchema>;
78
- export declare const LinkAccountSchema: z.ZodObject<{
79
- id: z.ZodString;
80
- label: z.ZodString;
81
- email: z.ZodOptional<z.ZodString>;
82
- organization: z.ZodOptional<z.ZodString>;
83
- variant: z.ZodOptional<z.ZodString>;
84
- scope: z.ZodOptional<z.ZodString>;
85
- connectedAt: z.ZodNumber;
86
- connectedBy: z.ZodOptional<z.ZodString>;
87
- needsReauth: z.ZodOptional<z.ZodBoolean>;
88
- detail: z.ZodOptional<z.ZodString>;
89
- seatRefusal: z.ZodOptional<z.ZodString>;
90
- usage: z.ZodOptional<z.ZodObject<{
91
- windows: z.ZodArray<z.ZodObject<{
92
- kind: z.ZodString;
93
- label: z.ZodOptional<z.ZodString>;
94
- utilization: z.ZodNumber;
95
- resetsAt: z.ZodOptional<z.ZodNumber>;
96
- gates: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
97
- models: z.ZodArray<z.ZodString>;
98
- }, z.core.$strip>]>;
99
- rounded: z.ZodOptional<z.ZodBoolean>;
100
- lapsedAt: z.ZodOptional<z.ZodNumber>;
101
- missingSince: z.ZodOptional<z.ZodNumber>;
102
- }, z.core.$strip>>;
103
- measuredAt: z.ZodNumber;
104
- unread: z.ZodOptional<z.ZodObject<{
105
- since: z.ZodNumber;
106
- reason: z.ZodString;
107
- }, z.core.$strip>>;
108
- uncovered: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
- contradicted: z.ZodOptional<z.ZodObject<{
110
- at: z.ZodNumber;
111
- model: z.ZodString;
112
- }, z.core.$strip>>;
113
- }, z.core.$strip>>;
114
- borrowedFrom: z.ZodOptional<z.ZodObject<{
115
- name: z.ZodString;
116
- sandboxId: z.ZodOptional<z.ZodString>;
117
- }, z.core.$strip>>;
118
- provider: z.ZodString;
119
- mode: z.ZodEnum<{
120
- copy: "copy";
121
- lend: "lend";
122
- }>;
123
- }, z.core.$strip>;
124
- export type LinkAccount = z.infer<typeof LinkAccountSchema>;
125
- export declare const LinkAccountsSchema: z.ZodObject<{
126
- accounts: z.ZodArray<z.ZodObject<{
127
- id: z.ZodString;
128
- label: z.ZodString;
129
- email: z.ZodOptional<z.ZodString>;
130
- organization: z.ZodOptional<z.ZodString>;
131
- variant: z.ZodOptional<z.ZodString>;
132
- scope: z.ZodOptional<z.ZodString>;
133
- connectedAt: z.ZodNumber;
134
- connectedBy: z.ZodOptional<z.ZodString>;
135
- needsReauth: z.ZodOptional<z.ZodBoolean>;
136
- detail: z.ZodOptional<z.ZodString>;
137
- seatRefusal: z.ZodOptional<z.ZodString>;
138
- usage: z.ZodOptional<z.ZodObject<{
139
- windows: z.ZodArray<z.ZodObject<{
140
- kind: z.ZodString;
141
- label: z.ZodOptional<z.ZodString>;
142
- utilization: z.ZodNumber;
143
- resetsAt: z.ZodOptional<z.ZodNumber>;
144
- gates: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
145
- models: z.ZodArray<z.ZodString>;
146
- }, z.core.$strip>]>;
147
- rounded: z.ZodOptional<z.ZodBoolean>;
148
- lapsedAt: z.ZodOptional<z.ZodNumber>;
149
- missingSince: z.ZodOptional<z.ZodNumber>;
150
- }, z.core.$strip>>;
151
- measuredAt: z.ZodNumber;
152
- unread: z.ZodOptional<z.ZodObject<{
153
- since: z.ZodNumber;
154
- reason: z.ZodString;
155
- }, z.core.$strip>>;
156
- uncovered: z.ZodOptional<z.ZodArray<z.ZodString>>;
157
- contradicted: z.ZodOptional<z.ZodObject<{
158
- at: z.ZodNumber;
159
- model: z.ZodString;
160
- }, z.core.$strip>>;
161
- }, z.core.$strip>>;
162
- borrowedFrom: z.ZodOptional<z.ZodObject<{
163
- name: z.ZodString;
164
- sandboxId: z.ZodOptional<z.ZodString>;
165
- }, z.core.$strip>>;
166
- provider: z.ZodString;
167
- mode: z.ZodEnum<{
168
- copy: "copy";
169
- lend: "lend";
170
- }>;
171
- }, z.core.$strip>>;
172
- }, z.core.$strip>;
173
- export type LinkAccounts = z.infer<typeof LinkAccountsSchema>;
174
- export declare const LinkAccountCopySchema: z.ZodObject<{
175
- copy: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
- kind: z.ZodLiteral<"account">;
177
- account: z.ZodObject<{
178
- label: z.ZodOptional<z.ZodString>;
179
- email: z.ZodOptional<z.ZodString>;
180
- variant: z.ZodOptional<z.ZodString>;
181
- plan: z.ZodOptional<z.ZodString>;
182
- apiKey: z.ZodString;
183
- apiKeyExpiresAtMs: z.ZodOptional<z.ZodNumber>;
184
- backendUrl: z.ZodOptional<z.ZodString>;
185
- }, z.core.$strip>;
186
- }, z.core.$strip>, z.ZodObject<{
187
- kind: z.ZodLiteral<"endpoint">;
188
- id: z.ZodString;
189
- config: z.ZodObject<{
190
- baseUrl: z.ZodURL;
191
- protocol: z.ZodDefault<z.ZodEnum<{
192
- anthropic: "anthropic";
193
- openai: "openai";
194
- }>>;
195
- apiKey: z.ZodOptional<z.ZodString>;
196
- headers: z.ZodOptional<z.ZodString>;
197
- }, z.core.$strip>;
198
- }, z.core.$strip>], "kind">;
199
- }, z.core.$strip>;
200
- export type LinkAccountCopy = z.infer<typeof LinkAccountCopySchema>;
201
- export declare const AccountsBorrowSchema: z.ZodObject<{
202
- card: z.ZodString;
203
- items: z.ZodArray<z.ZodObject<{
204
- provider: z.ZodString;
205
- account: z.ZodOptional<z.ZodString>;
206
- }, z.core.$strip>>;
207
- }, z.core.$strip>;
208
- export type AccountsBorrow = z.infer<typeof AccountsBorrowSchema>;
209
- export declare const BorrowOutcomeSchema: z.ZodObject<{
210
- provider: z.ZodString;
211
- account: z.ZodOptional<z.ZodString>;
212
- outcome: z.ZodEnum<{
213
- borrowed: "borrowed";
214
- copied: "copied";
215
- failed: "failed";
216
- }>;
217
- id: z.ZodOptional<z.ZodString>;
218
- message: z.ZodOptional<z.ZodString>;
219
- }, z.core.$strip>;
220
- export type BorrowOutcome = z.infer<typeof BorrowOutcomeSchema>;
221
- export declare const AccountsBorrowedSchema: z.ZodObject<{
222
- results: z.ZodArray<z.ZodObject<{
223
- provider: z.ZodString;
224
- account: z.ZodOptional<z.ZodString>;
225
- outcome: z.ZodEnum<{
226
- borrowed: "borrowed";
227
- copied: "copied";
228
- failed: "failed";
229
- }>;
230
- id: z.ZodOptional<z.ZodString>;
231
- message: z.ZodOptional<z.ZodString>;
232
- }, z.core.$strip>>;
233
- }, z.core.$strip>;
234
- export type AccountsBorrowed = z.infer<typeof AccountsBorrowedSchema>;
235
- export declare const BorrowedFromSchema: z.ZodObject<{
236
- name: z.ZodString;
237
- sandboxId: z.ZodOptional<z.ZodString>;
238
- }, z.core.$strip>;
239
- export type BorrowedFrom = z.infer<typeof BorrowedFromSchema>;
240
- export declare const BorrowedAccountSchema: z.ZodObject<{
241
- id: z.ZodString;
242
- card: z.ZodString;
243
- provider: z.ZodString;
244
- remote: z.ZodOptional<z.ZodString>;
245
- label: z.ZodString;
246
- email: z.ZodOptional<z.ZodString>;
247
- organization: z.ZodOptional<z.ZodString>;
248
- from: z.ZodObject<{
249
- name: z.ZodString;
250
- sandboxId: z.ZodOptional<z.ZodString>;
251
- }, z.core.$strip>;
252
- borrowedAt: z.ZodNumber;
253
- }, z.core.$strip>;
254
- export type BorrowedAccount = z.infer<typeof BorrowedAccountSchema>;
255
- export declare const BorrowedAccountsSchema: z.ZodObject<{
256
- accounts: z.ZodArray<z.ZodObject<{
257
- id: z.ZodString;
258
- card: z.ZodString;
259
- provider: z.ZodString;
260
- remote: z.ZodOptional<z.ZodString>;
261
- label: z.ZodString;
262
- email: z.ZodOptional<z.ZodString>;
263
- organization: z.ZodOptional<z.ZodString>;
264
- from: z.ZodObject<{
265
- name: z.ZodString;
266
- sandboxId: z.ZodOptional<z.ZodString>;
267
- }, z.core.$strip>;
268
- borrowedAt: z.ZodNumber;
269
- }, z.core.$strip>>;
270
- }, z.core.$strip>;
271
- export type BorrowedAccounts = z.infer<typeof BorrowedAccountsSchema>;
272
- export declare const BorrowedAccountIdSchema: z.ZodObject<{
273
- id: z.ZodString;
274
- }, z.core.$strip>;
275
- export declare const BORROWED_ID_PREFIX = "lent-";
276
- export declare const isBorrowedId: (id: string) => boolean;
277
- //# sourceMappingURL=account-sharing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account-sharing.d.ts","sourceRoot":"","sources":["../../../src/schemas/providers/account-sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,eAAe;;;;EAAiC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAKxD,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,MAAO,gBAAgB,KAAK,gBAAgB,KAAG,OAA+D,CAAC;AAGzI,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,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C1F,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;iBAUhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;iBAAyD,CAAC;AAC7F,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;iBAAsC,CAAC;AAG3E,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,YAAY,OAAQ,MAAM,KAAG,OAA4C,CAAC"}
@@ -1,68 +0,0 @@
1
- import { z } from "zod";
2
- import { EndpointConfigSchema } from "../capabilities.js";
3
- import { OauthAccountSchema } from "./provider-oauth.js";
4
- export const ShareModeSchema = z.enum(["copy", "lend", "no"]);
5
- export const SharedAccountRefSchema = z.object({
6
- provider: z.string().min(1).max(120),
7
- account: z.string().min(1).max(200).optional(),
8
- });
9
- export const sameSharedRef = (a, b) => a.provider === b.provider && a.account === b.account;
10
- export const ShareableAccountSchema = SharedAccountRefSchema.extend({
11
- label: z.string().describe("What the source calls it."),
12
- email: z.string().optional(),
13
- mode: ShareModeSchema,
14
- reason: z.string().optional().describe("Why it cannot be shared, when `mode` is no."),
15
- });
16
- export const ShareableAccountsSchema = z.object({
17
- sandbox: z.string().describe("What the source calls itself."),
18
- accounts: z.array(ShareableAccountSchema),
19
- });
20
- export const StaticAccountCopySchema = z.object({
21
- label: z.string().optional(),
22
- email: z.string().optional(),
23
- variant: z.string().optional(),
24
- plan: z.string().optional(),
25
- apiKey: z.string().min(1),
26
- apiKeyExpiresAtMs: z.number().optional(),
27
- backendUrl: z.string().optional(),
28
- });
29
- export const AccountCopySchema = z.discriminatedUnion("kind", [
30
- z.object({ kind: z.literal("account"), account: StaticAccountCopySchema }),
31
- z.object({ kind: z.literal("endpoint"), id: z.string().min(1), config: EndpointConfigSchema }),
32
- ]);
33
- export const LinkAccountSchema = OauthAccountSchema.extend({
34
- provider: z.string(),
35
- mode: z.enum(["copy", "lend"]),
36
- });
37
- export const LinkAccountsSchema = z.object({ accounts: z.array(LinkAccountSchema) });
38
- export const LinkAccountCopySchema = z.object({ copy: AccountCopySchema });
39
- export const AccountsBorrowSchema = z.object({
40
- card: z.string().min(1).describe("The link card the editor saved for the source."),
41
- items: z.array(SharedAccountRefSchema).min(1).max(64),
42
- });
43
- export const BorrowOutcomeSchema = SharedAccountRefSchema.extend({
44
- outcome: z.enum(["copied", "borrowed", "failed"]),
45
- id: z.string().optional().describe("The account's id here, for a copy or a borrow."),
46
- message: z.string().optional().describe("Why it failed, in words a person can act on."),
47
- });
48
- export const AccountsBorrowedSchema = z.object({ results: z.array(BorrowOutcomeSchema) });
49
- export const BorrowedFromSchema = z.object({
50
- name: z.string().describe("What the source calls itself."),
51
- sandboxId: z.string().optional(),
52
- });
53
- export const BorrowedAccountSchema = z.object({
54
- id: z.string().describe("Its id here: what a turn names, and what Stop borrowing takes."),
55
- card: z.string().describe("The link card it is borrowed through."),
56
- provider: z.string(),
57
- remote: z.string().optional().describe("Its id on the source; absent for a translator provider, borrowed whole."),
58
- label: z.string(),
59
- email: z.string().optional(),
60
- organization: z.string().optional(),
61
- from: BorrowedFromSchema,
62
- borrowedAt: z.number(),
63
- });
64
- export const BorrowedAccountsSchema = z.object({ accounts: z.array(BorrowedAccountSchema) });
65
- export const BorrowedAccountIdSchema = z.object({ id: z.string().min(1) });
66
- export const BORROWED_ID_PREFIX = "lent-";
67
- export const isBorrowedId = (id) => id.startsWith(BORROWED_ID_PREFIX);
68
- //#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@ -1,54 +0,0 @@
1
- import { procedure } from "../protocol/route-meta.js";
2
- import {
3
- AccountsBorrowedSchema,
4
- AccountsBorrowSchema,
5
- BorrowedAccountIdSchema,
6
- BorrowedAccountsSchema,
7
- ShareableAccountsSchema,
8
- } from "../schemas/providers/account-sharing.js";
9
- import { OkSchema } from "../schemas/shared.js";
10
-
11
- // Model accounts shared between the owner's sandboxes (schemas/providers/account-sharing.ts). The owner's editor, signed
12
- // in to both, reads what the source can share here, mints an accounts link there, and asks the target to bring the
13
- // accounts in over it. Each of these puts a stored credential in motion: the operating tier's, and no token's.
14
- const sharingRoute = procedure.meta({ floor: "maintainer", control: "never", panel: false });
15
-
16
- export const sharingContract = {
17
- shareable: sharingRoute
18
- .route({
19
- method: "GET",
20
- path: "/sharing/accounts",
21
- summary: "What this sandbox can share with another of yours",
22
- description:
23
- "Every model account held here and how it would reach another of the owner's sandboxes: copied (a key that does not rotate), lent turn by turn (a sign-in whose renewal must stay here), or not at all, with why. No credential is in the answer.",
24
- })
25
- .output(ShareableAccountsSchema),
26
- borrow: sharingRoute
27
- .route({
28
- method: "POST",
29
- path: "/sharing/borrow",
30
- summary: "Bring accounts in from another of your sandboxes",
31
- description:
32
- "Over the accounts link saved as `card`, copies each named static key into this sandbox's own stores and files each lent sign-in as borrowed. Each account answers on its own, so one that fails leaves the others in.",
33
- })
34
- .input(AccountsBorrowSchema)
35
- .output(AccountsBorrowedSchema),
36
- borrowed: sharingRoute
37
- .route({
38
- method: "GET",
39
- path: "/sharing/borrowed",
40
- summary: "Accounts this sandbox borrows",
41
- description: "Each account another of the owner's sandboxes lends here, and which link it is borrowed through. No credential is in the answer.",
42
- })
43
- .output(BorrowedAccountsSchema),
44
- stop: sharingRoute
45
- .route({
46
- method: "POST",
47
- path: "/sharing/borrowed/stop",
48
- summary: "Stop borrowing an account",
49
- description:
50
- "Forgets one borrowed account here: no turn asks the source for it again. The source's own link is changed separately, by the owner's editor or on the source.",
51
- })
52
- .input(BorrowedAccountIdSchema)
53
- .output(OkSchema),
54
- };
@@ -1,123 +0,0 @@
1
- import { z } from "zod";
2
- import { EndpointConfigSchema } from "../capabilities.js";
3
- import { OauthAccountSchema } from "./provider-oauth.js";
4
-
5
- // SHARING MODEL ACCOUNTS between one owner's sandboxes, over an accounts link (schemas/links.ts, `terms.accounts`).
6
- // Each account goes the one way that is safe for its credential:
7
- // - copy: a static key (Cursor, Devin, a minted Z.ai or Muse key, a model endpoint's API key) is read by the target's
8
- // daemon from the source's over the link and stored as the target's own; nothing ties the two afterwards.
9
- // - lend: a sign-in whose refresh token rotates (a Claude subscription) stays with the source; the target asks it for
10
- // an access token each turn. The refresh token never leaves the source, so the two sandboxes never race to renew one
11
- // login. A subscription the translator holds (Codex, Grok, Kimi, Gemini) is listed as `no` for now: lending it would
12
- // relay every request through the source's translator, which the target's runtimes do not do yet.
13
- // - no: what cannot travel either way, with the reason a person reads.
14
- // Values never ride the editor's wire: the browser sees these rows, and the target's daemon fetches a copy itself.
15
-
16
- export const ShareModeSchema = z.enum(["copy", "lend", "no"]);
17
- export type ShareMode = z.infer<typeof ShareModeSchema>;
18
-
19
- // One account an accounts link names: a provider (an AgentProvider id, `endpoint/<id>` included) and, for a provider
20
- // holding several of its own, which one. A translator provider is shared whole, since its translator picks among its
21
- // own subscriptions and takes no account, so `account` is absent there.
22
- export const SharedAccountRefSchema = z.object({
23
- provider: z.string().min(1).max(120),
24
- account: z.string().min(1).max(200).optional(),
25
- });
26
- export type SharedAccountRef = z.infer<typeof SharedAccountRefSchema>;
27
-
28
- export const sameSharedRef = (a: SharedAccountRef, b: SharedAccountRef): boolean => a.provider === b.provider && a.account === b.account;
29
-
30
- // GET /sharing/accounts on the source: everything it holds, and how each would reach another sandbox.
31
- export const ShareableAccountSchema = SharedAccountRefSchema.extend({
32
- label: z.string().describe("What the source calls it."),
33
- email: z.string().optional(),
34
- mode: ShareModeSchema,
35
- reason: z.string().optional().describe("Why it cannot be shared, when `mode` is no."),
36
- });
37
- export type ShareableAccount = z.infer<typeof ShareableAccountSchema>;
38
- export const ShareableAccountsSchema = z.object({
39
- sandbox: z.string().describe("What the source calls itself."),
40
- accounts: z.array(ShareableAccountSchema),
41
- });
42
- export type ShareableAccounts = z.infer<typeof ShareableAccountsSchema>;
43
-
44
- // A copy of one static account, the fields every static store keeps. Only the target's daemon ever reads one.
45
- export const StaticAccountCopySchema = z.object({
46
- label: z.string().optional(),
47
- email: z.string().optional(),
48
- variant: z.string().optional(),
49
- plan: z.string().optional(),
50
- apiKey: z.string().min(1),
51
- apiKeyExpiresAtMs: z.number().optional(),
52
- backendUrl: z.string().optional(),
53
- });
54
- export type StaticAccountCopy = z.infer<typeof StaticAccountCopySchema>;
55
-
56
- export const AccountCopySchema = z.discriminatedUnion("kind", [
57
- z.object({ kind: z.literal("account"), account: StaticAccountCopySchema }),
58
- z.object({ kind: z.literal("endpoint"), id: z.string().min(1), config: EndpointConfigSchema }),
59
- ]);
60
- export type AccountCopy = z.infer<typeof AccountCopySchema>;
61
-
62
- /* THE LINK DOORS for accounts, called by the target's daemon with the link token. */
63
-
64
- // GET /link/accounts: what this link may use, as rows without credentials, each with the source's own usage reading,
65
- // so the target shows the source's figures instead of measuring the same plan twice.
66
- export const LinkAccountSchema = OauthAccountSchema.extend({
67
- provider: z.string(),
68
- mode: z.enum(["copy", "lend"]),
69
- });
70
- export type LinkAccount = z.infer<typeof LinkAccountSchema>;
71
- export const LinkAccountsSchema = z.object({ accounts: z.array(LinkAccountSchema) });
72
- export type LinkAccounts = z.infer<typeof LinkAccountsSchema>;
73
-
74
- // POST /link/accounts/copy: one static account's value, for an account the link names in copy mode only.
75
- export const LinkAccountCopySchema = z.object({ copy: AccountCopySchema });
76
- export type LinkAccountCopy = z.infer<typeof LinkAccountCopySchema>;
77
-
78
- /* THE TARGET'S OWN ROUTES, called by the owner's editor. */
79
-
80
- // POST /sharing/borrow: bring the named accounts in over the accounts link saved as `card`.
81
- export const AccountsBorrowSchema = z.object({
82
- card: z.string().min(1).describe("The link card the editor saved for the source."),
83
- items: z.array(SharedAccountRefSchema).min(1).max(64),
84
- });
85
- export type AccountsBorrow = z.infer<typeof AccountsBorrowSchema>;
86
-
87
- export const BorrowOutcomeSchema = SharedAccountRefSchema.extend({
88
- outcome: z.enum(["copied", "borrowed", "failed"]),
89
- id: z.string().optional().describe("The account's id here, for a copy or a borrow."),
90
- message: z.string().optional().describe("Why it failed, in words a person can act on."),
91
- });
92
- export type BorrowOutcome = z.infer<typeof BorrowOutcomeSchema>;
93
- export const AccountsBorrowedSchema = z.object({ results: z.array(BorrowOutcomeSchema) });
94
- export type AccountsBorrowed = z.infer<typeof AccountsBorrowedSchema>;
95
-
96
- // Where a borrowed account comes from, as a row here says it.
97
- export const BorrowedFromSchema = z.object({
98
- name: z.string().describe("What the source calls itself."),
99
- sandboxId: z.string().optional(),
100
- });
101
- export type BorrowedFrom = z.infer<typeof BorrowedFromSchema>;
102
-
103
- // One account this sandbox borrows: no credential in it, only where to ask. Access tokens are held in memory.
104
- export const BorrowedAccountSchema = z.object({
105
- id: z.string().describe("Its id here: what a turn names, and what Stop borrowing takes."),
106
- card: z.string().describe("The link card it is borrowed through."),
107
- provider: z.string(),
108
- remote: z.string().optional().describe("Its id on the source; absent for a translator provider, borrowed whole."),
109
- label: z.string(),
110
- email: z.string().optional(),
111
- organization: z.string().optional(),
112
- from: BorrowedFromSchema,
113
- borrowedAt: z.number(),
114
- });
115
- export type BorrowedAccount = z.infer<typeof BorrowedAccountSchema>;
116
- export const BorrowedAccountsSchema = z.object({ accounts: z.array(BorrowedAccountSchema) });
117
- export type BorrowedAccounts = z.infer<typeof BorrowedAccountsSchema>;
118
-
119
- export const BorrowedAccountIdSchema = z.object({ id: z.string().min(1) });
120
-
121
- // The prefix every borrowed account's id here carries, so no store mistakes one for an account of its own.
122
- export const BORROWED_ID_PREFIX = "lent-";
123
- export const isBorrowedId = (id: string): boolean => id.startsWith(BORROWED_ID_PREFIX);