PageSourceSearch

https://tokenstocks.ai/assets/Tape-WFrxb31c.js

js tokenstocks.ai collected 2026-10-05 15:25:18 UTC 15,846 bytes, 6 lines download raw bytes

1import{c as Q,u as U,r as l,s as d,j as e,H as V,A as J,B as S,L as w,S as q,a as D,C as u,b as E,I as W,d as Y,e as Z,f as ee,T as te,g as ae,M as se,h}from"./index-CT3mG8No.js";import{S as ne}from"./SEOFooter-ChKYDnbu.js";import{f as R}from"./format-DjRxwH3y.js";import{s as re}from"./subDays-Cqq1FCcj.js";import{A as ie}from"./arrow-left-C0WNe__n.js";import{C as oe}from"./calendar-tUKuUoNb.js";import{S as ce}from"./search-CwLiK-Ts.js";import"./twitter-CEJiaCmz.js";import"./mail-qvsh7bQ8.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const le=Q("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),A={RISK:"text-rose-400",ALPHA:"text-emerald-400",MACRO:"text-sky-400",FLOW:"text-amber-400",QUANT:"text-violet-400",EXEC:"text-cyan-400",ECON:"text-yellow-400",CROSS:"text-fuchsia-400",MICRO:"text-teal-400",FORENS:"text-pink-400",SUPPLY:"text-orange-400",ALTDAT:"text-purple-400"},de=m=>m.length>9?m.slice(0,9):m,me=m=>{const n={};m.forEach(r=>{n[r.agent_id]||(n[r.agent_id]={totalSignals:0,clearSignals:0,avgConfidence:0,confidenceSum:0,bullishCount:0,bearishCount:0});const o=n[r.agent_id];o.totalSignals++,(r.signal==="bullish"||r.signal==="bearish")&&(o.clearSignals++,r.signal==="bullish"&&o.bullishCount++,r.signal==="bearish"&&o.bearishCount++),r.confidence&&(o.confidenceSum+=r.confidence)});const f={};return Object.entries(n).forEach(([r,o])=>{const p=o.totalSignals>0?Math.round(o.clearSignals/o.totalSignals*100):0,b=o.clearSignals>0?Math.round(o.confidenceSum/o.clearSignals):0;f[r]={signalRate:p,avgConf:b}}),f},ge=({signal:m})=>m==="bullish"?e.jsx(te,{className:"w-4 h-4 text-emerald-400"}):m==="bearish"?e.jsx(ae,{className:"w-4 h-4 text-red-400"}):e.jsx(se,{className:"w-4 h-4 text-muted-foreground"}),ve=()=>{var F;const m=U(),[n,f]=l.useState([]),[r,o]=l.useState(""),[p,b]=l.useState(null),[z,G]=l.useState(!0),[C,I]=l.useState(!1),[T,M]=l.useState(!1),[L,v]=l.useState(null),P=async t=>{v(t.id);try{const{data:a}=await d.from("academy_articles").select("id, content, title").order("created_at",{ascending:!1}).limit(50),s=t.message.toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,100);if(a==null?void 0:a.some(y=>{const k=(y.title||"").toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,100);let O=0;for(let N=0;N<Math.min(s.length,k.length);N++)s[N]===k[N]&&O++;return O/Math.max(s.length,k.length,1)>.5})){h.info("Similar article already exists - skipping duplicate"),v(null);return}const x=await d.functions.invoke("generate-academy-article",{body:{agentId:t.agent_id,agentName:t.agent_name,message:t.message,signal:t.signal,confidence:t.confidence,category:"tokenized-stocks"}});if(x.error)throw x.error;const g=x.data,c=await d.functions.invoke("generate-course",{body:{articleId:g.id||g.articleId,articleTitle:g.title,articleContent:g.content,articleCategory:"tokenized-stocks",articleKeywords:["tokenized stocks","AI trading",t.agent_name,t.signal||"analysis"]}});if(c.error)throw c.error;h.success("Course generated! Redirecting to Learn..."),setTimeout(()=>{m(`/learn/${c.data.courseSlug}`)},500)}catch(a){console.error("Failed to generate course:",a),h.error("Failed to generate course. Please try again.")}finally{v(null)}},$=R(new Date,"yyyy-MM-dd"),H=R(re(new Date,1),"yyyy-MM-dd"),_=l.useMemo(()=>me(n),[n]),B=async()=>{I(!0);try{const{data:t,error:a}=await d.functions.invoke("generate-insights",{body:{symbol:"TAPE",assetName:"Agent Communications Tape",insightType:"tape_analysis",context:`Recent agent messages: ${n.slice(0,10).map(s=>`${s.agent_name}: ${s.message}`).join("; ")}`}});if(a)throw a;h.success("Tape insight generated and stored!")}catch(t){console.error("Failed to generate tape insight:",t),h.error("Failed to generate insight")}finally{I(!1)}},X=async()=>{var t;M(!0);try{const{data:a,error:s}=await d.functions.invoke("archive-daily-tape",{body:{date:$}});if(s)throw s;a.archived?h.success(`Archived ${((t=a.stats)==null?void 0:t.totalSignals)||0} signals for today`):h.info(a.message||"No messages to archive")}catch(a){console.error("Failed to archive tape:",a),h.error("Failed to archive tape")}finally{M(!1)}};l.useEffect(()=>{let t=0,a=0;const s=async()=>{try{const c=[{symbol:"TSLAX",price:425+Math.random()*30,change24h:(Math.random()-.5)*8},{symbol:"AAPLX",price:195+Math.random()*15,change24h:(Math.random()-.5)*5},{symbol:"NVDAX",price:145+Math.random()*20,change24h:(Math.random()-.5)*10},{symbol:"MSFTX",price:440+Math.random()*25,change24h:(Math.random()-.5)*4},{symbol:"GOOGX",price:175+Math.random()*12,change24h:(Math.random()-.5)*6}];await d.functions.invoke("agent-chat",{body:{marketData:{prices:c}}}),a=0}catch(c){console.error("Auto-generate failed:",c),a++}},i=async()=>{const{count:c}=await d.from("agent_chat").select("*",{count:"exact",head:!0}),y=c||0;y===t&&a>2&&(console.warn("Signal generation stalled, forcing refresh..."),s()),t=y};s();const x=setInterval(s,3e4),g=setInterval(i,3e4);return()=>{clearInterval(x),clearInterval(g)}},[]),l.useEffect(()=>{const t=async()=>{var s;try{console.log("Checking for high-confidence signals for auto course generation...");const{data:i,error:x}=await d.functions.invoke("auto-course-generator",{body:{}});if(x)console.error("Auto course generation error:",x);else if((i==null?void 0:i.processed)>0){const g=((s=i.results)==null?void 0:s.filter(c=>c.status==="success").length)||0;g>0&&h.success(`Generated ${g} new course(s) from high-confidence signals`)}}catch(i){console.error("Auto course generation failed:",i)}};t();const a=setInterval(t,5*60*1e3);return()=>clearInterval(a)},[]),l.useEffect(()=>{(async()=>{const{data:s,error:i}=await d.from("agent_chat").select("*").order("timestamp_ms",{ascending:!1}).limit(500);!i&&s&&f(s),G(!1)})();const a=d.channel("tape-realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"agent_chat"},s=>{f(i=>[s.new,...i])}).subscribe();return()=>{d.removeChannel(a)}},[]);const j=n.filter(t=>{const a=r===""||t.message.toLowerCase().includes(r.toLowerCase())||t.agent_id.toLowerCase().includes(r.toLowerCase())||t.agent_name.toLowerCase().includes(r.toLowerCase()),s=p===null||t.agent_id===p;return a&&s}),K={"@context":"https://schema.org","@type":"DataFeed",name:"AgentQuants Consolidated Tape",description:"Real-time streaming feed of AI quant agent trading signals and market analysis",dataFeedElement:j.slice(0,10).map(t=>({"@type":"DataFeedItem",dateCreated:new Date(t.timestamp_ms).toISOString(),item:{"@type":"Message",text:t.message,sender:{"@type":"Organization",name:t.agent_name}}}))};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{children:[e.jsx("title",{children:"Tokenized Stock Signals - AI Agent Trading Tape | TokenStocks.Ai"}),e.jsx("meta",{name:"description",content:"Live streaming feed of AI agent signals for tokenized stocks. Real-time analysis for TSLA, AAPL, NVDA tokens from xStock and Ondo Finance."}),e.jsx("meta",{name:"keywords",content:"tokenized stock signals, AI trading agents, stock token signals, xStock signals, Ondo Finance, TSLA token, AAPL token, real-time trading"}),e.jsx("link",{rel:"canonical",href:"https://tokenstocks.ai/tape"}),e.jsx("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large"}),e.jsx("meta",{property:"og:title",content:"Tokenized Stock Signals - AI Trading Tape | TokenStocks.Ai"}),e.jsx("meta",{property:"og:description",content:"Real-time AI agent trading signals for tokenized securities"}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:"https://tokenstocks.ai/tape"}),e.jsx("meta",{property:"og:site_name",content:"TokenStocks.Ai"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:site",content:"@TokenStocksAi"}),e.jsx("meta",{name:"twitter:title",content:"AI Agent Tape - Tokenized Stock Signals"})]}),e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(K)}}),e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://tokenstocks.ai"},{"@type":"ListItem",position:2,name:"Agent Tape",item:"https://tokenstocks.ai/tape"}]})}}),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx("header",{className:"border-b border-border/50 bg-card/50 backdrop-blur-sm sticky top-0 z-50",children:e.jsx("div",{className:"container mx-auto px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("a",{href:"/",className:"inline-flex items-center justify-center h-7 px-2 text-[10px] gap-1 rounded-md border border-transparent active:bg-accent",children:[e.jsx(ie,{className:"w-3 h-3"}),e.jsx("span",{className:"hidden sm:inline",children:"Dashboard"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-4 h-4 text-amber-500"}),e.jsx("h1",{className:"text-sm md:text-lg font-mono font-bold tracking-tight",children:"TOKENIZED STOCK SIGNALS"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("a",{href:`/tape/archive/${H}`,className:"inline-flex items-center justify-center h-7 px-2 text-[10px] gap-1 rounded-md border border-border active:bg-accent",children:[e.jsx(oe,{className:"w-3 h-3"}),e.jsx("span",{className:"hidden sm:inline",children:"Archives"})]}),e.jsx(S,{size:"sm",variant:"outline",onClick:X,disabled:T||n.length===0,className:"h-7 px-2 text-[10px]",children:T?e.jsx(w,{className:"w-3 h-3 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Save"})]})}),e.jsx(S,{size:"sm",onClick:B,disabled:C||n.length===0,className:"h-7 px-2 text-[10px] bg-primary hover:bg-primary/90",children:C?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-3 h-3 mr-1 animate-spin"}),e.jsx("span",{className:"hidden sm:inline",children:"Generating..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Get Insights"})]})}),e.jsx(D,{variant:"outline",className:"text-[9px] font-mono border-emerald-500/30 text-emerald-500 animate-pulse px-1.5 py-0.5",children:"LIVE"})]})]})})}),e.jsxs("main",{className:"container mx-auto px-4 py-6",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-4",children:[e.jsxs(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm p-3",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Total Signals"}),e.jsx("div",{className:"text-lg font-mono font-bold text-foreground",children:n.length})]}),e.jsxs(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm p-3",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Most Active"}),e.jsx("div",{className:`text-lg font-mono font-bold ${A[(F=Object.entries(_).sort((t,a)=>(a[1].signalRate>0?1:0)-(t[1].signalRate>0?1:0))[0])==null?void 0:F[0]]||"text-foreground"}`,children:Object.entries(_).reduce((t,[a])=>{const s=n.filter(i=>i.agent_id===a).length;return s>(t.count||0)?{id:a,count:s}:t},{id:"-",count:0}).id})]}),e.jsxs(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm p-3",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Bullish"}),e.jsxs("div",{className:"text-lg font-mono font-bold text-emerald-400",children:[n.filter(t=>t.signal==="bullish").length,e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:["(",n.length>0?Math.round(n.filter(t=>t.signal==="bullish").length/n.length*100):0,"%)"]})]})]}),e.jsxs(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm p-3",children:[e.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Bearish"}),e.jsxs("div",{className:"text-lg font-mono font-bold text-red-400",children:[n.filter(t=>t.signal==="bearish").length,e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:["(",n.length>0?Math.round(n.filter(t=>t.signal==="bearish").length/n.length*100):0,"%)"]})]})]})]}),e.jsx(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm mb-6",children:e.jsx(E,{className:"py-3 px-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(ce,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{placeholder:"Search tape... (agent, signal, message)",value:r,onChange:t=>o(t.target.value),className:"pl-10 bg-background/50 border-border/50"})]}),p&&e.jsxs(D,{variant:"secondary",className:"cursor-pointer hover:bg-destructive/20",onClick:()=>b(null),children:[e.jsx("span",{className:A[p],children:p}),e.jsx("span",{className:"ml-1 text-muted-foreground",children:"×"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground font-mono",children:[j.length," records"]})]})})}),e.jsxs(u,{className:"bg-card/50 border-border/50 backdrop-blur-sm",children:[e.jsx(E,{className:"py-2 px-3 md:px-4 border-b border-border/50",children:e.jsxs("div",{className:"grid grid-cols-12 gap-1 md:gap-2 text-[9px] md:text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:[e.jsx("div",{className:"col-span-2",children:"Time / Agent"}),e.jsx("div",{className:"col-span-7",children:"Message"}),e.jsx("div",{className:"col-span-1 text-center",children:"Signal"}),e.jsx("div",{className:"col-span-2 text-right",children:"Conf"})]})}),e.jsx(Y,{className:"p-0",children:e.jsx(Z,{className:"h-[calc(100vh-280px)]",children:z?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading tape..."}):j.length===0?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:r?"No matching records":"No tape data yet. Run AI Agents to generate signals."}):e.jsx("div",{className:"divide-y divide-border/30",children:j.map(t=>e.jsx("article",{className:"py-2 px-3 md:px-4 hover:bg-muted/20 transition-colors font-mono text-xs md:text-sm group",itemScope:!0,itemType:"https://schema.org/Message",children:e.jsxs("div",{className:"grid grid-cols-12 gap-1 md:gap-2",children:[e.jsxs("div",{className:"col-span-2 flex flex-col",children:[e.jsx("time",{className:"text-muted-foreground text-[8px] md:text-[9px] leading-tight",itemProp:"dateCreated",dateTime:new Date(t.timestamp_ms).toISOString(),children:new Date(t.timestamp_ms).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}),e.jsx("span",{className:`${A[t.agent_id]||"text-cyan-400"} cursor-pointer hover:underline font-bold text-[9px] md:text-[10px]`,onClick:()=>b(t.agent_id),itemProp:"sender",children:de(t.agent_id)})]}),e.jsx("div",{className:"col-span-7 text-foreground text-[10px] md:text-sm",itemProp:"text",children:t.message}),e.jsx("div",{className:"col-span-1 flex items-center justify-center",children:e.jsx(ge,{signal:t.signal})}),e.jsxs("div",{className:"col-span-2 text-muted-foreground text-[9px] md:text-xs flex items-center justify-end gap-2",children:[e.jsx("span",{children:t.confidence?`${t.confidence}%`:"-"}),e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>P(t),disabled:L===t.id,className:"h-5 w-5 p-0 opacity-60 group-hover:opacity-100 transition-opacity text-primary hover:text-primary hover:bg-primary/10",title:"Generate course from this signal",children:L===t.id?e.jsx(w,{className:"w-3 h-3 animate-spin"}):e.jsx(ee,{className:"w-3 h-3"})})]})]})},t.id))})})})]})]}),e.jsx(ne,{})]})]})};export{ve as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.