@allyhub/sdk 0.15.3 → 0.17.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 (131) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/node_modules/@allyhub/audio/dist/index.d.ts +1 -0
  3. package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
  4. package/dist/node_modules/@allyhub/audio/dist/place.d.ts +26 -0
  5. package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
  6. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  7. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  8. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  9. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
  10. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  11. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  12. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +70 -11
  13. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  14. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
  15. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  16. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
  17. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  18. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +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/package.json +1 -1
  22. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  23. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  24. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
  25. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
  26. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  27. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
  28. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
  29. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +53 -10
  30. package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
  31. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  32. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -11
  33. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  34. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
  35. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  36. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
  37. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  38. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
  39. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  40. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
  41. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
  42. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
  43. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
  45. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
  46. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  47. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
  48. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +4 -1
  49. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
  51. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
  53. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +45 -0
  54. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  55. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
  56. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
  57. package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
  58. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
  59. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
  60. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
  61. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  62. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
  63. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  64. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
  65. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
  66. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
  67. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
  68. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  69. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
  70. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
  71. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
  72. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
  73. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
  74. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
  75. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
  76. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  77. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +26 -20
  78. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  79. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
  80. package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
  81. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  82. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  83. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  84. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  85. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +12 -0
  86. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  87. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
  90. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
  92. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  95. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +1 -1
  96. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  97. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  98. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  99. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  100. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  101. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +10 -0
  102. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  103. package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
  104. package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
  105. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +3 -1
  106. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +5 -0
  107. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  108. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  109. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  110. package/dist/node_modules/@allyhub/video-sdk/dist/free.d.ts +1 -1
  111. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  112. package/docs/batches.md +4 -4
  113. package/docs/contract.md +5 -5
  114. package/docs/defaults.md +2 -2
  115. package/docs/docs.md +16 -5
  116. package/docs/footage.md +8 -8
  117. package/docs/image.md +5 -5
  118. package/docs/layers.md +12 -10
  119. package/docs/linkedin.md +1 -1
  120. package/docs/modeling.md +3 -3
  121. package/docs/pictures.md +4 -4
  122. package/docs/project.md +11 -7
  123. package/docs/scenery.md +3 -3
  124. package/docs/sheets.md +5 -5
  125. package/docs/slides.md +3 -3
  126. package/docs/sound.md +7 -7
  127. package/docs/speech.md +7 -7
  128. package/docs/video.md +3 -3
  129. package/docs/websites.md +3 -3
  130. package/docs/x.md +2 -2
  131. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/ooxml",
3
- "version": "0.15.3",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -42,6 +42,11 @@ export interface EmbeddedVideo {
42
42
  /** Its moment by a reference of its own (an anchor, "@click", or a part's key), in its seconds (momentOf). */
43
43
  at(ref: string): number;
44
44
  }
45
+ /** Another item drawn live in a layer's element (`ctx.item`): a video's handle, and its kind. */
46
+ export interface EmbeddedItem extends EmbeddedVideo {
47
+ /** Its kind (`slides`, `video`). */
48
+ kind: string;
49
+ }
45
50
  export interface StageContext {
46
51
  look: Look;
47
52
  /** The format being drawn, e.g. "9x16". */
@@ -198,6 +203,16 @@ export interface StageContext {
198
203
  * embed.
199
204
  */
200
205
  video?(piece: unknown, el: HTMLElement): Promise<EmbeddedVideo>;
206
+ /**
207
+ * Another item of the project drawn live in an element of this layer's
208
+ * (docs/design/references.md §3.5): what its module exports, imported
209
+ * (`import q3 from "../decks/q3"`), drawn by its own kind's runtime in
210
+ * its own format, in this video's language where it has it. A video is
211
+ * drawn as `video` draws it; a deck's moments are its slides and their
212
+ * builds (`at("pricing")`). What it reads counts as this video's.
213
+ * Absent where the host cannot embed.
214
+ */
215
+ item?(piece: unknown, el: HTMLElement): Promise<EmbeddedItem>;
201
216
  /**
202
217
  * Answers a question the host asks every layer of the output by name
203
218
  * (`LoadedOutput.ask`): a scenery's cuts, the world times of references,
@@ -1,3 +1,4 @@
1
1
  export { consoleAt, consoleAtAsync, consoleLog, consoleParts, installConsole, resetConsole, } from "./console.js";
2
2
  export { locateLayers, pickLayer } from "./locate.js";
3
+ export { registerRuntimes, runtimeOf, type ItemRuntime } from "./runtimes.js";
3
4
  //# sourceMappingURL=index.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
- export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers,pickLayer}from"./locate.js";
2
+ export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers,pickLayer}from"./locate.js";export{registerRuntimes,runtimeOf}from"./runtimes.js";
@@ -0,0 +1,9 @@
1
+ import type { BuildSource, LoadOptions } from "../source.js";
2
+ import type { StageOutput } from "../stage.js";
3
+ /** What loads a source of a kind onto the stage: an output that answers the stage's bridge. */
4
+ export type ItemRuntime = (source: BuildSource, options: LoadOptions, el: HTMLElement) => Promise<StageOutput>;
5
+ /** The runtimes the stage page has, by kind: the stage page's, once, as it installs. */
6
+ export declare function registerRuntimes(runtimes: ReadonlyMap<string, ItemRuntime>): void;
7
+ /** The runtime of a kind, where the stage page has one. */
8
+ export declare function runtimeOf(kind: string): ItemRuntime | undefined;
9
+ //# sourceMappingURL=runtimes.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ let t=new Map;export function registerRuntimes(e){t=e}export function runtimeOf(e){return t.get(e)}
@@ -15,12 +15,25 @@ export interface LoadOptions {
15
15
  * console.ts); default CONSOLE_LIMIT.
16
16
  */
17
17
  consoleLimit?: number;
18
+ /**
19
+ * The item it is drawn inside, by id, when it is drawn live inside
20
+ * another's page (docs/design/references.md §3.5): the runtime leaves
21
+ * the page itself as it is (its background, its title), the outer
22
+ * item's.
23
+ */
24
+ inside?: string;
18
25
  }
19
26
  /** A data file ctx.data(path) can read: parsed, or why it could not be. */
20
27
  export interface DataFile {
21
28
  sha256: string;
22
29
  value?: unknown;
23
30
  error?: string;
31
+ /**
32
+ * Its rows as their source shows them (a sheet's table, each value in its
33
+ * cell's number format: `1,800`, `12%`), where it has a look of its own:
34
+ * what a table that shows the file reads (`shownPath`, @allyhub/formats).
35
+ */
36
+ shown?: unknown;
24
37
  }
25
38
  /** What the host hands load(): one piece, as the build made it. */
26
39
  export interface BuildSource {
@@ -46,6 +59,8 @@ export interface BuildSource {
46
59
  * (resolveSource), so one build is served anywhere.
47
60
  */
48
61
  module: string;
62
+ /** The chunks the bundle imports, and theirs: asked for beside it rather than one import after another. Absent from a build before it. */
63
+ imports?: string[];
49
64
  /** The stylesheets the bundle imports. */
50
65
  styles?: string[];
51
66
  /** The piece's dimensions, as the build resolved them (lang filled in). */
@@ -95,18 +110,46 @@ export interface BuildSource {
95
110
  kindData?: unknown;
96
111
  /**
97
112
  * Every piece of the build by id, for a piece that shows another inside
98
- * it (a scenery's screen): its file, dimensions, format and matrix.
113
+ * it (a scenery's screen): its file, dimensions, format and matrix. A
114
+ * piece this one uses live (docs/design/references.md §3.5) has what
115
+ * its kind's runtime loads it with too (`itemSource`).
99
116
  */
100
- pieces?: Record<string, {
101
- file: string;
102
- dims: Dims;
103
- format: string;
104
- matrix?: {
105
- space: MatrixSpace;
106
- rules: MatrixRule[];
107
- };
108
- }>;
117
+ pieces?: Record<string, BuildPiece>;
118
+ }
119
+ /** A piece of the build as another piece's source names it (BuildSource.pieces). */
120
+ export interface BuildPiece {
121
+ file: string;
122
+ dims: Dims;
123
+ format: string;
124
+ matrix?: {
125
+ space: MatrixSpace;
126
+ rules: MatrixRule[];
127
+ };
128
+ /** Its kind; present where it is used live, with the fields below. */
129
+ kind?: string;
130
+ /** Its bundled module's address, and the chunks and stylesheets it imports (BuildSource's). */
131
+ module?: string;
132
+ imports?: string[];
133
+ styles?: string[];
134
+ /** Its script, a project path with `{locale}` for each language. */
135
+ script?: string;
136
+ /** What its kind's build read for its runtime (BuildSource.kindData). */
137
+ kindData?: unknown;
109
138
  }
139
+ /**
140
+ * The source of a piece `source` uses live, as its kind's runtime loads
141
+ * it: the outer source's project (its words, media, data, looks, the
142
+ * pieces of the build) with the used piece's own module, file, format and
143
+ * kind's data; undefined when the build gave it no module (it is not one
144
+ * the outer piece uses live).
145
+ */
146
+ export declare function itemSource(source: BuildSource, id: string): BuildSource | undefined;
147
+ /**
148
+ * The piece of the build an imported piece is (an item's default export,
149
+ * `video()` or `presentation()`, which records the module that wrote it
150
+ * as `written.file`): its id and entry; undefined for any other value.
151
+ */
152
+ export declare function pieceOfValue(source: BuildSource, value: unknown): [string, BuildPiece] | undefined;
110
153
  /**
111
154
  * Part defaults a project (`defineConfig({ defaults: { part } })`) or a
112
155
  * video (`video({ defaults: { part } })`) sets over the built-in ones.
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const t=(e,n)=>e===""?e:new URL(e,n).href;export function resolveMedia(e,n){return Object.fromEntries(Object.entries(e).map(([i,d])=>[i,{...d,url:t(d.url,n),...d.matteUrl===void 0?{}:{matteUrl:t(d.matteUrl,n)},...d.denoisedUrl===void 0?{}:{denoisedUrl:t(d.denoisedUrl,n)}}]))}export function resolveSource(e,n){return{...e,module:t(e.module,n),...e.styles===void 0?{}:{styles:e.styles.map(i=>t(i,n))},media:resolveMedia(e.media,n)}}
2
+ const d=(n,t)=>n===""?n:new URL(n,t).href;export function resolveMedia(n,t){return Object.fromEntries(Object.entries(n).map(([e,i])=>[e,{...i,url:d(i.url,t),...i.matteUrl===void 0?{}:{matteUrl:d(i.matteUrl,t)},...i.denoisedUrl===void 0?{}:{denoisedUrl:d(i.denoisedUrl,t)}}]))}export function resolveSource(n,t){return{...n,module:d(n.module,t),...n.imports===void 0?{}:{imports:n.imports.map(e=>d(e,t))},...n.styles===void 0?{}:{styles:n.styles.map(e=>d(e,t))},media:resolveMedia(n.media,t),...n.pieces===void 0?{}:{pieces:Object.fromEntries(Object.entries(n.pieces).map(([e,i])=>[e,{...i,...i.module===void 0?{}:{module:d(i.module,t)},...i.imports===void 0?{}:{imports:i.imports.map(s=>d(s,t))},...i.styles===void 0?{}:{styles:i.styles.map(s=>d(s,t))}}]))}}}export function itemSource(n,t){const e=n.pieces?.[t];if(e?.module===void 0||e.kind===void 0)return;const i={...n};return delete i.kindData,delete i.script,delete i.matrix,{...i,kind:e.kind,piece:t,file:e.file,module:e.module,imports:e.imports??[],styles:e.styles??[],dims:e.dims,format:e.format,...e.matrix?{matrix:e.matrix}:{},...e.script===void 0?{}:{script:e.script},...e.kindData===void 0?{}:{kindData:e.kindData}}}export function pieceOfValue(n,t){if(typeof t!="object"||t===null)return;const e=t.written,i=typeof e=="object"&&e!==null?e.file:void 0;if(!(typeof i!="string"||i===""))return Object.entries(n.pieces??{}).find(([,s])=>s.file===i)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/piece",
3
- "version": "0.15.3",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -113,6 +113,7 @@ export declare const ACCOUNT_CALLS: {
113
113
  family: z.ZodDefault<z.ZodNullable<z.ZodString>>;
114
114
  recommended: z.ZodDefault<z.ZodBoolean>;
115
115
  monthlyCredits: z.ZodNumber;
116
+ storageBytes: z.ZodOptional<z.ZodNumber>;
116
117
  prices: z.ZodArray<z.ZodObject<{
117
118
  interval: z.ZodUnion<readonly [z.ZodEnum<{
118
119
  month: "month";
@@ -130,6 +131,7 @@ export declare const ACCOUNT_CALLS: {
130
131
  presetsCents: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
131
132
  }, z.core.$strip>;
132
133
  welcomeCredits: z.ZodOptional<z.ZodNumber>;
134
+ freeStorageBytes: z.ZodOptional<z.ZodNumber>;
133
135
  }, z.core.$strip>>;
134
136
  readonly usage: AccountCall<z.ZodObject<{
135
137
  days: z.ZodInt;
@@ -165,16 +167,16 @@ export declare const ACCOUNT_CALLS: {
165
167
  price: z.ZodOptional<z.ZodObject<{
166
168
  credits: z.ZodNumber;
167
169
  per: z.ZodUnion<readonly [z.ZodEnum<{
168
- call: "call";
170
+ question: "question";
169
171
  result: "result";
170
172
  page: "page";
173
+ call: "call";
171
174
  second: "second";
172
175
  minute: "minute";
173
176
  thousand_characters: "thousand_characters";
174
177
  image: "image";
175
178
  frame: "frame";
176
179
  megapixel: "megapixel";
177
- question: "question";
178
180
  phrase: "phrase";
179
181
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
180
182
  varies: z.ZodBoolean;
@@ -226,10 +228,10 @@ export declare const ACCOUNT_CALLS: {
226
228
  spends: z.ZodArray<z.ZodObject<{
227
229
  at: z.ZodString;
228
230
  kind: z.ZodUnion<readonly [z.ZodEnum<{
231
+ other: "other";
229
232
  models: "models";
230
233
  tools: "tools";
231
234
  studio: "studio";
232
- other: "other";
233
235
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
234
236
  what: z.ZodNullable<z.ZodString>;
235
237
  seconds: z.ZodNullable<z.ZodNumber>;
@@ -251,8 +253,8 @@ export declare const ACCOUNT_CALLS: {
251
253
  }, z.core.$strip>>;
252
254
  readonly portal: AccountCall<z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
253
255
  flow: z.ZodEnum<{
254
- home: "home";
255
256
  payment_method: "payment_method";
257
+ home: "home";
256
258
  cancel: "cancel";
257
259
  }>;
258
260
  }, z.core.$strict>, z.ZodObject<{
@@ -331,8 +333,8 @@ export declare const ACCOUNT_CALLS: {
331
333
  number: z.ZodNullable<z.ZodString>;
332
334
  createdAt: z.ZodString;
333
335
  kind: z.ZodUnion<readonly [z.ZodEnum<{
334
- credits: "credits";
335
336
  plan: "plan";
337
+ credits: "credits";
336
338
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
337
339
  totalCents: z.ZodNumber;
338
340
  currency: z.ZodString;
@@ -369,6 +371,7 @@ export declare const ACCOUNT_CALLS: {
369
371
  role: z.ZodString;
370
372
  limit: z.ZodNullable<z.ZodNumber>;
371
373
  used: z.ZodNumber;
374
+ spent: z.ZodOptional<z.ZodNumber>;
372
375
  }, z.core.$strip>>;
373
376
  }, z.core.$strip>>;
374
377
  readonly "members/limit": AccountCall<z.ZodObject<{
@@ -597,6 +600,7 @@ export declare const ACCOUNT_CALLS: {
597
600
  readonly storage: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
598
601
  keptBytes: z.ZodNumber;
599
602
  capBytes: z.ZodNullable<z.ZodNumber>;
603
+ clearingBytes: z.ZodOptional<z.ZodNumber>;
600
604
  }, z.core.$strip>>;
601
605
  readonly "storage/projects": AccountCall<z.ZodObject<{
602
606
  page: z.ZodInt;
@@ -623,12 +627,7 @@ export declare const ACCOUNT_CALLS: {
623
627
  }[], unknown[]>>;
624
628
  total: z.ZodNumber;
625
629
  }, z.core.$strip>>;
626
- readonly "files/delete": AccountCall<z.ZodObject<{
627
- id: z.ZodString;
628
- }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
629
- readonly "projects/delete": AccountCall<z.ZodObject<{
630
- id: z.ZodString;
631
- }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
630
+ readonly "storage/clear": AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
632
631
  readonly devices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
633
632
  devices: z.ZodArray<z.ZodObject<{
634
633
  id: z.ZodString;
@@ -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 j,ACCOUNT_EXPORT_PATH as G,DEVICES_PATH as b,DevicesSchema as v}from"./auth.js";import{FILES_PATH as H,AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as k,BILLING_CHECKOUT_PATH as U,BILLING_PAYMENT_PATH as C,BILLING_PLANS_PATH as R,BILLING_PORTAL_PATH as N,BILLING_REQUEST_PATH as x,BILLING_RESUME_PATH as M,BILLING_SUMMARY_PATH as B,BILLING_TOP_UP_PATH as D,BILLING_USAGE_PATH as $,BillingPaymentSchema as z,BillingPlansSchema as q,BillingSummarySchema as S,BillingUsageSchema as Y,CheckoutRequestSchema as F,PortalRequestSchema as K,TopUpRequestSchema as V,BILLING_INVOICES_PATH as Z,BILLING_SPENDS_PATH as J,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as X,EDITORS_PATH as ee,EditorsSchema as te,CapabilitiesSchema as O,CapabilityRequestSchema as se,CatalogSchema as oe,BillingSpendsSchema as ie}from"./cloud.js";import{PROJECTS_PATH as ne,STORAGE_FILES_PATH as ae,STORAGE_PATH as re,STORAGE_PROJECTS_PATH as ce,StoragePageSchema as w,StorageSchema as me,StoredFilesSchema as le,StoredProjectsSchema as he}from"./snapshots.js";import{MAIL_MESSAGES_PATH as f,MAIL_PATH as de,MAIL_PERSON_QUERY as pe,MAIL_SETTINGS_PATH as Te,MailMessageSchema as ue,MailSearchResponseSchema as Ee,MailSearchSchema as be,MailSettingsSchema as ge,MailboxSchema as I}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as Ae,MembersSchema as Se,ORGANIZATIONS_PATH as _,ORGANIZATION_PATH as y}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 s=e.strictObject({}),o=e.object({}),L=e.object({url:e.url()}),p=e.string().trim().min(1).max(100),t=(i,T,c,l,r,m)=>({http:i,route:T,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",B,s,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",R,s,q,"The plans, their prices, and what a top-up buys."),usage:t("GET",$,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),Y,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",X,s,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",ee,s,te,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,s,O,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,se,O,"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",J,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),ie,"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",U,F,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",N,K,L,"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",M,s,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",C,s,z,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",Z,s,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",D,V.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,k,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. A browser's session alone."),"autoTopUp/off":t("DELETE",A,s,o,"Auto top-up off."),"credits/request":t("POST",x,s,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",d,s,Se,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(Ae.shape),o,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),o,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),o,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,s,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),o,"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)}),o,"An invitation cancelled."),"team/create":t("POST",_,e.strictObject({name:p}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:p}),o,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,s,o,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,s,o,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${_}/:id/restore`,e.strictObject({id:e.string().min(1)}),o,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,s,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:p}),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()}),o,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),o,"An API key deleted."),mail:t("GET",de,s,I,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${Te}?${pe}`,ge,I,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",f,be,Ee,"The mailbox's messages, newest first."),"mail/message":t("GET",`${f}/:id`,e.strictObject({id:e.string().min(1)}),ue,"One message, read whole."),profile:t("GET",PROFILE_PATH,s,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:p}),o,"The person's name."),storage:t("GET",re,s,me,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",ce,w,he,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",ae,w,le,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"files/delete":t("DELETE",`${H}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's tools' inputs or outputs deleted from the cloud; its bytes stay while a project names them."),"projects/delete":t("DELETE",`${ne}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's projects deleted from the cloud, with its snapshots; a copy on a computer stays."),devices:t("GET",b,s,v,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),o,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,s,o,"Every computer signed out but the one that asks."),export:t("GET",G,s,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",j,s,o,"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(i,T){const c=T,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
2
+ import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as G,ACCOUNT_EXPORT_PATH as v,DEVICES_PATH as b,DevicesSchema as j}from"./auth.js";import{AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as H,BILLING_CHECKOUT_PATH as k,BILLING_PAYMENT_PATH as R,BILLING_PLANS_PATH as U,BILLING_PORTAL_PATH as C,BILLING_REQUEST_PATH as N,BILLING_RESUME_PATH as x,BILLING_SUMMARY_PATH as M,BILLING_TOP_UP_PATH as B,BILLING_USAGE_PATH as D,BillingPaymentSchema as $,BillingPlansSchema as z,BillingSummarySchema as S,BillingUsageSchema as q,CheckoutRequestSchema as Y,PortalRequestSchema as F,TopUpRequestSchema as K,BILLING_INVOICES_PATH as V,BILLING_SPENDS_PATH as Z,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as J,EDITORS_PATH as X,EditorsSchema as ee,CapabilitiesSchema as w,CapabilityRequestSchema as te,CatalogSchema as oe,BillingSpendsSchema as se}from"./cloud.js";import{STORAGE_CLEARING_PATH as ie,STORAGE_FILES_PATH as ne,STORAGE_PATH as ae,STORAGE_PROJECTS_PATH as re,StoragePageSchema as O,StorageSchema as ce,StoredFilesSchema as me,StoredProjectsSchema as le}from"./snapshots.js";import{MAIL_MESSAGES_PATH as I,MAIL_PATH as he,MAIL_PERSON_QUERY as de,MAIL_SETTINGS_PATH as Te,MailMessageSchema as pe,MailSearchResponseSchema as ue,MailSearchSchema as Ee,MailSettingsSchema as be,MailboxSchema as _}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as ge,MembersSchema as Ae,ORGANIZATIONS_PATH as f,ORGANIZATION_PATH as y}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 o=e.strictObject({}),s=e.object({}),L=e.object({url:e.url()}),T=e.string().trim().min(1).max(100),t=(i,p,c,l,r,m)=>({http:i,route:p,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",M,o,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",U,o,z,"The plans, their prices, and what a top-up buys."),usage:t("GET",D,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),q,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",J,o,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",X,o,ee,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,o,w,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,te,w,"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",Z,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),se,"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",k,Y,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",C,F,L,"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",x,o,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",R,o,$,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",V,o,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",B,K.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,H,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. A browser's session alone."),"autoTopUp/off":t("DELETE",A,o,s,"Auto top-up off."),"credits/request":t("POST",N,o,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",d,o,Ae,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ge.shape),s,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),s,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),s,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,o,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),s,"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)}),s,"An invitation cancelled."),"team/create":t("POST",f,e.strictObject({name:T}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:T}),s,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,o,s,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,o,s,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${f}/:id/restore`,e.strictObject({id:e.string().min(1)}),s,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,o,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:T}),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()}),s,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),s,"An API key deleted."),mail:t("GET",he,o,_,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${Te}?${de}`,be,_,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",I,Ee,ue,"The mailbox's messages, newest first."),"mail/message":t("GET",`${I}/:id`,e.strictObject({id:e.string().min(1)}),pe,"One message, read whole."),profile:t("GET",PROFILE_PATH,o,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:T}),s,"The person's name."),storage:t("GET",ae,o,ce,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",re,O,le,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",ne,O,me,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"storage/clear":t("DELETE",ie,o,s,"What the organization keeps that no longer is in use, deleted from the cloud now rather than at the daily sweep."),devices:t("GET",b,o,j,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),s,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,o,s,"Every computer signed out but the one that asks."),export:t("GET",v,o,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",G,o,s,"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(i,p){const c=p,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
@@ -30,6 +30,13 @@ export declare const DEVICES_PATH = "/api/account/devices";
30
30
  * It only tells them apart; the sign-in itself authorizes.
31
31
  */
32
32
  export declare const DEVICE_HEADER = "x-allyhub-device";
33
+ /**
34
+ * The header a program's call carries when no person asked for it, such
35
+ * as a Studio server's save on its clock: AllyHub marks a refusal of it as
36
+ * background (`refusal_met`'s `background`), so the paywall's funnel can
37
+ * leave it out. Its value is `1`; any other, or none, is a person's call.
38
+ */
39
+ export declare const BACKGROUND_HEADER = "x-allyhub-background";
33
40
  /** With a token request: the computer's name as its owner set it, percent-encoded (RFC 3986). */
34
41
  export declare const DEVICE_NAME_HEADER = "x-allyhub-device-name";
35
42
  /** A sign-in's id, as a computer makes it. */
@@ -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",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()}),SIGN_IN_PATH="/api/sign-in",SignInSchema=e.object({turnstile:e.object({siteKey:e.string().min(1)}).optional()}),CAPTCHA_HEADER="x-captcha-response",SIGN_IN_LINK_PATH=`${ISSUER_PATH}/sign-in/link`,SignInLinkRequestSchema=e.strictObject({email:e.email(),authorization:e.url()}),DESKTOP_SCHEME="allyhub",DESKTOP_OPEN=`${DESKTOP_SCHEME}://open`;export function signedInAddress(t,o={}){return`${t}/signed-in${o.desktop===!0?"?from=desktop":""}`}export function signedInFromDesktop(t){return new URLSearchParams(t).get("from")==="desktop"}export const 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()});
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",BACKGROUND_HEADER="x-allyhub-background",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()}),SIGN_IN_PATH="/api/sign-in",SignInSchema=e.object({turnstile:e.object({siteKey:e.string().min(1)}).optional()}),CAPTCHA_HEADER="x-captcha-response",SIGN_IN_LINK_PATH=`${ISSUER_PATH}/sign-in/link`,SignInLinkRequestSchema=e.strictObject({email:e.email(),authorization:e.url()}),DESKTOP_SCHEME="allyhub",DESKTOP_OPEN=`${DESKTOP_SCHEME}://open`;export function signedInAddress(t,o={}){return`${t}/signed-in${o.desktop===!0?"?from=desktop":""}`}export function signedInFromDesktop(t){return new URLSearchParams(t).get("from")==="desktop"}export const 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()});
@@ -12,6 +12,7 @@ export declare const TreeFileSchema: z.ZodObject<{
12
12
  sha256: z.ZodString;
13
13
  size: z.ZodInt;
14
14
  type: z.ZodString;
15
+ immutable: z.ZodOptional<z.ZodLiteral<true>>;
15
16
  }, z.core.$strip>;
16
17
  export type TreeFile = z.infer<typeof TreeFileSchema>;
17
18
  /** How many blobs are asked about at once. */
@@ -32,4 +33,12 @@ export declare const BlobsResponseSchema: z.ZodObject<{
32
33
  }, z.core.$strip>>;
33
34
  }, z.core.$strip>;
34
35
  export type BlobsResponse = z.infer<typeof BlobsResponseSchema>;
36
+ /** A tree's file: its blob, the type it is served as, and whether its name changes with its bytes. */
37
+ export declare const treeFileOf: (blob: {
38
+ sha256: string;
39
+ size: number;
40
+ }, recorded: {
41
+ type: string;
42
+ immutable?: true | undefined;
43
+ }) => TreeFile;
35
44
  //# sourceMappingURL=blobs.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";import{FILE_MAX_BYTES as o}from"./cloud.js";export const Sha256Schema=e.string().regex(/^[0-9a-f]{64}$/u),TreePathSchema=e.string().min(1).max(1024).refine(t=>!t.startsWith("/")&&!t.includes("\\")&&t.split("/").every(r=>r!==""&&r!=="."&&r!==".."),"a relative path of forward slashes, without . or .."),BlobSchema=e.object({sha256:Sha256Schema,size:e.int().nonnegative().max(o)}),TreeFileSchema=BlobSchema.extend({type:e.string().min(1).max(255)}),BLOBS_MAX=1e3,BlobsRequestSchema=e.strictObject({blobs:e.array(BlobSchema.extend({contentType:e.string().min(1).max(255)})).min(1).max(BLOBS_MAX)}),BlobsResponseSchema=e.object({uploads:e.array(e.object({sha256:Sha256Schema,url:e.url(),headers:e.record(e.string(),e.string())}))});
2
+ import{z as e}from"zod";import{FILE_MAX_BYTES as a}from"./cloud.js";export const Sha256Schema=e.string().regex(/^[0-9a-f]{64}$/u),TreePathSchema=e.string().min(1).max(1024).refine(t=>!t.startsWith("/")&&!t.includes("\\")&&t.split("/").every(r=>r!==""&&r!=="."&&r!==".."),"a relative path of forward slashes, without . or .."),BlobSchema=e.object({sha256:Sha256Schema,size:e.int().nonnegative().max(a)}),TreeFileSchema=BlobSchema.extend({type:e.string().min(1).max(255),immutable:e.literal(!0).optional()}),BLOBS_MAX=1e3,BlobsRequestSchema=e.strictObject({blobs:e.array(BlobSchema.extend({contentType:e.string().min(1).max(255)})).min(1).max(BLOBS_MAX)}),BlobsResponseSchema=e.object({uploads:e.array(e.object({sha256:Sha256Schema,url:e.url(),headers:e.record(e.string(),e.string())}))}),treeFileOf=(t,r)=>({sha256:t.sha256,size:t.size,type:r.type,...r.immutable===!0?{immutable:!0}:{}});
@@ -17,6 +17,8 @@ export declare const EXIT: {
17
17
  readonly interrupted: 130;
18
18
  };
19
19
  export type ExitCode = (typeof EXIT)[keyof typeof EXIT];
20
+ /** The code a command that ran and found problems (a check, an item that failed with no code of its own) is told with: apart from one that failed. */
21
+ export declare const PROBLEMS_FOUND = "problems-found";
20
22
  /** A failure as --json prints it, on stdout, with the exit code. */
21
23
  export declare const CliErrorSchema: z.ZodObject<{
22
24
  error: z.ZodObject<{
@@ -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 EXIT={ok:0,failed:1,usage:2,conflict:3,auth:4,platform:5,notFound:6,interrupted:130},CliErrorSchema=e.strictObject({error:e.strictObject({code:e.string().regex(/^[a-z][a-z0-9-]*$/u),message:e.string().min(1),hint:e.string().optional()})}),COMMAND_NAME=/^[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)*$/u;export function command(t){if(!COMMAND_NAME.test(t.name))throw new Error(`"${t.name}" is not a command name.`);const r=Object.keys(t.input.shape);for(const n of t.positional??[])if(!r.includes(n))throw new Error(`${t.name}: positional "${n}" is not a field of its input.`);for(const[n,o]of Object.entries(t.input.shape))if(!o.description)throw new Error(`${t.name}: "${n}" has no description.`);return t}export function describeCommand(t){return{name:t.name,summary:t.summary,positional:[...t.positional??[]],input:e.toJSONSchema(t.input,{io:"input",unrepresentable:"any"}),output:e.toJSONSchema(t.output,{io:"output",unrepresentable:"any"}),examples:[...t.examples??[]]}}export class CommandError extends Error{code;hint;exit;constructor(r,n,o={}){super(n,o.cause===void 0?void 0:{cause:o.cause}),this.name="CommandError",this.code=r,this.hint=o.hint,this.exit=o.exit??EXIT.failed}}
2
+ import{z as e}from"zod";export const EXIT={ok:0,failed:1,usage:2,conflict:3,auth:4,platform:5,notFound:6,interrupted:130},PROBLEMS_FOUND="problems-found",CliErrorSchema=e.strictObject({error:e.strictObject({code:e.string().regex(/^[a-z][a-z0-9-]*$/u),message:e.string().min(1),hint:e.string().optional()})}),COMMAND_NAME=/^[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)*$/u;export function command(t){if(!COMMAND_NAME.test(t.name))throw new Error(`"${t.name}" is not a command name.`);const r=Object.keys(t.input.shape);for(const n of t.positional??[])if(!r.includes(n))throw new Error(`${t.name}: positional "${n}" is not a field of its input.`);for(const[n,o]of Object.entries(t.input.shape))if(!o.description)throw new Error(`${t.name}: "${n}" has no description.`);return t}export function describeCommand(t){return{name:t.name,summary:t.summary,positional:[...t.positional??[]],input:e.toJSONSchema(t.input,{io:"input",unrepresentable:"any"}),output:e.toJSONSchema(t.output,{io:"output",unrepresentable:"any"}),examples:[...t.examples??[]]}}export class CommandError extends Error{code;hint;exit;constructor(r,n,o={}){super(n,o.cause===void 0?void 0:{cause:o.cause}),this.name="CommandError",this.code=r,this.hint=o.hint,this.exit=o.exit??EXIT.failed}}
@@ -0,0 +1,77 @@
1
+ import { z } from "zod";
2
+ export declare const CLOUD_COMPUTER_PATH = "/api/cloud-computer";
3
+ /** Made or resumed, at the cost of the person's organization. */
4
+ export declare const CLOUD_COMPUTER_RESUME_PATH = "/api/cloud-computer/resume";
5
+ /** Paused, if no work runs on it. */
6
+ export declare const CLOUD_COMPUTER_PAUSE_PATH = "/api/cloud-computer/pause";
7
+ /** Where it is reached, and a pass. */
8
+ export declare const CLOUD_COMPUTER_PASS_PATH = "/api/cloud-computer/pass";
9
+ /** How long it may stand idle. */
10
+ export declare const CLOUD_COMPUTER_IDLE_PATH = "/api/cloud-computer/idle";
11
+ /**
12
+ * What a released window asks when its person presses Restart to update,
13
+ * which a window of now never shows: answered, and nothing is done (the
14
+ * services only add, so the route stays for such a window).
15
+ */
16
+ export declare const CLOUD_COMPUTER_UPDATE_PATH = "/api/cloud-computer/update";
17
+ /** What a cloud computer is. `none`: there is none. The three others are a change of it under way. */
18
+ export declare const CLOUD_COMPUTER_STATES: readonly ["none", "running", "paused", "resuming", "pausing", "upgrading"];
19
+ /** A person's cloud computer, as last written down, what an hour of it costs in credits, and how long it may stand idle. */
20
+ export declare const CloudComputerInfoSchema: z.ZodObject<{
21
+ computer: z.ZodObject<{
22
+ state: z.ZodUnion<readonly [z.ZodEnum<{
23
+ paused: "paused";
24
+ running: "running";
25
+ none: "none";
26
+ resuming: "resuming";
27
+ pausing: "pausing";
28
+ upgrading: "upgrading";
29
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
30
+ confirmedAtMs: z.ZodOptional<z.ZodNumber>;
31
+ studioServerVersion: z.ZodOptional<z.ZodString>;
32
+ ranSinceMs: z.ZodOptional<z.ZodNumber>;
33
+ }, z.core.$strip>;
34
+ creditsPerHour: z.ZodNumber;
35
+ idle: z.ZodObject<{
36
+ minutes: z.ZodNumber;
37
+ chosen: z.ZodNullable<z.ZodNumber>;
38
+ min: z.ZodNumber;
39
+ max: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ update: z.ZodOptional<z.ZodObject<{
42
+ version: z.ZodString;
43
+ required: z.ZodOptional<z.ZodBoolean>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
46
+ export type CloudComputerInfo = z.infer<typeof CloudComputerInfoSchema>;
47
+ /** What a window says as it asks for the computer to be made or resumed. What the services receive is strict. */
48
+ export declare const CloudComputerResumeSchema: z.ZodObject<{
49
+ timeZone: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strict>;
51
+ export type CloudComputerResume = z.infer<typeof CloudComputerResumeSchema>;
52
+ /** How a released window's asking to update it now is answered: never updated now, with why. */
53
+ export declare const CloudComputerUpdatedSchema: z.ZodObject<{
54
+ updated: z.ZodBoolean;
55
+ version: z.ZodOptional<z.ZodString>;
56
+ because: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ export type CloudComputerUpdated = z.infer<typeof CloudComputerUpdatedSchema>;
59
+ /** Where a window reaches its person's cloud computer, and what lets it in: a Studio client's address. */
60
+ export declare const CloudComputerPassSchema: z.ZodObject<{
61
+ url: z.ZodString;
62
+ token: z.ZodString;
63
+ expiresAtMs: z.ZodNumber;
64
+ }, z.core.$strip>;
65
+ export type CloudComputerPass = z.infer<typeof CloudComputerPassSchema>;
66
+ /** How an asking to pause was answered: it is paused, or it is not, since work runs on it or its Studio server did not say. */
67
+ export declare const CloudComputerPausedSchema: z.ZodObject<{
68
+ paused: z.ZodBoolean;
69
+ because: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>;
71
+ export type CloudComputerPaused = z.infer<typeof CloudComputerPausedSchema>;
72
+ /** A person's own idle time, minutes; null: the default again. What the services receive is strict. */
73
+ export declare const CloudComputerIdleSchema: z.ZodObject<{
74
+ minutes: z.ZodNullable<z.ZodNumber>;
75
+ }, z.core.$strict>;
76
+ export type CloudComputerIdle = z.infer<typeof CloudComputerIdleSchema>;
77
+ //# sourceMappingURL=cloud-computer.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{z as o}from"zod";import{openEnum as e}from"./open.js";export const CLOUD_COMPUTER_PATH="/api/cloud-computer",CLOUD_COMPUTER_RESUME_PATH="/api/cloud-computer/resume",CLOUD_COMPUTER_PAUSE_PATH="/api/cloud-computer/pause",CLOUD_COMPUTER_PASS_PATH="/api/cloud-computer/pass",CLOUD_COMPUTER_IDLE_PATH="/api/cloud-computer/idle",CLOUD_COMPUTER_UPDATE_PATH="/api/cloud-computer/update",CLOUD_COMPUTER_STATES=["none","running","paused","resuming","pausing","upgrading"],CloudComputerInfoSchema=o.object({computer:o.object({state:e(CLOUD_COMPUTER_STATES),confirmedAtMs:o.number().optional(),studioServerVersion:o.string().optional(),ranSinceMs:o.number().optional()}),creditsPerHour:o.number(),idle:o.object({minutes:o.number(),chosen:o.number().nullable(),min:o.number(),max:o.number()}),update:o.object({version:o.string(),required:o.boolean().optional()}).optional()}),CloudComputerResumeSchema=o.strictObject({timeZone:o.string().min(1).max(64).optional()}),CloudComputerUpdatedSchema=o.object({updated:o.boolean(),version:o.string().optional(),because:o.string().optional()}),CloudComputerPassSchema=o.object({url:o.string(),token:o.string(),expiresAtMs:o.number()}),CloudComputerPausedSchema=o.object({paused:o.boolean(),because:o.string().optional()}),CloudComputerIdleSchema=o.strictObject({minutes:o.number().int().nullable()});