@allyhub/sdk 0.11.0 → 0.12.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/CHANGELOG.md +8 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +14 -5
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +56 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +53 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +328 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +4 -4
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Feature highlights from each AllyHub release.
|
|
4
4
|
|
|
5
|
+
## 0.12.0
|
|
6
|
+
|
|
7
|
+
- **AllyHub learns what is used and what fails.** The CLI and Studio tell AllyHub which commands run, how long agents take and the errors they meet, never what you make or say. Studio's Settings or `ALLYHUB_TELEMETRY=off` turns it off; the list of what is told is public.
|
|
8
|
+
- **Credits are simpler.** Every plan gives 100 credits a dollar, and a new account starts with 100.
|
|
9
|
+
- **A call is checked against your credits before it runs**, so it never ends unpaid halfway; while your other calls are still running, it waits a moment instead.
|
|
10
|
+
- **Files kept up to a cap.** 1 GiB without a plan, 100 GiB with one; an upload or a tool's result is let go 7 days after it was last used.
|
|
11
|
+
- **A cloud Studio pauses when its idle time is up**, and is paid for no longer than that.
|
|
12
|
+
|
|
5
13
|
## 0.11.0
|
|
6
14
|
|
|
7
15
|
- **Reports.** A page written freely in HTML, CSS and JavaScript, read on a screen and sent as a link; rendered as one self-contained HTML file, a PDF or one long PNG, with report styles to start from (`allyhub report style`).
|
|
@@ -42,10 +42,17 @@ export type Profile = z.infer<typeof ProfileSchema>;
|
|
|
42
42
|
/** The roles of a team, the strongest last. */
|
|
43
43
|
export declare const ROLES: readonly ["member", "admin", "owner"];
|
|
44
44
|
export type Role = (typeof ROLES)[number];
|
|
45
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* One call: its route (a `:name` filled from the parameter of that name)
|
|
47
|
+
* and its method; a parameter named in `headers` is sent as that request
|
|
48
|
+
* header; the other parameters are the query of a GET or a DELETE, else
|
|
49
|
+
* the body.
|
|
50
|
+
*/
|
|
46
51
|
export interface AccountCall<P extends z.ZodType = z.ZodType, R extends z.ZodType = z.ZodType> extends MethodSpec<P, R> {
|
|
47
52
|
http: "GET" | "POST" | "PUT" | "DELETE";
|
|
48
53
|
route: string;
|
|
54
|
+
/** The parameters sent as request headers, each by its header's name. */
|
|
55
|
+
headers?: Readonly<Record<string, string>>;
|
|
49
56
|
}
|
|
50
57
|
export declare const ACCOUNT_CALLS: {
|
|
51
58
|
readonly balance: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
@@ -336,6 +343,7 @@ export declare const ACCOUNT_CALLS: {
|
|
|
336
343
|
}, z.core.$strip>>;
|
|
337
344
|
readonly topUp: AccountCall<z.ZodObject<{
|
|
338
345
|
topUpCents: z.ZodNumber;
|
|
346
|
+
key: z.ZodUUID;
|
|
339
347
|
}, z.core.$strict>, z.ZodObject<{
|
|
340
348
|
credits: z.ZodNumber;
|
|
341
349
|
}, z.core.$strip>>;
|
|
@@ -437,8 +445,8 @@ export declare const ACCOUNT_CALLS: {
|
|
|
437
445
|
displayName: z.ZodString;
|
|
438
446
|
retentionDays: z.ZodNumber;
|
|
439
447
|
sendPolicy: z.ZodUnion<readonly [z.ZodEnum<{
|
|
440
|
-
off: "off";
|
|
441
448
|
team: "team";
|
|
449
|
+
off: "off";
|
|
442
450
|
anyone: "anyone";
|
|
443
451
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
444
452
|
sendsLeft: z.ZodNumber;
|
|
@@ -456,8 +464,8 @@ export declare const ACCOUNT_CALLS: {
|
|
|
456
464
|
readonly "mail/settings": AccountCall<z.ZodObject<{
|
|
457
465
|
displayName: z.ZodOptional<z.ZodString>;
|
|
458
466
|
sendPolicy: z.ZodOptional<z.ZodEnum<{
|
|
459
|
-
off: "off";
|
|
460
467
|
team: "team";
|
|
468
|
+
off: "off";
|
|
461
469
|
anyone: "anyone";
|
|
462
470
|
}>>;
|
|
463
471
|
retentionDays: z.ZodOptional<z.ZodNumber>;
|
|
@@ -466,8 +474,8 @@ export declare const ACCOUNT_CALLS: {
|
|
|
466
474
|
displayName: z.ZodString;
|
|
467
475
|
retentionDays: z.ZodNumber;
|
|
468
476
|
sendPolicy: z.ZodUnion<readonly [z.ZodEnum<{
|
|
469
|
-
off: "off";
|
|
470
477
|
team: "team";
|
|
478
|
+
off: "off";
|
|
471
479
|
anyone: "anyone";
|
|
472
480
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
473
481
|
sendsLeft: z.ZodNumber;
|
|
@@ -609,10 +617,11 @@ export declare const ACCOUNT_CALLS: {
|
|
|
609
617
|
};
|
|
610
618
|
export type AccountCalls = typeof ACCOUNT_CALLS;
|
|
611
619
|
export type AccountCallName = keyof AccountCalls;
|
|
612
|
-
/** A call as an HTTP request: its method, its path with the route's parameters and a GET's or a DELETE's query, and
|
|
620
|
+
/** A call as an HTTP request: its method, its path with the route's parameters and a GET's or a DELETE's query, a body, and the headers the call names. */
|
|
613
621
|
export declare function accountRequest(c: AccountCall, params: unknown): {
|
|
614
622
|
method: AccountCall["http"];
|
|
615
623
|
path: string;
|
|
616
624
|
body?: unknown;
|
|
625
|
+
headers?: Record<string, string>;
|
|
617
626
|
};
|
|
618
627
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as
|
|
2
|
+
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as L,ACCOUNT_EXPORT_PATH as v,DEVICES_PATH as E,DevicesSchema as G}from"./auth.js";import{AUTO_TOP_UP_PATH as g,AutoTopUpRequestSchema as j,BILLING_CHECKOUT_PATH as H,BILLING_PAYMENT_PATH as U,BILLING_PLANS_PATH as k,BILLING_PORTAL_PATH as N,BILLING_REQUEST_PATH as C,BILLING_RESUME_PATH as R,BILLING_SUMMARY_PATH as x,BILLING_TOP_UP_PATH as M,BILLING_USAGE_PATH as B,BillingPaymentSchema as D,BillingPlansSchema as $,BillingSummarySchema as S,BillingUsageSchema as z,CheckoutRequestSchema as q,PortalRequestSchema as Y,TopUpRequestSchema as K,BILLING_INVOICES_PATH as V,BILLING_SPENDS_PATH as Z,BillingInvoicesSchema as F,IDEMPOTENCY_KEY_HEADER as Q,CAPABILITIES_PATH as P,CATALOG_PATH as X,EDITORS_PATH as J,EditorsSchema as W,CapabilitiesSchema as w,CapabilityRequestSchema as ee,CatalogSchema as te,BillingSpendsSchema as se}from"./cloud.js";import{MAIL_MESSAGES_PATH as I,MAIL_PATH as ne,MAIL_PERSON_QUERY as ie,MAIL_SETTINGS_PATH as oe,MailMessageSchema as ae,MailSearchResponseSchema as re,MailSearchSchema as me,MailSettingsSchema as ce,MailboxSchema as O}from"./mail.js";import{MEMBERS_PATH as h,MemberLimitSchema as le,MembersSchema as de,ORGANIZATIONS_PATH as _,ORGANIZATION_PATH as y}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const s=e.strictObject({}),n=e.object({}),f=e.object({url:e.url()}),T=e.string().trim().min(1).max(100),t=(i,p,m,l,r,c)=>({http:i,route:p,params:m,result:l,about:r,...c===void 0?{}:{headers:c}});export const ACCOUNT_CALLS={balance:t("GET",x,s,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",k,s,$,"The plans, their prices, and what a top-up buys."),usage:t("GET",B,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),z,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",X,s,te,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",J,s,W,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,s,w,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,ee,w,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",Z,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),se,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",H,q,f,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",N,Y,f,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",R,s,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",U,s,D,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",V,s,F,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",M,K.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:Q}),"autoTopUp/set":t("PUT",g,j,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser. A browser's session alone."),"autoTopUp/off":t("DELETE",g,s,n,"Auto top-up off."),"credits/request":t("POST",C,s,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",h,s,de,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${h}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(le.shape),n,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${h}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),n,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${h}/:userId`,e.strictObject({userId:e.string().min(1)}),n,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,s,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),n,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An invitation cancelled."),"team/create":t("POST",_,e.strictObject({name:T}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:T}),n,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,s,n,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,s,n,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${_}/:id/restore`,e.strictObject({id:e.string().min(1)}),n,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,s,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:T}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),n,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An API key deleted."),mail:t("GET",ne,s,O,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${oe}?${ie}`,ce,O,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",I,me,re,"The mailbox's messages, newest first."),"mail/message":t("GET",`${I}/:id`,e.strictObject({id:e.string().min(1)}),ae,"One message, read whole."),profile:t("GET",PROFILE_PATH,s,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:T}),n,"The person's name."),devices:t("GET",E,s,G,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${E}/:id`,e.strictObject({id:e.string().min(1)}),n,"A computer signed out."),"devices/signOutOthers":t("DELETE",E,s,n,"Every computer signed out but the one that asks."),export:t("GET",v,s,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",L,s,n,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(i,p){const m=p,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(o,a)=>(l.add(a),encodeURIComponent(String(m[a])))),c=i.headers??{},A=Object.entries(c).flatMap(([o,a])=>{const d=m[o];return typeof d=="string"?[[a,d]]:[]}),b=A.length===0?{}:{headers:Object.fromEntries(A)},u=Object.entries(m).filter(([o,a])=>!l.has(o)&&!(o in c)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const o=u.map(([a,d])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(d))}`).join("&");return{method:i.http,path:o===""?r:`${r}?${o}`,...b}}return u.length===0?{method:i.http,path:r,...b}:{method:i.http,path:r,body:Object.fromEntries(u),...b}}
|
|
@@ -66,6 +66,62 @@ export declare const BrowserLinkSchema: z.ZodObject<{
|
|
|
66
66
|
url: z.ZodURL;
|
|
67
67
|
}, z.core.$strip>;
|
|
68
68
|
export type BrowserLink = z.infer<typeof BrowserLinkSchema>;
|
|
69
|
+
/**
|
|
70
|
+
* `GET`, open to anyone: what AllyHub's own sign-in page needs before it
|
|
71
|
+
* asks for a sign-in link. `turnstile` is there where a link is sent only
|
|
72
|
+
* to a request that carries Cloudflare Turnstile's token (the page draws
|
|
73
|
+
* the widget with `siteKey` and sends its token as `CAPTCHA_HEADER`).
|
|
74
|
+
*/
|
|
75
|
+
export declare const SIGN_IN_PATH = "/api/sign-in";
|
|
76
|
+
export declare const SignInSchema: z.ZodObject<{
|
|
77
|
+
turnstile: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
siteKey: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type SignIn = z.infer<typeof SignInSchema>;
|
|
82
|
+
/** The header a request for a sign-in link carries Turnstile's token in (Better Auth's captcha plugin's name for it). */
|
|
83
|
+
export declare const CAPTCHA_HEADER = "x-captcha-response";
|
|
84
|
+
/**
|
|
85
|
+
* `POST { email, authorization }`, open to anyone, a few times in ten
|
|
86
|
+
* minutes from one address: AllyHub mails `email` a link that signs a
|
|
87
|
+
* browser in and goes on to `authorization`, the authorization a program
|
|
88
|
+
* on this computer began for its own sign-in (AllyHub's client, the code
|
|
89
|
+
* back to its loopback; anything else is refused). It is how a program
|
|
90
|
+
* with no page of AllyHub's to ask from signs in by email (Studio's
|
|
91
|
+
* Welcome): the person stays in the program, and the link, followed in a
|
|
92
|
+
* browser on that computer, signs the computer in. AllyHub's own sign-in
|
|
93
|
+
* page asks Better Auth's route instead, with Turnstile's token where its
|
|
94
|
+
* keys are set; this route takes none, a program having nowhere to get
|
|
95
|
+
* one. Answers `{}` whether or not the address has an account.
|
|
96
|
+
*/
|
|
97
|
+
export declare const SIGN_IN_LINK_PATH = "/api/auth/sign-in/link";
|
|
98
|
+
export declare const SignInLinkRequestSchema: z.ZodObject<{
|
|
99
|
+
email: z.ZodEmail;
|
|
100
|
+
authorization: z.ZodURL;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export type SignInLinkRequest = z.infer<typeof SignInLinkRequestSchema>;
|
|
103
|
+
/**
|
|
104
|
+
* The scheme of the link that brings AllyHub's desktop app to the front (a
|
|
105
|
+
* private-use scheme, as RFC 8252 7.1 names them): the app registers it,
|
|
106
|
+
* and a page of AllyHub's links to it. A link of it carries nothing. A
|
|
107
|
+
* computer's sign-in comes back by the loopback, never by it, so a program
|
|
108
|
+
* that took the scheme for itself would learn nothing.
|
|
109
|
+
*/
|
|
110
|
+
export declare const DESKTOP_SCHEME = "allyhub";
|
|
111
|
+
/** The link that brings the desktop app to the front, and does nothing else. */
|
|
112
|
+
export declare const DESKTOP_OPEN = "allyhub://open";
|
|
113
|
+
/**
|
|
114
|
+
* The page a computer's sign-in lands on in the browser (its loopback
|
|
115
|
+
* sends the browser there). `desktop` says the sign-in was the desktop
|
|
116
|
+
* app's and a link opens it (`DESKTOP_OPEN`): the page then offers to
|
|
117
|
+
* bring it forward, which an app cannot do for itself from behind the
|
|
118
|
+
* browser the person is in.
|
|
119
|
+
*/
|
|
120
|
+
export declare function signedInAddress(origin: string, o?: {
|
|
121
|
+
desktop?: boolean | undefined;
|
|
122
|
+
}): string;
|
|
123
|
+
/** Whether the signed-in page's address says the sign-in was the desktop app's. */
|
|
124
|
+
export declare function signedInFromDesktop(search: string): boolean;
|
|
69
125
|
/** The credentials file, relative to the home folder (ALLYHUB_HOME moves it). */
|
|
70
126
|
export declare const CREDENTIALS_FILE = ".allyhub/credentials.json";
|
|
71
127
|
/** A token endpoint's answer (RFC 6749 5.1). */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});
|
|
2
|
+
import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),SIGN_IN_PATH="/api/sign-in",SignInSchema=e.object({turnstile:e.object({siteKey:e.string().min(1)}).optional()}),CAPTCHA_HEADER="x-captcha-response",SIGN_IN_LINK_PATH=`${ISSUER_PATH}/sign-in/link`,SignInLinkRequestSchema=e.strictObject({email:e.email(),authorization:e.url()}),DESKTOP_SCHEME="allyhub",DESKTOP_OPEN=`${DESKTOP_SCHEME}://open`;export function signedInAddress(t,o={}){return`${t}/signed-in${o.desktop===!0?"?from=desktop":""}`}export function signedInFromDesktop(t){return new URLSearchParams(t).get("from")==="desktop"}export const CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});
|
|
@@ -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
|
-
/**
|
|
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
|
|
209
|
-
*
|
|
210
|
-
*
|
|
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
|
|
246
|
+
/** The plan's section of Settings. */
|
|
230
247
|
export declare const BILLING_PAGE_PATH = "/settings/plan";
|
|
231
|
-
/**
|
|
232
|
-
export declare const
|
|
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. */
|
|
@@ -417,6 +452,15 @@ export declare const EditorsSchema: z.ZodObject<{
|
|
|
417
452
|
export type Editors = z.infer<typeof EditorsSchema>;
|
|
418
453
|
/** Where a tool's calls are made (POST). */
|
|
419
454
|
export declare const toolCallsPath: (tool: string) => string;
|
|
455
|
+
/**
|
|
456
|
+
* A call's POST may carry `IDEMPOTENCY_KEY_HEADER` so that a call sent
|
|
457
|
+
* again is one call: the same key from the same person in the same
|
|
458
|
+
* organization, with the same tool and input, answers the call there is,
|
|
459
|
+
* whatever its state, and starts nothing; with another tool or input it
|
|
460
|
+
* is a `conflict`. A new key a new call (a UUID), this many characters at
|
|
461
|
+
* most.
|
|
462
|
+
*/
|
|
463
|
+
export declare const IDEMPOTENCY_KEY_MAX = 255;
|
|
420
464
|
/** Where a call is read again (GET). */
|
|
421
465
|
export declare const callPath: (id: string) => string;
|
|
422
466
|
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
|
|
2
|
+
import{z as t}from"zod";import{openEnum as o}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:o(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),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 ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...s,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),...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}`;
|
|
@@ -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,328 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Where a client sends its events. */
|
|
3
|
+
export declare const EVENTS_PATH = "/api/events";
|
|
4
|
+
/** The most events in one request. */
|
|
5
|
+
export declare const EVENTS_AT_MOST = 100;
|
|
6
|
+
/**
|
|
7
|
+
* A word: a name a program gives (a kind's id, an agent's, a command's, an
|
|
8
|
+
* error's code), lower case, with no spaces. Not a sentence, a path or a
|
|
9
|
+
* title: those do not fit it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EventWordSchema: z.ZodString;
|
|
12
|
+
/** An id a program made: a project's, a session's. Random, never a name. */
|
|
13
|
+
export declare const EventIdSchema: z.ZodString;
|
|
14
|
+
/** A W3C trace id: 32 lower-case hex digits. */
|
|
15
|
+
export declare const EventTraceIdSchema: z.ZodString;
|
|
16
|
+
/** A route's pattern (`/api/tools/:name/calls`), never a path with its ids. */
|
|
17
|
+
export declare const EventRouteSchema: z.ZodString;
|
|
18
|
+
/** Each event's properties, by its name. */
|
|
19
|
+
export declare const EVENT_PROPS: {
|
|
20
|
+
/** A program started: Studio, the CLI on its first command of a day. */
|
|
21
|
+
readonly program_opened: z.ZodObject<{
|
|
22
|
+
os: z.ZodString;
|
|
23
|
+
arch: z.ZodString;
|
|
24
|
+
where: z.ZodEnum<{
|
|
25
|
+
computer: "computer";
|
|
26
|
+
cloud: "cloud";
|
|
27
|
+
}>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
/** A project opened in Studio. */
|
|
30
|
+
readonly project_opened: z.ZodObject<{
|
|
31
|
+
fresh: z.ZodBoolean;
|
|
32
|
+
items: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/** An item was put on show in Studio: the kind of work a person looks at. */
|
|
35
|
+
readonly item_opened: z.ZodObject<{
|
|
36
|
+
kind: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
/** A session with an agent started. */
|
|
39
|
+
readonly session_started: z.ZodObject<{
|
|
40
|
+
agent: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
/** A turn ended: a prompt, and all the agent did to answer it. */
|
|
43
|
+
readonly turn_finished: z.ZodObject<{
|
|
44
|
+
agent: z.ZodString;
|
|
45
|
+
durationMs: z.ZodNumber;
|
|
46
|
+
ended: z.ZodString;
|
|
47
|
+
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
/** Work Studio did ended (@allyhub/jobs): an export, a publish, an install, a download. */
|
|
50
|
+
readonly job_finished: z.ZodObject<{
|
|
51
|
+
what: z.ZodString;
|
|
52
|
+
about: z.ZodString;
|
|
53
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
54
|
+
durationMs: z.ZodNumber;
|
|
55
|
+
outcome: z.ZodEnum<{
|
|
56
|
+
failed: "failed";
|
|
57
|
+
done: "done";
|
|
58
|
+
cancelled: "cancelled";
|
|
59
|
+
}>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
/** A command of the CLI ran. Its name, never its arguments. */
|
|
62
|
+
readonly command_ran: z.ZodObject<{
|
|
63
|
+
command: z.ZodString;
|
|
64
|
+
durationMs: z.ZodNumber;
|
|
65
|
+
exit: z.ZodNumber;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
/** A refusal was shown to the person. */
|
|
68
|
+
readonly refusal_shown: z.ZodObject<{
|
|
69
|
+
code: z.ZodString;
|
|
70
|
+
where: z.ZodString;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
/** A person's first organization was made: they signed up. */
|
|
73
|
+
readonly account_created: z.ZodObject<{}, z.core.$strict>;
|
|
74
|
+
/** The service refused a call for credits, a plan, a limit or a tool turned off, or a file for the organization's cap. */
|
|
75
|
+
readonly refusal_met: z.ZodObject<{
|
|
76
|
+
code: z.ZodString;
|
|
77
|
+
route: z.ZodString;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
/** A person went to pay. */
|
|
80
|
+
readonly checkout_started: z.ZodObject<{
|
|
81
|
+
what: z.ZodEnum<{
|
|
82
|
+
plan: "plan";
|
|
83
|
+
card: "card";
|
|
84
|
+
top_up: "top_up";
|
|
85
|
+
}>;
|
|
86
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
87
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
/** A payment arrived. */
|
|
90
|
+
readonly checkout_completed: z.ZodObject<{
|
|
91
|
+
what: z.ZodEnum<{
|
|
92
|
+
plan: "plan";
|
|
93
|
+
top_up: "top_up";
|
|
94
|
+
}>;
|
|
95
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
/** A share was made. */
|
|
98
|
+
readonly share_made: z.ZodObject<{
|
|
99
|
+
kind: z.ZodString;
|
|
100
|
+
audience: z.ZodString;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
};
|
|
103
|
+
export type EventName = keyof typeof EVENT_PROPS;
|
|
104
|
+
/**
|
|
105
|
+
* Each event in a line, for the list people read (public/github's
|
|
106
|
+
* TELEMETRY.md is written from this file): an event added here is a type
|
|
107
|
+
* error until it says what it is.
|
|
108
|
+
*/
|
|
109
|
+
export declare const EVENT_ABOUT: Record<EventName, string>;
|
|
110
|
+
/** The events a client may send; the rest are the server's own to record. */
|
|
111
|
+
export declare const CLIENT_EVENTS: readonly ["program_opened", "project_opened", "item_opened", "session_started", "turn_finished", "job_finished", "command_ran", "refusal_shown"];
|
|
112
|
+
export type ClientEventName = (typeof CLIENT_EVENTS)[number];
|
|
113
|
+
/** An event's properties. */
|
|
114
|
+
export type EventProps<N extends EventName> = z.infer<(typeof EVENT_PROPS)[N]>;
|
|
115
|
+
/** An event as a client sends it. */
|
|
116
|
+
export declare const ClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
|
+
name: z.ZodLiteral<"program_opened">;
|
|
118
|
+
props: z.ZodObject<{
|
|
119
|
+
os: z.ZodString;
|
|
120
|
+
arch: z.ZodString;
|
|
121
|
+
where: z.ZodEnum<{
|
|
122
|
+
computer: "computer";
|
|
123
|
+
cloud: "cloud";
|
|
124
|
+
}>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
id: z.ZodUUID;
|
|
127
|
+
at: z.ZodISODateTime;
|
|
128
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
129
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
130
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
name: z.ZodLiteral<"project_opened">;
|
|
133
|
+
props: z.ZodObject<{
|
|
134
|
+
fresh: z.ZodBoolean;
|
|
135
|
+
items: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
id: z.ZodUUID;
|
|
138
|
+
at: z.ZodISODateTime;
|
|
139
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
143
|
+
name: z.ZodLiteral<"item_opened">;
|
|
144
|
+
props: z.ZodObject<{
|
|
145
|
+
kind: z.ZodString;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
id: z.ZodUUID;
|
|
148
|
+
at: z.ZodISODateTime;
|
|
149
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
153
|
+
name: z.ZodLiteral<"session_started">;
|
|
154
|
+
props: z.ZodObject<{
|
|
155
|
+
agent: z.ZodString;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
id: z.ZodUUID;
|
|
158
|
+
at: z.ZodISODateTime;
|
|
159
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
160
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
161
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
163
|
+
name: z.ZodLiteral<"turn_finished">;
|
|
164
|
+
props: z.ZodObject<{
|
|
165
|
+
agent: z.ZodString;
|
|
166
|
+
durationMs: z.ZodNumber;
|
|
167
|
+
ended: z.ZodString;
|
|
168
|
+
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
id: z.ZodUUID;
|
|
171
|
+
at: z.ZodISODateTime;
|
|
172
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
173
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
174
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
176
|
+
name: z.ZodLiteral<"job_finished">;
|
|
177
|
+
props: z.ZodObject<{
|
|
178
|
+
what: z.ZodString;
|
|
179
|
+
about: z.ZodString;
|
|
180
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
181
|
+
durationMs: z.ZodNumber;
|
|
182
|
+
outcome: z.ZodEnum<{
|
|
183
|
+
failed: "failed";
|
|
184
|
+
done: "done";
|
|
185
|
+
cancelled: "cancelled";
|
|
186
|
+
}>;
|
|
187
|
+
}, z.core.$strict>;
|
|
188
|
+
id: z.ZodUUID;
|
|
189
|
+
at: z.ZodISODateTime;
|
|
190
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
192
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
194
|
+
name: z.ZodLiteral<"command_ran">;
|
|
195
|
+
props: z.ZodObject<{
|
|
196
|
+
command: z.ZodString;
|
|
197
|
+
durationMs: z.ZodNumber;
|
|
198
|
+
exit: z.ZodNumber;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
id: z.ZodUUID;
|
|
201
|
+
at: z.ZodISODateTime;
|
|
202
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
203
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
206
|
+
name: z.ZodLiteral<"refusal_shown">;
|
|
207
|
+
props: z.ZodObject<{
|
|
208
|
+
code: z.ZodString;
|
|
209
|
+
where: z.ZodString;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
id: z.ZodUUID;
|
|
212
|
+
at: z.ZodISODateTime;
|
|
213
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
214
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$strict>], "name">;
|
|
217
|
+
export type ClientEvent = z.infer<typeof ClientEventSchema>;
|
|
218
|
+
/** A client's batch: strict, as everything the services receive. One event that is not in this file refuses the whole batch. */
|
|
219
|
+
export declare const EventsRequestSchema: z.ZodObject<{
|
|
220
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
221
|
+
name: z.ZodLiteral<"program_opened">;
|
|
222
|
+
props: z.ZodObject<{
|
|
223
|
+
os: z.ZodString;
|
|
224
|
+
arch: z.ZodString;
|
|
225
|
+
where: z.ZodEnum<{
|
|
226
|
+
computer: "computer";
|
|
227
|
+
cloud: "cloud";
|
|
228
|
+
}>;
|
|
229
|
+
}, z.core.$strict>;
|
|
230
|
+
id: z.ZodUUID;
|
|
231
|
+
at: z.ZodISODateTime;
|
|
232
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
233
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
234
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
236
|
+
name: z.ZodLiteral<"project_opened">;
|
|
237
|
+
props: z.ZodObject<{
|
|
238
|
+
fresh: z.ZodBoolean;
|
|
239
|
+
items: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
id: z.ZodUUID;
|
|
242
|
+
at: z.ZodISODateTime;
|
|
243
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
244
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
245
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
name: z.ZodLiteral<"item_opened">;
|
|
248
|
+
props: z.ZodObject<{
|
|
249
|
+
kind: z.ZodString;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
id: z.ZodUUID;
|
|
252
|
+
at: z.ZodISODateTime;
|
|
253
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
254
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
257
|
+
name: z.ZodLiteral<"session_started">;
|
|
258
|
+
props: z.ZodObject<{
|
|
259
|
+
agent: z.ZodString;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
id: z.ZodUUID;
|
|
262
|
+
at: z.ZodISODateTime;
|
|
263
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
264
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
265
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
+
name: z.ZodLiteral<"turn_finished">;
|
|
268
|
+
props: z.ZodObject<{
|
|
269
|
+
agent: z.ZodString;
|
|
270
|
+
durationMs: z.ZodNumber;
|
|
271
|
+
ended: z.ZodString;
|
|
272
|
+
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
273
|
+
}, z.core.$strict>;
|
|
274
|
+
id: z.ZodUUID;
|
|
275
|
+
at: z.ZodISODateTime;
|
|
276
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
277
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
278
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
280
|
+
name: z.ZodLiteral<"job_finished">;
|
|
281
|
+
props: z.ZodObject<{
|
|
282
|
+
what: z.ZodString;
|
|
283
|
+
about: z.ZodString;
|
|
284
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
285
|
+
durationMs: z.ZodNumber;
|
|
286
|
+
outcome: z.ZodEnum<{
|
|
287
|
+
failed: "failed";
|
|
288
|
+
done: "done";
|
|
289
|
+
cancelled: "cancelled";
|
|
290
|
+
}>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
id: z.ZodUUID;
|
|
293
|
+
at: z.ZodISODateTime;
|
|
294
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
295
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
296
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
298
|
+
name: z.ZodLiteral<"command_ran">;
|
|
299
|
+
props: z.ZodObject<{
|
|
300
|
+
command: z.ZodString;
|
|
301
|
+
durationMs: z.ZodNumber;
|
|
302
|
+
exit: z.ZodNumber;
|
|
303
|
+
}, z.core.$strict>;
|
|
304
|
+
id: z.ZodUUID;
|
|
305
|
+
at: z.ZodISODateTime;
|
|
306
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
307
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
308
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
310
|
+
name: z.ZodLiteral<"refusal_shown">;
|
|
311
|
+
props: z.ZodObject<{
|
|
312
|
+
code: z.ZodString;
|
|
313
|
+
where: z.ZodString;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
id: z.ZodUUID;
|
|
316
|
+
at: z.ZodISODateTime;
|
|
317
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
318
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
319
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
320
|
+
}, z.core.$strict>], "name">>;
|
|
321
|
+
}, z.core.$strict>;
|
|
322
|
+
export type EventsRequest = z.infer<typeof EventsRequestSchema>;
|
|
323
|
+
/** What the server answers: how many it kept (one sent before is kept once). */
|
|
324
|
+
export declare const EventsAnswerSchema: z.ZodObject<{
|
|
325
|
+
kept: z.ZodNumber;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
export type EventsAnswer = z.infer<typeof EventsAnswerSchema>;
|
|
328
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{z as e}from"zod";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const a=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words."),o=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:a}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:o,ended:EventWordSchema,changed:a}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:o,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:o,exit:e.number().int().min(0).max(255)}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema}),checkout_started:e.strictObject({what:e.enum(["plan","top_up","card"]),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional()}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_finished:"An agent finished answering a message: how long it took, how it ended, and how many files it changed of each kind of work.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took and its exit code.",refusal_shown:"Studio showed that a call needs credits or a plan.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit or a tool turned off.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",share_made:"A share link was made."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_finished","job_finished","command_ran","refusal_shown"];const r={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()},t=n=>e.strictObject({...r,name:e.literal(n),props:EVENT_PROPS[n]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)}),EventsAnswerSchema=e.object({kept:e.number().int().min(0)});
|
|
@@ -8,6 +8,8 @@ export * from "./frame.js";
|
|
|
8
8
|
export * from "./tools.js";
|
|
9
9
|
export * from "./cli.js";
|
|
10
10
|
export * from "./auth.js";
|
|
11
|
+
export * from "./events.js";
|
|
12
|
+
export * from "./errors.js";
|
|
11
13
|
export * from "./registry.js";
|
|
12
14
|
export * from "./runtimes.js";
|
|
13
15
|
export * from "./cloud.js";
|
|
@@ -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"./presence.js";export*from"./kinds.js";export*from"./notes.js";export*from"./frame.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";export*from"./blobs.js";export*from"./sites.js";export*from"./mail.js";export*from"./snapshots.js";export*from"./sources.js";export*from"./shares.js";export*from"./account.js";export*from"./open.js";export*from"./jobs.js";export*from"./peer.js";export*from"./shape.js";
|
|
2
|
+
export*from"./jsonrpc.js";export*from"./files.js";export*from"./editor.js";export*from"./presence.js";export*from"./kinds.js";export*from"./notes.js";export*from"./frame.js";export*from"./tools.js";export*from"./cli.js";export*from"./auth.js";export*from"./events.js";export*from"./errors.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";export*from"./blobs.js";export*from"./sites.js";export*from"./mail.js";export*from"./snapshots.js";export*from"./sources.js";export*from"./shares.js";export*from"./account.js";export*from"./open.js";export*from"./jobs.js";export*from"./peer.js";export*from"./shape.js";
|
|
@@ -67,8 +67,8 @@ export declare const MailboxSchema: z.ZodObject<{
|
|
|
67
67
|
displayName: z.ZodString;
|
|
68
68
|
retentionDays: z.ZodNumber;
|
|
69
69
|
sendPolicy: z.ZodUnion<readonly [z.ZodEnum<{
|
|
70
|
-
off: "off";
|
|
71
70
|
team: "team";
|
|
71
|
+
off: "off";
|
|
72
72
|
anyone: "anyone";
|
|
73
73
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
74
74
|
sendsLeft: z.ZodNumber;
|
|
@@ -264,8 +264,8 @@ export type MailReply = z.infer<typeof MailReplySchema>;
|
|
|
264
264
|
export declare const MailSettingsSchema: z.ZodObject<{
|
|
265
265
|
displayName: z.ZodOptional<z.ZodString>;
|
|
266
266
|
sendPolicy: z.ZodOptional<z.ZodEnum<{
|
|
267
|
-
off: "off";
|
|
268
267
|
team: "team";
|
|
268
|
+
off: "off";
|
|
269
269
|
anyone: "anyone";
|
|
270
270
|
}>>;
|
|
271
271
|
retentionDays: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{ACCOUNT_CALLS as E}from"./account.js";import{ACCOUNT_PATH as
|
|
2
|
+
import{ACCOUNT_CALLS as E}from"./account.js";import{ACCOUNT_PATH as _,BROWSER_LINK_PATH as O,METADATA_PATH as r,SIGN_IN_LINK_PATH as i}from"./auth.js";import{CATALOG_PATH as H,FILES_PATH as e,LLM_MESSAGES_PATH as I,LLM_MODELS_PATH as L}from"./cloud.js";import{ERRORS_PATH as G}from"./errors.js";import{EVENTS_PATH as n}from"./events.js";import{SHARES_PATH as T}from"./shares.js";import{PROJECTS_PATH as p,SNAPSHOTS_PATH as a,SNAPSHOT_BLOBS_PATH as s}from"./snapshots.js";import{SITES_PATH as t}from"./sites.js";import{MAIL_ALIASES_PATH as U,MAIL_MESSAGES_PATH as o,MAIL_PATH as $,MAIL_SEND_PATH as D,MAIL_SETTINGS_PATH as N}from"./mail.js";import{ORGANIZATIONS_PATH as f,STUDIO_OPEN_PATH as l,STUDIO_PATH as m,STUDIO_TICKET_PATH as R,STUDIO_WAKE_PATH as C,STUDIO_WAKES_PATH as M,STUDIO_PAUSE_PATH as c,STUDIO_POLICY_PATH as P,STUDIO_RESTART_PATH as u,STUDIO_PREPARE_PATH as b}from"./teams.js";export const CLIENT_ROUTES=[{method:"GET",path:r},{method:"GET",path:_},{method:"POST",path:O},{method:"POST",path:i},{method:"GET",path:L},{method:"POST",path:I},{method:"GET",path:H},{method:"POST",path:"/api/tools/:name/calls"},{method:"GET",path:"/api/calls/:id"},{method:"POST",path:n},{method:"POST",path:G},{method:"POST",path:e},{method:"POST",path:`${e}/:id/done`},{method:"GET",path:`${e}/:id/content`},{method:"GET",path:f},{method:"GET",path:m},{method:"DELETE",path:m},{method:"PATCH",path:m},{method:"POST",path:u},{method:"GET",path:P},{method:"PUT",path:P},{method:"POST",path:l},{method:"POST",path:R},{method:"PUT",path:C},{method:"POST",path:M},{method:"POST",path:c},{method:"POST",path:b},{method:"POST",path:s},{method:"POST",path:a},{method:"POST",path:`${a}/:id/view`},{method:"GET",path:p},{method:"DELETE",path:`${p}/:id`},{method:"PUT",path:`${p}/:id/executor`},{method:"POST",path:T},{method:"GET",path:T},{method:"PATCH",path:`${T}/:id`},{method:"DELETE",path:`${T}/:id`},{method:"GET",path:"/api/s/:token"},{method:"POST",path:"/api/s/:token/report"},...Object.values(E).map(h=>({method:h.http,path:h.route})),{method:"GET",path:t},{method:"POST",path:t},{method:"GET",path:`${t}/:id`},{method:"DELETE",path:`${t}/:id`},{method:"POST",path:`${t}/:id/deployments`},{method:"POST",path:`${t}/:id/blobs`},{method:"PUT",path:`${t}/:id/live`},{method:"DELETE",path:`${t}/:id/live`},{method:"PUT",path:`${t}/:id/settings`},{method:"GET",path:$},{method:"POST",path:U},{method:"GET",path:o},{method:"GET",path:`${o}/:id`},{method:"GET",path:`${o}/:id/raw`},{method:"POST",path:`${o}/:id/reply`},{method:"POST",path:D},{method:"PUT",path:N}],probePath=h=>h.path.replace(/:[A-Za-z]+/gu,"probe");export function routeMissing(h,S,A){if(S!==404)return!1;const d=A.error;return d?.code==="not_found"&&d.message===`There is no ${h.method} ${probePath(h)}.`}
|
|
@@ -301,8 +301,8 @@ export declare const WORKED_ELSEWHERE = "worked_elsewhere";
|
|
|
301
301
|
/** Which executor works on a project, and whether it is the one asking. */
|
|
302
302
|
export declare const ExecutorSchema: z.ZodObject<{
|
|
303
303
|
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
304
|
-
cloud: "cloud";
|
|
305
304
|
computer: "computer";
|
|
305
|
+
cloud: "cloud";
|
|
306
306
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
307
307
|
here: z.ZodBoolean;
|
|
308
308
|
}, z.core.$strip>;
|
|
@@ -362,8 +362,8 @@ export declare const ProjectInfoSchema: z.ZodObject<{
|
|
|
362
362
|
}, z.core.$strip>>;
|
|
363
363
|
executor: z.ZodObject<{
|
|
364
364
|
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
365
|
-
cloud: "cloud";
|
|
366
365
|
computer: "computer";
|
|
366
|
+
cloud: "cloud";
|
|
367
367
|
}>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
|
|
368
368
|
here: z.ZodBoolean;
|
|
369
369
|
}, z.core.$strip>;
|
|
@@ -380,7 +380,7 @@ export declare const ProjectsResponseSchema: z.ZodObject<{
|
|
|
380
380
|
hostVersion: string;
|
|
381
381
|
} | null;
|
|
382
382
|
executor: {
|
|
383
|
-
kind: (string & z.core.$brand<"Unknown">) | "
|
|
383
|
+
kind: (string & z.core.$brand<"Unknown">) | "computer" | "cloud";
|
|
384
384
|
here: boolean;
|
|
385
385
|
};
|
|
386
386
|
}[], unknown[]>>;
|
|
@@ -397,8 +397,8 @@ export declare const projectPath: (id: string) => string;
|
|
|
397
397
|
export declare const projectExecutorPath: (id: string) => string;
|
|
398
398
|
export declare const ExecutorMoveSchema: z.ZodObject<{
|
|
399
399
|
kind: z.ZodEnum<{
|
|
400
|
-
cloud: "cloud";
|
|
401
400
|
computer: "computer";
|
|
401
|
+
cloud: "cloud";
|
|
402
402
|
}>;
|
|
403
403
|
}, z.core.$strict>;
|
|
404
404
|
export type ExecutorMove = z.infer<typeof ExecutorMoveSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "What an agent writes videos, decks and workbooks with: each built-in kind's authoring API, re-exported from its extension. The root, /dom, /media and /scenery are the video's: video(), parts with their speech, footage and sounds, defineComponent() and custom() layers, the layout, motion and input helpers, the scenery() layer's options; /slides is the deck's, python-pptx's API; /image is the image's, its boards each its own size; /sheets is the sheet's, openpyxl's API. Nothing a host needs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://allyhub.com",
|