agent-lookout 0.2.3 → 0.2.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 (37) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/PRIVACY.md +59 -15
  3. package/README.md +10 -6
  4. package/SECURITY.md +16 -6
  5. package/dist/THIRD-PARTY-LICENSES.md +195 -0
  6. package/dist/assets/{HistoryPanel-DMnhIoFB.js → HistoryPanel-CIjshvhu.js} +1 -1
  7. package/dist/assets/SessionPanel-eBOdTLD9.js +1 -0
  8. package/dist/assets/index-B-myfVQS.js +2 -0
  9. package/dist/assets/index-Cceyz9yZ.css +1 -0
  10. package/dist/assets/radix-BH0JH8UU.js +41 -0
  11. package/dist/cli/agent-lookout.js +4 -4
  12. package/dist/cli/{chunk-GOX5UB5L.js → chunk-63XPRBHW.js} +85 -3
  13. package/dist/cli/{chunk-54ODUY75.js → chunk-KNOLJ3IC.js} +1 -1
  14. package/dist/cli/{chunk-4C34YX6S.js → chunk-XVXSGVEW.js} +6 -2
  15. package/dist/cli/mcpServer-HGH6PY4W.js +23664 -0
  16. package/dist/cli/{startCommand-H6O35VYR.js → startCommand-KNXMVM2U.js} +3996 -2822
  17. package/dist/index.html +3 -3
  18. package/docs/API.md +169 -62
  19. package/docs/GUIDE.md +127 -58
  20. package/package.json +5 -5
  21. package/dist/assets/SessionPanel-BNm9wCzf.js +0 -1
  22. package/dist/assets/atkinson-hyperlegible-mono-latin-400-normal-Cmjm2dBj.woff +0 -0
  23. package/dist/assets/atkinson-hyperlegible-mono-latin-500-normal-BV5ipwqM.woff +0 -0
  24. package/dist/assets/atkinson-hyperlegible-mono-latin-600-normal-CuPF9o0F.woff +0 -0
  25. package/dist/assets/atkinson-hyperlegible-mono-latin-ext-400-normal-ITMuFrSK.woff +0 -0
  26. package/dist/assets/atkinson-hyperlegible-mono-latin-ext-500-normal-BiHEOgiK.woff +0 -0
  27. package/dist/assets/atkinson-hyperlegible-mono-latin-ext-600-normal-ZiH-ObRk.woff +0 -0
  28. package/dist/assets/atkinson-hyperlegible-next-latin-400-normal-DPp7N0cD.woff +0 -0
  29. package/dist/assets/atkinson-hyperlegible-next-latin-500-normal-B0CYqHl3.woff +0 -0
  30. package/dist/assets/atkinson-hyperlegible-next-latin-600-normal-BhgCag5w.woff +0 -0
  31. package/dist/assets/atkinson-hyperlegible-next-latin-ext-400-normal-qxMiU51n.woff +0 -0
  32. package/dist/assets/atkinson-hyperlegible-next-latin-ext-500-normal-oZS3KxrF.woff +0 -0
  33. package/dist/assets/atkinson-hyperlegible-next-latin-ext-600-normal-BBAQIogt.woff +0 -0
  34. package/dist/assets/index-Ckda8OV4.js +0 -2
  35. package/dist/assets/index-DFR77qn5.css +0 -1
  36. package/dist/assets/radix-27o0jeIu.js +0 -41
  37. package/dist/cli/mcpServer-QQFQR6DC.js +0 -246
@@ -2375,3 +2375,198 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
2375
2375
  DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2376
2376
  FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
2377
2377
  OTHER DEALINGS IN THE FONT SOFTWARE.
2378
+
2379
+ ## @modelcontextprotocol/sdk - 1.32.1 (MIT)
2380
+
2381
+ MIT License
2382
+
2383
+ Copyright (c) 2024 Anthropic, PBC
2384
+
2385
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2386
+ of this software and associated documentation files (the "Software"), to deal
2387
+ in the Software without restriction, including without limitation the rights
2388
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2389
+ copies of the Software, and to permit persons to whom the Software is
2390
+ furnished to do so, subject to the following conditions:
2391
+
2392
+ The above copyright notice and this permission notice shall be included in all
2393
+ copies or substantial portions of the Software.
2394
+
2395
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2396
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2397
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2398
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2399
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2400
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2401
+ SOFTWARE.
2402
+
2403
+ ## ajv - 8.20.0 (MIT)
2404
+
2405
+ The MIT License (MIT)
2406
+
2407
+ Copyright (c) 2015-2021 Evgeny Poberezkin
2408
+
2409
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2410
+ of this software and associated documentation files (the "Software"), to deal
2411
+ in the Software without restriction, including without limitation the rights
2412
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2413
+ copies of the Software, and to permit persons to whom the Software is
2414
+ furnished to do so, subject to the following conditions:
2415
+
2416
+ The above copyright notice and this permission notice shall be included in all
2417
+ copies or substantial portions of the Software.
2418
+
2419
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2420
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2421
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2422
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2423
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2424
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2425
+ SOFTWARE.
2426
+
2427
+ ## ajv-formats - 3.0.1 (MIT)
2428
+
2429
+ MIT License
2430
+
2431
+ Copyright (c) 2020 Evgeny Poberezkin
2432
+
2433
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2434
+ of this software and associated documentation files (the "Software"), to deal
2435
+ in the Software without restriction, including without limitation the rights
2436
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2437
+ copies of the Software, and to permit persons to whom the Software is
2438
+ furnished to do so, subject to the following conditions:
2439
+
2440
+ The above copyright notice and this permission notice shall be included in all
2441
+ copies or substantial portions of the Software.
2442
+
2443
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2444
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2445
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2446
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2447
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2448
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2449
+ SOFTWARE.
2450
+
2451
+ ## fast-deep-equal - 3.1.3 (MIT)
2452
+
2453
+ MIT License
2454
+
2455
+ Copyright (c) 2017 Evgeny Poberezkin
2456
+
2457
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2458
+ of this software and associated documentation files (the "Software"), to deal
2459
+ in the Software without restriction, including without limitation the rights
2460
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2461
+ copies of the Software, and to permit persons to whom the Software is
2462
+ furnished to do so, subject to the following conditions:
2463
+
2464
+ The above copyright notice and this permission notice shall be included in all
2465
+ copies or substantial portions of the Software.
2466
+
2467
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2468
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2469
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2470
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2471
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2472
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2473
+ SOFTWARE.
2474
+
2475
+ ## fast-uri - 3.1.8 (BSD-3-Clause)
2476
+
2477
+ Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
2478
+ Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
2479
+ All rights reserved.
2480
+
2481
+ Redistribution and use in source and binary forms, with or without
2482
+ modification, are permitted provided that the following conditions are met:
2483
+ * Redistributions of source code must retain the above copyright
2484
+ notice, this list of conditions and the following disclaimer.
2485
+ * Redistributions in binary form must reproduce the above copyright
2486
+ notice, this list of conditions and the following disclaimer in the
2487
+ documentation and/or other materials provided with the distribution.
2488
+ * The names of any contributors may not be used to endorse or promote
2489
+ products derived from this software without specific prior written
2490
+ permission.
2491
+
2492
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2493
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2494
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2495
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
2496
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2497
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2498
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2499
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2500
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2501
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2502
+
2503
+ * * *
2504
+
2505
+ The complete list of contributors can be found at:
2506
+ - https://github.com/garycourt/uri-js/graphs/contributors
2507
+
2508
+ ## json-schema-traverse - 1.0.0 (MIT)
2509
+
2510
+ MIT License
2511
+
2512
+ Copyright (c) 2017 Evgeny Poberezkin
2513
+
2514
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2515
+ of this software and associated documentation files (the "Software"), to deal
2516
+ in the Software without restriction, including without limitation the rights
2517
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2518
+ copies of the Software, and to permit persons to whom the Software is
2519
+ furnished to do so, subject to the following conditions:
2520
+
2521
+ The above copyright notice and this permission notice shall be included in all
2522
+ copies or substantial portions of the Software.
2523
+
2524
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2525
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2526
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2527
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2528
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2529
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2530
+ SOFTWARE.
2531
+
2532
+ ## zod - 4.6.5 (MIT)
2533
+
2534
+ MIT License
2535
+
2536
+ Copyright (c) 2025 Colin McDonnell
2537
+
2538
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2539
+ of this software and associated documentation files (the "Software"), to deal
2540
+ in the Software without restriction, including without limitation the rights
2541
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2542
+ copies of the Software, and to permit persons to whom the Software is
2543
+ furnished to do so, subject to the following conditions:
2544
+
2545
+ The above copyright notice and this permission notice shall be included in all
2546
+ copies or substantial portions of the Software.
2547
+
2548
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2549
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2550
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2551
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2552
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2553
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2554
+ SOFTWARE.
2555
+
2556
+ ## zod-to-json-schema - 3.25.2 (ISC)
2557
+
2558
+ ISC License
2559
+
2560
+ Copyright (c) 2020, Stefan Terdell
2561
+
2562
+ Permission to use, copy, modify, and/or distribute this software for any
2563
+ purpose with or without fee is hereby granted, provided that the above
2564
+ copyright notice and this permission notice appear in all copies.
2565
+
2566
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
2567
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
2568
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
2569
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2570
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
2571
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
2572
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1 +1 @@
1
- import{r as y,j as t}from"./react-C2DiJaR6.js";import{b as G,t as K,r as q,f as U,a as _,c as X,d as V,h as $,m as J,H as Q,e as Z,D as ee,g as M,s as te,i as se,j as ne,S as oe,L as ae,C as re,k as ie}from"./index-Ckda8OV4.js";import"./motion-BAhdRuCw.js";import"./radix-27o0jeIu.js";const le={"needs-you":"text-status-needs-you-edge",working:"text-status-working",idle:"text-status-idle"},L={top:12,right:12,bottom:24,left:30},T=220,de=76,ce=104,I=1/60;function ue({samples:s,start:n,end:a,tone:g,label:w,describe:l,className:m}){const p=y.useRef(null),[c,k]=y.useState(0),[u,i]=y.useState(null);y.useEffect(()=>{const e=p.current;if(!e)return;const o=new ResizeObserver(([j])=>{j&&k(Math.floor(j.contentRect.width))});return o.observe(e),()=>o.disconnect()},[]);const r=L.left,h=Math.max(r+1,c-L.right),x=L.top,d=T-L.bottom,N=a-n;let O=0;for(const e of s)e.at>=n&&e.at<=a&&e.value>O&&(O=e.value);const A=V(O),b=G(s,{start:n,end:a},{left:r,right:h,top:x,bottom:d,ceiling:A.ceiling}),W=e=>r+(e-n)/N*(h-r),S=e=>d-e/A.ceiling*(d-x),B=K(n,a,Math.max(1,Math.floor((h-r)/de))),R=u??1,H=n+R*N,E=q(b.runs,H),C=E?l(E.value):"Not measured",v=W(H),z=(e,o)=>{const j=o.left+r,f=h-r;i(Math.min(1,Math.max(0,(e-j)/f)))},Y=e=>{const j={ArrowLeft:f=>f-I,ArrowRight:f=>f+I,PageDown:f=>f-I*10,PageUp:f=>f+I*10,Home:()=>0,End:()=>1}[e.key];j&&(e.preventDefault(),i(Math.min(1,Math.max(0,j(u??1)))))};return t.jsxs("div",{ref:p,"data-slot":"history-chart",role:"slider",tabIndex:0,"aria-label":`${w}. Arrow keys read the count at each moment.`,"aria-orientation":"horizontal","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(R*100),"aria-valuetext":`${_(H)}: ${C}`,onPointerMove:e=>z(e.clientX,e.currentTarget.getBoundingClientRect()),onPointerLeave:()=>i(null),onFocus:e=>{e.currentTarget.matches(":focus-visible")&&i(o=>o??1)},onBlur:()=>i(null),onKeyDown:Y,className:X("relative w-full cursor-crosshair rounded-row",le[g],m),style:{height:T},children:[c>0&&b.unmeasured.map((e,o)=>t.jsx("div",{"aria-hidden":!0,"data-part":"unmeasured",className:"unmeasured-hatch absolute",style:{left:e.x,top:x,width:e.width,height:d-x}},o)),c>0&&t.jsxs("svg",{"aria-hidden":!0,width:c,height:T,className:"relative block",children:[A.ticks.map(e=>t.jsxs("g",{children:[t.jsx("line",{"data-part":"grid",x1:r,x2:h,y1:S(e),y2:S(e),stroke:e===0?"var(--rule-strong)":"var(--hairline)",strokeWidth:1,shapeRendering:"crispEdges"}),t.jsx("text",{x:r-8,y:S(e),dy:"0.32em",textAnchor:"end",className:"fill-ink-muted font-mono text-micro",children:e})]},e)),b.unmeasured.map((e,o)=>e.width>=ce&&t.jsx("text",{"data-part":"unmeasured-label",x:e.x+8,y:x+14,className:"fill-ink-muted font-mono text-micro",stroke:"var(--glass-float)",strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke",children:"Not measured"},o)),b.areas.map((e,o)=>t.jsx("path",{d:e,fill:"currentColor",stroke:"none",opacity:.1},o)),b.lines.map((e,o)=>t.jsx("path",{"data-part":"line",d:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},o)),B.map(e=>{const o=W(e);return o<r+16||o>h-16?null:t.jsx("text",{"data-part":"time-tick",x:o,y:T-6,textAnchor:"middle",className:"fill-ink-muted font-mono text-micro",children:U(e)},e)}),u!==null&&t.jsxs("g",{"data-part":"crosshair",children:[t.jsx("line",{x1:v,x2:v,y1:x,y2:d,stroke:"var(--ink-muted)",strokeWidth:1,shapeRendering:"crispEdges"}),E&&t.jsx("circle",{cx:v,cy:S(Math.min(E.value,A.ceiling)),r:4.5,fill:"currentColor",stroke:"var(--glass-float)",strokeWidth:2})]})]}),u!==null&&c>0&&t.jsxs("div",{"aria-hidden":!0,"data-part":"reading",className:"pointer-events-none absolute z-10 rounded-row bg-glass-float px-2.5 py-1.5 font-mono text-fact whitespace-nowrap inset-ring inset-ring-rule",style:R>.62?{top:x,right:c-v+10}:{top:x,left:v+10},children:[t.jsx("span",{className:"block text-ink-muted",children:_(H)}),t.jsx("span",{className:"block text-ink",children:C})]})]})}const he=6e4;function me(s,n){const[a,g]=y.useState(null),[w,l]=y.useState(null),m=s>Q,p=n?.startedAt??null,c=n?$(n).at:null;if(y.useEffect(()=>{if(!m)return;let u=!0;const i=()=>{Z(s).then(h=>{u&&(g({windowMs:s,history:h}),l(null))},()=>{u&&l(s)})};i();const r=setInterval(i,he);return()=>{u=!1,clearInterval(r)}},[m,s,p,c]),!m)return{history:n,status:n?"ready":"loading"};const k=a?.windowMs===s&&(p===null||a.history.startedAt===p)&&(c===null||$(a.history).at===c)?a.history:null;return k?{history:J(k,n),status:"ready"}:{history:null,status:w===s?"failed":"loading"}}const P={needsYou:{title:"Needs you",about:"How many sessions were waiting on you, over time.",tone:"needs-you",chart:"Sessions that need you",describe:s=>`${s} ${s===1?"needs":"need"} you`,explainer:"A session needs you when it has stopped and cannot go on without an answer: a permission to grant, a question, or a plan to approve. The line is how many were waiting at each moment."},working:{title:"Working",about:"How many sessions were in the middle of a task, over time.",tone:"working",chart:"Sessions working",describe:s=>`${s} working`,explainer:"A session is working while it is in the middle of a task. The line is how many were busy at each moment."},idle:{title:"Idle",about:"How many sessions were ready for a new prompt, over time.",tone:"idle",chart:"Idle sessions",describe:s=>`${s} idle`,explainer:"A session is idle when it has finished what it was asked and is ready for a new prompt. One left idle a day or more is stale, and is counted under Stale instead. The line is how many were idle at each moment."}},D="–";function F({label:s,value:n,caption:a}){return t.jsxs("div",{"data-slot":"figure",className:"min-w-0",children:[t.jsx("p",{className:"text-body font-medium text-ink-secondary",children:s}),t.jsx("p",{className:"mt-2 text-stat font-medium tabular-nums",children:n}),t.jsx("p",{className:"mt-2 text-caption text-ink-muted",children:a})]})}function xe({metric:s,state:n,now:a}){const[g,w]=y.useState("15m"),l=M.find(d=>d.id===g)??M[0],m=P[s],{history:p,status:c}=me(l.ms,n.history),k=a-l.ms,u=p?te(p.points,s):[];let i=null;for(const d of u)d.at<k||d.at>a||(i===null||d.value>i)&&(i=d.value);const r=u[u.length-1],h=r&&a-r.at<=se?r.value:null,x=m.tone==="needs-you"&&ne(n.snapshot?.sessions)===0?"idle":m.tone;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-5 flex flex-wrap items-end justify-between gap-x-6 gap-y-4",children:[t.jsxs("div",{className:"flex gap-6",children:[t.jsx(F,{label:"Now",value:h===null?D:String(h),caption:h===null?"Not being measured":"At the last check"}),t.jsx("div",{className:"border-l border-rule pl-6",children:t.jsx(F,{label:"Highest",value:i===null?D:String(i),caption:i===null?"Nothing measured":`In ${l.words}`})})]}),t.jsx(oe,{label:"Time window",value:g,onValueChange:w,options:M.map(({id:d,label:N})=>({value:d,label:N}))})]}),t.jsx("div",{className:"mt-5 h-55",children:c==="ready"?t.jsx(ue,{samples:u,start:k,end:a,tone:x,label:`${m.chart} over ${l.words}`,describe:m.describe}):c==="loading"?t.jsx(ae,{label:`Reading ${l.words}`,className:"h-full"}):t.jsx(re,{tone:"error",title:`${ie(l.words)} could not be read`,children:t.jsx("p",{children:"Agent Lookout did not answer when asked for it. The page asks again every minute. The 15 minute window is still there."})})}),t.jsxs("div",{"data-slot":"explainer",className:"mt-5 rounded-inner bg-fill-quiet px-4 py-3 inset-ring inset-ring-hairline",children:[t.jsx("p",{className:"text-row font-semibold text-ink",children:"What this counts"}),t.jsx("p",{className:"mt-0.5 text-body text-ink-secondary",children:m.explainer}),t.jsxs("p",{className:"mt-1.5 text-body text-ink-secondary",children:["Hatched time was not measured: Agent Lookout was not running, or could not read its source, or the history was cleared then. It is never drawn as zero."," ",n.history?.kept?.where==="memory"?"History covers the last six hours and starts again when Agent Lookout restarts.":"History covers the last six hours, and is kept when Agent Lookout restarts."]})]})]})}function we({metric:s,open:n,onOpenChange:a,state:g,now:w}){const l=P[s];return t.jsx(ee,{open:n,onOpenChange:a,title:l.title,description:l.about,size:"wide",children:t.jsx(xe,{metric:s,state:g,now:w})})}export{we as HistoryPanel};
1
+ import{r as y,j as t}from"./react-C2DiJaR6.js";import{b as G,t as K,r as q,f as U,a as _,c as X,d as V,h as $,m as J,H as Q,e as Z,D as ee,g as M,s as te,i as se,j as ne,S as oe,L as ae,C as re,k as ie}from"./index-B-myfVQS.js";import"./motion-BAhdRuCw.js";import"./radix-BH0JH8UU.js";const le={"needs-you":"text-status-needs-you-edge",working:"text-status-working",idle:"text-status-idle"},L={top:12,right:12,bottom:24,left:30},T=220,de=76,ce=104,I=1/60;function ue({samples:s,start:n,end:a,tone:g,label:w,describe:l,className:m}){const p=y.useRef(null),[c,k]=y.useState(0),[u,i]=y.useState(null);y.useEffect(()=>{const e=p.current;if(!e)return;const o=new ResizeObserver(([j])=>{j&&k(Math.floor(j.contentRect.width))});return o.observe(e),()=>o.disconnect()},[]);const r=L.left,h=Math.max(r+1,c-L.right),x=L.top,d=T-L.bottom,N=a-n;let O=0;for(const e of s)e.at>=n&&e.at<=a&&e.value>O&&(O=e.value);const A=V(O),b=G(s,{start:n,end:a},{left:r,right:h,top:x,bottom:d,ceiling:A.ceiling}),W=e=>r+(e-n)/N*(h-r),S=e=>d-e/A.ceiling*(d-x),B=K(n,a,Math.max(1,Math.floor((h-r)/de))),R=u??1,H=n+R*N,E=q(b.runs,H),C=E?l(E.value):"Not measured",v=W(H),z=(e,o)=>{const j=o.left+r,f=h-r;i(Math.min(1,Math.max(0,(e-j)/f)))},Y=e=>{const j={ArrowLeft:f=>f-I,ArrowRight:f=>f+I,PageDown:f=>f-I*10,PageUp:f=>f+I*10,Home:()=>0,End:()=>1}[e.key];j&&(e.preventDefault(),i(Math.min(1,Math.max(0,j(u??1)))))};return t.jsxs("div",{ref:p,"data-slot":"history-chart",role:"slider",tabIndex:0,"aria-label":`${w}. Arrow keys read the count at each moment.`,"aria-orientation":"horizontal","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(R*100),"aria-valuetext":`${_(H)}: ${C}`,onPointerMove:e=>z(e.clientX,e.currentTarget.getBoundingClientRect()),onPointerLeave:()=>i(null),onFocus:e=>{e.currentTarget.matches(":focus-visible")&&i(o=>o??1)},onBlur:()=>i(null),onKeyDown:Y,className:X("relative w-full cursor-crosshair rounded-row",le[g],m),style:{height:T},children:[c>0&&b.unmeasured.map((e,o)=>t.jsx("div",{"aria-hidden":!0,"data-part":"unmeasured",className:"unmeasured-hatch absolute",style:{left:e.x,top:x,width:e.width,height:d-x}},o)),c>0&&t.jsxs("svg",{"aria-hidden":!0,width:c,height:T,className:"relative block",children:[A.ticks.map(e=>t.jsxs("g",{children:[t.jsx("line",{"data-part":"grid",x1:r,x2:h,y1:S(e),y2:S(e),stroke:e===0?"var(--rule-strong)":"var(--hairline)",strokeWidth:1,shapeRendering:"crispEdges"}),t.jsx("text",{x:r-8,y:S(e),dy:"0.32em",textAnchor:"end",className:"fill-ink-muted font-mono text-micro",children:e})]},e)),b.unmeasured.map((e,o)=>e.width>=ce&&t.jsx("text",{"data-part":"unmeasured-label",x:e.x+8,y:x+14,className:"fill-ink-muted font-mono text-micro",stroke:"var(--glass-float)",strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke",children:"Not measured"},o)),b.areas.map((e,o)=>t.jsx("path",{d:e,fill:"currentColor",stroke:"none",opacity:.1},o)),b.lines.map((e,o)=>t.jsx("path",{"data-part":"line",d:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},o)),B.map(e=>{const o=W(e);return o<r+16||o>h-16?null:t.jsx("text",{"data-part":"time-tick",x:o,y:T-6,textAnchor:"middle",className:"fill-ink-muted font-mono text-micro",children:U(e)},e)}),u!==null&&t.jsxs("g",{"data-part":"crosshair",children:[t.jsx("line",{x1:v,x2:v,y1:x,y2:d,stroke:"var(--ink-muted)",strokeWidth:1,shapeRendering:"crispEdges"}),E&&t.jsx("circle",{cx:v,cy:S(Math.min(E.value,A.ceiling)),r:4.5,fill:"currentColor",stroke:"var(--glass-float)",strokeWidth:2})]})]}),u!==null&&c>0&&t.jsxs("div",{"aria-hidden":!0,"data-part":"reading",className:"pointer-events-none absolute z-10 rounded-row bg-glass-float px-2.5 py-1.5 font-mono text-fact whitespace-nowrap inset-ring inset-ring-rule",style:R>.62?{top:x,right:c-v+10}:{top:x,left:v+10},children:[t.jsx("span",{className:"block text-ink-muted",children:_(H)}),t.jsx("span",{className:"block text-ink",children:C})]})]})}const he=6e4;function me(s,n){const[a,g]=y.useState(null),[w,l]=y.useState(null),m=s>Q,p=n?.startedAt??null,c=n?$(n).at:null;if(y.useEffect(()=>{if(!m)return;let u=!0;const i=()=>{Z(s).then(h=>{u&&(g({windowMs:s,history:h}),l(null))},()=>{u&&l(s)})};i();const r=setInterval(i,he);return()=>{u=!1,clearInterval(r)}},[m,s,p,c]),!m)return{history:n,status:n?"ready":"loading"};const k=a?.windowMs===s&&(p===null||a.history.startedAt===p)&&(c===null||$(a.history).at===c)?a.history:null;return k?{history:J(k,n),status:"ready"}:{history:null,status:w===s?"failed":"loading"}}const P={needsYou:{title:"Needs you",about:"How many sessions were waiting on you, over time.",tone:"needs-you",chart:"Sessions that need you",describe:s=>`${s} ${s===1?"needs":"need"} you`,explainer:"A session needs you when it has stopped and cannot go on without an answer: a permission to grant, a question, or a plan to approve. The line is how many were waiting at each moment."},working:{title:"Working",about:"How many sessions were in the middle of a task, over time.",tone:"working",chart:"Sessions working",describe:s=>`${s} working`,explainer:"A session is working while it is in the middle of a task. The line is how many were busy at each moment."},idle:{title:"Idle",about:"How many sessions were ready for a new prompt, over time.",tone:"idle",chart:"Idle sessions",describe:s=>`${s} idle`,explainer:"A session is idle when it has finished what it was asked and is ready for a new prompt. One left idle a day or more is stale, and is counted under Stale instead. The line is how many were idle at each moment."}},D="–";function F({label:s,value:n,caption:a}){return t.jsxs("div",{"data-slot":"figure",className:"min-w-0",children:[t.jsx("p",{className:"text-body font-medium text-ink-secondary",children:s}),t.jsx("p",{className:"mt-2 text-stat font-medium tabular-nums",children:n}),t.jsx("p",{className:"mt-2 text-caption text-ink-muted",children:a})]})}function xe({metric:s,state:n,now:a}){const[g,w]=y.useState("15m"),l=M.find(d=>d.id===g)??M[0],m=P[s],{history:p,status:c}=me(l.ms,n.history),k=a-l.ms,u=p?te(p.points,s):[];let i=null;for(const d of u)d.at<k||d.at>a||(i===null||d.value>i)&&(i=d.value);const r=u[u.length-1],h=r&&a-r.at<=se?r.value:null,x=m.tone==="needs-you"&&ne(n.snapshot?.sessions)===0?"idle":m.tone;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-5 flex flex-wrap items-end justify-between gap-x-6 gap-y-4",children:[t.jsxs("div",{className:"flex gap-6",children:[t.jsx(F,{label:"Now",value:h===null?D:String(h),caption:h===null?"Not being measured":"At the last check"}),t.jsx("div",{className:"border-l border-rule pl-6",children:t.jsx(F,{label:"Highest",value:i===null?D:String(i),caption:i===null?"Nothing measured":`In ${l.words}`})})]}),t.jsx(oe,{label:"Time window",value:g,onValueChange:w,options:M.map(({id:d,label:N})=>({value:d,label:N}))})]}),t.jsx("div",{className:"mt-5 h-55",children:c==="ready"?t.jsx(ue,{samples:u,start:k,end:a,tone:x,label:`${m.chart} over ${l.words}`,describe:m.describe}):c==="loading"?t.jsx(ae,{label:`Reading ${l.words}`,className:"h-full"}):t.jsx(re,{tone:"error",title:`${ie(l.words)} could not be read`,children:t.jsx("p",{children:"Agent Lookout did not answer when asked for it. The page asks again every minute. The 15 minute window is still there."})})}),t.jsxs("div",{"data-slot":"explainer",className:"mt-5 rounded-inner bg-fill-quiet px-4 py-3 inset-ring inset-ring-hairline",children:[t.jsx("p",{className:"text-row font-semibold text-ink",children:"What this counts"}),t.jsx("p",{className:"mt-0.5 text-body text-ink-secondary",children:m.explainer}),t.jsxs("p",{className:"mt-1.5 text-body text-ink-secondary",children:["Hatched time was not measured: Agent Lookout was not running, or could not read its source, or the history was cleared then. It is never drawn as zero."," ",n.history?.kept?.where==="memory"?"History covers the last six hours and starts again when Agent Lookout restarts.":"History covers the last six hours, and is kept when Agent Lookout restarts."]})]})]})}function we({metric:s,open:n,onOpenChange:a,state:g,now:w}){const l=P[s];return t.jsx(ee,{open:n,onOpenChange:a,title:l.title,description:l.about,size:"wide",children:t.jsx(xe,{metric:s,state:g,now:w})})}export{we as HistoryPanel};
@@ -0,0 +1 @@
1
+ import{j as e,r as c}from"./react-C2DiJaR6.js";import{F as j,T,p as O,l as q,w as L,u as M,J as P,c as R,n as C,D as W,o as D,q as B,v as _,M as $,x as I,y as J,z as K,A as z,B as G,E as F,G as U,O as V,f as N,I as X,K as Y,N as H,P as Q,Q as Z,R as ee,U as te,V as se,W as v,X as E,Y as ne,L as ae,Z as le}from"./index-B-myfVQS.js";import"./motion-BAhdRuCw.js";import"./radix-BH0JH8UU.js";function re({pullRequest:t}){return e.jsxs(j,{label:"Pull request",children:[e.jsxs(T,{"data-part":"pull-request",href:t.url,target:"_blank",rel:"noreferrer noopener",lines:2,tooltip:`#${t.number} ${t.title}`,className:"wrap-anywhere underline decoration-rule-strong underline-offset-2 transition-colors duration-120 hover:decoration-ink",children:[e.jsxs("span",{className:"tabular-nums",children:["#",t.number]})," ",t.title]}),e.jsx("span",{"data-part":"pull-request-state",className:"block text-caption font-normal text-ink-secondary tabular-nums",children:O(t)})]})}function ie(t,a={}){const{open:s=!0,onStopped:n,request:l=q}=a,[i,r]=c.useState({kind:"idle"}),[o,d]=c.useState(s);s!==o&&(d(s),!s&&!(i.kind==="confirming"&&i.busy)&&r({kind:"idle"}));const u=c.useRef(s);c.useEffect(()=>{u.current=s},[s]);const p=c.useId(),[m]=c.useState(()=>({stop:`${p}-stop`,cancel:`${p}-cancel`,outcome:`${p}-outcome`})),f=c.useRef(null),h=c.useRef(!1),x=c.useRef(!0);c.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]),c.useEffect(()=>{const b=f.current;f.current=null,b!==null&&document.getElementById(m[b])?.focus()},[i,m]);const g=c.useCallback(()=>{h.current||(f.current="cancel",r({kind:"confirming",busy:!1}))},[]),y=c.useCallback(()=>{h.current||(f.current="stop",r({kind:"idle"}))},[]),k=c.useCallback(()=>{h.current||(h.current=!0,r({kind:"confirming",busy:!0}),l(t).then(b=>{if(h.current=!1,!!x.current){if(b==="stopped"&&n?.(),!u.current){r({kind:"idle"});return}f.current="outcome",r({kind:"answered",outcome:b})}}))},[t,l,n]);return{step:i,ask:g,cancel:y,confirm:k,ids:m}}const A=[];function oe(t,a){const s=CSS.escape(t),n=[...document.querySelectorAll(`:is([data-slot="session-row"], [data-slot="board-card"], [data-slot="hero-session"])[data-session="${s}"] a[data-part="name"]`)];return a!==null&&n.includes(a)?a:n.find(l=>!l.closest('[data-slot="hero-session"]'))??n[0]??null}function ce({session:t,gone:a,asOf:s,now:n}){const l=t.status==="finished"||t.status==="failed",i=Y(t),r=i?"stale":a&&t.status==="needs-you"?"answered":t.status,o=t.statusSince,d=o!==null?Math.max(0,s-o):null,u=H(t,s),p=t.status==="needs-you",m=p?Q(t):null,f=p&&!a&&t.waitingText?.trim()||null,h=o!==null?`${l?"at":i?"idle since":"since"} ${F(o,n)}`:"time not reported",x=[p?Z(t):null,h,u&&ee(u)].filter(g=>typeof g=="string");return e.jsxs(j,{label:"Status",note:f?e.jsxs(e.Fragment,{children:[e.jsx(T,{"data-part":"asking",lines:2,className:"wrap-anywhere",children:f}),m&&e.jsx("span",{className:"block",children:m})]}):m??void 0,children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(te,{kind:r}),e.jsx("span",{"data-part":"status",children:i?"Stale":se[t.status]}),d!==null&&e.jsxs("span",{"data-part":"duration",className:"tabular-nums",children:[e.jsx("span",{className:"sr-only",children:l?` ${v(d)} ago`:` for ${v(d)}`}),e.jsxs("span",{"aria-hidden":!0,children:[E(d),l&&" ago"]})]})]}),e.jsx("span",{"data-part":"since",className:"block text-caption font-normal text-ink-secondary tabular-nums",children:x.join(", ")})]})}function ue({session:t,state:a,now:s,asOf:n}){const l=c.useMemo(()=>ne({sessions:a.snapshot?.sessions??A,events:a.events,history:a.history,now:s,asOf:n,eventsFull:a.events.length>=$}),[a.snapshot,a.events,a.history,s,n]);if(!l)return e.jsxs(j,{label:"Waits",children:["Not known",e.jsx("span",{className:"block text-caption font-normal text-ink-secondary",children:"The history could not be read"})]});const i=l.sessions.find(d=>d.id===t.id),r=l.period.today?"today":`since ${N(l.period.from)}`;let o="None";if(i){const d=`${i.startKnown?"":"at least "}${E(i.ms)}`;o=i.times===1?`Once, ${d}`:`${i.times} times, ${d} in all`}return e.jsxs(j,{label:"Waits",children:[e.jsx("span",{"data-part":"waits",className:"tabular-nums",children:o}),e.jsx("span",{className:"block text-caption font-normal text-ink-secondary",children:r})]})}function S({title:t,aside:a,children:s,...n}){return e.jsxs("section",{...n,"aria-label":t,className:"mt-6",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4 border-b border-hairline pb-2",children:[e.jsx("h3",{className:"text-body font-semibold text-ink",children:t}),a&&e.jsx("p",{className:"text-caption text-ink-muted",children:a})]}),s]})}function de({session:t,gone:a,state:s,now:n,asOf:l}){const i=s.snapshot?.sources??[],r=s.snapshot?.sessions??A,o=_(t.surface),d=s.events.length>=$,u=c.useMemo(()=>I(s.events.filter(h=>h.sessionId===t.id),r),[s.events,r,t.id]),p=J(s.events,s.history,d),m=c.useMemo(()=>s.history?K({sessions:r,events:s.events,history:s.history,now:n,asOf:l,eventsFull:d}):null,[r,s.events,s.history,n,l,d]),f=m?.rows.find(h=>h.id===t.id);return e.jsxs(e.Fragment,{children:[a&&e.jsx("p",{"data-part":"gone",className:"mt-4 text-body text-ink-secondary",children:"This session has left the list. Here is what was last known of it."}),e.jsxs(z,{className:"mt-3",children:[e.jsx(ce,{session:t,gone:a,asOf:l,now:n}),e.jsx(j,{label:"Agent",children:G(t,i)}),o!==null&&e.jsx(j,{label:"App",children:o}),e.jsx(j,{label:"Folder",mono:t.cwd!==null,children:t.cwd!==null?e.jsx("span",{"data-part":"folder",className:"wrap-anywhere select-text",children:t.cwd.split("/").map((h,x,g)=>e.jsxs(c.Fragment,{children:[h,x<g.length-1&&e.jsxs(e.Fragment,{children:["/",e.jsx("wbr",{})]})]},x))}):"Not known"}),t.git?.repository!==void 0&&e.jsx(j,{label:"Repository",children:e.jsx("span",{"data-part":"repository",className:"wrap-anywhere",children:t.git.repository.name})}),t.git?.branch!==void 0?e.jsx(j,{label:"Branch",children:e.jsx("span",{"data-part":"branch",className:"wrap-anywhere",children:t.git.branch})}):t.git?.commit!==void 0&&e.jsx(j,{label:"Commit",mono:!0,children:t.git.commit}),t.git?.pullRequest!==void 0&&e.jsx(re,{pullRequest:t.git.pullRequest}),e.jsx(j,{label:"Started",children:e.jsx("span",{className:"tabular-nums",children:t.startedAt!==null?F(t.startedAt,n):"Not reported"})}),t.pid!==void 0&&e.jsx(j,{label:"Process",mono:!0,note:t.alive===!1?"The process has ended.":!a&&t.source==="claude-code"&&t.surface==="desktop"?U:void 0,children:t.pid}),e.jsx(ue,{session:t,state:s,now:n,asOf:l})]}),e.jsx(S,{"data-part":"events",title:"Events",aside:p?`since ${N(p.at)}`:void 0,children:u.length>0?e.jsx(V,{entries:u,now:n,className:"pt-0.5"}):e.jsxs("p",{className:"py-2.5 text-body text-ink-secondary",children:["Nothing has happened to this session"," ",p?`since ${N(p.at)}`:"yet","."]})}),e.jsx(S,{"data-part":"timeline",title:"Timeline",aside:"last hour",children:m&&f?e.jsx(X,{timeline:m,rows:[f],named:!1,label:"Its last hour",className:"pt-3"}):e.jsx("p",{className:"py-2.5 text-body text-ink-secondary",children:m?"It did not run in the last hour.":"The last hour could not be read. The page asks again every two seconds."})})]})}function pe({sessionId:t,open:a,onClose:s,state:n,now:l,onStopped:i}){const r=n.snapshot?.sessions.find(w=>w.id===t)??null,[o,d]=c.useState(null);r!==null&&r!==o?.session?d({session:r,at:n.lastOkAt??l}):r===null&&o?.session.waitingText!==void 0&&d({...o,session:L(o.session)});const u=r??o?.session??null,p=r===null&&o!==null,m=M(u??{id:t,source:"status-files",surface:"unknown",links:{}}),f=p&&o?o.at:n.phase==="stalled"&&n.lastOkAt!==null?n.lastOkAt:l,h=m.outcome!==null||m.asking!==null,x=ie(t,{open:a,onStopped:i}),g=x.step.kind==="answered"||x.step.kind==="confirming"&&(x.step.busy||!p);let y,k,b="wide";return u?(y=u.name,k=e.jsxs(e.Fragment,{children:[!p&&e.jsx("div",{className:R("flex flex-wrap items-center gap-x-2 gap-y-1",h&&"mt-3"),children:e.jsx(P,{session:u,jump:m})}),g&&e.jsx(C,{session:u,stop:x,className:"mt-3"}),e.jsx(de,{session:u,gone:p,state:n,now:l,asOf:f})]})):n.snapshot===null?(y="Session",k=e.jsx(ae,{label:"Reading sessions",className:"justify-start px-0 pt-5 pb-1"})):(y="No such session",b="sm",k=e.jsxs("div",{"data-part":"missing",children:[e.jsx("p",{className:"mt-2 text-body text-ink-secondary",children:"Agent Lookout is not watching a session at this address. It may have ended before this page was opened."}),e.jsx(le,{className:"mt-4",onClick:s,children:"Go to the Overview"})]})),e.jsx(W,{open:a,onOpenChange:w=>{w||s()},title:y,size:b,focusTitle:!0,returnFocus:w=>oe(t,w)??document.querySelector("main"),actions:u&&!p&&e.jsxs(e.Fragment,{children:[e.jsx(D,{session:u,jump:m,variant:u.status==="needs-you"?"needs-you":"quiet"}),e.jsx(B,{session:u,stop:x})]}),children:k})}function je({sessionId:t,onClose:a,state:s,now:n,onStopped:l}){const[i,r]=c.useState(t);return t!==null&&t!==i&&r(t),i===null?null:e.jsx(pe,{sessionId:i,open:t!==null,onClose:a,state:s,now:n,onStopped:l},i)}export{je as SessionPanel};