@rizom/brain 0.2.0-alpha.843 → 0.2.0-alpha.845

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 (27) hide show
  1. package/dist/brain.js +5 -5
  2. package/dist/chunks/{app-xwcj6nrj.js → app-9ca5jhcf.js} +2 -2
  3. package/dist/chunks/{index-p89e6rzz.js → index-5xrzkk86.js} +2 -2
  4. package/dist/chunks/{index-n3nbytk3.js → index-dwry26z1.js} +3 -3
  5. package/dist/chunks/{index-n3nbytk3.js.map → index-dwry26z1.js.map} +1 -1
  6. package/dist/chunks/{package-scqh3wsz.js → package-8hrrb634.js} +3 -3
  7. package/dist/chunks/{package-scqh3wsz.js.map → package-8hrrb634.js.map} +1 -1
  8. package/dist/model.js +4 -4
  9. package/dist/model.js.map +1 -1
  10. package/dist/testing.js +1 -1
  11. package/dist/ui/{studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css → studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css} +2 -1
  12. package/dist/ui/{studio-app-mnzsgt8r.js → studio-app-njac86mm.js} +79 -79
  13. package/dist/ui/{studio-app-mnzsgt8r.js.map → studio-app-njac86mm.js.map} +5 -4
  14. package/dist/ui/studio-asset-manifest.json +13 -13
  15. package/dist/ui/studio-chunks/{account-view-5hn8fnzw.js → account-view-vd7r4j1h.js} +1 -1
  16. package/dist/ui/studio-chunks/main-172x0me8.js +4 -0
  17. package/dist/ui/studio-chunks/{main-zy0c7qnp.js.map → main-172x0me8.js.map} +4 -4
  18. package/dist/ui/studio-chunks/main-98w8qkfj.js +4 -0
  19. package/dist/ui/studio-chunks/{main-px4xemnw.js.map → main-98w8qkfj.js.map} +3 -3
  20. package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js → studio-chat-workspace-rdge6t6n.js} +1 -1
  21. package/package.json +1 -1
  22. package/dist/ui/studio-chunks/main-px4xemnw.js +0 -4
  23. package/dist/ui/studio-chunks/main-zy0c7qnp.js +0 -4
  24. /package/dist/chunks/{app-xwcj6nrj.js.map → app-9ca5jhcf.js.map} +0 -0
  25. /package/dist/chunks/{index-p89e6rzz.js.map → index-5xrzkk86.js.map} +0 -0
  26. /package/dist/ui/studio-chunks/{account-view-5hn8fnzw.js.map → account-view-vd7r4j1h.js.map} +0 -0
  27. /package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js.map → studio-chat-workspace-rdge6t6n.js.map} +0 -0
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ge as k,he as V,ie as U}from"./chunks/index-n3nbytk3.js";import{Ae as A,Be as x,bf as N,cf as O,df as z,ef as M,ff as q,gf as J,hf as L,je as E,jf as _,kf as j,me as I}from"./chunks/index-ygeeaab7.js";import"./chunks/index-dv4tqrbw.js";import{of as D}from"./chunks/index-24r1t300.js";import{$i as C,Ko as B,ll as P,ml as w,sg as h}from"./chunks/index-590f2jt0.js";import{Xp as p}from"./chunks/index-s7mrb3rq.js";import{fu as S,hu as v}from"./chunks/index-0va9v6ve.js";import"./chunks/index-ky8tsadx.js";import"./chunks/index-gb5500kt.js";import"./chunks/index-r8mzr1hv.js";import"./chunks/index-cmk5se4p.js";import{mkdtemp as K,rm as b}from"fs/promises";import{tmpdir as X}from"os";import{join as m}from"path";var y="none";function s(){return Promise.reject(Error("A test brain has no AI provider"))}function W(e){return{specificationVersion:"v3",provider:"test-brain",modelId:e,supportedUrls:{},doGenerate:s,doStream:s}}function T(e){let r={...e};return{generateText:s,generateObject:s,judge:s,generateImage:s,getModel:()=>W(r.model??"none"),canGenerateImages:()=>!1,getConfig:()=>({...r}),updateConfig:(o)=>{r={...r,...o}}}}function R(){return{identity:{model:"test:none",dimensions:1536,promptRevision:0},embedQuery:s,embedDocuments:s}}var Y="shell",ee=20;function te(e){if("needsConfirmation"in e)return{needsConfirmation:!0,summary:e.summary};if(!e.success)return{success:!1,error:e.error,...p({code:e.code})};return{success:!0,...p({data:e.data,message:e.message})}}function re(e,r){if(e.status==="completed"||e.status==="failed")return!0;return e.status==="pending"&&e.lastError!==null&&e.scheduledFor>r}function ne(e,r){return e.flatMap((o)=>{if(!D(o))throw Error("A test brain runs packages configured with use(), as defineBrain does");return P(o.definition,o.config,r)})}async function F(e,r){let o=k(r.directory);V(o,r.brainVersion);let f=ne(e.plugins,{name:o.name,version:o.version}),a=await K(m(r.temporaryRoot??X(),"rizom-test-brain-")),g={...E({dataDir:a,cacheDir:m(a,"cache"),distDir:m(a,"dist")}),embedding:{enabled:!1}},i;try{await new J(v.createFresh({level:S.WARN,context:"test-brain"}),{getStandardConfigWithDirectories:async()=>g,migrateEntities:O,migrateJobQueue:z,migrateConversations:M,migrateRuntimeState:q}).runAllMigrations();let t=_({name:o.name,version:o.version,logLevel:"warn",plugins:f,shellConfig:{...g,dataDir:m(a,"brain-data"),ai:{model:y}}}),n=I(j(t));i=N.createFresh(n,{aiService:T(A(n)),embeddingService:R()}),await i.initialize()}catch(t){throw await b(a,{recursive:!0,force:!0}),t}let Z=f.map((t)=>t.id),H,Q=async()=>{try{await i.shutdown()}finally{await b(a,{recursive:!0,force:!0})}};return Object.freeze({async tool(t,n){let l=i.getMCPService().listTools(),d=l.find(({tool:u})=>u.name===t);if(!d)throw Error(`No tool "${t}"; this brain has ${l.map(({tool:u})=>u.name).join(", ")}`);return te(await d.tool.handler(n,L()))},request:(t,n)=>h(i.getMessageBus(),t,n,Y),async fetch(t){let n=x(B(i),t.method.toUpperCase(),new URL(t.url).pathname);if(!n)return new Response("Not Found",{status:404});if(n.sharedHostAdmission==="deny")return new Response("Unauthorized",{status:401});return n.handler(t)},entities:C(i.getEntityService(),"restricted"),jobs:Object.freeze({async wait(t,n){let l=i.getJobQueueService(),d=async()=>{let c=await l.getStatus(n);if(!c||!Z.some((G)=>c.type===`${G}:${t.name}`))return null;if(re(c,Date.now()))return c;return await Bun.sleep(ee),d()},u=await d();return u?w(t,u):null}}),stop:()=>H??=Q()})}function Ee(e){return F(e,{brainVersion:U.version,directory:process.cwd()})}export{Ee as startTestBrain};
2
+ import{ge as k,he as V,ie as U}from"./chunks/index-dwry26z1.js";import{Ae as A,Be as x,bf as N,cf as O,df as z,ef as M,ff as q,gf as J,hf as L,je as E,jf as _,kf as j,me as I}from"./chunks/index-ygeeaab7.js";import"./chunks/index-dv4tqrbw.js";import{of as D}from"./chunks/index-24r1t300.js";import{$i as C,Ko as B,ll as P,ml as w,sg as h}from"./chunks/index-590f2jt0.js";import{Xp as p}from"./chunks/index-s7mrb3rq.js";import{fu as S,hu as v}from"./chunks/index-0va9v6ve.js";import"./chunks/index-ky8tsadx.js";import"./chunks/index-gb5500kt.js";import"./chunks/index-r8mzr1hv.js";import"./chunks/index-cmk5se4p.js";import{mkdtemp as K,rm as b}from"fs/promises";import{tmpdir as X}from"os";import{join as m}from"path";var y="none";function s(){return Promise.reject(Error("A test brain has no AI provider"))}function W(e){return{specificationVersion:"v3",provider:"test-brain",modelId:e,supportedUrls:{},doGenerate:s,doStream:s}}function T(e){let r={...e};return{generateText:s,generateObject:s,judge:s,generateImage:s,getModel:()=>W(r.model??"none"),canGenerateImages:()=>!1,getConfig:()=>({...r}),updateConfig:(o)=>{r={...r,...o}}}}function R(){return{identity:{model:"test:none",dimensions:1536,promptRevision:0},embedQuery:s,embedDocuments:s}}var Y="shell",ee=20;function te(e){if("needsConfirmation"in e)return{needsConfirmation:!0,summary:e.summary};if(!e.success)return{success:!1,error:e.error,...p({code:e.code})};return{success:!0,...p({data:e.data,message:e.message})}}function re(e,r){if(e.status==="completed"||e.status==="failed")return!0;return e.status==="pending"&&e.lastError!==null&&e.scheduledFor>r}function ne(e,r){return e.flatMap((o)=>{if(!D(o))throw Error("A test brain runs packages configured with use(), as defineBrain does");return P(o.definition,o.config,r)})}async function F(e,r){let o=k(r.directory);V(o,r.brainVersion);let f=ne(e.plugins,{name:o.name,version:o.version}),a=await K(m(r.temporaryRoot??X(),"rizom-test-brain-")),g={...E({dataDir:a,cacheDir:m(a,"cache"),distDir:m(a,"dist")}),embedding:{enabled:!1}},i;try{await new J(v.createFresh({level:S.WARN,context:"test-brain"}),{getStandardConfigWithDirectories:async()=>g,migrateEntities:O,migrateJobQueue:z,migrateConversations:M,migrateRuntimeState:q}).runAllMigrations();let t=_({name:o.name,version:o.version,logLevel:"warn",plugins:f,shellConfig:{...g,dataDir:m(a,"brain-data"),ai:{model:y}}}),n=I(j(t));i=N.createFresh(n,{aiService:T(A(n)),embeddingService:R()}),await i.initialize()}catch(t){throw await b(a,{recursive:!0,force:!0}),t}let Z=f.map((t)=>t.id),H,Q=async()=>{try{await i.shutdown()}finally{await b(a,{recursive:!0,force:!0})}};return Object.freeze({async tool(t,n){let l=i.getMCPService().listTools(),d=l.find(({tool:u})=>u.name===t);if(!d)throw Error(`No tool "${t}"; this brain has ${l.map(({tool:u})=>u.name).join(", ")}`);return te(await d.tool.handler(n,L()))},request:(t,n)=>h(i.getMessageBus(),t,n,Y),async fetch(t){let n=x(B(i),t.method.toUpperCase(),new URL(t.url).pathname);if(!n)return new Response("Not Found",{status:404});if(n.sharedHostAdmission==="deny")return new Response("Unauthorized",{status:401});return n.handler(t)},entities:C(i.getEntityService(),"restricted"),jobs:Object.freeze({async wait(t,n){let l=i.getJobQueueService(),d=async()=>{let c=await l.getStatus(n);if(!c||!Z.some((G)=>c.type===`${G}:${t.name}`))return null;if(re(c,Date.now()))return c;return await Bun.sleep(ee),d()},u=await d();return u?w(t,u):null}}),stop:()=>H??=Q()})}function Ee(e){return F(e,{brainVersion:U.version,directory:process.cwd()})}export{Ee as startTestBrain};
3
3
 
4
4
  //# debugId=6B453CF90E8CBEB964756E2164756E21
5
5
  //# sourceMappingURL=testing.js.map
@@ -1241,6 +1241,7 @@
1241
1241
  .xfb3i0g:not(#\#):not(#\#):not(#\#):not(#\#){min-width:180px}
1242
1242
  .x46jg8d:not(#\#):not(#\#):not(#\#):not(#\#){min-width:32px}
1243
1243
  .x1nb6za0:not(#\#):not(#\#):not(#\#):not(#\#){min-width:44px}
1244
+ .x12tqqkd:not(#\#):not(#\#):not(#\#):not(#\#){min-width:8ch}
1244
1245
  .x450l9j:not(#\#):not(#\#):not(#\#):not(#\#){min-width:90px}
1245
1246
  .xk8lq53:not(#\#):not(#\#):not(#\#):not(#\#){min-width:max-content}
1246
1247
  .xlsvjbk:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--console-touch)}
@@ -1305,7 +1306,6 @@
1305
1306
  .x187nhsf:not(#\#):not(#\#):not(#\#):not(#\#){width:44px}
1306
1307
  .x1v4s8kt:not(#\#):not(#\#):not(#\#):not(#\#){width:6px}
1307
1308
  .xci0xqf:not(#\#):not(#\#):not(#\#):not(#\#){width:7px}
1308
- .x16ck42q:not(#\#):not(#\#):not(#\#):not(#\#){width:8ch}
1309
1309
  .x1xc55vz:not(#\#):not(#\#):not(#\#):not(#\#){width:8px}
1310
1310
  .x1wc42o8:not(#\#):not(#\#):not(#\#):not(#\#){width:9px}
1311
1311
  .x14atkfc:not(#\#):not(#\#):not(#\#):not(#\#){width:auto}
@@ -1321,6 +1321,7 @@
1321
1321
  .xwr7mz2:is([data-studio-field-assist] *):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:9px}
1322
1322
  .x1nopeu7:is([data-studio-system-fields] *):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:0}
1323
1323
  .x15x95ik:empty:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}
1324
+ .xwlmubu:focus:not(#\#):not(#\#):not(#\#):not(#\#){min-width:12ch}
1324
1325
  .x1boxzuo:focus:not(#\#):not(#\#):not(#\#):not(#\#){width:12ch}
1325
1326
  @media (max-width: 640px){.x1lclwwd.x1lclwwd:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-left-radius:0}}
1326
1327
  @media (max-width: 640px){.xgrp7ii.xgrp7ii:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-right-radius:0}}