ccdeck 3.39.1 → 3.39.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.
- package/README.md +42 -14
- package/dist/web/assets/{BrowserWatchModal-ByzpjRVo.js → BrowserWatchModal-DvLtvWy6.js} +1 -1
- package/dist/web/assets/TrafficRadar-MfnZJeq1.js +1 -0
- package/dist/web/assets/{UsageHistoryModal-C5K8FVaU.js → UsageHistoryModal-X4UF2sFE.js} +1 -1
- package/dist/web/assets/index-CxIdVCPz.js +305 -0
- package/dist/web/assets/index-TDFtmv7q.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/release-notes.json +13 -2
- package/src/server/desktop-update-routes.mjs +14 -1
- package/src/server/index.mjs +5 -1
- package/src/server/lan-beacon.mjs +5 -1
- package/src/server/lan-engine.mjs +6 -1
- package/src/server/traffic-radar-capture.mjs +67 -35
- package/src/server/traffic-radar-config.mjs +9 -6
- package/src/server/traffic-radar-helper.mjs +31 -7
- package/src/server/traffic-radar-monitor.mjs +77 -0
- package/src/server/traffic-radar-platform.mjs +80 -0
- package/src/server/traffic-radar-routes.mjs +3 -2
- package/src/server/traffic-radar.mjs +12 -18
- package/dist/web/assets/TrafficRadar-CyYzkKvE.js +0 -1
- package/dist/web/assets/index-DGMP4S3t.js +0 -305
- package/dist/web/assets/index-WHHCRAB3.css +0 -1
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import {
|
|
3
|
+
import { systemCommand, powershell, WINDOWS_PROCESSES, windowsSockets, linuxSockets } from './traffic-radar-platform.mjs';
|
|
4
4
|
import { readRadarConfig } from "./traffic-radar-config.mjs";
|
|
5
5
|
|
|
6
|
-
function systemCommand(file, args) {
|
|
7
|
-
return new Promise(resolve => {
|
|
8
|
-
execFile(file, args, { timeout: 2_000, maxBuffer: 262_144, encoding: "utf8", windowsHide: true }, (error, stdout, stderr) => {
|
|
9
|
-
if (!error) return resolve(stdout);
|
|
10
|
-
if (file === "/usr/sbin/lsof" && error.code === 1 && !stdout && !stderr) return resolve("");
|
|
11
|
-
resolve(null);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
6
|
export function claudePids(text) {
|
|
17
7
|
const pids = [];
|
|
18
8
|
for (const line of String(text ?? "").split("\n")) {
|
|
19
9
|
const match = /^\s*(\d+)\s+(.+?)\s*$/.exec(line);
|
|
20
|
-
if (match && ["claude", "claude-native"].includes(
|
|
10
|
+
if (match && ["claude", "claude-native"].includes(match[2].split(/[\\/]/).at(-1)?.replace(/\.exe$/i, "").toLowerCase())) {
|
|
21
11
|
const pid = Number(match[1]);
|
|
22
12
|
if (Number.isSafeInteger(pid) && pid > 0) pids.push(pid);
|
|
23
13
|
}
|
|
@@ -29,7 +19,8 @@ export function parseRadarSockets(text, pids) {
|
|
|
29
19
|
const allowed = new Set(pids);
|
|
30
20
|
const sockets = new Map();
|
|
31
21
|
let pid = null;
|
|
32
|
-
for (const
|
|
22
|
+
for (const rawLine of String(text ?? "").split("\n")) {
|
|
23
|
+
const line = rawLine.trimEnd();
|
|
33
24
|
if (/^p\d+$/.test(line)) pid = Number(line.slice(1));
|
|
34
25
|
if (!allowed.has(pid) || !line.startsWith("n")) continue;
|
|
35
26
|
const peer = line.slice(1).split("->")[1];
|
|
@@ -48,7 +39,8 @@ export function parseRadarWorkspaces(text, pids, home = homedir()) {
|
|
|
48
39
|
const allowed = new Set(pids);
|
|
49
40
|
const workspaces = new Map();
|
|
50
41
|
let pid = null;
|
|
51
|
-
for (const
|
|
42
|
+
for (const rawLine of String(text ?? "").split("\n")) {
|
|
43
|
+
const line = rawLine.trimEnd();
|
|
52
44
|
if (/^p\d+$/.test(line)) pid = Number(line.slice(1));
|
|
53
45
|
if (allowed.has(pid) && line.startsWith("n/")) {
|
|
54
46
|
const path = line.slice(1);
|
|
@@ -58,7 +50,7 @@ export function parseRadarWorkspaces(text, pids, home = homedir()) {
|
|
|
58
50
|
return workspaces;
|
|
59
51
|
}
|
|
60
52
|
|
|
61
|
-
export function createTrafficRadar({ platform = process.platform, now = Date.now, run = systemCommand, config = readRadarConfig } = {}) {
|
|
53
|
+
export function createTrafficRadar({ platform = process.platform, now = Date.now, run = systemCommand, config = readRadarConfig, readLinuxSockets = linuxSockets } = {}) {
|
|
62
54
|
let pending = null;
|
|
63
55
|
let cached = null;
|
|
64
56
|
let previousAt = null;
|
|
@@ -79,8 +71,8 @@ export function createTrafficRadar({ platform = process.platform, now = Date.now
|
|
|
79
71
|
previousConfig = null;
|
|
80
72
|
}
|
|
81
73
|
const base = { ok: true, sampledAt, platform, pollMs: 5_000, processCount: 0, connections: [], alerts: [] };
|
|
82
|
-
if (
|
|
83
|
-
const [configuration, processes] = await Promise.all([config(), run("/bin/ps", ["-axo", "pid=,comm="])]);
|
|
74
|
+
if (!["darwin", "linux", "win32"].includes(platform)) return { ...base, status: "unsupported", config: null };
|
|
75
|
+
const [configuration, processes] = await Promise.all([config({ platform }), platform === "win32" ? run("powershell.exe", powershell(WINDOWS_PROCESSES)) : run("/bin/ps", ["-axo", "pid=,comm="])]);
|
|
84
76
|
const nextConfig = new Map(configuration.variables.filter(v => !v.key.endsWith("HEADERS")).map(v => [`${v.source}:${v.key}`, v.value]));
|
|
85
77
|
if (previousConfig) {
|
|
86
78
|
for (const [key, value] of nextConfig) {
|
|
@@ -94,7 +86,9 @@ export function createTrafficRadar({ platform = process.platform, now = Date.now
|
|
|
94
86
|
const selected = pids.slice(0, 64);
|
|
95
87
|
let sockets = "";
|
|
96
88
|
let cwd = "";
|
|
97
|
-
if (selected.length)
|
|
89
|
+
if (selected.length && platform === "linux") ({ sockets, cwd } = await readLinuxSockets(selected));
|
|
90
|
+
else if (selected.length && platform === "win32") sockets = await run("powershell.exe", powershell(windowsSockets(selected)));
|
|
91
|
+
else if (selected.length) [sockets, cwd] = await Promise.all([
|
|
98
92
|
run("/usr/sbin/lsof", ["-nP", "-a", "-p", selected.join(","), "-iTCP", "-sTCP:ESTABLISHED", "-Fpn"]),
|
|
99
93
|
run("/usr/sbin/lsof", ["-nP", "-a", "-p", selected.join(","), "-d", "cwd", "-Fpn"]),
|
|
100
94
|
]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,z as Oe,j as e,A as Ae,u as Le,d as _e,B as Ie}from"./index-DGMP4S3t.js";function ye(s){return[...new Set(s.filter(t=>t.key.endsWith("ENDPOINT")).map(t=>t.value).filter(t=>/^https?:\/\//.test(t)))]}function Ne(s){return(s==null?void 0:s.status)!=="observing"?[]:[...new Set(s.connections.filter(t=>t.active===!0).map(t=>t.destination))]}function ve(s){try{const t=new URL(s);return/^\d+\.\d+\.\d+\.\d+$/.test(t.hostname)?`${t.hostname}:${t.port||(t.protocol==="https:"?"443":"80")}`:null}catch{return null}}function Re(s){const t=s.filter(r=>r.key==="CLAUDE_CODE_ENABLE_TELEMETRY").map(r=>r.value);return t.length?new Set(t).size>1?"Conflicting settings":t[0]==="Enabled"?"Enabled in settings":t[0]==="Disabled"?"Disabled in settings":"Unknown":"Unknown"}function Me(s){const t=s.replace(/^\uFEFF/,"").trim();if(!t)return[];let r;try{JSON.parse(t),r=[t]}catch{r=s.replace(/^\uFEFF/,"").split(/\r?\n/)}if(r.length>1e4)throw new Error("This file has more than 10,000 lines. Choose a smaller export.");return r.flatMap((m,c)=>{var g;if(!m.trim())return[];try{const h=JSON.parse(m),u=h&&typeof h=="object"?h:{},f=new Set,i=[h];for(;i.length;){const v=i.pop();if(!v||typeof v!="object")continue;if(Array.isArray(v)){for(const o of v)i.push(o);continue}const x=v;for(const o of["session.id","session_id","sessionId"])typeof x[o]=="string"&&f.add(x[o]);if(["session.id","session_id"].includes(String(x.key))){const o=x.value;typeof(o==null?void 0:o.stringValue)=="string"&&f.add(o.stringValue)}for(const o of Object.values(x))i.push(o)}return[{line:c+1,raw:m,sessionIds:[...f],label:String(u.eventName??((g=u.event)==null?void 0:g.name)??u.type??u.model??"JSON record").slice(0,160),sessionId:typeof(u.session_id??u.sessionId??u["session.id"])=="string"?u.session_id??u.sessionId??u["session.id"]:null,timestamp:typeof u.timestamp=="string"?u.timestamp:null,valid:!0}]}catch{return[{line:c+1,raw:m,label:"Invalid JSON",sessionId:null,timestamp:null,sessionIds:[],valid:!1}]}})}function De(){const[s,t]=d.useState(null),[r,m]=d.useState(!1);return d.useEffect(()=>{let c=!0,g,h=null;const u=()=>document.visibilityState!=="hidden",f=()=>{clearTimeout(g),h==null||h.abort(),h=null},i=async()=>{if(!c||!u()||h)return;const x=new AbortController;h=x;try{const o=await fetch("/api/system/traffic-radar",{signal:x.signal});if(!o.ok)throw new Error("radar_unavailable");const w=await o.json();if(!w.ok)throw new Error("radar_unavailable");c&&!x.signal.aborted&&(t(w),m(!1))}catch{c&&!x.signal.aborted&&m(!0)}finally{h===x&&(h=null),c&&!x.signal.aborted&&u()&&(g=setTimeout(i,5e3))}},v=()=>{f(),document.visibilityState!=="hidden"&&i()};return i(),document.addEventListener("visibilitychange",v),()=>{c=!1,f(),document.removeEventListener("visibilitychange",v)}},[]),{snapshot:s,failed:r}}function Pe(){const[s,t]=d.useState(null),[r,m]=d.useState(!1),[c,g]=d.useState(!1),[h,u]=d.useState(""),[f,i]=d.useState(""),[v,x]=d.useState([]),[o,w]=d.useState(null),[C,_]=d.useState(null),N=d.useRef(null),I=d.useRef(null);d.useEffect(()=>{let a=!0,p,l=null;const b=()=>document.visibilityState!=="hidden",T=()=>{clearTimeout(p),l==null||l.abort(),l=null},S=async()=>{if(!a||!b()||l)return;const L=new AbortController;l=L;try{const F=await fetch("/api/system/traffic-radar/capture",{signal:L.signal});if(!F.ok)throw new Error;const P=await F.json();a&&!L.signal.aborted&&(t(P),m(!1))}catch{a&&!L.signal.aborted&&m(!0)}finally{l===L&&(l=null),a&&!L.signal.aborted&&b()&&(p=setTimeout(S,1e3))}},M=()=>{T(),document.visibilityState!=="hidden"&&S()};return S(),document.addEventListener("visibilitychange",M),()=>{var L;a=!1,T(),(L=I.current)==null||L.abort(),document.removeEventListener("visibilitychange",M)}},[]);const k=async(a,p)=>{if(!Oe(N.current))return;N.current=a,_(a),g(!0),u("");const l=new AbortController;I.current=l;const b=setTimeout(()=>l.abort(),5e3);try{const T=await fetch(`/api/system/traffic-radar/capture/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({destination:p}),signal:l.signal}),S=await T.json();if(!T.ok)throw new Error(S.error||"Capture action failed. Please retry.");a==="prepare"&&(i(S.command),x(S.commands??[{destination:String(p),command:S.command}]),w(S.sessionId)),a==="stop"&&(i(""),x([]));const M=await fetch("/api/system/traffic-radar/capture",{signal:l.signal});M.ok&&(t(await M.json()),m(!1))}catch(T){u(T instanceof Error?T.message:"Capture action failed. Please retry.")}finally{clearTimeout(b),I.current=null,N.current=null,_(null),g(!1)}};return{capture:s,failed:r,busy:c,pendingAction:C,error:h,commands:(s==null?void 0:s.sessionId)===o?v:[],command:(s==null?void 0:s.sessionId)===o?f:"",action:k}}const A=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},J=s=>Array.isArray(s)?s:[],ae=s=>new Date(s).toLocaleTimeString(),$e=s=>({unconfirmed:"Transfer observed · receipt unconfirmed",accepted:"Collector accepted",partial:"Collector reported partial success",rejected:"Collector rejected",unknown:"Response incomplete",reset:"Stream reset"})[s.outcome],be={encrypted:"Encrypted traffic observed; contents cannot be read.",joined_midstream:"Capture joined an existing connection. Waiting for a new HTTP/2 connection to decode it reliably.",capture_gap:"Incomplete packets or a gap were observed. Affected contents are not shown as decoded.",decode_failed:"Some payloads could not be decoded. They are not shown as verified events.",payload_limit:"A payload exceeded the inspection limit and was omitted.",stream_limit:"A stream exceeded the inspection limit.",connection_limit:"The connection inspection limit was reached.",unsupported_compression:"A compression format other than gzip was observed.",unsupported_link:"This network capture format is not supported.",unsupported_network:"Some packets used a network protocol this decoder does not support.",fragmented:"Fragmented IP packets cannot be decoded in this version.",unknown_export:"A request could not be identified as an OTLP export.",connection_closed:"An HTTP/2 connection closed.",idle_connection:"An idle connection was removed from the decoder."};function K(s){const t=A(s);for(const r of["stringValue","intValue","doubleValue","boolValue","bytesValue"])if(t[r]!==void 0)return t[r];return t.arrayValue?J(A(t.arrayValue).values).map(K):t.kvlistValue?Object.fromEntries(J(A(t.kvlistValue).values).map(r=>{const m=A(r);return[String(m.key),K(m.value)]})):null}function Je(s){return/prompt/i.test(s)?"Prompt-related field included in this export.":/response|completion/i.test(s)?"Response-related field included in this export.":/tool/i.test(s)?"Tool-related field included in this export.":/session/i.test(s)?"Session identifier or session metadata.":/user|email|account/i.test(s)?"User or account metadata.":/token|cost|duration|latency/i.test(s)?"Usage or timing measurement.":"Attribute included in this export."}function U({value:s}){return e.jsx("pre",{className:"tr-value",children:typeof s=="string"?s:JSON.stringify(s,null,2)})}function le({value:s}){return e.jsx("dl",{className:"tr-attributes",children:J(s).map((t,r)=>{const m=A(t);return e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx("code",{children:String(m.key??"Unnamed attribute")}),e.jsx("span",{children:Je(String(m.key))})]}),e.jsx("dd",{children:e.jsx(U,{value:K(m.value)})})]},r)})})}function Ue({record:s}){const t=["gauge","sum","histogram","exponentialHistogram","summary"].find(r=>s[r]);return t?e.jsxs("div",{children:[s.description&&e.jsx("p",{className:"tr-note",children:String(s.description)}),J(A(s[t]).dataPoints).map((r,m)=>{const c=A(r);return e.jsxs("section",{children:[e.jsxs("dl",{className:"tr-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Measurement"}),e.jsx("dd",{children:t})]}),c.asInt!==void 0||c.asDouble!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Value"}),e.jsx("dd",{children:e.jsxs("code",{children:[String(c.asInt??c.asDouble)," ",String(s.unit??"")]})})]}):null,c.count!==void 0&&e.jsxs("div",{children:[e.jsx("dt",{children:"Count"}),e.jsx("dd",{children:e.jsx("code",{children:String(c.count)})})]}),c.sum!==void 0&&e.jsxs("div",{children:[e.jsx("dt",{children:"Sum"}),e.jsx("dd",{children:e.jsxs("code",{children:[String(c.sum)," ",String(s.unit??"")]})})]})]}),e.jsx(le,{value:c.attributes}),e.jsxs("details",{className:"tr-details",children:[e.jsx("summary",{children:"All measurement fields"}),e.jsx(U,{value:c})]})]},m)})]}):null}function Fe({record:s}){let t=null;try{t=`${Number(BigInt(String(s.endTimeUnixNano))-BigInt(String(s.startTimeUnixNano)))/1e6} ms`}catch{t=null}return e.jsxs("dl",{className:"tr-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Duration"}),e.jsx("dd",{children:t??"Not included"})]}),s.kind&&e.jsxs("div",{children:[e.jsx("dt",{children:"Span kind"}),e.jsx("dd",{children:String(s.kind)})]}),s.status&&e.jsxs("div",{children:[e.jsx("dt",{children:"Span status"}),e.jsx("dd",{children:e.jsx(U,{value:s.status})})]})]})}function Ve({payload:s,signal:t}){const r=t==="traces"?"Spans":t==="logs"?"Logs":"Metrics",m=t==="traces"?"spans":t==="logs"?"logRecords":"metrics";return e.jsx("div",{className:"tr-decoded",children:J(s["resource"+r]).map((c,g)=>{const h=A(c);return e.jsxs("section",{children:[e.jsxs("details",{className:"tr-details",children:[e.jsx("summary",{children:"Resource metadata"}),e.jsx(le,{value:A(h.resource).attributes})]}),J(h["scope"+r]).map((u,f)=>{const i=A(u);return e.jsxs("div",{children:[i.scope&&e.jsxs("p",{className:"tr-note",children:["Instrumentation: ",String(A(i.scope).name??"Unnamed")," ",String(A(i.scope).version??"")]}),J(i[m]).map((v,x)=>{const o=A(v);return e.jsxs("article",{className:"tr-record",children:[e.jsx("h4",{children:String(o.eventName??o.name??`${t==="logs"?"Log record":"Record"} ${x+1}`)}),o.body&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"tr-note",children:"Event body"}),e.jsx(U,{value:K(o.body)})]}),t==="metrics"&&e.jsx(Ue,{record:o}),t==="traces"&&e.jsx(Fe,{record:o}),o.attributes&&e.jsx(le,{value:o.attributes}),e.jsxs("details",{className:"tr-details",children:[e.jsx("summary",{children:"All record fields"}),e.jsx(U,{value:o})]})]},x)})]},f)})]},g)})})}function Be({capture:s,radar:t,failed:r,busy:m,pendingAction:c=null,error:g,command:h,commands:u=[],action:f,sessionFilter:i="all",sessions:v=[]}){var ue,he,pe,fe,xe,je,ge;const x=ye(((ue=t==null?void 0:t.config)==null?void 0:ue.variables)??[]),o=[...new Set(x.map(ve).filter(n=>!!n))],w=Ne(t).filter(n=>!o.includes(n)&&ve(`http://${n}`)),[C,_]=d.useState("all"),[N,I]=d.useState(""),[k,a]=d.useState(null),[p,l]=d.useState(null),[b,T]=d.useState("all"),[S,M]=d.useState("all"),[L,F]=d.useState(null),[P,Q]=d.useState(null),[X,H]=d.useState(null),[Z,re]=d.useState("summary"),[E,ee]=d.useState(null),[oe,Se]=d.useState(0),se=d.useRef(null),ne=(s==null?void 0:s.events)??[],B=P?P.map(n=>ne.find(j=>j.id===n.id)).filter(n=>!!n):ne,W=B.filter(n=>{var j,O;return(S==="all"||n.signal===S)&&(b==="all"||b===n.destination)&&(i==="all"||(i==="unidentified"?!((j=n.sessionIds)!=null&&j.length):(O=n.sessionIds)==null?void 0:O.includes(i)))}),$=((s==null?void 0:s.observations)??[]).filter(n=>(L===null||L.includes(n.id))&&S==="all"&&(i==="all"||i==="unidentified")&&(b==="all"||b===n.destination)),Y=$.find(n=>n.id===k),y=k!==null?void 0:p===null?W[0]:W.find(n=>n.id===p),G=y==null?void 0:y.id;d.useEffect(()=>{l(null),a(null)},[i,S,b]),d.useEffect(()=>{if(ee(null),H(null),G===void 0)return;const n=new AbortController;let j=!0;const O=setTimeout(()=>n.abort(),5e3);return fetch(`/api/system/traffic-radar/capture/event?id=${G}`,{signal:n.signal}).then(async R=>{if(!R.ok)throw new Error("This message has expired. Select a newer message.");const ke=await R.json();j&&!n.signal.aborted&&ee({id:G,payload:ke.payload})}).catch(R=>{j&&ee({id:G,error:n.signal.aborted?"Loading timed out. Try again.":R instanceof Error?R.message:"Could not read this message."})}).finally(()=>clearTimeout(O)),()=>{j=!1,clearTimeout(O),n.abort()}},[G,oe]);const D=!!s&&["awaiting","receiving","capturing"].includes(s.state),q=((he=s==null?void 0:s.sources)==null?void 0:he.filter(n=>n.active).length)??0,z=((pe=s==null?void 0:s.sources)==null?void 0:pe.length)??1,we=r?"Monitor connection lost":s?{idle:"Message capture stopped",awaiting:"Terminal activation needed",receiving:"Listening · waiting for traffic",capturing:"Monitoring traffic",stopped:"Message capture stopped",expired:"Monitoring expired",interrupted:"Capture disconnected",error:"Capture could not be read"}[s.state]:"Reading monitor…",V=n=>{const j=Ae(c??(m?"capture":null),n);return{disabled:j.disabled,"aria-busy":j.busy}},Ce=n=>{var j,O,R;a(null),l(n.id),typeof window<"u"&&((j=window.matchMedia)!=null&&j.call(window,"(max-width: 640px)").matches)&&((O=se.current)==null||O.focus({preventScroll:!0}),(R=se.current)==null||R.scrollIntoView({block:"start",behavior:"auto"}))},ce=()=>{var j;H(null),Q(null),F(null),l(null),a(null);const n=C==="custom"?[N.trim()]:C==="all"?o:[C];f("prepare",n.length?n:((j=s==null?void 0:s.sources)==null?void 0:j.map(O=>O.destination))??(s!=null&&s.destination?[s.destination]:[]))},te=u.length?u:h?[{destination:(s==null?void 0:s.destination)??"Collector",command:h}]:[],de=async(n,j)=>{try{await navigator.clipboard.writeText(n),H(j)}catch{H("failed")}},me=(n=[])=>n.length?n.map(j=>{var O;return`${((O=v.find(R=>R.id===j))==null?void 0:O.label)??"Session"} · ${j.slice(0,8)}`}).join(", "):"Unidentified session",Te=((s==null?void 0:s.issues.encrypted)??0)>0,Ee=new Set([...((fe=s==null?void 0:s.sources)==null?void 0:fe.map(n=>n.destination))??[],...o]),ie=(t==null?void 0:t.status)==="observing"?t.connections.filter(n=>n.active&&Ee.has(n.destination)):[];return e.jsxs("div",{className:"tr-telemetry",children:[e.jsxs("div",{className:"tr-capture-bar",children:[e.jsxs("div",{children:[e.jsxs("h3",{role:"status",children:[e.jsx("span",{className:`tr-live-dot${D&&q?" is-live":""}`}),we]}),e.jsxs("p",{className:"tr-note",children:[D?`${q} of ${z} destination${z===1?"":"s"} listening. `:"See messages sent to your configured collectors. ","Claude settings stay unchanged."]})]}),e.jsxs("div",{className:"tr-capture-actions",children:[D?e.jsx("button",{className:"btn",...V("stop"),onClick:()=>void f("stop"),children:"Stop monitoring"}):e.jsx("button",{className:"btn tr-start",...V("prepare"),disabled:V("prepare").disabled||!s||r||(t==null?void 0:t.status)==="unsupported"||C==="all"&&!o.length||C==="custom"&&!N.trim(),onClick:ce,children:c==="prepare"?"Starting…":"Start monitoring"}),e.jsx("button",{className:"btn",...V("clear"),disabled:V("clear").disabled||!(s!=null&&s.events.length)&&!((xe=s==null?void 0:s.observations)!=null&&xe.length),onClick:()=>{l(null),a(null),Q(null),F(null),f("clear")},children:"Clear messages"})]})]}),!D&&e.jsxs("div",{className:"tr-destination",children:[e.jsxs("label",{children:["Destination",e.jsxs("select",{className:"tr-select","aria-label":"Capture destination",value:C,onChange:n=>_(n.target.value),children:[e.jsxs("option",{value:"all",children:["All configured IPv4 destinations (",o.length,")"]}),o.map(n=>e.jsx("option",{value:n,children:n},n)),w.length>0&&e.jsx("optgroup",{label:"Observed Claude connections · telemetry unverified",children:w.map(n=>e.jsxs("option",{value:n,children:[n," · observed"]},n))}),e.jsx("option",{value:"custom",children:"Another IPv4 address…"})]})]}),C==="custom"&&e.jsx("input",{className:"tr-input","aria-label":"Collector IPv4 and port",value:N,onChange:n=>I(n.target.value),placeholder:"192.168.1.10:4317"}),!o.length&&C==="all"&&e.jsx("span",{className:"tr-note",children:w.length?"Choose an observed connection or enter your collector address.":"Enter your collector address to monitor traffic. Missing settings do not mean telemetry is off."})]}),(t==null?void 0:t.status)==="unsupported"&&e.jsx("p",{className:"tr-capture-error",role:"status",children:"Live capture is available on macOS. You can still inspect a local file."}),g&&e.jsx("p",{className:"tr-capture-error",role:"alert",children:g}),D&&!te.length&&(s==null?void 0:s.state)==="awaiting"&&e.jsxs("div",{className:"tr-activation",children:[e.jsx("p",{children:"Activation is pending. Generate the Terminal instructions again to continue."}),e.jsx("button",{className:"btn",...V("prepare"),onClick:ce,children:"Show activation instructions"}),e.jsx("p",{className:"tr-note",children:"The previous token will be invalidated."})]}),te.length>0&&D&&e.jsxs("details",{className:"tr-activation",open:!q,children:[e.jsxs("summary",{children:["Activate in Terminal",z>1?` · ${q}/${z} listening`:""]}),e.jsx("p",{children:"Run each command in a separate Terminal tab. Only tcpdump asks for administrator permission."}),te.map(n=>e.jsxs("div",{className:"tr-command-entry",children:[e.jsxs("div",{children:[e.jsx("code",{children:n.destination}),e.jsx("button",{className:"btn",onClick:()=>void de(n.command,n.destination),children:X===n.destination?"Copied":"Copy command"})]}),e.jsx("pre",{className:"tr-command",children:n.command})]},n.destination)),e.jsx("p",{className:"tr-note",children:"Press Ctrl+C in each Terminal tab to stop tcpdump. Monitoring expires after 10 minutes. Commands contain a temporary local token; do not share them."})]}),X==="failed"&&e.jsx("p",{className:"tr-capture-error",role:"alert",children:"Clipboard unavailable. Select the text and copy it manually."}),r&&e.jsx("p",{className:"tr-capture-error",role:"alert",children:"Displayed messages are from the last successful read. Reconnecting automatically."}),e.jsxs("div",{className:"tr-workspace",children:[e.jsxs("section",{className:"tr-feed","aria-label":"Captured telemetry messages",children:[e.jsxs("div",{className:"tr-feed-head",children:[e.jsxs("h3",{children:["Messages ",e.jsx("span",{className:"tr-count",children:W.length+$.length})]}),e.jsx("button",{className:"btn",disabled:!B.length&&!$.length,onClick:()=>{Q(P?null:[...B]),F(P?null:((s==null?void 0:s.observations)??[]).map(n=>n.id))},children:P?"Resume list":"Pause list"})]}),e.jsxs("div",{className:"tr-filter",children:[e.jsxs("label",{children:["Type",e.jsxs("select",{className:"tr-select","aria-label":"Message type",value:S,onChange:n=>{l(null),M(n.target.value)},children:[e.jsx("option",{value:"all",children:"All types"}),e.jsx("option",{value:"logs",children:"Events"}),e.jsx("option",{value:"metrics",children:"Metrics"}),e.jsx("option",{value:"traces",children:"Traces"})]})]}),e.jsxs("label",{children:["To",e.jsxs("select",{className:"tr-select","aria-label":"Message destination",value:b,onChange:n=>{l(null),T(n.target.value)},children:[e.jsx("option",{value:"all",children:"All destinations"}),[...new Set([...o,...((je=s==null?void 0:s.sources)==null?void 0:je.map(n=>n.destination))??[],...ne.map(n=>n.destination)])].map(n=>e.jsx("option",{value:n,children:n},n))]})]})]}),P&&e.jsx("p",{className:"tr-note",children:"List paused. Monitoring continues."}),Te&&e.jsxs("div",{className:"tr-observation",role:"status",children:[e.jsx("strong",{children:"Encrypted traffic observed"}),e.jsx("p",{className:"tr-note",children:"The connection is visible; its contents cannot be read. Inspect the collector for its JSON."})]}),((s==null?void 0:s.issues.joined_midstream)??0)>0&&e.jsx("p",{className:"tr-warning",children:"Waiting for a new HTTP/2 connection to decode messages. Existing traffic is not reconstructable."}),W.length?e.jsx("ul",{className:"tr-connections",children:W.map(n=>e.jsx("li",{children:e.jsxs("button",{className:"tr-message","aria-pressed":(y==null?void 0:y.id)===n.id,onClick:()=>Ce(n),children:[e.jsxs("span",{className:"tr-event-top",children:[e.jsx("span",{className:"tr-signal",children:n.signal==="logs"?"Event":n.signal==="metrics"?"Metric":"Trace"}),e.jsx("time",{dateTime:new Date(n.at).toISOString(),children:ae(n.at)})]}),e.jsx("strong",{className:"tr-event-name",children:n.name}),e.jsx("span",{children:me(n.sessionIds)}),e.jsx("code",{children:n.destination}),e.jsxs("span",{className:"tr-event-bottom",children:[e.jsx("span",{className:`tr-receipt ${n.outcome==="accepted"?"tr-tone-ok":n.outcome==="rejected"||n.outcome==="partial"?"tr-tone-enabled":""}`,children:n.outcome==="accepted"?"Accepted":n.outcome==="unconfirmed"?"Receipt unconfirmed":n.outcome==="partial"?"Partially accepted":n.outcome==="rejected"?"Rejected":"Receipt unknown"}),e.jsxs("span",{children:[n.count," ",n.count===1?"record":"records"," · ",n.bytes.toLocaleString()," B"]})]})]})},n.id))}):!$.length&&e.jsxs("div",{className:"tr-empty-capture",children:[e.jsx("h4",{children:B.length||$.length?"No matching messages":D?"Waiting for messages":"Message capture is off"}),e.jsx("p",{className:"tr-note",children:B.length?"Try another session or message type.":D?"Messages appear here once capture is activated and new decodable traffic arrives.":"No messages have been captured by Radar. Claude may still be sending telemetry. Choose a destination, start monitoring, then run the Terminal command to inspect new traffic."})]}),$.length>0&&e.jsx("ul",{className:"tr-connections tr-unreadable",children:$.map(n=>e.jsx("li",{children:e.jsxs("button",{className:"tr-message","aria-pressed":k===n.id,onClick:()=>{l(null),a(n.id)},children:[e.jsxs("span",{className:"tr-event-top",children:[e.jsx("span",{children:"Connection observation"}),e.jsx("time",{children:ae(n.at)})]}),e.jsx("strong",{children:n.reason==="encrypted"?"Encrypted traffic":"Contents unavailable"}),e.jsx("code",{children:n.destination}),e.jsx("span",{children:"Unidentified session · no decoded JSON"})]})},n.id))}),ie.length>0&&e.jsxs("details",{className:"tr-details",children:[e.jsxs("summary",{children:["Connections to these collectors (",ie.length,")"]}),e.jsx("ul",{className:"tr-live-connections",children:ie.map(n=>e.jsxs("li",{children:[e.jsx("code",{children:n.destination}),e.jsxs("span",{children:["Claude · PID ",n.pid," · ",n.workspace??"Workspace unknown"]})]},`${n.pid}:${n.destination}`))}),e.jsx("p",{className:"tr-note",children:"A connection alone does not prove a telemetry message was sent. These connections are not filtered by session."})]})]}),e.jsx("section",{className:"tr-inspector","aria-label":"Message contents",ref:se,tabIndex:-1,children:Y?e.jsxs("div",{className:"tr-inspector-empty",children:[e.jsx("h3",{children:Y.reason==="encrypted"?"Encrypted contents":"Contents unavailable"}),e.jsx("code",{children:Y.destination}),e.jsx("p",{className:"tr-note",children:be[Y.reason]??"This connection could not be decoded."}),e.jsx("p",{className:"tr-note",children:"There is no decoded JSON or confirmed session ID for this observation."})]}):y?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"tr-inspector-head",children:[e.jsx("h3",{children:y.name}),e.jsx("p",{className:"tr-note",children:me(y.sessionIds)})]}),e.jsxs("div",{className:"tr-detail-tabs",role:"group","aria-label":"Message format",children:[e.jsx("button",{className:"btn","aria-pressed":Z==="summary",onClick:()=>re("summary"),children:"Overview"}),e.jsx("button",{className:"btn","aria-pressed":Z==="json",onClick:()=>re("json"),children:"JSON"}),e.jsx("button",{className:"btn tr-copy-json",disabled:!(E!=null&&E.payload)||E.id!==y.id,onClick:()=>void de(JSON.stringify(E==null?void 0:E.payload,null,2),"json"),children:X==="json"?"Copied":"Copy JSON"})]}),(E==null?void 0:E.id)===y.id?E.payload?Z==="json"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"tr-note",children:"Decoded OTLP fields. Unknown protobuf fields and transport headers are excluded."}),e.jsx(U,{value:E.payload})]}):e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:"tr-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Destination"}),e.jsx("dd",{children:e.jsx("code",{children:y.destination})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Time"}),e.jsx("dd",{children:ae(y.at)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsx("dd",{children:$e(y)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Size"}),e.jsxs("dd",{children:[y.bytes.toLocaleString()," bytes · ",y.count," ",y.count===1?"record":"records"]})]}),((ge=y.response)==null?void 0:ge.message)&&e.jsxs("div",{children:[e.jsx("dt",{children:"Response"}),e.jsx("dd",{children:e.jsx(U,{value:y.response.message})})]})]}),e.jsx(Ve,{payload:E.payload,signal:y.signal})]}):e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:E.error}),e.jsx("button",{className:"btn",onClick:()=>Se(oe+1),children:"Retry"})]}):e.jsx("p",{className:"tr-note",role:"status",children:"Loading message contents…"})]}):e.jsxs("div",{className:"tr-inspector-empty",children:[e.jsx("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.25","aria-hidden":"true",children:e.jsx("path",{d:"M8 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3M16 4h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3M10 8l-3 4 3 4M14 8l3 4-3 4"})}),e.jsx("h3",{children:p!==null?"Message no longer available":"See what was sent"}),e.jsx("p",{className:"tr-note",children:p!==null?"The selected message is no longer retained or does not match your filter. Select another message.":"Select a message to explore its contents or inspect the full JSON."})]})})]}),e.jsxs("footer",{className:"tr-monitor-footer",children:[e.jsxs("span",{children:[r?"Connection interrupted":D?"Local capture":"Not monitoring",s!=null&&s.bytes?` · ${s.bytes.toLocaleString()} capture bytes`:""]}),e.jsxs("details",{children:[e.jsx("summary",{children:"Monitoring limits"}),e.jsxs("div",{children:[e.jsx("p",{children:"Plaintext IPv4 OTLP/gRPC only. HTTPS contents cannot be decoded. Traffic to the chosen addresses can come from any process, not only Claude."}),e.jsx("p",{children:"Messages stay in local memory: up to 100 exports for 5 minutes. No capture file is written. Closing this modal does not stop capture; use Stop monitoring and Ctrl+C in Terminal."}),Object.entries((s==null?void 0:s.issues)??{}).map(([n,j])=>e.jsxs("p",{children:[be[n]??"An inspection limitation was observed."," (",j,")"]},n))]})]})]})]})}function We({sessionFilter:s="all",onSessions:t}){const[r,m]=d.useState([]),[c,g]=d.useState(""),[h,u]=d.useState(""),[f,i]=d.useState(!1),[v,x]=d.useState(null),[o,w]=d.useState(""),[C,_]=d.useState(!1),N=d.useRef(0),I=async l=>{if(!l)return;const b=++N.current;u(""),i(!0),_(!1);try{if(l.size>10*1024*1024)throw new Error("Choose a file smaller than 10 MB.");const T=await l.text(),S=Me(T);if(b!==N.current)return;t==null||t([...new Set(S.flatMap(M=>M.sessionIds))]),m(S),g(l.name),x(null),w(""),S.length||u("This file is empty. Choose a JSON or JSONL telemetry file.")}catch(T){b===N.current&&u(T instanceof Error?T.message:"Could not read this file.")}finally{b===N.current&&i(!1)}},k=r.filter(l=>(s==="all"||(s==="unidentified"?!l.sessionIds.length:l.sessionIds.includes(s)))&&(!o||l.raw.toLowerCase().includes(o.toLowerCase()))),a=k.slice(0,200),p=v===null?a[0]:k.find(l=>l.line===v);return e.jsxs("div",{className:"tr-file",children:[e.jsxs("div",{className:"tr-file-toolbar",children:[e.jsxs("div",{children:[e.jsx("h3",{children:"Inspect a telemetry file"}),e.jsx("p",{className:"tr-note",children:"Open a local JSON or JSONL file. It stays in your browser and is not uploaded."})]}),e.jsxs("label",{className:"btn tr-file-picker",children:[f?"Reading…":c?"Choose another file":"Open file",e.jsx("input",{type:"file",accept:".json,.jsonl,.ndjson,application/json","aria-label":"Open telemetry file",onChange:l=>{var b;I((b=l.target.files)==null?void 0:b[0]),l.target.value=""}})]})]}),h&&e.jsx("p",{className:"tr-capture-error",role:"alert",children:h}),e.jsxs("div",{className:"tr-workspace",children:[e.jsxs("section",{className:"tr-feed","aria-label":"File records",children:[e.jsxs("h3",{children:[c||"File records"," ",e.jsx("span",{className:"tr-count",children:k.length})]}),r.length>0&&e.jsx("input",{type:"search",className:"tr-input tr-search","aria-label":"Search file contents",placeholder:"Search contents…",value:o,onChange:l=>{w(l.target.value),x(null)}}),a.length?e.jsx("ul",{className:"tr-connections",children:a.map(l=>e.jsx("li",{children:e.jsxs("button",{className:"tr-message","aria-pressed":(p==null?void 0:p.line)===l.line,onClick:()=>{x(l.line),_(!1)},children:[e.jsxs("span",{className:"tr-event-top",children:[e.jsxs("span",{children:["Line ",l.line]}),e.jsx("span",{className:l.valid?"":"tr-tone-enabled",children:l.valid?"JSON":"Invalid JSON"})]}),e.jsx("strong",{children:l.label}),l.timestamp&&e.jsx("span",{children:l.timestamp}),e.jsx("span",{children:l.sessionIds.join(", ")||"Unidentified session"})]})},l.line))}):e.jsxs("div",{className:"tr-empty-capture",children:[e.jsx("h4",{children:r.length?"No matching records":"Your saved records, in one place"}),e.jsx("p",{className:"tr-note",children:r.length?"Try another session or search.":"Choose a file to browse its rows and inspect the original JSON. A saved file is separate from live network capture."})]}),k.length>a.length&&e.jsx("p",{className:"tr-note",children:"Showing the first 200 matching rows. Search to narrow the list."})]}),e.jsx("section",{className:"tr-inspector","aria-label":"File record contents",children:p?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"tr-feed-head",children:[e.jsxs("h3",{children:["Line ",p.line]}),e.jsx("button",{className:"btn",onClick:()=>{navigator.clipboard.writeText(p.raw).then(()=>_(!0),()=>u("Clipboard unavailable. Select the JSON and copy it manually."))},children:C?"Copied":"Copy JSON"})]}),e.jsx("p",{className:"tr-note",children:"Original file contents. This does not prove the record was sent or received."}),e.jsx("pre",{className:"tr-value",children:p.raw})]}):e.jsxs("div",{className:"tr-inspector-empty",children:[e.jsx("h3",{children:"Inspect a record"}),e.jsx("p",{className:"tr-note",children:"Select a row to read its original contents."})]})})]})]})}function qe({onClose:s,sessions:t=[]}){const r=Le(s),m=_e(s),{snapshot:c,failed:g}=De(),h=Pe();return e.jsx("div",{className:"modal-backdrop",...m,role:"presentation",children:e.jsxs("div",{className:"modal tr-modal",ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"tr-title",onClick:u=>u.stopPropagation(),children:[e.jsxs("header",{className:"modal-head",children:[e.jsxs("div",{className:"modal-title",children:[e.jsx("span",{className:"modal-tool-name",id:"tr-title",children:"Telemetry Radar"}),e.jsx("span",{className:"tr-beta",title:"Beta feature — still being tested and improved.",children:"Beta"})]}),e.jsx("button",{className:"glyph-btn",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]}),e.jsx(Ge,{snapshot:c,failed:g,captureState:h,sessions:t})]})})}function Ge({snapshot:s,failed:t=!1,captureState:r,sessions:m=[]}){var I,k;const[c,g]=d.useState("monitor"),[h,u]=d.useState([]),[f,i]=d.useState("all"),v=["monitor","configuration","file"],x=a=>{var b;const p=Ie(a,v.indexOf(c),v.length);if(p.kind!=="select")return;a.preventDefault();const l=v[p.index];g(l),(b=document.getElementById(`tr-tab-${l}`))==null||b.focus()},o=((I=s==null?void 0:s.config)==null?void 0:I.variables)??[],w=ye(o),C=Re(o),_=t?[]:Ne(s),N=new Map(m.map(a=>[a.id,a.label]));for(const a of((k=r==null?void 0:r.capture)==null?void 0:k.events)??[])for(const p of a.sessionIds??[])N.has(p)||N.set(p,p.slice(0,8));for(const a of h)N.has(a)||N.set(a,a.slice(0,8));return e.jsxs("div",{className:"tr-body",children:[e.jsxs("div",{className:"tr-summary",children:[e.jsxs("div",{className:"tr-summary-state",children:[e.jsx("span",{className:`tr-state ${t||!s?"tr-tone-unknown":C==="Enabled in settings"?"tr-tone-enabled":"tr-tone-unknown"}`,children:t?"Configuration unavailable":s?C==="Unknown"?"Configuration unknown":C:"Reading settings…"}),e.jsx("span",{className:"tr-note",children:w.length?`${w.length} configured destination${w.length===1?"":"s"}`:"No destination found in the settings files read. Telemetry may still be running."})]}),w.length>0&&e.jsx("div",{className:"tr-endpoints",children:w.map(a=>e.jsx("code",{children:a},a))}),!w.length&&_.length>0&&e.jsxs("div",{className:"tr-observed-summary",children:[e.jsx("span",{className:"tr-state",children:"Claude connections observed"}),e.jsx("div",{className:"tr-endpoints",children:_.map(a=>e.jsx("code",{children:a},a))}),e.jsx("p",{className:"tr-note",children:"These are active connections, not confirmed telemetry messages. Choose an observed address below to inspect its traffic."})]})]}),e.jsxs("div",{className:"tr-navigation",children:[e.jsx("div",{className:"tr-tabs",role:"tablist","aria-label":"Radar views",onKeyDown:x,children:[["monitor","Monitor"],["configuration","Configuration"],["file","File"]].map(([a,p])=>e.jsx("button",{id:`tr-tab-${a}`,className:"tr-tab",role:"tab","aria-selected":c===a,"aria-controls":`tr-panel-${a}`,tabIndex:c===a?0:-1,onClick:()=>g(a),children:p},a))}),e.jsxs("label",{className:"tr-session-filter",children:["Session",e.jsxs("select",{className:"tr-select",value:f,onChange:a=>i(a.target.value),"aria-label":"Session",children:[e.jsx("option",{value:"all",children:"All sessions"}),[...N].map(([a,p])=>e.jsxs("option",{value:a,children:[p," · ",a.slice(0,8)]},a)),e.jsx("option",{value:"unidentified",children:"Unidentified session"})]})]})]}),e.jsx("div",{className:"tr-page",id:"tr-panel-monitor",role:"tabpanel","aria-labelledby":"tr-tab-monitor",hidden:c!=="monitor",children:r?e.jsx(Be,{...r,radar:t&&s?{...s,status:"unavailable"}:s,sessionFilter:f,sessions:m}):e.jsx("p",{className:"tr-empty",children:"Reading monitor status…"})}),e.jsx("div",{className:"tr-page",id:"tr-panel-configuration",role:"tabpanel","aria-labelledby":"tr-tab-configuration",hidden:c!=="configuration",children:s?e.jsx(He,{snapshot:s,stale:t,sessionLabel:f==="all"?void 0:N.get(f)??f}):e.jsx("p",{className:"tr-empty",children:t?"Could not read settings. Sampling will retry.":"Reading local settings…"})}),e.jsx("div",{className:"tr-page",id:"tr-panel-file",role:"tabpanel","aria-labelledby":"tr-tab-file",hidden:c!=="file",children:e.jsx(We,{onSessions:u,sessionFilter:f})})]})}function He({snapshot:s,sessionLabel:t,stale:r=!1}){var u,f;const m=((u=s.config)==null?void 0:u.variables)??[],c=m.filter(i=>i.key.endsWith("ENDPOINT")),g=m.filter(i=>i.key.startsWith("OTEL_LOG_")||i.key.includes("ENABLE")||i.key.includes("TELEMETRY_BETA")),h={CLAUDE_CODE_ENABLE_TELEMETRY:"Telemetry",OTEL_LOG_USER_PROMPTS:"Your prompts",OTEL_LOG_ASSISTANT_RESPONSES:"Claude responses",OTEL_LOG_TOOL_DETAILS:"Tool details",OTEL_LOG_TOOL_CONTENT:"Tool contents",OTEL_LOG_RAW_API_BODIES:"Full API bodies",OTEL_LOG_MANAGED_SETTINGS:"Managed settings",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"Enhanced telemetry",ENABLE_ENHANCED_TELEMETRY_BETA:"Enhanced telemetry"};return e.jsxs("section",{className:"tr-config","aria-label":"Telemetry configuration",children:[e.jsx("h3",{children:"What Claude is configured to send"}),r&&e.jsx("p",{className:"tr-warning",role:"status",children:"Last successfully read settings. Current configuration could not be verified."}),e.jsx("p",{className:"tr-note",children:"Read from local Claude settings. The effective environment of a running session is not verified."}),t&&e.jsxs("p",{className:"tr-note",children:["Selected session: ",t,". These shared settings are evidence; this session’s runtime values are unverified."]}),e.jsx("h4",{children:"Destinations"}),c.length?e.jsx("ul",{className:"tr-destinations",children:c.map(i=>e.jsxs("li",{children:[e.jsx("code",{children:i.value}),e.jsxs("span",{children:[i.source," · ",i.key]})]},`${i.source}:${i.key}`))}):e.jsx("p",{className:"tr-note",children:"No destination found in the sources read. This does not mean telemetry is off."}),!c.length&&s.connections.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Observed Claude connections"}),e.jsx("ul",{className:"tr-live-connections",children:s.connections.map(i=>e.jsxs("li",{children:[e.jsx("code",{children:i.destination}),e.jsxs("span",{children:[r||i.active===null?"Visibility unavailable":i.active?"Active connection":"Previously observed"," · PID ",i.pid," · ",i.workspace??"Workspace unknown"]})]},`${i.pid}:${i.destination}`))}),e.jsx("p",{className:"tr-note",children:"A running process can keep previously loaded settings after a settings file disappears. Connections alone do not identify telemetry or prove a message was sent."})]}),e.jsx("h4",{children:"Telemetry and content"}),g.length?e.jsx("dl",{className:"tr-variables",children:g.map(i=>e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx("strong",{children:h[i.key]??i.key}),e.jsx("code",{children:i.key}),e.jsx("span",{children:i.source})]}),e.jsxs("dd",{children:[e.jsx("span",{className:`tr-state ${i.value.startsWith("Enabled")?"tr-tone-enabled":"tr-tone-unknown"}`,children:i.value}),i.rawValue!==void 0&&e.jsx("code",{className:"tr-raw-flag",children:i.rawValue})]})]},`${i.source}:${i.key}`))}):e.jsx("p",{className:"tr-note",children:"No telemetry flags found in the settings read."}),e.jsxs("details",{className:"tr-details",children:[e.jsx("summary",{children:"All variables and sources"}),e.jsx("dl",{className:"tr-variables",children:m.map(i=>e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx("code",{children:i.key}),e.jsx("span",{children:i.source})]}),e.jsx("dd",{children:i.value})]},`${i.source}:${i.key}`))}),e.jsx("ul",{className:"tr-sources",children:(f=s.config)==null?void 0:f.sources.map(i=>e.jsxs("li",{children:[e.jsx("span",{children:i.name}),e.jsx("span",{children:i.status==="read"?"Read":i.status==="absent"?"Not found":"Unavailable"})]},i.name))}),e.jsx("p",{className:"tr-note",children:"Endpoint credentials and headers are hidden. Settings can differ from an already running process."})]})]})}export{He as Configuration,Ge as TrafficRadarView,qe as default};
|