@allyhub/sdk 0.2.0-next.3 → 0.2.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.
package/docs/speech.md CHANGED
@@ -101,7 +101,7 @@ export default video({
101
101
 
102
102
  ## `say(text, opts?)`
103
103
 
104
- Text to speech. `allyhub voice` makes the missing files with the cloud voice tool, each in `assets/media/gen/say/<hash>` with its words and its record (`--quote` prices them first). A `say` without its file is AK-T002; until it has one, the part lasts about as long as the line takes to say (`SPEECH_RATE_DEFAULTS`: 0.38 s a word, 0.22 s a Chinese, Japanese or Korean character; at least 1 s), and its anchors are placed in proportion along the line.
104
+ Text to speech. `allyhub voice` makes the missing files with the cloud voice tool, each in `assets/media/gen/say/<hash>` with its words and its record (`--dry-run` lists them first, with their characters; each tool's description says what it costs). A `say` without its file is AK-T002; until it has one, the part lasts about as long as the line takes to say (`SPEECH_RATE_DEFAULTS`: 0.38 s a word, 0.22 s a Chinese, Japanese or Korean character; at least 1 s), and its anchors are placed in proportion along the line.
105
105
 
106
106
  - `voice`: the voice tool's voice id; default the tool's own.
107
107
  - `tool`: the voice tool; default `"speech-elevenlabs-multilingual-v2"` (`allyhub help ai <tool>` lists its input).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/audio",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/formats",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -3,10 +3,20 @@ import { z } from "zod";
3
3
  export declare const API_KEY_ENV = "ALLYHUB_API_KEY";
4
4
  /** `GET`: the organization's credits, its plan and its auto top-up. */
5
5
  export declare const BILLING_SUMMARY_PATH = "/api/billing/summary";
6
+ /**
7
+ * Why an auto top-up stopped by itself, for a page to say in its words:
8
+ * no card saved, a Checkout still saving one, a saved method that is not a
9
+ * card, the card declined, the bank asking the person to confirm (3D
10
+ * Secure), Stripe not charging it for another reason, a top-up too small to
11
+ * clear its line, a top-up refunded, a payment disputed.
12
+ */
13
+ export declare const AUTO_TOP_UP_STOPS: readonly ["no_card", "saving_card", "not_a_card", "declined", "needs_authentication", "not_charged", "under_line", "refunded", "disputed"];
14
+ export type AutoTopUpStop = (typeof AUTO_TOP_UP_STOPS)[number];
6
15
  export declare const BillingSummarySchema: z.ZodObject<{
7
16
  credits: z.ZodNumber;
8
17
  held: z.ZodNumber;
9
18
  owed: z.ZodNumber;
19
+ frozen: z.ZodDefault<z.ZodNullable<z.ZodString>>;
10
20
  plan: z.ZodNullable<z.ZodObject<{
11
21
  id: z.ZodString;
12
22
  name: z.ZodString;
@@ -21,7 +31,17 @@ export declare const BillingSummarySchema: z.ZodObject<{
21
31
  autoTopUp: z.ZodNullable<z.ZodObject<{
22
32
  below: z.ZodNumber;
23
33
  amountCents: z.ZodNumber;
24
- stopped: z.ZodNullable<z.ZodString>;
34
+ stopped: z.ZodNullable<z.ZodEnum<{
35
+ no_card: "no_card";
36
+ saving_card: "saving_card";
37
+ not_a_card: "not_a_card";
38
+ declined: "declined";
39
+ needs_authentication: "needs_authentication";
40
+ not_charged: "not_charged";
41
+ under_line: "under_line";
42
+ refunded: "refunded";
43
+ disputed: "disputed";
44
+ }>>;
25
45
  }, z.core.$strip>>;
26
46
  }, z.core.$strip>;
27
47
  export type BillingSummary = z.infer<typeof BillingSummarySchema>;
@@ -90,6 +110,8 @@ export declare const BILLING_VIEWS: {
90
110
  readonly plans: "plans";
91
111
  readonly credits: "add-credits";
92
112
  };
113
+ /** The organization the page acts in and pays from (its id), which becomes the session's. */
114
+ export declare const BILLING_ORG_PARAM = "org";
93
115
  /** The language the app shows, which the page shows too (a locale code, `zh-cn`). */
94
116
  export declare const BILLING_LANG_PARAM = "lang";
95
117
  /** The models the organization may use. */
@@ -129,40 +151,6 @@ export declare const ModelCatalogSchema: z.ZodObject<{
129
151
  export type ModelCatalog = z.infer<typeof ModelCatalogSchema>;
130
152
  /** A JSON Schema document of a tool's input or output. */
131
153
  export declare const JsonSchemaSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
132
- /**
133
- * One part of a tool's price rule: `credits` per unit of `meter` (per
134
- * `tiers[input[tierField]]` when the input picks a tier), beyond `free`
135
- * units. Meters that read the input (`input_count`, `input_block`,
136
- * `input_value`) count `field`; the others count what the run returned
137
- * (results, seconds, images…), estimated from `field` or `typical`.
138
- * Meters are plain strings: the server may add new ones.
139
- */
140
- export declare const ToolPricePartSchema: z.ZodObject<{
141
- meter: z.ZodString;
142
- credits: z.ZodNumber;
143
- field: z.ZodOptional<z.ZodString>;
144
- size: z.ZodOptional<z.ZodNumber>;
145
- free: z.ZodOptional<z.ZodNumber>;
146
- tierField: z.ZodOptional<z.ZodString>;
147
- tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
148
- typical: z.ZodOptional<z.ZodNumber>;
149
- }, z.core.$strip>;
150
- export type ToolPricePart = z.infer<typeof ToolPricePartSchema>;
151
- /** What a run is charged, in credits: the base plus each part. */
152
- export declare const ToolPriceSchema: z.ZodObject<{
153
- baseCredits: z.ZodNumber;
154
- parts: z.ZodArray<z.ZodObject<{
155
- meter: z.ZodString;
156
- credits: z.ZodNumber;
157
- field: z.ZodOptional<z.ZodString>;
158
- size: z.ZodOptional<z.ZodNumber>;
159
- free: z.ZodOptional<z.ZodNumber>;
160
- tierField: z.ZodOptional<z.ZodString>;
161
- tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
162
- typical: z.ZodOptional<z.ZodNumber>;
163
- }, z.core.$strip>>;
164
- }, z.core.$strip>;
165
- export type ToolPrice = z.infer<typeof ToolPriceSchema>;
166
154
  export declare const CATALOG_PATH = "/api/catalog";
167
155
  export declare const CatalogWorkSchema: z.ZodObject<{
168
156
  id: z.ZodString;
@@ -177,19 +165,6 @@ export declare const CatalogToolSchema: z.ZodObject<{
177
165
  description: z.ZodString;
178
166
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
179
167
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
180
- price: z.ZodObject<{
181
- baseCredits: z.ZodNumber;
182
- parts: z.ZodArray<z.ZodObject<{
183
- meter: z.ZodString;
184
- credits: z.ZodNumber;
185
- field: z.ZodOptional<z.ZodString>;
186
- size: z.ZodOptional<z.ZodNumber>;
187
- free: z.ZodOptional<z.ZodNumber>;
188
- tierField: z.ZodOptional<z.ZodString>;
189
- tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
190
- typical: z.ZodOptional<z.ZodNumber>;
191
- }, z.core.$strip>>;
192
- }, z.core.$strip>;
193
168
  long: z.ZodBoolean;
194
169
  }, z.core.$strip>;
195
170
  export type CatalogTool = z.infer<typeof CatalogToolSchema>;
@@ -207,46 +182,10 @@ export declare const CatalogSchema: z.ZodObject<{
207
182
  description: z.ZodString;
208
183
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
209
184
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
210
- price: z.ZodObject<{
211
- baseCredits: z.ZodNumber;
212
- parts: z.ZodArray<z.ZodObject<{
213
- meter: z.ZodString;
214
- credits: z.ZodNumber;
215
- field: z.ZodOptional<z.ZodString>;
216
- size: z.ZodOptional<z.ZodNumber>;
217
- free: z.ZodOptional<z.ZodNumber>;
218
- tierField: z.ZodOptional<z.ZodString>;
219
- tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
220
- typical: z.ZodOptional<z.ZodNumber>;
221
- }, z.core.$strip>>;
222
- }, z.core.$strip>;
223
185
  long: z.ZodBoolean;
224
186
  }, z.core.$strip>>;
225
187
  }, z.core.$strip>;
226
188
  export type Catalog = z.infer<typeof CatalogSchema>;
227
- /**
228
- * A call that spends credits, as the person is asked to allow it before
229
- * it is made: in MCP's elicitation (`elicitation/create`, a form with no
230
- * fields), under this key of its `_meta`, so a client says the price in
231
- * its own words; the elicitation's message says the same in English.
232
- */
233
- export declare const CHARGE_META = "allyhub.com/charge";
234
- /**
235
- * Where AllyHub's command line asks the person when an agent runs it in
236
- * Studio's shell: Studio's Host names an address in each agent's
237
- * environment, and the CLI posts `{ cwd, params }` to it (`params` the
238
- * elicitation's, as an MCP server sends them) and is answered with MCP's
239
- * elicitation result, or an error saying why no one could be asked.
240
- */
241
- export declare const STUDIO_ASK_ENV = "ALLYHUB_STUDIO_ASK";
242
- export declare const ChargeSchema: z.ZodObject<{
243
- tool: z.ZodString;
244
- title: z.ZodString;
245
- credits: z.ZodNumber;
246
- estimated: z.ZodBoolean;
247
- unknown: z.ZodBoolean;
248
- }, z.core.$strip>;
249
- export type Charge = z.infer<typeof ChargeSchema>;
250
189
  /** Where a tool's calls are made (POST). */
251
190
  export declare const toolCallsPath: (tool: string) => string;
252
191
  /** Where a call is read again (GET). */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as t}from"zod";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),plan:t.object({id:t.string(),name:t.string(),interval:t.enum(["month","year"]),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable()}).nullable(),autoTopUp:t.object({below:t.number(),amountCents:t.number(),stopped:t.string().nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),monthlyCredits:t.number(),prices:t.array(t.object({interval:t.enum(["month","year"]),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number()})}),BILLING_USAGE_PATH="/api/billing/usage",BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number()}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(["month","year"])}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive()}),BILLING_PAGE_PATH="/plan",BILLING_PAID_PATH="/plan/paid",BILLING_VIEWS={plans:"plans",credits:"add-credits"},BILLING_LANG_PARAM="lang",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const r={tier:t.enum(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),...r,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),...r})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),ToolPricePartSchema=t.object({meter:t.string().min(1),credits:t.number().nonnegative(),field:t.string().optional(),size:t.number().int().positive().optional(),free:t.number().int().nonnegative().optional(),tierField:t.string().optional(),tiers:t.record(t.string(),t.number().nonnegative()).optional(),typical:t.number().nonnegative().optional()}),ToolPriceSchema=t.object({baseCredits:t.number().nonnegative(),parts:t.array(ToolPricePartSchema)}),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,price:ToolPriceSchema,long:t.boolean()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CHARGE_META="allyhub.com/charge",STUDIO_ASK_ENV="ALLYHUB_STUDIO_ASK",ChargeSchema=t.object({tool:t.string().min(1),title:t.string().min(1),credits:t.number().nonnegative(),estimated:t.boolean(),unknown:t.boolean()}),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:t.enum(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 o="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${o}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(o))return;const[n,i,...a]=e.slice(o.length).split("/");if(!(!n||!i||a.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}`;
2
+ import{z as t}from"zod";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"],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:t.enum(["month","year"]),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable()}).nullable(),autoTopUp:t.object({below:t.number(),amountCents:t.number(),stopped:t.enum(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(),monthlyCredits:t.number(),prices:t.array(t.object({interval:t.enum(["month","year"]),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number()})}),BILLING_USAGE_PATH="/api/billing/usage",BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number()}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(["month","year"])}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive()}),BILLING_PAGE_PATH="/plan",BILLING_PAID_PATH="/plan/paid",BILLING_VIEWS={plans:"plans",credits:"add-credits"},BILLING_ORG_PARAM="org",BILLING_LANG_PARAM="lang",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const r={tier:t.enum(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),...r,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),...r})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),toolCallsPath=n=>`/api/tools/${encodeURIComponent(n)}/calls`,callPath=n=>`/api/calls/${encodeURIComponent(n)}`,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:t.enum(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 o="ally://data-tool-results/";export const allyFilePath=(n,e)=>`${o}${encodeURIComponent(n)}/${encodeURIComponent(e)}`;export function parseAllyFilePath(n){if(!n.startsWith(o))return;const[e,i,...a]=n.slice(o.length).split("/");if(!(!e||!i||a.length>0))try{return{id:decodeURIComponent(e),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=n=>`${FILES_PATH}/${encodeURIComponent(n)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(n,e)=>`${FILES_PATH}/${encodeURIComponent(n)}/content?disposition=${e}`;
@@ -9,4 +9,5 @@ export * from "./runtimes.js";
9
9
  export * from "./cloud.js";
10
10
  export * from "./teams.js";
11
11
  export * from "./app.js";
12
+ export * from "./routes.js";
12
13
  //# 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*from"./jsonrpc.js";export*from"./files.js";export*from"./editor.js";export*from"./tools.js";export*from"./cli.js";export*from"./auth.js";export*from"./registry.js";export*from"./runtimes.js";export*from"./cloud.js";export*from"./teams.js";export*from"./app.js";
2
+ export*from"./jsonrpc.js";export*from"./files.js";export*from"./editor.js";export*from"./tools.js";export*from"./cli.js";export*from"./auth.js";export*from"./registry.js";export*from"./runtimes.js";export*from"./cloud.js";export*from"./teams.js";export*from"./app.js";export*from"./routes.js";
@@ -124,6 +124,8 @@ export declare const RegistryItemSchema: z.ZodObject<{
124
124
  }, z.core.$strict>>;
125
125
  }, z.core.$strict>;
126
126
  export type RegistryItem = z.infer<typeof RegistryItemSchema>;
127
+ /** An item as its file is written: what the schema fills in (`assets`, `bakes`) may be left out. */
128
+ export type RegistryItemInput = z.input<typeof RegistryItemSchema>;
127
129
  export declare const RegistryIndexSchema: z.ZodObject<{
128
130
  $schema: z.ZodOptional<z.ZodString>;
129
131
  name: z.ZodString;
@@ -0,0 +1,14 @@
1
+ export interface ClientRoute {
2
+ method: "GET" | "POST" | "PUT" | "DELETE";
3
+ path: string;
4
+ }
5
+ export declare const CLIENT_ROUTES: readonly ClientRoute[];
6
+ /** A path to ask for a route by: each parameter given a value no record has. */
7
+ export declare const probePath: (route: ClientRoute) => string;
8
+ /**
9
+ * Whether an answer says the API has no such route: its 404 for a path no
10
+ * route matches ("There is no GET /api/…"), not a route's own 404 for a
11
+ * record that is not there.
12
+ */
13
+ export declare function routeMissing(route: ClientRoute, status: number, body: unknown): boolean;
14
+ //# sourceMappingURL=routes.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{ACCOUNT_PATH as A,DEVICES_PATH as o,METADATA_PATH as P}from"./auth.js";import{AUTO_TOP_UP_PATH as e,BILLING_CHECKOUT_PATH as _,BILLING_PLANS_PATH as r,BILLING_PORTAL_PATH as L,BILLING_SUMMARY_PATH as O,BILLING_USAGE_PATH as G,CATALOG_PATH as S,FILES_PATH as T,LLM_MESSAGES_PATH as I,LLM_MODELS_PATH as H}from"./cloud.js";import{MEMBERS_PATH as p,ORGANIZATIONS_PATH as E,ORGANIZATION_PATH as i,STUDIO_OPEN_PATH as n,STUDIO_PATH as a,STUDIO_WAKE_PATH as s}from"./teams.js";export const CLIENT_ROUTES=[{method:"GET",path:P},{method:"GET",path:A},{method:"GET",path:o},{method:"DELETE",path:`${o}/:id`},{method:"GET",path:r},{method:"GET",path:O},{method:"GET",path:G},{method:"POST",path:_},{method:"POST",path:L},{method:"PUT",path:e},{method:"DELETE",path:e},{method:"GET",path:H},{method:"POST",path:I},{method:"GET",path:S},{method:"POST",path:"/api/tools/:name/calls"},{method:"GET",path:"/api/calls/:id"},{method:"POST",path:T},{method:"POST",path:`${T}/:id/done`},{method:"GET",path:`${T}/:id/content`},{method:"GET",path:E},{method:"POST",path:`${E}/:id/restore`},{method:"DELETE",path:i},{method:"GET",path:p},{method:"PUT",path:`${p}/:userId/limit`},{method:"GET",path:a},{method:"DELETE",path:a},{method:"POST",path:n},{method:"PUT",path:s}],probePath=t=>t.path.replace(/:[A-Za-z]+/gu,"probe");export function routeMissing(t,d,m){if(d!==404)return!1;const h=m.error;return h?.code==="not_found"&&h.message===`There is no ${t.method} ${probePath(t)}.`}
@@ -1,15 +1,11 @@
1
1
  import { z } from "zod";
2
- /** `GET`: the organizations the person is in, their own first. */
2
+ /** `GET`: the organizations the person is in, the one a request acts in unless it names another first. */
3
3
  export declare const ORGANIZATIONS_PATH = "/api/organizations";
4
4
  export declare const OrganizationsSchema: z.ZodObject<{
5
5
  organizations: z.ZodArray<z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  name: z.ZodString;
8
8
  slug: z.ZodString;
9
- kind: z.ZodEnum<{
10
- personal: "personal";
11
- team: "team";
12
- }>;
13
9
  role: z.ZodString;
14
10
  dissolvedAt: z.ZodNullable<z.ZodISODateTime>;
15
11
  }, z.core.$strip>>;
@@ -33,8 +29,6 @@ export declare const memberLimitPath: (userId: string) => string;
33
29
  export declare const MemberLimitSchema: z.ZodObject<{
34
30
  monthly: z.ZodNullable<z.ZodNumber>;
35
31
  }, z.core.$strict>;
36
- /** `POST`: the person's own credits moved into the team the request acts in; answers `{ moved }`. */
37
- export declare const MOVE_CREDITS_PATH = "/api/organization/credits/move";
38
32
  /** `DELETE`, its owner's: the team the request acts in dissolved. */
39
33
  export declare const ORGANIZATION_PATH = "/api/organization";
40
34
  /** `POST`, its owner's: a dissolved team restored, within 30 days. */
@@ -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";export const ORGANIZATIONS_PATH="/api/organizations",OrganizationsSchema=t.object({organizations:t.array(t.object({id:t.string(),name:t.string(),slug:t.string(),kind:t.enum(["personal","team"]),role:t.string(),dissolvedAt:t.iso.datetime().nullable()}))}),MEMBERS_PATH="/api/organization/members",MembersSchema=t.object({members:t.array(t.object({userId:t.string(),email:t.string(),name:t.string(),role:t.string(),limit:t.number().nullable(),used:t.number()}))}),memberLimitPath=e=>`${MEMBERS_PATH}/${encodeURIComponent(e)}/limit`,MemberLimitSchema=t.strictObject({monthly:t.number().nonnegative().nullable()}),MOVE_CREDITS_PATH="/api/organization/credits/move",ORGANIZATION_PATH="/api/organization",restorePath=e=>`${ORGANIZATIONS_PATH}/${encodeURIComponent(e)}/restore`,STUDIO_PATH="/api/studio",StudioSchema=t.object({studio:t.object({state:t.enum(["running","paused"]),organizationId:t.string()}).nullable(),creditsPerHour:t.number()}),STUDIO_OPEN_PATH="/api/studio/open",STUDIO_WAKE_PATH="/api/studio/wake",StudioWakeSchema=t.strictObject({at:t.iso.datetime().nullable()});
2
+ import{z as t}from"zod";export const ORGANIZATIONS_PATH="/api/organizations",OrganizationsSchema=t.object({organizations:t.array(t.object({id:t.string(),name:t.string(),slug:t.string(),role:t.string(),dissolvedAt:t.iso.datetime().nullable()}))}),MEMBERS_PATH="/api/organization/members",MembersSchema=t.object({members:t.array(t.object({userId:t.string(),email:t.string(),name:t.string(),role:t.string(),limit:t.number().nullable(),used:t.number()}))}),memberLimitPath=e=>`${MEMBERS_PATH}/${encodeURIComponent(e)}/limit`,MemberLimitSchema=t.strictObject({monthly:t.number().nonnegative().nullable()}),ORGANIZATION_PATH="/api/organization",restorePath=e=>`${ORGANIZATIONS_PATH}/${encodeURIComponent(e)}/restore`,STUDIO_PATH="/api/studio",StudioSchema=t.object({studio:t.object({state:t.enum(["running","paused"]),organizationId:t.string()}).nullable(),creditsPerHour:t.number()}),STUDIO_OPEN_PATH="/api/studio/open",STUDIO_WAKE_PATH="/api/studio/wake",StudioWakeSchema=t.strictObject({at:t.iso.datetime().nullable()});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/protocol",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/runtimes",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/scenery",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/video-core",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/sdk",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0",
4
4
  "description": "What an agent writes videos and decks with: video() and slides(), parts with their speech, footage and sounds, defineComponent() and custom() layers, the layout, motion and input helpers, and the scenery() layer's options. Nothing a host needs.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://allyhub.com",
@@ -42,12 +42,12 @@
42
42
  "node": ">=22.19"
43
43
  },
44
44
  "dependencies": {
45
- "@allyhub-next/audio": "0.2.0-next.3",
46
- "@allyhub-next/formats": "0.2.0-next.3",
47
- "@allyhub-next/protocol": "0.2.0-next.3",
48
- "@allyhub-next/runtimes": "0.2.0-next.3",
49
- "@allyhub-next/scenery": "0.2.0-next.3",
50
- "@allyhub-next/video-core": "0.2.0-next.3",
45
+ "@allyhub-next/audio": "0.2.0",
46
+ "@allyhub-next/formats": "0.2.0",
47
+ "@allyhub-next/protocol": "0.2.0",
48
+ "@allyhub-next/runtimes": "0.2.0",
49
+ "@allyhub-next/scenery": "0.2.0",
50
+ "@allyhub-next/video-core": "0.2.0",
51
51
  "dequal": "2.0.3",
52
52
  "env-paths": "4.0.0",
53
53
  "jsonc-parser": "^3.3.1",