@allyhub/sdk 0.13.0 → 0.15.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 +14 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/files.d.ts +9 -2
- package/dist/node_modules/@allyhub/formats/dist/files.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +9 -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/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +36 -0
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/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 +0 -1
- package/package.json +1 -1
- package/docs/reports.md +0 -89
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Feature highlights from each AllyHub release.
|
|
4
4
|
|
|
5
|
+
## 0.15.0
|
|
6
|
+
|
|
7
|
+
- **Reports are set aside.** AllyHub no longer makes reports, and `allyhub report style` is gone. Write a page of findings as a doc, a sheet or a deck instead.
|
|
8
|
+
|
|
9
|
+
## 0.14.1
|
|
10
|
+
|
|
11
|
+
- **Plain files read better.** Notes and plain text read as a page, ⌘F is a find bar with replace, and a PDF opens with its pages one under another.
|
|
12
|
+
- **The right viewer whatever a name's case**, and a file that cannot be shown as text, or is too large, says so instead of being read.
|
|
13
|
+
|
|
14
|
+
## 0.14.0
|
|
15
|
+
|
|
16
|
+
- **Any file opens.** A note, data, a config, a log, subtitles or a loose picture, video or sound opens as text or media, edited by hand beside the agent and marked up like any other work. The agent can show any file, listed in the project or not.
|
|
17
|
+
- **A cloud Studio wakes in place on the web.** The page you were on stays as the Studio wakes, instead of loading again.
|
|
18
|
+
|
|
5
19
|
## 0.13.0
|
|
6
20
|
|
|
7
21
|
- **Decks and sheets work like PowerPoint and Excel.** The deck editor has PowerPoint's ribbon and every animation effect; the sheet editor has Excel's everyday commands, from filters by colour to Paste Special, and rich text in a cell. An export says what it leaves out.
|
|
@@ -17,6 +17,12 @@ export interface FileEditorSpec {
|
|
|
17
17
|
readonly icon?: string | undefined;
|
|
18
18
|
/** Its colour, a token of the UI kit's. */
|
|
19
19
|
readonly color?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Whether it opens the files its patterns match by default, or only when
|
|
22
|
+
* no default editor's do (VS Code's "Reopen With"): a text editor of any
|
|
23
|
+
* file opens a canvas only when asked; none is `default`.
|
|
24
|
+
*/
|
|
25
|
+
readonly priority?: "default" | "option" | undefined;
|
|
20
26
|
/**
|
|
21
27
|
* Its check module, where the check imports it from (its contribution's
|
|
22
28
|
* `check`, resolved against its extension's folder): its default export
|
|
@@ -37,10 +43,11 @@ export interface EditorFile {
|
|
|
37
43
|
* A glob pattern as a test of project paths, as VS Code's file patterns
|
|
38
44
|
* read: `*` is any run of characters but `/`, `?` one of them, `**` any
|
|
39
45
|
* run of folders (none among them), `{a,b}` either; a pattern with no `/`
|
|
40
|
-
* matches a file's name in any folder (`*.canvas` as `**\/*.canvas`)
|
|
46
|
+
* matches a file's name in any folder (`*.canvas` as `**\/*.canvas`);
|
|
47
|
+
* whatever the case of its letters.
|
|
41
48
|
*/
|
|
42
49
|
export declare function globTest(pattern: string): (path: string) => boolean;
|
|
43
|
-
/** The editor that opens a project path by its name, in a table: the first whose pattern matches. */
|
|
50
|
+
/** The editor that opens a project path by its name, in a table: the first whose pattern matches, an editor of its files by default before one that opens them only when asked. */
|
|
44
51
|
export declare function fileEditorIn(table: FileEditorTable, path: string): FileEditorSpec | undefined;
|
|
45
52
|
/**
|
|
46
53
|
* The files of a project the editors of `table` open by their names, in
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{unscanned as
|
|
2
|
+
import{unscanned as u}from"./layout.js";const l=/[.+^${}()|[\]\\]/gu;export function globTest(i){const e=i.includes("/")?i:`**/${i}`;let s="";for(let t=0;t<e.length;t++){const o=e.charAt(t);if(o==="*"&&e.charAt(t+1)==="*"){const n=e.charAt(t+2)==="/";s+=n?"(?:[^/]+/)*":".*",t+=n?2:1}else if(o==="*")s+="[^/]*";else if(o==="?")s+="[^/]";else if(o==="{"){const n=e.indexOf("}",t);n<0?s+="\\{":(s+=`(?:${e.slice(t+1,n).split(",").map(c=>c.replace(l,"\\$&").replaceAll("*","[^/]*")).join("|")})`,t=n)}else s+=o.replace(l,"\\$&")}const r=new RegExp(`^${s}$`,"iu");return t=>r.test(t)}const f=i=>i.priority==="option",p=i=>[...i.filter(e=>!f(e)),...i.filter(f)];export function fileEditorIn(i,e){return p(i).find(s=>s.files.some(r=>globTest(r)(e)))}export function scanFiles(i,e){if(e.length===0)return[];const s=p(e).map(t=>({id:t.id,tests:t.files.map(globTest)})),r=[];for(const t of[...i].filter(o=>!u(o)).sort()){const o=s.find(n=>n.tests.some(c=>c(t)));o&&r.push({path:t,editor:o.id})}return r}
|
|
@@ -56,4 +56,13 @@ export declare function mapOutline(outline: readonly (readonly NotePoint[])[], m
|
|
|
56
56
|
export declare function outlineBox(outline: readonly (readonly NotePoint[])[]): NoteBox;
|
|
57
57
|
/** Whether a point is inside an outline: inside one of its rings (the even-odd rule a ring). */
|
|
58
58
|
export declare function insideOutline(outline: readonly (readonly NotePoint[])[], p: NotePoint): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A mark as SVG path data, its points mapped (into the pixels of what it is
|
|
61
|
+
* on: a board, a picture), and whether it holds an area: a region a tool
|
|
62
|
+
* that takes a mask is handed (`NoteRegion`).
|
|
63
|
+
*/
|
|
64
|
+
export declare function shapePath(shape: NoteShape, map: (p: NotePoint) => NotePoint): {
|
|
65
|
+
path: string;
|
|
66
|
+
area: boolean;
|
|
67
|
+
};
|
|
59
68
|
//# sourceMappingURL=note-shape.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
const O=6,P=.85,I=.25,S=40,k=12,
|
|
2
|
+
const O=6,P=.85,I=.25,S=40,k=12,f=(t,n,r)=>Math.min(r,Math.max(n,t));function a(t){const n=t.map(e=>e.x),r=t.map(e=>e.y),c=Math.min(...n),o=Math.min(...r);return{x:c,y:o,width:Math.max(...n)-c,height:Math.max(...r)-o}}function l(t){const[n]=t,r=t.at(-1);if(!n||!r)return!1;const{width:c,height:o}=a(t),e=Math.hypot(c,o);return e>0&&Math.hypot(r.x-n.x,r.y-n.y)<=e*.25}const m=(t,n)=>t.x<n.x+Math.max(n.width,1)&&t.x+Math.max(t.width,1)>n.x&&t.y<n.y+Math.max(n.height,1)&&t.y+Math.max(t.height,1)>n.y;function w(t,n){const r=t.width/2||1,c=t.height/2||1,o=t.x+r,e=t.y+c,i=(f(o,n.x,n.x+n.width)-o)/r,s=(f(e,n.y,n.y+n.height)-e)/c;return Math.hypot(i,s)<=.85}function $(t,n,r){const c=n.x-t.x,o=n.y-t.y;let e=0,i=1;for(const[s,u]of[[-c,t.x-r.x],[c,r.x+r.width-t.x],[-o,t.y-r.y],[o,r.y+r.height-t.y]]){if(s===0){if(u<0)return!1}else s<0?e=Math.max(e,u/s):i=Math.min(i,u/s);if(e>i)return!1}return!0}export function touches(t,n){switch(t.kind){case"box":return m(t.rect,n);case"round":return w(t.rect,n);case"arrow":return m({x:t.to.x-6,y:t.to.y-6,width:12,height:12},n);case"line":return l(t.points)?w(a(t.points),n):t.points.some((r,c)=>$(t.points[c-1]??r,r,n))}}function d(t,n){return n.flatMap(r=>n.map(c=>({x:t.x+t.width*c,y:t.y+t.height*r})))}function T(t){const n=t.map((o,e)=>{const i=t[e-1]??o;return Math.hypot(o.x-i.x,o.y-i.y)}),r=n.reduce((o,e)=>o+e,0),c=f(Math.ceil(r/40)+1,2,12);return Array.from({length:c},(o,e)=>{let i=r*e/(c-1);for(const[s,u]of t.entries()){const x=n[s]??0,h=t[s-1];if(h&&i<=x){const M=x===0?0:i/x;return{x:h.x+(u.x-h.x)*M,y:h.y+(u.y-h.y)*M}}i-=x}return t.at(-1)??{x:0,y:0}})}export function pointsOf(t){switch(t.kind){case"box":return d(t.rect,[.5,.2,.8]);case"round":return d(t.rect,[.5,.3,.7]);case"arrow":return[t.to];case"line":return l(t.points)?d(a(t.points),[.5,.3,.7]):T(t.points)}}export function mapShape(t,n){switch(t.kind){case"box":case"round":{const r=n(t.rect),c=n({x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height});return{kind:t.kind,rect:{...r,width:c.x-r.x,height:c.y-r.y}}}case"arrow":return{kind:"arrow",from:n(t.from),to:n(t.to)};case"line":return{kind:"line",points:t.points.map(n)}}}export function rectOutline(t){return[[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]]}export function turnedOutline(t,n){if(n%360===0)return rectOutline(t);const r=n*Math.PI/180,c=Math.cos(r),o=Math.sin(r),e=t.x+t.width/2,i=t.y+t.height/2;return rectOutline(t).map(s=>s.map(u=>({x:e+(u.x-e)*c-(u.y-i)*o,y:i+(u.x-e)*o+(u.y-i)*c})))}const g=48;export function roundOutline(t){const n=t.width/2,r=t.height/2;return[Array.from({length:g},(c,o)=>{const e=2*Math.PI*o/g;return{x:t.x+n+n*Math.cos(e),y:t.y+r+r*Math.sin(e)}})]}export function mapOutline(t,n){return t.map(r=>r.map(n))}export function outlineBox(t){return a(t.flat())}export function insideOutline(t,n){return t.some(r=>{let c=!1;for(let o=0,e=r.length-1;o<r.length;e=o++){const i=r[o],s=r[e];!i||!s||i.y>n.y!=s.y>n.y&&n.x<(s.x-i.x)*(n.y-i.y)/(s.y-i.y)+i.x&&(c=!c)}return c})}const y=t=>String(Math.round(t*10)/10);export function shapePath(t,n){switch(t.kind){case"box":{const r=n({x:t.rect.x,y:t.rect.y}),c=n({x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height});return{path:`M ${y(r.x)} ${y(r.y)} H ${y(c.x)} V ${y(c.y)} H ${y(r.x)} Z`,area:!0}}case"round":{const r=n({x:t.rect.x,y:t.rect.y}),c=n({x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height}),o=Math.abs(c.x-r.x)/2,e=Math.abs(c.y-r.y)/2,i=(r.y+c.y)/2,s=Math.min(r.x,c.x);return{path:`M ${y(s)} ${y(i)} A ${y(o)} ${y(e)} 0 1 0 ${y(s+2*o)} ${y(i)} A ${y(o)} ${y(e)} 0 1 0 ${y(s)} ${y(i)} Z`,area:!0}}case"arrow":{const r=n(t.from),c=n(t.to);return{path:`M ${y(r.x)} ${y(r.y)} L ${y(c.x)} ${y(c.y)}`,area:!1}}case"line":{const r=t.points.map(n),c=r.length>2&&l(r);return{path:r.map((o,e)=>`${e===0?"M":"L"} ${y(o.x)} ${y(o.y)}`).join(" ")+(c?" Z":""),area:c}}}}
|
|
@@ -171,6 +171,41 @@ export declare const PROJECT_TOOLS: {
|
|
|
171
171
|
scope: z.ZodString;
|
|
172
172
|
revision: z.ZodInt;
|
|
173
173
|
}, z.core.$strict>>;
|
|
174
|
+
readonly "project/file": MethodSpec<z.ZodObject<{
|
|
175
|
+
path: z.ZodString;
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
item: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
180
|
+
dir: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
181
|
+
entry: z.ZodString;
|
|
182
|
+
title: z.ZodOptional<z.ZodString>;
|
|
183
|
+
groups: z.ZodArray<z.ZodString>;
|
|
184
|
+
kindInfo: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
noun: z.ZodString;
|
|
186
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
187
|
+
color: z.ZodOptional<z.ZodString>;
|
|
188
|
+
editor: z.ZodOptional<z.ZodString>;
|
|
189
|
+
exports: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
types: z.ZodArray<z.ZodString>;
|
|
191
|
+
extras: z.ZodArray<z.ZodString>;
|
|
192
|
+
options: z.ZodArray<z.ZodObject<{
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
only: z.ZodArray<z.ZodString>;
|
|
195
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
share: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
201
|
+
plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
202
|
+
starter: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
204
|
+
entry: z.ZodString;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
}, z.core.$strict>>;
|
|
174
209
|
readonly "items/preview": MethodSpec<z.ZodObject<{
|
|
175
210
|
item: z.ZodString;
|
|
176
211
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -330,6 +365,7 @@ export type ProjectToolName = keyof typeof PROJECT_TOOLS;
|
|
|
330
365
|
*/
|
|
331
366
|
export declare const PROJECT_TOOL_SOURCES: {
|
|
332
367
|
readonly "project/items": "project";
|
|
368
|
+
readonly "project/file": "asleep";
|
|
333
369
|
readonly "items/preview": "asleep";
|
|
334
370
|
readonly "items/page": "asleep";
|
|
335
371
|
readonly "work/add": "machine";
|
|
@@ -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 n,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as a}from"./kinds.js";import{RPC_ERROR as g,RpcError as b,method as s,notification as o}from"./jsonrpc.js";export const VersionRef={item:t,version:e.string().optional()};export{ImageSchema}from"./image.js";export const ProblemSchema=e.looseObject({code:e.string(),level:e.enum(["error","warn"]),message:e.string(),piece:e.string().optional(),part:e.string().optional(),t:e.number().optional()}),FactSchema=e.looseObject({kind:e.string(),data:e.unknown()}),CHECK_STATES=["off","waiting","running","done","failed"],CheckStateSchema=e.strictObject({status:e.enum(CHECK_STATES),revision:e.int().nonnegative(),problems:e.array(ProblemSchema),facts:e.array(FactSchema),versions:e.strictObject({total:e.int(),loaded:e.int(),reused:e.int()}).optional(),error:e.string().optional()}),EXPORT_STATES=["queued","running","done","failed","cancelled"],ExportOptionsSchema=e.record(e.string(),e.union([e.string(),e.boolean()])),ExportJobSchema=e.strictObject({id:e.string(),item:t,versions:e.array(e.string()),types:e.array(e.string()),options:ExportOptionsSchema.optional(),state:e.enum(EXPORT_STATES),progress:e.number().min(0).max(1),files:e.array(t),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:t,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()}),FramedPageSchema=e.strictObject({url:e.string(),probe:e.string()}),COMPONENT_STILLS_MAX=64,PROJECT_TOOLS={"project/items":s(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),files:e.array(e.object({path:e.string().min(1),role:e.string().min(1).optional()})).optional(),kindInfo:a.optional()})),kinds:e.array(a.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."),"project/file":s(e.strictObject({path:t}),e.strictObject({item:e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),kindInfo:a.optional()})}),"A file of the project as it opens in an editor, whether the list names it or not: the item it is, else the file in the editor that opens it by its name (an `editors` contribution's `files`); not found for a file that is not there or that no editor opens."),"items/preview":s(e.strictObject({item:t}),e.strictObject({preview:h.optional()}),"What an item looks like (named by its id or its file), as its kind's provider makes it from its files now (a video's still, an image's boards, a deck's slide, a doc's first paragraphs, a sheet's first rows); none where its kind gives none."),"items/page":s(e.strictObject({item:t,folder:n.optional(),file:t.optional()}),e.strictObject({url:e.string()}),"The address of an item's page, for a frame (a report's page, a website built as files): `folder` served as the root of an origin of its own, the project's files alone (no other address loads), every file the page loads recorded as the item's input, so the item's editors hear `items/changed` when one changes."),"work/add":s(e.strictObject({kind:e.string().min(1),file:t,title:e.string().min(1).optional()}),e.strictObject({}),"Adds a piece to the end of the project's list (allyhub.yaml), the rest of it as it was; nothing when its file is listed already."),"components/list":s(e.strictObject({item:t}),e.strictObject({components:e.array(e.strictObject({of:e.string(),name:e.string(),label:e.union([e.string(),e.record(e.string(),e.string())]).optional()}))}),"The components an item may place: every one the project's files define, by the reference it would write."),"components/stage":s(e.strictObject(VersionRef),FramedPageSchema,"The address of a page that draws an item's components one at a time, for a sandboxed frame (docs/design/components-everywhere.md): a deck's by the name its module gives it, a doc's by the reference its block writes. Its parent posts `{ type: \"component\", name, props, width, height, t }` and hears `component-ready`, or `error` with what went wrong."),"components/stills":s(e.strictObject({...VersionRef,components:e.array(e.strictObject({name:e.string(),props:e.record(e.string(),e.unknown()),width:e.number().positive(),height:e.number().positive(),t:e.number().nonnegative()})).min(1).max(COMPONENT_STILLS_MAX)}),e.strictObject({stills:e.array(e.strictObject({key:e.string(),url:e.url()}).nullable())}),"An item's components (a deck's, a doc's) drawn alone, transparent, as the render draws them: pictures kept by what they show, given as addresses."),"check/results":s(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":s(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":s(e.strictObject({item:t,versions:e.array(e.string()).optional(),types:e.array(e.string().min(1)).max(10).optional(),options:ExportOptionsSchema.optional()}),e.strictObject({job:ExportJobSchema}),"Exports an item (its versions, as file types) into .allyhub/out/; `export/changed` says how it goes."),"export/cancel":s(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":s(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":s(e.strictObject({path:t}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`).")},PROJECT_TOOL_SOURCES={"project/items":"project","project/file":"asleep","items/preview":"asleep","items/page":"asleep","work/add":"machine","components/list":"asleep","components/stage":"asleep","components/stills":"project","check/results":"project","check/run":"machine","export/start":"machine","export/cancel":"machine","export/list":"asleep","export/reveal":"machine"},AGENT_DOES={"project/items":{files:"allyhub.yaml"},"project/file":{files:"the project's files"},"items/preview":{command:"frames"},"items/page":{command:"frames"},"work/add":{files:"allyhub.yaml"},"components/list":{files:"the project's components (defineComponent)"},"components/stage":{command:"frames"},"components/stills":{command:"frames"},"check/results":{command:"inspect"},"check/run":{command:"check"},"export/start":{command:"render"},"export/cancel":{command:"render"},"export/list":{files:".allyhub/out/"},"export/reveal":{files:".allyhub/out/"}};export function toolSpec(r){return Object.hasOwn(PROJECT_TOOLS,r)?PROJECT_TOOLS[r]:void 0}export function toolCaller(r){return async(p,i,l)=>{const{result:m}=await p["tools/call"]({name:i,arguments:l}),c=r[i]?.result.safeParse(m);if(!c?.success)throw new b(g.internal,`The answer to the tool ${i} is not what the protocol says.`);return c.data}}export const TOOL_NOTIFICATIONS={"project/changed":o(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"items/changed":o(e.strictObject({item:t,paths:e.array(e.string())}),`One of an item's inputs changed (docs/design/item-files.md, "An item's inputs"): a file its build lists, or one its pages loaded.`),"check/changed":o(CheckStateSchema,"The check started, ended or failed."),"export/changed":o(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":o(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on."),"jobs/changed":o(e.strictObject({job:d,item:t}),"A job of the process the server runs in (docs/design/jobs.md: a website starting, an export) moved on, about a thing in this project: what the window lists, for the editor of that thing to show where the person waits on it.")};
|
package/docs/README.md
CHANGED
|
@@ -16,7 +16,6 @@ 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.
|
|
20
19
|
- [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.
|
|
21
20
|
- [canvas.md](canvas.md): a canvas, a JSON Canvas file laying a project's work out with notes, groups and edges.
|
|
22
21
|
- [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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "What an agent writes videos, decks and workbooks with: each built-in kind's authoring API, re-exported from its extension. The root, /dom, /media and /scenery are the video's: video(), parts with their speech, footage and sounds, defineComponent() and custom() layers, the layout, motion and input helpers, the scenery() layer's options; /slides is the deck's, python-pptx's API; /image is the image's, its boards each its own size; /sheets is the sheet's, openpyxl's API. Nothing a host needs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://allyhub.com",
|
package/docs/reports.md
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Reports
|
|
2
|
-
|
|
3
|
-
A report is a page read on a screen and sent as a link: one HTML file you write freely, in HTML, CSS and JavaScript, listed in `allyhub.yaml` as `kind: report` ([project.md](project.md#items)), and whatever it loads beside it. AllyHub gives it no components, classes or layout: every part of the page is yours. It draws the page offline, the same on every computer, checks it for what is objectively wrong, draws pictures of it to look at, and makes it into files.
|
|
4
|
-
|
|
5
|
-
## A report item
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
research/channels/
|
|
9
|
-
channels.html the report
|
|
10
|
-
charts.js anything it loads, beside it or elsewhere in the project
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
```yaml
|
|
14
|
-
work:
|
|
15
|
-
- file: research/channels/channels.html
|
|
16
|
-
kind: report
|
|
17
|
-
title: AI productivity channels
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
- Its id is its file without its extension (`research/channels/channels`); commands take either.
|
|
21
|
-
- Its file ends in `.html`; one that does not, or is not there, is AK-M017.
|
|
22
|
-
|
|
23
|
-
## What it loads
|
|
24
|
-
|
|
25
|
-
The page is drawn from a server of the project's folder: it loads the project's files by their paths, relative to the report (`../../data/channels.csv`), and nothing else.
|
|
26
|
-
|
|
27
|
-
- **Data**: `fetch` a CSV or a JSON by its path and draw from it, so a figure, a table and a chart are one number. A sheet's table files hold the rows typed into it, not what its formulas compute: for those, render the sheet into the report's folder (`allyhub render <sheet> --type csv` or `json`, then copy the file beside the report) and load that.
|
|
28
|
-
- **Libraries** are files of the project: a package installed and loaded by its path (`../../node_modules/chart.js/dist/chart.umd.min.js`), or a file beside the report. A classic script or a module with no imports is carried by the self-contained HTML export; a module that imports others is not (bundle it into one file).
|
|
29
|
-
- **Faces** are files: `@font-face` rules naming font files in the project (a `@fontsource` package's CSS, or your own). The built-in faces of the stage (project.md, "Fonts") are not loaded for a report.
|
|
30
|
-
- **Nothing from the network**: an address outside the project (a CDN, Google Fonts) is refused when the page is drawn and is AK-N003. Put the file in the project instead.
|
|
31
|
-
- A report style (below) brings its faces and Chart.js as files.
|
|
32
|
-
|
|
33
|
-
## How it is drawn
|
|
34
|
-
|
|
35
|
-
`check`, `frames` and `render` draw the page the same way, in the pinned Chrome:
|
|
36
|
-
|
|
37
|
-
- At a window of 1440 × 900 CSS pixels (`100vh` is 900), at 1 device pixel per CSS pixel, unless asked otherwise.
|
|
38
|
-
- `prefers-reduced-motion: reduce` and `prefers-color-scheme: light`, unless asked otherwise. `Math.random` gives the same numbers each time; the clock is the real one.
|
|
39
|
-
- It is drawn once it has settled: loaded, its network quiet (up to 3 s after the load event), its fonts ready, its pictures decoded, `window.allyhubReady` kept when the page sets it to a promise, its CSS animations finished (an endless one paused at its start), then 1.2 s more for what scripts animate. A page that draws later than that (a chart animating for longer) sets `window.allyhubReady`, or turns its motion off under reduced motion.
|
|
40
|
-
- A page that has not loaded and settled within 30 s is AK-P004.
|
|
41
|
-
|
|
42
|
-
Each of these is a `--param` of `allyhub render` (`width`, `height`, `scale`, `timeout`, `network`, `quiet`, `dark`, `paper`): `allyhub help render`.
|
|
43
|
-
|
|
44
|
-
## Check
|
|
45
|
-
|
|
46
|
-
`allyhub check` draws each report and reports objective errors alone:
|
|
47
|
-
|
|
48
|
-
| Code | What |
|
|
49
|
-
| --- | --- |
|
|
50
|
-
| AK-M017 | Its file is not an HTML file, or is not there |
|
|
51
|
-
| AK-A001 | It asks for a file of the project that is not there |
|
|
52
|
-
| AK-N003 | It asks for an address outside the project, which is refused |
|
|
53
|
-
| AK-R001 | Its scripts threw and did not catch |
|
|
54
|
-
| AK-P004 | It did not load, or did not settle, within its timeout |
|
|
55
|
-
| AK-L006 | Text is drawn in a face of the computer rather than a file of the project (a warning: another computer draws it in its own) |
|
|
56
|
-
|
|
57
|
-
How it looks, what it says and how it is laid out are never problems.
|
|
58
|
-
|
|
59
|
-
## In Studio and allyhub dev
|
|
60
|
-
|
|
61
|
-
A report opens in its view: the page in a frame, served from the project's files with the same rule as the render (nothing from outside the project loads), at the window's width or a desktop's, a tablet's or a phone's, scaled down when wider than the window. It is drawn again when a file it is made from changes: its own, or one its page loaded (the CSV it fetched, a face its stylesheet named), wherever it is in the project. A person changes one thing in it by hand, its theme, where its report style writes themes: the view's theme menu sets `data-theme` on the page's `<html>`, every other byte of the file kept, and you see it in the file. A read-only view (a snapshot) and a share's viewer offer no theme to set, as they offer nothing that changes the item. Anything else they point at with Mark up and send to you.
|
|
62
|
-
|
|
63
|
-
## Look at it
|
|
64
|
-
|
|
65
|
-
`allyhub frames <report>` draws the page as the render does, from its top, and writes the picture under `.allyhub/work/frames/<place>/`:
|
|
66
|
-
|
|
67
|
-
- `--width 375` at a phone's width, `--dark` as a reader who asks for dark sees it (a page with no `prefers-color-scheme: dark` styles looks the same), `--print` laid out for paper (`@media print`) as one long picture;
|
|
68
|
-
- `--at <selector>` one element alone, at its size, its picture named by the selector;
|
|
69
|
-
- a page more than about 1.6 times as tall as it is wide is cut into bands laid side by side (at most six), so one picture shows all of it.
|
|
70
|
-
|
|
71
|
-
It says the page's height, and what it asked for that was missing or refused and what it threw.
|
|
72
|
-
|
|
73
|
-
## Render
|
|
74
|
-
|
|
75
|
-
`allyhub render <report>` writes under `.allyhub/out/`, by its id:
|
|
76
|
-
|
|
77
|
-
- `html` (the default): one self-contained HTML file, and the render says its size and how much of it is faces. Every file the page loaded is put inside it, its bytes as they are in the project: scripts and style sheets in their tags, pictures and faces as `data:` URLs, and what its scripts loaded (`fetch`, `XMLHttpRequest`, a picture or a script made by code) answered from a table in a first script. It runs offline on any computer, its interactivity kept. A module script that imports another file stops it, with why.
|
|
78
|
-
- `pdf`: Chrome's print of the page, its backgrounds printed, on Letter (`--param paper=a4`) unless its `@page` names a size; write `@media print` for paper.
|
|
79
|
-
- `png`: the whole page as one long picture at its width.
|
|
80
|
-
|
|
81
|
-
`--type html,pdf,png` makes them all.
|
|
82
|
-
|
|
83
|
-
## Report styles
|
|
84
|
-
|
|
85
|
-
A report style is a look written down for a report to start from when the person gives no style of their own: a reference, never a limit, and never a component.
|
|
86
|
-
|
|
87
|
-
- `allyhub report style list` names them, each with its themes.
|
|
88
|
-
- `allyhub report style show <name>` prints one: its themes, tokens, type, page, example parts and charts.
|
|
89
|
-
- `allyhub report style use <report> <name>` writes its `style.css` (the tokens as CSS variables, each theme as `[data-theme="…"]`, the faces' `@font-face` rules, reduced motion) and `tokens.js` (the same tokens for a canvas chart: `reportToken("hero-deco2")`) in the report's `style/` folder, and copies its faces and Chart.js once into the project's `assets/report-styles/<name>/`. It prints the lines to link them. The files are then the report's own: change them as it needs; `--force` writes style.css and tokens.js again.
|