@allyhub/sdk 0.9.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 +16 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +3 -0
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
- package/dist/node_modules/@allyhub/chart/dist/chart.js +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/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +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/dist/schemas.d.ts +50 -0
- 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/dist/geometry/index.js +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/layout.d.ts +16 -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 +18 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
- 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 +15 -3
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
- package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +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/formula/ast.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -2
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/docs/README.md +4 -0
- package/docs/canvas.md +28 -0
- package/docs/defaults.md +30 -4
- package/docs/docs.md +10 -10
- package/docs/image.md +3 -3
- package/docs/linkedin.md +96 -0
- package/docs/reports.md +89 -0
- package/docs/scenery.md +3 -4
- package/docs/sheets.md +23 -6
- package/docs/slides.md +50 -4
- package/docs/speech.md +1 -1
- package/docs/x.md +73 -0
- package/package.json +1 -1
|
@@ -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()});
|
|
@@ -29,8 +29,8 @@ export declare const CHECK_STATES: readonly ["off", "waiting", "running", "done"
|
|
|
29
29
|
/** The check the server runs after edits, as it stands. */
|
|
30
30
|
export declare const CheckStateSchema: z.ZodObject<{
|
|
31
31
|
status: z.ZodEnum<{
|
|
32
|
-
failed: "failed";
|
|
33
32
|
off: "off";
|
|
33
|
+
failed: "failed";
|
|
34
34
|
running: "running";
|
|
35
35
|
done: "done";
|
|
36
36
|
waiting: "waiting";
|
|
@@ -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;
|
|
@@ -232,8 +239,8 @@ export declare const PROJECT_TOOLS: {
|
|
|
232
239
|
}, z.core.$strict>>;
|
|
233
240
|
readonly "check/results": MethodSpec<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
234
241
|
status: z.ZodEnum<{
|
|
235
|
-
failed: "failed";
|
|
236
242
|
off: "off";
|
|
243
|
+
failed: "failed";
|
|
237
244
|
running: "running";
|
|
238
245
|
done: "done";
|
|
239
246
|
waiting: "waiting";
|
|
@@ -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,10 +376,14 @@ 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
|
-
failed: "failed";
|
|
374
385
|
off: "off";
|
|
386
|
+
failed: "failed";
|
|
375
387
|
running: "running";
|
|
376
388
|
done: "done";
|
|
377
389
|
waiting: "waiting";
|
|
@@ -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.")};
|
|
@@ -11,9 +11,9 @@ export { AUTO_EXPOSURE_DEFAULTS, AUTOFOCUS_DEFAULTS, handheld, HANDHELD_DEFAULTS
|
|
|
11
11
|
export { bandNoise, gauss3, hash3, powerNoise, swellOf, unit3, type Band, type Slope, } from "./noise.js";
|
|
12
12
|
export { convexHull, floorRect, type Floor, type FloorRect } from "./hull.js";
|
|
13
13
|
export { solveCamera, SOLVE_DEFAULTS, SOLVE_PARAMS, type SolveLine, type SolveOptions, type SolveParam, type SolvePoint, type SolveResidual, type SolveResult, } from "./solve.js";
|
|
14
|
-
export { invert3, moireAt, moireBand, moireCamera, moireProblems, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type SensorOptions, } from "./moire.js";
|
|
14
|
+
export { invert3, moireAt, moireBand, moireCamera, moireProblems, screenGradeWeight, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type Grade, type SensorGrade, type SensorOptions, } from "./moire.js";
|
|
15
15
|
export { screenFocus, SCREEN_FOCUS_DEFAULTS, type ScreenFocus, type ScreenFocusOptions, } from "./screen-focus.js";
|
|
16
|
-
export { apply, homography, matrix3d, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
|
|
16
|
+
export { apply, homography, matrix3d, clipToFrame, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
|
|
17
17
|
export { AROUND_DEFAULTS, FLOOR_DEFAULTS, INVENTORY_FRAME, MAP_DEFAULTS, MAP_VIEWS, MEASURE_DEFAULTS, MOTION_DEFAULTS, SIDES, type AxisBox, type CameraClearance, type CameraSource, type Channel, type ClearAhead, type Contact, type FreeFloor, type Levels, type MeasureRequest, type MeasureResult, type MeshHealth, type Motion, type MotionRequest, type SeeRequest, type SeeResult, type SeeTile, type Sight, type Support, type DrawnCamera, type Footprint, type MapPath, type MapRequest, type MapResult, type MapView, type MapViewResult, type OwnBox, type PointRef, type PointsRequest, type Seen, type Side, type UprightBox, type ViewRequest, type ViewResult, type ViewTile, type ViewTileResult, type SceneryInventory, type SceneryLight, type SceneryObject, topObjects, } from "./report.js";
|
|
18
18
|
export { channel, motionOf, type CameraSample, type MotionNumbers, } from "./motion.js";
|
|
19
19
|
export { easeValue, timedNumber, type Ease, type NumberKey } from "./timing.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
|
|
2
|
+
export{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,screenGradeWeight,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,clipToFrame,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
|
|
@@ -22,19 +22,58 @@ export interface SensorOptions {
|
|
|
22
22
|
*/
|
|
23
23
|
distortion?: number;
|
|
24
24
|
/**
|
|
25
|
-
* How the phone grades what it films: the
|
|
26
|
-
*
|
|
25
|
+
* How the phone grades what it films, by what fills its frame: the room's
|
|
26
|
+
* grade, and as a screen comes to fill the frame, the grade it gives a lit
|
|
27
|
+
* screen (it exposes for the screen's light), eased between them frame by
|
|
28
|
+
* frame. On the scenery layer's picture alone, not on what is laid over
|
|
29
|
+
* it. null for no grade.
|
|
27
30
|
*/
|
|
28
|
-
grade?:
|
|
29
|
-
filter: string;
|
|
30
|
-
} | null;
|
|
31
|
+
grade?: SensorGrade | null;
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* A grade: the picture's brightness through a curve, every colour moved
|
|
35
|
+
* with it so hues stay (a grade of luma alone), then the colours' strength,
|
|
36
|
+
* a turn of their hue, and a white balance.
|
|
37
|
+
*/
|
|
38
|
+
export interface Grade {
|
|
39
|
+
/** [brightness in, brightness out] points, 0–1, from in 0 to in 1 in order, joined by straight lines. */
|
|
40
|
+
curve: [number, number][];
|
|
41
|
+
/** How strong the colours are after it (1: as they were; 0: grey). */
|
|
42
|
+
saturation?: number;
|
|
43
|
+
/** The colours' hue turned this many degrees. */
|
|
44
|
+
hue?: number;
|
|
45
|
+
/** Each channel's gain last, red, green and blue (a white balance; [1, 1, 1] none). */
|
|
46
|
+
balance?: [number, number, number];
|
|
47
|
+
}
|
|
48
|
+
/** How a phone grades what it films, by how much of its frame a screen fills (SensorOptions.grade). */
|
|
49
|
+
export interface SensorGrade {
|
|
50
|
+
/** What it films when no screen fills much of the frame: the room, a person. */
|
|
51
|
+
room: Grade;
|
|
52
|
+
/** A lit screen filmed close: the phone exposes for its light. */
|
|
53
|
+
screen: Grade;
|
|
54
|
+
/**
|
|
55
|
+
* The nearest screen's share of the frame where the room's grade starts
|
|
56
|
+
* to give way to the screen's, and where the screen's is whole (0–1).
|
|
57
|
+
*/
|
|
58
|
+
share: [number, number];
|
|
59
|
+
}
|
|
60
|
+
/** How much of the screen's grade a frame takes (0–1): eased between share[0] and share[1] of the frame filled. */
|
|
61
|
+
export declare function screenGradeWeight(share: number, [from, to]: readonly [number, number]): number;
|
|
32
62
|
/** A screen's physical pixels (screen({ pixels })). */
|
|
33
63
|
export interface PanelOptions {
|
|
34
64
|
/** Physical pixels per content pixel each way (a Retina laptop: 2). */
|
|
35
65
|
density?: number;
|
|
36
66
|
/** How much the dark lines between rows of pixels darken them (0–1). */
|
|
37
67
|
rows?: number;
|
|
68
|
+
/**
|
|
69
|
+
* The pixel mesh a phone's camera close to a screen shows (0–1, 0: none):
|
|
70
|
+
* a fine grid of faint dark lines, every three of the panel's pixels,
|
|
71
|
+
* drawn on the screen's picture. At a video's resolution the panel's own
|
|
72
|
+
* pixels are too fine to resolve (the moiré above is what is left of
|
|
73
|
+
* them), yet phone footage of a screen close up is never clean: this is
|
|
74
|
+
* that texture, as phone photos of a laptop's screen show it.
|
|
75
|
+
*/
|
|
76
|
+
mesh?: number;
|
|
38
77
|
}
|
|
39
78
|
export declare const SENSOR_DEFAULTS: {
|
|
40
79
|
photosites: number;
|
|
@@ -46,6 +85,7 @@ export declare const SENSOR_DEFAULTS: {
|
|
|
46
85
|
export declare const PANEL_DEFAULTS: {
|
|
47
86
|
density: number;
|
|
48
87
|
rows: number;
|
|
88
|
+
mesh: number;
|
|
49
89
|
};
|
|
50
90
|
/**
|
|
51
91
|
* The depth a stripe a third of a pixel wide gives its fundamental,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{blurDiameter as
|
|
2
|
+
import{blurDiameter as $}from"./camera.js";import{homography as z}from"./screen.js";export function screenGradeWeight(o,[e,s]){if(o<=e)return 0;if(o>=s)return 1;const t=(o-e)/(s-e);return t*t*(3-2*t)}function I(o,e){if(!o)return[`${e} is missing.`];const s=[],t=o.curve,u=n=>Number.isFinite(n)&&n>=0&&n<=1;(!Array.isArray(t)||t.length<2||t.some(n=>!u(n[0])||!u(n[1]))||t.some((n,i)=>i>0&&n[0]<=(t[i-1]?.[0]??-1))||t[0]?.[0]!==0||t[t.length-1]?.[0]!==1)&&s.push(`${e}.curve is [in, out] points from 0 to 1, in order, from in 0 to in 1.`),o.saturation!==void 0&&!(Number.isFinite(o.saturation)&&o.saturation>=0)&&s.push(`${e}.saturation is 0 or more, not ${String(o.saturation)}.`);const r=o.balance;return r!==void 0&&!(Array.isArray(r)&&r.length===3&&r.every(n=>Number.isFinite(n)&&n>=0&&n<=2))&&s.push(`${e}.balance is three gains from 0 to 2, red, green and blue.`),o.hue!==void 0&&!Number.isFinite(o.hue)&&s.push(`${e}.hue is a number of degrees, not ${String(o.hue)}.`),s}export const SENSOR_DEFAULTS={photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03},PANEL_DEFAULTS={density:2,rows:.15,mesh:.09},STRIPE_DEPTH=2*Math.sin(Math.PI/3)/(Math.PI/3)/2;const M=2*Math.PI,P=o=>Math.abs(o)<1e-6?1:Math.sin(Math.PI*o)/(Math.PI*o);function C(o,e){if(e===1){const s=Math.round(o[0]+o[1]),t=Math.round(o[0]-o[1]);return[(s+t)/2,(s-t)/2]}return[Math.round(2*o[0])/2,Math.round(2*o[1])/2]}const R={0:[0,0],1:[1,0],2:[1,1]};function A(o,e,s,t,u,r,n){return N(o,e,s,t,u,r,n).factor}function N(o,e,s,t,u,r,n){const i=r.pitch,c=[s[0]*i,s[1]*i],d=T(t,r),l=[d[0]/i,d[1]/i],f=C(c,o),p=R[o],a=[(c[0]-f[0])/i,(c[1]-f[1])/i],m=Math.hypot(a[0],a[1]);if(m>=.5)return{factor:1,depth:0,period:1/0};const S=c[0]*c[0]+c[1]*c[1],k=Math.exp(-2*Math.PI**2*r.lens**2*S),v=n/4,x=Math.exp(-2*Math.PI**2*v**2*(s[0]*s[0]+s[1]*s[1])),y=Math.abs(P(c[0])*P(c[1])),g=Math.abs(P(a[0])*P(a[1]))*(1-2*m),h=Math.min(1,r.strength*u*k*x*y*g),b=e-M*(f[0]*l[0]+f[1]*l[1])+M*(f[0]*p[0]+f[1]*p[1]);return{factor:1-h*(1-Math.cos(b))/2,depth:h,period:m>0?1/m:1/0}}function T(o,e){const{k1:s,centre:t,radius:u}=e.distortion,r=o[0]-t[0],n=o[1]-t[1],i=(r*r+n*n)/(u*u),c=1+s*i;return[t[0]+r*c,t[1]+n*c]}const E=[.299,.587,.114];export function moireAt(o,e,s){const t=o.inverse,[u,r]=s,n=(t[6]??0)*u+(t[7]??0)*r+(t[8]??1);if(n<=0)return;const i=((t[0]??0)*u+(t[1]??0)*r+(t[2]??0))/n,c=((t[3]??0)*u+(t[4]??0)*r+(t[5]??0))/n,[d,l]=o.size;if(i<0||c<0||i>d||c>l)return;const f=[((t[0]??0)-(t[6]??0)*i)/n,((t[1]??0)-(t[7]??0)*i)/n],p=[((t[3]??0)-(t[6]??0)*c)/n,((t[4]??0)-(t[7]??0)*c)/n],a=o.density,[m,S,k]=o.depth,v=m+S*i+k*c,x=e.blur?e.blur.k*Math.abs(v-e.blur.focus)/Math.max(v,e.blur.near):0,y=[a*f[0],a*f[1]],g=[a*p[0],a*p[1]],h=[1,1,1];for(const w of[0,1,2]){const D=A(w,M*(a*i-w/3),y,s,STRIPE_DEPTH,e,x),F=A(w,M*a*c,g,s,o.rows*STRIPE_DEPTH,e,x);h[w]=D*F}const b=E[0]*h[0]+E[1]*h[1]+E[2]*h[2];return[b+e.chroma*(h[0]-b),b+e.chroma*(h[1]-b),b+e.chroma*(h[2]-b)]}export function moireBand(o,e,s){const t=o.inverse,[u,r]=s,n=(t[6]??0)*u+(t[7]??0)*r+(t[8]??1);if(n<=0)return;const i=((t[0]??0)*u+(t[1]??0)*r+(t[2]??0))/n,c=((t[3]??0)*u+(t[4]??0)*r+(t[5]??0))/n,[d,l]=o.size;if(i<0||c<0||i>d||c>l)return;const f=[((t[0]??0)-(t[6]??0)*i)/n,((t[1]??0)-(t[7]??0)*i)/n],p=[((t[3]??0)-(t[6]??0)*c)/n,((t[4]??0)-(t[7]??0)*c)/n],a=o.density,[m,S,k]=o.depth,v=m+S*i+k*c,x=e.blur?e.blur.k*Math.abs(v-e.blur.focus)/Math.max(v,e.blur.near):0;let y={depth:0,period:1/0};for(const g of[0,1,2])for(const h of[N(g,M*(a*i-g/3),[a*f[0],a*f[1]],s,STRIPE_DEPTH,e,x),N(g,M*a*c,[a*p[0],a*p[1]],s,o.rows*STRIPE_DEPTH,e,x)])h.depth>y.depth&&(y={depth:h.depth,period:h.period});return y}export const MOIRE_SCREENS=4,MOIRE_GLSL=`#version 300 es
|
|
3
3
|
precision highp float;
|
|
4
4
|
#define SCREENS ${String(MOIRE_SCREENS)}
|
|
5
5
|
uniform int count;
|
|
@@ -90,4 +90,4 @@ void main() {
|
|
|
90
90
|
}
|
|
91
91
|
// Off every screen: nothing (premultiplied).
|
|
92
92
|
colour = on ? vec4(factor, 1.0) : vec4(0.0);
|
|
93
|
-
}`;export function invert3(o){const[
|
|
93
|
+
}`;export function invert3(o){const[e=0,s=0,t=0,u=0,r=0,n=0,i=0,c=0,d=1]=o,l=r*d-n*c,f=-(u*d-n*i),p=u*c-r*i,a=e*l+s*f+t*p;if(!(Math.abs(a)<1e-18))return[l/a,-(s*d-t*c)/a,(s*n-t*r)/a,f/a,(e*d-t*i)/a,-(e*n-t*u)/a,p/a,-(e*c-s*i)/a,(e*r-s*u)/a]}export function moireScreen(o){const[e,s]=o.size,t=z(e,s,o.quad),u=t?invert3(t):void 0;if(!u)return;const r=o.camera,n=f=>(f[0]-r.position[0])*r.forward[0]+(f[1]-r.position[1])*r.forward[1]+(f[2]-r.position[2])*r.forward[2],[i,c,,d]=o.corners,l=n(i);return{inverse:u,size:[e,s],density:o.panel?.density??PANEL_DEFAULTS.density,rows:o.panel?.rows??PANEL_DEFAULTS.rows,depth:[l,(n(c)-l)/e,(n(d)-l)/s]}}export function moireCamera(o,e,s,t={},u=[0,0]){const r=t.photosites??SENSOR_DEFAULTS.photosites,n={pitch:Math.max(e[0],e[1])/r,lens:t.lens??SENSOR_DEFAULTS.lens,strength:t.moire??SENSOR_DEFAULTS.moire,chroma:t.chroma??SENSOR_DEFAULTS.chroma,distortion:{k1:t.distortion??SENSOR_DEFAULTS.distortion,centre:[e[0]/2-u[0],e[1]/2-u[1]],radius:Math.hypot(e[0],e[1])/2}},i=o.dof;if(i){const c=2*i.focus,d=$(o,c,s)*Math.max(c,o.near)/Math.abs(c-i.focus);n.blur={k:d,focus:i.focus,near:o.near}}return n}export function moireProblems(o,e){const s=[],t=(n,i)=>{n!==void 0&&!(Number.isFinite(n)&&n>0)&&s.push(`${i} is a positive number, not ${String(n)}.`)};t(o?.photosites,"sensor.photosites"),t(o?.lens,"sensor.lens"),t(e?.density,"pixels.density");const u=(n,i,c)=>{n!==void 0&&!(Number.isFinite(n)&&n>=0&&n<=c)&&s.push(`${i} is from 0 to ${String(c)}, not ${String(n)}.`)};u(o?.moire,"sensor.moire",4),u(o?.chroma,"sensor.chroma",1),o?.distortion!==void 0&&!(Number.isFinite(o.distortion)&&Math.abs(o.distortion)<=.5)&&s.push(`sensor.distortion is from -0.5 to 0.5, not ${String(o.distortion)}.`),u(e?.rows,"pixels.rows",1),u(e?.mesh,"pixels.mesh",1);const r=o?.grade;if(r){s.push(...I(r.room,"sensor.grade.room")),s.push(...I(r.screen,"sensor.grade.screen"));const[n=Number.NaN,i=Number.NaN]=r.share;Number.isFinite(n)&&Number.isFinite(i)&&n>=0&&n<i&&i<=1||s.push("sensor.grade.share is [from, to], 0 ≤ from < to ≤ 1.")}return s}
|
|
@@ -19,9 +19,10 @@ export interface PhoneCamera {
|
|
|
19
19
|
* hand: a 26 mm lens on its 4:3 frame at f/8 equivalent (f/1.8 on its
|
|
20
20
|
* small sensor), a 12 MP sensor, a hand whose tremor its stabiliser mostly
|
|
21
21
|
* takes out, focus that hunts after a cut, a reframe or a jolt, exposure
|
|
22
|
-
* that follows a new framing late, and a grade
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* that follows a new framing late, and a grade by what fills the frame:
|
|
23
|
+
* a phone's gentle contrast and colour on a room, and as a screen comes to
|
|
24
|
+
* fill the frame, the phone exposing for its light (its white a neutral
|
|
25
|
+
* light grey, its middle tones much darker, its colours deep).
|
|
25
26
|
*/
|
|
26
27
|
export declare const PHONE_CAMERA: PhoneCamera;
|
|
27
28
|
/** Something with every field optional, all the way down. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export const PHONE_CAMERA={lens:{lens:26,lensFrame:"phone",aperture:8},sensor:{photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03,grade:{
|
|
2
|
+
export const PHONE_CAMERA={lens:{lens:26,lensFrame:"phone",aperture:8},sensor:{photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03,grade:{room:{curve:[[0,0],[.25,.21],[.5,.47],[.75,.78],[1,1]],saturation:1.08},screen:{curve:[[0,0],[.36,.1],[.51,.16],[.67,.46],[.8,.84],[1,1]],saturation:1.25,hue:5,balance:[1,.97,1]},share:[.5,.8]}},hand:{angle:.25,roll:.6,shift:.001,sway:.65,tremor:{angle:.1,frequency:8.5},drift:{angle:.15,shift:.001,period:8},stabilizer:{strength:.7,cutoff:1.5},autofocus:{},exposure:{}}};const s=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function i(e,r){if(!s(e)||!s(r))return r===void 0?e:r;const t={...e};for(const[n,o]of Object.entries(r))t[n]=o===void 0?e[n]:i(e[n],o);return t}export function phoneCamera(e={}){return i(PHONE_CAMERA,e)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{parseValue as
|
|
2
|
+
import{parseValue as x}from"numfmt";import{CellError as f,ERR as i,Matrix as h,numberText as M,readTyped as b}from"../values.js";const l=new Map,w=5e4;export function numberOfText(e){if(!/\d/u.test(e))return;if(l.has(e))return l.get(e);l.size>=w&&l.clear();const r=E(e);return l.set(e,r),r}function E(e){const r=b(e.trim());if(typeof r.value=="number")return r.value;if(e.trim()==="")return;const t=x(e);return typeof t?.value=="number"?t.value:void 0}export function toNumber(e){return typeof e=="number"?e:e==null?0:typeof e=="boolean"?e?1:0:e instanceof f?e:numberOfText(e)??i.VALUE}export function toText(e){return typeof e=="string"?e:e==null?"":typeof e=="number"?M(e):typeof e=="boolean"?e?"TRUE":"FALSE":e}export function toBool(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(typeof e=="number")return e!==0;if(e instanceof f)return e;const r=e.trim().toUpperCase();return r==="TRUE"?!0:r==="FALSE"?!1:i.VALUE}const y=e=>typeof e=="number"?0:typeof e=="string"?1:2;export const sameNumber=(e,r)=>e===r?!0:Math.abs(e-r)>1e-13*Math.max(Math.abs(e),Math.abs(r))?!1:Number(e.toPrecision(15))===Number(r.toPrecision(15));export function compare(e,r){const t=e??(typeof r=="string"?"":typeof r=="boolean"?!1:0),n=r??(typeof e=="string"?"":typeof e=="boolean"?!1:0),o=y(t),c=y(n);if(o!==c)return o<c?-1:1;if(typeof t=="number"&&typeof n=="number")return sameNumber(t,n)?0:t<n?-1:1;if(typeof t=="string"&&typeof n=="string"){const a=t.toUpperCase(),u=n.toUpperCase();return a===u?0:a<u?-1:1}return t===n?0:t===!1?-1:1}export const finite=e=>Number.isFinite(e)?e:i.NUM;export function snap(e,r,t){return Math.abs(e)<=Math.max(Math.abs(r),Math.abs(t))*89e-17?0:e}export function arithmetic(e,r,t){const n=toNumber(r);if(n instanceof f)return n;const o=toNumber(t);if(o instanceof f)return o;switch(e){case"+":return finite(snap(n+o,n,o));case"-":return finite(snap(n-o,n,o));case"*":return finite(n*o);case"/":return o===0?i.DIV0:finite(n/o);default:return n===0&&o===0?i.NUM:n===0&&o<0?i.DIV0:finite(n**o)}}export function binary(e,r,t){if(r instanceof f)return r;if(t instanceof f)return t;switch(e){case"&":{const n=toText(r);if(n instanceof f)return n;const o=toText(t);return o instanceof f?o:`${n}${o}`}case"=":return compare(r,t)===0;case"<>":return compare(r,t)!==0;case"<":return compare(r,t)<0;case"<=":return compare(r,t)<=0;case">":return compare(r,t)>0;case">=":return compare(r,t)>=0;default:return arithmetic(e,r,t)}}export function mapBoth(e,r,t){const n=Math.max(e.rows,r.rows),o=Math.max(e.cols,r.cols),c=new Array(n*o),a=(u,s,d)=>{const p=u.rows===1?0:s,m=u.cols===1?0:d;return p<u.rows&&m<u.cols?u.at(p,m):void 0};for(let u=0;u<n;u++)for(let s=0;s<o;s++){const d=a(e,u,s),p=a(r,u,s);c[u*o+s]=d===void 0||p===void 0?i.NA:t(d,p)}return new h(n,o,c)}
|
|
@@ -28,6 +28,20 @@ export interface CalcOptions {
|
|
|
28
28
|
* not change from one run to the next: mulberry32 over the seed's FNV-1a hash.
|
|
29
29
|
*/
|
|
30
30
|
export declare function seededRandom(seed: string): () => number;
|
|
31
|
+
/** Excel's own limits on iterative calculation, where a file's `iteration` names none. */
|
|
32
|
+
export declare const ITERATION_DEFAULTS: {
|
|
33
|
+
readonly max_iterations: 100;
|
|
34
|
+
readonly max_change: 0.001;
|
|
35
|
+
};
|
|
36
|
+
/** What the last iterative calculation did. */
|
|
37
|
+
export interface Iterated {
|
|
38
|
+
/** Formula cells computed each round: those around a circular reference and what reads them. */
|
|
39
|
+
cells: number;
|
|
40
|
+
/** Rounds computed, the one that found the circular reference first. */
|
|
41
|
+
iterations: number;
|
|
42
|
+
/** The most a value moved in the last round; Infinity where one changed kind (a number to an error). */
|
|
43
|
+
change: number;
|
|
44
|
+
}
|
|
31
45
|
/** A cell put in the workbook. */
|
|
32
46
|
export interface CellChange {
|
|
33
47
|
sheet: Worksheet;
|
|
@@ -40,11 +54,25 @@ export declare class Calc {
|
|
|
40
54
|
cycles: FormulaCell[][];
|
|
41
55
|
/** How many formula cells the last pass computed. */
|
|
42
56
|
computed: number;
|
|
57
|
+
/** The last iterative calculation, while the circular reference it worked out is there. */
|
|
58
|
+
iterated: Iterated | undefined;
|
|
43
59
|
readonly nowSerial: () => number;
|
|
44
60
|
readonly random: () => number;
|
|
45
61
|
private pass;
|
|
62
|
+
/** The slots LAMBDA calls under way take (LAMBDA_STACK). */
|
|
63
|
+
private lambdaSlots;
|
|
46
64
|
private readonly stack;
|
|
47
65
|
private readonly inCycle;
|
|
66
|
+
/** Cells around a circular reference a pass found, where the workbook iterates. */
|
|
67
|
+
private readonly looping;
|
|
68
|
+
/** The data tables' cells, by their formula; made when first asked. */
|
|
69
|
+
private tablesOf;
|
|
70
|
+
/** Working data tables out: what that computes does not do it again. */
|
|
71
|
+
private inTables;
|
|
72
|
+
/** The cells the last iterative calculation computed. */
|
|
73
|
+
private loop;
|
|
74
|
+
/** The cells around circular references iterative calculation worked out since the workbook was calculated. */
|
|
75
|
+
private readonly around;
|
|
48
76
|
private readonly namesAt;
|
|
49
77
|
/** Who reads whom: made the first time something changes. */
|
|
50
78
|
private readonly graph;
|
|
@@ -77,6 +105,8 @@ export declare class Calc {
|
|
|
77
105
|
filtered(sheet: Worksheet): ReadonlySet<number>;
|
|
78
106
|
/** Computes every formula. */
|
|
79
107
|
calculate(): this;
|
|
108
|
+
/** The workbook's iterative calculation's limits, when it iterates. */
|
|
109
|
+
private iteration;
|
|
80
110
|
/** What filters hide, from the rows computed; what leaves those out is computed again. */
|
|
81
111
|
private applyFilters;
|
|
82
112
|
/** The value at a place. */
|
|
@@ -88,6 +118,40 @@ export declare class Calc {
|
|
|
88
118
|
/** What was worked out over ranges that hold changed cells is worked out again. */
|
|
89
119
|
private forget;
|
|
90
120
|
private run;
|
|
121
|
+
/** Every data table's cells, by the formula they share. */
|
|
122
|
+
private tableCells;
|
|
123
|
+
/**
|
|
124
|
+
* Excel's data tables, once what they read is computed: each cell what the
|
|
125
|
+
* table's formula gives with its inputs set to the values of the cell's
|
|
126
|
+
* row and column, as Excel's what-if analysis works one out. Its inputs are
|
|
127
|
+
* set, the model computes what that touches (iterating where it does), and
|
|
128
|
+
* they are put back. A two-way table's formula is the cell above its left
|
|
129
|
+
* column; a one-way table's are its row above (a column input) or its
|
|
130
|
+
* column to the left (a row input).
|
|
131
|
+
*/
|
|
132
|
+
private tables;
|
|
133
|
+
/**
|
|
134
|
+
* LibreOffice's form of a data table, which it writes into the files it
|
|
135
|
+
* saves: TABLE(formula, input, its value[, input, its value]), as its
|
|
136
|
+
* MULTIPLE.OPERATIONS, each cell's references its own. Each cell is the
|
|
137
|
+
* formula's value with each input set to what the cell after it holds.
|
|
138
|
+
*/
|
|
139
|
+
private operations;
|
|
140
|
+
private table;
|
|
141
|
+
/**
|
|
142
|
+
* Excel's iterative calculation: the cells around a circular reference and
|
|
143
|
+
* what reads them computed again, round after round, each reading the
|
|
144
|
+
* latest value of every other, until none moves by the maximum change or
|
|
145
|
+
* the rounds run out. The round that found the circular reference is the
|
|
146
|
+
* first.
|
|
147
|
+
*/
|
|
148
|
+
private iterate;
|
|
149
|
+
/** Whether iterative calculation worked a cell out: its value is as close as the maximum change says. */
|
|
150
|
+
iterates(cell: FormulaCell): boolean;
|
|
151
|
+
/** The cells around circular references iterative calculation worked out: those whose start matters. */
|
|
152
|
+
circularCells(): readonly FormulaCell[];
|
|
153
|
+
/** Cells and what reads them, however far. */
|
|
154
|
+
private downstream;
|
|
91
155
|
/**
|
|
92
156
|
* What reads a spill's cells computed again until nothing moves: who reads
|
|
93
157
|
* a place does not say who spills into it, so a spill that came, went or
|
|
@@ -109,6 +173,12 @@ export declare class Calc {
|
|
|
109
173
|
private order;
|
|
110
174
|
/** The formula cells yet to compute that a cell reads. */
|
|
111
175
|
private pending;
|
|
176
|
+
/**
|
|
177
|
+
* A cell computed: inside another's computing, on the stack, until it is
|
|
178
|
+
* STACKED deep; outermost, from a list, each cell a read had to wait for
|
|
179
|
+
* first, then what read it again from the start.
|
|
180
|
+
*/
|
|
181
|
+
private computeNow;
|
|
112
182
|
private compute;
|
|
113
183
|
/** What a formula computed, in its cell and those it spills into. */
|
|
114
184
|
private settleResult;
|