friend-assistant 0.1.92 → 0.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BUILD.json +2 -2
- package/dist/friend.mjs +12 -3
- package/dist/web/assets/{OrgParts-B_NNIax2.js → OrgParts-CTM488ZT.js} +1 -1
- package/dist/web/assets/{index-CGqXBn7o.js → index-DL_4YDP5.js} +63 -63
- package/dist/web/assets/{jarvis-ui-oy6y9klH.js → jarvis-ui-Csg1Py5-.js} +1 -1
- package/dist/web/assets/{jarvisTree-aDm0Q3vj.js → jarvisTree-BdDS6ikq.js} +1 -1
- package/dist/web/assets/{ort.bundle.min-CZV_4gBt.js → ort.bundle.min-CCWhq81g.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
package/dist/BUILD.json
CHANGED
package/dist/friend.mjs
CHANGED
|
@@ -23281,7 +23281,16 @@ function applySettings(config, raw) {
|
|
|
23281
23281
|
if (p.ollama) Object.assign(config.ollama, p.ollama);
|
|
23282
23282
|
if (p.openai) {
|
|
23283
23283
|
const { apiKey, ...rest } = p.openai;
|
|
23284
|
+
const sameHost = (a, b) => {
|
|
23285
|
+
try {
|
|
23286
|
+
return new URL(a).origin === new URL(b).origin;
|
|
23287
|
+
} catch {
|
|
23288
|
+
return false;
|
|
23289
|
+
}
|
|
23290
|
+
};
|
|
23291
|
+
const moved = rest.url !== void 0 && !sameHost(rest.url, config.openai.url);
|
|
23284
23292
|
Object.assign(config.openai, rest);
|
|
23293
|
+
if (moved) config.openai.apiKey = null;
|
|
23285
23294
|
if (apiKey) config.openai.apiKey = apiKey;
|
|
23286
23295
|
}
|
|
23287
23296
|
if (p.claudeCode) Object.assign(config.claudeCode, p.claudeCode);
|
|
@@ -23985,7 +23994,7 @@ function currentSelf() {
|
|
|
23985
23994
|
// ../server/src/system/npm.ts
|
|
23986
23995
|
import { spawn as spawn10 } from "node:child_process";
|
|
23987
23996
|
var PACKAGE = "friend-assistant";
|
|
23988
|
-
var runningVersion = () => true ? "0.1.
|
|
23997
|
+
var runningVersion = () => true ? "0.1.93" : "development";
|
|
23989
23998
|
async function npmLatest(fetchFn = fetch, timeoutMs = 1e4) {
|
|
23990
23999
|
try {
|
|
23991
24000
|
const res = await fetchFn(`https://registry.npmjs.org/${PACKAGE}/latest`, { headers: { accept: "application/json" }, signal: AbortSignal.timeout(timeoutMs) });
|
|
@@ -29667,7 +29676,7 @@ import { appendFileSync } from "node:fs";
|
|
|
29667
29676
|
import { join as join42 } from "node:path";
|
|
29668
29677
|
var PACKAGE2 = "friend-assistant";
|
|
29669
29678
|
var real2 = {
|
|
29670
|
-
current: () => true ? "0.1.
|
|
29679
|
+
current: () => true ? "0.1.93" : "development",
|
|
29671
29680
|
latest: () => new Promise((resolve13) => {
|
|
29672
29681
|
const child = crossSpawn5("npm", ["view", PACKAGE2, "version", "--prefer-online"], { stdio: ["ignore", "pipe", "ignore"] });
|
|
29673
29682
|
let out = "";
|
|
@@ -29985,7 +29994,7 @@ async function run(argv, io2) {
|
|
|
29985
29994
|
case "version":
|
|
29986
29995
|
case "--version":
|
|
29987
29996
|
case "-v":
|
|
29988
|
-
io2.out(true ? "0.1.
|
|
29997
|
+
io2.out(true ? "0.1.93" : "development");
|
|
29989
29998
|
return 0;
|
|
29990
29999
|
case "lan":
|
|
29991
30000
|
return await lanCommand(rest, io2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,l as t,o as n,t as r}from"./index-
|
|
1
|
+
import{i as e,l as t,o as n,t as r}from"./index-DL_4YDP5.js";import{a as i,n as a,r as o,t as s}from"./jarvis-ui-Csg1Py5-.js";var c=t(n(),1),l=350,u=174,d=.25,f=2.5,p=96;function m(e){let t=r(e),n=e=>Math.round(e.y/134),i=e=>({x:n(e)===0?0:260+(n(e)-1)*l,y:Math.round(e.x/216*u)}),a=t.nodes.map(e=>({id:e.id,worker:e.worker,w:e.worker?240:150,...i(e)})),o=new Map(a.map(e=>[e.id,e])),s=t.edges.map(e=>{let t=o.get(e.from),n=o.get(e.to);return{from:e.from,to:e.to,x1:t.x+t.w,y1:t.y+70,x2:n.x,y2:n.y+70}}),c=Math.min(...a.map(e=>e.y));for(let e of a)e.y-=c;for(let e of s)e.y1-=c,e.y2-=c;return{nodes:a,edges:s,width:Math.max(...a.map(e=>e.x+e.w)),height:Math.max(...a.map(e=>e.y))+140}}var h=e=>Math.min(f,Math.max(d,e));function g(e,t){let n=h(Math.min((t.width-56)/e.width,(t.height-56)/e.height,1.25));return{k:n,x:(t.width-e.width*n)/2,y:(t.height-e.height*n)/2}}function _(e,t,n){let r=h(e.k*n),i=r/e.k;return{k:r,x:t.x-(t.x-e.x)*i,y:t.y-(t.y-e.y)*i}}function v(e,t,n){let r=t.width*e.k,i=t.height*e.k,a=Math.min(p,r),o=Math.min(p,i);return{k:e.k,x:Math.min(n.width-a,Math.max(a-r,e.x)),y:Math.min(n.height-o,Math.max(o-i,e.y))}}var y=e(),b={starting:`green`,running:`green`,waiting:`amber`,idle:`cyan`,paused:`ghost`,stopped:`ghost`,failed:`red`},x={starting:`active`,running:`active`,waiting:`warning`,idle:`success`,paused:`warning`,stopped:`warning`,failed:`error`},S={starting:`running`,running:`running`,waiting:`waiting`,idle:`idle`,paused:`idle`,stopped:`idle`,failed:`failed`},C=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e),w=1.25;function T({workers:e,name:t,onWorker:n}){let r=(0,c.useRef)(null),l=(0,c.useMemo)(()=>m(e),[e]),u=(0,c.useMemo)(()=>({width:l.width,height:l.height}),[l.width,l.height]),[d,f]=(0,c.useState)({width:640,height:420}),[p,h]=(0,c.useState)(()=>g(u,d)),T=(0,c.useRef)(!1),E=(0,c.useRef)(!1),D=(0,c.useRef)(null),O=new Map(e.map(e=>[e.id,e.status])),k=(0,c.useCallback)(e=>h(v(e,u,d)),[u,d]),A=(0,c.useCallback)(()=>{T.current=!1,h(g(u,d))},[u,d]);(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>40&&t.height>40&&f({width:Math.floor(t.width),height:Math.floor(t.height)})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,c.useEffect)(()=>{T.current||h(g(u,d))},[u,d]),(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=t=>{t.preventDefault();let n=e.getBoundingClientRect();T.current=!0,h(e=>v(_(e,{x:t.clientX-n.left,y:t.clientY-n.top},Math.exp(-t.deltaY*.0015)),u,d))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[u,d]);let j={x:d.width/2,y:d.height/2},M=e=>{T.current=!0,k(_(p,j,e))};return(0,y.jsxs)(`div`,{className:`ob-canvas-room`,ref:r,children:[(0,y.jsx)(`div`,{className:`ob-canvas-pan`,onPointerDown:e=>{e.button===0&&(E.current=!1,D.current={x:e.clientX,y:e.clientY,vx:p.x,vy:p.y,id:e.pointerId,far:!1})},onPointerMove:e=>{let t=D.current;if(!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;!t.far&&Math.hypot(n,r)<5||(t.far||e.currentTarget.setPointerCapture?.(t.id),t.far=!0,E.current=!0,T.current=!0,k({k:p.k,x:t.vx+n,y:t.vy+r}))},onPointerUp:e=>{D.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId)},onPointerCancel:()=>D.current=null,children:(0,y.jsxs)(`div`,{className:`ob-canvas-world`,style:{width:l.width,height:l.height,transform:`translate(${p.x}px, ${p.y}px) scale(${p.k})`},children:[(0,y.jsxs)(`svg`,{className:`ob-canvas-edges`,width:l.width,height:l.height,"aria-hidden":`true`,children:[(0,y.jsx)(`defs`,{children:(0,y.jsx)(`marker`,{id:`ob-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,y.jsx)(`path`,{d:`M0 0L10 5L0 10z`,className:`ob-arrow`})})}),l.edges.map(e=>{let t=O.get(e.to),n=(e.x1+e.x2)/2;return(0,y.jsx)(`path`,{d:`M${e.x1} ${e.y1}C${n} ${e.y1} ${n} ${e.y2} ${e.x2} ${e.y2}`,markerEnd:`url(#ob-arrow)`,"data-flow":t===`running`||t===`starting`?`on`:t===`waiting`?`wait`:`off`},`${e.from}>${e.to}`)})]}),l.nodes.map(e=>{let r=e.worker;if(!r)return(0,y.jsxs)(`div`,{className:`ob-cnode ob-cnode-root`,"data-node":`friend`,style:{left:e.x,top:e.y,width:e.w,height:140},children:[(0,y.jsx)(a,{size:92,color:`cyan`,label:t.toUpperCase(),animated:!0}),(0,y.jsx)(`small`,{children:`the assistant`})]},e.id);let c=r.budget&&r.budget>0?Math.min(100,100*r.tokens/r.budget):void 0;return(0,y.jsx)(`div`,{className:`ob-cnode`,role:`button`,tabIndex:0,"data-node":e.id,"data-status":S[r.status],"aria-label":`${r.name}, ${r.title}, ${r.detail||r.status}`,style:{left:e.x,top:e.y,width:240,height:140},onClick:()=>{E.current?E.current=!1:n(e.id)},onKeyDown:t=>(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id)),children:(0,y.jsxs)(s,{cardStyle:`SideRail`,color:b[r.status],padding:`8px 12px`,header:(0,y.jsxs)(`div`,{className:`ob-cnode-head`,children:[(0,y.jsx)(`b`,{children:r.name}),(0,y.jsx)(i,{state:x[r.status],children:r.status.toUpperCase()})]}),children:[(0,y.jsx)(o,{label:`JOB`,value:r.title}),(0,y.jsx)(o,{label:`DOING`,value:r.detail||r.status}),(0,y.jsx)(o,{label:`TOKENS`,value:C(r.tokens),...c===void 0?{}:{barPercent:c}})]})},e.id)})]})}),(0,y.jsxs)(`div`,{className:`ob-canvas-tools`,role:`toolbar`,"aria-label":`View of the team`,children:[(0,y.jsx)(`button`,{type:`button`,"aria-label":`Zoom in`,onClick:()=>M(w),children:`+`}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Zoom out`,onClick:()=>M(1/w),children:`−`}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Fit the team`,onClick:A,children:`⤢`}),(0,y.jsxs)(`span`,{"aria-hidden":`true`,children:[Math.round(p.k*100),`%`]})]})]})}export{T as OrgCanvas};
|