@humwick/server 0.130.0 → 0.130.1
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/docs/guides/tools-administration.md +2 -1
- package/docs/openapi.json +1 -1
- package/node_modules/@humwick/kernel/package.json +0 -8
- package/node_modules/@humwick/offload/package.json +0 -4
- package/package.json +5 -5
- package/public/assets/fleet-B_rFEbnL.js +2 -0
- package/public/assets/{index-BK0WV6hF.js → index-BU3uWo2t.js} +4 -4
- package/public/index.html +1 -1
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/scripts/cd-config.ts +16 -3
- package/src/commands-db.ts +7 -3
- package/src/commands-write.ts +8 -0
- package/src/db/activity-write-ops.ts +1 -0
- package/src/db/agent-lifecycle-write-ops.ts +1 -0
- package/src/db/agent-meta.ts +2 -2
- package/src/db/agent-ownership-write-ops.ts +4 -0
- package/src/db/agents-async.ts +6 -2
- package/src/db/agents-write-ops.ts +16 -2
- package/src/db/artifacts-write-ops.ts +8 -3
- package/src/db/bus-outbox-write-ops.ts +1 -0
- package/src/db/channels-write-ops.ts +4 -0
- package/src/db/claude-api-budget-ops.ts +5 -5
- package/src/db/claude-app-oauth.ts +4 -4
- package/src/db/codex-reset-consumes-write-ops.ts +3 -0
- package/src/db/commands-write-ops.ts +21 -0
- package/src/db/config-store-write-ops.ts +2 -0
- package/src/db/continuation-archives-write-ops.ts +2 -0
- package/src/db/delivery-write-ops.ts +5 -0
- package/src/db/hosts-write-ops.ts +14 -0
- package/src/db/inbox-write-ops.ts +4 -0
- package/src/db/insights-write-ops.ts +1 -0
- package/src/db/macos-privacy.ts +1 -1
- package/src/db/message-reads-write-ops.ts +3 -0
- package/src/db/message-write-ops.ts +4 -0
- package/src/db/orchestrators-async.ts +7 -3
- package/src/db/orchestrators-write-ops.ts +7 -1
- package/src/db/orchestrators.ts +17 -5
- package/src/db/prompt-versions-ops.ts +1 -0
- package/src/db/provider-catalog-write-ops.ts +4 -4
- package/src/db/provider-flap-messages-write-ops.ts +1 -0
- package/src/db/provider-quota-lease-write-ops.ts +1 -0
- package/src/db/provider-quota-write-ops.ts +2 -0
- package/src/db/provisioning-write-ops.ts +9 -8
- package/src/db/routing-policy.ts +1 -1
- package/src/db/secrets-broker-write-ops.ts +5 -5
- package/src/db/secrets-vault-write.ts +7 -7
- package/src/db/services-write-ops.ts +3 -0
- package/src/db/spawn-tree-cleanup.ts +3 -0
- package/src/db/team-spawn-delegation.ts +1 -1
- package/src/db/teams-write-ops.ts +4 -4
- package/src/db/timer-cutover-write-ops.ts +7 -0
- package/src/db/timer-ingress-write-ops.ts +9 -0
- package/src/db/timer-operator-write-ops.ts +14 -0
- package/src/db/timer-transfer-write-ops.ts +4 -0
- package/src/db/timer-write-ops.ts +14 -0
- package/src/db/token-db-write-ops.ts +4 -0
- package/src/db/user-settings-write-ops.ts +1 -0
- package/src/db/vault-backup.ts +2 -2
- package/src/db/vault-expiry.ts +2 -2
- package/src/db/vault-health.ts +3 -3
- package/src/db/vault-token-ops.ts +8 -8
- package/src/db/web-tool-call-ops.ts +3 -3
- package/src/db/write-ops.ts +9 -1
- package/src/db/writer-fault-seam.ts +5 -2
- package/src/db/writer-gateway.ts +4 -1
- package/src/mcp-host-tools.ts +1 -1
- package/src/package-pack.ts +42 -39
- package/src/routes/host-resource-control.ts +4 -1
- package/src/routes/orchestrator-bootstrap.ts +2 -2
- package/src/routes/orchestrator.ts +2 -2
- package/src/routes/provider-config.ts +3 -2
- package/src/runtime-tokens.ts +12 -3
- package/src/services/kernel-timers-cutover-chaos-worker.ts +2 -0
- package/src/services/kernel-timers-request-key-migration-chaos-worker.ts +4 -1
- package/public/assets/fleet-BL4UXS_k.js +0 -2
|
@@ -32,7 +32,8 @@ Patch host gate policy using `hostId` and one or more of `landSlots`,
|
|
|
32
32
|
(project id to land slot count). Requires `hosts:write`. Null removes an override;
|
|
33
33
|
unset fields stay unchanged. Per-host settings override fleet defaults in
|
|
34
34
|
`gates/default`; otherwise hardware determines the two pools. CPU and memory are
|
|
35
|
-
per-run
|
|
35
|
+
per-run soft shares; the gate slice caps total gate memory, and a further gate
|
|
36
|
+
starts only while its memory share is free. Returns persisted policy and a warning
|
|
36
37
|
when reservations consume all land slots (shared capacity 0). Idle reservations
|
|
37
38
|
remain borrowable; waiting owners take the next free slot. Use `relay_hosts` to
|
|
38
39
|
check sampled pools and borrowed occupancy after the orchestrator heartbeat.
|
package/docs/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Humwick API",
|
|
5
|
-
"version": "0.130.
|
|
5
|
+
"version": "0.130.1",
|
|
6
6
|
"description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "MIT",
|
|
@@ -35,13 +35,5 @@
|
|
|
35
35
|
"./workflow-runtime": "./workflow-runtime.ts",
|
|
36
36
|
"./workflow-step-commit": "./workflow-step-commit.ts",
|
|
37
37
|
"./workflow-values": "./workflow-values.ts"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@humwick/sdk": "0.2.135",
|
|
41
|
-
"@hono/zod-openapi": "^1.4.0",
|
|
42
|
-
"hono": "^4.12.0",
|
|
43
|
-
"zod": "^4.4.3",
|
|
44
|
-
"ajv": "^8.20.0",
|
|
45
|
-
"jsep": "^1.4.0"
|
|
46
38
|
}
|
|
47
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humwick/server",
|
|
3
|
-
"version": "0.130.
|
|
3
|
+
"version": "0.130.1",
|
|
4
4
|
"description": "Lightweight HTTP message relay for inter-agent communication across machines",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -84,20 +84,20 @@
|
|
|
84
84
|
],
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"age-encryption": "0.3.1",
|
|
87
|
-
"@humwick/channels-host": "0.130.
|
|
87
|
+
"@humwick/channels-host": "0.130.1",
|
|
88
|
+
"@humwick/kernel": "0.0.0",
|
|
89
|
+
"@humwick/offload": "0.0.0",
|
|
88
90
|
"@humwick/providers": "0.104.7",
|
|
89
|
-
"@humwick/sdk": "0.2.
|
|
91
|
+
"@humwick/sdk": "0.2.136",
|
|
90
92
|
"ajv": "^8.20.0",
|
|
91
93
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
92
94
|
"express": "^5.2.1",
|
|
93
95
|
"busboy": "^1.6.0",
|
|
94
96
|
"unbash": "6.0.0",
|
|
95
|
-
"@humwick/kernel": "0.0.0",
|
|
96
97
|
"@hono/zod-openapi": "^1.4.0",
|
|
97
98
|
"hono": "^4.12.0",
|
|
98
99
|
"zod": "^4.4.3",
|
|
99
100
|
"jsep": "^1.4.0",
|
|
100
|
-
"@humwick/offload": "0.0.0",
|
|
101
101
|
"p-queue": "^9.3.3"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{Ct as i,E as a,t as o}from"./store-BvtFdlGX.js";import"./provider-display-DbLWpP3j.js";import{h as s}from"./display-CfO7rTuF.js";import{t as c}from"./host-mTgRw7xh.js";import{t as l}from"./chevron-right-iljytE0x.js";import{t as u}from"./cpu-Dndy84IU.js";import{t as d}from"./git-merge-C7eIG425.js";import{t as f}from"./globe-Cl5fXtqs.js";import{t as p}from"./layers-DEfClY-v.js";import{t as m}from"./loader-circle-BfPd4kOD.js";import{t as h}from"./pencil-B1Hf2V_J.js";import{t as ee}from"./rocket-BmO1qSu-.js";import{t as te}from"./triangle-alert-BBNhfgMi.js";import{t as ne}from"./users-C7B3u9jv.js";import{t as g}from"./button-Do6Z3vvn.js";import{t as _}from"./badge-DqJRtj_p.js";import{t as v}from"./input-CsTB6jIx.js";import{a as re,c as y,i as ie,l as b,n as ae,o as x,r as oe,s as se,t as S,u as C}from"./fleet-metrics-BkHP-P3R.js";import{i as w,o as T,r as E,s as D,t as O}from"./card-C4QJ4hCW.js";var k=e(n(),1),A=r(),j={ok:`text-tone-success-fg`,warn:`text-tone-warning-fg`,crit:`text-tone-danger-fg`,idle:`text-tone-neutral-fg`},M={ok:`stroke-tone-success`,warn:`stroke-tone-warning`,crit:`stroke-tone-danger`,idle:`stroke-tone-neutral`},N={ok:`bg-tone-success`,warn:`bg-tone-warning`,crit:`bg-tone-danger`,idle:`bg-tone-neutral`},P=20,F=2*Math.PI*P;function I({label:e,pct:n,tone:r,center:i,sub:a,title:o}){let s=n===void 0?0:S(n),c=F*(1-s/100);return(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-1 min-w-0`,title:o,children:[(0,A.jsxs)(`div`,{className:`relative h-[60px] w-[60px]`,children:[(0,A.jsxs)(`svg`,{viewBox:`0 0 48 48`,role:`img`,"aria-label":`${e} ${i}`,className:`h-full w-full -rotate-90`,children:[(0,A.jsx)(`circle`,{cx:`24`,cy:`24`,r:P,fill:`none`,strokeWidth:`4.5`,className:`stroke-foreground/10`}),n===void 0?null:(0,A.jsx)(`circle`,{cx:`24`,cy:`24`,r:P,fill:`none`,strokeWidth:`4.5`,strokeLinecap:`round`,"data-testid":`ring-${e.toLowerCase()}`,"data-pct":Math.round(s),className:t(M[r],`motion-safe:animate-fleet-ring-in motion-safe:transition-[stroke-dashoffset] motion-safe:duration-700`),style:{strokeDasharray:F,strokeDashoffset:c,"--ring-c":F}})]}),(0,A.jsx)(`span`,{className:t(`absolute inset-0 flex items-center justify-center text-[13px] font-semibold tabular-nums`,j[r]),children:i})]}),(0,A.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground leading-none`,children:e}),a?(0,A.jsx)(`div`,{className:`text-[10px] text-muted-foreground/80 leading-none truncate max-w-full tabular-nums`,children:a}):null]})}function ce({tone:e,live:n,title:r}){return(0,A.jsxs)(`span`,{className:`relative flex h-3 w-3 items-center justify-center shrink-0`,title:r,role:`img`,"aria-label":r,children:[n?(0,A.jsx)(`span`,{className:t(`absolute inline-flex h-full w-full rounded-full opacity-50 motion-safe:animate-fleet-ping`,N[e])}):null,(0,A.jsx)(`span`,{className:t(`relative inline-flex h-2.5 w-2.5 rounded-full ring-2 ring-card`,N[e])})]})}var L={idle:1,normal:1,busy:2,saturated:3,blocked:4};function le({band:e,tone:n,title:r}){let i=L[e]??0;return(0,A.jsx)(`span`,{className:`inline-flex items-end gap-[3px] h-3.5`,title:r,role:`img`,"aria-label":`pressure ${e}`,children:[1,2,3,4].map(e=>(0,A.jsx)(`span`,{className:t(`w-[3px] rounded-sm transition-colors`,e<=i?N[n]:`bg-foreground/15`),style:{height:`${25+e*18}%`}},e))})}function ue({cells:e,active:n,queued:r}){let i=t=>t<e.own?`bg-tone-sky`:t<e.own+e.other?`bg-tone-warning`:t<e.own+e.other+e.unattributed?`bg-tone-success`:``;return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[3px]`,"data-testid":`gate-cells`,children:[Array.from({length:e.total},(e,r)=>{let a=i(r);return(0,A.jsx)(`span`,{className:t(`h-3 w-3 rounded-[3px]`,a?[a,n&&`motion-safe:animate-fleet-breathe`]:`bg-foreground/10`),style:a&&n?{animationDelay:`${r%6*160}ms`}:void 0},r)}),r>0?(0,A.jsx)(`span`,{className:`ml-1.5 flex items-center gap-[3px]`,title:`${r} queued ${r===1?`gate`:`gates`}`,children:Array.from({length:Math.min(r,6)},(e,t)=>(0,A.jsx)(`span`,{className:`h-3 w-3 rounded-[3px] border border-dashed border-tone-warning/80 motion-safe:animate-fleet-breathe`},t))}):null]})}function R({dots:e,tone:n,active:r,queued:i=0}){return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[3px]`,children:[Array.from({length:e.filled},(e,i)=>(0,A.jsx)(`span`,{className:t(`h-2 w-2 rounded-full`,N[n],r&&`motion-safe:animate-fleet-breathe`),style:r?{animationDelay:`${i%6*200}ms`}:void 0},`f${i}`)),Array.from({length:e.empty},(e,t)=>(0,A.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-foreground/10`},`e${t}`)),Array.from({length:e.over},(e,t)=>(0,A.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-tone-danger ring-1 ring-tone-danger/40`},`o${t}`)),Array.from({length:Math.min(i,6)},(e,t)=>(0,A.jsx)(`span`,{className:`h-2 w-2 rounded-full border border-dashed border-tone-warning/80 motion-safe:animate-fleet-breathe`},`q${t}`))]})}function z({icon:e,label:t,right:n,children:r,title:i}){return(0,A.jsxs)(`div`,{className:`space-y-1.5`,title:i,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground`,children:[e,(0,A.jsx)(`span`,{children:t}),(0,A.jsx)(`span`,{className:`ml-auto normal-case tracking-normal tabular-nums text-foreground/80 text-[11px]`,children:n})]}),r]})}function de({label:e,icon:n,checked:r,saving:i,disabled:a,title:o,onChange:s}){return(0,A.jsxs)(`label`,{title:o,"data-state":r?`on`:`off`,"data-saving":i||void 0,className:t(`group/toggle flex select-none items-center gap-1.5 rounded-full border py-0.5 pl-1.5 pr-1 text-[11px] font-medium transition-colors`,`focus-within:ring-2 focus-within:ring-ring/50`,r?`border-tone-success/30 bg-tone-success/10 text-tone-success-fg`:`border-foreground/10 bg-foreground/[0.03] text-muted-foreground`,a?`cursor-wait`:`cursor-pointer hover:border-foreground/25`,i&&`motion-safe:animate-fleet-breathe`),children:[(0,A.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`peer sr-only`,checked:r,disabled:a,onChange:s}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:`flex items-center`,children:i?(0,A.jsx)(m,{className:`h-3 w-3 motion-safe:animate-spin`}):n}),(0,A.jsx)(`span`,{children:e}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:t(`relative h-3.5 w-6 rounded-full transition-colors`,r?`bg-tone-success`:`bg-foreground/20`),children:(0,A.jsx)(`span`,{className:t(`absolute top-0.5 h-2.5 w-2.5 rounded-full bg-white shadow-sm transition-all`,r?`left-[calc(100%-0.75rem)]`:`left-0.5`)})})]})}var B={"systemd-user-scope":`Linux cgroup (systemd scope)`,"delegated-cgroup":`Linux cgroup (delegated)`,taskpolicy:`macOS background QoS`,nice:`nice priority`,"admission-only":`Admission only`},V={land:`Land`,iterate:`Iterate`,validation:`Validation`};function H(e){let t=e.cpuQuotaAvailable?`soft CPU shares${e.cpuLimit===void 0?``:` · ceiling ${U(e.cpuLimit)} CPUs`}`:`no CPU control${e.priority?` · priority ${e.priority}`:``}`;return{label:B[e.mechanism],detail:t,degraded:e.mechanism===`nice`||e.mechanism===`admission-only`,reason:e.reason}}function U(e){return String(Math.round(e*10)/10)}function W(e){let t=e/1024**3;return t>=1?`${Math.round(t*10)/10} GB`:`${Math.round(e/1024**2)} MB`}function G(e){return e?e.replace(/\/+$/,``).split(`/`).at(-1)||e:`unknown repository`}function K(e,t){let n=e.resource_control,r=n?.sampledAt??e.sampled_at;if(e.state===`unavailable`||!r||t-r>6e4)return{state:`unknown`};if(!n)return{state:`off`};let i=H(n),a=[`agent`,`land`].flatMap(e=>n.paths?.[e]?[{name:e,view:H(n.paths[e])}]:[]),o=(n.work??[]).map(e=>({id:e.id,repository:G(e.repository),repositoryPath:e.repository,kind:e.kind,state:e.state})),s=[...i.degraded?[`${i.label}: ${i.reason??`CPU quota unavailable`}`]:[],...a.filter(e=>e.view.degraded).map(e=>`${e.name===`agent`?`Agent`:`Land`} path, ${e.view.label}: ${e.view.reason??`CPU quota unavailable`}`)];return{state:`on`,mechanism:i,paths:a,usableCpus:U(n.usableCpus),gateCpus:U(n.gateCpus),memory:W(n.memoryBytes),...n.gateMemoryBytes?{gateMemory:n.gateMemoryUsedBytes===void 0?`cap ${W(n.gateMemoryBytes)}`:`${W(n.gateMemoryUsedBytes)} of ${W(n.gateMemoryBytes)} in use`}:{},...n.runMemoryBytes?{runMemory:W(n.runMemoryBytes)}:{},slots:n.slots,held:n.held,waiters:n.waiters,iterateOverflow:n.iterateOverflow,kinds:n.kinds?c.map(e=>({kind:e,label:V[e],...n.kinds[e],cpus:U(n.kinds[e].cpus)})):void 0,work:o,hiddenWork:Math.max(0,n.held+n.waiters-o.length),degradations:s}}var q={landSlots:`Land slots`,validationSlots:`Validation slots`,runCpus:`CPUs per run`,runMemory:`Memory per run (GiB)`};function J({host:e,field:t}){let n=o(e=>e.setHostGateBudget),[r,i]=(0,k.useState)(null),[a,s]=(0,k.useState)(!1),c=e.policy?.[t]??(t===`landSlots`?e.policy?.gateBudget??e.gate_budget:t===`validationSlots`?e.policy?.validationGateBudget:void 0)??null,l=t===`runMemory`?1024**3:1,u=r??(c===null?``:String(c/l)),d=u.trim()===``?null:Number(u)*l,f=t===`landSlots`||t===`validationSlots`,p=d===null||Number.isFinite(d)&&d>0&&(t===`runCpus`?d>=.01&&d<=1e3:Number.isSafeInteger(d)&&(!f||d<=1e3)),m=r!==null&&d!==c,h=async r=>{let a={[t]:r};t===`landSlots`&&(a.gateBudget=null),t===`validationSlots`&&(a.validationGateBudget=null),t===`runCpus`&&(a.landGateCpus=null,a.validationGateCpus=null),s(!0);try{await n(e.id,a)&&i(null)}finally{s(!1)}};return(0,A.jsxs)(`form`,{className:`space-y-1`,onSubmit:e=>{e.preventDefault(),p&&m&&h(d)},children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`label`,{htmlFor:`${t}-${e.id}`,className:`text-[11px] text-muted-foreground`,children:q[t]}),(0,A.jsx)(v,{id:`${t}-${e.id}`,inputMode:`decimal`,className:`h-7 w-20 text-center tabular-nums`,value:u,placeholder:`auto`,disabled:a,"aria-invalid":!p,onChange:e=>i(e.target.value)}),(0,A.jsx)(g,{type:`submit`,size:`sm`,variant:`outline`,className:`h-7 text-xs`,"aria-label":`Apply ${q[t]}`,disabled:!p||!m||a,children:a?`Saving…`:`Apply`}),c===null?null:(0,A.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 text-xs`,disabled:a,"aria-label":`Use automatic ${q[t]}`,onClick:()=>void h(null),children:`Use automatic`})]}),p?null:(0,A.jsx)(`p`,{className:`text-[10px] text-tone-danger-fg`,children:f?`Whole number 1–1000, or empty.`:t===`runCpus`?`0.01–1000 CPUs, or empty.`:`Positive memory in GiB, or empty.`})]})}function Y({host:e}){return(0,A.jsxs)(`div`,{className:`space-y-2`,"aria-label":`Gate pool settings`,children:[Object.keys(q).map(t=>(0,A.jsx)(J,{host:e,field:t},t)),(0,A.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Empty uses fleet or hardware defaults. Land and validation slots add up to one shared pool. CPUs and memory per run are soft shares; the gate slice caps total gate memory.`})]})}function fe({host:e}){let n=K(e,Date.now()),r=n.state===`on`?`${n.held} held · ${n.waiters} queued`:n.state===`off`?`off`:`no data`;return(0,A.jsx)(z,{icon:(0,A.jsx)(u,{className:`w-3 h-3`}),label:`Resource control`,right:r,title:`Built-in host resource control: how this host limits gate CPU, what it has admitted, and the gate budget`,children:(0,A.jsxs)(`div`,{className:`space-y-2 text-[11px]`,"data-testid":`resource-control`,children:[n.state===`unknown`?(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Unknown: no fresh sample from this host's orchestrator.`}):n.state===`off`?(0,A.jsxs)(`p`,{className:`text-muted-foreground`,"data-testid":`resource-control-off`,children:[`Off on this host. Set `,(0,A.jsx)(`code`,{className:`break-all`,children:`AGENT_RELAY_HOST_RESOURCE_CONTROL=1`}),` on its orchestrator to enable shared admission and CPU limits; until then gates use per-repository leases.`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(_,{variant:`secondary`,className:`text-[10px]`,"data-testid":`resource-mechanism`,children:n.mechanism.label}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:n.mechanism.detail})]}),(0,A.jsxs)(`dl`,{className:`grid grid-cols-3 gap-2 tabular-nums`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`CPUs`}),(0,A.jsxs)(`dd`,{children:[n.gateCpus,` of `,n.usableCpus]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Memory`}),(0,A.jsx)(`dd`,{children:n.memory})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Shared pool`}),(0,A.jsxs)(`dd`,{children:[n.held,` / `,n.slots,n.iterateOverflow?` +${n.iterateOverflow} iterate`:``]})]})]}),n.gateMemory?(0,A.jsxs)(`p`,{className:`text-muted-foreground`,"data-testid":`resource-gate-memory`,children:[`Gate memory: `,n.gateMemory,`.`,n.runMemory?` Each run has a ${n.runMemory} soft share; another gate starts only while that much is free.`:``]}):null,n.kinds?(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`p`,{className:`text-muted-foreground`,children:[`One pool for all gates. A free slot goes to lands first, then iterate, then validation.`,n.iterateOverflow?` Iterate may use ${n.iterateOverflow} extra slot when the pool is full.`:``]}),(0,A.jsx)(`ul`,{"aria-label":`Gate kinds`,className:`space-y-0.5 tabular-nums`,children:n.kinds.map(e=>(0,A.jsxs)(`li`,{children:[e.label,`: `,e.held,` held · `,e.waiters,` queued · `,e.cpus,` CPUs per run (soft)`]},e.kind))})]}):(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Pool detail not reported by this orchestrator.`}),n.degradations.map(e=>(0,A.jsxs)(`div`,{"data-testid":`resource-degraded`,className:`flex items-start gap-1.5 rounded-md bg-tone-warning/10 px-2 py-1.5 leading-snug text-tone-warning-fg`,children:[(0,A.jsx)(te,{className:`w-3 h-3 mt-px shrink-0`}),(0,A.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Degraded. `,e]})]},e)),n.paths.length>1||n.paths.some(e=>e.view.label!==n.mechanism.label)?(0,A.jsx)(`ul`,{className:`space-y-0.5 text-muted-foreground`,children:n.paths.map(e=>(0,A.jsxs)(`li`,{children:[e.name===`agent`?`Agents`:`Lands`,`: `,e.view.label,` · `,e.view.detail]},e.name))}):null,n.work.length>0?(0,A.jsxs)(`ul`,{className:`space-y-1`,"aria-label":`Held and queued gates`,children:[n.work.map(e=>(0,A.jsxs)(`li`,{"data-testid":`resource-work`,"data-state":e.state,className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-1.5 text-[10px] font-medium`,e.state===`held`?`border-tone-success/30 bg-tone-success/10 text-tone-success-fg`:`border-dashed border-tone-warning/80 text-tone-warning-fg`),children:e.state}),(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.kind}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.repositoryPath??e.id,children:e.repository})]},e.id)),n.hiddenWork>0?(0,A.jsxs)(`li`,{className:`text-muted-foreground`,children:[`+`,n.hiddenWork,` more not listed`]}):null]}):n.held+n.waiters>0?(0,A.jsxs)(`p`,{className:`text-muted-foreground`,children:[n.held+n.waiters,` gates in flight; detail not reported by this orchestrator.`]}):(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`No gates held or queued.`})]}),e.resource_control?.gateLimits?.enabled?(0,A.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Gate cap: `,e.resource_control.gateLimits.gateRunCapMs/6e4,` min · Slot hold cap: `,e.resource_control.gateLimits.slotHoldCapMs/6e4,` min`]}):null,Object.keys(e.gate_reservations??{}).length>0?(0,A.jsx)(`ul`,{"aria-label":`Project reserved gate slots`,className:`space-y-0.5 text-muted-foreground`,children:Object.entries(e.gate_reservations).map(([e,t])=>(0,A.jsxs)(`li`,{children:[e,`: `,t,` reserved gate slot`,t===1?``:`s`]},e))}):null,e.gate_reservation_warning?(0,A.jsx)(`p`,{role:`alert`,className:`text-tone-warning-fg`,children:e.gate_reservation_warning}):null,(0,A.jsx)(Y,{host:e})]})})}function X({session:e,now:t}){let n=o(t=>t.agentsById[e.agentId]),r=o(t=>t.orchestrators.find(t=>t.id===e.orchestratorId)?.hostname),i=o(e=>e.openAgentDetail),a=n?.label||n?.name||e.agentId;return(0,A.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 py-2 text-sm`,"data-testid":`browser-fleet-row`,"data-session-id":e.id,children:[n?(0,A.jsx)(`button`,{type:`button`,className:`min-w-0 max-w-full truncate font-medium hover:underline`,onClick:()=>i(n),children:a}):(0,A.jsx)(`span`,{className:`min-w-0 max-w-full truncate font-medium`,children:a}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,title:e.orchestratorId,children:r??e.orchestratorId}),(0,A.jsx)(_,{variant:`outline`,className:`text-[11px]`,children:e.status}),(0,A.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,title:new Date(e.createdAt).toLocaleString(),children:[`open `,s(t,e.createdAt)]}),(0,A.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,title:`Time since the agent last used this browser, as of the host's last report`,children:[`idle `,e.status===`running`&&e.lastActivityAt?s(t,e.lastActivityAt):`—`]}),(0,A.jsx)(`span`,{className:`ml-auto`,children:(0,A.jsx)(C,{session:e,label:`Stop the browser of ${a}`})})]})}function pe(){window.location.hash=`settings/agents`,o.getState().switchView(`settings`)}function Z(){let e=o(e=>e.browser),t=i();if(!e?.enabled)return null;let n=Object.values(e.sessions).filter(a).sort((e,t)=>t.createdAt-e.createdAt),r=e.limits;return(0,A.jsxs)(O,{size:`sm`,"data-testid":`browser-fleet`,children:[(0,A.jsxs)(T,{children:[(0,A.jsxs)(D,{className:`flex items-center gap-2 text-sm`,children:[(0,A.jsx)(f,{className:`size-4`}),`Browser sessions`]}),(0,A.jsxs)(w,{className:`flex flex-wrap items-center gap-x-2 text-xs`,children:[r?(0,A.jsxs)(`span`,{"data-testid":`browser-fleet-limits`,children:[`Up to `,r.perAgent,` per agent and `,r.perHost,` per host. An idle browser stops after `,r.idleTimeoutMinutes,` min.`]}):(0,A.jsx)(`span`,{children:`Headless browsers that agents run on their hosts.`}),(0,A.jsx)(g,{variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,onClick:pe,children:`Change limits`})]})]}),(0,A.jsx)(E,{children:e.fleetError?(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.fleetError}):n.length===0?(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No browser is open.`}):(0,A.jsx)(`ul`,{className:`divide-y`,children:n.map(e=>(0,A.jsx)(X,{session:e,now:t},e.id))})})]})}var me={healthy:`ok`,degraded:`warn`,unavailable:`crit`};function he(e){return e===`idle`||e===`normal`?`ok`:e===`busy`?`warn`:e===`saturated`||e===`blocked`?`crit`:`idle`}function Q({label:e,children:t}){return(0,A.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:`text-right text-foreground tabular-nums`,children:t})]})}function $({host:e}){let n=o(e=>e.setHostAdmission),[r,i]=(0,k.useState)(null),a=async t=>{i(t);try{await n(e.id,{[t]:e.policy?.[t]===!1})}finally{i(null)}},s=o(e=>e.openHostEdit),c=o(e=>e.fetchHostProviders),u=o(t=>ie(t.orchestrators,e.id)),f=o(e=>e.acceptHostHardware),m=e.state!==`unavailable`&&!!e.gates_sampled_at&&Date.now()-e.gates_sampled_at<=6e4,v=(e.landing_slots?.queued??0)-(e.landing_slots?.wait_reasons?.reduce((e,t)=>e+t.count,0)??0),S=m?e.gate_capacity:void 0,C=e.state===`unavailable`?void 0:e.gate_arming,w=e.system_tags.includes(`conflict:pending`),M=e.enabled?me[e.state]??`idle`:`idle`,P=re(e.cpu_utilization),F=b(x(e.used_ram),x(e.total_ram)),L=x(e.total_storage),B=x(e.free_storage),V=L&&B!==void 0?b(L-B,L):void 0,H=e=>e===void 0?`—`:`${Math.round(e)}%`,U=m?e.running_gates:void 0,W=(S?.reservations??S?.reservedCores??U??0)>0,G=S?oe(S):U===void 0?`unknown`:`${U} running`,K=e.agent_slots?.used??e.live_agents,q=e.agent_slots?.max,J=q!==void 0&&K>q,Y=e.landing_slots,X=(Y?.used??0)>0,pe=e.policy?.spawnEnabled===!1||e.policy?.gatesEnabled===!1,Z=e.band_reason??e.band,$=e.project_toolchain,ge=[e.band&&e.band!==`normal`&&e.band_reason&&!e.state_details?.includes(e.band_reason)?{text:e.band_reason,tone:`idle`}:null,e.state_details?{text:e.state_details,tone:`warn`}:null,e.identity.matched?null:{text:`${e.identity.cause} ${e.identity.remedy}`,tone:`crit`},C?.state===`unarmed`?{text:`Gate capacity NOT ARMED (${C.cause}): gates run uncapped. ${C.reason??``}`,tone:`crit`}:null,$?.resolver?.error?{text:`Project toolchains refused: ${$.resolver.error}`,tone:`crit`}:null].filter(e=>e!==null);return(0,A.jsxs)(O,{className:t(`relative gap-3 transition-shadow hover:shadow-md`,!e.enabled&&`opacity-60`),children:[(0,A.jsx)(`div`,{className:t(`absolute inset-x-0 top-0 h-0.5`,N[M],`opacity-70`),"aria-hidden":!0}),(0,A.jsxs)(T,{className:`pb-0 pt-1 px-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,A.jsx)(`div`,{className:`pt-1.5`,children:(0,A.jsx)(ce,{tone:M,live:e.enabled&&e.state===`healthy`,title:`${e.enabled?e.state:`disabled`}`})}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsx)(D,{className:`text-sm font-semibold truncate`,children:e.label}),(0,A.jsxs)(`div`,{className:`text-[11px] text-muted-foreground mt-0.5 truncate`,children:[e.os,e.os_version?` ${e.os_version}`:``,` · `,e.cpu_cores,`c / `,e.cpu_threads,`t`]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 pt-0.5`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:e.state}),e.band?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(le,{band:e.band,tone:he(e.band),title:Z}),(0,A.jsx)(`span`,{className:t(`text-[10px] font-medium`,j[he(e.band)]),title:Z,children:e.band})]}):null]})]}),(e.tags.length>0||e.system_tags.length>0)&&(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-1 pt-2`,children:[e.tags.map(e=>(0,A.jsx)(_,{variant:`secondary`,className:`text-[10px]`,children:e},`tag-${e}`)),e.system_tags.map(e=>(0,A.jsx)(_,{variant:`outline`,className:`text-[10px] text-muted-foreground`,children:e},`stag-${e}`))]})]}),(0,A.jsxs)(E,{className:`px-4 space-y-3.5`,children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 rounded-lg bg-foreground/[0.03] py-3 px-1`,children:[(0,A.jsx)(I,{label:`CPU`,pct:P,tone:y(P),center:H(P),sub:e.free_threads===void 0?void 0:`${e.free_threads} free`,title:`CPU utilization ${e.cpu_utilization??`unknown`}: busy share of all cores${e.cpu_pressure?` · CPU pressure ${e.cpu_pressure} (share of time tasks wait for a CPU)`:``}${e.free_threads===void 0?``:` · ${e.free_threads} free threads`}`}),(0,A.jsx)(I,{label:`RAM`,pct:F,tone:y(F),center:H(F),sub:e.used_ram?`${e.used_ram} / ${e.total_ram}`:e.total_ram,title:`RAM ${e.used_ram??`unknown`} used of ${e.total_ram}${e.usable_ram?` · ${e.usable_ram} available`:``}`}),(0,A.jsx)(I,{label:`Disk`,pct:V,tone:y(V),center:H(V),sub:e.free_storage?`${e.free_storage} free`:e.total_storage,title:`Disk ${e.free_storage??`unknown`} free of ${e.total_storage}`})]}),(0,A.jsx)(z,{icon:(0,A.jsx)(p,{className:`w-3 h-3`}),label:`Gates`,right:G,title:`Gate slots: one cell per CPU core of host gate capacity; blue = Relay's gates, amber = other users' gates, dashed = queued`,children:S?(0,A.jsx)(ue,{cells:ae(S),active:W,queued:S.queued}):(0,A.jsx)(`div`,{className:`h-3 rounded-[3px] bg-foreground/10`})}),(0,A.jsx)(fe,{host:e}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:[(0,A.jsx)(z,{icon:(0,A.jsx)(ne,{className:`w-3 h-3`}),label:`Agents`,right:q===void 0?K:`${K} / ${q}`,title:q===void 0?`${K} live agents`:`${K} / ${q} ${e.agent_slots?.cap_source===`operator`?`cap`:`default cap`}`,children:(0,A.jsx)(R,{dots:se(K,q),tone:J?`crit`:`ok`,active:K>0})}),Y?(0,A.jsx)(z,{icon:(0,A.jsx)(d,{className:`w-3 h-3`}),label:`Landing`,right:`${Y.used} / ${Y.max}${Y.queued>0?` +${Y.queued}`:``}`,title:`Landing admission: ${Y.used} / ${Y.max} slots, ${Y.queued} queued`,children:(0,A.jsx)(R,{dots:se(Y.used,Y.max),tone:`ok`,active:X,queued:Y.queued})}):null]}),ge.map(e=>(0,A.jsxs)(`div`,{className:t(`flex items-start gap-1.5 rounded-md px-2 py-1.5 text-[11px] leading-snug`,e.tone===`crit`?`bg-tone-danger/10 text-tone-danger-fg`:e.tone===`warn`?`bg-tone-warning/10 text-tone-warning-fg`:`bg-foreground/5 text-muted-foreground`),children:[(0,A.jsx)(te,{className:`w-3 h-3 mt-px shrink-0`}),(0,A.jsx)(`span`,{title:e.text,children:e.text})]},e.text)),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[11px]`,children:[[`spawnEnabled`,`gatesEnabled`].map(t=>(0,A.jsx)(de,{label:t===`spawnEnabled`?`Spawns`:`Gates`,icon:t===`spawnEnabled`?(0,A.jsx)(ee,{className:`h-3 w-3`}):(0,A.jsx)(p,{className:`h-3 w-3`}),checked:e.policy?.[t]!==!1,saving:r===t,disabled:r!==null,title:t===`spawnEnabled`?`Spawns: whether new agents may start on this host. Off drains it — running agents continue.`:`Gates: whether this host may run test gates and landings. Off drains it — running gates finish.`,onChange:()=>void a(t)},t)),(0,A.jsxs)(`div`,{className:`ml-auto flex gap-1.5`,children:[w?(0,A.jsx)(g,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:()=>void f(e.id),children:`Accept new hardware / same host`}):null,(0,A.jsxs)(g,{size:`sm`,variant:`ghost`,className:`h-7 text-xs gap-1`,onClick:()=>{u&&c(u),s(e)},children:[(0,A.jsx)(h,{className:`w-3 h-3`}),`Edit host`]})]})]}),pe?(0,A.jsxs)(`div`,{className:`text-xs text-tone-warning-fg`,children:[`Draining: `,e.live_agents,` live agents · `,U??`unknown`,` running gates`]}):null,(0,A.jsxs)(`details`,{className:`group text-xs`,children:[(0,A.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground`,children:[(0,A.jsx)(l,{className:`w-3 h-3 transition-transform group-open:rotate-90`}),`Details`]}),(0,A.jsxs)(`dl`,{className:`mt-2 space-y-1`,children:[(0,A.jsx)(Q,{label:`RAM`,children:e.total_ram}),(0,A.jsx)(Q,{label:`Storage`,children:e.total_storage}),(0,A.jsxs)(Q,{label:`CPU`,children:[e.cpu_type,e.cpu_model?` ${e.cpu_model}`:``]}),(0,A.jsxs)(Q,{label:`Cores/Threads`,children:[e.cpu_cores,`c / `,e.cpu_threads,`t`]}),(0,A.jsx)(Q,{label:`CPU utilization`,children:e.cpu_utilization??`—`}),e.cpu_pressure?(0,A.jsx)(Q,{label:`CPU pressure (PSI)`,children:e.cpu_pressure}):null,e.free_threads===void 0?null:(0,A.jsx)(Q,{label:`Free threads`,children:e.free_threads}),e.used_ram?(0,A.jsx)(Q,{label:`Used RAM`,children:e.used_ram}):null,e.usable_ram?(0,A.jsx)(Q,{label:`Avail RAM`,children:e.usable_ram}):null,e.free_storage?(0,A.jsx)(Q,{label:`Free disk`,children:e.free_storage}):null,(0,A.jsx)(Q,{label:`Agents`,children:q===void 0?K:`${K} / ${q} ${e.agent_slots?.cap_source===`operator`?`cap`:`default cap`}`}),Y?(0,A.jsxs)(Q,{label:`Landing admission`,children:[Y.used,` / `,Y.max,` `,Y.cap_source===`operator`?`slots`:`default slots`,Y.wait_reasons?.length?Y.wait_reasons.map(e=>` · ${e.count} ${e.reason}`).join(``):``,v>0?` · ${v} queued lands`:``]}):null,(0,A.jsx)(Q,{label:`Gates`,children:G}),$?(0,A.jsx)(Q,{label:`Project toolchains`,children:$.resolver?`mise${$.resolver.miseVersion?` ${$.resolver.miseVersion}`:``}${$.resolver.error?` (unavailable)`:``}`:`off`}):null,Object.entries($?.projects??{}).map(([e,t])=>(0,A.jsx)(Q,{label:(0,A.jsx)(`span`,{title:e,children:e.split(`/`).filter(Boolean).at(-1)??e}),children:t},e))]})]})]})]})}function ge(){let e=o(e=>e.hosts),t=o(e=>e.hostsLoading),n=o(e=>e.fetchHosts),r=e.filter(e=>e.enabled).length;return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-base font-semibold`,children:`Fleet`}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Registered hosts, hardware, and live load`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[(0,A.jsxs)(_,{variant:`outline`,className:`text-xs`,children:[r,` enabled`]}),(0,A.jsx)(g,{size:`sm`,variant:`outline`,disabled:t,onClick:()=>void n(),children:t?`Refreshing…`:`Refresh`})]})]}),e.length===0?(0,A.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:t?`Loading hosts…`:`No hosts registered.`}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4`,children:e.map(e=>(0,A.jsx)($,{host:e},e.id))}),(0,A.jsx)(Z,{})]})}export{ge as FleetView};
|
|
2
|
+
//# sourceMappingURL=fleet-B_rFEbnL.js.map
|