allyhub 0.2.0-next.2 → 0.2.0-next.4

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 (67) hide show
  1. package/client.d.ts +5 -1
  2. package/dist/charge.js +2 -0
  3. package/dist/commands/add.js +5 -5
  4. package/dist/commands/check.js +1 -1
  5. package/dist/commands/cloud-tools.js +10 -10
  6. package/dist/commands/index.js +1 -1
  7. package/dist/commands/mcp.js +1 -1
  8. package/dist/commands/skills.js +4 -0
  9. package/dist/commands/voice.js +2 -2
  10. package/dist/lent/model-three.d.ts +2 -0
  11. package/dist/main.js +4 -4
  12. package/dist/resources.js +2 -0
  13. package/dist/works.js +1 -1
  14. package/editor-app/view.html +4 -4
  15. package/editor-web/assets/chevron-left-B1KTa28S.js +1 -0
  16. package/editor-web/assets/{chevron-up-DdzgESXy.js → chevron-up-B2IfPYC4.js} +1 -1
  17. package/editor-web/assets/{dist-CiIDdJZw.js → dist-ChU-0IAY.js} +1 -1
  18. package/editor-web/assets/{dist-DqFDRJ1S.js → dist-CuyNR3bn.js} +2 -2
  19. package/editor-web/assets/{dist-DlzWTZjN.js → dist-DCgVauDD.js} +1 -1
  20. package/editor-web/assets/{dist-ZLZyLIPV.js → dist-VsUk3S-a.js} +1 -1
  21. package/editor-web/assets/{floating-ui.react-dom-BrYYB6DH.js → floating-ui.react-dom-C6Aeuo3L.js} +1 -1
  22. package/editor-web/assets/index-BoYpZLq7.js +56 -0
  23. package/editor-web/assets/{react-DIqYlXoe.js → react-CSPssXRH.js} +3 -3
  24. package/editor-web/assets/{undo-2-oaEQLQ47.js → undo-2-D6qCS-P0.js} +1 -1
  25. package/editor-web/index.html +3 -3
  26. package/node_modules/@allyhub-next/audio/package.json +1 -1
  27. package/node_modules/@allyhub-next/browser/package.json +1 -1
  28. package/node_modules/@allyhub-next/build/package.json +1 -1
  29. package/node_modules/@allyhub-next/check/package.json +1 -1
  30. package/node_modules/@allyhub-next/cloud/dist/call.js +2 -2
  31. package/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  32. package/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  33. package/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  34. package/node_modules/@allyhub-next/cloud/dist/price.js +1 -1
  35. package/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  36. package/node_modules/@allyhub-next/cloud/package.json +1 -1
  37. package/node_modules/@allyhub-next/components/package.json +1 -1
  38. package/node_modules/@allyhub-next/dev-server/dist/live.d.ts +1 -1
  39. package/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  40. package/node_modules/@allyhub-next/dev-server/package.json +1 -1
  41. package/node_modules/@allyhub-next/doc/package.json +1 -1
  42. package/node_modules/@allyhub-next/export/package.json +1 -1
  43. package/node_modules/@allyhub-next/formats/package.json +1 -1
  44. package/node_modules/@allyhub-next/measure/package.json +1 -1
  45. package/node_modules/@allyhub-next/media/package.json +1 -1
  46. package/node_modules/@allyhub-next/model/package.json +1 -1
  47. package/node_modules/@allyhub-next/project/package.json +1 -1
  48. package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +108 -1
  49. package/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  50. package/node_modules/@allyhub-next/protocol/package.json +1 -1
  51. package/node_modules/@allyhub-next/registry/package.json +1 -1
  52. package/node_modules/@allyhub-next/render/package.json +1 -1
  53. package/node_modules/@allyhub-next/runtime/package.json +1 -1
  54. package/node_modules/@allyhub-next/runtimes/manifest.json +88 -14
  55. package/node_modules/@allyhub-next/runtimes/package.json +1 -1
  56. package/node_modules/@allyhub-next/scaffold/LICENSE +241 -0
  57. package/node_modules/@allyhub-next/scaffold/dist/index.js +16 -0
  58. package/node_modules/@allyhub-next/scaffold/package.json +13 -0
  59. package/node_modules/@allyhub-next/scenery/package.json +1 -1
  60. package/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  61. package/node_modules/@allyhub-next/sheet/package.json +1 -1
  62. package/node_modules/@allyhub-next/site/package.json +1 -1
  63. package/node_modules/@allyhub-next/stage/package.json +1 -1
  64. package/node_modules/@allyhub-next/video-core/package.json +1 -1
  65. package/package.json +32 -27
  66. package/editor-web/assets/chevron-left-BWWKfQPt.js +0 -1
  67. package/editor-web/assets/index-DYkuF7LX.js +0 -56
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{accessToken,billingSummary,organizations}from"./token.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{estimatePrice,priceCalls,priceText,withDefaults}from"./price.js";export{POLL_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,quoteSays,sayInput}from"./voice.js";
2
+ export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{accessToken,billingSummary,organizations}from"./token.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{estimatePrice,priceCalls,priceText,withDefaults}from"./price.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,declined,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,quoteSays,sayInput}from"./voice.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const k=new Set(["input_count","input_block","input_value"]),_={request:["supplier request","supplier requests"],result:["result","results"],second:["second of media","seconds of media"],reference_second:["second of reference media","seconds of reference media"],usd:["dollar the AI model's provider charges","dollars the AI model's provider charges"],"1k_characters":["thousand characters","thousand characters"],"1k_tokens":["thousand prompt, reference and reasoning tokens","thousand prompt, reference and reasoning tokens"],image:["image","images"],"1k_output_tokens":["thousand text tokens generated","thousand text tokens generated"],"1k_image_tokens":["thousand image tokens generated","thousand image tokens generated"],search:["web search","web searches"],input_count:["item in","items in"],input_block:["block of","blocks of"],input_value:["of","of"]},c=e=>Math.round(e*1e6)/1e6,f=(e,r)=>{const n=r===void 0?void 0:e[r];return typeof n=="number"&&Number.isFinite(n)?n:void 0};function b(e,r){if(e.tiers&&e.tierField){const n=r[e.tierField],t=typeof n=="string"||typeof n=="number"?String(n):void 0,s=t===void 0?void 0:e.tiers[t];if(t!==void 0&&s!==void 0)return{rate:s,tier:t}}return{rate:e.credits,tier:void 0}}function g(e,r){const n=e.typical??0;if(e.meter==="input_count"){const i=e.field===void 0?void 0:r[e.field];return Array.isArray(i)?{units:i.length,estimated:!1}:{units:n,estimated:!0}}if(e.meter==="input_block"){const i=f(r,e.field);return i===void 0?{units:n,estimated:!0}:{units:Math.ceil(i/(e.size??1)),estimated:!1}}if(e.meter==="input_value"){const i=f(r,e.field);return i===void 0?{units:n,estimated:!0}:{units:i,estimated:!1}}const t=e.field===void 0?void 0:r[e.field];if(e.meter==="1k_characters"&&typeof t=="string")return{units:t.length/1e3,estimated:!1};const s=f(r,e.field);return s===void 0?{units:n,estimated:!0}:{units:e.meter==="1k_characters"?s/1e3:s,estimated:!0}}export function estimatePrice(e,r){const n=[];e.baseCredits>0&&n.push({what:"per call",units:1,rate:e.baseCredits,credits:e.baseCredits,estimated:!1,unknown:!1});for(const t of e.parts){const{units:s,estimated:i}=g(t,r),u=Math.max(0,s-(t.free??0)),{rate:d,tier:l}=b(t,r),[m,h]=_[t.meter]??[t.meter,t.meter],a=s===1?m:h,p=t.meter==="input_block"?`${a} ${String(t.size??1)} in \`${t.field??""}\``:k.has(t.meter)?`${a} \`${t.field??""}\``:a;n.push({what:[`${String(c(s))} ${p}`,l?`(${l})`:"",t.free?`(first ${String(t.free)} free)`:""].filter(Boolean).join(" "),units:s,rate:d,credits:c(u*d),estimated:i,unknown:i&&s===0})}return{credits:c(n.reduce((t,s)=>t+s.credits,0)),lines:n,estimated:n.some(t=>t.estimated)}}export function withDefaults(e,r){const n=e.properties,t={};if(n&&typeof n=="object")for(const[s,i]of Object.entries(n))i&&typeof i=="object"&&"default"in i&&(t[s]=i.default);return{...t,...r}}export function priceCalls(e,r,n){const t=n.map(s=>{const i=withDefaults(r,s);return{input:i,...estimatePrice(e,i)}});return{calls:t,credits:Math.round(t.reduce((s,i)=>s+i.credits,0)*1e4)/1e4,estimated:t.some(s=>s.estimated)}}const $={request:"supplier request",result:"result",second:"second",reference_second:"second of reference media",usd:"dollar the model's provider charges","1k_characters":"1,000 characters","1k_bytes":"1,000 bytes","1k_tokens":"1,000 tokens","1k_output_tokens":"1,000 tokens generated",image:"image","1k_image_tokens":"1,000 image tokens",search:"web search"},o=e=>new Intl.NumberFormat("en-US",{maximumFractionDigits:4}).format(e);function y(e){const r=e.tiers?Object.values(e.tiers):[e.credits],n=Math.min(...r),t=Math.max(...r),s=n===t?o(n):`${o(n)}–${o(t)}`,i=e.tierField?` by ${e.tierField}`:"",u=e.meter==="input_count"?`item in ${e.field??"the input"}`:e.meter==="input_block"?`${o(e.size??1)} of ${e.field??"the input"}`:e.meter==="input_value"?`unit of ${e.field??"the input"}`:$[e.meter]??e.meter.replaceAll("_"," "),d=e.free?` beyond ${o(e.free)}`:"";return`${s} per ${u}${d}${i}`}export function priceText(e){const r=e.parts.map(y);return r.length===0?`${o(e.baseCredits)} credits per call`:`${e.baseCredits>0?`${o(e.baseCredits)} credits per call + `:"credits: "}${r.join(" + ")}`}
2
+ const M=new Set(["input_count","input_block","input_value"]),S={request:["supplier request","supplier requests"],result:["result","results"],second:["second of media","seconds of media"],reference_second:["second of reference media","seconds of reference media"],usd:["dollar the AI model's provider charges","dollars the AI model's provider charges"],"1k_characters":["thousand characters","thousand characters"],"1k_tokens":["thousand prompt, reference and reasoning tokens","thousand prompt, reference and reasoning tokens"],image:["image","images"],"1k_output_tokens":["thousand text tokens generated","thousand text tokens generated"],"1k_image_tokens":["thousand image tokens generated","thousand image tokens generated"],search:["web search","web searches"],input_count:["item in","items in"],input_block:["block of","blocks of"],input_value:["of","of"]},m=e=>Math.round(e*1e6)/1e6,p=(e,r)=>{const n=r===void 0?void 0:e[r];return typeof n=="number"&&Number.isFinite(n)?n:void 0};function q(e,r){let n=e;for(const s of r.split(".")){if(n===null||typeof n!="object"||Array.isArray(n))return;n=n[s]}return n}function F(e,r){const n=q(e,r);return n===void 0?null:typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:void 0}const b=(e,r,n)=>{const s=e.when[r];return s===void 0||n!==void 0&&s.includes(n)};function C(e,r){if(e.rates){const n=[...new Set(e.rates.flatMap(t=>Object.keys(t.when)))],s=new Map(n.map(t=>[t,F(r,t)])),i=e.rates.find(t=>n.every(d=>b(t,d,s.get(d))));if(i)return{rate:i.credits,label:i.label,assumed:Object.entries(i.when).filter(([t,d])=>s.get(t)===null&&d.some(a=>a!==null)).map(([t])=>t),dependsOn:[]};const o=n.filter(t=>!e.rates?.some(d=>b(d,t,s.get(t))));return{assumed:[],dependsOn:o.length?o:n}}if(e.tiers&&e.tierField){const n=r[e.tierField],s=typeof n=="string"||typeof n=="number"?String(n):void 0,i=s===void 0?void 0:e.tiers[s];if(s!==void 0&&i!==void 0)return{rate:i,label:`at ${e.tierField} ${s}`,assumed:[],dependsOn:[]}}return{rate:e.credits,assumed:[],dependsOn:[]}}function I(e,r){const n={units:e.typical??0,estimated:!0,typical:e.typical!==void 0,missing:e.typical===void 0},s=(t,d)=>({units:t,estimated:d,typical:!1,missing:!1});if(e.meter==="input_count"){const t=e.field===void 0?void 0:r[e.field];return Array.isArray(t)?s(t.length,!1):n}if(e.meter==="input_block"){const t=p(r,e.field);return t===void 0?n:s(Math.ceil(t/(e.size??1)),!1)}if(e.meter==="input_value"){const t=p(r,e.field);return t===void 0?n:s(t,!1)}const i=e.field===void 0?void 0:r[e.field];if(e.meter==="1k_characters"&&typeof i=="string")return s(i.length/1e3,!1);const o=p(r,e.field);return o===void 0?n:s(e.meter==="1k_characters"?o/1e3:o,!0)}export function estimatePrice(e,r){const n=[],s=t=>({assumed:[],typical:!1,dependsOn:[],...t});e.baseCredits>0&&n.push(s({what:"per call",units:1,per:"call",rate:e.baseCredits,credits:e.baseCredits,estimated:!1,unknown:!1}));const i=e.quote??e.parts;for(const t of i){const{units:d,estimated:a,typical:$,missing:f}=I(t,r),y=Math.max(0,d-(t.free??0)),{rate:c,label:k,assumed:w,dependsOn:v}=C(t,r),[O,g]=S[t.meter]??[t.meter,t.meter],l=d===1?O:g,j=t.meter==="input_block"?`${l} ${String(t.size??1)} in \`${t.field??""}\``:M.has(t.meter)?`${l} \`${t.field??""}\``:l,A=[...f&&t.field!==void 0?[t.field]:[],...v];n.push(s({what:[f?g:`${String(m(d))} ${j}`,t.free?`(first ${String(t.free)} free)`:""].filter(Boolean).join(" "),units:d,per:h(t),...t.field===void 0?{}:{field:t.field},...c===void 0?{}:{rate:c},...k===void 0?{}:{label:k},assumed:w,typical:$,credits:c===void 0||f?0:m(y*c),estimated:a,unknown:c===void 0||f,dependsOn:A}))}const o=n.filter(t=>t.unknown);return{credits:m(n.reduce((t,d)=>t+d.credits,0)),lines:n,estimated:n.some(t=>t.estimated),unknown:o.length>0,dependsOn:[...new Set(o.flatMap(t=>t.dependsOn))]}}export function withDefaults(e,r){const n=e.properties,s={};if(n&&typeof n=="object")for(const[i,o]of Object.entries(n))o&&typeof o=="object"&&"default"in o&&(s[i]=o.default);return{...s,...r}}export function priceCalls(e,r,n){const s=n.map(i=>{const o=withDefaults(r,i);return{input:o,...estimatePrice(e,o)}});return{calls:s,credits:Math.round(s.reduce((i,o)=>i+o.credits,0)*1e4)/1e4,estimated:s.some(i=>i.estimated),unknown:s.some(i=>i.unknown)}}const T={request:"supplier request",result:"result",second:"second",reference_second:"second of reference media",usd:"dollar the model's provider charges","1k_characters":"1,000 characters","1k_bytes":"1,000 bytes","1k_tokens":"1,000 tokens","1k_output_tokens":"1,000 tokens generated",image:"image","1k_image_tokens":"1,000 image tokens",search:"web search"},u=e=>new Intl.NumberFormat("en-US",{maximumFractionDigits:4}).format(e);function h(e){return e.meter==="input_count"?`item in ${e.field??"the input"}`:e.meter==="input_block"?`${u(e.size??1)} of ${e.field??"the input"}`:e.meter==="input_value"?`unit of ${e.field??"the input"}`:T[e.meter]??e.meter.replaceAll("_"," ")}function N(e){const r=e.free?` beyond ${u(e.free)}`:"";if(e.rates)return e.rates.map((d,a)=>`${u(d.credits)}${a===0?` per ${h(e)}${r}`:""} ${d.label}`).join("; ");const n=e.tiers?Object.values(e.tiers):[e.credits],s=Math.min(...n),i=Math.max(...n),o=s===i?u(s):`${u(s)}–${u(i)}`,t=e.tierField?` by ${e.tierField}`:"";return`${o} per ${h(e)}${r}${t}`}function _(e,r){const n=r.map(N);return n.length===0?`${u(e)} credits per call`:`${e>0?`${u(e)} credits per call + `:"credits: "}${n.join(" + ")}`}export function priceText(e){const r=_(e.baseCredits,e.parts);return e.quote?`${_(e.baseCredits,e.quote)} (the provider's published rates; a call is charged ${r.replace(/^credits: /u,"")})`:r}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{copyFile as u,mkdir as l,mkdtemp as p,rm as w}from"node:fs/promises";import{tmpdir as x}from"node:os";import{dirname as h,extname as v,join as d}from"node:path";import{genFileFor as y}from"@allyhub-next/formats";import{EXIT as g}from"@allyhub-next/protocol";import{callTool as k}from"./call.js";import{findTool as F}from"./catalog.js";import{CloudError as I}from"./errors.js";import{estimatePrice as b,withDefaults as S}from"./price.js";import{toolWords as T,writeWords as $}from"./records.js";export function sayInput(o){return{...o.params??{},text:o.text,...o.voice===void 0?{}:{voiceId:o.voice}}}const j=o=>Math.round(o*1e6)/1e6;export async function quoteSays(o,i){const r=new Map,s=[];let a=0;for(const t of i){let e=r.get(t.tool);e||(e=await F(o,t.tool),r.set(t.tool,e));const n=b(e.price,S(e.input,sayInput(t)));a+=n.credits,s.push({stem:t.stem,credits:n.credits,estimated:n.estimated})}return{says:s,credits:j(a),estimated:s.some(t=>t.estimated)}}export async function makeSay(o,i,r,s){const a=await p(d(x(),"allyhub-voice-"));try{const t=await k(o,r.tool,sayInput(r),{...s,outDir:a,wait:!0});if("jobId"in t||t.file===void 0)throw new I("no-audio",`${r.tool} returned no audio file.`,{exit:g.platform});const e=T(t.output)??[],n=t.output.durationSeconds,c=typeof n=="number"?n:e.at(-1)?.end??0,m=`${r.stem}${v(t.file).toLowerCase()||".mp3"}`;await l(h(d(i,m)),{recursive:!0}),await u(t.file,d(i,m)),t.gen&&await u(t.gen,d(i,y(m)));const f=await $(d(i,m),e,c>=0?c:void 0);return{file:m,words:f.slice(i.length+1),seconds:c,credits:t.credits??0}}finally{await w(a,{recursive:!0,force:!0})}}
2
+ import{copyFile as c,mkdir as f,mkdtemp as p,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as h,join as u}from"node:path";import{genFileFor as k}from"@allyhub-next/formats";import{EXIT as y}from"@allyhub-next/protocol";import{callTool as g}from"./call.js";import{findTool as F}from"./catalog.js";import{CloudError as I}from"./errors.js";import{estimatePrice as b,withDefaults as S}from"./price.js";import{toolWords as T,writeWords as $}from"./records.js";export function sayInput(o){return{...o.params??{},text:o.text,...o.voice===void 0?{}:{voiceId:o.voice}}}const j=o=>Math.round(o*1e6)/1e6;export async function quoteSays(o,a){const i=new Map,m=[];let d=0,t=!1;for(const e of a){let r=i.get(e.tool);r||(r=await F(o,e.tool),i.set(e.tool,r));const n=b(r.price,S(r.input,sayInput(e)));d+=n.credits,t||=n.lines.some(s=>s.unknown&&s.rate!==0),m.push({stem:e.stem,credits:n.credits,estimated:n.estimated})}return{says:m,credits:j(d),estimated:m.some(e=>e.estimated),unknown:t,titles:[...i.values()].map(e=>e.title)}}export async function makeSay(o,a,i,m){const d=await p(u(v(),"allyhub-voice-"));try{const t=await g(o,i.tool,sayInput(i),{...m,outDir:d,wait:!0});if("jobId"in t||t.file===void 0)throw new I("no-audio",`${i.tool} returned no audio file.`,{exit:y.platform});const e=T(t.output)??[],r=t.output.durationSeconds,n=typeof r=="number"?r:e.at(-1)?.end??0,s=`${i.stem}${h(t.file).toLowerCase()||".mp3"}`;await f(x(u(a,s)),{recursive:!0}),await c(t.file,u(a,s)),t.gen&&await c(t.gen,u(a,k(s)));const l=await $(u(a,s),e,n>=0?n:void 0);return{file:s,words:l.slice(a.length+1),seconds:n,credits:t.credits??0}}finally{await w(d,{recursive:!0,force:!0})}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/cloud",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/components",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -28,7 +28,7 @@ export declare class Live {
28
28
  moved(revision: number): void;
29
29
  /** The project prepared and bundled for the stage, as it is now. */
30
30
  prepared(): Promise<Prepared>;
31
- /** The last build that finished, if any (titles for a listing, without waiting). */
31
+ /** The last build that finished, if any (without waiting for one). */
32
32
  latest(): Prepared | undefined;
33
33
  /** A piece and its version, by the item's folder and a combo's key or id. */
34
34
  target(item: string, version?: string): Promise<{
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as y}from"node:fs/promises";import{basename as P,join as b}from"node:path";import{listFiles as d}from"@allyhub-next/build";import{splitTitle as S,parseDoc as R,titleText as T}from"@allyhub-next/doc";import{ITEM_KINDS as E,scanItems as u}from"@allyhub-next/formats";import{OpenedVersion as O,parseCombo as F}from"@allyhub-next/project";import{RPC_ERROR as c,RpcError as l}from"@allyhub-next/protocol";import{readSpec as j}from"@allyhub-next/sheet";import{comboKey as w,formatInfo as v}from"@allyhub-next/video-core";import{rpcErrorOf as I}from"./live.js";import{loose as $}from"./paths.js";const g=n=>{const o=n.addresses?.();if(!o)throw new l(c.unavailable,"This server serves no pages: only allyhub dev's does.");return o},N=n=>({mime:"image/webp",data:n.toString("base64")});async function q(n,o,m){try{if(o.kind==="doc"){const t=await y(b(n,o.entry),"utf8");return T(S(R(t).blocks).title)||void 0}if(o.kind==="sheet"){const t=await y(b(n,o.dir,"sheet.yaml"),"utf8");return j(t).spec.title}}catch{return}return m.get(o.dir)}export function toolHandlers(n){const{live:o}=n,m=async(t,r,s,e)=>{try{return await o.withSession(async i=>{const a=await O.open({root:o.root,item:t,...r===void 0?{}:{combos:[F(r)]},purpose:s,session:i});try{return await e(a)}finally{await a.close()}})}catch(i){throw I(i)}};return{"project/items":async()=>{const t=await d(o.root),r=u(t),s=new Map;for(const e of o.latest()?.pieces??[]){const i=typeof e.title=="string"?e.title:void 0;i&&s.set(e.dir,i)}return{items:await Promise.all(r.items.map(async e=>{const i=await q(o.root,e,s);return{...e,...i?{title:i}:{}}})),folder:o.root,name:P(o.root),revision:o.revision}},"video/versions":async({item:t})=>{const{piece:r}=await o.target(t),s=[...new Set(r.combos.map(e=>e.lang))];return{piece:r.id,kind:r.kind,...typeof r.title=="string"?{title:r.title}:{},width:v(r.formatEntry)?.width??0,height:v(r.formatEntry)?.height??0,versions:s.map(e=>e===void 0?{key:w({})}:{key:w({lang:e}),lang:e})}},"video/stage":async({item:t,version:r,start:s,play:e,chrome:i})=>{const{piece:a,combo:f}=await o.target(t,r),p=new URLSearchParams({piece:a.id,combo:w(f)});for(const[k,x]of Object.entries(s??{}))p.set(k,String(x));e&&p.set("play","1"),i===!1&&p.set("chrome","0");const h=g(n);return{url:h.stage(p),probe:h.probe}},"video/timeline":async({item:t,version:r})=>m(t,r,"play",s=>Promise.resolve({timeline:$(s.timeline),text:s.version.summary?.text??[]})),"video/still":async({item:t,version:r,t:s})=>m(t,r,"render",async e=>{const i=s??e.timeline.parts[0]?.still??0;return{t:i,image:N(await e.still(i,{format:"webp"})),width:e.timeline.width,height:e.timeline.height,duration:e.timeline.duration}}),"check/results":()=>Promise.resolve(n.checker?.state??{status:"off",revision:o.revision,problems:[],facts:[]}),"check/run":()=>{if(!n.checker)throw new l(c.unavailable,"This server runs no check.");return n.checker.schedule(!0),Promise.resolve({})},"export/start":async({item:t,versions:r,types:s})=>{const e=await d(o.root);if(!u(e).items.some(i=>i.dir===t))throw new l(c.notFound,`There is no item ${t}.`);return{job:n.exports.start(t,r??[],s??[])}},"export/cancel":({job:t})=>{if(!n.exports.cancel(t))throw new l(c.notFound,`No export ${t} is under way.`);return Promise.resolve({})},"export/list":()=>Promise.resolve({jobs:n.exports.list()}),"scenery/viewer":async({item:t,camera:r})=>{const s=await d(o.root),e=u(s).items.find(f=>f.dir===t&&f.kind==="scenery");if(!e)throw new l(c.notFound,`There is no scenery ${t}: a scenery is a folder with a ${E.scenery.entries[0]??"scenery.ts"}.`);const i=new URLSearchParams({file:e.entry});r&&i.set("camera",JSON.stringify(r));const a=g(n);return{url:a.viewer(i),probe:a.probe}}}}
2
+ import{readFile as y}from"node:fs/promises";import{basename as P,join as b}from"node:path";import{listFiles as f}from"@allyhub-next/build";import{splitTitle as S,parseDoc as R,titleText as T}from"@allyhub-next/doc";import{ITEM_KINDS as E,scanItems as u}from"@allyhub-next/formats";import{OpenedVersion as O,parseCombo as F}from"@allyhub-next/project";import{RPC_ERROR as l,RpcError as m}from"@allyhub-next/protocol";import{readSpec as j}from"@allyhub-next/sheet";import{comboKey as w,formatInfo as v}from"@allyhub-next/video-core";import{rpcErrorOf as I}from"./live.js";import{loose as $}from"./paths.js";const g=s=>{const r=s.addresses?.();if(!r)throw new m(l.unavailable,"This server serves no pages: only allyhub dev's does.");return r},N=s=>({mime:"image/webp",data:s.toString("base64")});async function q(s,r,d){try{if(r.kind==="doc"){const e=await y(b(s,r.entry),"utf8");return T(S(R(e).blocks).title)||void 0}if(r.kind==="sheet"){const e=await y(b(s,r.dir,"sheet.yaml"),"utf8");return j(e).spec.title}}catch{return}return d.get(r.dir)}export function toolHandlers(s){const{live:r}=s,d=async(e,t,a,o)=>{try{return await r.withSession(async n=>{const i=await O.open({root:r.root,item:e,...t===void 0?{}:{combos:[F(t)]},purpose:a,session:n});try{return await o(i)}finally{await i.close()}})}catch(n){throw I(n)}};return{"project/items":async()=>{const e=await f(r.root),t=u(e),o=t.items.some(i=>i.kind==="video"||i.kind==="slides")?await r.prepared().catch(()=>r.latest()):void 0,n=new Map;for(const i of o?.pieces??[]){const c=typeof i.title=="string"?i.title:void 0;c&&n.set(i.dir,c)}return{items:await Promise.all(t.items.map(async i=>{const c=await q(r.root,i,n);return{...i,...c?{title:c}:{}}})),folder:r.root,name:P(r.root),revision:r.revision}},"video/versions":async({item:e})=>{const{piece:t}=await r.target(e),a=[...new Set(t.combos.map(o=>o.lang))];return{piece:t.id,kind:t.kind,...typeof t.title=="string"?{title:t.title}:{},width:v(t.formatEntry)?.width??0,height:v(t.formatEntry)?.height??0,versions:a.map(o=>o===void 0?{key:w({})}:{key:w({lang:o}),lang:o})}},"video/stage":async({item:e,version:t,start:a,play:o,chrome:n})=>{const{piece:i,combo:c}=await r.target(e,t),p=new URLSearchParams({piece:i.id,combo:w(c)});for(const[k,x]of Object.entries(a??{}))p.set(k,String(x));o&&p.set("play","1"),n===!1&&p.set("chrome","0");const h=g(s);return{url:h.stage(p),probe:h.probe}},"video/timeline":async({item:e,version:t})=>d(e,t,"play",a=>Promise.resolve({timeline:$(a.timeline),text:a.version.summary?.text??[]})),"video/still":async({item:e,version:t,t:a})=>d(e,t,"render",async o=>{const n=a??o.timeline.parts[0]?.still??0;return{t:n,image:N(await o.still(n,{format:"webp"})),width:o.timeline.width,height:o.timeline.height,duration:o.timeline.duration}}),"check/results":()=>Promise.resolve(s.checker?.state??{status:"off",revision:r.revision,problems:[],facts:[]}),"check/run":()=>{if(!s.checker)throw new m(l.unavailable,"This server runs no check.");return s.checker.schedule(!0),Promise.resolve({})},"export/start":async({item:e,versions:t,types:a})=>{const o=await f(r.root);if(!u(o).items.some(n=>n.dir===e))throw new m(l.notFound,`There is no item ${e}.`);return{job:s.exports.start(e,t??[],a??[])}},"export/cancel":({job:e})=>{if(!s.exports.cancel(e))throw new m(l.notFound,`No export ${e} is under way.`);return Promise.resolve({})},"export/list":()=>Promise.resolve({jobs:s.exports.list()}),"scenery/viewer":async({item:e,camera:t})=>{const a=await f(r.root),o=u(a).items.find(c=>c.dir===e&&c.kind==="scenery");if(!o)throw new m(l.notFound,`There is no scenery ${e}: a scenery is a folder with a ${E.scenery.entries[0]??"scenery.ts"}.`);const n=new URLSearchParams({file:o.entry});t&&n.set("camera",JSON.stringify(t));const i=g(s);return{url:i.viewer(n),probe:i.probe}}}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/dev-server",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/doc",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/export",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/formats",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/measure",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/media",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/model",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/project",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -148,7 +148,46 @@ export declare const ToolPricePartSchema: z.ZodObject<{
148
148
  typical: z.ZodOptional<z.ZodNumber>;
149
149
  }, z.core.$strip>;
150
150
  export type ToolPricePart = z.infer<typeof ToolPricePartSchema>;
151
- /** What a run is charged, in credits: the base plus each part. */
151
+ /**
152
+ * A rate a unit costs when the input's settings pick it: each `when` path
153
+ * (dotted, into the input: `providerOptions.klingai.mode`) holds one of
154
+ * its values, `null` for a setting not given (the provider's default).
155
+ * `label` says it after the rate: "at 720p", "in pro mode with sound".
156
+ */
157
+ export declare const ToolPriceRateSchema: z.ZodObject<{
158
+ label: z.ZodString;
159
+ credits: z.ZodNumber;
160
+ when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
161
+ }, z.core.$strip>;
162
+ export type ToolPriceRate = z.infer<typeof ToolPriceRateSchema>;
163
+ /**
164
+ * A part of a quote: a part whose rate may be the first of `rates` the
165
+ * input matches (`credits` is then the lowest of them); none matching, the
166
+ * rate is not known before the call.
167
+ */
168
+ export declare const ToolQuotePartSchema: z.ZodObject<{
169
+ meter: z.ZodString;
170
+ credits: z.ZodNumber;
171
+ field: z.ZodOptional<z.ZodString>;
172
+ size: z.ZodOptional<z.ZodNumber>;
173
+ free: z.ZodOptional<z.ZodNumber>;
174
+ tierField: z.ZodOptional<z.ZodString>;
175
+ tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
176
+ typical: z.ZodOptional<z.ZodNumber>;
177
+ rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
178
+ label: z.ZodString;
179
+ credits: z.ZodNumber;
180
+ when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
181
+ }, z.core.$strip>>>;
182
+ }, z.core.$strip>;
183
+ export type ToolQuotePart = z.infer<typeof ToolQuotePartSchema>;
184
+ /**
185
+ * What a run is charged, in credits: the base plus each part. A tool
186
+ * charged what its AI model's provider reports (a `usd` part) has a
187
+ * `quote`: the provider's published rates (by the second of video, the
188
+ * token, the image…), converted to credits as the charge is, which a quote
189
+ * counts by before the call; the call is still charged by `parts`.
190
+ */
152
191
  export declare const ToolPriceSchema: z.ZodObject<{
153
192
  baseCredits: z.ZodNumber;
154
193
  parts: z.ZodArray<z.ZodObject<{
@@ -161,6 +200,21 @@ export declare const ToolPriceSchema: z.ZodObject<{
161
200
  tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
162
201
  typical: z.ZodOptional<z.ZodNumber>;
163
202
  }, z.core.$strip>>;
203
+ quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
+ meter: z.ZodString;
205
+ credits: z.ZodNumber;
206
+ field: z.ZodOptional<z.ZodString>;
207
+ size: z.ZodOptional<z.ZodNumber>;
208
+ free: z.ZodOptional<z.ZodNumber>;
209
+ tierField: z.ZodOptional<z.ZodString>;
210
+ tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
211
+ typical: z.ZodOptional<z.ZodNumber>;
212
+ rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ label: z.ZodString;
214
+ credits: z.ZodNumber;
215
+ when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
216
+ }, z.core.$strip>>>;
217
+ }, z.core.$strip>>>;
164
218
  }, z.core.$strip>;
165
219
  export type ToolPrice = z.infer<typeof ToolPriceSchema>;
166
220
  export declare const CATALOG_PATH = "/api/catalog";
@@ -189,6 +243,21 @@ export declare const CatalogToolSchema: z.ZodObject<{
189
243
  tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
190
244
  typical: z.ZodOptional<z.ZodNumber>;
191
245
  }, z.core.$strip>>;
246
+ quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
247
+ meter: z.ZodString;
248
+ credits: z.ZodNumber;
249
+ field: z.ZodOptional<z.ZodString>;
250
+ size: z.ZodOptional<z.ZodNumber>;
251
+ free: z.ZodOptional<z.ZodNumber>;
252
+ tierField: z.ZodOptional<z.ZodString>;
253
+ tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
254
+ typical: z.ZodOptional<z.ZodNumber>;
255
+ rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
256
+ label: z.ZodString;
257
+ credits: z.ZodNumber;
258
+ when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
259
+ }, z.core.$strip>>>;
260
+ }, z.core.$strip>>>;
192
261
  }, z.core.$strip>;
193
262
  long: z.ZodBoolean;
194
263
  }, z.core.$strip>;
@@ -219,11 +288,49 @@ export declare const CatalogSchema: z.ZodObject<{
219
288
  tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
220
289
  typical: z.ZodOptional<z.ZodNumber>;
221
290
  }, z.core.$strip>>;
291
+ quote: z.ZodOptional<z.ZodArray<z.ZodObject<{
292
+ meter: z.ZodString;
293
+ credits: z.ZodNumber;
294
+ field: z.ZodOptional<z.ZodString>;
295
+ size: z.ZodOptional<z.ZodNumber>;
296
+ free: z.ZodOptional<z.ZodNumber>;
297
+ tierField: z.ZodOptional<z.ZodString>;
298
+ tiers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
299
+ typical: z.ZodOptional<z.ZodNumber>;
300
+ rates: z.ZodOptional<z.ZodArray<z.ZodObject<{
301
+ label: z.ZodString;
302
+ credits: z.ZodNumber;
303
+ when: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
304
+ }, z.core.$strip>>>;
305
+ }, z.core.$strip>>>;
222
306
  }, z.core.$strip>;
223
307
  long: z.ZodBoolean;
224
308
  }, z.core.$strip>>;
225
309
  }, z.core.$strip>;
226
310
  export type Catalog = z.infer<typeof CatalogSchema>;
311
+ /**
312
+ * A call that spends credits, as the person is asked to allow it before
313
+ * it is made: in MCP's elicitation (`elicitation/create`, a form with no
314
+ * fields), under this key of its `_meta`, so a client says the price in
315
+ * its own words; the elicitation's message says the same in English.
316
+ */
317
+ export declare const CHARGE_META = "allyhub.com/charge";
318
+ /**
319
+ * Where AllyHub's command line asks the person when an agent runs it in
320
+ * Studio's shell: Studio's Host names an address in each agent's
321
+ * environment, and the CLI posts `{ cwd, params }` to it (`params` the
322
+ * elicitation's, as an MCP server sends them) and is answered with MCP's
323
+ * elicitation result, or an error saying why no one could be asked.
324
+ */
325
+ export declare const STUDIO_ASK_ENV = "ALLYHUB_STUDIO_ASK";
326
+ export declare const ChargeSchema: z.ZodObject<{
327
+ tool: z.ZodString;
328
+ title: z.ZodString;
329
+ credits: z.ZodNumber;
330
+ estimated: z.ZodBoolean;
331
+ unknown: z.ZodBoolean;
332
+ }, z.core.$strip>;
333
+ export type Charge = z.infer<typeof ChargeSchema>;
227
334
  /** Where a tool's calls are made (POST). */
228
335
  export declare const toolCallsPath: (tool: string) => string;
229
336
  /** Where a call is read again (GET). */
@@ -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";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),plan:t.object({id:t.string(),name:t.string(),interval:t.enum(["month","year"]),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable()}).nullable(),autoTopUp:t.object({below:t.number(),amountCents:t.number(),stopped:t.string().nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),monthlyCredits:t.number(),prices:t.array(t.object({interval:t.enum(["month","year"]),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number()})}),BILLING_USAGE_PATH="/api/billing/usage",BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number()}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(["month","year"])}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive()}),BILLING_PAGE_PATH="/plan",BILLING_PAID_PATH="/plan/paid",BILLING_VIEWS={plans:"plans",credits:"add-credits"},BILLING_LANG_PARAM="lang",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const r={tier:t.enum(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),...r,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),...r})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),ToolPricePartSchema=t.object({meter:t.string().min(1),credits:t.number().nonnegative(),field:t.string().optional(),size:t.number().int().positive().optional(),free:t.number().int().nonnegative().optional(),tierField:t.string().optional(),tiers:t.record(t.string(),t.number().nonnegative()).optional(),typical:t.number().nonnegative().optional()}),ToolPriceSchema=t.object({baseCredits:t.number().nonnegative(),parts:t.array(ToolPricePartSchema)}),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),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,price:ToolPriceSchema,long:t.boolean()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),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:t.enum(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 o="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${o}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(o))return;const[n,i,...a]=e.slice(o.length).split("/");if(!(!n||!i||a.length>0))try{return{id:decodeURIComponent(n),name:decodeURIComponent(i)}}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,n)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${n}`;
2
+ import{z as t}from"zod";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),plan:t.object({id:t.string(),name:t.string(),interval:t.enum(["month","year"]),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable()}).nullable(),autoTopUp:t.object({below:t.number(),amountCents:t.number(),stopped:t.string().nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),monthlyCredits:t.number(),prices:t.array(t.object({interval:t.enum(["month","year"]),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number()})}),BILLING_USAGE_PATH="/api/billing/usage",BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number()}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(["month","year"])}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive()}),BILLING_PAGE_PATH="/plan",BILLING_PAID_PATH="/plan/paid",BILLING_VIEWS={plans:"plans",credits:"add-credits"},BILLING_LANG_PARAM="lang",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const r={tier:t.enum(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),...r,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),...r})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),ToolPricePartSchema=t.object({meter:t.string().min(1),credits:t.number().nonnegative(),field:t.string().optional(),size:t.number().int().positive().optional(),free:t.number().int().nonnegative().optional(),tierField:t.string().optional(),tiers:t.record(t.string(),t.number().nonnegative()).optional(),typical:t.number().nonnegative().optional()}),ToolPriceRateSchema=t.object({label:t.string().min(1),credits:t.number().nonnegative(),when:t.record(t.string().min(1),t.array(t.union([t.string(),t.number(),t.boolean(),t.null()])).min(1))}),ToolQuotePartSchema=ToolPricePartSchema.extend({rates:t.array(ToolPriceRateSchema).min(1).optional()}),ToolPriceSchema=t.object({baseCredits:t.number().nonnegative(),parts:t.array(ToolPricePartSchema),quote:t.array(ToolQuotePartSchema).min(1).optional()}),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),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,price:ToolPriceSchema,long:t.boolean()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CHARGE_META="allyhub.com/charge",STUDIO_ASK_ENV="ALLYHUB_STUDIO_ASK",ChargeSchema=t.object({tool:t.string().min(1),title:t.string().min(1),credits:t.number().nonnegative(),estimated:t.boolean(),unknown:t.boolean()}),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:t.enum(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 o="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${o}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(o))return;const[n,i,...a]=e.slice(o.length).split("/");if(!(!n||!i||a.length>0))try{return{id:decodeURIComponent(n),name:decodeURIComponent(i)}}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,n)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${n}`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/protocol",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/registry",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/render",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/runtime",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -350,42 +350,116 @@
350
350
  }
351
351
  },
352
352
  "node": {
353
- "about": "Node.js, for a Studio Host package: the official Linux builds",
354
- "version": "24.21.0",
353
+ "about": "Node.js and its npm, the official builds: what a Studio Host package runs on, and Studio's agents on the desktop",
354
+ "version": "24.22.2",
355
355
  "license": "MIT",
356
356
  "homepage": "https://nodejs.org",
357
357
  "platforms": {
358
+ "darwin-arm64": [
359
+ {
360
+ "url": "https://nodejs.org/dist/v24.22.2/node-v24.22.2-darwin-arm64.tar.gz",
361
+ "sha256": "aa9549349e47dffaa42dcf95d6e06ade8c4bdafc980979883b88767670df385a",
362
+ "size": 53068959,
363
+ "unpack": "tgz",
364
+ "check": [
365
+ {
366
+ "path": "node-v24.22.2-darwin-arm64/bin/node",
367
+ "sha256": "b6fb419f0f43bb2fbca273700294dd2f3b685a64b60e8417c295f47646a70e4a"
368
+ },
369
+ {
370
+ "path": "node-v24.22.2-darwin-arm64/lib/node_modules/npm/bin/npm-cli.js",
371
+ "sha256": "8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7"
372
+ },
373
+ {
374
+ "path": "node-v24.22.2-darwin-arm64/lib/node_modules/npm/bin/npx-cli.js",
375
+ "sha256": "237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900"
376
+ }
377
+ ],
378
+ "bins": {
379
+ "node": "node-v24.22.2-darwin-arm64/bin/node",
380
+ "npm": "node-v24.22.2-darwin-arm64/lib/node_modules/npm/bin/npm-cli.js",
381
+ "npx": "node-v24.22.2-darwin-arm64/lib/node_modules/npm/bin/npx-cli.js"
382
+ }
383
+ }
384
+ ],
385
+ "darwin-x64": [
386
+ {
387
+ "url": "https://nodejs.org/dist/v24.22.2/node-v24.22.2-darwin-x64.tar.gz",
388
+ "sha256": "d5e336d588c45be0c37dbd52cc29895593009ca4997a77a1fd02815131ed0e52",
389
+ "size": 54383415,
390
+ "unpack": "tgz",
391
+ "check": [
392
+ {
393
+ "path": "node-v24.22.2-darwin-x64/bin/node",
394
+ "sha256": "bdcd4500054d48c9ec6058706795d91cac83e3e3eaced218434294d8f2fbf7fa"
395
+ },
396
+ {
397
+ "path": "node-v24.22.2-darwin-x64/lib/node_modules/npm/bin/npm-cli.js",
398
+ "sha256": "8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7"
399
+ },
400
+ {
401
+ "path": "node-v24.22.2-darwin-x64/lib/node_modules/npm/bin/npx-cli.js",
402
+ "sha256": "237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900"
403
+ }
404
+ ],
405
+ "bins": {
406
+ "node": "node-v24.22.2-darwin-x64/bin/node",
407
+ "npm": "node-v24.22.2-darwin-x64/lib/node_modules/npm/bin/npm-cli.js",
408
+ "npx": "node-v24.22.2-darwin-x64/lib/node_modules/npm/bin/npx-cli.js"
409
+ }
410
+ }
411
+ ],
358
412
  "linux-x64": [
359
413
  {
360
- "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-x64.tar.gz",
361
- "sha256": "6e1db87ef58b8819e5d5402eff1536491b18edd8eb7bee5ef7897876e88dc5ff",
362
- "size": 58088022,
414
+ "url": "https://nodejs.org/dist/v24.22.2/node-v24.22.2-linux-x64.tar.gz",
415
+ "sha256": "361718c444e49af2ca5a110c83ba6a8901143f23ab285ebbef0341f391f482a9",
416
+ "size": 58299872,
363
417
  "unpack": "tgz",
364
418
  "check": [
365
419
  {
366
- "path": "node-v24.21.0-linux-x64/bin/node",
367
- "sha256": "7fde7b8afa198da66257f42ee2001d874c7355631e6d1579a5fb5ef1f246df4c"
420
+ "path": "node-v24.22.2-linux-x64/bin/node",
421
+ "sha256": "904a6d3484241d466989f9df9ba3aab822b1496191bdb28230eb491a55c32a52"
422
+ },
423
+ {
424
+ "path": "node-v24.22.2-linux-x64/lib/node_modules/npm/bin/npm-cli.js",
425
+ "sha256": "8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7"
426
+ },
427
+ {
428
+ "path": "node-v24.22.2-linux-x64/lib/node_modules/npm/bin/npx-cli.js",
429
+ "sha256": "237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900"
368
430
  }
369
431
  ],
370
432
  "bins": {
371
- "node": "node-v24.21.0-linux-x64/bin/node"
433
+ "node": "node-v24.22.2-linux-x64/bin/node",
434
+ "npm": "node-v24.22.2-linux-x64/lib/node_modules/npm/bin/npm-cli.js",
435
+ "npx": "node-v24.22.2-linux-x64/lib/node_modules/npm/bin/npx-cli.js"
372
436
  }
373
437
  }
374
438
  ],
375
439
  "linux-arm64": [
376
440
  {
377
- "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-arm64.tar.gz",
378
- "sha256": "724282c3b43aec998aa9527380465b45d229e021b58035f5f4f63095eabfe5d5",
379
- "size": 57824078,
441
+ "url": "https://nodejs.org/dist/v24.22.2/node-v24.22.2-linux-arm64.tar.gz",
442
+ "sha256": "95c264150aceb7f3437a29fd6984924f5f8d1511ea3cbd6c508b83f6c555dae2",
443
+ "size": 58030966,
380
444
  "unpack": "tgz",
381
445
  "check": [
382
446
  {
383
- "path": "node-v24.21.0-linux-arm64/bin/node",
384
- "sha256": "0f8949d1028f6d61506b2d5bc57e7e6fe893d7b1997509b7847294fc9c616584"
447
+ "path": "node-v24.22.2-linux-arm64/bin/node",
448
+ "sha256": "b4855de8c4781130b722ceaec9718fed77cca3eed2e5cfc5455e267c0b9ee3b0"
449
+ },
450
+ {
451
+ "path": "node-v24.22.2-linux-arm64/lib/node_modules/npm/bin/npm-cli.js",
452
+ "sha256": "8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7"
453
+ },
454
+ {
455
+ "path": "node-v24.22.2-linux-arm64/lib/node_modules/npm/bin/npx-cli.js",
456
+ "sha256": "237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900"
385
457
  }
386
458
  ],
387
459
  "bins": {
388
- "node": "node-v24.21.0-linux-arm64/bin/node"
460
+ "node": "node-v24.22.2-linux-arm64/bin/node",
461
+ "npm": "node-v24.22.2-linux-arm64/lib/node_modules/npm/bin/npm-cli.js",
462
+ "npx": "node-v24.22.2-linux-arm64/lib/node_modules/npm/bin/npx-cli.js"
389
463
  }
390
464
  }
391
465
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/runtimes",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.0-next.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {