@allyhub/sdk 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/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 +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +4 -0
- 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/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 +0 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- 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/snapshots.d.ts +17 -0
- 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{
|
|
2
|
+
import{z as t}from"zod";import{insideOutline as i,mapOutline as n,mapShape as o,outlineBox as r,pointsOf as c,rectOutline as a,roundOutline as s,touches as m,turnedOutline as p}from"@allyhub/formats";import{PathSchema as e}from"./files.js";export const NoteRectSchema=t.strictObject({x:t.number(),y:t.number(),width:t.number().nonnegative(),height:t.number().nonnegative()}),NotePointSchema=t.strictObject({x:t.number(),y:t.number()}),NoteShapeSchema=t.discriminatedUnion("kind",[t.strictObject({kind:t.literal("box"),rect:NoteRectSchema}),t.strictObject({kind:t.literal("round"),rect:NoteRectSchema}),t.strictObject({kind:t.literal("arrow"),from:NotePointSchema,to:NotePointSchema}),t.strictObject({kind:t.literal("line"),points:t.array(NotePointSchema).min(1)})]);export{i as insideOutline,n as mapOutline,o as mapShape,r as outlineBox,c as pointsOf,a as rectOutline,s as roundOutline,m as touches,p as turnedOutline};export const NoteSourceSchema=t.strictObject({path:e,line:t.int().positive().optional(),endLine:t.int().positive().optional()}),HeldSchema=t.strictObject({key:t.string().min(1),what:t.string(),source:NoteSourceSchema.optional()}),NotePictureSchema=t.strictObject({rect:NoteRectSchema.optional(),mime:t.string().min(1),data:t.string().min(1)}),NoteRegionSchema=t.strictObject({in:t.string().min(1),file:e.optional(),width:t.number().positive(),height:t.number().positive(),path:t.string().min(1),area:t.boolean(),scale:t.number().positive()}),NoteElementSchema=t.strictObject({name:t.string().min(1),source:NoteSourceSchema.optional(),text:t.string().optional(),regions:t.array(NoteRegionSchema).optional()}),NoteFoundSchema=t.strictObject({elements:t.array(NoteElementSchema),where:t.string().optional()}),NotePickSchema=t.strictObject({element:NoteElementSchema,outline:t.array(t.array(NotePointSchema).min(3)).min(1),where:t.string().optional()});
|
|
@@ -229,6 +229,10 @@ export declare const KindSnapshotSchema: z.ZodObject<{
|
|
|
229
229
|
data: z.ZodArray<z.ZodString>;
|
|
230
230
|
}, z.core.$strip>>;
|
|
231
231
|
routes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
232
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
234
|
+
file: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
232
236
|
}, z.core.$strip>;
|
|
233
237
|
export type KindSnapshot = z.infer<typeof KindSnapshotSchema>;
|
|
234
238
|
/** An item's gallery preview in the tree: its `Preview` (a picture, words or rows), as JSON. */
|
|
@@ -414,9 +418,22 @@ export type SnapshotView = z.infer<typeof SnapshotViewSchema>;
|
|
|
414
418
|
/** A read view's paths besides the tree's. */
|
|
415
419
|
export declare const SNAPSHOT_VIEW: {
|
|
416
420
|
readonly manifest: "manifest.json";
|
|
421
|
+
/** The project's files as text, sandboxed: they run nothing. */
|
|
417
422
|
readonly files: "files/";
|
|
423
|
+
/**
|
|
424
|
+
* The project's files as an item's page loads them (`items/page`): each
|
|
425
|
+
* as its type, at an opaque origin, loading nothing but this view's own
|
|
426
|
+
* files (PAGE_CSP).
|
|
427
|
+
*/
|
|
428
|
+
readonly pages: "pages/";
|
|
418
429
|
readonly conversations: "conversations/";
|
|
419
430
|
};
|
|
431
|
+
/**
|
|
432
|
+
* An item's page as a read view serves it (`pages/`): sandboxed to an
|
|
433
|
+
* opaque origin, so it reaches nothing of the page that frames it, its
|
|
434
|
+
* scripts running, and loading nothing but its own view's files.
|
|
435
|
+
*/
|
|
436
|
+
export declare const PAGE_CSP: string;
|
|
420
437
|
/**
|
|
421
438
|
* The JSON-RPC error a read-only host answers for what needs the machine
|
|
422
439
|
* (a change, an export, a check run, the agent): the window offers to wake
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{STAGE_LOADS as b}from"@allyhub/formats";import{z as e}from"zod";import{BlobSchema as g,Sha256Schema as
|
|
2
|
+
import{STAGE_LOADS as b}from"@allyhub/formats";import{z as e}from"zod";import{BlobSchema as g,Sha256Schema as h,TreeFileSchema as S,TreePathSchema as d}from"./blobs.js";import{placeParams as $}from"./editor.js";import{known as w,openEnum as x,readable as E}from"./open.js";export const SNAPSHOT_FORMAT=1,ConversationEntrySchema=e.object({sessionId:e.string().min(1),agent:e.string().min(1),title:e.string().optional(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),transcript:h}),TranscriptSchema=e.object({sessionId:e.string().min(1),messages:e.array(e.object({method:e.string().min(1),params:e.unknown()}))}),SNAPSHOT_KINDS=["project","home"],StageFolderSchema=e.string().regex(/^[a-z][a-z0-9-]*\/$/u,"one lower-case word and /").refine(t=>!Object.values(SNAPSHOT_TREE).includes(t)&&!Object.values(SNAPSHOT_VIEW).includes(t),"a folder of the core's"),StageLoadSchema=x(b),StageRoutesSchema=e.record(e.string(),e.array(e.string()));const O=e.string().refine(t=>t.endsWith("/")&&d.safeParse(t.slice(0,-1)).success,"a folder of the tree, ending in /");export const ItemReachSchema=e.object({tree:e.array(d),files:e.array(d),own:e.record(d,S)}),SnapshotReachSchema=e.object({shared:e.array(O),items:e.record(e.string(),ItemReachSchema)}),SnapshotManifestSchema=e.object({format:e.literal(SNAPSHOT_FORMAT),kind:e.enum(SNAPSHOT_KINDS),project:e.object({name:e.string().min(1).max(255)}),host:e.object({version:e.string().min(1)}),madeAt:e.iso.datetime(),files:e.record(d,g),tree:e.record(d,S),conversations:e.array(ConversationEntrySchema),reach:SnapshotReachSchema.optional(),routes:StageRoutesSchema.optional()});export function scopedManifest(t,o){const s=t.reach,r=s!==void 0&&Object.hasOwn(s.items,o)?s.items[o]:void 0;if(s===void 0||r===void 0)return;const a={};for(const[n,c]of Object.entries(t.tree))s.shared.some(p=>n.startsWith(p))&&(a[n]=c);for(const n of r.tree){const c=Object.hasOwn(t.tree,n)?t.tree[n]:void 0;c!==void 0&&(a[n]=c)}Object.assign(a,r.own);const i={};for(const n of r.files){const c=Object.hasOwn(t.files,n)?t.files[n]:void 0;c!==void 0&&(i[n]=c)}return{format:t.format,kind:t.kind,project:t.project,host:t.host,madeAt:t.madeAt,files:i,tree:a,conversations:[],...t.routes===void 0?{}:{routes:t.routes}}}export const SNAPSHOT_SKIPPED=["node_modules",".allyhub/cache",".allyhub/out"],SNAPSHOT_TREE={editor:"editor/",runtime:"runtime/",build:"build/",media:"media/",matte:"matte/",stills:"stills/",answers:"answers/",previews:"previews/"};function l(t){return Array.isArray(t)?t.map(l):t!==null&&typeof t=="object"?Object.fromEntries(Object.keys(t).sort().map(o=>[o,l(t[o])])):t}export const snapshotAnswerPath=(t,o)=>`${SNAPSHOT_TREE.answers}${t}/${encodeURIComponent(JSON.stringify(l(o??{})))}.json`,RecordedAnswerSchema=e.object({result:e.unknown().optional(),error:e.object({code:e.number(),message:e.string(),data:e.unknown().optional()}).optional()}),recordedReadPath=(t,o)=>snapshotAnswerPath(t,Object.fromEntries(Object.entries(o??{}).filter(([s,r])=>s!=="folder"&&r!==void 0))),stillPath=t=>`${SNAPSHOT_TREE.stills}${t}.webp`,stillsIndexPath=(t,o)=>`${SNAPSHOT_TREE.stills}index/${encodeURIComponent(t)}/${encodeURIComponent(o)}.json`,StillsIndexSchema=e.object({stills:e.record(e.string(),e.string().regex(/^[0-9a-f]{64}$/u))}),stillsIndexKey=t=>JSON.stringify(l(t));const P=e.object({name:e.string(),props:e.record(e.string(),e.unknown()),width:e.number().positive(),height:e.number().positive(),t:e.number().nonnegative()});export const KindSnapshotSchema=e.object({stills:e.array(e.object({version:e.string(),components:e.array(P)})).optional(),shows:e.object({media:e.array(e.string()),data:e.array(e.string())}).optional(),routes:e.record(e.string(),e.array(e.string().min(1))).optional(),page:e.object({folder:e.string().optional(),file:e.string().optional()}).optional()}),snapshotPreviewPath=t=>`${SNAPSHOT_TREE.previews}${encodeURIComponent(t)}.json`,TREE_PAGES={stage:`${SNAPSHOT_TREE.runtime}stage.html`,viewer:`${SNAPSHOT_TREE.runtime}viewer.html`,probe:`${SNAPSHOT_TREE.runtime}probe.html`},pieceSourcePath=t=>`${SNAPSHOT_TREE.build}sources/${encodeURIComponent(t)}.json`,treeHref=t=>t.split("/").map(encodeURIComponent).join("/");export function stageCsp(t,o,s={}){const r=m=>`${t}${m}`,a=r(SNAPSHOT_TREE.runtime),i=r(SNAPSHOT_TREE.build),n=r(SNAPSHOT_TREE.media),c=r(SNAPSHOT_TREE.matte),p=m=>Object.entries(s).filter(([u,j])=>StageFolderSchema.safeParse(u).success&&j.some(f=>w(b,f)&&f===m)).map(([u])=>` ${r(u)}`).join("");return["default-src 'none'",`script-src 'unsafe-eval' 'wasm-unsafe-eval' ${a} ${i}${p("script")}`,"worker-src blob:",`style-src 'unsafe-inline' ${a} ${i}${p("style")}`,`font-src ${a} ${i} ${n}${p("font")} data:`,`img-src ${n} ${i}${p("img")} data: blob:`,`media-src ${n} ${c}${p("media")} blob:`,`connect-src ${n} ${c} ${i} ${a}${p("connect")} blob: data:`,`frame-ancestors ${o.length>0?o.join(" "):"'none'"}`].join("; ")}export function snapshotEditorUrl(t,o,s={}){const r=Object.entries({item:o,embed:"studio",snapshot:"1",...s.viewer===!0?{viewer:"1"}:{},...s.theme===void 0?{}:{theme:s.theme},...$(s.place)}).map(([a,i])=>`${a}=${encodeURIComponent(i)}`);return`${t.replace(/\/$/u,"")}/${SNAPSHOT_TREE.editor}?${r.join("&")}`}export const EXECUTOR_KINDS=["cloud","computer"],COMPUTER_HEADER="x-allyhub-computer",ComputerIdSchema=e.string().regex(/^[A-Za-z0-9_-]{16,64}$/u),WORKED_ELSEWHERE="worked_elsewhere",ExecutorSchema=e.object({kind:x(EXECUTOR_KINDS),here:e.boolean()}),SNAPSHOT_BLOBS_PATH="/api/snapshots/blobs",SNAPSHOTS_PATH="/api/snapshots",SnapshotCreateSchema=e.strictObject({project:e.strictObject({id:e.string().min(1).optional(),kind:e.enum(SNAPSHOT_KINDS),name:e.string().min(1).max(255)}),manifest:h}),SnapshotCreatedSchema=e.object({id:e.string().min(1),projectId:e.string().min(1)}),SnapshotMissingSchema=e.object({missing:e.array(h)}),PROJECTS_PATH="/api/projects",SnapshotInfoSchema=e.object({id:e.string().min(1),madeAt:e.iso.datetime(),hostVersion:e.string()}),ProjectInfoSchema=e.object({id:e.string().min(1),kind:e.enum(SNAPSHOT_KINDS),name:e.string(),latest:SnapshotInfoSchema.nullable(),executor:ExecutorSchema}),ProjectsResponseSchema=e.object({projects:E(ProjectInfoSchema)}),projectPath=t=>`${PROJECTS_PATH}/${encodeURIComponent(t)}`,projectExecutorPath=t=>`${projectPath(t)}/executor`,ExecutorMoveSchema=e.strictObject({kind:e.enum(EXECUTOR_KINDS)}),snapshotViewPath=t=>`${SNAPSHOTS_PATH}/${encodeURIComponent(t)}/view`,SnapshotViewSchema=e.object({origin:e.url(),expiresAt:e.iso.datetime()}),SNAPSHOT_VIEW={manifest:"manifest.json",files:"files/",pages:"pages/",conversations:"conversations/"},PAGE_CSP=["sandbox allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox","default-src 'self' data: blob:","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:","style-src 'self' 'unsafe-inline'","img-src 'self' data: blob:","font-src 'self' data:","connect-src 'self' data: blob:","media-src 'self' data: blob:"].join("; "),NEEDS_MACHINE=-32010,isNeedsMachine=t=>typeof t=="object"&&t!==null&&t.code===NEEDS_MACHINE,ELSEWHERE=-32011,CHANGED_HERE=-32012,MoveChangesSchema=e.object({changed:e.array(e.string())});
|
|
@@ -109,6 +109,13 @@ export declare const NDJSON = "application/x-ndjson";
|
|
|
109
109
|
* or the first time), its Host started. A step not needed is not said.
|
|
110
110
|
*/
|
|
111
111
|
export declare const STUDIO_OPEN_STEPS: readonly ["machine", "install", "start"];
|
|
112
|
+
/**
|
|
113
|
+
* The environment variable a cloud Studio's Host is started with: a value
|
|
114
|
+
* new to each start, which its `/health` says back as `start`, so its
|
|
115
|
+
* control plane knows the Host answering is the one it started (not one
|
|
116
|
+
* before it that did not stop). A Host older than it ignores it.
|
|
117
|
+
*/
|
|
118
|
+
export declare const STUDIO_START_ENV = "ALLYHUB_STUDIO_START";
|
|
112
119
|
export type StudioOpenStep = (typeof STUDIO_OPEN_STEPS)[number];
|
|
113
120
|
export declare const StudioOpenLineSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
114
121
|
step: z.ZodEnum<{
|
|
@@ -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 e}from"./open.js";export const ORGANIZATIONS_PATH="/api/organizations",OrganizationsSchema=t.object({organizations:t.array(t.object({id:t.string(),name:t.string(),slug:t.string(),role:t.string(),dissolvedAt:t.iso.datetime().nullable()}))}),MEMBERS_PATH="/api/organization/members",MembersSchema=t.object({members:t.array(t.object({userId:t.string(),email:t.string(),name:t.string(),role:t.string(),limit:t.number().nullable(),used:t.number()}))}),MemberLimitSchema=t.strictObject({monthly:t.number().nonnegative().nullable()}),ORGANIZATION_PATH="/api/organization",STUDIO_PATH="/api/studio",STUDIO_STATES=["running","paused"],StudioSchema=t.object({studio:t.object({state:e(STUDIO_STATES),organizationId:t.string()}).nullable(),creditsPerHour:t.number(),idle:t.object({minutes:t.number(),chosen:t.number().nullable(),min:t.number(),max:t.number()}).optional(),update:t.object({since:t.string(),by:t.string()}).optional()}),STUDIO_RESTART_PATH="/api/studio/restart",StudioSettingsSchema=t.strictObject({idleMinutes:t.number().int().nullable()}),STUDIO_POLICY_PATH="/api/organization/studio",StudioPolicySchema=t.strictObject({idleMaxMinutes:t.number().int().nullable()}),STUDIO_OPEN_PATH="/api/studio/open",STUDIO_OPEN_STAGES=["balance","hold","create","resume","health","release","install","start","charge","ticket"],StudioOpenStagesSchema=t.record(t.string(),t.number()),StudioOpenedSchema=t.object({origin:t.url(),ticket:t.string().min(1),stages:StudioOpenStagesSchema.optional()}),NDJSON="application/x-ndjson",STUDIO_OPEN_STEPS=["machine","install","start"],StudioOpenLineSchema=t.union([t.object({step:t.enum(STUDIO_OPEN_STEPS),first:t.boolean().optional()}),t.object({status:t.number(),error:t.object({code:t.string(),message:t.string(),data:t.record(t.string(),t.unknown()).optional()})}),StudioOpenedSchema]),STUDIO_TICKET_PATH="/api/studio/ticket",StudioTicketSchema=t.object({ticket:t.string().min(1)}),STUDIO_PREPARE_PATH="/api/studio/prepare",StudioPreparedSchema=t.object({prepared:t.boolean()}),STUDIO_PAUSE_PATH="/api/studio/pause",StudioPausedSchema=t.object({paused:t.boolean()}),STUDIO_WAKES_PATH="/api/studio/wakes",STUDIO_WAKE_OUTCOMES=["live","failed"],StudioWakeReportSchema=t.strictObject({outcome:t.enum(STUDIO_WAKE_OUTCOMES),error:t.string().max(500).optional(),server:StudioOpenStagesSchema.optional(),window:t.strictObject({open:t.number().optional(),connect:t.number().optional(),enter:t.number().optional(),total:t.number()}),first:t.boolean().optional()}),STUDIO_WAKE_PATH="/api/studio/wake",StudioWakeSchema=t.strictObject({at:t.iso.datetime().nullable()});
|
|
2
|
+
import{z as t}from"zod";import{openEnum as e}from"./open.js";export const ORGANIZATIONS_PATH="/api/organizations",OrganizationsSchema=t.object({organizations:t.array(t.object({id:t.string(),name:t.string(),slug:t.string(),role:t.string(),dissolvedAt:t.iso.datetime().nullable()}))}),MEMBERS_PATH="/api/organization/members",MembersSchema=t.object({members:t.array(t.object({userId:t.string(),email:t.string(),name:t.string(),role:t.string(),limit:t.number().nullable(),used:t.number()}))}),MemberLimitSchema=t.strictObject({monthly:t.number().nonnegative().nullable()}),ORGANIZATION_PATH="/api/organization",STUDIO_PATH="/api/studio",STUDIO_STATES=["running","paused"],StudioSchema=t.object({studio:t.object({state:e(STUDIO_STATES),organizationId:t.string()}).nullable(),creditsPerHour:t.number(),idle:t.object({minutes:t.number(),chosen:t.number().nullable(),min:t.number(),max:t.number()}).optional(),update:t.object({since:t.string(),by:t.string()}).optional()}),STUDIO_RESTART_PATH="/api/studio/restart",StudioSettingsSchema=t.strictObject({idleMinutes:t.number().int().nullable()}),STUDIO_POLICY_PATH="/api/organization/studio",StudioPolicySchema=t.strictObject({idleMaxMinutes:t.number().int().nullable()}),STUDIO_OPEN_PATH="/api/studio/open",STUDIO_OPEN_STAGES=["balance","hold","create","resume","health","release","install","start","charge","ticket"],StudioOpenStagesSchema=t.record(t.string(),t.number()),StudioOpenedSchema=t.object({origin:t.url(),ticket:t.string().min(1),stages:StudioOpenStagesSchema.optional()}),NDJSON="application/x-ndjson",STUDIO_OPEN_STEPS=["machine","install","start"],STUDIO_START_ENV="ALLYHUB_STUDIO_START",StudioOpenLineSchema=t.union([t.object({step:t.enum(STUDIO_OPEN_STEPS),first:t.boolean().optional()}),t.object({status:t.number(),error:t.object({code:t.string(),message:t.string(),data:t.record(t.string(),t.unknown()).optional()})}),StudioOpenedSchema]),STUDIO_TICKET_PATH="/api/studio/ticket",StudioTicketSchema=t.object({ticket:t.string().min(1)}),STUDIO_PREPARE_PATH="/api/studio/prepare",StudioPreparedSchema=t.object({prepared:t.boolean()}),STUDIO_PAUSE_PATH="/api/studio/pause",StudioPausedSchema=t.object({paused:t.boolean()}),STUDIO_WAKES_PATH="/api/studio/wakes",STUDIO_WAKE_OUTCOMES=["live","failed"],StudioWakeReportSchema=t.strictObject({outcome:t.enum(STUDIO_WAKE_OUTCOMES),error:t.string().max(500).optional(),server:StudioOpenStagesSchema.optional(),window:t.strictObject({open:t.number().optional(),connect:t.number().optional(),enter:t.number().optional(),total:t.number()}),first:t.boolean().optional()}),STUDIO_WAKE_PATH="/api/studio/wake",StudioWakeSchema=t.strictObject({at:t.iso.datetime().nullable()});
|
|
@@ -193,6 +193,13 @@ export declare const PROJECT_TOOLS: {
|
|
|
193
193
|
count: z.ZodInt;
|
|
194
194
|
}, z.core.$strict>], "type">>;
|
|
195
195
|
}, z.core.$strict>>;
|
|
196
|
+
readonly "items/page": MethodSpec<z.ZodObject<{
|
|
197
|
+
item: z.ZodString;
|
|
198
|
+
folder: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
|
|
199
|
+
file: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
201
|
+
url: z.ZodString;
|
|
202
|
+
}, z.core.$strict>>;
|
|
196
203
|
readonly "work/add": MethodSpec<z.ZodObject<{
|
|
197
204
|
kind: z.ZodString;
|
|
198
205
|
file: z.ZodString;
|
|
@@ -324,6 +331,7 @@ export type ProjectToolName = keyof typeof PROJECT_TOOLS;
|
|
|
324
331
|
export declare const PROJECT_TOOL_SOURCES: {
|
|
325
332
|
readonly "project/items": "project";
|
|
326
333
|
readonly "items/preview": "asleep";
|
|
334
|
+
readonly "items/page": "asleep";
|
|
327
335
|
readonly "work/add": "machine";
|
|
328
336
|
readonly "components/list": "asleep";
|
|
329
337
|
readonly "components/stage": "asleep";
|
|
@@ -368,6 +376,10 @@ export declare const TOOL_NOTIFICATIONS: {
|
|
|
368
376
|
readonly "project/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
369
377
|
revision: z.ZodInt;
|
|
370
378
|
}, z.core.$strict>>;
|
|
379
|
+
readonly "items/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
380
|
+
item: z.ZodString;
|
|
381
|
+
paths: z.ZodArray<z.ZodString>;
|
|
382
|
+
}, z.core.$strict>>;
|
|
371
383
|
readonly "check/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
372
384
|
status: z.ZodEnum<{
|
|
373
385
|
off: "off";
|
|
@@ -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
|
|
2
|
+
import{z as e}from"zod";import{FolderSchema as a,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as c}from"./kinds.js";import{RPC_ERROR as g,RpcError as b,method as s,notification as r}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:a,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(c.extend({id:e.string().min(1)})).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."),"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:a.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","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"},"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(o){return Object.hasOwn(PROJECT_TOOLS,o)?PROJECT_TOOLS[o]:void 0}export function toolCaller(o){return async(p,n,l)=>{const{result:m}=await p["tools/call"]({name:n,arguments:l}),i=o[n]?.result.safeParse(m);if(!i?.success)throw new b(g.internal,`The answer to the tool ${n} is not what the protocol says.`);return i.data}}export const TOOL_NOTIFICATIONS={"project/changed":r(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":r(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":r(CheckStateSchema,"The check started, ended or failed."),"export/changed":r(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":r(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on."),"jobs/changed":r(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,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"./browser-bridge": {
|
|
11
|
-
"types": "./dist/browser-bridge.d.ts",
|
|
12
|
-
"default": "./dist/browser-bridge.js"
|
|
13
9
|
}
|
|
14
10
|
},
|
|
15
11
|
"sideEffects": false,
|
|
@@ -19,14 +19,6 @@ export declare function csvText(value: Scalar, code: string | undefined, mode?:
|
|
|
19
19
|
export declare function dataValue(value: Scalar, code: string | undefined, mode?: ValueMode): string | number | boolean | null;
|
|
20
20
|
/** A sheet as CSV (RFC 4180: CRLF between records), from A1 to the last cell it uses. */
|
|
21
21
|
export declare function csvOf(calc: Calc, sheet: Worksheet, o?: CsvOptions): string;
|
|
22
|
-
/**
|
|
23
|
-
* A sheet as a Markdown table, its first row the head: values as their
|
|
24
|
-
* formats show them unless `values` is "data"; a column whose values are
|
|
25
|
-
* all numbers is aligned right.
|
|
26
|
-
*/
|
|
27
|
-
export declare function markdownOf(calc: Calc, sheet: Worksheet, o?: ValueOptions): string;
|
|
28
22
|
/** A table's computed rows, by header. */
|
|
29
23
|
export declare function tableRows(calc: Calc, table: Table, o?: ValueOptions): Record<string, string | number | boolean | null>[];
|
|
30
|
-
/** The workbook as data: each sheet's rows, each table's rows by header. */
|
|
31
|
-
export declare function jsonOf(calc: Calc, o?: ValueOptions): Record<string, unknown>;
|
|
32
24
|
//# sourceMappingURL=export.d.ts.map
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{writeCsv as
|
|
3
|
-
`,bom:r.bom??!0,finalNewline:!0})}
|
|
4
|
-
`)}
|
|
5
|
-
`}export function tableRows(t,n,r={}){const{sheet:o,at:e}=n,s=[];for(let i=0;i<n.rows;i++){const u={};for(const c of n.columns){const a=e.row+1+i,f=e.col+c.index;u[c.name]=dataValue(t.value(o,a,f),p(o,a,f),r.values)}s.push(u)}return s}export function jsonOf(t,n={}){const{wb:r}=t,o={};for(const e of r.sheets){const s={};for(const i of e.tables)s[i.name]=tableRows(t,i,n);o[e.name]={rows:g(e,(i,u)=>dataValue(t.value(e,i,u),p(e,i,u),n.values)),...e.tables.length>0?{tables:s}:{}}}return{...r.title===void 0?{}:{title:r.title},sheets:o}}
|
|
2
|
+
import{writeCsv as b}from"@allyhub/formats";import{isDateCode as x,shownValue as p}from"./format.js";import{CellError as h,dateOf as k}from"./values.js";const y=t=>(t.split(";")[0]??"").replace(/"[^"]*"|\\.|_.|\*./gu,"").replace(/\[(?![hms]+\])[^\]]*\]/giu,""),d=new Map;function $(t){if(t===void 0)return;if(d.has(t))return d.get(t);let n;if(x(t)){const r=y(t).toLowerCase(),e=/\[(h+|m+|s+)\]/u.test(r),o=[...r.matchAll(/\[?([ydhms])\1*\]?|am\/pm|a\/p/gu)].map(u=>u[0]);let s=!1,i=!1,f=!1;for(const[u,c]of o.entries()){const a=c.replace(/[[\]]/gu,"")[0];if(a==="y"||a==="d")s=!0;else if(a==="h"||c.includes("/"))i=!0;else if(a==="s")i=!0,f=!0;else if(a==="m"){const M=o[u-1]?.replace(/[[\]]/gu,"")[0],S=o[u+1]?.replace(/[[\]]/gu,"")[0];c.startsWith("[")||M==="h"||S==="s"?i=!0:s=!0}}e?n={kind:"duration",seconds:f}:s&&i?n={kind:"datetime",seconds:f}:i?n={kind:"time",seconds:f}:s&&(n={kind:"date",seconds:!1})}return d.set(t,n),n}const m=864e5,A=2958465,l=(t,n=2)=>String(t).padStart(n,"0");export const excelNumber=t=>t===0?0:Number(t.toPrecision(15));function g(t,n,r=2){const e=Math.floor(t/1e3),o=t%1e3;let s=`${l(Math.floor(e/3600),r)}:${l(Math.floor(e/60)%60)}`;return(n||e%60!==0||o!==0)&&(s+=`:${l(e%60)}`),o!==0&&(s+=`.${l(o,3).replace(/0+$/u,"")}`),s}function T(t){const n=t<0?"-":"";let r=Math.abs(t);const e=Math.floor(r/36e5);r-=e*36e5;const o=Math.floor(r/6e4);r-=o*6e4;const s=[e>0?`${String(e)}H`:"",o>0?`${String(o)}M`:"",r>0?`${String(r/1e3)}S`:""].join("");return`${n}PT${s||"0S"}`}function w(t,n,r){const e=Math.round(t*m);if(n.kind==="duration")return r==="json"?T(e):`${e<0?"-":""}${g(Math.abs(e),n.seconds,1)}`;if(t<0||t>=A+1)return;const o=Math.floor(e/m),s=g(e-o*m,n.seconds||r==="json");if(o===0||n.kind==="time")return s;if(o===60)return;const{year:i,month:f,day:u}=k(o),c=`${l(i,4)}-${l(f)}-${l(u)}`;return n.kind==="date"?c:`${c}${r==="json"?"T":" "}${s}`}export function csvText(t,n,r="data"){if(t===null)return"";if(r==="shown")return p(t,n);if(typeof t=="boolean")return t?"TRUE":"FALSE";if(t instanceof h)return t.code;if(typeof t=="string")return t;const e=$(n);return(e&&w(t,e,"csv"))??String(excelNumber(t))}export function dataValue(t,n,r="data"){if(t===null)return null;if(r==="shown")return p(t,n);if(t instanceof h)return t.code;if(typeof t!="number")return t;const e=$(n);return(e&&w(t,e,"json"))??excelNumber(t)}const _=(t,n,r)=>t.lookAt(n,r).format;function j(t,n){const r=t.used;if(!r)return[];const e=[];for(let o=0;o<=r.bottom;o++){const s=[];for(let i=0;i<=r.right;i++)s.push(n(o,i));e.push(s)}return e}export function csvOf(t,n,r={}){const e=j(n,(o,s)=>csvText(t.value(n,o,s),_(n,o,s),r.values));return b(e,{delimiter:",",newline:`\r
|
|
3
|
+
`,bom:r.bom??!0,finalNewline:!0})}export function tableRows(t,n,r={}){const{sheet:e,at:o}=n,s=[];for(let i=0;i<n.rows;i++){const f={};for(const u of n.columns){const c=o.row+1+i,a=o.col+u.index;f[u.name]=dataValue(t.value(e,c,a),_(e,c,a),r.values)}s.push(f)}return s}
|
|
@@ -19,7 +19,7 @@ export { analyse, type Analysis } from "./calc/analyse.js";
|
|
|
19
19
|
export { FUNCTIONS } from "./calc/functions/index.js";
|
|
20
20
|
export { Reference } from "./calc/types.js";
|
|
21
21
|
export { checkWorkbook, placeName, type CheckedWorkbook } from "./check.js";
|
|
22
|
-
export { csvOf, csvText, dataValue, excelNumber,
|
|
22
|
+
export { csvOf, csvText, dataValue, excelNumber, tableRows, type CsvOptions, type ValueMode, type ValueOptions, } from "./export.js";
|
|
23
23
|
export { generalForms, generalText, isDateCode, shownColor, shownValue, } from "./format.js";
|
|
24
24
|
export { DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT, headerFooterHtml, sheetHtml, SheetPrint, type PageFields, type PrintHtmlOptions, type SheetHtml, type SheetHtmlOptions, } from "./html.js";
|
|
25
25
|
export { PAPERS, PRINT_DEFAULTS, paginate, type PaginateOptions, type PrintJob, type PrintedPage, type SheetPages, } from "./paginate.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"./address.js";export{patchCsv}from"./patch.js";export{printedFacts,printedLines}from"./printed.js";export*from"./values.js";export*from"./workbook.js";export*from"./calc/remote.js";export*from"./calc/server.js";export{CODE as SHEET_CODE,ENTRY as SHEET_ENTRY,codeOf,dataFilesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,ITERATION_DEFAULTS,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,csvText,dataValue,excelNumber,
|
|
2
|
+
export*from"./address.js";export{patchCsv}from"./patch.js";export{printedFacts,printedLines}from"./printed.js";export*from"./values.js";export*from"./workbook.js";export*from"./calc/remote.js";export*from"./calc/server.js";export{CODE as SHEET_CODE,ENTRY as SHEET_ENTRY,codeOf,dataFilesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,ITERATION_DEFAULTS,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,csvText,dataValue,excelNumber,tableRows}from"./export.js";export{generalForms,generalText,isDateCode,shownColor,shownValue}from"./format.js";export{DEFAULT_COLUMN_WIDTH,DEFAULT_ROW_HEIGHT,headerFooterHtml,sheetHtml,SheetPrint}from"./html.js";export{PAPERS,PRINT_DEFAULTS,paginate}from"./paginate.js";export{DEFAULT_TABLE_STYLE,tableStyleLook,tableStyleOf}from"./table-style.js";export{PROFILE_TOP,profileTable}from"./profile.js";export{importRows}from"./import.js";export{patchYaml,writeYaml}from"./write.js";export*from"./edit.js";export*from"./arrange.js";export{NO_LOOK,autoFill,copyLooks,fillDownTo,moveCells,pasteLooks}from"./fill.js";export{seriesAfter}from"./series.js";export{compareForSort,hasHeader,sortCells,sortedOrder,sortedRows}from"./sort.js";export{filterChoices,filteredRows,regionAround}from"./filter.js";export{Rules,colorBetween,compareValues,holds,iconShape}from"./rules.js";export{choicesIn,invalidCells,joinChoices,listValues,separatorOf,valid}from"./validate.js";export{freeColumn,restructure,tableShape,uniqueColumn,withColumnsUpTo}from"./structure.js";export{SHEET_CHART_DEFAULTS,chartAfter,chartDataRange,chartDef,chartOfRange,chartPlace,chartSize,chartSvg,readDataRange}from"./chart.js";export{INSPECT_DEFAULTS,SHEET_FACT_KINDS,inspectWorkbook}from"./inspect.js";export{DIFF_DEFAULTS,diffWorkbooks}from"./diff.js";
|
package/docs/README.md
CHANGED
|
@@ -16,8 +16,10 @@ What a piece is written with, for the version of the SDK installed beside them.
|
|
|
16
16
|
- [scenery.md](scenery.md): 3D sceneries: `defineScenery()`, cameras and their moves, the hand that holds one, the `scenery()` layer and its screens.
|
|
17
17
|
- [modeling.md](modeling.md): a prop modelled in code with `@allyhub/model` and put in a scenery.
|
|
18
18
|
- [docs.md](docs.md): a doc, one MDX file: its title, the Markdown and tags it reads, pictures and links, check and render.
|
|
19
|
+
- [reports.md](reports.md): a report, one HTML file written freely: what it loads from the project, how it is drawn, its check, frames and render, report styles.
|
|
19
20
|
- [sheets.md](sheets.md): a sheet, a workbook as YAML and CSV: tables, formulas, names, checks, the openpyxl API (`@allyhub/sdk/sheets`), calc, trace and render.
|
|
20
21
|
- [canvas.md](canvas.md): a canvas, a JSON Canvas file laying a project's work out with notes, groups and edges.
|
|
21
22
|
- [x.md](x.md): an X post, thread or long post in POST /2/tweets's fields, and an X article in X's blocks: what X counts and refuses, and what they render to.
|
|
23
|
+
- [linkedin.md](linkedin.md): a LinkedIn post in the Posts API's fields (words, pictures, a video, a document or carousel, a poll, a link) and a LinkedIn article in LinkedIn's blocks: what LinkedIn counts and refuses, and what they render to.
|
|
22
24
|
- [websites.md](websites.md): a website, any web project with its JSON file: how Studio serves it while it is made (`PORT`, `HOST`, the preview hosts), a project's videos in its pages, its build.
|
|
23
25
|
- [defaults.md](defaults.md): every default of the piece API, generated from the code's constants, with the option that changes it.
|
package/docs/defaults.md
CHANGED
|
@@ -591,6 +591,15 @@ How `allyhub render` and an editor's Export encode an mp4 when nothing chooses o
|
|
|
591
591
|
| `height` | `1080` |
|
|
592
592
|
| `fps` | `30` |
|
|
593
593
|
|
|
594
|
+
### `GIF_ENCODE`
|
|
595
|
+
|
|
596
|
+
How `allyhub render` and an editor's Export make a GIF when nothing chooses otherwise: its width in pixels (its height in proportion) and its frames a second, each never more than the video's own. `--param gif-width`, `--param gif-fps` (0 for the video's own).
|
|
597
|
+
|
|
598
|
+
| Key | Value |
|
|
599
|
+
| --- | --- |
|
|
600
|
+
| `width` | `640` |
|
|
601
|
+
| `fps` | `15` |
|
|
602
|
+
|
|
594
603
|
### `MATTE_FEATHER`
|
|
595
604
|
|
|
596
605
|
The softness of the person's edge, px at 1080p. `footage({ background: { feather } })`.
|
|
@@ -793,12 +802,11 @@ Value: `16384`
|
|
|
793
802
|
|
|
794
803
|
### `IMAGE_EXPORT_DEFAULTS`
|
|
795
804
|
|
|
796
|
-
An image's files: JPEG's quality,
|
|
805
|
+
An image's files: JPEG's quality, 0–100; a WebP without one keeps every pixel. `allyhub render --param quality=…`. A board's picture's pixels per board pixel, from 0.25 to 4: `--param scale=…`, or `width=…` / `height=…` in pixels.
|
|
797
806
|
|
|
798
807
|
| Key | Value |
|
|
799
808
|
| --- | --- |
|
|
800
809
|
| `jpegQuality` | `90` |
|
|
801
|
-
| `avifQuality` | `60` |
|
|
802
810
|
| `scale` | `1` |
|
|
803
811
|
|
|
804
812
|
### `PSD_DEFAULTS`
|
package/docs/docs.md
CHANGED
|
@@ -205,7 +205,7 @@ As [](#sales) shows, revenue doubled; [](#costs) lists the costs.
|
|
|
205
205
|
|
|
206
206
|
### Citations
|
|
207
207
|
|
|
208
|
-
A citation is Pandoc's: `[@key]`, `[@a; @b]`, `[@key, p. 12]` in a line. Its sources are a CSL-JSON file (what Zotero, Mendeley and Pandoc export) the front matter's `bibliography` names, from the doc's folder. `<Bibliography />` on a line of its own is where they are listed; without it they are listed at the doc's end. `citation-style` is `apa` (the default: APA 7's author and year, `(Smith, 2019, p. 12)`, the list by author), `mla` (MLA 9's author and page, `(Smith 12)`, its Works Cited by author) or `gbt7714` (GB/T 7714's sources numbered in the order first cited, `[1]`, `[2-4]`). The list's heading is the doc's own (`## References`, `## Works Cited`). Only sources the doc cites are listed. The PDF
|
|
208
|
+
A citation is Pandoc's: `[@key]`, `[@a; @b]`, `[@key, p. 12]` in a line. Its sources are a CSL-JSON file (what Zotero, Mendeley and Pandoc export) the front matter's `bibliography` names, from the doc's folder. `<Bibliography />` on a line of its own is where they are listed; without it they are listed at the doc's end. `citation-style` is `apa` (the default: APA 7's author and year, `(Smith, 2019, p. 12)`, the list by author), `mla` (MLA 9's author and page, `(Smith 12)`, its Works Cited by author) or `gbt7714` (GB/T 7714's sources numbered in the order first cited, `[1]`, `[2-4]`). The list's heading is the doc's own (`## References`, `## Works Cited`). Only sources the doc cites are listed. The PDF and Word set them as text; the editor shows each as it prints. A key the file does not hold, a file that is not there or not CSL-JSON, and citations with no `bibliography` are AK-M008.
|
|
209
209
|
|
|
210
210
|
### Equations and diagrams
|
|
211
211
|
|
|
@@ -241,7 +241,7 @@ A figure drawn by code is a component (`defineComponent`, [layers.md](layers.md#
|
|
|
241
241
|
| `align` | `center` or `right` |
|
|
242
242
|
| any other | A prop, read by its type: a `number()` from its digits, a `boolean()` from `true` or `false`, a `list()` or `object()` from JSON, anything else as written |
|
|
243
243
|
|
|
244
|
-
It is drawn as a slide's component is, with the project's look (`var(--ak-color-*)`, `var(--ak-font-*)`, and the look's theme as `var(--ak-theme-*)`), its fonts and files. The editor draws it live, its props a field each when it is clicked; the PDF, Word
|
|
244
|
+
It is drawn as a slide's component is, with the project's look (`var(--ak-color-*)`, `var(--ak-font-*)`, and the look's theme as `var(--ak-theme-*)`), its fonts and files. The editor draws it live, its props a field each when it is clicked; the PDF, Word and a read view show a still of it, drawn once and kept by what it shows. A wrong module, export or prop is AK-M008 at its line; an exception in its code is AK-R001.
|
|
245
245
|
|
|
246
246
|
### Kept as written
|
|
247
247
|
|
|
@@ -273,7 +273,7 @@ captions: numbered
|
|
|
273
273
|
|
|
274
274
|
| Key | Means |
|
|
275
275
|
| --- | --- |
|
|
276
|
-
| `preset` | A convention that sets the keys below as it does; any key the doc writes wins over it. `
|
|
276
|
+
| `preset` | A convention that sets the keys below as it does; any key the doc writes wins over it. `brief`: a brief read on screen and on paper (its earlier name `report` is read as it) (the text 10.5 pt at 1.2 lines, 0.7 em after each paragraph, the title 24 pt, levels 1 and 2 at 18 and 14 pt with a hairline under them, level 3 at 11.5 pt), for figures (`<Stats>`), cards and tags. `apa`: APA 7's student paper (Letter at 1 in, Times 12 double-spaced, paragraphs set in 0.5 in with no space between them, the page number at the top right, the title and headings the text's size and bold, level 1 centred, levels 3 and 5 italic, APA citations). `mla`: MLA 9's paper (the same page; write the surname before the number: `header: { right: "Smith {page}" }`; the title centred and plain, MLA citations and Works Cited). `memo`: Purdue OWL's memo (Letter at 1 in, Times 12 single-spaced, paragraphs flush left with a blank line between them, the title and headings the text's size and bold, the page number at the foot's centre; write the heading block, TO, FROM, DATE and SUBJECT, yourself). `business-letter`: Purdue OWL's block-format letter (the same page, no running head or foot and no page numbers; the date, inside address, salutation and closing are your paragraphs) |
|
|
277
277
|
| `paper` | `Letter` (the default), `Legal`, `A4`, `A3`, `A5`, `B5`, or `[width, height]` in mm |
|
|
278
278
|
| `orientation` | `portrait` (the default) or `landscape` |
|
|
279
279
|
| `margins` | mm: one for all four, `[top and bottom, sides]`, or `[top, right, bottom, left]`; default 18 at the top and bottom, 20 at the sides |
|
|
@@ -306,4 +306,4 @@ Without front matter the page is Letter, sans, with the default accent and no co
|
|
|
306
306
|
- `allyhub check` reports AK-M008 for a doc whose file is not MDX, that holds what a doc does not draw (`{…}`, a tag inside a line other than the marks above, a wrong attribute or value), that shows a picture which is not in the project, that names a component which is not one or a prop it does not have, whose chart cannot be drawn from its numbers or whose equation is not TeX KaTeX reads, that cites a source its bibliography does not hold (or names a bibliography that is not CSL-JSON in the project); each problem has its file and line.
|
|
307
307
|
- `allyhub inspect pages <doc>` measures its pages as `allyhub render` prints them, from the PDF itself, and says the facts with their raw numbers (mm on the paper, each block by its line in the doc's file): the space left at each page's foot, each block broken over pages with its lines (a table's rows) on each and whether its head repeats, a heading near a page's foot with the lines after it on its page, a paragraph's short last line, content past the column and what is cut at the paper's edge, a line that starts or ends with a mark Chinese type keeps off it, each numbered figure's page and the pages that name it, the text as a grid, and whether the contents' page numbers held. It draws the pages too, each block outlined and labelled by its line, the space at each foot shaded (`.allyhub/work/inspect/<place>/pages.webp`). They are facts, never problems: where a page breaks well is yours to judge. `--heading-lines` and `--short-line` say what is listed, `--all` lists every heading and last line.
|
|
308
308
|
- `allyhub frames <doc>` draws its pages as `allyhub render` prints them, its components drawn first (the PDF printed and thrown away, each page drawn), tiled on one picture under `.allyhub/work/frames/<place>/`, and says how many pages there are and on what paper; `--page 2-3` draws those pages large. It is how to look at a doc and fit it to a length, and nothing is written to `.allyhub/out/`.
|
|
309
|
-
- `allyhub render` prints each doc under `.allyhub/out/`, by its id, as `plan.pdf`; `--type png` writes a picture of the whole page (`plan.png`), `--type docx` a Word document (`plan.docx`: its text and its charts editable, a picture Word cannot show as a JPEG, an equation and a diagram as pictures), `--type
|
|
309
|
+
- `allyhub render` prints each doc under `.allyhub/out/`, by its id, as `plan.pdf`; `--type png` writes a picture of the whole page (`plan.png`), `--type docx` a Word document (`plan.docx`: its text and its charts editable, a picture Word cannot show as a JPEG, an equation and a diagram as pictures), and `--type pdf,docx,png` all of them. There is no Markdown: the doc's MDX is its text. With a PDF or a Word document it says how the pages printed: how many, the share of each page's text area left empty at its foot, the blocks broken over pages (a Word document alone is printed once to measure it); `allyhub inspect pages` has every fact. A doc with a problem is not rendered: the command fails and says why. `allyhub help render` has every option.
|
package/docs/image.md
CHANGED
|
@@ -59,7 +59,7 @@ A picture a board starts from is never changed: a pixel edit (a matte, a part re
|
|
|
59
59
|
| `script` | a path with `{locale}` | none | Its script, from the module's folder, with `{locale}` once in its name for each language (`./friends.{locale}.yaml`) |
|
|
60
60
|
| `matrix` | `Matrix` | the project's languages and its script's | Dimensions and slots, as a video's ([batches.md](batches.md)): each combo is a set of the boards |
|
|
61
61
|
| `id`, `title`, `meta` | | its module's file without its extension; the script's `title` | As a video's |
|
|
62
|
-
| `transparent` | `boolean` | `false` | No background: PNG
|
|
62
|
+
| `transparent` | `boolean` | `false` | No background: PNG and WebP keep the alpha channel |
|
|
63
63
|
|
|
64
64
|
## `board()`
|
|
65
65
|
|
|
@@ -141,9 +141,9 @@ An image's viewer shows every board of every version, each drawn live, to zoom,
|
|
|
141
141
|
- `allyhub check` reports what cannot be drawn: a size that does not exist (AK-I001), a name used twice (AK-I002), a layer without a name (AK-I003), an image with no boards (AK-I005), what Chrome cannot draw exactly (AK-I007), and what any version reports: a picture that does not load (AK-A005), a fallback font (AK-L006), text the board's edge cuts (AK-L002), a board drawn differently in order and out of order (AK-D002).
|
|
142
142
|
- `allyhub frames <image>` draws every board on one sheet, each named by its key and size; `--part <key>` one board at its own size.
|
|
143
143
|
- `allyhub inspect <image>` gives `board` (each board's size and where it came from), `board-consistency` (a named layer's box, cap height and colour on every board that has it, and their spread, ΔE in OKLab), `picture-scale` (a picture's source pixels against the board pixels they fill), `overset` (a type layer's words its paragraph box does not hold: its lines and characters and those past the box's bottom, how far past; the box does not cut them, so this is a fact, not a rule), `generated`, `text-contrast` and the layout facts of one frame for each board.
|
|
144
|
-
- `allyhub render <image>` makes a PNG a board (`<item>.<combo>/<key>.png`); `--type jpeg
|
|
144
|
+
- `allyhub render <image>` makes a PNG a board (`<item>.<combo>/<key>.png`); `--type jpeg` and `webp` the same in those; `pdf` one file, a page a board at its own size, its text as text; `zip` the set, each board a PNG. `--param quality=…` (0–100) sets JPEG and WebP quality ([defaults.md](defaults.md)); `psd` a layered Photoshop file a board (below).
|
|
145
145
|
- A board's picture larger or smaller than the board, its layout kept: `--param scale=2` (0.25 to 4), or `width=…` or `height=…` in pixels (the other side in proportion, a scale for each board). Chrome draws it at that scale, so type and shapes are sharp; a picture has only the pixels its file has (`picture-scale` in `allyhub inspect`). A picture is at most 16384 px a side. A board of another shape is another board, in the code.
|
|
146
|
-
- `--param max-kb=…` keeps each board's JPEG
|
|
146
|
+
- `--param max-kb=…` keeps each board's JPEG or WebP at most that many KB, at the best quality under it, which the render says (`chosen`); one that is over it at every quality, or a PNG over it (a PNG keeps every pixel), is not made, and the render says why.
|
|
147
147
|
|
|
148
148
|
## PSD: out and in
|
|
149
149
|
|
package/docs/linkedin.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# LinkedIn posts and articles
|
|
2
|
+
|
|
3
|
+
Two kinds in LinkedIn's own model, each a file listed in `allyhub.yaml` ([project.md](project.md#items)): a `linkedin-post` and a `linkedin-article`.
|
|
4
|
+
|
|
5
|
+
## A LinkedIn post
|
|
6
|
+
|
|
7
|
+
A `linkedin-post` is a YAML file (`- { kind: linkedin-post, file: launch/post.yaml }`). Its fields are the Posts API's own (`POST /rest/posts`):
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
commentary: |
|
|
11
|
+
We shipped the new editor.
|
|
12
|
+
|
|
13
|
+
#launch
|
|
14
|
+
visibility: PUBLIC # or CONNECTIONS
|
|
15
|
+
content:
|
|
16
|
+
media: { file: ./carousel.ts, title: What changed } # a picture, a video or a document
|
|
17
|
+
isReshareDisabledByAuthor: false
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`content` is one of these, or none (a post of words alone):
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
content:
|
|
24
|
+
media: { file: ./demo.mp4, title: The demo } # one picture (altText), one video, or one document (title)
|
|
25
|
+
---
|
|
26
|
+
content:
|
|
27
|
+
multiImage:
|
|
28
|
+
images: # 2 to 20 pictures
|
|
29
|
+
- { file: ./a.png, altText: The editor. }
|
|
30
|
+
- { file: ./shots.ts#chart, altText: The chart. }
|
|
31
|
+
---
|
|
32
|
+
content:
|
|
33
|
+
poll:
|
|
34
|
+
question: Which do you use?
|
|
35
|
+
options: [{ text: Light }, { text: Dark }]
|
|
36
|
+
settings: { duration: SEVEN_DAYS } # ONE_DAY, THREE_DAYS, SEVEN_DAYS (the default, as LinkedIn's composer) or FOURTEEN_DAYS
|
|
37
|
+
---
|
|
38
|
+
content:
|
|
39
|
+
article: # a link's card: LinkedIn fetches nothing through the API, so its fields are set here
|
|
40
|
+
source: https://allyhub.com/blog/editor
|
|
41
|
+
title: The new editor
|
|
42
|
+
description: How we rebuilt it.
|
|
43
|
+
thumbnail: ./card.png
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- **Length is LinkedIn's composer's count**: UTF-16 units, so an emoji is 2, a CJK character 1 and a line break 1. At most 3,000 (measured on linkedin.com; the API states none).
|
|
47
|
+
- **"… more"**: the feed shows a post's first three lines (14 on 20 px, a 526 px column, its line breaks kept) and folds the rest. "… more" goes right after the last word on those lines that leaves room for it, and the fold moves up to that word's line: a post whose third line is blank shows two lines, and one when its second is blank too. Characters do not decide it: a post of short lines folds sooner than 200 characters, one of long lines later. (From LinkedIn's feed code, checked on 107 posts; an ad folds the same way from two lines.) On a phone's width the rule is the same and the column narrower (the screen less 26 px: 364 px on a 390 px phone), so a post folds sooner in its words. `allyhub frames` draws the post folded on a computer (`feed`, 552 px), on a phone (`phone`, 390 px) and opened (`open`); the fold is drawn in Inter, near LinkedIn's face, not identical to it, so it can land a word earlier or later on a reader's screen. LinkedIn's phone apps were not measured and may fold elsewhere.
|
|
48
|
+
- **Plain text.** A post holds no bold or italics. `#word` is a hashtag. A mention needs a member's or a page's URN, so it waits for a connected account.
|
|
49
|
+
- **The commentary as a block (`|`) or in quotes** when it holds ` #` (YAML reads the rest of the line as a comment), starts with `#`, `@` or a quote, or holds `: `. The line break a block ends in is not posted.
|
|
50
|
+
- **Media**: a picture is JPG, PNG or GIF, under 36,152,320 pixels, its alt text at most 4,086 characters; a video is MP4, 3 seconds to 30 minutes, 75 KB to 5 GB; a document is PDF, PPT, PPTX, DOC or DOCX, at most 100 MB and 300 pages (its pages are not counted here). LinkedIn publishes no picture size, crop or safe area.
|
|
51
|
+
- **A carousel** is a document: `media: { file: ./carousel.ts, title: … }` names an image whose boards are its pages, made as one PDF when the post is rendered; a deck (`../q3.ts`) is made as its PDF. A board (`./shots.ts#hero`) is a picture; a video item's file is its first version. Its bytes are checked when it is made.
|
|
52
|
+
|
|
53
|
+
## A LinkedIn article
|
|
54
|
+
|
|
55
|
+
A `linkedin-article` is a Markdown file (`- { kind: linkedin-article, file: launch/story.md }`), its title and cover in its front matter, its body in LinkedIn's article blocks alone:
|
|
56
|
+
|
|
57
|
+
````markdown
|
|
58
|
+
---
|
|
59
|
+
title: Why we rebuilt the editor
|
|
60
|
+
cover: ./cover.png # a picture or a video, or another item's (./shots.ts#cover); or { file, alt }
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
Paragraphs with **bold**, _italic_ and [links](https://example.com).
|
|
64
|
+
|
|
65
|
+
# A Heading
|
|
66
|
+
|
|
67
|
+
## A Subheading
|
|
68
|
+
|
|
69
|
+
- a list, one level deep
|
|
70
|
+
|
|
71
|
+
1. or numbered
|
|
72
|
+
|
|
73
|
+
> A quote.
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
a code snippet
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+

|
|
82
|
+
|
|
83
|
+
https://www.youtube.com/watch?v=…
|
|
84
|
+
|
|
85
|
+
<br />
|
|
86
|
+
````
|
|
87
|
+
|
|
88
|
+
- **Each element is one of LinkedIn's blocks** (its editor's: Normal, Heading, Subheading, bold, italic, link, bulleted and numbered lists, quote, code snippet, divider, image with its caption, embed): an address alone on its line is an embed; `<br />` alone on a line is an empty line. A third level of heading, a list inside a list, a table, an equation, inline code, strikethrough, a footnote, a picture inside a line and other HTML are not: each is a problem at its line.
|
|
89
|
+
- **Pictures** are JPG, PNG or GIF; a video goes in as an embed (its address). The cover is a picture or a video. LinkedIn publishes no most for a title or a body.
|
|
90
|
+
- **LinkedIn has no API that publishes an article.** It is pasted into LinkedIn's editor: the article editor's Copy for LinkedIn copies the body, pasted into the empty body there, and the title is typed in its own field. Every block comes through as LinkedIn's own (measured on linkedin.com) but two: pictures are added there by hand, and an embed arrives as its link, made a player with LinkedIn's Embed.
|
|
91
|
+
|
|
92
|
+
## Check, measure and render
|
|
93
|
+
|
|
94
|
+
`allyhub check` reports what LinkedIn refuses under `allyhub.linkedin/…`, at its line. `allyhub inspect <post>` gives the commentary's characters beside 3,000, its lines, hashtags and links, and its media's bytes and alt text; `allyhub inspect <article>` its title, words, headings, pictures and embeds. `allyhub frames` draws a post as the feed shows it (`feed`, folded; `open`) and an article as its page does (`article`), in Inter in place of the system face LinkedIn draws in; an embed and a link's card are drawn by their address.
|
|
95
|
+
|
|
96
|
+
`allyhub render <post>` writes the Posts API's request (`post.json`: the commentary in LinkedIn's little text, each medium beside it with the API it goes up by and the placeholder its id fills), or what a person posts by hand (`--type txt`: `post.txt`, the commentary as written, each medium beside it and its alt text in `<name>.alt.txt`). `allyhub render <article>` writes `article.html` with its pictures beside it. The editor's Export offers `txt` and a picture of the post (`png`); the request waits for publishing. Publishing to LinkedIn is not built.
|