@allyhub/sdk 0.2.0-next.3 → 0.2.0-next.4
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/node_modules/@allyhub-next/audio/package.json +1 -1
- package/node_modules/@allyhub-next/formats/package.json +1 -1
- package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +85 -1
- package/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/node_modules/@allyhub-next/protocol/package.json +1 -1
- package/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/package.json +7 -7
|
@@ -148,7 +148,46 @@ export declare const ToolPricePartSchema: z.ZodObject<{
|
|
|
148
148
|
typical: z.ZodOptional<z.ZodNumber>;
|
|
149
149
|
}, z.core.$strip>;
|
|
150
150
|
export type ToolPricePart = z.infer<typeof ToolPricePartSchema>;
|
|
151
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* A rate a unit costs when the input's settings pick it: each `when` path
|
|
153
|
+
* (dotted, into the input: `providerOptions.klingai.mode`) holds one of
|
|
154
|
+
* its values, `null` for a setting not given (the provider's default).
|
|
155
|
+
* `label` says it after the rate: "at 720p", "in pro mode with sound".
|
|
156
|
+
*/
|
|
157
|
+
export declare const ToolPriceRateSchema: z.ZodObject<{
|
|
158
|
+
label: z.ZodString;
|
|
159
|
+
credits: z.ZodNumber;
|
|
160
|
+
when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
export type ToolPriceRate = z.infer<typeof ToolPriceRateSchema>;
|
|
163
|
+
/**
|
|
164
|
+
* A part of a quote: a part whose rate may be the first of `rates` the
|
|
165
|
+
* input matches (`credits` is then the lowest of them); none matching, the
|
|
166
|
+
* rate is not known before the call.
|
|
167
|
+
*/
|
|
168
|
+
export declare const ToolQuotePartSchema: z.ZodObject<{
|
|
169
|
+
meter: z.ZodString;
|
|
170
|
+
credits: z.ZodNumber;
|
|
171
|
+
field: z.ZodOptional<z.ZodString>;
|
|
172
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
free: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
tierField: z.ZodOptional<z.ZodString>;
|
|
175
|
+
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
176
|
+
typical: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
label: z.ZodString;
|
|
179
|
+
credits: z.ZodNumber;
|
|
180
|
+
when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
181
|
+
}, z.core.$strip>>>;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
|
+
export type ToolQuotePart = z.infer<typeof ToolQuotePartSchema>;
|
|
184
|
+
/**
|
|
185
|
+
* What a run is charged, in credits: the base plus each part. A tool
|
|
186
|
+
* charged what its AI model's provider reports (a `usd` part) has a
|
|
187
|
+
* `quote`: the provider's published rates (by the second of video, the
|
|
188
|
+
* token, the image…), converted to credits as the charge is, which a quote
|
|
189
|
+
* counts by before the call; the call is still charged by `parts`.
|
|
190
|
+
*/
|
|
152
191
|
export declare const ToolPriceSchema: z.ZodObject<{
|
|
153
192
|
baseCredits: z.ZodNumber;
|
|
154
193
|
parts: z.ZodArray<z.ZodObject<{
|
|
@@ -161,6 +200,21 @@ export declare const ToolPriceSchema: z.ZodObject<{
|
|
|
161
200
|
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
162
201
|
typical: z.ZodOptional<z.ZodNumber>;
|
|
163
202
|
}, z.core.$strip>>;
|
|
203
|
+
quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
204
|
+
meter: z.ZodString;
|
|
205
|
+
credits: z.ZodNumber;
|
|
206
|
+
field: z.ZodOptional<z.ZodString>;
|
|
207
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
free: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
tierField: z.ZodOptional<z.ZodString>;
|
|
210
|
+
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
211
|
+
typical: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
+
label: z.ZodString;
|
|
214
|
+
credits: z.ZodNumber;
|
|
215
|
+
when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
}, z.core.$strip>>>;
|
|
164
218
|
}, z.core.$strip>;
|
|
165
219
|
export type ToolPrice = z.infer<typeof ToolPriceSchema>;
|
|
166
220
|
export declare const CATALOG_PATH = "/api/catalog";
|
|
@@ -189,6 +243,21 @@ export declare const CatalogToolSchema: z.ZodObject<{
|
|
|
189
243
|
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
190
244
|
typical: z.ZodOptional<z.ZodNumber>;
|
|
191
245
|
}, z.core.$strip>>;
|
|
246
|
+
quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
247
|
+
meter: z.ZodString;
|
|
248
|
+
credits: z.ZodNumber;
|
|
249
|
+
field: z.ZodOptional<z.ZodString>;
|
|
250
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
free: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
tierField: z.ZodOptional<z.ZodString>;
|
|
253
|
+
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
254
|
+
typical: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
256
|
+
label: z.ZodString;
|
|
257
|
+
credits: z.ZodNumber;
|
|
258
|
+
when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
259
|
+
}, z.core.$strip>>>;
|
|
260
|
+
}, z.core.$strip>>>;
|
|
192
261
|
}, z.core.$strip>;
|
|
193
262
|
long: z.ZodBoolean;
|
|
194
263
|
}, z.core.$strip>;
|
|
@@ -219,6 +288,21 @@ export declare const CatalogSchema: z.ZodObject<{
|
|
|
219
288
|
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
220
289
|
typical: z.ZodOptional<z.ZodNumber>;
|
|
221
290
|
}, z.core.$strip>>;
|
|
291
|
+
quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
292
|
+
meter: z.ZodString;
|
|
293
|
+
credits: z.ZodNumber;
|
|
294
|
+
field: z.ZodOptional<z.ZodString>;
|
|
295
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
free: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
tierField: z.ZodOptional<z.ZodString>;
|
|
298
|
+
tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
299
|
+
typical: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
301
|
+
label: z.ZodString;
|
|
302
|
+
credits: z.ZodNumber;
|
|
303
|
+
when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
304
|
+
}, z.core.$strip>>>;
|
|
305
|
+
}, z.core.$strip>>>;
|
|
222
306
|
}, z.core.$strip>;
|
|
223
307
|
long: z.ZodBoolean;
|
|
224
308
|
}, z.core.$strip>>;
|
|
@@ -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",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()}),ToolPriceRateSchema=t.object({label:t.string().min(1),credits:t.number().nonnegative(),when:t.record(t.string().min(1),t.array(t.union([t.string(),t.number(),t.boolean(),t.null()])).min(1))}),ToolQuotePartSchema=ToolPricePartSchema.extend({rates:t.array(ToolPriceRateSchema).min(1).optional()}),ToolPriceSchema=t.object({baseCredits:t.number().nonnegative(),parts:t.array(ToolPricePartSchema),quote:t.array(ToolQuotePartSchema).min(1).optional()}),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}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/sdk",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.4",
|
|
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.
|
|
46
|
-
"@allyhub-next/formats": "0.2.0-next.
|
|
47
|
-
"@allyhub-next/protocol": "0.2.0-next.
|
|
48
|
-
"@allyhub-next/runtimes": "0.2.0-next.
|
|
49
|
-
"@allyhub-next/scenery": "0.2.0-next.
|
|
50
|
-
"@allyhub-next/video-core": "0.2.0-next.
|
|
45
|
+
"@allyhub-next/audio": "0.2.0-next.4",
|
|
46
|
+
"@allyhub-next/formats": "0.2.0-next.4",
|
|
47
|
+
"@allyhub-next/protocol": "0.2.0-next.4",
|
|
48
|
+
"@allyhub-next/runtimes": "0.2.0-next.4",
|
|
49
|
+
"@allyhub-next/scenery": "0.2.0-next.4",
|
|
50
|
+
"@allyhub-next/video-core": "0.2.0-next.4",
|
|
51
51
|
"dequal": "2.0.3",
|
|
52
52
|
"env-paths": "4.0.0",
|
|
53
53
|
"jsonc-parser": "^3.3.1",
|