@allyhub/sdk 0.16.0 → 0.17.1
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 +13 -0
- package/dist/node_modules/@allyhub/audio/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/place.d.ts +26 -0
- package/dist/node_modules/@allyhub/audio/dist/place.js +2 -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/dist/data/slides.d.ts +15 -3
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +40 -7
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +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/dist/layer.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +51 -10
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -6
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +39 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +3 -0
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +30 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +6 -0
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- 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/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +12 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +10 -0
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +3 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +5 -0
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +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/dist/free.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/docs/docs.md +11 -0
- package/docs/layers.md +2 -0
- package/docs/slides.md +1 -1
- package/package.json +1 -1
|
@@ -15,12 +15,25 @@ export interface LoadOptions {
|
|
|
15
15
|
* console.ts); default CONSOLE_LIMIT.
|
|
16
16
|
*/
|
|
17
17
|
consoleLimit?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The item it is drawn inside, by id, when it is drawn live inside
|
|
20
|
+
* another's page (docs/design/references.md §3.5): the runtime leaves
|
|
21
|
+
* the page itself as it is (its background, its title), the outer
|
|
22
|
+
* item's.
|
|
23
|
+
*/
|
|
24
|
+
inside?: string;
|
|
18
25
|
}
|
|
19
26
|
/** A data file ctx.data(path) can read: parsed, or why it could not be. */
|
|
20
27
|
export interface DataFile {
|
|
21
28
|
sha256: string;
|
|
22
29
|
value?: unknown;
|
|
23
30
|
error?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Its rows as their source shows them (a sheet's table, each value in its
|
|
33
|
+
* cell's number format: `1,800`, `12%`), where it has a look of its own:
|
|
34
|
+
* what a table that shows the file reads (`shownPath`, @allyhub/formats).
|
|
35
|
+
*/
|
|
36
|
+
shown?: unknown;
|
|
24
37
|
}
|
|
25
38
|
/** What the host hands load(): one piece, as the build made it. */
|
|
26
39
|
export interface BuildSource {
|
|
@@ -97,18 +110,46 @@ export interface BuildSource {
|
|
|
97
110
|
kindData?: unknown;
|
|
98
111
|
/**
|
|
99
112
|
* Every piece of the build by id, for a piece that shows another inside
|
|
100
|
-
* it (a scenery's screen): its file, dimensions, format and matrix.
|
|
113
|
+
* it (a scenery's screen): its file, dimensions, format and matrix. A
|
|
114
|
+
* piece this one uses live (docs/design/references.md §3.5) has what
|
|
115
|
+
* its kind's runtime loads it with too (`itemSource`).
|
|
101
116
|
*/
|
|
102
|
-
pieces?: Record<string,
|
|
103
|
-
file: string;
|
|
104
|
-
dims: Dims;
|
|
105
|
-
format: string;
|
|
106
|
-
matrix?: {
|
|
107
|
-
space: MatrixSpace;
|
|
108
|
-
rules: MatrixRule[];
|
|
109
|
-
};
|
|
110
|
-
}>;
|
|
117
|
+
pieces?: Record<string, BuildPiece>;
|
|
111
118
|
}
|
|
119
|
+
/** A piece of the build as another piece's source names it (BuildSource.pieces). */
|
|
120
|
+
export interface BuildPiece {
|
|
121
|
+
file: string;
|
|
122
|
+
dims: Dims;
|
|
123
|
+
format: string;
|
|
124
|
+
matrix?: {
|
|
125
|
+
space: MatrixSpace;
|
|
126
|
+
rules: MatrixRule[];
|
|
127
|
+
};
|
|
128
|
+
/** Its kind; present where it is used live, with the fields below. */
|
|
129
|
+
kind?: string;
|
|
130
|
+
/** Its bundled module's address, and the chunks and stylesheets it imports (BuildSource's). */
|
|
131
|
+
module?: string;
|
|
132
|
+
imports?: string[];
|
|
133
|
+
styles?: string[];
|
|
134
|
+
/** Its script, a project path with `{locale}` for each language. */
|
|
135
|
+
script?: string;
|
|
136
|
+
/** What its kind's build read for its runtime (BuildSource.kindData). */
|
|
137
|
+
kindData?: unknown;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The source of a piece `source` uses live, as its kind's runtime loads
|
|
141
|
+
* it: the outer source's project (its words, media, data, looks, the
|
|
142
|
+
* pieces of the build) with the used piece's own module, file, format and
|
|
143
|
+
* kind's data; undefined when the build gave it no module (it is not one
|
|
144
|
+
* the outer piece uses live).
|
|
145
|
+
*/
|
|
146
|
+
export declare function itemSource(source: BuildSource, id: string): BuildSource | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* The piece of the build an imported piece is (an item's default export,
|
|
149
|
+
* `video()` or `presentation()`, which records the module that wrote it
|
|
150
|
+
* as `written.file`): its id and entry; undefined for any other value.
|
|
151
|
+
*/
|
|
152
|
+
export declare function pieceOfValue(source: BuildSource, value: unknown): [string, BuildPiece] | undefined;
|
|
112
153
|
/**
|
|
113
154
|
* Part defaults a project (`defineConfig({ defaults: { part } })`) or a
|
|
114
155
|
* video (`video({ defaults: { part } })`) sets over the built-in ones.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
const
|
|
2
|
+
const d=(n,t)=>n===""?n:new URL(n,t).href;export function resolveMedia(n,t){return Object.fromEntries(Object.entries(n).map(([e,i])=>[e,{...i,url:d(i.url,t),...i.matteUrl===void 0?{}:{matteUrl:d(i.matteUrl,t)},...i.denoisedUrl===void 0?{}:{denoisedUrl:d(i.denoisedUrl,t)}}]))}export function resolveSource(n,t){return{...n,module:d(n.module,t),...n.imports===void 0?{}:{imports:n.imports.map(e=>d(e,t))},...n.styles===void 0?{}:{styles:n.styles.map(e=>d(e,t))},media:resolveMedia(n.media,t),...n.pieces===void 0?{}:{pieces:Object.fromEntries(Object.entries(n.pieces).map(([e,i])=>[e,{...i,...i.module===void 0?{}:{module:d(i.module,t)},...i.imports===void 0?{}:{imports:i.imports.map(s=>d(s,t))},...i.styles===void 0?{}:{styles:i.styles.map(s=>d(s,t))}}]))}}}export function itemSource(n,t){const e=n.pieces?.[t];if(e?.module===void 0||e.kind===void 0)return;const i={...n};return delete i.kindData,delete i.script,delete i.matrix,{...i,kind:e.kind,piece:t,file:e.file,module:e.module,imports:e.imports??[],styles:e.styles??[],dims:e.dims,format:e.format,...e.matrix?{matrix:e.matrix}:{},...e.script===void 0?{}:{script:e.script},...e.kindData===void 0?{}:{kindData:e.kindData}}}export function pieceOfValue(n,t){if(typeof t!="object"||t===null)return;const e=t.written,i=typeof e=="object"&&e!==null?e.file:void 0;if(!(typeof i!="string"||i===""))return Object.entries(n.pieces??{}).find(([,s])=>s.file===i)}
|
|
@@ -628,12 +628,6 @@ export declare const ACCOUNT_CALLS: {
|
|
|
628
628
|
total: z.ZodNumber;
|
|
629
629
|
}, z.core.$strip>>;
|
|
630
630
|
readonly "storage/clear": AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
631
|
-
readonly "files/delete": AccountCall<z.ZodObject<{
|
|
632
|
-
id: z.ZodString;
|
|
633
|
-
}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
634
|
-
readonly "projects/delete": AccountCall<z.ZodObject<{
|
|
635
|
-
id: z.ZodString;
|
|
636
|
-
}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
|
|
637
631
|
readonly devices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
638
632
|
devices: z.ZodArray<z.ZodObject<{
|
|
639
633
|
id: z.ZodString;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as G,ACCOUNT_EXPORT_PATH as
|
|
2
|
+
import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as G,ACCOUNT_EXPORT_PATH as v,DEVICES_PATH as b,DevicesSchema as j}from"./auth.js";import{AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as H,BILLING_CHECKOUT_PATH as k,BILLING_PAYMENT_PATH as R,BILLING_PLANS_PATH as U,BILLING_PORTAL_PATH as C,BILLING_REQUEST_PATH as N,BILLING_RESUME_PATH as x,BILLING_SUMMARY_PATH as M,BILLING_TOP_UP_PATH as B,BILLING_USAGE_PATH as D,BillingPaymentSchema as $,BillingPlansSchema as z,BillingSummarySchema as S,BillingUsageSchema as q,CheckoutRequestSchema as Y,PortalRequestSchema as F,TopUpRequestSchema as K,BILLING_INVOICES_PATH as V,BILLING_SPENDS_PATH as Z,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as J,EDITORS_PATH as X,EditorsSchema as ee,CapabilitiesSchema as w,CapabilityRequestSchema as te,CatalogSchema as oe,BillingSpendsSchema as se}from"./cloud.js";import{STORAGE_CLEARING_PATH as ie,STORAGE_FILES_PATH as ne,STORAGE_PATH as ae,STORAGE_PROJECTS_PATH as re,StoragePageSchema as O,StorageSchema as ce,StoredFilesSchema as me,StoredProjectsSchema as le}from"./snapshots.js";import{MAIL_MESSAGES_PATH as I,MAIL_PATH as he,MAIL_PERSON_QUERY as de,MAIL_SETTINGS_PATH as Te,MailMessageSchema as pe,MailSearchResponseSchema as ue,MailSearchSchema as Ee,MailSettingsSchema as be,MailboxSchema as _}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as ge,MembersSchema as Ae,ORGANIZATIONS_PATH as f,ORGANIZATION_PATH as y}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const o=e.strictObject({}),s=e.object({}),L=e.object({url:e.url()}),T=e.string().trim().min(1).max(100),t=(i,p,c,l,r,m)=>({http:i,route:p,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",M,o,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",U,o,z,"The plans, their prices, and what a top-up buys."),usage:t("GET",D,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),q,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",J,o,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",X,o,ee,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,o,w,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,te,w,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",Z,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),se,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",k,Y,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",C,F,L,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",x,o,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",R,o,$,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",V,o,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",B,K.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,H,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser. A browser's session alone."),"autoTopUp/off":t("DELETE",A,o,s,"Auto top-up off."),"credits/request":t("POST",N,o,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",d,o,Ae,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ge.shape),s,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),s,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),s,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,o,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),s,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),s,"An invitation cancelled."),"team/create":t("POST",f,e.strictObject({name:T}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:T}),s,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,o,s,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,o,s,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${f}/:id/restore`,e.strictObject({id:e.string().min(1)}),s,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,o,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:T}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),s,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),s,"An API key deleted."),mail:t("GET",he,o,_,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${Te}?${de}`,be,_,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",I,Ee,ue,"The mailbox's messages, newest first."),"mail/message":t("GET",`${I}/:id`,e.strictObject({id:e.string().min(1)}),pe,"One message, read whole."),profile:t("GET",PROFILE_PATH,o,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:T}),s,"The person's name."),storage:t("GET",ae,o,ce,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",re,O,le,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",ne,O,me,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"storage/clear":t("DELETE",ie,o,s,"What the organization keeps that no longer is in use, deleted from the cloud now rather than at the daily sweep."),devices:t("GET",b,o,j,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),s,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,o,s,"Every computer signed out but the one that asks."),export:t("GET",v,o,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",G,o,s,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(i,p){const c=p,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
|
|
@@ -41,6 +41,14 @@ export type WindowPage = (typeof WINDOW_PAGES)[number];
|
|
|
41
41
|
/** What a person goes to Stripe's Checkout for: a plan, credits, or a card saved for auto top-up. */
|
|
42
42
|
export declare const CHECKOUT_WHATS: readonly ["plan", "top_up", "card"];
|
|
43
43
|
export type CheckoutWhat = (typeof CHECKOUT_WHATS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* Why a plan was cancelled (`subscription_canceled`): the reason the
|
|
46
|
+
* person chose in Stripe's billing portal (its `cancellation_details.feedback`
|
|
47
|
+
* words), or `dispute` where a payment's dispute ended it. An open list: a
|
|
48
|
+
* reader leaves a word it does not know as it is.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CANCEL_REASONS: readonly ["too_expensive", "missing_features", "switched_service", "unused", "customer_service", "too_complex", "low_quality", "other", "dispute"];
|
|
51
|
+
export type CancelReason = (typeof CANCEL_REASONS)[number];
|
|
44
52
|
/**
|
|
45
53
|
* What stopped a person who came back from Stripe's Checkout without
|
|
46
54
|
* paying, as they answered (`checkout_abandoned`): the price, no payment
|
|
@@ -213,6 +221,37 @@ export declare const EVENT_PROPS: {
|
|
|
213
221
|
currency: z.ZodOptional<z.ZodString>;
|
|
214
222
|
country: z.ZodOptional<z.ZodString>;
|
|
215
223
|
}, z.core.$strict>;
|
|
224
|
+
/** A plan moved to another plan or interval (an upgrade, a downgrade at the period's end, monthly to yearly). Once a change. */
|
|
225
|
+
readonly subscription_changed: z.ZodObject<{
|
|
226
|
+
plan: z.ZodString;
|
|
227
|
+
interval: z.ZodString;
|
|
228
|
+
from_plan: z.ZodString;
|
|
229
|
+
from_interval: z.ZodString;
|
|
230
|
+
}, z.core.$strict>;
|
|
231
|
+
/** A plan was set to end (at its period's end, as the billing portal cancels), with why where the person said. Once a cancellation; one undone and made again is another. */
|
|
232
|
+
readonly subscription_canceled: z.ZodObject<{
|
|
233
|
+
plan: z.ZodString;
|
|
234
|
+
interval: z.ZodString;
|
|
235
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
/** A plan ended: the organization has it no more. Once a subscription. */
|
|
238
|
+
readonly subscription_ended: z.ZodObject<{
|
|
239
|
+
plan: z.ZodString;
|
|
240
|
+
interval: z.ZodString;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
/** A plan's new period was paid (Stripe's `subscription_cycle` invoice). Once an invoice. */
|
|
243
|
+
readonly subscription_renewed: z.ZodObject<{
|
|
244
|
+
plan: z.ZodString;
|
|
245
|
+
interval: z.ZodString;
|
|
246
|
+
amount_cents: z.ZodNumber;
|
|
247
|
+
currency: z.ZodString;
|
|
248
|
+
}, z.core.$strict>;
|
|
249
|
+
/** A plan's invoice could not be charged (the card declined, expired): Stripe tries again. Once an attempt. */
|
|
250
|
+
readonly payment_failed: z.ZodObject<{
|
|
251
|
+
plan: z.ZodString;
|
|
252
|
+
interval: z.ZodString;
|
|
253
|
+
attempt: z.ZodNumber;
|
|
254
|
+
}, z.core.$strict>;
|
|
216
255
|
/** A share was made. */
|
|
217
256
|
readonly share_made: z.ZodObject<{
|
|
218
257
|
kind: z.ZodString;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";import{TURN_MOODS as i,TURN_PURPOSES as d,TURN_TROUBLES as c}from"./purposes.js";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),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/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(
|
|
2
|
+
import{z as e}from"zod";import{TURN_MOODS as i,TURN_PURPOSES as d,TURN_TROUBLES as c}from"./purposes.js";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),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/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(o=>Object.keys(o).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CANCEL_REASONS=["too_expensive","missing_features","switched_service","unused","customer_service","too_complex","low_quality","other","dispute"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const s=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_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:s,ended:EventWordSchema,changed:a,made:a.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:s,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:s,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),subscription_changed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,from_plan:EventWordSchema,from_interval:EventWordSchema}),subscription_canceled:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,reason:EventWordSchema.optional()}),subscription_ended:e.strictObject({plan:EventWordSchema,interval:EventWordSchema}),subscription_renewed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,amount_cents:e.number().int().nonnegative(),currency:EventWordSchema}),payment_failed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,attempt:e.number().int().min(1)}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_classified:e.strictObject({purpose:e.enum(d),language:EventLanguageSchema.optional(),mood:e.enum(i).optional(),trouble:e.enum(c).optional()})},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_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",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, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the console's Home, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",page_viewed:"One of a few pages was arrived at: the console's Home, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",subscription_changed:"A plan moved to another plan or between monthly and yearly.",subscription_canceled:"A plan was set to end, and the reason the person chose for it, when they chose one.",subscription_ended:"A plan ended.",subscription_renewed:"A plan's new period was paid.",payment_failed:"A plan's payment could not be charged.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","share_opened","upgrade_clicked","page_viewed","paywall_shown","checkout_abandoned"];const r={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()},t=o=>e.strictObject({...r,name:e.literal(o),props:EVENT_PROPS[o]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_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)});const n=o=>e.strictObject({...r,name:e.literal(o),props:EVENT_PROPS[o]});export const WindowEventSchema=e.discriminatedUnion("name",[n("home_product_chosen"),n("item_opened_from_sidebar"),n("file_downloaded"),n("share_opened"),n("upgrade_clicked"),n("page_viewed"),n("paywall_shown"),n("checkout_abandoned")]),WindowEventsRequestSchema=e.strictObject({events:e.array(WindowEventSchema).min(1).max(EVENTS_AT_MOST)}),EventsAnswerSchema=e.object({kept:e.number().int().min(0)});
|
|
@@ -210,6 +210,9 @@ export declare const FRAME_NOTIFICATIONS: {
|
|
|
210
210
|
item: z.ZodString;
|
|
211
211
|
place: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
212
212
|
}, z.core.$strict>>;
|
|
213
|
+
readonly "item/open": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
214
|
+
item: z.ZodString;
|
|
215
|
+
}, z.core.$strict>>;
|
|
213
216
|
readonly "export/state": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
214
217
|
at: z.ZodEnum<{
|
|
215
218
|
done: "done";
|
|
@@ -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{EDITOR_STATES as a,EditorModeSchema as
|
|
2
|
+
import{z as e}from"zod";import{EDITOR_STATES as a,EditorModeSchema as h,ExportStateSchema as c,PlaceSchema as d,ThemeSchema as m}from"./editor.js";import{AgentHereSchema as p}from"./presence.js";import{PathSchema as s}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as w,NoteFoundSchema as l,NotePickSchema as i,NotePictureSchema as g,NotePointSchema as f,NoteRectSchema as r,NoteShapeSchema as b}from"./notes.js";const n=e.strictObject({connection:e.string().min(1),message:e.unknown()});export const FRAME_METHODS={"note/hold":o(e.strictObject({selection:e.boolean().optional()}),w.extend({selected:e.array(i).optional()}),"Holds what moves by itself while the person marks a picture of it; says what is on show, and with `selection` what is selected in it."),"note/locate":o(e.strictObject({shape:b}),l,"What a mark is on: the editor's answer and every inset's under it, innermost first. Empty is an answer: the mark's place still goes."),"note/pick":o(e.strictObject({at:f}),e.strictObject({pick:i.optional()}),"The one thing in front at a point, with its edge: the innermost inset's under it that answers, else the editor's. None is an answer."),"note/pictures":o(e.strictObject({}),e.strictObject({pictures:e.array(g),uncovered:e.array(e.strictObject({name:e.string(),rect:r}))}),"The page as it shows now, drawn without the window's marks, then its insets' pictures, each at its rect, outermost first."),"note/release":o(e.strictObject({}),e.strictObject({}),"The person is done marking. Nothing starts by itself.")},WINDOW_NOTIFICATIONS={"editor/command":t(e.strictObject({command:e.string().min(1),open:e.boolean().optional()}),"A shortcut the window took, its header's Export or its agent's name, or a command of the editor's extension, for the editor to do as its own."),"editor/upstream":t(e.discriminatedUnion("from",[e.strictObject({from:e.literal("snapshot"),root:e.url()}),e.strictObject({from:e.literal("window"),connection:e.string().min(1)})]),"Where the page reads and writes from now: a read view, or the project's server through the window. Each is a new upstream: the page makes its watches again there and its editor takes what differs as a change on disk."),"editor/context":t(e.strictObject({mode:h,theme:m}),"The editor's mode and the theme the window draws in, as they are now: the page's editor hears them as its host's context and changes where it stands."),"editor/message":t(n,"A message of the project's server for the page.")},FRAME_NOTIFICATIONS={"editor/ready":t(e.strictObject({}),"The page is loaded: the window tells it its upstream and its context."),"editor/send":t(n,"A message of the page for the project's server."),"note/ready":t(e.strictObject({}),"The page's editor has given its surface: the page answers notes."),"note/gone":t(e.strictObject({}),"The page no longer answers notes: its editor went, or the page goes."),"window/key":t(e.strictObject({key:e.string(),code:e.string(),meta:e.boolean(),ctrl:e.boolean(),shift:e.boolean(),alt:e.boolean()}),"A key with ⌘ or Ctrl pressed in the page that its editor did not take: the window's shortcut (⌘⇧M, ⌘K), heard where the keys are in the page. A desktop shell's menu hears them itself, so a page framed there tells none."),"agent/ask":t(e.strictObject({text:e.string().min(1)}),"Words the editor puts before the person's agent, for them to go on and send."),"note/begin":t(e.strictObject({from:r.optional(),selection:e.boolean().optional()}),"The person asked for Mark up from the editor: the window shows its tools, or with `selection` begins with what is selected marked; `from` is what they pressed, in the page's viewport."),"share/begin":t(e.strictObject({}),"The person asked to share the item on show."),"edit/request":t(e.strictObject({}),"The person pressed an Edit of the page's own on a read-only page, or the page needs the machine for what they asked: the window wakes it. Never for a key pressed in the item."),"editor/place":t(e.strictObject({item:s,place:d}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"item/open":t(e.strictObject({item:s}),"The person opened another item of the project from the editor (an embed's Open, a link to an item): the window opens it as its list would, so its header and list follow."),"export/state":t(c,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(a),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(p,"The project's agent in the item on show and whether its editor follows it, for the window's header; its button asks back with `editor/command`'s `follow` or `unfollow`.")};
|
|
@@ -60,8 +60,38 @@ export declare const ListedKindSchema: z.ZodObject<{
|
|
|
60
60
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
61
61
|
entry: z.ZodString;
|
|
62
62
|
}, z.core.$strip>>;
|
|
63
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
turnInto: z.ZodOptional<z.ZodBoolean>;
|
|
63
65
|
}, z.core.$strip>;
|
|
64
66
|
export type ListedKind = z.infer<typeof ListedKindSchema>;
|
|
67
|
+
/** A kind the project's extensions contribute, by its id, as a listing of its items gives it (`project/items`' `kinds`). */
|
|
68
|
+
export declare const ProjectKindSchema: z.ZodObject<{
|
|
69
|
+
noun: z.ZodString;
|
|
70
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
71
|
+
color: z.ZodOptional<z.ZodString>;
|
|
72
|
+
editor: z.ZodOptional<z.ZodString>;
|
|
73
|
+
exports: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
types: z.ZodArray<z.ZodString>;
|
|
75
|
+
extras: z.ZodArray<z.ZodString>;
|
|
76
|
+
options: z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
only: z.ZodArray<z.ZodString>;
|
|
79
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
share: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
85
|
+
plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
86
|
+
starter: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
88
|
+
entry: z.ZodString;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
turnInto: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type ProjectKind = z.infer<typeof ProjectKindSchema>;
|
|
65
95
|
/** A kind of the kind table as a listing gives it to page code. */
|
|
66
96
|
export declare function listedKind(spec: KindSpec): ListedKind;
|
|
67
97
|
/**
|
|
@@ -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 r}from"zod";const m=r.object({name:r.string().min(1),only:r.array(r.string().min(1)),values:r.array(r.string().min(1)).optional()});export const ExportOfferSchema=r.object({types:r.array(r.string().min(1)),extras:r.array(r.string().min(1)),options:r.array(m),names:r.record(r.string(),r.record(r.string(),r.string())).optional()});const
|
|
2
|
+
import{z as r}from"zod";const m=r.object({name:r.string().min(1),only:r.array(r.string().min(1)),values:r.array(r.string().min(1)).optional()});export const ExportOfferSchema=r.object({types:r.array(r.string().min(1)),extras:r.array(r.string().min(1)),options:r.array(m),names:r.record(r.string(),r.record(r.string(),r.string())).optional()});const d={noun:r.string().min(1),icon:r.string().min(1).optional(),color:r.string().min(1).optional(),editor:r.string().min(1).optional(),exports:ExportOfferSchema.optional(),share:r.boolean().optional()};export const KindInfoSchema=r.object({name:r.string().min(1),...d}),ListedKindSchema=r.object({name:r.record(r.string(),r.string().min(1)),plural:r.record(r.string(),r.string().min(1)).optional(),starter:r.object({files:r.record(r.string().min(1),r.string()),entry:r.string().min(1)}).optional(),order:r.number().optional(),turnInto:r.boolean().optional(),...d}),ProjectKindSchema=ListedKindSchema.extend({id:r.string().min(1)});export function listedKind(n){return{name:n.name??{en:n.noun},...n.plural===void 0?{}:{plural:{...n.plural}},...n.starter===void 0?{}:{starter:{files:{...n.starter.files},entry:n.starter.entry}},...n.order===void 0?{}:{order:n.order},...n.turnInto===!1?{turnInto:!1}:{},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},...n.editor===void 0?{}:{editor:n.editor},...n.exports===void 0?{}:{exports:{types:[...n.exports.types],extras:[...n.exports.extras],options:n.exports.options.map(o=>({name:o.name,only:[...o.only],...o.values===void 0?{}:{values:[...o.values]}})),...n.exports.names===void 0?{}:{names:Object.fromEntries(Object.entries(n.exports.names).map(([o,e])=>[o,{...e}]))}}},...n.share===void 0?{}:{share:n.share}}}export function listedFileEditor(n){return{name:{...n.name},...n.plural===void 0?{}:{plural:{...n.plural}},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},editor:n.id}}export const kindNameIn=(n,o)=>n.name[o]??n.name.en??n.noun,kindPluralIn=(n,o)=>n.plural?.[o]??n.plural?.en??kindNameIn(n,o);const s=/\.(ya?ml|json)$/u;export function starterFiles(n,o,e,i){const a=t=>t.replaceAll("{{locale}}",e).replaceAll("{{name}}",i);return{files:Object.entries(n.files).map(([t,u])=>{const l=a(t),f=s.test(l)?JSON.stringify(o):o;return{path:l,text:u.replaceAll("{{locale}}",e).replaceAll("{{name}}",i).replaceAll("{{title}}",()=>f)}}),entry:a(n.entry)}}export function kindInfoIn(n,o,e){return o===void 0?{name:n??"file",noun:n??"file"}:{name:kindNameIn(o,e),noun:o.noun,...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.editor===void 0?{}:{editor:o.editor},...o.exports===void 0?{}:{exports:o.exports},...o.share===void 0?{}:{share:o.share}}}export function downloadOffered(n){return n.kindInfo?.exports!==void 0?"formats":n.kind===void 0?"file as it is":"nothing"}
|
|
@@ -141,6 +141,8 @@ export declare const PROJECT_TOOLS: {
|
|
|
141
141
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
142
142
|
entry: z.ZodString;
|
|
143
143
|
}, z.core.$strip>>;
|
|
144
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
turnInto: z.ZodOptional<z.ZodBoolean>;
|
|
144
146
|
}, z.core.$strip>>;
|
|
145
147
|
}, z.core.$strict>>;
|
|
146
148
|
kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -165,6 +167,8 @@ export declare const PROJECT_TOOLS: {
|
|
|
165
167
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
166
168
|
entry: z.ZodString;
|
|
167
169
|
}, z.core.$strip>>;
|
|
170
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
turnInto: z.ZodOptional<z.ZodBoolean>;
|
|
168
172
|
id: z.ZodString;
|
|
169
173
|
}, z.core.$strip>>>;
|
|
170
174
|
name: z.ZodString;
|
|
@@ -203,6 +207,8 @@ export declare const PROJECT_TOOLS: {
|
|
|
203
207
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
204
208
|
entry: z.ZodString;
|
|
205
209
|
}, z.core.$strip>>;
|
|
210
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
turnInto: z.ZodOptional<z.ZodBoolean>;
|
|
206
212
|
}, z.core.$strip>>;
|
|
207
213
|
}, z.core.$strict>;
|
|
208
214
|
}, z.core.$strict>>;
|
|
@@ -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{FolderSchema as n,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as
|
|
2
|
+
import{z as e}from"zod";import{FolderSchema as n,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as c,ProjectKindSchema as g}from"./kinds.js";import{RPC_ERROR as b,RpcError as f,method as s,notification as o}from"./jsonrpc.js";export const VersionRef={item:t,version:e.string().optional()};export{ImageSchema}from"./image.js";export const ProblemSchema=e.looseObject({code:e.string(),level:e.enum(["error","warn"]),message:e.string(),piece:e.string().optional(),part:e.string().optional(),t:e.number().optional()}),FactSchema=e.looseObject({kind:e.string(),data:e.unknown()}),CHECK_STATES=["off","waiting","running","done","failed"],CheckStateSchema=e.strictObject({status:e.enum(CHECK_STATES),revision:e.int().nonnegative(),problems:e.array(ProblemSchema),facts:e.array(FactSchema),versions:e.strictObject({total:e.int(),loaded:e.int(),reused:e.int()}).optional(),error:e.string().optional()}),EXPORT_STATES=["queued","running","done","failed","cancelled"],ExportOptionsSchema=e.record(e.string(),e.union([e.string(),e.boolean()])),ExportJobSchema=e.strictObject({id:e.string(),item:t,versions:e.array(e.string()),types:e.array(e.string()),options:ExportOptionsSchema.optional(),state:e.enum(EXPORT_STATES),progress:e.number().min(0).max(1),files:e.array(t),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:t,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()}),FramedPageSchema=e.strictObject({url:e.string(),probe:e.string()}),COMPONENT_STILLS_MAX=64,PROJECT_TOOLS={"project/items":s(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),files:e.array(e.object({path:e.string().min(1),role:e.string().min(1).optional()})).optional(),kindInfo:c.optional()})),kinds:e.array(g).optional(),name:e.string(),scope:e.string(),revision:e.int().nonnegative()}),"The project's items, as its list (allyhub.yaml) names them, in its order: each a file of a kind, or a file an editor opens by its name."),"project/file":s(e.strictObject({path:t}),e.strictObject({item:e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),kindInfo:c.optional()})}),"A file of the project as it opens in an editor, whether the list names it or not: the item it is, else the file in the editor that opens it by its name (an `editors` contribution's `files`); not found for a file that is not there or that no editor opens."),"items/preview":s(e.strictObject({item:t}),e.strictObject({preview:h.optional()}),"What an item looks like (named by its id or its file), as its kind's provider makes it from its files now (a video's still, an image's boards, a deck's slide, a doc's first paragraphs, a sheet's first rows); none where its kind gives none."),"items/page":s(e.strictObject({item:t,folder:n.optional(),file:t.optional()}),e.strictObject({url:e.string()}),"The address of an item's page, for a frame (a report's page, a website built as files): `folder` served as the root of an origin of its own, the project's files alone (no other address loads), every file the page loads recorded as the item's input, so the item's editors hear `items/changed` when one changes."),"work/add":s(e.strictObject({kind:e.string().min(1),file:t,title:e.string().min(1).optional()}),e.strictObject({}),"Adds a piece to the end of the project's list (allyhub.yaml), the rest of it as it was; nothing when its file is listed already."),"components/list":s(e.strictObject({item:t}),e.strictObject({components:e.array(e.strictObject({of:e.string(),name:e.string(),label:e.union([e.string(),e.record(e.string(),e.string())]).optional()}))}),"The components an item may place: every one the project's files define, by the reference it would write."),"components/stage":s(e.strictObject(VersionRef),FramedPageSchema,"The address of a page that draws an item's components one at a time, for a sandboxed frame (docs/design/components-everywhere.md): a deck's by the name its module gives it, a doc's by the reference its block writes. Its parent posts `{ type: \"component\", name, props, width, height, t }` and hears `component-ready`, or `error` with what went wrong."),"components/stills":s(e.strictObject({...VersionRef,components:e.array(e.strictObject({name:e.string(),props:e.record(e.string(),e.unknown()),width:e.number().positive(),height:e.number().positive(),t:e.number().nonnegative()})).min(1).max(COMPONENT_STILLS_MAX)}),e.strictObject({stills:e.array(e.strictObject({key:e.string(),url:e.url()}).nullable())}),"An item's components (a deck's, a doc's) drawn alone, transparent, as the render draws them: pictures kept by what they show, given as addresses."),"check/results":s(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":s(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":s(e.strictObject({item:t,versions:e.array(e.string()).optional(),types:e.array(e.string().min(1)).max(10).optional(),options:ExportOptionsSchema.optional()}),e.strictObject({job:ExportJobSchema}),"Exports an item (its versions, as file types) into .allyhub/out/; `export/changed` says how it goes."),"export/cancel":s(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":s(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":s(e.strictObject({path:t}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`).")},PROJECT_TOOL_SOURCES={"project/items":"project","project/file":"asleep","items/preview":"asleep","items/page":"asleep","work/add":"machine","components/list":"asleep","components/stage":"asleep","components/stills":"project","check/results":"project","check/run":"machine","export/start":"machine","export/cancel":"machine","export/list":"asleep","export/reveal":"machine"},AGENT_DOES={"project/items":{files:"allyhub.yaml"},"project/file":{files:"the project's files"},"items/preview":{command:"frames"},"items/page":{command:"frames"},"work/add":{files:"allyhub.yaml"},"components/list":{files:"the project's components (defineComponent)"},"components/stage":{command:"frames"},"components/stills":{command:"frames"},"check/results":{command:"inspect"},"check/run":{command:"check"},"export/start":{command:"render"},"export/cancel":{command:"render"},"export/list":{files:".allyhub/out/"},"export/reveal":{files:".allyhub/out/"}};export function toolSpec(r){return Object.hasOwn(PROJECT_TOOLS,r)?PROJECT_TOOLS[r]:void 0}export function toolCaller(r){return async(p,i,l)=>{const{result:m}=await p["tools/call"]({name:i,arguments:l}),a=r[i]?.result.safeParse(m);if(!a?.success)throw new f(b.internal,`The answer to the tool ${i} is not what the protocol says.`);return a.data}}export const TOOL_NOTIFICATIONS={"project/changed":o(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"items/changed":o(e.strictObject({item:t,paths:e.array(e.string())}),`One of an item's inputs changed (docs/design/item-files.md, "An item's inputs"): a file its build lists, or one its pages loaded.`),"check/changed":o(CheckStateSchema,"The check started, ended or failed."),"export/changed":o(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":o(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on."),"jobs/changed":o(e.strictObject({job:d,item:t}),"A job of the process the server runs in (docs/design/jobs.md: a website starting, an export) moved on, about a thing in this project: what the window lists, for the editor of that thing to show where the person waits on it.")};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{parseValue as
|
|
2
|
+
import{parseValue as y}from"numfmt";import{CellError as f,ERR as i,Matrix as h,numberText as M,readTyped as b}from"../values.js";const l=new Map,w=5e4;export function numberOfText(e){if(!/\d/u.test(e))return;if(l.has(e))return l.get(e);l.size>=w&&l.clear();const r=E(e);return l.set(e,r),r}function E(e){const r=b(e.trim());if(typeof r.value=="number")return r.value;if(e.trim()==="")return;const t=y(e);if(typeof t?.value=="number")return t.value;const n=/^(\s*\d{1,2})([A-Za-z]{3,}\s+\d{2,4}\s*)$/u.exec(e);if(!n)return;const o=y(`${n[1]??""} ${n[2]??""}`);return typeof o?.value=="number"?o.value:void 0}export function toNumber(e){return typeof e=="number"?e:e==null?0:typeof e=="boolean"?e?1:0:e instanceof f?e:numberOfText(e)??i.VALUE}export function toText(e){return typeof e=="string"?e:e==null?"":typeof e=="number"?M(e):typeof e=="boolean"?e?"TRUE":"FALSE":e}export function toBool(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(typeof e=="number")return e!==0;if(e instanceof f)return e;const r=e.trim().toUpperCase();return r==="TRUE"?!0:r==="FALSE"?!1:i.VALUE}const x=e=>typeof e=="number"?0:typeof e=="string"?1:2;export const sameNumber=(e,r)=>e===r?!0:Math.abs(e-r)>1e-13*Math.max(Math.abs(e),Math.abs(r))?!1:Number(e.toPrecision(15))===Number(r.toPrecision(15));export function compare(e,r){const t=e??(typeof r=="string"?"":typeof r=="boolean"?!1:0),n=r??(typeof e=="string"?"":typeof e=="boolean"?!1:0),o=x(t),c=x(n);if(o!==c)return o<c?-1:1;if(typeof t=="number"&&typeof n=="number")return sameNumber(t,n)?0:t<n?-1:1;if(typeof t=="string"&&typeof n=="string"){const a=t.toUpperCase(),u=n.toUpperCase();return a===u?0:a<u?-1:1}return t===n?0:t===!1?-1:1}export const finite=e=>Number.isFinite(e)?e:i.NUM;export function snap(e,r,t){return Math.abs(e)<=Math.max(Math.abs(r),Math.abs(t))*89e-17?0:e}export function arithmetic(e,r,t){const n=toNumber(r);if(n instanceof f)return n;const o=toNumber(t);if(o instanceof f)return o;switch(e){case"+":return finite(snap(n+o,n,o));case"-":return finite(snap(n-o,n,o));case"*":return finite(n*o);case"/":return o===0?i.DIV0:finite(n/o);default:return n===0&&o===0?i.NUM:n===0&&o<0?i.DIV0:finite(n**o)}}export function binary(e,r,t){if(r instanceof f)return r;if(t instanceof f)return t;switch(e){case"&":{const n=toText(r);if(n instanceof f)return n;const o=toText(t);return o instanceof f?o:`${n}${o}`}case"=":return compare(r,t)===0;case"<>":return compare(r,t)!==0;case"<":return compare(r,t)<0;case"<=":return compare(r,t)<=0;case">":return compare(r,t)>0;case">=":return compare(r,t)>=0;default:return arithmetic(e,r,t)}}export function mapBoth(e,r,t){const n=Math.max(e.rows,r.rows),o=Math.max(e.cols,r.cols),c=new Array(n*o),a=(u,s,d)=>{const p=u.rows===1?0:s,m=u.cols===1?0:d;return p<u.rows&&m<u.cols?u.at(p,m):void 0};for(let u=0;u<n;u++)for(let s=0;s<o;s++){const d=a(e,u,s),p=a(r,u,s);c[u*o+s]=d===void 0||p===void 0?i.NA:t(d,p)}return new h(n,o,c)}
|
|
@@ -63,6 +63,18 @@ export declare class Calc {
|
|
|
63
63
|
private lambdaSlots;
|
|
64
64
|
private readonly stack;
|
|
65
65
|
private readonly inCycle;
|
|
66
|
+
/**
|
|
67
|
+
* Cells the outermost compute set aside, each until one a read of it had
|
|
68
|
+
* to wait for is computed: read meanwhile, one is in a circular reference
|
|
69
|
+
* longer than the stack, as a cell on it would be.
|
|
70
|
+
*/
|
|
71
|
+
private readonly waiting;
|
|
72
|
+
/** The outermost compute's cells, each waiting for the next: the last is on the stack. */
|
|
73
|
+
private work;
|
|
74
|
+
/** What was on the stack when a cell of `work` was set aside: from it to the read that waits. */
|
|
75
|
+
private readonly unwound;
|
|
76
|
+
/** The cells of `work` whose cells a circular reference counted already: each is counted once. */
|
|
77
|
+
private readonly counted;
|
|
66
78
|
/** Cells around a circular reference a pass found, where the workbook iterates. */
|
|
67
79
|
private readonly looping;
|
|
68
80
|
/** The data tables' cells, by their formula; made when first asked. */
|