@allyhub/sdk 0.10.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 +16 -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/dist/problem.d.ts +7 -0
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
- package/dist/node_modules/@allyhub/formats/dist/note-shape.js +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/dist/index.d.ts +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 +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +12 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +22 -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 +57 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +6 -0
- package/dist/node_modules/@allyhub/protocol/dist/editor.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/frame.d.ts +61 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -1
- 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/notes.d.ts +41 -3
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -4
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +12 -0
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -5
- 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/export.d.ts +0 -8
- package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.js +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/docs/README.md +2 -0
- package/docs/defaults.md +10 -2
- package/docs/docs.md +4 -4
- package/docs/image.md +3 -3
- package/docs/linkedin.md +96 -0
- package/docs/reports.md +89 -0
- package/docs/sheets.md +1 -1
- package/docs/x.md +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +0 -337
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +0 -2
|
@@ -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}`;
|
|
@@ -191,6 +191,7 @@ export declare const HOST_METHODS: {
|
|
|
191
191
|
width: z.ZodNumber;
|
|
192
192
|
height: z.ZodNumber;
|
|
193
193
|
}, z.core.$strict>>;
|
|
194
|
+
selection: z.ZodOptional<z.ZodBoolean>;
|
|
194
195
|
}, z.core.$strict>, z.ZodObject<{
|
|
195
196
|
begun: z.ZodBoolean;
|
|
196
197
|
}, z.core.$strict>>;
|
|
@@ -233,6 +234,10 @@ export declare const HOST_NOTIFICATIONS: {
|
|
|
233
234
|
readonly "project/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
234
235
|
revision: z.ZodInt;
|
|
235
236
|
}, z.core.$strict>>;
|
|
237
|
+
readonly "items/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
238
|
+
item: z.ZodString;
|
|
239
|
+
paths: z.ZodArray<z.ZodString>;
|
|
240
|
+
}, z.core.$strict>>;
|
|
236
241
|
readonly "check/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
237
242
|
status: z.ZodEnum<{
|
|
238
243
|
off: "off";
|
|
@@ -559,6 +564,7 @@ export declare const EDITOR_HOST_METHODS: {
|
|
|
559
564
|
width: z.ZodNumber;
|
|
560
565
|
height: z.ZodNumber;
|
|
561
566
|
}, z.core.$strict>>;
|
|
567
|
+
selection: z.ZodOptional<z.ZodBoolean>;
|
|
562
568
|
}, z.core.$strict>, z.ZodObject<{
|
|
563
569
|
begun: z.ZodBoolean;
|
|
564
570
|
}, 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 t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person
|
|
2
|
+
import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional(),selection:t.boolean().optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person pressed an Edit of the editor's own (a website's view, with no machine to run its server) on a read-only host (`readOnly`): the host wakes the machine that changes it; false where nothing does. Never sent for a key pressed in the item."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":n(HostContextSchema,"The language, theme or agent changed."),"editor/command":n(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...d,...p},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...m};
|
|
@@ -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)});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** What the window asks the page. */
|
|
3
3
|
export declare const FRAME_METHODS: {
|
|
4
|
-
readonly "note/hold": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
|
|
4
|
+
readonly "note/hold": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
|
|
5
|
+
selection: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
7
|
key: z.ZodString;
|
|
6
8
|
what: z.ZodString;
|
|
7
9
|
source: z.ZodOptional<z.ZodObject<{
|
|
@@ -9,6 +11,31 @@ export declare const FRAME_METHODS: {
|
|
|
9
11
|
line: z.ZodOptional<z.ZodInt>;
|
|
10
12
|
endLine: z.ZodOptional<z.ZodInt>;
|
|
11
13
|
}, z.core.$strict>>;
|
|
14
|
+
selected: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
element: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
line: z.ZodOptional<z.ZodInt>;
|
|
20
|
+
endLine: z.ZodOptional<z.ZodInt>;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
text: z.ZodOptional<z.ZodString>;
|
|
23
|
+
regions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
in: z.ZodString;
|
|
25
|
+
file: z.ZodOptional<z.ZodString>;
|
|
26
|
+
width: z.ZodNumber;
|
|
27
|
+
height: z.ZodNumber;
|
|
28
|
+
path: z.ZodString;
|
|
29
|
+
area: z.ZodBoolean;
|
|
30
|
+
scale: z.ZodNumber;
|
|
31
|
+
}, z.core.$strict>>>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
outline: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
34
|
+
x: z.ZodNumber;
|
|
35
|
+
y: z.ZodNumber;
|
|
36
|
+
}, z.core.$strict>>>;
|
|
37
|
+
where: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>>>;
|
|
12
39
|
}, z.core.$strict>>;
|
|
13
40
|
readonly "note/locate": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
|
|
14
41
|
shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -65,6 +92,38 @@ export declare const FRAME_METHODS: {
|
|
|
65
92
|
}, z.core.$strict>>;
|
|
66
93
|
where: z.ZodOptional<z.ZodString>;
|
|
67
94
|
}, z.core.$strict>>;
|
|
95
|
+
readonly "note/pick": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
|
|
96
|
+
at: z.ZodObject<{
|
|
97
|
+
x: z.ZodNumber;
|
|
98
|
+
y: z.ZodNumber;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
101
|
+
pick: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
element: z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
path: z.ZodString;
|
|
106
|
+
line: z.ZodOptional<z.ZodInt>;
|
|
107
|
+
endLine: z.ZodOptional<z.ZodInt>;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
text: z.ZodOptional<z.ZodString>;
|
|
110
|
+
regions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
111
|
+
in: z.ZodString;
|
|
112
|
+
file: z.ZodOptional<z.ZodString>;
|
|
113
|
+
width: z.ZodNumber;
|
|
114
|
+
height: z.ZodNumber;
|
|
115
|
+
path: z.ZodString;
|
|
116
|
+
area: z.ZodBoolean;
|
|
117
|
+
scale: z.ZodNumber;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
outline: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
121
|
+
x: z.ZodNumber;
|
|
122
|
+
y: z.ZodNumber;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
where: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
}, z.core.$strict>>;
|
|
68
127
|
readonly "note/pictures": import("./jsonrpc.js").MethodSpec<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
69
128
|
pictures: z.ZodArray<z.ZodObject<{
|
|
70
129
|
rect: z.ZodOptional<z.ZodObject<{
|
|
@@ -117,6 +176,7 @@ export declare const FRAME_NOTIFICATIONS: {
|
|
|
117
176
|
width: z.ZodNumber;
|
|
118
177
|
height: z.ZodNumber;
|
|
119
178
|
}, z.core.$strict>>;
|
|
179
|
+
selection: z.ZodOptional<z.ZodBoolean>;
|
|
120
180
|
}, z.core.$strict>>;
|
|
121
181
|
readonly "share/begin": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, z.core.$strict>>;
|
|
122
182
|
readonly "edit/request": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, 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{EDITOR_STATES as r,ExportStateSchema as
|
|
2
|
+
import{z as e}from"zod";import{EDITOR_STATES as r,ExportStateSchema as n,PlaceSchema as a}from"./editor.js";import{AgentHereSchema as h}from"./presence.js";import{PathSchema as c}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as d,NoteFoundSchema as p,NotePickSchema as s,NotePictureSchema as m,NotePointSchema as w,NoteRectSchema as i,NoteShapeSchema as l}from"./notes.js";export const FRAME_METHODS={"note/hold":o(e.strictObject({selection:e.boolean().optional()}),d.extend({selected:e.array(s).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:l}),p,"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:w}),e.strictObject({pick:s.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(m),uncovered:e.array(e.strictObject({name:e.string(),rect:i}))}),"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.")},FRAME_NOTIFICATIONS={"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:i.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:c,place:a}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"export/state":t(n,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(r),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(h,"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`.")};
|
|
@@ -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";
|
|
@@ -22,7 +24,6 @@ export * from "./sources.js";
|
|
|
22
24
|
export * from "./shares.js";
|
|
23
25
|
export * from "./account.js";
|
|
24
26
|
export * from "./open.js";
|
|
25
|
-
export * from "./browser-bridge.js";
|
|
26
27
|
export * from "./jobs.js";
|
|
27
28
|
export * from "./peer.js";
|
|
28
29
|
export * from "./shape.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"./
|
|
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>;
|