@allyhub/sdk 0.11.0 → 0.13.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 (158) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/node_modules/@allyhub/audio/dist/plan.d.ts +3 -0
  3. package/dist/node_modules/@allyhub/audio/dist/render.js +1 -1
  4. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  5. package/dist/node_modules/@allyhub/chart/dist/chart-file.d.ts +2 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +3 -2
  8. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +5 -12
  9. package/dist/node_modules/@allyhub/chart/dist/chart.js +2 -1
  10. package/dist/node_modules/@allyhub/chart/dist/color.d.ts +37 -0
  11. package/dist/node_modules/@allyhub/chart/dist/color.js +2 -0
  12. package/dist/node_modules/@allyhub/chart/dist/index.d.ts +1 -0
  13. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  14. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  15. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  16. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +130 -0
  18. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  19. package/dist/node_modules/@allyhub/formats/dist/data/gen.d.ts +3 -1
  20. package/dist/node_modules/@allyhub/formats/dist/data/gen.js +1 -1
  21. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +512 -166
  22. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  23. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +2523 -136
  24. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  25. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +931 -87
  26. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  27. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  28. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  29. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  30. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  31. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  32. package/dist/node_modules/@allyhub/ooxml/dist/color.d.ts +11 -0
  33. package/dist/node_modules/@allyhub/ooxml/dist/color.js +1 -1
  34. package/dist/node_modules/@allyhub/ooxml/dist/ext.d.ts +43 -0
  35. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  36. package/dist/node_modules/@allyhub/ooxml/dist/index.d.ts +2 -1
  37. package/dist/node_modules/@allyhub/ooxml/dist/index.js +1 -1
  38. package/dist/node_modules/@allyhub/ooxml/dist/transform.d.ts +13 -0
  39. package/dist/node_modules/@allyhub/ooxml/dist/transform.js +2 -0
  40. package/dist/node_modules/@allyhub/ooxml/package.json +5 -1
  41. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +4 -4
  42. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +2 -2
  43. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +49 -5
  45. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +56 -0
  47. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +72 -9
  49. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +35 -20
  51. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +7 -0
  53. package/dist/node_modules/@allyhub/protocol/dist/errors.js +2 -0
  54. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +328 -0
  55. package/dist/node_modules/@allyhub/protocol/dist/events.js +2 -0
  56. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +28 -2
  57. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  58. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -0
  59. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  60. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  61. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +2 -2
  62. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +69 -6
  64. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  65. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +9 -9
  66. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  67. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  68. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/annotations.d.ts +14 -0
  70. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +2 -0
  71. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/api/index.d.ts +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/api/rules.d.ts +24 -0
  75. package/dist/node_modules/@allyhub/sheet/dist/api/rules.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/api/styles.d.ts +12 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +3 -1
  79. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/arrange.d.ts +28 -1
  81. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/data-tools.d.ts +42 -0
  83. package/dist/node_modules/@allyhub/sheet/dist/data-tools.js +2 -0
  84. package/dist/node_modules/@allyhub/sheet/dist/edit.d.ts +43 -2
  85. package/dist/node_modules/@allyhub/sheet/dist/edit.js +1 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/fill.d.ts +10 -0
  87. package/dist/node_modules/@allyhub/sheet/dist/fill.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.d.ts +14 -0
  90. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  92. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +6 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/dist/outline.d.ts +30 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/outline.js +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/rich.d.ts +29 -0
  97. package/dist/node_modules/@allyhub/sheet/dist/rich.js +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/rules.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/table-style.d.ts +6 -0
  100. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  101. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +5 -1
  103. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +17 -1
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.d.ts +56 -0
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.js +2 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  114. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +117 -21
  115. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +181 -30
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +3 -3
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +28 -2
  120. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/check.js +1 -1
  122. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +222 -4
  123. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +6 -0
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.d.ts +3 -0
  127. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.js +2 -0
  128. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +3 -0
  129. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  130. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  131. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +98 -10
  132. package/dist/node_modules/@allyhub/slides-core/dist/numbering.d.ts +6 -0
  133. package/dist/node_modules/@allyhub/slides-core/dist/numbering.js +2 -0
  134. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +53 -0
  135. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  136. package/dist/node_modules/@allyhub/slides-core/dist/patterns.d.ts +8 -0
  137. package/dist/node_modules/@allyhub/slides-core/dist/patterns.js +2 -0
  138. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +36 -6
  139. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  140. package/dist/node_modules/@allyhub/slides-core/dist/script.d.ts +11 -0
  141. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  142. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  144. package/dist/node_modules/@allyhub/slides-core/dist/table-style.d.ts +48 -0
  145. package/dist/node_modules/@allyhub/slides-core/dist/table-style.js +2 -0
  146. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  147. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +1 -1
  148. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +4 -0
  149. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  150. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  151. package/docs/defaults.md +78 -4
  152. package/docs/image.md +1 -1
  153. package/docs/pictures.md +1 -1
  154. package/docs/project.md +1 -1
  155. package/docs/sheets.md +19 -9
  156. package/docs/slides.md +30 -16
  157. package/docs/speech.md +1 -1
  158. package/package.json +1 -1
@@ -196,18 +196,34 @@ export declare const BillingInvoicesSchema: z.ZodObject<{
196
196
  }, z.core.$strip>>;
197
197
  }, z.core.$strip>;
198
198
  export type BillingInvoices = z.infer<typeof BillingInvoicesSchema>;
199
- /** `POST { topUpCents }`, an owner's or an admin's: credits bought with the saved card at once; answers `{ credits }`, what was added. */
199
+ /**
200
+ * `POST { topUpCents }`, an owner's or an admin's in a browser on AllyHub's
201
+ * site (never a computer's sign-in: it takes money with no person at
202
+ * Stripe's page): credits bought with the saved card at once; answers
203
+ * `{ credits }`, what was added. It needs `IDEMPOTENCY_KEY_HEADER`, and is
204
+ * refused (`too_many_charges`) past a day's charges of the card.
205
+ */
200
206
  export declare const BILLING_TOP_UP_PATH = "/api/billing/top-up";
201
207
  export declare const TopUpRequestSchema: z.ZodObject<{
202
208
  topUpCents: z.ZodNumber;
203
209
  }, z.core.$strict>;
210
+ /**
211
+ * The request header that makes what a request does once (IETF's httpapi
212
+ * draft, "The Idempotency-Key HTTP Header Field"): a key the client makes
213
+ * for one purchase or one call, a UUID. A top-up with the saved card needs
214
+ * it: the same key sent again is answered as the first was, the card
215
+ * charged once; without it the request is refused (400), and with another
216
+ * request's it is refused too. A tool call may carry it (below).
217
+ */
218
+ export declare const IDEMPOTENCY_KEY_HEADER = "idempotency-key";
204
219
  /** `POST`, any member's: the organization's owners and admins are asked by email to add credits, at most once a day for each member. */
205
220
  export declare const BILLING_REQUEST_PATH = "/api/billing/request";
206
221
  /**
207
222
  * `PUT { below, amountCents, monthlyLimitCents?, newCard? }`, an owner's or
208
- * an admin's: auto top-up on, answered `{ on: true }`, or `{ saveCard: url }`,
209
- * a Checkout that saves a card first (or a new one, `newCard`); `DELETE`
210
- * turns it off.
223
+ * an admin's in a browser on AllyHub's site (never a computer's sign-in: it
224
+ * agrees to charges made with no person there): auto top-up on, answered
225
+ * `{ on: true }`, or `{ saveCard: url }`, a Checkout that saves a card first
226
+ * (or a new one, `newCard`); `DELETE` turns it off.
211
227
  */
212
228
  export declare const AUTO_TOP_UP_PATH = "/api/billing/auto-top-up";
213
229
  export declare const AutoTopUpRequestSchema: z.ZodObject<{
@@ -222,14 +238,33 @@ export declare const AutoTopUpRequestSchema: z.ZodObject<{
222
238
  * bounds (`min`, `max`, in cents), a monthly limit under the amount, a
223
239
  * plan already bought, a plan not offered, nothing to pay with, an
224
240
  * organization frozen by a dispute, a card that could not be charged
225
- * (`why`, an auto top-up stop's), a request asked already today.
241
+ * (`why`, an auto top-up stop's), a request asked already today, the saved
242
+ * card charged as often as a day allows (`most`, in 24 hours).
226
243
  */
227
- export declare const BILLING_REFUSALS: readonly ["top_up_amount", "monthly_limit", "has_plan", "no_plan", "no_such_plan", "not_customer", "no_card", "frozen", "not_charged", "asked_today"];
244
+ export declare const BILLING_REFUSALS: readonly ["top_up_amount", "monthly_limit", "has_plan", "no_plan", "no_such_plan", "not_customer", "no_card", "frozen", "not_charged", "asked_today", "too_many_charges"];
228
245
  export type BillingRefusal = (typeof BILLING_REFUSALS)[number];
229
- /** The plan's section of Settings, where a payment that was not made comes back to. */
246
+ /** The plan's section of Settings. */
230
247
  export declare const BILLING_PAGE_PATH = "/settings/plan";
231
- /** Where Stripe's Checkout lands once paid: the plan's section, which follows the balance until what was paid for is there. */
232
- export declare const BILLING_PAID_PATH = "/settings/plan?paid=1";
248
+ /** The team a page of Settings acts in, in its address (`?team=`): the organization's id. Without it, the team the browser works in. */
249
+ export declare const TEAM_PARAM = "team";
250
+ /** Where the plan page opens, in its address (`?view=`): `plans`, or `credits` to buy. */
251
+ export declare const PLAN_VIEW_PARAM = "view";
252
+ /** Back from paying, in the plan page's address (`?paid=1`): the page follows the balance until what was paid for is there. */
253
+ export declare const PAID_PARAM = "paid";
254
+ /** What the plan page opens at: its plans, credits to buy, or back from paying. */
255
+ export declare const PLAN_PAGE_OPENS: readonly ["plans", "credits", "paid"];
256
+ export type PlanPageOpen = (typeof PLAN_PAGE_OPENS)[number];
257
+ /**
258
+ * The plan page's address on a site (its origin), in the team it acts in
259
+ * and at what it opens. Everything that sends a person to the plan page
260
+ * makes its address here: Stripe's way back, the billing emails, the CLI's
261
+ * hint.
262
+ */
263
+ export declare function planPageAddress(origin: string, o?: {
264
+ /** The team it acts in, by the organization's id. */
265
+ organization?: string | undefined;
266
+ open?: PlanPageOpen | undefined;
267
+ }): string;
233
268
  /** The models the organization may use. */
234
269
  export declare const LLM_MODELS_PATH = "/api/llm/models";
235
270
  /** Anthropic's Messages API (`POST`), streamed or not. */
@@ -237,9 +272,28 @@ export declare const LLM_MESSAGES_PATH = "/api/llm/v1/messages";
237
272
  /** A model's tier by its price, the highest first: how a client groups the models. */
238
273
  export declare const MODEL_TIERS: readonly ["premium", "standard", "efficient"];
239
274
  export type ModelTier = (typeof MODEL_TIERS)[number];
275
+ /** The ways a model's thinking is set, as the gateway names them: on or off, an effort level, a token budget. */
276
+ export declare const REASONING_OPTION_TYPES: readonly ["toggle", "effort", "budget_tokens"];
277
+ export declare const ReasoningOptionSchema: z.ZodObject<{
278
+ type: z.ZodUnion<readonly [z.ZodEnum<{
279
+ toggle: "toggle";
280
+ effort: "effort";
281
+ budget_tokens: "budget_tokens";
282
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
283
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
284
+ min: z.ZodOptional<z.ZodNumber>;
285
+ max: z.ZodOptional<z.ZodNumber>;
286
+ }, z.core.$strip>;
287
+ export type ReasoningOption = z.infer<typeof ReasoningOptionSchema>;
240
288
  export declare const ModelCatalogSchema: z.ZodObject<{
241
289
  models: z.ZodArray<z.ZodObject<{
242
290
  reasoning: z.ZodOptional<z.ZodBoolean>;
291
+ reasoningOptions: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<{
292
+ type: (string & z.core.$brand<"Unknown">) | "toggle" | "effort" | "budget_tokens";
293
+ values?: string[] | undefined;
294
+ min?: number | undefined;
295
+ max?: number | undefined;
296
+ }[], unknown[]>>>;
243
297
  input: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
298
  contextWindow: z.ZodOptional<z.ZodNumber>;
245
299
  maxOutput: z.ZodOptional<z.ZodNumber>;
@@ -417,6 +471,15 @@ export declare const EditorsSchema: z.ZodObject<{
417
471
  export type Editors = z.infer<typeof EditorsSchema>;
418
472
  /** Where a tool's calls are made (POST). */
419
473
  export declare const toolCallsPath: (tool: string) => string;
474
+ /**
475
+ * A call's POST may carry `IDEMPOTENCY_KEY_HEADER` so that a call sent
476
+ * again is one call: the same key from the same person in the same
477
+ * organization, with the same tool and input, answers the call there is,
478
+ * whatever its state, and starts nothing; with another tool or input it
479
+ * is a `conflict`. A new key a new call (a UUID), this many characters at
480
+ * most.
481
+ */
482
+ export declare const IDEMPOTENCY_KEY_MAX = 255;
420
483
  /** Where a call is read again (GET). */
421
484
  export declare const callPath: (id: string) => string;
422
485
  export declare const ToolCallRequestSchema: 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 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}`;
2
+ import{z as t}from"zod";import{openEnum as o,readable as l}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),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: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_SPENDS_PATH="/api/billing/spends",BillingSpendsSchema=t.object({spends:t.array(t.object({at:t.string(),kind:o(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:o(["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()}),IDEMPOTENCY_KEY_HEADER="idempotency-key",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","too_many_charges"],BILLING_PAGE_PATH="/settings/plan",TEAM_PARAM="team",PLAN_VIEW_PARAM="view",PAID_PARAM="paid",PLAN_PAGE_OPENS=["plans","credits","paid"];export function planPageAddress(e,n={}){const i=new URLSearchParams;n.open==="paid"?i.set(PAID_PARAM,"1"):n.open!==void 0&&i.set(PLAN_VIEW_PARAM,n.open),n.organization!==void 0&&i.set(TEAM_PARAM,n.organization);const r=i.toString();return`${e}${BILLING_PAGE_PATH}${r===""?"":`?${r}`}`}export const LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const s={tier:o(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const REASONING_OPTION_TYPES=["toggle","effort","budget_tokens"],ReasoningOptionSchema=t.object({type:o(REASONING_OPTION_TYPES),values:t.array(t.string().min(1)).optional(),min:t.number().int().nonnegative().optional(),max:t.number().int().positive().optional()}),ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...s,reasoning:t.boolean().optional(),reasoningOptions:l(ReasoningOptionSchema).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),...s})).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:o(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:o(PRICE_UNITS),varies:t.boolean()}).optional(),shown:t.object({name:t.string(),line:t.string(),section:o(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`,IDEMPOTENCY_KEY_MAX=255,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 a="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${a}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(a))return;const[n,i,...r]=e.slice(a.length).split("/");if(!(!n||!i||r.length>0))try{return{id:decodeURIComponent(n),name:decodeURIComponent(i)}}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}`;
@@ -6,6 +6,13 @@ export declare const ThemeSchema: z.ZodEnum<{
6
6
  light: "light";
7
7
  dark: "dark";
8
8
  }>;
9
+ /** An editor's two modes (HostContext's `mode`). */
10
+ export declare const EDITOR_MODES: readonly ["read", "edit"];
11
+ export declare const EditorModeSchema: z.ZodEnum<{
12
+ read: "read";
13
+ edit: "edit";
14
+ }>;
15
+ export type EditorMode = z.infer<typeof EditorModeSchema>;
9
16
  export declare const HostContextSchema: z.ZodObject<{
10
17
  locale: z.ZodString;
11
18
  theme: z.ZodEnum<{
@@ -22,8 +29,10 @@ export declare const HostContextSchema: z.ZodObject<{
22
29
  share: z.ZodOptional<z.ZodBoolean>;
23
30
  commands: z.ZodOptional<z.ZodBoolean>;
24
31
  audienceWindow: z.ZodOptional<z.ZodBoolean>;
25
- readOnly: z.ZodOptional<z.ZodBoolean>;
26
- viewer: z.ZodOptional<z.ZodBoolean>;
32
+ mode: z.ZodEnum<{
33
+ read: "read";
34
+ edit: "edit";
35
+ }>;
27
36
  place: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
28
37
  item: z.ZodObject<{
29
38
  id: z.ZodString;
@@ -71,10 +80,10 @@ export declare const EXPORT_BUTTON_STATES: readonly ["idle", "queued", "running"
71
80
  export declare const ExportStateSchema: z.ZodObject<{
72
81
  at: z.ZodEnum<{
73
82
  failed: "failed";
74
- running: "running";
75
- idle: "idle";
76
83
  queued: "queued";
84
+ running: "running";
77
85
  done: "done";
86
+ idle: "idle";
78
87
  }>;
79
88
  percent: z.ZodOptional<z.ZodNumber>;
80
89
  open: z.ZodOptional<z.ZodBoolean>;
@@ -97,8 +106,10 @@ export declare const HOST_METHODS: {
97
106
  share: z.ZodOptional<z.ZodBoolean>;
98
107
  commands: z.ZodOptional<z.ZodBoolean>;
99
108
  audienceWindow: z.ZodOptional<z.ZodBoolean>;
100
- readOnly: z.ZodOptional<z.ZodBoolean>;
101
- viewer: z.ZodOptional<z.ZodBoolean>;
109
+ mode: z.ZodEnum<{
110
+ read: "read";
111
+ edit: "edit";
112
+ }>;
102
113
  place: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
103
114
  item: z.ZodObject<{
104
115
  id: z.ZodString;
@@ -158,10 +169,10 @@ export declare const HOST_METHODS: {
158
169
  readonly "export/state": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
159
170
  at: z.ZodEnum<{
160
171
  failed: "failed";
161
- running: "running";
162
- idle: "idle";
163
172
  queued: "queued";
173
+ running: "running";
164
174
  done: "done";
175
+ idle: "idle";
165
176
  }>;
166
177
  percent: z.ZodOptional<z.ZodNumber>;
167
178
  open: z.ZodOptional<z.ZodBoolean>;
@@ -278,8 +289,8 @@ export declare const HOST_NOTIFICATIONS: {
278
289
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
279
290
  state: z.ZodEnum<{
280
291
  failed: "failed";
281
- running: "running";
282
292
  queued: "queued";
293
+ running: "running";
283
294
  done: "done";
284
295
  cancelled: "cancelled";
285
296
  }>;
@@ -306,8 +317,8 @@ export declare const HOST_NOTIFICATIONS: {
306
317
  about: z.ZodObject<{
307
318
  kind: z.ZodEnum<{
308
319
  studio: "studio";
309
- project: "project";
310
320
  agent: "agent";
321
+ project: "project";
311
322
  piece: "piece";
312
323
  plugin: "plugin";
313
324
  skill: "skill";
@@ -316,20 +327,20 @@ export declare const HOST_NOTIFICATIONS: {
316
327
  id: z.ZodString;
317
328
  }, z.core.$strict>;
318
329
  what: z.ZodEnum<{
319
- update: "update";
320
- install: "install";
321
- start: "start";
322
330
  download: "download";
323
331
  wake: "wake";
324
332
  export: "export";
333
+ update: "update";
334
+ install: "install";
335
+ start: "start";
325
336
  publish: "publish";
326
337
  }>;
327
338
  name: z.ZodOptional<z.ZodString>;
328
339
  state: z.ZodEnum<{
329
340
  failed: "failed";
341
+ queued: "queued";
330
342
  running: "running";
331
343
  paused: "paused";
332
- queued: "queued";
333
344
  done: "done";
334
345
  cancelled: "cancelled";
335
346
  }>;
@@ -396,8 +407,10 @@ export declare const HOST_NOTIFICATIONS: {
396
407
  share: z.ZodOptional<z.ZodBoolean>;
397
408
  commands: z.ZodOptional<z.ZodBoolean>;
398
409
  audienceWindow: z.ZodOptional<z.ZodBoolean>;
399
- readOnly: z.ZodOptional<z.ZodBoolean>;
400
- viewer: z.ZodOptional<z.ZodBoolean>;
410
+ mode: z.ZodEnum<{
411
+ read: "read";
412
+ edit: "edit";
413
+ }>;
401
414
  place: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
402
415
  item: z.ZodObject<{
403
416
  id: z.ZodString;
@@ -470,8 +483,10 @@ export declare const EDITOR_HOST_METHODS: {
470
483
  share: z.ZodOptional<z.ZodBoolean>;
471
484
  commands: z.ZodOptional<z.ZodBoolean>;
472
485
  audienceWindow: z.ZodOptional<z.ZodBoolean>;
473
- readOnly: z.ZodOptional<z.ZodBoolean>;
474
- viewer: z.ZodOptional<z.ZodBoolean>;
486
+ mode: z.ZodEnum<{
487
+ read: "read";
488
+ edit: "edit";
489
+ }>;
475
490
  place: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
476
491
  item: z.ZodObject<{
477
492
  id: z.ZodString;
@@ -531,10 +546,10 @@ export declare const EDITOR_HOST_METHODS: {
531
546
  readonly "export/state": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
532
547
  at: z.ZodEnum<{
533
548
  failed: "failed";
534
- running: "running";
535
- idle: "idle";
536
549
  queued: "queued";
550
+ running: "running";
537
551
  done: "done";
552
+ idle: "idle";
538
553
  }>;
539
554
  percent: z.ZodOptional<z.ZodNumber>;
540
555
  open: z.ZodOptional<z.ZodBoolean>;
@@ -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(),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};
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 s}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as n}from"./place.js";import{AgentHereSchema as m,PRESENCE_METHODS as l,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"]),EDITOR_MODES=["read","edit"],EditorModeSchema=t.enum(EDITOR_MODES),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(),mode:EditorModeSchema,place:n.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(m,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:n}),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) in read mode (`mode`): 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":s(HostContextSchema,"The language, theme or agent changed."),"editor/command":s(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,...l};
@@ -0,0 +1,7 @@
1
+ /** Where a program sends an error report. */
2
+ export declare const ERRORS_PATH = "/api/errors";
3
+ /** The address a program's error SDK is given: a well-formed one that is nowhere. The service replaces it. */
4
+ export declare const ERRORS_DSN = "https://allyhub@errors.allyhub.invalid/1";
5
+ /** The largest report, bytes: an exception is a few kilobytes, a native crash's dump a few megabytes. */
6
+ export declare const ERRORS_MOST_BYTES: number;
7
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export const ERRORS_PATH="/api/errors",ERRORS_DSN="https://allyhub@errors.allyhub.invalid/1",ERRORS_MOST_BYTES=8388608;