@allyhub/sdk 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  3. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  4. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  5. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  6. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  7. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  8. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  9. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  10. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  11. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +1 -1
  12. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  13. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  14. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  15. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  16. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  17. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  18. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  19. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  20. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +12 -0
  21. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  22. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +8 -0
  23. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +4 -0
  24. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  25. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +6 -0
  26. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  27. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +61 -1
  28. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  29. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -1
  30. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  31. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +41 -3
  32. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  33. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  34. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  35. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  36. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  37. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +12 -0
  38. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  39. package/dist/node_modules/@allyhub/protocol/package.json +1 -5
  40. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  41. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  42. package/dist/node_modules/@allyhub/sheet/dist/export.d.ts +0 -8
  43. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  44. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +1 -1
  45. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  46. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  47. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  48. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  49. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  50. package/docs/README.md +2 -0
  51. package/docs/defaults.md +10 -2
  52. package/docs/docs.md +4 -4
  53. package/docs/image.md +3 -3
  54. package/docs/linkedin.md +96 -0
  55. package/docs/reports.md +89 -0
  56. package/docs/sheets.md +1 -1
  57. package/docs/x.md +1 -1
  58. package/package.json +1 -1
  59. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +0 -337
  60. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +0 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Feature highlights from each AllyHub release.
4
4
 
5
+ ## 0.11.0
6
+
7
+ - **Reports.** A page written freely in HTML, CSS and JavaScript, read on a screen and sent as a link; rendered as one self-contained HTML file, a PDF or one long PNG, with report styles to start from (`allyhub report style`).
8
+ - **LinkedIn posts, carousels and articles**, written beside LinkedIn's look and checked against its limits; a post shows where LinkedIn folds it at "… more", and an article copies as LinkedIn's editor takes it.
9
+ - **Exports go to your Downloads.** An export from an editor lands in one folder, Downloads unless you choose another (`allyhub dev --exports`), and never overwrites a file there.
10
+ - **Mark up a thing by picking it.** Select marks what is under the pointer, and Mark up from a selection starts with it marked, so the agent is told exactly what you mean.
11
+ - **Present a deck on two screens as in PowerPoint**, each full screen, with Swap and Duplicate Slide Show.
12
+
5
13
  ## 0.10.0
6
14
 
7
15
  - **Word, Excel and PowerPoint files that hold up in Office.** A deck's file holds what its preview shows; a workbook keeps iterative calculation, data tables and combination charts; a chart over dates shows dates.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -26,6 +26,13 @@ export interface Problem {
26
26
  selector?: string;
27
27
  bbox?: Box;
28
28
  };
29
+ /**
30
+ * A fact of the page that drew it (its browser), not of the piece: where
31
+ * that page renders (frames, check, an export) it is the export's; where
32
+ * it is an editor's preview, the export is not affected, so it is not a
33
+ * problem of the version (allykit#502).
34
+ */
35
+ ofPage?: true;
29
36
  }
30
37
  /** A code no rule this process knows has: a mistake in the code that reports it, or in its extension's manifest. */
31
38
  export declare class UnknownRuleError extends Error {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -36,4 +36,24 @@ export declare function touches(shape: NoteShape, box: NoteBox): boolean;
36
36
  export declare function pointsOf(shape: NoteShape): NotePoint[];
37
37
  /** A shape moved into another frame, as a stage's own. */
38
38
  export declare function mapShape(shape: NoteShape, map: (p: NotePoint) => NotePoint): NoteShape;
39
+ /**
40
+ * An element's edge as it is drawn, for a person who picks it rather than
41
+ * drawing round it (docs/design/notes.md, "Select"): closed outlines, each a
42
+ * ring of points in the surface's pixels. A box is one ring of four, a box
43
+ * turned its four corners turned, words a ring a line, a round shape its
44
+ * edge in steps.
45
+ */
46
+ export type NoteOutline = NotePoint[][];
47
+ /** A box's outline. */
48
+ export declare function rectOutline(box: NoteBox): NoteOutline;
49
+ /** A box turned about its middle, degrees clockwise: its four corners where they are drawn. */
50
+ export declare function turnedOutline(box: NoteBox, degrees: number): NoteOutline;
51
+ /** The round in a box: its edge in steps. */
52
+ export declare function roundOutline(box: NoteBox): NoteOutline;
53
+ /** An outline moved into another frame. */
54
+ export declare function mapOutline(outline: readonly (readonly NotePoint[])[], map: (p: NotePoint) => NotePoint): NoteOutline;
55
+ /** The box round an outline. */
56
+ export declare function outlineBox(outline: readonly (readonly NotePoint[])[]): NoteBox;
57
+ /** Whether a point is inside an outline: inside one of its rings (the even-odd rule a ring). */
58
+ export declare function insideOutline(outline: readonly (readonly NotePoint[])[], p: NotePoint): boolean;
39
59
  //# 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 T=6,P=.85,I=.25,O=40,S=12,x=(t,n,r)=>Math.min(r,Math.max(n,t));function f(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}=f(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 M(t,n){const r=t.width/2||1,c=t.height/2||1,o=t.x+r,e=t.y+c,i=(x(o,n.x,n.x+n.width)-o)/r,s=(x(e,n.y,n.y+n.height)-e)/c;return Math.hypot(i,s)<=.85}function w(t,n,r){const c=n.x-t.x,o=n.y-t.y;let e=0,i=1;for(const[s,h]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(h<0)return!1}else s<0?e=Math.max(e,h/s):i=Math.min(i,h/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 M(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)?M(f(t.points),n):t.points.some((r,c)=>w(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 g(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=x(Math.ceil(r/40)+1,2,12);return Array.from({length:c},(o,e)=>{let i=r*e/(c-1);for(const[s,h]of t.entries()){const u=n[s]??0,y=t[s-1];if(y&&i<=u){const a=u===0?0:i/u;return{x:y.x+(h.x-y.x)*a,y:y.y+(h.y-y.y)*a}}i-=u}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(f(t.points),[.5,.3,.7]):g(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)}}}
2
+ const O=6,P=.85,I=.25,S=40,k=12,x=(t,n,r)=>Math.min(r,Math.max(n,t));function f(t){const n=t.map(e=>e.x),r=t.map(e=>e.y),c=Math.min(...n),i=Math.min(...r);return{x:c,y:i,width:Math.max(...n)-c,height:Math.max(...r)-i}}function d(t){const[n]=t,r=t.at(-1);if(!n||!r)return!1;const{width:c,height:i}=f(t),e=Math.hypot(c,i);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 M(t,n){const r=t.width/2||1,c=t.height/2||1,i=t.x+r,e=t.y+c,o=(x(i,n.x,n.x+n.width)-i)/r,s=(x(e,n.y,n.y+n.height)-e)/c;return Math.hypot(o,s)<=.85}function g(t,n,r){const c=n.x-t.x,i=n.y-t.y;let e=0,o=1;for(const[s,y]of[[-c,t.x-r.x],[c,r.x+r.width-t.x],[-i,t.y-r.y],[i,r.y+r.height-t.y]]){if(s===0){if(y<0)return!1}else s<0?e=Math.max(e,y/s):o=Math.min(o,y/s);if(e>o)return!1}return!0}export function touches(t,n){switch(t.kind){case"box":return m(t.rect,n);case"round":return M(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 d(t.points)?M(f(t.points),n):t.points.some((r,c)=>g(t.points[c-1]??r,r,n))}}function a(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((i,e)=>{const o=t[e-1]??i;return Math.hypot(i.x-o.x,i.y-o.y)}),r=n.reduce((i,e)=>i+e,0),c=x(Math.ceil(r/40)+1,2,12);return Array.from({length:c},(i,e)=>{let o=r*e/(c-1);for(const[s,y]of t.entries()){const h=n[s]??0,u=t[s-1];if(u&&o<=h){const l=h===0?0:o/h;return{x:u.x+(y.x-u.x)*l,y:u.y+(y.y-u.y)*l}}o-=h}return t.at(-1)??{x:0,y:0}})}export function pointsOf(t){switch(t.kind){case"box":return a(t.rect,[.5,.2,.8]);case"round":return a(t.rect,[.5,.3,.7]);case"arrow":return[t.to];case"line":return d(t.points)?a(f(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),i=Math.sin(r),e=t.x+t.width/2,o=t.y+t.height/2;return rectOutline(t).map(s=>s.map(y=>({x:e+(y.x-e)*c-(y.y-o)*i,y:o+(y.x-e)*i+(y.y-o)*c})))}const w=48;export function roundOutline(t){const n=t.width/2,r=t.height/2;return[Array.from({length:w},(c,i)=>{const e=2*Math.PI*i/w;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 f(t.flat())}export function insideOutline(t,n){return t.some(r=>{let c=!1;for(let i=0,e=r.length-1;i<r.length;e=i++){const o=r[i],s=r[e];!o||!s||o.y>n.y!=s.y>n.y&&n.x<(s.x-o.x)*(n.y-o.y)/(s.y-o.y)+o.x&&(c=!c)}return c})}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/formats",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-draw",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./*": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-measure",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./*": {
@@ -123,7 +123,7 @@ export interface ImageOptions {
123
123
  * no words of its own.
124
124
  */
125
125
  script?: string;
126
- /** Its boards have no background: their files keep the alpha channel (PNG, WebP, AVIF). */
126
+ /** Its boards have no background: their files keep the alpha channel (PNG, WebP). */
127
127
  transparent?: boolean;
128
128
  /** Its boards, in order. */
129
129
  boards(ctx: ImageContext): Board[] | Promise<Board[]>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/measure",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/ooxml",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -110,6 +110,8 @@ export interface StageContext {
110
110
  code: string;
111
111
  message: string;
112
112
  level?: "error" | "warn";
113
+ /** A fact of the page drawing it (its browser), not of the piece (`Problem.ofPage`). */
114
+ ofPage?: true;
113
115
  }): void;
114
116
  /**
115
117
  * The caption cues shown in this part, on its own clock (seconds from
@@ -1,3 +1,3 @@
1
1
  export { consoleAt, consoleAtAsync, consoleLog, consoleParts, installConsole, resetConsole, } from "./console.js";
2
- export { locateLayers } from "./locate.js";
2
+ export { locateLayers, pickLayer } from "./locate.js";
3
3
  //# sourceMappingURL=index.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
- export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers}from"./locate.js";
2
+ export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers,pickLayer}from"./locate.js";
@@ -1,4 +1,17 @@
1
1
  import { type NoteShape } from "@allyhub/formats";
2
- import type { LocatedLayer } from "../stage.js";
2
+ import type { LocatedLayer, PickedLayer } from "../stage.js";
3
3
  export declare function locateLayers(root: ParentNode, mark: NoteShape): LocatedLayer[];
4
+ /**
5
+ * The one thing in front at a point of the stage (px of its window), as a
6
+ * browser's inspector finds the element under the pointer: the first
7
+ * element there, front to back, that shows and draws something of its own,
8
+ * in a layer or a footage. A piece of a run of words (a letter or a word
9
+ * in its own span, for its motion) is its run. Its edge is a box with room
10
+ * round it (`edgeOf`): the element's own, turned with it, where it paints
11
+ * one or is a picture; else the box round its words.
12
+ */
13
+ export declare function pickLayer(doc: Document, at: {
14
+ x: number;
15
+ y: number;
16
+ }): PickedLayer | undefined;
4
17
  //# sourceMappingURL=locate.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
- import{touches as T}from"@allyhub/formats";import{LAYER_NAME as C}from"../layer.js";const A=3,E=120,m=e=>e.width*e.height;function S(e){if(e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGElement||d(e)!=="")return!0;const o=getComputedStyle(e);return o.backgroundColor!=="transparent"&&!/^rgba\(.*,\s*0\)$/u.test(o.backgroundColor)||o.backgroundImage!=="none"||parseFloat(o.borderTopWidth)+parseFloat(o.borderRightWidth)+parseFloat(o.borderBottomWidth)+parseFloat(o.borderLeftWidth)>0}const b=e=>e.closest("[data-ak-piece]")?.dataset.akPiece;function d(e){return[...e.childNodes].filter(o=>o.nodeType===Node.TEXT_NODE).map(o=>o.textContent).join("").trim()}export function locateLayers(e,o){const c=t=>t.width>0&&t.height>0&&T(o,t),u=[],l=[];for(const t of e.querySelectorAll(".ak-layer")){if(!t.checkVisibility({opacityProperty:!0,visibilityProperty:!0})||!c(t.getBoundingClientRect())||![t,...t.querySelectorAll("*")].filter(i=>c(i.getBoundingClientRect())).some(S))continue;const r=t.getAttribute(C)??void 0,a=b(t),p={part:t.closest(".ak-part")?.dataset.key??"",layer:t.dataset.component??"",...r===void 0||r===""?{}:{key:r},...a===void 0?{}:{piece:a}};let n;for(const i of[t,...t.querySelectorAll("*")]){const h=i.getBoundingClientRect();!c(h)||d(i)===""&&!i.hasAttribute("data-ak")||(!n||m(h)<m(n.getBoundingClientRect()))&&(n=i)}if(!n){l.push(p);continue}const g=n.closest("[data-ak]")?.getAttribute("data-ak"),y=d(n).slice(0,E);u.push({...p,...g?{name:g}:{},...y===""?{}:{text:y}})}const f=[];for(const t of e.querySelectorAll(".ak-footage")){const s=t.dataset.akFile,r=(t.querySelector("video")??t).checkVisibility({opacityProperty:!0,visibilityProperty:!0});if(s===void 0||!r||!c(t.getBoundingClientRect()))continue;const a=b(t);f.push({part:t.dataset.akPart??"",layer:"footage",file:s,...a===void 0?{}:{piece:a}})}return[...u,...f,...l].slice(0,A)}
2
+ import{touches as $}from"@allyhub/formats";import{LAYER_NAME as C}from"../layer.js";const A=3,E=120,T=t=>t.width*t.height;function S(t){if(t instanceof HTMLImageElement||t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGElement||k(t)!=="")return!0;const e=getComputedStyle(t);return e.backgroundColor!=="transparent"&&!/^rgba\(.*,\s*0\)$/u.test(e.backgroundColor)||e.backgroundImage!=="none"||parseFloat(e.borderTopWidth)+parseFloat(e.borderRightWidth)+parseFloat(e.borderBottomWidth)+parseFloat(e.borderLeftWidth)>0}const m=t=>t.closest("[data-ak-piece]")?.dataset.akPiece;function k(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}export function locateLayers(t,e){const r=i=>i.width>0&&i.height>0&&$(e,i),d=[],s=[];for(const i of t.querySelectorAll(".ak-layer")){if(!i.checkVisibility({opacityProperty:!0,visibilityProperty:!0})||!r(i.getBoundingClientRect())||![i,...i.querySelectorAll("*")].filter(f=>r(f.getBoundingClientRect())).some(S))continue;const c=i.getAttribute(C)??void 0,a=m(i),l={part:i.closest(".ak-part")?.dataset.key??"",layer:i.dataset.component??"",...c===void 0||c===""?{}:{key:c},...a===void 0?{}:{piece:a}};let y;for(const f of[i,...i.querySelectorAll("*")]){const p=f.getBoundingClientRect();!r(p)||k(f)===""&&!f.hasAttribute("data-ak")||(!y||T(p)<T(y.getBoundingClientRect()))&&(y=f)}if(!y){s.push(l);continue}const x=y.closest("[data-ak]")?.getAttribute("data-ak"),h=k(y).slice(0,E);d.push({...l,...x?{name:x}:{},...h===""?{}:{text:h}})}const o=[];for(const i of t.querySelectorAll(".ak-footage")){const u=i.dataset.akFile,c=(i.querySelector("video")??i).checkVisibility({opacityProperty:!0,visibilityProperty:!0});if(u===void 0||!c||!r(i.getBoundingClientRect()))continue;const a=m(i);o.push({part:i.dataset.akPart??"",layer:"footage",file:u,...a===void 0?{}:{piece:a}})}return[...d,...o,...s].slice(0,A)}const v=t=>t.checkVisibility({opacityProperty:!0,visibilityProperty:!0});function M(t){if(t instanceof HTMLImageElement||t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGElement)return!0;const e=getComputedStyle(t);return e.backgroundColor!=="transparent"&&!/^rgba\(.*,\s*0\)$/u.test(e.backgroundColor)||e.backgroundImage!=="none"||parseFloat(e.borderTopWidth)+parseFloat(e.borderRightWidth)+parseFloat(e.borderBottomWidth)+parseFloat(e.borderLeftWidth)>0}const R={px:2,share:.02};function L(t){if(!(t instanceof HTMLElement)||!t.parentElement)return;const e=t.getBoundingClientRect(),r=getComputedStyle(t),d=t.ownerDocument,s=d.createElement("div");s.style.cssText=["position:absolute","margin:0","padding:0","border:0","box-sizing:border-box","visibility:hidden","pointer-events:none",`left:${String(t.offsetLeft)}px`,`top:${String(t.offsetTop)}px`,`width:${String(t.offsetWidth)}px`,`height:${String(t.offsetHeight)}px`,`transform:${r.transform}`,`transform-origin:${r.transformOrigin}`,`rotate:${r.rotate}`,`scale:${r.scale}`,`translate:${r.translate}`].join(";");const o=(f,p)=>{const g=d.createElement("div");return g.style.cssText=`position:absolute;width:0;height:0;left:${f};top:${p}`,s.append(g),g},i=[o("0","0"),o("100%","0"),o("0","100%")];t.after(s);let u;try{u=i.map(f=>{const p=f.getBoundingClientRect();return{x:p.x,y:p.y}})}finally{s.remove()}const[n,c,a]=u;if(!n||!c||!a)return;const l={x:c.x+a.x-n.x,y:c.y+a.y-n.y},y=[n.x,c.x,a.x,l.x],x=[n.y,c.y,a.y,l.y],h=(f,p,g)=>Math.abs(f-p)>Math.max(R.px,g*R.share);if(!(h(Math.min(...y),e.left,e.width)||h(Math.max(...y),e.right,e.width)||h(Math.min(...x),e.top,e.height)||h(Math.max(...x),e.bottom,e.height)))return{o:n,a:c,b:a}}const F=t=>Math.abs(t.a.y-t.o.y)<.5&&Math.abs(t.b.x-t.o.x)<.5,b={share:.008,least:3};function B(t){const e=t.ownerDocument.defaultView,r=Math.max(b.least,Math.min(e?.innerWidth??0,e?.innerHeight??0)*b.share);let d,s,o;const i=L(t),u=t instanceof SVGGraphicsElement?t.getScreenCTM():null;if(i)({o:d,a:s,b:o}=i);else if(t instanceof SVGGraphicsElement&&u){const n=t.getBBox(),c=getComputedStyle(t),a=c.stroke==="none"?0:(parseFloat(c.strokeWidth)||0)/2,l=(y,x)=>{const h=new DOMPoint(y,x).matrixTransform(u);return{x:h.x,y:h.y}};d=l(n.x-a,n.y-a),s=l(n.x+n.width+a,n.y-a),o=l(n.x-a,n.y+n.height+a)}else{const n=t.getBoundingClientRect();d={x:n.left,y:n.top},s={x:n.right,y:n.top},o={x:n.left,y:n.bottom}}return[W(d,s,o,r)]}function W(t,e,r,d){const s=(n,c)=>{const a=Math.hypot(c.x-n.x,c.y-n.y)||1;return{x:(c.x-n.x)/a*d,y:(c.y-n.y)/a*d}},o=s(t,e),i=s(t,r),u={x:e.x+r.x-t.x,y:e.y+r.y-t.y};return[{x:t.x-o.x-i.x,y:t.y-o.y-i.y},{x:e.x+o.x-i.x,y:e.y+o.y-i.y},{x:u.x+o.x+i.x,y:u.y+o.y+i.y},{x:r.x-o.x+i.x,y:r.y-o.y+i.y}]}function H(t){const e=t.ownerDocument.createRange();e.selectNodeContents(t);const r=[...e.getClientRects()].filter(o=>o.width>0&&o.height>0);if(r.length===0)return;const d=Math.min(...r.map(o=>o.left)),s=Math.min(...r.map(o=>o.top));return{x:d,y:s,width:Math.max(...r.map(o=>o.right))-d,height:Math.max(...r.map(o=>o.bottom))-s}}export function pickLayer(t,e){const r=t.createElement("style");r.textContent="* { pointer-events: auto !important; }",t.head.append(r);let d;try{d=t.elementsFromPoint(e.x,e.y)}finally{r.remove()}for(const s of d){const o=s.closest(".ak-footage"),i=o?.dataset.akFile;if(o&&i!==void 0){if(!v(o.querySelector("video")??o))continue;const w=m(o);return{part:o.dataset.akPart??"",layer:"footage",file:i,...w===void 0?{}:{piece:w},outline:B(o)}}const u=s.closest(".ak-layer");if(!u||!v(s)||!S(s))continue;let n=s;for(;n!==u&&n.parentElement&&getComputedStyle(n).display.startsWith("inline")&&!M(n);)n=n.parentElement;const c=M(n)?void 0:L(n),a=c!==void 0&&!F(c),l=M(n)||a?void 0:H(n),y=t.defaultView,x=l?[W({x:l.x,y:l.y},{x:l.x+l.width,y:l.y},{x:l.x,y:l.y+l.height},Math.max(b.least,Math.min(y?.innerWidth??0,y?.innerHeight??0)*b.share))]:B(n),h=u.getAttribute(C)??void 0,f=m(u),p=n.closest("[data-ak]")?.getAttribute("data-ak"),g=(n instanceof HTMLElement?n.innerText:n.textContent).trim().replace(/\s+/gu," ");return{part:u.closest(".ak-part")?.dataset.key??"",layer:u.dataset.component??"",...h===void 0||h===""?{}:{key:h},...f===void 0?{}:{piece:f},...p?{name:p}:{},...g===""?{}:{text:g.slice(0,E)},outline:x}}}
@@ -229,6 +229,13 @@ export interface LocatedLayer {
229
229
  /** The module it is written in, where another item's (a video drawn inside this one), project-relative. */
230
230
  piece?: string;
231
231
  }
232
+ /** The one layer a person picked at a point (docs/design/notes.md, "Select"): what it is, and its edge, closed rings of points. */
233
+ export interface PickedLayer extends LocatedLayer {
234
+ outline: {
235
+ x: number;
236
+ y: number;
237
+ }[][];
238
+ }
232
239
  /** Where a player starts: a moment, or a part and how far into it (the same share of it when its length is no longer `dur`). */
233
240
  export interface PlayAt {
234
241
  /** Seconds. */
@@ -269,6 +276,11 @@ export interface StageBridge {
269
276
  play(options: PlayOptions): Promise<PlayControl>;
270
277
  /** What a person's mark is on, in shares of the stage. */
271
278
  locate(mark: NoteShape): LocatedLayer[];
279
+ /** The one thing in front at a point, with its edge, both in shares of the stage; none where nothing is drawn there. */
280
+ pick(at: {
281
+ x: number;
282
+ y: number;
283
+ }): PickedLayer | undefined;
272
284
  /**
273
285
  * An item's code as data, its module run and nothing drawn, as the
274
286
  * message its editor hears (a deck's DeckCode and theme), from the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/piece",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -75,6 +75,10 @@ export declare const ACCOUNT_CALLS: {
75
75
  renewsAt: z.ZodISODateTime;
76
76
  }, z.core.$strip>>>;
77
77
  bought: z.ZodDefault<z.ZodNumber>;
78
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
79
+ credits: z.ZodNumber;
80
+ expiresAt: z.ZodISODateTime;
81
+ }, z.core.$strip>>>;
78
82
  customer: z.ZodDefault<z.ZodBoolean>;
79
83
  autoTopUp: z.ZodNullable<z.ZodObject<{
80
84
  below: z.ZodNumber;
@@ -281,6 +285,10 @@ export declare const ACCOUNT_CALLS: {
281
285
  renewsAt: z.ZodISODateTime;
282
286
  }, z.core.$strip>>>;
283
287
  bought: z.ZodDefault<z.ZodNumber>;
288
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
289
+ credits: z.ZodNumber;
290
+ expiresAt: z.ZodISODateTime;
291
+ }, z.core.$strip>>>;
284
292
  customer: z.ZodDefault<z.ZodBoolean>;
285
293
  autoTopUp: z.ZodNullable<z.ZodObject<{
286
294
  below: z.ZodNumber;
@@ -42,6 +42,10 @@ export declare const BillingSummarySchema: z.ZodObject<{
42
42
  renewsAt: z.ZodISODateTime;
43
43
  }, z.core.$strip>>>;
44
44
  bought: z.ZodDefault<z.ZodNumber>;
45
+ expiring: z.ZodDefault<z.ZodArray<z.ZodObject<{
46
+ credits: z.ZodNumber;
47
+ expiresAt: z.ZodISODateTime;
48
+ }, z.core.$strip>>>;
45
49
  customer: z.ZodDefault<z.ZodBoolean>;
46
50
  autoTopUp: z.ZodNullable<z.ZodObject<{
47
51
  below: z.ZodNumber;
@@ -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 n}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:n(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:n(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:n(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_SPENDS_PATH="/api/billing/spends",BillingSpendsSchema=t.object({spends:t.array(t.object({at:t.string(),kind:n(SPEND_KINDS),what:t.string().nullable(),seconds:t.number().nullable(),member:t.string().nullable(),credits:t.number()})),more:t.boolean()}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_INVOICES_PATH="/api/billing/invoices",BillingInvoicesSchema=t.object({invoices:t.array(t.object({id:t.string(),number:t.string().nullable(),createdAt:t.string(),kind:n(["plan","credits"]),totalCents:t.number(),currency:t.string(),status:t.string(),pdf:t.string().nullable(),url:t.string().nullable()}))}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:n(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",PRICE_UNITS=["call","result","page","second","minute","thousand_characters","image","frame","megapixel","question","phrase"],TOOL_SECTIONS=["video","image","voice","music"],WORK_KINDS=["data","ai"],CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1),kind:n(WORK_KINDS).default("data"),line:t.string().optional()}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean(),example:t.record(t.string(),t.unknown()).optional(),price:t.object({credits:t.number().nonnegative(),per:n(PRICE_UNITS),varies:t.boolean()}).optional(),shown:t.object({name:t.string(),line:t.string(),section:n(TOOL_SECTIONS)}).optional()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CAPABILITIES_PATH="/api/capabilities",CapabilitiesSchema=t.object({off:t.object({works:t.array(t.string()),tools:t.array(t.string())})}),CapabilityRequestSchema=t.union([t.strictObject({work:t.string().min(1),on:t.boolean()}),t.strictObject({tool:t.string().min(1),on:t.boolean()})]),EDITORS_PATH="/api/editors",EditorsSchema=t.object({editors:t.array(t.object({id:t.string().min(1),name:t.record(t.string(),t.string()),plural:t.record(t.string(),t.string()).optional(),line:t.record(t.string(),t.string()),icon:t.string().optional(),color:t.string().optional()}))}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:n(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,o)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(o)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[o,r,...s]=e.slice(i.length).split("/");if(!(!o||!r||s.length>0))try{return{id:decodeURIComponent(o),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,o)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${o}`;
2
+ import{z as t}from"zod";import{openEnum as n}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:n(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),expiring:t.array(t.object({credits:t.number(),expiresAt:t.iso.datetime()})).default([]),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:n(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:n(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_SPENDS_PATH="/api/billing/spends",BillingSpendsSchema=t.object({spends:t.array(t.object({at:t.string(),kind:n(SPEND_KINDS),what:t.string().nullable(),seconds:t.number().nullable(),member:t.string().nullable(),credits:t.number()})),more:t.boolean()}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_INVOICES_PATH="/api/billing/invoices",BillingInvoicesSchema=t.object({invoices:t.array(t.object({id:t.string(),number:t.string().nullable(),createdAt:t.string(),kind:n(["plan","credits"]),totalCents:t.number(),currency:t.string(),status:t.string(),pdf:t.string().nullable(),url:t.string().nullable()}))}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:n(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",PRICE_UNITS=["call","result","page","second","minute","thousand_characters","image","frame","megapixel","question","phrase"],TOOL_SECTIONS=["video","image","voice","music"],WORK_KINDS=["data","ai"],CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1),kind:n(WORK_KINDS).default("data"),line:t.string().optional()}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean(),example:t.record(t.string(),t.unknown()).optional(),price:t.object({credits:t.number().nonnegative(),per:n(PRICE_UNITS),varies:t.boolean()}).optional(),shown:t.object({name:t.string(),line:t.string(),section:n(TOOL_SECTIONS)}).optional()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CAPABILITIES_PATH="/api/capabilities",CapabilitiesSchema=t.object({off:t.object({works:t.array(t.string()),tools:t.array(t.string())})}),CapabilityRequestSchema=t.union([t.strictObject({work:t.string().min(1),on:t.boolean()}),t.strictObject({tool:t.string().min(1),on:t.boolean()})]),EDITORS_PATH="/api/editors",EditorsSchema=t.object({editors:t.array(t.object({id:t.string().min(1),name:t.record(t.string(),t.string()),plural:t.record(t.string(),t.string()).optional(),line:t.record(t.string(),t.string()),icon:t.string().optional(),color:t.string().optional()}))}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:n(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,o)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(o)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[o,r,...s]=e.slice(i.length).split("/");if(!(!o||!r||s.length>0))try{return{id:decodeURIComponent(o),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,o)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${o}`;
@@ -191,6 +191,7 @@ export declare const HOST_METHODS: {
191
191
  width: z.ZodNumber;
192
192
  height: z.ZodNumber;
193
193
  }, z.core.$strict>>;
194
+ selection: z.ZodOptional<z.ZodBoolean>;
194
195
  }, z.core.$strict>, z.ZodObject<{
195
196
  begun: z.ZodBoolean;
196
197
  }, z.core.$strict>>;
@@ -233,6 +234,10 @@ export declare const HOST_NOTIFICATIONS: {
233
234
  readonly "project/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
234
235
  revision: z.ZodInt;
235
236
  }, z.core.$strict>>;
237
+ readonly "items/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
238
+ item: z.ZodString;
239
+ paths: z.ZodArray<z.ZodString>;
240
+ }, z.core.$strict>>;
236
241
  readonly "check/changed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
237
242
  status: z.ZodEnum<{
238
243
  off: "off";
@@ -559,6 +564,7 @@ export declare const EDITOR_HOST_METHODS: {
559
564
  width: z.ZodNumber;
560
565
  height: z.ZodNumber;
561
566
  }, z.core.$strict>>;
567
+ selection: z.ZodOptional<z.ZodBoolean>;
562
568
  }, z.core.$strict>, z.ZodObject<{
563
569
  begun: z.ZodBoolean;
564
570
  }, z.core.$strict>>;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person tried to change what a read-only host shows (`readOnly`): the host offers to wake the machine that changes it; false where nothing does."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":n(HostContextSchema,"The language, theme or agent changed."),"editor/command":n(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...d,...p},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...m};
2
+ import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as n}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as s}from"./place.js";import{AgentHereSchema as l,PRESENCE_METHODS as m,PRESENCE_NOTIFICATIONS as p}from"./presence.js";import{TOOL_NOTIFICATIONS as d}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),readOnly:t.boolean().optional(),viewer:t.boolean().optional(),place:s.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(l,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:s}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional(),selection:t.boolean().optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person pressed an Edit of the editor's own (a website's view, with no machine to run its server) on a read-only host (`readOnly`): the host wakes the machine that changes it; false where nothing does. Never sent for a key pressed in the item."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":n(HostContextSchema,"The language, theme or agent changed."),"editor/command":n(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...d,...p},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...m};
@@ -1,7 +1,9 @@
1
1
  import { z } from "zod";
2
2
  /** What the window asks the page. */
3
3
  export declare const FRAME_METHODS: {
4
- readonly "note/hold": import("./jsonrpc.js").MethodSpec<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
4
+ readonly "note/hold": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
5
+ selection: z.ZodOptional<z.ZodBoolean>;
6
+ }, z.core.$strict>, z.ZodObject<{
5
7
  key: z.ZodString;
6
8
  what: z.ZodString;
7
9
  source: z.ZodOptional<z.ZodObject<{
@@ -9,6 +11,31 @@ export declare const FRAME_METHODS: {
9
11
  line: z.ZodOptional<z.ZodInt>;
10
12
  endLine: z.ZodOptional<z.ZodInt>;
11
13
  }, z.core.$strict>>;
14
+ selected: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ element: z.ZodObject<{
16
+ name: z.ZodString;
17
+ source: z.ZodOptional<z.ZodObject<{
18
+ path: z.ZodString;
19
+ line: z.ZodOptional<z.ZodInt>;
20
+ endLine: z.ZodOptional<z.ZodInt>;
21
+ }, z.core.$strict>>;
22
+ text: z.ZodOptional<z.ZodString>;
23
+ regions: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ in: z.ZodString;
25
+ file: z.ZodOptional<z.ZodString>;
26
+ width: z.ZodNumber;
27
+ height: z.ZodNumber;
28
+ path: z.ZodString;
29
+ area: z.ZodBoolean;
30
+ scale: z.ZodNumber;
31
+ }, z.core.$strict>>>;
32
+ }, z.core.$strict>;
33
+ outline: z.ZodArray<z.ZodArray<z.ZodObject<{
34
+ x: z.ZodNumber;
35
+ y: z.ZodNumber;
36
+ }, z.core.$strict>>>;
37
+ where: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>>>;
12
39
  }, z.core.$strict>>;
13
40
  readonly "note/locate": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
14
41
  shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -65,6 +92,38 @@ export declare const FRAME_METHODS: {
65
92
  }, z.core.$strict>>;
66
93
  where: z.ZodOptional<z.ZodString>;
67
94
  }, z.core.$strict>>;
95
+ readonly "note/pick": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
96
+ at: z.ZodObject<{
97
+ x: z.ZodNumber;
98
+ y: z.ZodNumber;
99
+ }, z.core.$strict>;
100
+ }, z.core.$strict>, z.ZodObject<{
101
+ pick: z.ZodOptional<z.ZodObject<{
102
+ element: z.ZodObject<{
103
+ name: z.ZodString;
104
+ source: z.ZodOptional<z.ZodObject<{
105
+ path: z.ZodString;
106
+ line: z.ZodOptional<z.ZodInt>;
107
+ endLine: z.ZodOptional<z.ZodInt>;
108
+ }, z.core.$strict>>;
109
+ text: z.ZodOptional<z.ZodString>;
110
+ regions: z.ZodOptional<z.ZodArray<z.ZodObject<{
111
+ in: z.ZodString;
112
+ file: z.ZodOptional<z.ZodString>;
113
+ width: z.ZodNumber;
114
+ height: z.ZodNumber;
115
+ path: z.ZodString;
116
+ area: z.ZodBoolean;
117
+ scale: z.ZodNumber;
118
+ }, z.core.$strict>>>;
119
+ }, z.core.$strict>;
120
+ outline: z.ZodArray<z.ZodArray<z.ZodObject<{
121
+ x: z.ZodNumber;
122
+ y: z.ZodNumber;
123
+ }, z.core.$strict>>>;
124
+ where: z.ZodOptional<z.ZodString>;
125
+ }, z.core.$strict>>;
126
+ }, z.core.$strict>>;
68
127
  readonly "note/pictures": import("./jsonrpc.js").MethodSpec<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
69
128
  pictures: z.ZodArray<z.ZodObject<{
70
129
  rect: z.ZodOptional<z.ZodObject<{
@@ -117,6 +176,7 @@ export declare const FRAME_NOTIFICATIONS: {
117
176
  width: z.ZodNumber;
118
177
  height: z.ZodNumber;
119
178
  }, z.core.$strict>>;
179
+ selection: z.ZodOptional<z.ZodBoolean>;
120
180
  }, z.core.$strict>>;
121
181
  readonly "share/begin": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, z.core.$strict>>;
122
182
  readonly "edit/request": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, z.core.$strict>>;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{EDITOR_STATES as r,ExportStateSchema as i,PlaceSchema as a}from"./editor.js";import{AgentHereSchema as n}from"./presence.js";import{PathSchema as h}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as c,NoteFoundSchema as d,NotePictureSchema as m,NoteRectSchema as s,NoteShapeSchema as p}from"./notes.js";export const FRAME_METHODS={"note/hold":o(e.strictObject({}),c,"Holds what moves by itself while the person marks a picture of it; says what is on show."),"note/locate":o(e.strictObject({shape:p}),d,"What a mark is on: the editor's answer and every inset's under it, innermost first. Empty is an answer: the mark's place still goes."),"note/pictures":o(e.strictObject({}),e.strictObject({pictures:e.array(m),uncovered:e.array(e.strictObject({name:e.string(),rect:s}))}),"The page as it shows now, drawn without the window's marks, then its insets' pictures, each at its rect, outermost first."),"note/release":o(e.strictObject({}),e.strictObject({}),"The person is done marking. Nothing starts by itself.")},WINDOW_NOTIFICATIONS={"editor/command":t(e.strictObject({command:e.string().min(1),open:e.boolean().optional()}),"A shortcut the window took, its header's Export or its agent's name, or a command of the editor's extension, for the editor to do as its own.")},FRAME_NOTIFICATIONS={"note/ready":t(e.strictObject({}),"The page's editor has given its surface: the page answers notes."),"note/gone":t(e.strictObject({}),"The page no longer answers notes: its editor went, or the page goes."),"window/key":t(e.strictObject({key:e.string(),code:e.string(),meta:e.boolean(),ctrl:e.boolean(),shift:e.boolean(),alt:e.boolean()}),"A key with ⌘ or Ctrl pressed in the page that its editor did not take: the window's shortcut (⌘⇧M, ⌘K), heard where the keys are in the page. A desktop shell's menu hears them itself, so a page framed there tells none."),"agent/ask":t(e.strictObject({text:e.string().min(1)}),"Words the editor puts before the person's agent, for them to go on and send."),"note/begin":t(e.strictObject({from:s.optional()}),"The person asked for Mark up from the editor: the window shows its tools; `from` is what they pressed, in the page's viewport."),"share/begin":t(e.strictObject({}),"The person asked to share the item on show."),"edit/request":t(e.strictObject({}),"The person tried to change what a read-only page shows, or the page needs the machine: the window offers to wake it."),"editor/place":t(e.strictObject({item:h,place:a}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"export/state":t(i,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(r),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(n,"The project's agent in the item on show and whether its editor follows it, for the window's header; its button asks back with `editor/command`'s `follow` or `unfollow`.")};
2
+ import{z as e}from"zod";import{EDITOR_STATES as r,ExportStateSchema as n,PlaceSchema as a}from"./editor.js";import{AgentHereSchema as h}from"./presence.js";import{PathSchema as c}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as d,NoteFoundSchema as p,NotePickSchema as s,NotePictureSchema as m,NotePointSchema as w,NoteRectSchema as i,NoteShapeSchema as l}from"./notes.js";export const FRAME_METHODS={"note/hold":o(e.strictObject({selection:e.boolean().optional()}),d.extend({selected:e.array(s).optional()}),"Holds what moves by itself while the person marks a picture of it; says what is on show, and with `selection` what is selected in it."),"note/locate":o(e.strictObject({shape:l}),p,"What a mark is on: the editor's answer and every inset's under it, innermost first. Empty is an answer: the mark's place still goes."),"note/pick":o(e.strictObject({at:w}),e.strictObject({pick:s.optional()}),"The one thing in front at a point, with its edge: the innermost inset's under it that answers, else the editor's. None is an answer."),"note/pictures":o(e.strictObject({}),e.strictObject({pictures:e.array(m),uncovered:e.array(e.strictObject({name:e.string(),rect:i}))}),"The page as it shows now, drawn without the window's marks, then its insets' pictures, each at its rect, outermost first."),"note/release":o(e.strictObject({}),e.strictObject({}),"The person is done marking. Nothing starts by itself.")},WINDOW_NOTIFICATIONS={"editor/command":t(e.strictObject({command:e.string().min(1),open:e.boolean().optional()}),"A shortcut the window took, its header's Export or its agent's name, or a command of the editor's extension, for the editor to do as its own.")},FRAME_NOTIFICATIONS={"note/ready":t(e.strictObject({}),"The page's editor has given its surface: the page answers notes."),"note/gone":t(e.strictObject({}),"The page no longer answers notes: its editor went, or the page goes."),"window/key":t(e.strictObject({key:e.string(),code:e.string(),meta:e.boolean(),ctrl:e.boolean(),shift:e.boolean(),alt:e.boolean()}),"A key with ⌘ or Ctrl pressed in the page that its editor did not take: the window's shortcut (⌘⇧M, ⌘K), heard where the keys are in the page. A desktop shell's menu hears them itself, so a page framed there tells none."),"agent/ask":t(e.strictObject({text:e.string().min(1)}),"Words the editor puts before the person's agent, for them to go on and send."),"note/begin":t(e.strictObject({from:i.optional(),selection:e.boolean().optional()}),"The person asked for Mark up from the editor: the window shows its tools, or with `selection` begins with what is selected marked; `from` is what they pressed, in the page's viewport."),"share/begin":t(e.strictObject({}),"The person asked to share the item on show."),"edit/request":t(e.strictObject({}),"The person pressed an Edit of the page's own on a read-only page, or the page needs the machine for what they asked: the window wakes it. Never for a key pressed in the item."),"editor/place":t(e.strictObject({item:c,place:a}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"export/state":t(n,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(r),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(h,"The project's agent in the item on show and whether its editor follows it, for the window's header; its button asks back with `editor/command`'s `follow` or `unfollow`.")};
@@ -22,7 +22,6 @@ export * from "./sources.js";
22
22
  export * from "./shares.js";
23
23
  export * from "./account.js";
24
24
  export * from "./open.js";
25
- export * from "./browser-bridge.js";
26
25
  export * from "./jobs.js";
27
26
  export * from "./peer.js";
28
27
  export * from "./shape.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export*from"./jsonrpc.js";export*from"./files.js";export*from"./editor.js";export*from"./presence.js";export*from"./kinds.js";export*from"./notes.js";export*from"./frame.js";export*from"./tools.js";export*from"./cli.js";export*from"./auth.js";export*from"./registry.js";export*from"./runtimes.js";export*from"./cloud.js";export*from"./teams.js";export*from"./app.js";export*from"./routes.js";export*from"./blobs.js";export*from"./sites.js";export*from"./mail.js";export*from"./snapshots.js";export*from"./sources.js";export*from"./shares.js";export*from"./account.js";export*from"./open.js";export*from"./browser-bridge.js";export*from"./jobs.js";export*from"./peer.js";export*from"./shape.js";
2
+ export*from"./jsonrpc.js";export*from"./files.js";export*from"./editor.js";export*from"./presence.js";export*from"./kinds.js";export*from"./notes.js";export*from"./frame.js";export*from"./tools.js";export*from"./cli.js";export*from"./auth.js";export*from"./registry.js";export*from"./runtimes.js";export*from"./cloud.js";export*from"./teams.js";export*from"./app.js";export*from"./routes.js";export*from"./blobs.js";export*from"./sites.js";export*from"./mail.js";export*from"./snapshots.js";export*from"./sources.js";export*from"./shares.js";export*from"./account.js";export*from"./open.js";export*from"./jobs.js";export*from"./peer.js";export*from"./shape.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { pointsOf, mapShape, touches, type NoteShape } from "@allyhub/formats";
2
+ import { insideOutline, mapOutline, mapShape, outlineBox, pointsOf, rectOutline, roundOutline, touches, turnedOutline, type NoteOutline, type NoteShape } from "@allyhub/formats";
3
3
  export declare const NoteRectSchema: z.ZodObject<{
4
4
  x: z.ZodNumber;
5
5
  y: z.ZodNumber;
@@ -46,8 +46,8 @@ export declare const NoteShapeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
46
  y: z.ZodNumber;
47
47
  }, z.core.$strict>>;
48
48
  }, z.core.$strict>], "kind">;
49
- export { mapShape, pointsOf, touches };
50
- export type { NoteShape };
49
+ export { insideOutline, mapOutline, mapShape, outlineBox, pointsOf, rectOutline, roundOutline, touches, turnedOutline, };
50
+ export type { NoteOutline, NoteShape };
51
51
  /** Where to change something: a project's file, and its line. */
52
52
  export declare const NoteSourceSchema: z.ZodObject<{
53
53
  path: z.ZodString;
@@ -135,6 +135,38 @@ export declare const NoteFoundSchema: z.ZodObject<{
135
135
  where: z.ZodOptional<z.ZodString>;
136
136
  }, z.core.$strict>;
137
137
  export type NoteFound = z.infer<typeof NoteFoundSchema>;
138
+ /**
139
+ * An element a person picked rather than drew round (docs/design/notes.md,
140
+ * "Select"): what it is, and its edge as it is drawn, closed rings of
141
+ * points in px of the surface. The host draws the edge as the mark and
142
+ * passes the element on unread.
143
+ */
144
+ export declare const NotePickSchema: z.ZodObject<{
145
+ element: z.ZodObject<{
146
+ name: z.ZodString;
147
+ source: z.ZodOptional<z.ZodObject<{
148
+ path: z.ZodString;
149
+ line: z.ZodOptional<z.ZodInt>;
150
+ endLine: z.ZodOptional<z.ZodInt>;
151
+ }, z.core.$strict>>;
152
+ text: z.ZodOptional<z.ZodString>;
153
+ regions: z.ZodOptional<z.ZodArray<z.ZodObject<{
154
+ in: z.ZodString;
155
+ file: z.ZodOptional<z.ZodString>;
156
+ width: z.ZodNumber;
157
+ height: z.ZodNumber;
158
+ path: z.ZodString;
159
+ area: z.ZodBoolean;
160
+ scale: z.ZodNumber;
161
+ }, z.core.$strict>>>;
162
+ }, z.core.$strict>;
163
+ outline: z.ZodArray<z.ZodArray<z.ZodObject<{
164
+ x: z.ZodNumber;
165
+ y: z.ZodNumber;
166
+ }, z.core.$strict>>>;
167
+ where: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strict>;
169
+ export type NotePick = z.infer<typeof NotePickSchema>;
138
170
  /**
139
171
  * What every editor gives its host for notes on it, for as long as it is on
140
172
  * show (docs/design/notes.md, "The contract"): Mark up takes a picture of
@@ -149,6 +181,10 @@ export interface NoteSurface {
149
181
  hold(): Promise<Held>;
150
182
  /** What a mark is on, among what the editor draws in the page itself; insets answer for theirs. Empty is an answer. */
151
183
  locate(mark: NoteShape): Promise<NoteFound>;
184
+ /** The one thing in front at a point, among what the editor draws in the page itself, with its edge; none where there is nothing to pick. */
185
+ pick?(at: NotePoint): Promise<NotePick | undefined>;
186
+ /** What the person has selected in the editor now, each as a pick: what Mark up asked from a selection marks. None where nothing is. */
187
+ selected?(): Promise<NotePick[]>;
152
188
  /** The person is done. Nothing starts by itself: a video that was paused stays paused. */
153
189
  release?(): void;
154
190
  }
@@ -166,6 +202,8 @@ export interface NoteInset {
166
202
  pictures?(): Promise<NotePicture[]>;
167
203
  /** What a mark (px of the page) is on inside it. */
168
204
  locate?(mark: NoteShape): Promise<NoteFound>;
205
+ /** The one thing in front at a point (px of the page) inside it, with its edge. */
206
+ pick?(at: NotePoint): Promise<NotePick | undefined>;
169
207
  /** Stops what moves by itself in it. */
170
208
  hold?(): Promise<void>;
171
209
  release?(): void;