@dudousxd/nestjs-agent-dashboard 0.3.0 → 0.4.0

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.
@@ -0,0 +1 @@
1
+ import{c as l,j as e,r as d,L as i,S as u,M as m,b as p,R as h,P as g,a as v}from"./index-DXmRzl_c.js";const x=[{modelId:"gpt-4o",requests:4200,inputTokens:84e5,outputTokens:21e5,costUsd:84.2},{modelId:"claude-3-5-sonnet",requests:2600,inputTokens:52e5,outputTokens:13e5,costUsd:41.6},{modelId:"gpt-4o-mini",requests:9800,inputTokens:12e6,outputTokens:3e6,costUsd:9.4},{modelId:"llama-3-70b",requests:1200,inputTokens:21e5,outputTokens:64e4,costUsd:0}],I=[{actorRef:"tenant:acme",requests:8200,totalTokens:184e5,costUsd:78.1,actorLabel:"Acme Corp"},{actorRef:"user:davi@goflip.ai",requests:3100,totalTokens:69e5,costUsd:34.2,actorLabel:"Davi de Carvalho"},{actorRef:"tenant:globex",requests:4400,totalTokens:92e5,costUsd:21.8,actorLabel:null},{actorRef:"user:ops-bot",requests:2100,totalTokens:394e4,costUsd:1.1,actorLabel:null}],S={"tenant:acme":2e7,"user:davi@goflip.ai":5e6,"tenant:globex":12e6};function b(){const a=[];for(let t=29;t>=0;t-=1){const c=new Date(Date.now()-t*864e5).toISOString().slice(0,10),n=Math.sin(t/3)*.5+1;a.push({day:c,totalTokens:Math.round(7e5*n+t*4e3),costUsd:Number((4.2*n+t*.05).toFixed(2))})}return a}const s={byModel:x,byActor:I,trend:b()},w=S,T=[{toolCallId:"tc1",toolName:"search_records",toolType:"read",status:"ok",threadId:"th1",createdAt:new Date(Date.now()-12e3).toISOString()},{toolCallId:"tc2",toolName:"delete_asset",toolType:"action",status:"forbidden",threadId:"th2",createdAt:new Date(Date.now()-9e4).toISOString()},{toolCallId:"tc3",toolName:"fetch_pricing",toolType:"read",status:"ok",threadId:"th1",createdAt:new Date(Date.now()-24e4).toISOString()},{toolCallId:"tc4",toolName:"send_email",toolType:"action",status:"failed",threadId:"th3",createdAt:new Date(Date.now()-62e4).toISOString()},{toolCallId:"tc5",toolName:"summarize_thread",toolType:"read",status:"ok",threadId:"th2",createdAt:new Date(Date.now()-12e5).toISOString()}],f=[{threadId:"th1",title:"Q3 procurement review",actorRef:"tenant:acme",messageCount:24,totalTokens:184e3,lastActivityAt:new Date(Date.now()-3e4).toISOString(),actorLabel:"Acme Corp"},{threadId:"th2",title:"Incident triage",actorRef:"user:ops-bot",messageCount:11,totalTokens:62e3,lastActivityAt:new Date(Date.now()-4e5).toISOString(),actorLabel:null},{threadId:"th3",title:"Contract summary",actorRef:"user:davi@goflip.ai",messageCount:6,totalTokens:28400,lastActivityAt:new Date(Date.now()-18e5).toISOString(),actorLabel:"Davi de Carvalho"}],D=[{threadId:"th1",title:"Q3 procurement review",actorRef:"tenant:acme",requests:24,totalTokens:184e3,costUsd:18.4,actorLabel:"Acme Corp"},{threadId:"th2",title:"Incident triage",actorRef:"user:ops-bot",requests:11,totalTokens:62e3,costUsd:6.2,actorLabel:null},{threadId:"th3",title:"Contract summary",actorRef:"user:davi@goflip.ai",requests:6,totalTokens:28400,costUsd:2.8,actorLabel:"Davi de Carvalho"}],k=[{modelId:"gpt-4o",inputPricePer1m:2.5,outputPricePer1m:10,cacheReadPricePer1m:1.25,effectiveFrom:new Date(Date.now()-5*864e5).toISOString()},{modelId:"claude-3-5-sonnet",inputPricePer1m:3,outputPricePer1m:15,cacheWritePricePer1m:3.75,cacheReadPricePer1m:.3,effectiveFrom:new Date(Date.now()-12*864e5).toISOString()},{modelId:"gpt-4o-mini",inputPricePer1m:.15,outputPricePer1m:.6,effectiveFrom:new Date(Date.now()-2*864e5).toISOString()}],y=[{id:"e1",event:"run.started",ts:Date.now()-2e3,payload:{runId:"r-9f2",agentName:"analyst"}},{id:"e2",event:"tool-call",ts:Date.now()-5e3,payload:{toolName:"search_records",toolType:"read",status:"ok"}},{id:"e3",event:"quota.exceeded",ts:Date.now()-9e3,payload:{actorId:"tenant:globex",usedTokens:124e5,limitTokens:12e6}},{id:"e4",event:"tool-call",ts:Date.now()-14e3,payload:{toolName:"delete_asset",toolType:"action",status:"forbidden"}},{id:"e5",event:"delegated",ts:Date.now()-2e4,payload:{fromAgent:"router",toAgent:"billing-agent"}},{id:"e6",event:"run.finished",ts:Date.now()-26e3,payload:{runId:"r-8a1",steps:7,inputTokens:4200,outputTokens:1100}}];function j(){return e.jsxs("div",{className:"relative min-h-full",children:[e.jsx("div",{className:"app-bg"}),e.jsxs("div",{className:"relative z-10 mx-auto max-w-[1180px] space-y-6 px-5 py-6",children:[e.jsxs("header",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-lg border border-[var(--accent)]/40 bg-[var(--accent)]/10",children:e.jsx(i,{className:"h-4 w-4 text-[var(--accent)]"})}),e.jsxs("div",{className:"leading-none",children:[e.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"AI gateway — preview"}),e.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-[var(--muted)]",children:"mock data · no backend"})]})]}),e.jsx(o,{label:"Spend & usage",children:e.jsx(u,{overview:s,topThreads:D})}),e.jsx(o,{label:"Models",children:e.jsx(m,{rows:s.byModel})}),e.jsx(o,{label:"Actors & budgets",children:e.jsx(p,{rows:s.byActor,budgets:w})}),e.jsx(o,{label:"Runs & tools",children:e.jsx(h,{toolCalls:T,threads:f})}),e.jsx(o,{label:"Pricing",children:e.jsx(g,{prices:k,loading:!1,unavailable:!1,onUpsert:async()=>{},saving:!1})}),e.jsx(o,{label:"Live",children:e.jsx(v,{events:y,connected:!0})})]})]})}function o({label:a,children:t}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"mono text-[11px] uppercase tracking-[0.2em] text-[var(--muted)]",children:a}),t]})}const r=document.getElementById("root");r&&l.createRoot(r).render(e.jsx(d.StrictMode,{children:e.jsx(j,{})}));
@@ -10,9 +10,9 @@
10
10
  rel="stylesheet"
11
11
  />
12
12
  <title>ai gateway · governance console</title>
13
- <script type="module" crossorigin src="/ai-gateway/assets/index-IlHveh9s.js"></script>
14
- <link rel="modulepreload" crossorigin href="/ai-gateway/assets/index-CVpU-HIB.js">
15
- <link rel="stylesheet" crossorigin href="/ai-gateway/assets/index-DAwWrHBV.css">
13
+ <script type="module" crossorigin src="/ai-gateway/assets/index-DPCmjbDB.js"></script>
14
+ <link rel="modulepreload" crossorigin href="/ai-gateway/assets/index-DXmRzl_c.js">
15
+ <link rel="stylesheet" crossorigin href="/ai-gateway/assets/index-BHFHKR8b.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -10,9 +10,9 @@
10
10
  rel="stylesheet"
11
11
  />
12
12
  <title>ai gateway · preview</title>
13
- <script type="module" crossorigin src="/ai-gateway/assets/preview-BsbVArrR.js"></script>
14
- <link rel="modulepreload" crossorigin href="/ai-gateway/assets/index-CVpU-HIB.js">
15
- <link rel="stylesheet" crossorigin href="/ai-gateway/assets/index-DAwWrHBV.css">
13
+ <script type="module" crossorigin src="/ai-gateway/assets/preview-BQeQWTP5.js"></script>
14
+ <link rel="modulepreload" crossorigin href="/ai-gateway/assets/index-DXmRzl_c.js">
15
+ <link rel="stylesheet" crossorigin href="/ai-gateway/assets/index-BHFHKR8b.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-agent-dashboard",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/DavideCarvalho/nestjs-agent.git",
7
+ "directory": "packages/dashboard"
8
+ },
4
9
  "description": "Embedded AI-gateway governance console (spend, models, actors/budgets, runs/tools, live feed) for nestjs-agent — bundled React SPA served by NestJS",
5
10
  "license": "MIT",
6
11
  "author": "Davide Carvalho",
@@ -32,6 +37,7 @@
32
37
  "@dudousxd/nestjs-agent-core": ">=0.1.0 <1.0.0",
33
38
  "@nestjs/common": "^10.0.0 || ^11.0.0",
34
39
  "@nestjs/core": "^10.0.0 || ^11.0.0",
40
+ "reflect-metadata": "^0.2.0",
35
41
  "rxjs": "^7.0.0"
36
42
  },
37
43
  "dependencies": {
@@ -56,7 +62,7 @@
56
62
  "typescript": "5.9.3",
57
63
  "vite": "5.4.21",
58
64
  "vitest": "2.1.9",
59
- "@dudousxd/nestjs-agent-core": "0.3.0"
65
+ "@dudousxd/nestjs-agent-core": "0.4.0"
60
66
  },
61
67
  "scripts": {
62
68
  "build": "vite build && tsup && tsc -p tsconfig.client.json",