@allyhub/sdk 0.11.0 → 0.13.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 (158) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/node_modules/@allyhub/audio/dist/plan.d.ts +3 -0
  3. package/dist/node_modules/@allyhub/audio/dist/render.js +1 -1
  4. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  5. package/dist/node_modules/@allyhub/chart/dist/chart-file.d.ts +2 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +3 -2
  8. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +5 -12
  9. package/dist/node_modules/@allyhub/chart/dist/chart.js +2 -1
  10. package/dist/node_modules/@allyhub/chart/dist/color.d.ts +37 -0
  11. package/dist/node_modules/@allyhub/chart/dist/color.js +2 -0
  12. package/dist/node_modules/@allyhub/chart/dist/index.d.ts +1 -0
  13. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  14. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  15. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  16. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +130 -0
  18. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  19. package/dist/node_modules/@allyhub/formats/dist/data/gen.d.ts +3 -1
  20. package/dist/node_modules/@allyhub/formats/dist/data/gen.js +1 -1
  21. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +512 -166
  22. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  23. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +2523 -136
  24. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  25. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +931 -87
  26. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  27. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  28. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  29. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  30. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  31. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  32. package/dist/node_modules/@allyhub/ooxml/dist/color.d.ts +11 -0
  33. package/dist/node_modules/@allyhub/ooxml/dist/color.js +1 -1
  34. package/dist/node_modules/@allyhub/ooxml/dist/ext.d.ts +43 -0
  35. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  36. package/dist/node_modules/@allyhub/ooxml/dist/index.d.ts +2 -1
  37. package/dist/node_modules/@allyhub/ooxml/dist/index.js +1 -1
  38. package/dist/node_modules/@allyhub/ooxml/dist/transform.d.ts +13 -0
  39. package/dist/node_modules/@allyhub/ooxml/dist/transform.js +2 -0
  40. package/dist/node_modules/@allyhub/ooxml/package.json +5 -1
  41. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +4 -4
  42. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +2 -2
  43. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +49 -5
  45. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +56 -0
  47. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +72 -9
  49. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +35 -20
  51. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +7 -0
  53. package/dist/node_modules/@allyhub/protocol/dist/errors.js +2 -0
  54. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +328 -0
  55. package/dist/node_modules/@allyhub/protocol/dist/events.js +2 -0
  56. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +28 -2
  57. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  58. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -0
  59. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  60. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  61. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +2 -2
  62. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +69 -6
  64. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  65. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +9 -9
  66. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  67. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  68. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/annotations.d.ts +14 -0
  70. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +2 -0
  71. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/api/index.d.ts +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/api/rules.d.ts +24 -0
  75. package/dist/node_modules/@allyhub/sheet/dist/api/rules.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/api/styles.d.ts +12 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +3 -1
  79. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/arrange.d.ts +28 -1
  81. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/data-tools.d.ts +42 -0
  83. package/dist/node_modules/@allyhub/sheet/dist/data-tools.js +2 -0
  84. package/dist/node_modules/@allyhub/sheet/dist/edit.d.ts +43 -2
  85. package/dist/node_modules/@allyhub/sheet/dist/edit.js +1 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/fill.d.ts +10 -0
  87. package/dist/node_modules/@allyhub/sheet/dist/fill.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.d.ts +14 -0
  90. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  92. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +6 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/dist/outline.d.ts +30 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/outline.js +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/rich.d.ts +29 -0
  97. package/dist/node_modules/@allyhub/sheet/dist/rich.js +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/rules.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/table-style.d.ts +6 -0
  100. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  101. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +5 -1
  103. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +17 -1
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.d.ts +56 -0
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.js +2 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  114. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +117 -21
  115. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +181 -30
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +3 -3
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +28 -2
  120. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/check.js +1 -1
  122. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +222 -4
  123. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +6 -0
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.d.ts +3 -0
  127. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.js +2 -0
  128. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +3 -0
  129. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  130. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  131. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +98 -10
  132. package/dist/node_modules/@allyhub/slides-core/dist/numbering.d.ts +6 -0
  133. package/dist/node_modules/@allyhub/slides-core/dist/numbering.js +2 -0
  134. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +53 -0
  135. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  136. package/dist/node_modules/@allyhub/slides-core/dist/patterns.d.ts +8 -0
  137. package/dist/node_modules/@allyhub/slides-core/dist/patterns.js +2 -0
  138. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +36 -6
  139. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  140. package/dist/node_modules/@allyhub/slides-core/dist/script.d.ts +11 -0
  141. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  142. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  144. package/dist/node_modules/@allyhub/slides-core/dist/table-style.d.ts +48 -0
  145. package/dist/node_modules/@allyhub/slides-core/dist/table-style.js +2 -0
  146. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  147. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +1 -1
  148. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +4 -0
  149. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  150. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  151. package/docs/defaults.md +78 -4
  152. package/docs/image.md +1 -1
  153. package/docs/pictures.md +1 -1
  154. package/docs/project.md +1 -1
  155. package/docs/sheets.md +19 -9
  156. package/docs/slides.md +30 -16
  157. package/docs/speech.md +1 -1
  158. package/package.json +1 -1
@@ -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 r}from"zod";import{ConfigSchema as m}from"./data/config.js";import{DeckCodeSchema as n}from"./data/deck-code.js";import{EditsFileSchema as c}from"./data/edits.js";import{ElementsFileSchema as h}from"./data/elements.js";import{GenFileSchema as l}from"./data/gen.js";import{MessagesFileSchema as f}from"./data/messages.js";import{InterpretationSchema as d}from"./data/reference.js";import{ScriptFileSchema as p}from"./data/script.js";import{SheetFileSchema as u}from"./data/sheet.js";import{SlidesFileSchema as b}from"./data/slides.js";import{WebsiteFileSchema as g}from"./data/website.js";import{WORK_FILE as S,WorkFileSchema as w}from"./data/work.js";import{WordsFileSchema as k}from"./data/words.js";export const DATA_FILES={work:{schema:w,files:[S],about:"The work a person sees of the project: each piece's kind, file and title, in groups."},words:{schema:k,files:["**/*.words.json"],about:"The words said in an audio or video file, with their times."},edits:{schema:c,files:["**/edits/*.json"],about:"A recording's cut list."},elements:{schema:h,files:["**/*.elements.json"],about:"A page screenshot's named elements, each its box in the picture's pixels."},gen:{schema:l,files:["**/*.gen.json"],about:"How a media file was made, and where it came from."},script:{schema:p,files:[],about:"An item's words in one language."},messages:{schema:f,files:["assets/text/*.json"],about:"Words several items share, in one language."},sheet:{schema:u,files:[],about:"A workbook: its sheets, cells, formulas, formats, names, checks and scenarios."},slides:{schema:b,files:[],about:"A deck's pages: their order, layouts, values and what was placed on them."},website:{schema:g,files:[],about:"A website: how it is served while it is made, how it is built, and where the built site is."},interpretation:{schema:d,files:["**/reference/*/interpretation.json"],about:"What the agent concludes of a reference video: its sections, captions, watermarks and labels."},"deck-code":{schema:n,files:[],about:"What a deck's module and its generators made, as data: what its code host sends the editor."},config:{schema:m,files:[],about:"allyhub.config.ts's settings."}};export function jsonSchemaOf(e){const{schema:t,about:s}=DATA_FILES[e];return{$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://allyhub.com/schemas/${e}.schema.json`,title:e,description:s,...r.toJSONSchema(t,{io:"input",unrepresentable:"any"})}}function o(e){if(e.code!=="invalid_union")return e.message;const t=e.errors.flatMap(s=>s.slice(0,1).map(a=>{const i=a.path.map(String).join(".");return i===""?o(a):`${i}: ${o(a)}`}));return t.length===0?e.message:`Fits none of its forms: ${[...new Set(t)].join("; ")}`}export function readDataFile(e,t){const s=DATA_FILES[e].schema.safeParse(t);return s.success?{ok:!0,value:s.data}:{ok:!1,problems:s.error.issues.map(a=>({path:a.path.map(String).join("."),message:o(a)}))}}
2
+ import{z as r}from"zod";import{ConfigSchema as m}from"./data/config.js";import{DeckCodeSchema as n}from"./data/deck-code.js";import{EditsFileSchema as c}from"./data/edits.js";import{ElementsFileSchema as h}from"./data/elements.js";import{GenFileSchema as l}from"./data/gen.js";import{MessagesFileSchema as f}from"./data/messages.js";import{InterpretationSchema as d}from"./data/reference.js";import{ScriptFileSchema as p}from"./data/script.js";import{SheetFileSchema as u}from"./data/sheet.js";import{SlidesFileSchema as b}from"./data/slides.js";import{WebsiteFileSchema as g}from"./data/website.js";import{WORK_FILE as S,WorkFileSchema as w}from"./data/work.js";import{WordsFileSchema as k}from"./data/words.js";export const DATA_FILES={work:{schema:w,files:[S],about:"The work a person sees of the project: each piece's kind, file and title, in groups."},words:{schema:k,files:["**/*.words.json"],about:"The words said in an audio or video file, with their times."},edits:{schema:c,files:["**/edits/*.json"],about:"A recording's cut list."},elements:{schema:h,files:["**/*.elements.json"],about:"A page screenshot's named elements, each its box in the picture's pixels."},gen:{schema:l,files:["**/*.provenance"],about:"How a media file was made, and where it came from."},script:{schema:p,files:[],about:"An item's words in one language."},messages:{schema:f,files:["assets/text/*.json"],about:"Words several items share, in one language."},sheet:{schema:u,files:[],about:"A workbook: its sheets, cells, formulas, formats, names, checks and scenarios."},slides:{schema:b,files:[],about:"A deck's pages: their order, layouts, values and what was placed on them."},website:{schema:g,files:[],about:"A website: how it is served while it is made, how it is built, and where the built site is."},interpretation:{schema:d,files:["**/reference/*/interpretation.json"],about:"What the agent concludes of a reference video: its sections, captions, watermarks and labels."},"deck-code":{schema:n,files:[],about:"What a deck's module and its generators made, as data: what its code host sends the editor."},config:{schema:m,files:[],about:"allyhub.config.ts's settings."}};export function jsonSchemaOf(e){const{schema:t,about:s}=DATA_FILES[e];return{$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://allyhub.com/schemas/${e}.schema.json`,title:e,description:s,...r.toJSONSchema(t,{io:"input",unrepresentable:"any"})}}function o(e){if(e.code!=="invalid_union")return e.message;const t=e.errors.flatMap(s=>s.slice(0,1).map(a=>{const i=a.path.map(String).join(".");return i===""?o(a):`${i}: ${o(a)}`}));return t.length===0?e.message:`Fits none of its forms: ${[...new Set(t)].join("; ")}`}export function readDataFile(e,t){const s=DATA_FILES[e].schema.safeParse(t);return s.success?{ok:!0,value:s.data}:{ok:!1,problems:s.error.issues.map(a=>({path:a.path.map(String).join("."),message:o(a)}))}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/formats",
3
- "version": "0.11.0",
3
+ "version": "0.13.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.11.0",
3
+ "version": "0.13.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.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./*": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/measure",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -25,6 +25,17 @@ export interface ResolvedColor {
25
25
  brightness?: number;
26
26
  /** Its transforms other than alpha and a brightness changed it: it is no longer the scheme's colour. */
27
27
  transformed: boolean;
28
+ /** A scheme colour's name as the file writes it, before the colour map (`tx1`, `bg2`, `accent1`). */
29
+ name?: string;
30
+ /** `#RRGGBB` before its transforms: a scheme colour's value, an RGB's own, a system colour's last. */
31
+ base?: string;
32
+ /** Its transforms in the file's order, each its local name and its value as the file writes it (100 000ths; an angle in 60 000ths of a degree). */
33
+ steps?: ColorStep[];
34
+ }
35
+ /** One of a colour's transforms as the file writes it (`a:lumMod val="75000"`): its local name and its value, where it has one. */
36
+ export interface ColorStep {
37
+ name: string;
38
+ val?: number;
28
39
  }
29
40
  /** The colour in an element whose content is a colour choice; undefined when it has none. */
30
41
  export declare function colorIn(parent: AnyEl | undefined, ctx: ColorContext): ResolvedColor | undefined;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{brightened as w,brightnessOfLum as v,fromHsl as k,hexOfRgb as M,rgbOfHex as O,toHsl as B}from"./brightness.js";import{parseValue as x}from"./node.js";export const SCHEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],DEFAULT_COLOR_MAP={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",...Object.fromEntries(SCHEME_COLORS.map(t=>[t,t]))};const L=["a:srgbClr","a:schemeClr","a:sysClr","a:prstClr","a:hslClr","a:scrgbClr"];export function colorIn(t,l){const e=t?.choice(...L);return e?colorOf(e,l):void 0}const T=M,m=O,C=2.3,u=t=>Math.pow(t,C),h=t=>Math.pow(Math.max(0,t),1/C),f=t=>Math.min(1,Math.max(0,t));export function colorOf(t,l){let e=[0,0,0],s=1,i,p,c=!1;const D=[],g=t;switch(t.key){case"a:srgbClr":e=m(g.attr("val")??"000000");break;case"a:schemeClr":{const r=g.attr("val")??"";r==="phClr"&&l.placeholder?(e=m(l.placeholder.rgb),s=l.placeholder.alpha,i=l.placeholder.scheme,p=l.placeholder.brightness,c=l.placeholder.transformed):(i=l.map[r]??r,e=m(l.scheme[i]??"000000"));break}case"a:sysClr":{const r=g.attr("lastClr"),d=g.attr("val")??"";e=m(r??W[d]??"000000");break}case"a:prstClr":e=m(q(g.attr("val")??""));break;case"a:hslClr":{const r=t;e=k([(r.attr("hue")??0)/6e4,(r.attr("sat")??0)/1e5,(r.attr("lum")??0)/1e5]);break}case"a:scrgbClr":{const r=t;e=[r.attr("r")??0,r.attr("g")??0,r.attr("b")??0].map(d=>h(d/1e5));break}}for(const r of g.kids()){r.use();const d=r.attr("val"),E=typeof d=="number"?d:Number(x("pct",d??"0")),o=E/1e5,F=r.el.local;if(F.startsWith("alpha")){s=F==="alpha"?o:F==="alphaMod"?s*o:s+o,s=f(s);continue}switch(F==="lumMod"||F==="lumOff"?D.push({name:F,val:E}):c=!0,F){case"tint":e=e.map(a=>h(1-(1-u(a))*o));break;case"shade":e=e.map(a=>h(u(a)*o));break;case"inv":e=e.map(a=>h(1-u(a)));break;case"gamma":e=e.map(a=>h(Math.pow(u(a),1/C)));break;case"invGamma":e=e.map(a=>h(Math.pow(u(a),C)));break;case"comp":{const[a,n,b]=B(e);e=k([a+180,n,b]);break}case"gray":{const a=.299*e[0]+.587*e[1]+.114*e[2];e=[a,a,a];break}case"red":case"green":case"blue":case"redMod":case"greenMod":case"blueMod":case"redOff":case"greenOff":case"blueOff":{const a=F.startsWith("red")?0:F.startsWith("green")?1:2,n=e.map(u);n[a]=f(F.endsWith("Mod")?n[a]*o:F.endsWith("Off")?n[a]+o:o),e=n.map(h);break}default:{const a=B(e),n=F.startsWith("hue")?0:F.startsWith("sat")?1:2,b=n===0?E/6e4:o,y=n===0?360:1,A=a[n];a[n]=Math.min(y,Math.max(0,F.endsWith("Mod")?A*o:F.endsWith("Off")?A+b:b)),e=k(a);break}}}if(D.length>0&&!c){const r=p===void 0?v(D):void 0;i===void 0||r===void 0?c=!0:(p=r,e=m(w(l.scheme[i]??"000000",r)))}return{rgb:T(e),alpha:s,...i===void 0||c?{}:{scheme:i},...p===void 0||c?{}:{brightness:p},transformed:c}}const W={window:"FFFFFF",windowText:"000000",btnFace:"F0F0F0",btnText:"000000",highlight:"0078D7",highlightText:"FFFFFF",grayText:"6D6D6D",menu:"F0F0F0",menuText:"000000",infoBk:"FFFFE1",infoText:"000000",hotLight:"0066CC",captionText:"000000",activeCaption:"99B4D1",inactiveCaption:"BFCDDB",appWorkspace:"ABABAB",background:"000000",scrollBar:"C8C8C8","3dDkShadow":"696969","3dLight":"E3E3E3",btnHighlight:"FFFFFF",btnShadow:"A0A0A0",windowFrame:"646464",activeBorder:"B4B4B4",inactiveBorder:"F4F7FC",gradientActiveCaption:"B9D1EA",gradientInactiveCaption:"D7E4F2",menuBar:"F0F0F0",menuHighlight:"3399FF",inactiveCaptionText:"000000"},_={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370DB",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"DB7093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},q=t=>_[t.replace(/^dk/u,"dark").replace(/^lt/u,"light").replace(/^med/u,"medium").toLowerCase()]??"000000";
2
+ import{brightened as A,brightnessOfLum as B,fromHsl as k,hexOfRgb as f,rgbOfHex as y}from"./brightness.js";import{parseValue as w}from"./node.js";import{transformed as v}from"./transform.js";export const SCHEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],DEFAULT_COLOR_MAP={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",...Object.fromEntries(SCHEME_COLORS.map(F=>[F,F]))};const O=["a:srgbClr","a:schemeClr","a:sysClr","a:prstClr","a:hslClr","a:scrgbClr"];export function colorIn(F,r){const a=F?.choice(...O);return a?colorOf(a,r):void 0}const b=f,s=y;export function colorOf(F,r){let a=[0,0,0],c=1,t,g,m,C=[],d,n=!1;const u=[],i=F;switch(F.key){case"a:srgbClr":a=s(i.attr("val")??"000000");break;case"a:schemeClr":{const e=i.attr("val")??"";e==="phClr"&&r.placeholder?(a=s(r.placeholder.rgb),c=r.placeholder.alpha,t=r.placeholder.scheme,d=r.placeholder.brightness,n=r.placeholder.transformed,g=r.placeholder.name,m=r.placeholder.base,C=r.placeholder.steps??[]):(t=r.map[e]??e,g=e,a=s(r.scheme[t]??"000000"));break}case"a:sysClr":{const e=i.attr("lastClr"),l=i.attr("val")??"";a=s(e??T[l]??"000000");break}case"a:prstClr":a=s(L(i.attr("val")??""));break;case"a:hslClr":{const e=F;a=k([(e.attr("hue")??0)/6e4,(e.attr("sat")??0)/1e5,(e.attr("lum")??0)/1e5]);break}case"a:scrgbClr":{const e=F;a=[e.attr("r")??0,e.attr("g")??0,e.attr("b")??0].map(l=>Math.pow(Math.max(0,l/1e5),1/2.3));break}}const E=m??b(a),p=[...C];for(const e of i.kids()){e.use();const l=e.attr("val"),h=l===void 0?void 0:typeof l=="number"?l:Number(w("pct",l)),o=e.el.local;p.push(h===void 0?{name:o}:{name:o,val:h});const D=v({rgb:a,alpha:c},o,h??0);a=D.rgb,c=D.alpha,!o.startsWith("alpha")&&(o==="lumMod"||o==="lumOff"?u.push({name:o,val:h??0}):n=!0)}if(u.length>0&&!n){const e=d===void 0?B(u):void 0;t===void 0||e===void 0?n=!0:(d=e,a=s(A(r.scheme[t]??"000000",e)))}return{rgb:b(a),alpha:c,...t===void 0||n?{}:{scheme:t},...d===void 0||n?{}:{brightness:d},transformed:n,...g===void 0?{}:{name:g},base:E,steps:p}}const T={window:"FFFFFF",windowText:"000000",btnFace:"F0F0F0",btnText:"000000",highlight:"0078D7",highlightText:"FFFFFF",grayText:"6D6D6D",menu:"F0F0F0",menuText:"000000",infoBk:"FFFFE1",infoText:"000000",hotLight:"0066CC",captionText:"000000",activeCaption:"99B4D1",inactiveCaption:"BFCDDB",appWorkspace:"ABABAB",background:"000000",scrollBar:"C8C8C8","3dDkShadow":"696969","3dLight":"E3E3E3",btnHighlight:"FFFFFF",btnShadow:"A0A0A0",windowFrame:"646464",activeBorder:"B4B4B4",inactiveBorder:"F4F7FC",gradientActiveCaption:"B9D1EA",gradientInactiveCaption:"D7E4F2",menuBar:"F0F0F0",menuHighlight:"3399FF",inactiveCaptionText:"000000"},q={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370DB",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"DB7093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},L=F=>q[F.replace(/^dk/u,"dark").replace(/^lt/u,"light").replace(/^med/u,"medium").toLowerCase()]??"000000";
@@ -11,8 +11,14 @@ export declare const EXT_ELEMENTS: {
11
11
  readonly "a14:useLocalDpi": "x:CT_Val";
12
12
  /** [MS-ODRAWXML] 2.25.1: a picture's SVG original beside its PNG. */
13
13
  readonly "asvg:svgBlip": "asvg:CT_SVGBlip";
14
+ /** [MS-PPTX] 2.3.26: the presentation's sections, named runs of its slides. */
15
+ readonly "p14:sectionLst": "p14:CT_SectionList";
14
16
  /** [MS-PPTX] 2.3.31: the Morph transition. */
15
17
  readonly "p159:morph": "p159:CT_Morph";
18
+ /** [MS-PPTX] 2.3.x: PowerPoint 2010's Reveal transition, smoothly or through black, from the left or the right. */
19
+ readonly "p14:reveal": "p14:CT_RevealTransition";
20
+ /** [MS-PPTX] 2.3.x: PowerPoint 2010's Zoom transition, in or out. */
21
+ readonly "p14:warp": "p14:CT_InOutTransition";
16
22
  };
17
23
  /** The types of the extension elements. */
18
24
  export declare const EXT_TYPES: {
@@ -34,6 +40,32 @@ export declare const EXT_TYPES: {
34
40
  readonly end: readonly ["s"];
35
41
  };
36
42
  };
43
+ readonly "p14:CT_SectionList": {
44
+ readonly c: {
45
+ readonly "p14:section": "p14:CT_Section";
46
+ readonly "p14:extLst": "x:CT_Any";
47
+ };
48
+ };
49
+ readonly "p14:CT_Section": {
50
+ readonly a: {
51
+ readonly name: readonly ["s"];
52
+ readonly id: readonly ["s"];
53
+ };
54
+ readonly c: {
55
+ readonly "p14:sldIdLst": "p14:CT_SectionSlideIdList";
56
+ readonly "p14:extLst": "x:CT_Any";
57
+ };
58
+ };
59
+ readonly "p14:CT_SectionSlideIdList": {
60
+ readonly c: {
61
+ readonly "p14:sldId": "p14:CT_SectionSlideIdListEntry";
62
+ };
63
+ };
64
+ readonly "p14:CT_SectionSlideIdListEntry": {
65
+ readonly a: {
66
+ readonly id: readonly ["n"];
67
+ };
68
+ };
37
69
  readonly "p14:CT_MediaFade": {
38
70
  readonly a: {
39
71
  readonly in: readonly ["s"];
@@ -51,6 +83,17 @@ export declare const EXT_TYPES: {
51
83
  readonly option: readonly ["p159:ST_MorphOption", "byObject"];
52
84
  };
53
85
  };
86
+ readonly "p14:CT_RevealTransition": {
87
+ readonly a: {
88
+ readonly thruBlk: readonly ["b", "false"];
89
+ readonly dir: readonly ["s", "l"];
90
+ };
91
+ };
92
+ readonly "p14:CT_InOutTransition": {
93
+ readonly a: {
94
+ readonly dir: readonly ["s", "out"];
95
+ };
96
+ };
54
97
  readonly "x:CT_Val": {
55
98
  readonly a: {
56
99
  readonly val: readonly ["s"];
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export const EXT_ELEMENTS={"p14:media":"p14:CT_Media","p14:creationId":"x:CT_Val","p14:modId":"x:CT_Val","a16:creationId":"x:CT_Id","a14:useLocalDpi":"x:CT_Val","asvg:svgBlip":"asvg:CT_SVGBlip","p159:morph":"p159:CT_Morph"},EXT_TYPES={"p14:CT_Media":{a:{"r:embed":["s"],"r:link":["s"]},c:{"p14:trim":"p14:CT_MediaTrim","p14:fade":"p14:CT_MediaFade","p14:bmkLst":"x:CT_Any","p14:extLst":"x:CT_Any"}},"p14:CT_MediaTrim":{a:{st:["s"],end:["s"]}},"p14:CT_MediaFade":{a:{in:["s"],out:["s"]}},"asvg:CT_SVGBlip":{a:{"r:embed":["s"],"r:link":["s"]}},"p159:CT_Morph":{a:{option:["p159:ST_MorphOption","byObject"]}},"x:CT_Val":{a:{val:["s"]}},"x:CT_Id":{a:{id:["s"]}},"x:CT_Any":{any:!0}},EXT_ATTRS={"p:CT_SlideTransition":{"p14:dur":["n"]}},EXT_ENUMS={"p159:ST_MorphOption":["byObject","byWord","byChar"]};
2
+ export const EXT_ELEMENTS={"p14:media":"p14:CT_Media","p14:creationId":"x:CT_Val","p14:modId":"x:CT_Val","a16:creationId":"x:CT_Id","a14:useLocalDpi":"x:CT_Val","asvg:svgBlip":"asvg:CT_SVGBlip","p14:sectionLst":"p14:CT_SectionList","p159:morph":"p159:CT_Morph","p14:reveal":"p14:CT_RevealTransition","p14:warp":"p14:CT_InOutTransition"},EXT_TYPES={"p14:CT_Media":{a:{"r:embed":["s"],"r:link":["s"]},c:{"p14:trim":"p14:CT_MediaTrim","p14:fade":"p14:CT_MediaFade","p14:bmkLst":"x:CT_Any","p14:extLst":"x:CT_Any"}},"p14:CT_MediaTrim":{a:{st:["s"],end:["s"]}},"p14:CT_SectionList":{c:{"p14:section":"p14:CT_Section","p14:extLst":"x:CT_Any"}},"p14:CT_Section":{a:{name:["s"],id:["s"]},c:{"p14:sldIdLst":"p14:CT_SectionSlideIdList","p14:extLst":"x:CT_Any"}},"p14:CT_SectionSlideIdList":{c:{"p14:sldId":"p14:CT_SectionSlideIdListEntry"}},"p14:CT_SectionSlideIdListEntry":{a:{id:["n"]}},"p14:CT_MediaFade":{a:{in:["s"],out:["s"]}},"asvg:CT_SVGBlip":{a:{"r:embed":["s"],"r:link":["s"]}},"p159:CT_Morph":{a:{option:["p159:ST_MorphOption","byObject"]}},"p14:CT_RevealTransition":{a:{thruBlk:["b","false"],dir:["s","l"]}},"p14:CT_InOutTransition":{a:{dir:["s","out"]}},"x:CT_Val":{a:{val:["s"]}},"x:CT_Id":{a:{id:["s"]}},"x:CT_Any":{any:!0}},EXT_ATTRS={"p:CT_SlideTransition":{"p14:dur":["n"]}},EXT_ENUMS={"p159:ST_MorphOption":["byObject","byWord","byChar"]};
@@ -4,7 +4,8 @@ export { applyMce, understands, type McEvent } from "./mce.js";
4
4
  export { Marks, XEl, as, type AnyEl, rootOf, rootType, childType, attrSpec, parseValue, knowsElement, type TypeName, type ChildName, type ChildType, type AttrName, type AttrValue, } from "./node.js";
5
5
  export { leftovers, groupReport, type ReportEntry, type ReportGroup, type ReportKind, } from "./report.js";
6
6
  export { Package, resolvePart, type Relationship } from "./opc.js";
7
- export { colorIn, colorOf, DEFAULT_COLOR_MAP, SCHEME_COLORS, type ColorContext, type ColorMap, type ResolvedColor, type SchemeColor, } from "./color.js";
7
+ export { colorIn, colorOf, DEFAULT_COLOR_MAP, SCHEME_COLORS, type ColorContext, type ColorMap, type ColorStep, type ResolvedColor, type SchemeColor, } from "./color.js";
8
+ export { transformed, type Rgba } from "./transform.js";
8
9
  export { brightened, brightnessOfLum, lumOf } from "./brightness.js";
9
10
  export { ENUMS } from "./generated/enums.js";
10
11
  //# 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{NAMESPACES,qname,transitional,isStrict,uriOf}from"./ns.js";export{parseXml,attrOf}from"./xml.js";export{applyMce,understands}from"./mce.js";export{Marks,XEl,as,rootOf,rootType,childType,attrSpec,parseValue,knowsElement}from"./node.js";export{leftovers,groupReport}from"./report.js";export{Package,resolvePart}from"./opc.js";export{colorIn,colorOf,DEFAULT_COLOR_MAP,SCHEME_COLORS}from"./color.js";export{brightened,brightnessOfLum,lumOf}from"./brightness.js";export{ENUMS}from"./generated/enums.js";
2
+ export{NAMESPACES,qname,transitional,isStrict,uriOf}from"./ns.js";export{parseXml,attrOf}from"./xml.js";export{applyMce,understands}from"./mce.js";export{Marks,XEl,as,rootOf,rootType,childType,attrSpec,parseValue,knowsElement}from"./node.js";export{leftovers,groupReport}from"./report.js";export{Package,resolvePart}from"./opc.js";export{colorIn,colorOf,DEFAULT_COLOR_MAP,SCHEME_COLORS}from"./color.js";export{transformed}from"./transform.js";export{brightened,brightnessOfLum,lumOf}from"./brightness.js";export{ENUMS}from"./generated/enums.js";
@@ -0,0 +1,13 @@
1
+ /** A colour as transforms see it: red, green and blue, each 0 to 1, and its alpha, 0 to 1. */
2
+ export interface Rgba {
3
+ rgb: [number, number, number];
4
+ alpha: number;
5
+ }
6
+ /**
7
+ * A colour after one transform, by its element's local name and its value
8
+ * as the file writes it: a percentage in 100 000ths, an angle (hue, hueOff)
9
+ * in 60 000ths of a degree; transforms of no value (inv, gray, comp, gamma,
10
+ * invGamma) take none.
11
+ */
12
+ export declare function transformed(c: Rgba, name: string, val?: number): Rgba;
13
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{fromHsl as u,toHsl as b}from"./brightness.js";const n=2.3,r=o=>Math.pow(o,n),h=o=>Math.pow(Math.max(0,o),1/n),p=o=>Math.min(1,Math.max(0,o));export function transformed(o,t,d=0){const c=d/1e5;let s=o.rgb,f=o.alpha;if(t.startsWith("alpha"))return f=t==="alpha"?c:t==="alphaMod"?f*c:f+c,{rgb:s,alpha:p(f)};switch(t){case"tint":s=s.map(a=>h(1-(1-r(a))*c));break;case"shade":s=s.map(a=>h(r(a)*c));break;case"inv":s=s.map(a=>h(1-r(a)));break;case"gamma":s=s.map(a=>h(Math.pow(r(a),1/n)));break;case"invGamma":s=s.map(a=>h(Math.pow(r(a),n)));break;case"comp":{const[a,e,i]=b(s);s=u([a+180,e,i]);break}case"gray":{const a=.299*s[0]+.587*s[1]+.114*s[2];s=[a,a,a];break}case"red":case"green":case"blue":case"redMod":case"greenMod":case"blueMod":case"redOff":case"greenOff":case"blueOff":{const a=t.startsWith("red")?0:t.startsWith("green")?1:2,e=s.map(r);e[a]=p(t.endsWith("Mod")?e[a]*c:t.endsWith("Off")?e[a]+c:c),s=e.map(h);break}case"hue":case"hueMod":case"hueOff":case"sat":case"satMod":case"satOff":case"lum":case"lumMod":case"lumOff":{const a=b(s),e=t.startsWith("hue")?0:t.startsWith("sat")?1:2,i=e===0&&t!=="hueMod"?d/6e4:c,l=a[e],M=t.endsWith("Mod")?l*c:t.endsWith("Off")?l+i:i;a[e]=e===0?(M%360+360)%360:p(M),s=u(a);break}}return{rgb:s,alpha:f}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/ooxml",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,6 +18,10 @@
18
18
  "./brightness": {
19
19
  "types": "./dist/brightness.d.ts",
20
20
  "default": "./dist/brightness.js"
21
+ },
22
+ "./transform": {
23
+ "types": "./dist/transform.d.ts",
24
+ "default": "./dist/transform.js"
21
25
  }
22
26
  },
23
27
  "sideEffects": false,
@@ -27,7 +27,7 @@ export interface MediaGen {
27
27
  matches?: boolean;
28
28
  }
29
29
  /**
30
- * A `.gen.json`'s content as a media value's `gen`, or why it cannot be
30
+ * A `.provenance`'s content as a media value's `gen`, or why it cannot be
31
31
  * read. `sha256` is the media file's own.
32
32
  */
33
33
  export declare function mediaGen(record: string, value: unknown, sha256: string): {
@@ -50,7 +50,7 @@ export interface GeneratedUse {
50
50
  start?: number;
51
51
  end?: number;
52
52
  }
53
- /** A generated file a version shows or plays (it has a `.gen.json` record whose `ai` is not false). */
53
+ /** A generated file a version shows or plays (it has a `.provenance` record whose `ai` is not false). */
54
54
  export interface GeneratedFile {
55
55
  file: string;
56
56
  kind: MediaKind;
@@ -70,7 +70,7 @@ export interface GeneratedFile {
70
70
  /** What the facts of generated media measure: every kind's, a contract between kinds. */
71
71
  export interface GeneratedFactData {
72
72
  /**
73
- * The generated media a version shows or plays, from the `.gen.json`
73
+ * The generated media a version shows or plays, from the `.provenance`
74
74
  * records beside its files, and when: one per output × combo × format
75
75
  * that uses any. Whether a platform's AI label is needed is the
76
76
  * agent's to decide.
@@ -83,7 +83,7 @@ export interface GeneratedFactData {
83
83
  estimated?: true;
84
84
  };
85
85
  /**
86
- * A `.gen.json` record that does not hold for the file beside it: its
86
+ * A `.provenance` record that does not hold for the file beside it: its
87
87
  * sha256 is another file's (the record was moved or copied without its
88
88
  * media, or the media was changed), or it cannot be read. One per piece
89
89
  * that reads the file.
@@ -74,12 +74,12 @@ export interface MediaInfo {
74
74
  /** A take: what is heard between its words, reported, never removed on its own. */
75
75
  sounds?: UnheardSound[];
76
76
  /**
77
- * The file's provenance, from the `<file>.gen.json` beside it (gen.ts):
77
+ * The file's provenance, from the `<file>.provenance` beside it (gen.ts):
78
78
  * the tool that generated it, when, from what input. Absent without a
79
79
  * readable record.
80
80
  */
81
81
  gen?: MediaGen;
82
- /** A `<file>.gen.json` beside it that could not be read, and why. */
82
+ /** A `<file>.provenance` beside it that could not be read, and why. */
83
83
  genUnread?: {
84
84
  record: string;
85
85
  error: string;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/piece",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -42,10 +42,17 @@ export type Profile = z.infer<typeof ProfileSchema>;
42
42
  /** The roles of a team, the strongest last. */
43
43
  export declare const ROLES: readonly ["member", "admin", "owner"];
44
44
  export type Role = (typeof ROLES)[number];
45
- /** One call: its route (a `:name` filled from the parameter of that name) and its method; the other parameters are the query of a GET or a DELETE, else the body. */
45
+ /**
46
+ * One call: its route (a `:name` filled from the parameter of that name)
47
+ * and its method; a parameter named in `headers` is sent as that request
48
+ * header; the other parameters are the query of a GET or a DELETE, else
49
+ * the body.
50
+ */
46
51
  export interface AccountCall<P extends z.ZodType = z.ZodType, R extends z.ZodType = z.ZodType> extends MethodSpec<P, R> {
47
52
  http: "GET" | "POST" | "PUT" | "DELETE";
48
53
  route: string;
54
+ /** The parameters sent as request headers, each by its header's name. */
55
+ headers?: Readonly<Record<string, string>>;
49
56
  }
50
57
  export declare const ACCOUNT_CALLS: {
51
58
  readonly balance: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
@@ -336,6 +343,7 @@ export declare const ACCOUNT_CALLS: {
336
343
  }, z.core.$strip>>;
337
344
  readonly topUp: AccountCall<z.ZodObject<{
338
345
  topUpCents: z.ZodNumber;
346
+ key: z.ZodUUID;
339
347
  }, z.core.$strict>, z.ZodObject<{
340
348
  credits: z.ZodNumber;
341
349
  }, z.core.$strip>>;
@@ -437,8 +445,8 @@ export declare const ACCOUNT_CALLS: {
437
445
  displayName: z.ZodString;
438
446
  retentionDays: z.ZodNumber;
439
447
  sendPolicy: z.ZodUnion<readonly [z.ZodEnum<{
440
- off: "off";
441
448
  team: "team";
449
+ off: "off";
442
450
  anyone: "anyone";
443
451
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
444
452
  sendsLeft: z.ZodNumber;
@@ -456,8 +464,8 @@ export declare const ACCOUNT_CALLS: {
456
464
  readonly "mail/settings": AccountCall<z.ZodObject<{
457
465
  displayName: z.ZodOptional<z.ZodString>;
458
466
  sendPolicy: z.ZodOptional<z.ZodEnum<{
459
- off: "off";
460
467
  team: "team";
468
+ off: "off";
461
469
  anyone: "anyone";
462
470
  }>>;
463
471
  retentionDays: z.ZodOptional<z.ZodNumber>;
@@ -466,8 +474,8 @@ export declare const ACCOUNT_CALLS: {
466
474
  displayName: z.ZodString;
467
475
  retentionDays: z.ZodNumber;
468
476
  sendPolicy: z.ZodUnion<readonly [z.ZodEnum<{
469
- off: "off";
470
477
  team: "team";
478
+ off: "off";
471
479
  anyone: "anyone";
472
480
  }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
473
481
  sendsLeft: z.ZodNumber;
@@ -586,6 +594,41 @@ export declare const ACCOUNT_CALLS: {
586
594
  readonly "profile/set": AccountCall<z.ZodObject<{
587
595
  name: z.ZodString;
588
596
  }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
597
+ readonly storage: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
598
+ keptBytes: z.ZodNumber;
599
+ capBytes: z.ZodNullable<z.ZodNumber>;
600
+ }, z.core.$strip>>;
601
+ readonly "storage/projects": AccountCall<z.ZodObject<{
602
+ page: z.ZodInt;
603
+ }, z.core.$strict>, z.ZodObject<{
604
+ items: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<{
605
+ id: string;
606
+ kind: "home" | "project";
607
+ name: string;
608
+ bytes: number;
609
+ versions: number;
610
+ madeAt: string | null;
611
+ }[], unknown[]>>;
612
+ total: z.ZodNumber;
613
+ }, z.core.$strip>>;
614
+ readonly "storage/files": AccountCall<z.ZodObject<{
615
+ page: z.ZodInt;
616
+ }, z.core.$strict>, z.ZodObject<{
617
+ items: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<{
618
+ id: string;
619
+ name: string;
620
+ contentType: string;
621
+ size: number;
622
+ keptUntil: string;
623
+ }[], unknown[]>>;
624
+ total: z.ZodNumber;
625
+ }, z.core.$strip>>;
626
+ readonly "files/delete": AccountCall<z.ZodObject<{
627
+ id: z.ZodString;
628
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
629
+ readonly "projects/delete": AccountCall<z.ZodObject<{
630
+ id: z.ZodString;
631
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
589
632
  readonly devices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
590
633
  devices: z.ZodArray<z.ZodObject<{
591
634
  id: z.ZodString;
@@ -609,10 +652,11 @@ export declare const ACCOUNT_CALLS: {
609
652
  };
610
653
  export type AccountCalls = typeof ACCOUNT_CALLS;
611
654
  export type AccountCallName = keyof AccountCalls;
612
- /** A call as an HTTP request: its method, its path with the route's parameters and a GET's or a DELETE's query, and a body. */
655
+ /** A call as an HTTP request: its method, its path with the route's parameters and a GET's or a DELETE's query, a body, and the headers the call names. */
613
656
  export declare function accountRequest(c: AccountCall, params: unknown): {
614
657
  method: AccountCall["http"];
615
658
  path: string;
616
659
  body?: unknown;
660
+ headers?: Record<string, string>;
617
661
  };
618
662
  //# sourceMappingURL=account.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{z as e}from"zod";import{ACCOUNT_DELETE_PATH as _,ACCOUNT_EXPORT_PATH as f,DEVICES_PATH as p,DevicesSchema as y}from"./auth.js";import{AUTO_TOP_UP_PATH as b,AutoTopUpRequestSchema as L,BILLING_CHECKOUT_PATH as v,BILLING_PAYMENT_PATH as G,BILLING_PLANS_PATH as j,BILLING_PORTAL_PATH as U,BILLING_REQUEST_PATH as H,BILLING_RESUME_PATH as k,BILLING_SUMMARY_PATH as N,BILLING_TOP_UP_PATH as C,BILLING_USAGE_PATH as R,BillingPaymentSchema as x,BillingPlansSchema as M,BillingSummarySchema as u,BillingUsageSchema as B,CheckoutRequestSchema as D,PortalRequestSchema as $,TopUpRequestSchema as z,BILLING_INVOICES_PATH as q,BILLING_SPENDS_PATH as V,BillingInvoicesSchema as Y,CAPABILITIES_PATH as A,CATALOG_PATH as Z,EDITORS_PATH as K,EditorsSchema as F,CapabilitiesSchema as E,CapabilityRequestSchema as Q,CatalogSchema as X,BillingSpendsSchema as J}from"./cloud.js";import{MAIL_MESSAGES_PATH as g,MAIL_PATH as W,MAIL_PERSON_QUERY as ee,MAIL_SETTINGS_PATH as te,MailMessageSchema as ie,MailSearchResponseSchema as ne,MailSearchSchema as oe,MailSettingsSchema as se,MailboxSchema as S}from"./mail.js";import{MEMBERS_PATH as l,MemberLimitSchema as ae,MembersSchema as re,ORGANIZATIONS_PATH as P,ORGANIZATION_PATH as I}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const i=e.strictObject({}),n=e.object({}),w=e.object({url:e.url()}),d=e.string().trim().min(1).max(100),t=(o,h,m,c,s)=>({http:o,route:h,params:m,result:c,about:s});export const ACCOUNT_CALLS={balance:t("GET",N,i,u,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",j,i,M,"The plans, their prices, and what a top-up buys."),usage:t("GET",R,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),B,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",Z,i,X,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",K,i,F,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",A,i,E,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",A,Q,E,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",V,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),J,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",v,D,w,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",U,$,w,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",k,i,u,"A plan cancelled at its period's end taken up again."),payment:t("GET",G,i,x,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",q,i,Y,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",C,z,e.object({credits:e.number()}),"Credits bought with the saved card at once; answers what was added."),"autoTopUp/set":t("PUT",b,L,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser."),"autoTopUp/off":t("DELETE",b,i,n,"Auto top-up off."),"credits/request":t("POST",H,i,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",l,i,re,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${l}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ae.shape),n,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${l}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),n,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${l}/:userId`,e.strictObject({userId:e.string().min(1)}),n,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,i,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),n,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An invitation cancelled."),"team/create":t("POST",P,e.strictObject({name:d}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",I,e.strictObject({name:d}),n,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,i,n,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",I,i,n,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${P}/:id/restore`,e.strictObject({id:e.string().min(1)}),n,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,i,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:d}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),n,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),n,"An API key deleted."),mail:t("GET",W,i,S,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${te}?${ee}`,se,S,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",g,oe,ne,"The mailbox's messages, newest first."),"mail/message":t("GET",`${g}/:id`,e.strictObject({id:e.string().min(1)}),ie,"One message, read whole."),profile:t("GET",PROFILE_PATH,i,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:d}),n,"The person's name."),devices:t("GET",p,i,y,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${p}/:id`,e.strictObject({id:e.string().min(1)}),n,"A computer signed out."),"devices/signOutOthers":t("DELETE",p,i,n,"Every computer signed out but the one that asks."),export:t("GET",f,i,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",_,i,n,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(o,h){const m=h,c=new Set,s=o.route.replace(/:([A-Za-z]+)/gu,(r,a)=>(c.add(a),encodeURIComponent(String(m[a])))),T=Object.entries(m).filter(([r,a])=>!c.has(r)&&a!==void 0);if(o.http==="GET"||o.http==="DELETE"){const r=T.map(([a,O])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(O))}`).join("&");return{method:o.http,path:r===""?s:`${s}?${r}`}}return T.length===0?{method:o.http,path:s}:{method:o.http,path:s,body:Object.fromEntries(T)}}
2
+ import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as j,ACCOUNT_EXPORT_PATH as G,DEVICES_PATH as b,DevicesSchema as v}from"./auth.js";import{FILES_PATH as H,AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as k,BILLING_CHECKOUT_PATH as U,BILLING_PAYMENT_PATH as C,BILLING_PLANS_PATH as R,BILLING_PORTAL_PATH as N,BILLING_REQUEST_PATH as x,BILLING_RESUME_PATH as M,BILLING_SUMMARY_PATH as B,BILLING_TOP_UP_PATH as D,BILLING_USAGE_PATH as $,BillingPaymentSchema as z,BillingPlansSchema as q,BillingSummarySchema as S,BillingUsageSchema as Y,CheckoutRequestSchema as F,PortalRequestSchema as K,TopUpRequestSchema as V,BILLING_INVOICES_PATH as Z,BILLING_SPENDS_PATH as J,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as X,EDITORS_PATH as ee,EditorsSchema as te,CapabilitiesSchema as O,CapabilityRequestSchema as se,CatalogSchema as oe,BillingSpendsSchema as ie}from"./cloud.js";import{PROJECTS_PATH as ne,STORAGE_FILES_PATH as ae,STORAGE_PATH as re,STORAGE_PROJECTS_PATH as ce,StoragePageSchema as w,StorageSchema as me,StoredFilesSchema as le,StoredProjectsSchema as he}from"./snapshots.js";import{MAIL_MESSAGES_PATH as f,MAIL_PATH as de,MAIL_PERSON_QUERY as pe,MAIL_SETTINGS_PATH as Te,MailMessageSchema as ue,MailSearchResponseSchema as Ee,MailSearchSchema as be,MailSettingsSchema as ge,MailboxSchema as I}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as Ae,MembersSchema as Se,ORGANIZATIONS_PATH as _,ORGANIZATION_PATH as y}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const s=e.strictObject({}),o=e.object({}),L=e.object({url:e.url()}),p=e.string().trim().min(1).max(100),t=(i,T,c,l,r,m)=>({http:i,route:T,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",B,s,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",R,s,q,"The plans, their prices, and what a top-up buys."),usage:t("GET",$,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),Y,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",X,s,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",ee,s,te,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,s,O,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,se,O,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",J,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),ie,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",U,F,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",N,K,L,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",M,s,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",C,s,z,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",Z,s,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",D,V.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,k,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser. A browser's session alone."),"autoTopUp/off":t("DELETE",A,s,o,"Auto top-up off."),"credits/request":t("POST",x,s,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",d,s,Se,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(Ae.shape),o,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),o,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),o,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,s,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),o,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),o,"An invitation cancelled."),"team/create":t("POST",_,e.strictObject({name:p}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:p}),o,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,s,o,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,s,o,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${_}/:id/restore`,e.strictObject({id:e.string().min(1)}),o,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,s,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:p}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),o,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),o,"An API key deleted."),mail:t("GET",de,s,I,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${Te}?${pe}`,ge,I,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",f,be,Ee,"The mailbox's messages, newest first."),"mail/message":t("GET",`${f}/:id`,e.strictObject({id:e.string().min(1)}),ue,"One message, read whole."),profile:t("GET",PROFILE_PATH,s,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:p}),o,"The person's name."),storage:t("GET",re,s,me,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",ce,w,he,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",ae,w,le,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"files/delete":t("DELETE",`${H}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's tools' inputs or outputs deleted from the cloud; its bytes stay while a project names them."),"projects/delete":t("DELETE",`${ne}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's projects deleted from the cloud, with its snapshots; a copy on a computer stays."),devices:t("GET",b,s,v,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),o,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,s,o,"Every computer signed out but the one that asks."),export:t("GET",G,s,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",j,s,o,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(i,T){const c=T,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
@@ -66,6 +66,62 @@ export declare const BrowserLinkSchema: z.ZodObject<{
66
66
  url: z.ZodURL;
67
67
  }, z.core.$strip>;
68
68
  export type BrowserLink = z.infer<typeof BrowserLinkSchema>;
69
+ /**
70
+ * `GET`, open to anyone: what AllyHub's own sign-in page needs before it
71
+ * asks for a sign-in link. `turnstile` is there where a link is sent only
72
+ * to a request that carries Cloudflare Turnstile's token (the page draws
73
+ * the widget with `siteKey` and sends its token as `CAPTCHA_HEADER`).
74
+ */
75
+ export declare const SIGN_IN_PATH = "/api/sign-in";
76
+ export declare const SignInSchema: z.ZodObject<{
77
+ turnstile: z.ZodOptional<z.ZodObject<{
78
+ siteKey: z.ZodString;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strip>;
81
+ export type SignIn = z.infer<typeof SignInSchema>;
82
+ /** The header a request for a sign-in link carries Turnstile's token in (Better Auth's captcha plugin's name for it). */
83
+ export declare const CAPTCHA_HEADER = "x-captcha-response";
84
+ /**
85
+ * `POST { email, authorization }`, open to anyone, a few times in ten
86
+ * minutes from one address: AllyHub mails `email` a link that signs a
87
+ * browser in and goes on to `authorization`, the authorization a program
88
+ * on this computer began for its own sign-in (AllyHub's client, the code
89
+ * back to its loopback; anything else is refused). It is how a program
90
+ * with no page of AllyHub's to ask from signs in by email (Studio's
91
+ * Welcome): the person stays in the program, and the link, followed in a
92
+ * browser on that computer, signs the computer in. AllyHub's own sign-in
93
+ * page asks Better Auth's route instead, with Turnstile's token where its
94
+ * keys are set; this route takes none, a program having nowhere to get
95
+ * one. Answers `{}` whether or not the address has an account.
96
+ */
97
+ export declare const SIGN_IN_LINK_PATH = "/api/auth/sign-in/link";
98
+ export declare const SignInLinkRequestSchema: z.ZodObject<{
99
+ email: z.ZodEmail;
100
+ authorization: z.ZodURL;
101
+ }, z.core.$strict>;
102
+ export type SignInLinkRequest = z.infer<typeof SignInLinkRequestSchema>;
103
+ /**
104
+ * The scheme of the link that brings AllyHub's desktop app to the front (a
105
+ * private-use scheme, as RFC 8252 7.1 names them): the app registers it,
106
+ * and a page of AllyHub's links to it. A link of it carries nothing. A
107
+ * computer's sign-in comes back by the loopback, never by it, so a program
108
+ * that took the scheme for itself would learn nothing.
109
+ */
110
+ export declare const DESKTOP_SCHEME = "allyhub";
111
+ /** The link that brings the desktop app to the front, and does nothing else. */
112
+ export declare const DESKTOP_OPEN = "allyhub://open";
113
+ /**
114
+ * The page a computer's sign-in lands on in the browser (its loopback
115
+ * sends the browser there). `desktop` says the sign-in was the desktop
116
+ * app's and a link opens it (`DESKTOP_OPEN`): the page then offers to
117
+ * bring it forward, which an app cannot do for itself from behind the
118
+ * browser the person is in.
119
+ */
120
+ export declare function signedInAddress(origin: string, o?: {
121
+ desktop?: boolean | undefined;
122
+ }): string;
123
+ /** Whether the signed-in page's address says the sign-in was the desktop app's. */
124
+ export declare function signedInFromDesktop(search: string): boolean;
69
125
  /** The credentials file, relative to the home folder (ALLYHUB_HOME moves it). */
70
126
  export declare const CREDENTIALS_FILE = ".allyhub/credentials.json";
71
127
  /** A token endpoint's answer (RFC 6749 5.1). */
@@ -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";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});
2
+ import{z as e}from"zod";export const AuthServerSchema=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),device_authorization_endpoint:e.url(),revocation_endpoint:e.url(),code_challenge_methods_supported:e.array(e.string()).refine(t=>t.includes("S256"),{message:"The server must take S256 PKCE challenges."})}),CLIENT_ID="allyhub-cli",ISSUER_PATH="/api/auth",METADATA_PATH=`/.well-known/oauth-authorization-server${ISSUER_PATH}`,SCOPES="openid profile email offline_access",ACCOUNT_PATH="/api/account",ORGANIZATION_HEADER="x-allyhub-organization",DEVICES_PATH="/api/account/devices",DEVICE_HEADER="x-allyhub-device",DEVICE_NAME_HEADER="x-allyhub-device-name",DeviceIdSchema=e.string().regex(/^[\w-]{16,64}$/u),ACCOUNT_EXPORT_PATH="/api/account/export",ACCOUNT_DELETE_PATH="/api/account/delete",DevicesSchema=e.object({devices:e.array(e.object({id:e.string(),client:e.string(),signedInAt:e.iso.datetime(),lastActiveAt:e.iso.datetime(),name:e.string().nullable().optional(),app:e.string().nullable().optional(),os:e.string().nullable().optional(),city:e.string().nullable().optional(),country:e.string().nullable().optional(),current:e.boolean().optional()}))}),BROWSER_LINK_PATH="/api/account/browser-link",BrowserLinkRequestSchema=e.strictObject({to:e.string().startsWith("/")}),BrowserLinkSchema=e.object({url:e.url()}),SIGN_IN_PATH="/api/sign-in",SignInSchema=e.object({turnstile:e.object({siteKey:e.string().min(1)}).optional()}),CAPTCHA_HEADER="x-captcha-response",SIGN_IN_LINK_PATH=`${ISSUER_PATH}/sign-in/link`,SignInLinkRequestSchema=e.strictObject({email:e.email(),authorization:e.url()}),DESKTOP_SCHEME="allyhub",DESKTOP_OPEN=`${DESKTOP_SCHEME}://open`;export function signedInAddress(t,o={}){return`${t}/signed-in${o.desktop===!0?"?from=desktop":""}`}export function signedInFromDesktop(t){return new URLSearchParams(t).get("from")==="desktop"}export const CREDENTIALS_FILE=".allyhub/credentials.json",TokenResponseSchema=e.object({access_token:e.string().min(1),token_type:e.string(),expires_in:e.number().positive(),refresh_token:e.string().min(1).optional(),scope:e.string().optional()}),OAuthErrorSchema=e.object({error:e.string(),error_description:e.string().optional()}),DeviceAuthorizationSchema=e.object({device_code:e.string().min(1),user_code:e.string().min(1),verification_uri:e.url(),verification_uri_complete:e.url().optional(),expires_in:e.number().positive(),interval:e.number().positive().optional()}),AccountSchema=e.object({id:e.string().min(1),email:e.email(),name:e.string().optional(),organization:e.object({id:e.string().min(1),name:e.string()}).optional()}),CredentialsFileSchema=e.object({version:e.literal(1),url:e.url(),issuer:e.url(),account:AccountSchema,refreshToken:e.string().min(1).optional(),access:e.object({token:e.string().min(1),expiresAt:e.iso.datetime({offset:!0})}).optional(),keychain:e.string().min(1).optional(),since:e.iso.datetime({offset:!0}),device:e.string().min(1).optional()});