@allyhub/sdk 0.9.0 → 0.11.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 (148) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  3. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +3 -0
  4. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  5. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  8. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  9. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  10. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  11. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  12. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  13. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  14. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  15. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  16. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  18. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  19. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  20. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  21. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +1 -1
  22. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  23. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  24. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  25. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  26. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  27. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  28. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  29. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  30. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  31. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  32. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  33. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  34. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  35. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  36. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  37. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  38. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  39. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  40. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  41. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  42. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  43. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  45. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  47. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  49. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  51. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  53. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  54. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  55. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  56. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  57. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  58. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  59. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  60. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  61. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  62. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  63. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  64. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  65. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  66. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  67. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  68. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  70. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  71. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  75. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  79. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  81. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/export.d.ts +0 -8
  83. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  84. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  85. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  87. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -2
  90. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
  92. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  94. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  97. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  100. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  101. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  103. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  115. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  120. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
  122. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  123. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
  124. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  126. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  128. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  129. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
  130. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
  131. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  132. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  133. package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
  134. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  135. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  136. package/docs/README.md +4 -0
  137. package/docs/canvas.md +28 -0
  138. package/docs/defaults.md +30 -4
  139. package/docs/docs.md +10 -10
  140. package/docs/image.md +3 -3
  141. package/docs/linkedin.md +96 -0
  142. package/docs/reports.md +89 -0
  143. package/docs/scenery.md +3 -4
  144. package/docs/sheets.md +23 -6
  145. package/docs/slides.md +50 -4
  146. package/docs/speech.md +1 -1
  147. package/docs/x.md +73 -0
  148. package/package.json +1 -1
@@ -32,6 +32,11 @@ export declare const ProfileSchema: z.ZodObject<{
32
32
  name: z.ZodString;
33
33
  email: z.ZodString;
34
34
  google: z.ZodBoolean;
35
+ v1: z.ZodOptional<z.ZodObject<{
36
+ url: z.ZodURL;
37
+ closesAt: z.ZodISODateTime;
38
+ bonusCredits: z.ZodDefault<z.ZodNumber>;
39
+ }, z.core.$strip>>;
35
40
  }, z.core.$strip>;
36
41
  export type Profile = z.infer<typeof ProfileSchema>;
37
42
  /** The roles of a team, the strongest last. */
@@ -70,6 +75,10 @@ export declare const ACCOUNT_CALLS: {
70
75
  renewsAt: z.ZodISODateTime;
71
76
  }, z.core.$strip>>>;
72
77
  bought: z.ZodDefault<z.ZodNumber>;
78
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
79
+ credits: z.ZodNumber;
80
+ expiresAt: z.ZodISODateTime;
81
+ }, z.core.$strip>>>;
73
82
  customer: z.ZodDefault<z.ZodBoolean>;
74
83
  autoTopUp: z.ZodNullable<z.ZodObject<{
75
84
  below: z.ZodNumber;
@@ -125,6 +134,103 @@ export declare const ACCOUNT_CALLS: {
125
134
  byKind: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
126
135
  }, z.core.$strip>>;
127
136
  }, z.core.$strip>>;
137
+ readonly catalog: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
138
+ version: z.ZodString;
139
+ works: z.ZodArray<z.ZodObject<{
140
+ id: z.ZodString;
141
+ title: z.ZodString;
142
+ description: z.ZodString;
143
+ kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
144
+ data: "data";
145
+ ai: "ai";
146
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
147
+ line: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strip>>;
149
+ tools: z.ZodArray<z.ZodObject<{
150
+ name: z.ZodString;
151
+ work: z.ZodString;
152
+ title: z.ZodString;
153
+ description: z.ZodString;
154
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
155
+ output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
156
+ long: z.ZodBoolean;
157
+ example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
158
+ price: z.ZodOptional<z.ZodObject<{
159
+ credits: z.ZodNumber;
160
+ per: z.ZodUnion<readonly [z.ZodEnum<{
161
+ call: "call";
162
+ result: "result";
163
+ page: "page";
164
+ second: "second";
165
+ minute: "minute";
166
+ thousand_characters: "thousand_characters";
167
+ image: "image";
168
+ frame: "frame";
169
+ megapixel: "megapixel";
170
+ question: "question";
171
+ phrase: "phrase";
172
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
173
+ varies: z.ZodBoolean;
174
+ }, z.core.$strip>>;
175
+ shown: z.ZodOptional<z.ZodObject<{
176
+ name: z.ZodString;
177
+ line: z.ZodString;
178
+ section: z.ZodUnion<readonly [z.ZodEnum<{
179
+ image: "image";
180
+ video: "video";
181
+ voice: "voice";
182
+ music: "music";
183
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>>;
186
+ }, z.core.$strip>>;
187
+ readonly editors: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
188
+ editors: z.ZodArray<z.ZodObject<{
189
+ id: z.ZodString;
190
+ name: z.ZodRecord<z.ZodString, z.ZodString>;
191
+ plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
192
+ line: z.ZodRecord<z.ZodString, z.ZodString>;
193
+ icon: z.ZodOptional<z.ZodString>;
194
+ color: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>>;
196
+ }, z.core.$strip>>;
197
+ readonly capabilities: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
198
+ off: z.ZodObject<{
199
+ works: z.ZodArray<z.ZodString>;
200
+ tools: z.ZodArray<z.ZodString>;
201
+ }, z.core.$strip>;
202
+ }, z.core.$strip>>;
203
+ readonly "capabilities/set": AccountCall<z.ZodUnion<readonly [z.ZodObject<{
204
+ work: z.ZodString;
205
+ on: z.ZodBoolean;
206
+ }, z.core.$strict>, z.ZodObject<{
207
+ tool: z.ZodString;
208
+ on: z.ZodBoolean;
209
+ }, z.core.$strict>]>, z.ZodObject<{
210
+ off: z.ZodObject<{
211
+ works: z.ZodArray<z.ZodString>;
212
+ tools: z.ZodArray<z.ZodString>;
213
+ }, z.core.$strip>;
214
+ }, z.core.$strip>>;
215
+ readonly spends: AccountCall<z.ZodObject<{
216
+ days: z.ZodInt;
217
+ limit: z.ZodOptional<z.ZodInt>;
218
+ }, z.core.$strict>, z.ZodObject<{
219
+ spends: z.ZodArray<z.ZodObject<{
220
+ at: z.ZodString;
221
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
222
+ models: "models";
223
+ tools: "tools";
224
+ studio: "studio";
225
+ other: "other";
226
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
227
+ what: z.ZodNullable<z.ZodString>;
228
+ seconds: z.ZodNullable<z.ZodNumber>;
229
+ member: z.ZodNullable<z.ZodString>;
230
+ credits: z.ZodNumber;
231
+ }, z.core.$strip>>;
232
+ more: z.ZodBoolean;
233
+ }, z.core.$strip>>;
128
234
  readonly checkout: AccountCall<z.ZodUnion<readonly [z.ZodObject<{
129
235
  plan: z.ZodString;
130
236
  interval: z.ZodEnum<{
@@ -179,6 +285,10 @@ export declare const ACCOUNT_CALLS: {
179
285
  renewsAt: z.ZodISODateTime;
180
286
  }, z.core.$strip>>>;
181
287
  bought: z.ZodDefault<z.ZodNumber>;
288
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
289
+ credits: z.ZodNumber;
290
+ expiresAt: z.ZodISODateTime;
291
+ }, z.core.$strip>>>;
182
292
  customer: z.ZodDefault<z.ZodBoolean>;
183
293
  autoTopUp: z.ZodNullable<z.ZodObject<{
184
294
  below: z.ZodNumber;
@@ -208,6 +318,22 @@ export declare const ACCOUNT_CALLS: {
208
318
  }, z.core.$strip>>;
209
319
  email: z.ZodNullable<z.ZodString>;
210
320
  }, z.core.$strip>>;
321
+ readonly invoices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
322
+ invoices: z.ZodArray<z.ZodObject<{
323
+ id: z.ZodString;
324
+ number: z.ZodNullable<z.ZodString>;
325
+ createdAt: z.ZodString;
326
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
327
+ credits: "credits";
328
+ plan: "plan";
329
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
330
+ totalCents: z.ZodNumber;
331
+ currency: z.ZodString;
332
+ status: z.ZodString;
333
+ pdf: z.ZodNullable<z.ZodString>;
334
+ url: z.ZodNullable<z.ZodString>;
335
+ }, z.core.$strip>>;
336
+ }, z.core.$strip>>;
211
337
  readonly topUp: AccountCall<z.ZodObject<{
212
338
  topUpCents: z.ZodNumber;
213
339
  }, z.core.$strict>, z.ZodObject<{
@@ -316,6 +442,7 @@ export declare const ACCOUNT_CALLS: {
316
442
  anyone: "anyone";
317
443
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
318
444
  sendsLeft: z.ZodNumber;
445
+ sendsPerDay: z.ZodOptional<z.ZodNumber>;
319
446
  addresses: z.ZodArray<z.ZodObject<{
320
447
  address: z.ZodString;
321
448
  kind: z.ZodUnion<readonly [z.ZodEnum<{
@@ -344,6 +471,7 @@ export declare const ACCOUNT_CALLS: {
344
471
  anyone: "anyone";
345
472
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
346
473
  sendsLeft: z.ZodNumber;
474
+ sendsPerDay: z.ZodOptional<z.ZodNumber>;
347
475
  addresses: z.ZodArray<z.ZodObject<{
348
476
  address: z.ZodString;
349
477
  kind: z.ZodUnion<readonly [z.ZodEnum<{
@@ -449,6 +577,11 @@ export declare const ACCOUNT_CALLS: {
449
577
  name: z.ZodString;
450
578
  email: z.ZodString;
451
579
  google: z.ZodBoolean;
580
+ v1: z.ZodOptional<z.ZodObject<{
581
+ url: z.ZodURL;
582
+ closesAt: z.ZodISODateTime;
583
+ bonusCredits: z.ZodDefault<z.ZodNumber>;
584
+ }, z.core.$strip>>;
452
585
  }, z.core.$strip>>;
453
586
  readonly "profile/set": AccountCall<z.ZodObject<{
454
587
  name: z.ZodString;
@@ -459,11 +592,18 @@ export declare const ACCOUNT_CALLS: {
459
592
  client: z.ZodString;
460
593
  signedInAt: z.ZodISODateTime;
461
594
  lastActiveAt: z.ZodISODateTime;
595
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
596
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
597
+ os: z.ZodOptional<z.ZodNullable<z.ZodString>>;
598
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
599
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
600
+ current: z.ZodOptional<z.ZodBoolean>;
462
601
  }, z.core.$strip>>;
463
602
  }, z.core.$strip>>;
464
603
  readonly "devices/signOut": AccountCall<z.ZodObject<{
465
604
  id: z.ZodString;
466
605
  }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
606
+ readonly "devices/signOutOthers": AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
467
607
  readonly export: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
468
608
  readonly close: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
469
609
  };
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as I,ACCOUNT_EXPORT_PATH as _,DEVICES_PATH as T,DevicesSchema as w}from"./auth.js";import{AUTO_TOP_UP_PATH as b,AutoTopUpRequestSchema as L,BILLING_CHECKOUT_PATH as y,BILLING_PAYMENT_PATH as j,BILLING_PLANS_PATH as f,BILLING_PORTAL_PATH as U,BILLING_REQUEST_PATH as v,BILLING_RESUME_PATH as G,BILLING_SUMMARY_PATH as k,BILLING_TOP_UP_PATH as H,BILLING_USAGE_PATH as N,BillingPaymentSchema as R,BillingPlansSchema as C,BillingSummarySchema as u,BillingUsageSchema as M,CheckoutRequestSchema as x,PortalRequestSchema as $,TopUpRequestSchema as B}from"./cloud.js";import{MAIL_MESSAGES_PATH as g,MAIL_PATH as D,MAIL_PERSON_QUERY as z,MAIL_SETTINGS_PATH as q,MailMessageSchema as Y,MailSearchResponseSchema as Z,MailSearchSchema as K,MailSettingsSchema as V,MailboxSchema as A}from"./mail.js";import{MEMBERS_PATH as l,MemberLimitSchema as Q,MembersSchema as F,ORGANIZATIONS_PATH as E,ORGANIZATION_PATH as P}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean()}),ROLES=["member","admin","owner"];const n=e.strictObject({}),i=e.object({}),S=e.object({url:e.url()}),d=e.string().trim().min(1).max(100),t=(s,h,m,c,a)=>({http:s,route:h,params:m,result:c,about:a});export const ACCOUNT_CALLS={balance:t("GET",k,n,u,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",f,n,C,"The plans, their prices, and what a top-up buys."),usage:t("GET",N,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),M,"Credits spent each day by what they were spent on, the days with none left out."),checkout:t("POST",y,x,S,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",U,$,S,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",G,n,u,"A plan cancelled at its period's end taken up again."),payment:t("GET",j,n,R,"The card charged without the person there, and where Stripe's emails go."),topUp:t("POST",H,B,e.object({credits:e.number()}),"Credits bought with the saved card at once; answers what was added."),"autoTopUp/set":t("PUT",b,L,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser."),"autoTopUp/off":t("DELETE",b,n,i,"Auto top-up off."),"credits/request":t("POST",v,n,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",l,n,F,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${l}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(Q.shape),i,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${l}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),i,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${l}/:userId`,e.strictObject({userId:e.string().min(1)}),i,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,n,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),i,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),i,"An invitation cancelled."),"team/create":t("POST",E,e.strictObject({name:d}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",P,e.strictObject({name:d}),i,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,n,i,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",P,n,i,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${E}/:id/restore`,e.strictObject({id:e.string().min(1)}),i,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,n,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:d}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),i,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),i,"An API key deleted."),mail:t("GET",D,n,A,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${q}?${z}`,V,A,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",g,K,Z,"The mailbox's messages, newest first."),"mail/message":t("GET",`${g}/:id`,e.strictObject({id:e.string().min(1)}),Y,"One message, read whole."),profile:t("GET",PROFILE_PATH,n,ProfileSchema,"The person's name and email, and whether Google signs them in."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:d}),i,"The person's name."),devices:t("GET",T,n,w,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${T}/:id`,e.strictObject({id:e.string().min(1)}),i,"A computer signed out."),export:t("GET",_,n,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",I,n,i,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(s,h){const m=h,c=new Set,a=s.route.replace(/:([A-Za-z]+)/gu,(r,o)=>(c.add(o),encodeURIComponent(String(m[o])))),p=Object.entries(m).filter(([r,o])=>!c.has(r)&&o!==void 0);if(s.http==="GET"||s.http==="DELETE"){const r=p.map(([o,O])=>`${encodeURIComponent(o)}=${encodeURIComponent(String(O))}`).join("&");return{method:s.http,path:r===""?a:`${a}?${r}`}}return p.length===0?{method:s.http,path:a}:{method:s.http,path:a,body:Object.fromEntries(p)}}
2
+ import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as _,ACCOUNT_EXPORT_PATH as f,DEVICES_PATH as p,DevicesSchema as y}from"./auth.js";import{AUTO_TOP_UP_PATH as b,AutoTopUpRequestSchema as L,BILLING_CHECKOUT_PATH as v,BILLING_PAYMENT_PATH as G,BILLING_PLANS_PATH as j,BILLING_PORTAL_PATH as U,BILLING_REQUEST_PATH as H,BILLING_RESUME_PATH as k,BILLING_SUMMARY_PATH as N,BILLING_TOP_UP_PATH as C,BILLING_USAGE_PATH as R,BillingPaymentSchema as x,BillingPlansSchema as M,BillingSummarySchema as u,BillingUsageSchema as B,CheckoutRequestSchema as D,PortalRequestSchema as $,TopUpRequestSchema as z,BILLING_INVOICES_PATH as q,BILLING_SPENDS_PATH as V,BillingInvoicesSchema as Y,CAPABILITIES_PATH as A,CATALOG_PATH as Z,EDITORS_PATH as K,EditorsSchema as F,CapabilitiesSchema as E,CapabilityRequestSchema as Q,CatalogSchema as X,BillingSpendsSchema as J}from"./cloud.js";import{MAIL_MESSAGES_PATH as g,MAIL_PATH as W,MAIL_PERSON_QUERY as ee,MAIL_SETTINGS_PATH as te,MailMessageSchema as ie,MailSearchResponseSchema as ne,MailSearchSchema as oe,MailSettingsSchema as se,MailboxSchema as S}from"./mail.js";import{MEMBERS_PATH as l,MemberLimitSchema as ae,MembersSchema as re,ORGANIZATIONS_PATH as P,ORGANIZATION_PATH as I}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const i=e.strictObject({}),n=e.object({}),w=e.object({url:e.url()}),d=e.string().trim().min(1).max(100),t=(o,h,m,c,s)=>({http:o,route:h,params:m,result:c,about:s});export const ACCOUNT_CALLS={balance:t("GET",N,i,u,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",j,i,M,"The plans, their prices, and what a top-up buys."),usage:t("GET",R,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),B,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",Z,i,X,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",K,i,F,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",A,i,E,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",A,Q,E,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",V,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),J,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",v,D,w,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",U,$,w,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",k,i,u,"A plan cancelled at its period's end taken up again."),payment:t("GET",G,i,x,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",q,i,Y,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",C,z,e.object({credits:e.number()}),"Credits bought with the saved card at once; answers what was added."),"autoTopUp/set":t("PUT",b,L,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser."),"autoTopUp/off":t("DELETE",b,i,n,"Auto top-up off."),"credits/request":t("POST",H,i,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",l,i,re,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${l}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ae.shape),n,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${l}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),n,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${l}/:userId`,e.strictObject({userId:e.string().min(1)}),n,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,i,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),n,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An invitation cancelled."),"team/create":t("POST",P,e.strictObject({name:d}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",I,e.strictObject({name:d}),n,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,i,n,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",I,i,n,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${P}/:id/restore`,e.strictObject({id:e.string().min(1)}),n,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,i,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:d}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),n,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An API key deleted."),mail:t("GET",W,i,S,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${te}?${ee}`,se,S,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",g,oe,ne,"The mailbox's messages, newest first."),"mail/message":t("GET",`${g}/:id`,e.strictObject({id:e.string().min(1)}),ie,"One message, read whole."),profile:t("GET",PROFILE_PATH,i,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:d}),n,"The person's name."),devices:t("GET",p,i,y,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${p}/:id`,e.strictObject({id:e.string().min(1)}),n,"A computer signed out."),"devices/signOutOthers":t("DELETE",p,i,n,"Every computer signed out but the one that asks."),export:t("GET",f,i,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",_,i,n,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(o,h){const m=h,c=new Set,s=o.route.replace(/:([A-Za-z]+)/gu,(r,a)=>(c.add(a),encodeURIComponent(String(m[a])))),T=Object.entries(m).filter(([r,a])=>!c.has(r)&&a!==void 0);if(o.http==="GET"||o.http==="DELETE"){const r=T.map(([a,O])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(O))}`).join("&");return{method:o.http,path:r===""?s:`${s}?${r}`}}return T.length===0?{method:o.http,path:s}:{method:o.http,path:s,body:Object.fromEntries(T)}}
@@ -21,8 +21,19 @@ export declare const SCOPES = "openid profile email offline_access";
21
21
  export declare const ACCOUNT_PATH = "/api/account";
22
22
  /** The header that names the organization a request acts in; without it, the person's own. */
23
23
  export declare const ORGANIZATION_HEADER = "x-allyhub-organization";
24
- /** `GET`: the computers signed in as the person; `DELETE <path>/<id>` signs one out. */
24
+ /** `GET`: the computers signed in as the person; `DELETE <path>/<id>` signs one out; `DELETE <path>` signs out every one but the asking computer. */
25
25
  export declare const DEVICES_PATH = "/api/account/devices";
26
+ /**
27
+ * The header that names a computer's sign-in: an id it makes once and
28
+ * keeps in its credentials file, sent with its token requests and its
29
+ * calls, so AllyHub tells its sign-ins apart and knows which one asks.
30
+ * It only tells them apart; the sign-in itself authorizes.
31
+ */
32
+ export declare const DEVICE_HEADER = "x-allyhub-device";
33
+ /** With a token request: the computer's name as its owner set it, percent-encoded (RFC 3986). */
34
+ export declare const DEVICE_NAME_HEADER = "x-allyhub-device-name";
35
+ /** A sign-in's id, as a computer makes it. */
36
+ export declare const DeviceIdSchema: z.ZodString;
26
37
  /** `GET`: everything kept about the person, as a file. */
27
38
  export declare const ACCOUNT_EXPORT_PATH = "/api/account/export";
28
39
  /** `POST`, a browser's session alone: mails the link that deletes the account, unless something stands in the way. */
@@ -33,6 +44,12 @@ export declare const DevicesSchema: z.ZodObject<{
33
44
  client: z.ZodString;
34
45
  signedInAt: z.ZodISODateTime;
35
46
  lastActiveAt: z.ZodISODateTime;
47
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ os: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ current: z.ZodOptional<z.ZodBoolean>;
36
53
  }, z.core.$strip>>;
37
54
  }, z.core.$strip>;
38
55
  export type Devices = z.infer<typeof DevicesSchema>;
@@ -114,6 +131,7 @@ export declare const CredentialsFileSchema: z.ZodObject<{
114
131
  }, z.core.$strip>>;
115
132
  keychain: z.ZodOptional<z.ZodString>;
116
133
  since: z.ZodISODateTime;
134
+ device: z.ZodOptional<z.ZodString>;
117
135
  }, z.core.$strip>;
118
136
  export type CredentialsFile = z.infer<typeof CredentialsFileSchema>;
119
137
  //# sourceMappingURL=auth.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0})});
2
+ import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});
@@ -42,6 +42,10 @@ export declare const BillingSummarySchema: z.ZodObject<{
42
42
  renewsAt: z.ZodISODateTime;
43
43
  }, z.core.$strip>>>;
44
44
  bought: z.ZodDefault<z.ZodNumber>;
45
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
46
+ credits: z.ZodNumber;
47
+ expiresAt: z.ZodISODateTime;
48
+ }, z.core.$strip>>>;
45
49
  customer: z.ZodDefault<z.ZodBoolean>;
46
50
  autoTopUp: z.ZodNullable<z.ZodObject<{
47
51
  below: z.ZodNumber;
@@ -104,6 +108,29 @@ export declare const BillingUsageSchema: z.ZodObject<{
104
108
  }, z.core.$strip>>;
105
109
  }, z.core.$strip>;
106
110
  export type BillingUsage = z.infer<typeof BillingUsageSchema>;
111
+ /**
112
+ * `GET ?days=30&limit=500`: each spend of the last days, the latest first:
113
+ * an owner or an admin reads the team's, a member their own. `more` when
114
+ * there were more than `limit`.
115
+ */
116
+ export declare const BILLING_SPENDS_PATH = "/api/billing/spends";
117
+ export declare const BillingSpendsSchema: z.ZodObject<{
118
+ spends: z.ZodArray<z.ZodObject<{
119
+ at: z.ZodString;
120
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
121
+ models: "models";
122
+ tools: "tools";
123
+ studio: "studio";
124
+ other: "other";
125
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
126
+ what: z.ZodNullable<z.ZodString>;
127
+ seconds: z.ZodNullable<z.ZodNumber>;
128
+ member: z.ZodNullable<z.ZodString>;
129
+ credits: z.ZodNumber;
130
+ }, z.core.$strip>>;
131
+ more: z.ZodBoolean;
132
+ }, z.core.$strip>;
133
+ export type BillingSpends = z.infer<typeof BillingSpendsSchema>;
107
134
  /** `POST`, an owner's or an admin's: Stripe Checkout for a plan or a top-up; answers `{ url }`. */
108
135
  export declare const BILLING_CHECKOUT_PATH = "/api/billing/checkout";
109
136
  export declare const CheckoutRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -150,6 +177,25 @@ export declare const BillingPaymentSchema: z.ZodObject<{
150
177
  email: z.ZodNullable<z.ZodString>;
151
178
  }, z.core.$strip>;
152
179
  export type BillingPayment = z.infer<typeof BillingPaymentSchema>;
180
+ /** `GET`, an owner's or an admin's: the organization's invoices, the latest first (Stripe's, with their PDFs). */
181
+ export declare const BILLING_INVOICES_PATH = "/api/billing/invoices";
182
+ export declare const BillingInvoicesSchema: z.ZodObject<{
183
+ invoices: z.ZodArray<z.ZodObject<{
184
+ id: z.ZodString;
185
+ number: z.ZodNullable<z.ZodString>;
186
+ createdAt: z.ZodString;
187
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
188
+ credits: "credits";
189
+ plan: "plan";
190
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
191
+ totalCents: z.ZodNumber;
192
+ currency: z.ZodString;
193
+ status: z.ZodString;
194
+ pdf: z.ZodNullable<z.ZodString>;
195
+ url: z.ZodNullable<z.ZodString>;
196
+ }, z.core.$strip>>;
197
+ }, z.core.$strip>;
198
+ export type BillingInvoices = z.infer<typeof BillingInvoicesSchema>;
153
199
  /** `POST { topUpCents }`, an owner's or an admin's: credits bought with the saved card at once; answers `{ credits }`, what was added. */
154
200
  export declare const BILLING_TOP_UP_PATH = "/api/billing/top-up";
155
201
  export declare const TopUpRequestSchema: z.ZodObject<{
@@ -222,10 +268,21 @@ export type ModelCatalog = z.infer<typeof ModelCatalogSchema>;
222
268
  /** A JSON Schema document of a tool's input or output. */
223
269
  export declare const JsonSchemaSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
224
270
  export declare const CATALOG_PATH = "/api/catalog";
271
+ /** The units the console lists a tool's price in. */
272
+ export declare const PRICE_UNITS: readonly ["call", "result", "page", "second", "minute", "thousand_characters", "image", "frame", "megapixel", "question", "phrase"];
273
+ /** The console's sections of AI tools; a data work's tools are research. */
274
+ export declare const TOOL_SECTIONS: readonly ["video", "image", "voice", "music"];
275
+ /** What a work is, for the console's capabilities: data from many sources (switched as one), or AI models (each tool switched on its own). */
276
+ export declare const WORK_KINDS: readonly ["data", "ai"];
225
277
  export declare const CatalogWorkSchema: z.ZodObject<{
226
278
  id: z.ZodString;
227
279
  title: z.ZodString;
228
280
  description: z.ZodString;
281
+ kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
282
+ data: "data";
283
+ ai: "ai";
284
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
285
+ line: z.ZodOptional<z.ZodString>;
229
286
  }, z.core.$strip>;
230
287
  export type CatalogWork = z.infer<typeof CatalogWorkSchema>;
231
288
  export declare const CatalogToolSchema: z.ZodObject<{
@@ -237,6 +294,33 @@ export declare const CatalogToolSchema: z.ZodObject<{
237
294
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
238
295
  long: z.ZodBoolean;
239
296
  example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
297
+ price: z.ZodOptional<z.ZodObject<{
298
+ credits: z.ZodNumber;
299
+ per: z.ZodUnion<readonly [z.ZodEnum<{
300
+ call: "call";
301
+ result: "result";
302
+ page: "page";
303
+ second: "second";
304
+ minute: "minute";
305
+ thousand_characters: "thousand_characters";
306
+ image: "image";
307
+ frame: "frame";
308
+ megapixel: "megapixel";
309
+ question: "question";
310
+ phrase: "phrase";
311
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
312
+ varies: z.ZodBoolean;
313
+ }, z.core.$strip>>;
314
+ shown: z.ZodOptional<z.ZodObject<{
315
+ name: z.ZodString;
316
+ line: z.ZodString;
317
+ section: z.ZodUnion<readonly [z.ZodEnum<{
318
+ image: "image";
319
+ video: "video";
320
+ voice: "voice";
321
+ music: "music";
322
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
323
+ }, z.core.$strip>>;
240
324
  }, z.core.$strip>;
241
325
  export type CatalogTool = z.infer<typeof CatalogToolSchema>;
242
326
  export declare const CatalogSchema: z.ZodObject<{
@@ -245,6 +329,11 @@ export declare const CatalogSchema: z.ZodObject<{
245
329
  id: z.ZodString;
246
330
  title: z.ZodString;
247
331
  description: z.ZodString;
332
+ kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
333
+ data: "data";
334
+ ai: "ai";
335
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
336
+ line: z.ZodOptional<z.ZodString>;
248
337
  }, z.core.$strip>>;
249
338
  tools: z.ZodArray<z.ZodObject<{
250
339
  name: z.ZodString;
@@ -255,9 +344,77 @@ export declare const CatalogSchema: z.ZodObject<{
255
344
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
256
345
  long: z.ZodBoolean;
257
346
  example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
347
+ price: z.ZodOptional<z.ZodObject<{
348
+ credits: z.ZodNumber;
349
+ per: z.ZodUnion<readonly [z.ZodEnum<{
350
+ call: "call";
351
+ result: "result";
352
+ page: "page";
353
+ second: "second";
354
+ minute: "minute";
355
+ thousand_characters: "thousand_characters";
356
+ image: "image";
357
+ frame: "frame";
358
+ megapixel: "megapixel";
359
+ question: "question";
360
+ phrase: "phrase";
361
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
362
+ varies: z.ZodBoolean;
363
+ }, z.core.$strip>>;
364
+ shown: z.ZodOptional<z.ZodObject<{
365
+ name: z.ZodString;
366
+ line: z.ZodString;
367
+ section: z.ZodUnion<readonly [z.ZodEnum<{
368
+ image: "image";
369
+ video: "video";
370
+ voice: "voice";
371
+ music: "music";
372
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
373
+ }, z.core.$strip>>;
258
374
  }, z.core.$strip>>;
259
375
  }, z.core.$strip>;
260
376
  export type Catalog = z.infer<typeof CatalogSchema>;
377
+ /**
378
+ * `GET`: the cloud tools the organization turned off, anyone in it reads;
379
+ * `PUT { work, on }` or `PUT { tool, on }`, an owner's or an admin's: one
380
+ * switched, answering what is off now. A data work is switched as one
381
+ * (its tools added later too), an AI work's tools each on its own. A
382
+ * tool turned off is refused to every call in the organization (403
383
+ * `tool_off`): the CLI's, Studio's, an agent's.
384
+ */
385
+ export declare const CAPABILITIES_PATH = "/api/capabilities";
386
+ export declare const CapabilitiesSchema: z.ZodObject<{
387
+ off: z.ZodObject<{
388
+ works: z.ZodArray<z.ZodString>;
389
+ tools: z.ZodArray<z.ZodString>;
390
+ }, z.core.$strip>;
391
+ }, z.core.$strip>;
392
+ export type Capabilities = z.infer<typeof CapabilitiesSchema>;
393
+ export declare const CapabilityRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
394
+ work: z.ZodString;
395
+ on: z.ZodBoolean;
396
+ }, z.core.$strict>, z.ZodObject<{
397
+ tool: z.ZodString;
398
+ on: z.ZodBoolean;
399
+ }, z.core.$strict>]>;
400
+ export type CapabilityRequest = z.infer<typeof CapabilityRequestSchema>;
401
+ /**
402
+ * `GET`: the editors the console lists, free in every product: each kind
403
+ * the built-in extensions contribute with how the console shows it, in its
404
+ * order; open to anyone.
405
+ */
406
+ export declare const EDITORS_PATH = "/api/editors";
407
+ export declare const EditorsSchema: z.ZodObject<{
408
+ editors: z.ZodArray<z.ZodObject<{
409
+ id: z.ZodString;
410
+ name: z.ZodRecord<z.ZodString, z.ZodString>;
411
+ plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
412
+ line: z.ZodRecord<z.ZodString, z.ZodString>;
413
+ icon: z.ZodOptional<z.ZodString>;
414
+ color: z.ZodOptional<z.ZodString>;
415
+ }, z.core.$strip>>;
416
+ }, z.core.$strip>;
417
+ export type Editors = z.infer<typeof EditorsSchema>;
261
418
  /** Where a tool's calls are made (POST). */
262
419
  export declare const toolCallsPath: (tool: string) => string;
263
420
  /** Where a call is read again (GET). */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as t}from"zod";import{openEnum as o}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:o(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:o(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:o(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:o(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean(),example:t.record(t.string(),t.unknown()).optional()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:o(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[n,r,...l]=e.slice(i.length).split("/");if(!(!n||!r||l.length>0))try{return{id:decodeURIComponent(n),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,n)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${n}`;
2
+ import{z as t}from"zod";import{openEnum as n}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:n(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),expiring:t.array(t.object({credits:t.number(),expiresAt:t.iso.datetime()})).default([]),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:n(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:n(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_SPENDS_PATH="/api/billing/spends",BillingSpendsSchema=t.object({spends:t.array(t.object({at:t.string(),kind:n(SPEND_KINDS),what:t.string().nullable(),seconds:t.number().nullable(),member:t.string().nullable(),credits:t.number()})),more:t.boolean()}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_INVOICES_PATH="/api/billing/invoices",BillingInvoicesSchema=t.object({invoices:t.array(t.object({id:t.string(),number:t.string().nullable(),createdAt:t.string(),kind:n(["plan","credits"]),totalCents:t.number(),currency:t.string(),status:t.string(),pdf:t.string().nullable(),url:t.string().nullable()}))}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:n(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",PRICE_UNITS=["call","result","page","second","minute","thousand_characters","image","frame","megapixel","question","phrase"],TOOL_SECTIONS=["video","image","voice","music"],WORK_KINDS=["data","ai"],CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1),kind:n(WORK_KINDS).default("data"),line:t.string().optional()}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean(),example:t.record(t.string(),t.unknown()).optional(),price:t.object({credits:t.number().nonnegative(),per:n(PRICE_UNITS),varies:t.boolean()}).optional(),shown:t.object({name:t.string(),line:t.string(),section:n(TOOL_SECTIONS)}).optional()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CAPABILITIES_PATH="/api/capabilities",CapabilitiesSchema=t.object({off:t.object({works:t.array(t.string()),tools:t.array(t.string())})}),CapabilityRequestSchema=t.union([t.strictObject({work:t.string().min(1),on:t.boolean()}),t.strictObject({tool:t.string().min(1),on:t.boolean()})]),EDITORS_PATH="/api/editors",EditorsSchema=t.object({editors:t.array(t.object({id:t.string().min(1),name:t.record(t.string(),t.string()),plural:t.record(t.string(),t.string()).optional(),line:t.record(t.string(),t.string()),icon:t.string().optional(),color:t.string().optional()}))}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:n(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,o)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(o)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[o,r,...s]=e.slice(i.length).split("/");if(!(!o||!r||s.length>0))try{return{id:decodeURIComponent(o),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,o)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${o}`;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { type ClientOf } from "./jsonrpc.js";
3
- import { type NoteSurface } from "./notes.js";
3
+ import { type NoteInset, type NoteSurface } from "./notes.js";
4
4
  export { PLACE_PARAM, PlaceSchema, placeIn, placeParams, type Place, } from "./place.js";
5
5
  export declare const ThemeSchema: z.ZodEnum<{
6
6
  light: "light";
@@ -191,6 +191,7 @@ export declare const HOST_METHODS: {
191
191
  width: z.ZodNumber;
192
192
  height: z.ZodNumber;
193
193
  }, z.core.$strict>>;
194
+ selection: z.ZodOptional<z.ZodBoolean>;
194
195
  }, z.core.$strict>, z.ZodObject<{
195
196
  begun: z.ZodBoolean;
196
197
  }, z.core.$strict>>;
@@ -233,10 +234,14 @@ export declare const HOST_NOTIFICATIONS: {
233
234
  readonly "project/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
234
235
  revision: z.ZodInt;
235
236
  }, z.core.$strict>>;
237
+ readonly "items/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
238
+ item: z.ZodString;
239
+ paths: z.ZodArray<z.ZodString>;
240
+ }, z.core.$strict>>;
236
241
  readonly "check/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
237
242
  status: z.ZodEnum<{
238
- failed: "failed";
239
243
  off: "off";
244
+ failed: "failed";
240
245
  running: "running";
241
246
  done: "done";
242
247
  waiting: "waiting";
@@ -559,6 +564,7 @@ export declare const EDITOR_HOST_METHODS: {
559
564
  width: z.ZodNumber;
560
565
  height: z.ZodNumber;
561
566
  }, z.core.$strict>>;
567
+ selection: z.ZodOptional<z.ZodBoolean>;
562
568
  }, z.core.$strict>, z.ZodObject<{
563
569
  begun: z.ZodBoolean;
564
570
  }, z.core.$strict>>;
@@ -647,5 +653,7 @@ export type EditorHost = ClientOf<typeof EDITOR_HOST_METHODS> & {
647
653
  on<N extends keyof typeof HOST_NOTIFICATIONS>(name: N, listener: (params: z.output<(typeof HOST_NOTIFICATIONS)[N]["params"]>) => void): () => void;
648
654
  /** Gives the host what it asks of the editor for a person's notes; answers how to stop. Absent where nobody takes notes. */
649
655
  notes?(surface: NoteSurface): () => void;
656
+ /** Gives the host a box of the page that draws itself and answers for its marks; answers how to stop. Absent where nobody takes notes. */
657
+ noteInset?(inset: NoteInset): () => void;
650
658
  };
651
659
  //# sourceMappingURL=editor.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Note mode on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person tried to change what a read-only host shows (`readOnly`): the host offers to wake the machine that changes it; false where nothing does."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":n(HostContextSchema,"The language, theme or agent changed."),"editor/command":n(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...d,...p},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...m};
2
+ import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional(),selection:t.boolean().optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person pressed an Edit of the editor's own (a website's view, with no machine to run its server) on a read-only host (`readOnly`): the host wakes the machine that changes it; false where nothing does. Never sent for a key pressed in the item."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":n(HostContextSchema,"The language, theme or agent changed."),"editor/command":n(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...d,...p},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...m};