friend-assistant 0.1.98 → 0.1.99
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 +11 -5
- package/dist/pc-agent/agent.js +1 -1
- package/dist/pc-agent/agent.js.sha256 +1 -1
- package/dist/web/assets/{OrgParts-cpxPQOUM.js → OrgParts-BEmAAhgo.js} +1 -1
- package/dist/web/assets/{index-BWBKqeo4.js → index-D8oZdcLi.js} +4 -4
- package/dist/web/assets/{jarvis-ui-BIfOaoqG.js → jarvis-ui-DMmG6Vql.js} +1 -1
- package/dist/web/assets/{jarvisTree-DYpxvcj2.js → jarvisTree-BgxmcvtM.js} +1 -1
- package/dist/web/assets/{ort.bundle.min-DoGBmaIC.js → ort.bundle.min-BOU6KpEx.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
|
@@ -24977,6 +24977,11 @@ var PcStore = class {
|
|
|
24977
24977
|
this.db.prepare("delete from pc_tokens where pc_id = ?").run(id2);
|
|
24978
24978
|
return this.db.prepare("update pcs set revoked = 1 where id = ?").run(id2).changes > 0;
|
|
24979
24979
|
}
|
|
24980
|
+
/** Lets a revoked PC sign in again (with a new enrollment). Its name and permissions stay as they were; its old tokens are already gone. */
|
|
24981
|
+
restore(id2) {
|
|
24982
|
+
this.db.prepare("delete from pc_tokens where pc_id = ?").run(id2);
|
|
24983
|
+
return this.db.prepare("update pcs set revoked = 0, status_json = '' where id = ?").run(id2).changes > 0;
|
|
24984
|
+
}
|
|
24980
24985
|
remove(id2) {
|
|
24981
24986
|
return this.db.prepare("delete from pcs where id = ?").run(id2).changes > 0;
|
|
24982
24987
|
}
|
|
@@ -25029,9 +25034,10 @@ var PcService = class {
|
|
|
25029
25034
|
async reissue(id2, pin, ip) {
|
|
25030
25035
|
await this.pin(pin, ip);
|
|
25031
25036
|
const pc2 = this.store.get(id2);
|
|
25032
|
-
if (!pc2
|
|
25037
|
+
if (!pc2) throw new HttpError(404, "There is no such PC.");
|
|
25038
|
+
if (pc2.revoked) this.store.restore(id2);
|
|
25033
25039
|
const enrollmentId = this.store.newEnrollment(id2);
|
|
25034
|
-
this.deps.audit.log("owner", "pc.reissued", { pc: pc2.name, ip });
|
|
25040
|
+
this.deps.audit.log("owner", pc2.revoked ? "pc.readded" : "pc.reissued", { pc: pc2.name, ip });
|
|
25035
25041
|
return { enrollmentId };
|
|
25036
25042
|
}
|
|
25037
25043
|
start(input, ip) {
|
|
@@ -26121,7 +26127,7 @@ function currentSelf() {
|
|
|
26121
26127
|
// ../server/src/system/npm.ts
|
|
26122
26128
|
import { spawn as spawn10 } from "node:child_process";
|
|
26123
26129
|
var PACKAGE = "friend-assistant";
|
|
26124
|
-
var runningVersion = () => true ? "0.1.
|
|
26130
|
+
var runningVersion = () => true ? "0.1.99" : "development";
|
|
26125
26131
|
async function npmLatest(fetchFn = fetch, timeoutMs = 1e4) {
|
|
26126
26132
|
try {
|
|
26127
26133
|
const res = await fetchFn(`https://registry.npmjs.org/${PACKAGE}/latest`, { headers: { accept: "application/json" }, signal: AbortSignal.timeout(timeoutMs) });
|
|
@@ -31918,7 +31924,7 @@ import { appendFileSync } from "node:fs";
|
|
|
31918
31924
|
import { join as join42 } from "node:path";
|
|
31919
31925
|
var PACKAGE2 = "friend-assistant";
|
|
31920
31926
|
var real2 = {
|
|
31921
|
-
current: () => true ? "0.1.
|
|
31927
|
+
current: () => true ? "0.1.99" : "development",
|
|
31922
31928
|
latest: () => new Promise((resolve13) => {
|
|
31923
31929
|
const child = crossSpawn5("npm", ["view", PACKAGE2, "version", "--prefer-online"], { stdio: ["ignore", "pipe", "ignore"] });
|
|
31924
31930
|
let out = "";
|
|
@@ -32236,7 +32242,7 @@ async function run(argv, io2) {
|
|
|
32236
32242
|
case "version":
|
|
32237
32243
|
case "--version":
|
|
32238
32244
|
case "-v":
|
|
32239
|
-
io2.out(true ? "0.1.
|
|
32245
|
+
io2.out(true ? "0.1.99" : "development");
|
|
32240
32246
|
return 0;
|
|
32241
32247
|
case "lan":
|
|
32242
32248
|
return await lanCommand(rest, io2);
|
package/dist/pc-agent/agent.js
CHANGED
|
@@ -30830,7 +30830,7 @@ function toTask(r) {
|
|
|
30830
30830
|
}
|
|
30831
30831
|
|
|
30832
30832
|
// ../pc-agent/src/main.ts
|
|
30833
|
-
var VERSION = "0.1.
|
|
30833
|
+
var VERSION = "0.1.99";
|
|
30834
30834
|
var TASK = "Friend PC Agent";
|
|
30835
30835
|
function parse3(argv) {
|
|
30836
30836
|
const out = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
978db5cd168c12eefba4a2e184b05c25116c2ed2c7d8518983cd5c7f3ca273ce
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,s as t,t as n,u as r}from"./index-
|
|
1
|
+
import{a as e,s as t,t as n,u as r}from"./index-D8oZdcLi.js";import{a as i,n as a,r as o,t as s}from"./jarvis-ui-DMmG6Vql.js";var c=r(t(),1),l=350,u=174,d=.25,f=2.5,p=96;function m(e){let t=n(e),r=e=>Math.round(e.y/134),i=e=>({x:r(e)===0?0:260+(r(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};
|