@corenel/web-ui 0.7.0 → 0.8.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.
- package/dist/Composer.d.ts.map +1 -1
- package/dist/Composer.js +184 -172
- package/dist/Composer.js.map +1 -1
- package/dist/ContextBar.d.ts +1 -4
- package/dist/ContextBar.d.ts.map +1 -1
- package/dist/ContextBar.js +2 -2
- package/dist/ContextBar.js.map +1 -1
- package/dist/ContextManager.d.ts +3 -6
- package/dist/ContextManager.d.ts.map +1 -1
- package/dist/ContextManager.js +58 -10
- package/dist/ContextManager.js.map +1 -1
- package/dist/SummaryTranscript.d.ts +11 -1
- package/dist/SummaryTranscript.d.ts.map +1 -1
- package/dist/SummaryTranscript.js +47 -10
- package/dist/SummaryTranscript.js.map +1 -1
- package/dist/ToolFold.d.ts +9 -0
- package/dist/ToolFold.d.ts.map +1 -0
- package/dist/ToolFold.js +32 -0
- package/dist/ToolFold.js.map +1 -0
- package/dist/Transcript.d.ts +30 -1
- package/dist/Transcript.d.ts.map +1 -1
- package/dist/Transcript.js +132 -23
- package/dist/Transcript.js.map +1 -1
- package/dist/agentChat/AgentChat.d.ts +11 -3
- package/dist/agentChat/AgentChat.d.ts.map +1 -1
- package/dist/agentChat/AgentChat.js +171 -88
- package/dist/agentChat/AgentChat.js.map +1 -1
- package/dist/agentChat/OptionsDrawer.d.ts +0 -23
- package/dist/agentChat/OptionsDrawer.d.ts.map +1 -1
- package/dist/agentChat/OptionsDrawer.js +10 -45
- package/dist/agentChat/OptionsDrawer.js.map +1 -1
- package/dist/agentChat/PlanReview.d.ts +24 -0
- package/dist/agentChat/PlanReview.d.ts.map +1 -0
- package/dist/agentChat/PlanReview.js +103 -0
- package/dist/agentChat/PlanReview.js.map +1 -0
- package/dist/agentChat/SkillsSection.js +4 -2
- package/dist/agentChat/SkillsSection.js.map +1 -1
- package/dist/agentChat/controller.d.ts +10 -2
- package/dist/agentChat/controller.d.ts.map +1 -1
- package/dist/agentChat/controller.js.map +1 -1
- package/dist/arrivalEffect.d.ts +28 -0
- package/dist/arrivalEffect.d.ts.map +1 -0
- package/dist/arrivalEffect.js +114 -0
- package/dist/arrivalEffect.js.map +1 -0
- package/dist/commandTurn.d.ts.map +1 -1
- package/dist/commandTurn.js +3 -2
- package/dist/commandTurn.js.map +1 -1
- package/dist/fx/AsteroidsOverlay.d.ts +6 -0
- package/dist/fx/AsteroidsOverlay.d.ts.map +1 -0
- package/dist/fx/AsteroidsOverlay.js +166 -0
- package/dist/fx/AsteroidsOverlay.js.map +1 -0
- package/dist/fx/FlapRow.d.ts +8 -0
- package/dist/fx/FlapRow.d.ts.map +1 -0
- package/dist/fx/FlapRow.js +12 -0
- package/dist/fx/FlapRow.js.map +1 -0
- package/dist/fx/FxText.d.ts +11 -0
- package/dist/fx/FxText.d.ts.map +1 -0
- package/dist/fx/FxText.js +50 -0
- package/dist/fx/FxText.js.map +1 -0
- package/dist/fx/LiveAnswer.d.ts +17 -0
- package/dist/fx/LiveAnswer.d.ts.map +1 -0
- package/dist/fx/LiveAnswer.js +298 -0
- package/dist/fx/LiveAnswer.js.map +1 -0
- package/dist/fx/MatrixRain.d.ts +5 -0
- package/dist/fx/MatrixRain.d.ts.map +1 -0
- package/dist/fx/MatrixRain.js +73 -0
- package/dist/fx/MatrixRain.js.map +1 -0
- package/dist/fx/NetsplitJoin.d.ts +3 -0
- package/dist/fx/NetsplitJoin.d.ts.map +1 -0
- package/dist/fx/NetsplitJoin.js +13 -0
- package/dist/fx/NetsplitJoin.js.map +1 -0
- package/dist/fx/arrivalModes.d.ts +27 -0
- package/dist/fx/arrivalModes.d.ts.map +1 -0
- package/dist/fx/arrivalModes.js +107 -0
- package/dist/fx/arrivalModes.js.map +1 -0
- package/dist/fx/tail.d.ts +16 -0
- package/dist/fx/tail.d.ts.map +1 -0
- package/dist/fx/tail.js +54 -0
- package/dist/fx/tail.js.map +1 -0
- package/dist/fx/useReveal.d.ts +2 -0
- package/dist/fx/useReveal.d.ts.map +1 -0
- package/dist/fx/useReveal.js +59 -0
- package/dist/fx/useReveal.js.map +1 -0
- package/dist/observed.d.ts +16 -0
- package/dist/observed.d.ts.map +1 -0
- package/dist/observed.js +33 -0
- package/dist/observed.js.map +1 -0
- package/dist/toolRender.d.ts +6 -2
- package/dist/toolRender.d.ts.map +1 -1
- package/dist/toolRender.js +27 -17
- package/dist/toolRender.js.map +1 -1
- package/dist/transcriptSkin.d.ts +23 -0
- package/dist/transcriptSkin.d.ts.map +1 -0
- package/dist/transcriptSkin.js +255 -0
- package/dist/transcriptSkin.js.map +1 -0
- package/dist/transcriptSkinCss.d.ts +4 -0
- package/dist/transcriptSkinCss.d.ts.map +1 -0
- package/dist/transcriptSkinCss.js +136 -0
- package/dist/transcriptSkinCss.js.map +1 -0
- package/dist/usageSummary.d.ts +31 -0
- package/dist/usageSummary.d.ts.map +1 -0
- package/dist/usageSummary.js +39 -0
- package/dist/usageSummary.js.map +1 -0
- package/dist/verificationView.d.ts +3 -0
- package/dist/verificationView.d.ts.map +1 -0
- package/dist/verificationView.js +37 -0
- package/dist/verificationView.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const T = (skin) => `[data-tx-skin="${skin}"]`;
|
|
2
|
+
const terminal = `
|
|
3
|
+
${T('terminal')} [data-tx-part="user"]::before { content: "you ~ % "; color: #5fb3f9; }
|
|
4
|
+
${T('terminal')} [data-tx-part="assistant"] { padding-left: 2ch; border-left: 1px solid #26303b; }
|
|
5
|
+
${T('terminal')} [data-tx-part="tool-name"] { color: #7ee787; }
|
|
6
|
+
${T('terminal')} [data-tx-status="error"] { --tx-glyph-fg: #ff7b72; }
|
|
7
|
+
${T('terminal')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #ff7b72; }
|
|
8
|
+
${T('terminal')} [data-tx-part="stats"]::before { content: "-- "; }
|
|
9
|
+
`;
|
|
10
|
+
const crt = `
|
|
11
|
+
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
|
|
12
|
+
${T('crt')} { text-shadow: 0 0 4px rgba(255,170,60,0.55), 0 0 12px rgba(255,140,20,0.25); }
|
|
13
|
+
${T('crt')}::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
|
|
14
|
+
background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.28) 0 1px, transparent 1px 3px);
|
|
15
|
+
box-shadow: inset 0 0 90px rgba(0,0,0,0.85); }
|
|
16
|
+
${T('crt')} [data-tx-part="user"]::before { content: "> "; }
|
|
17
|
+
${T('crt')} [data-tx-part="tool-name"] { text-transform: uppercase; }
|
|
18
|
+
${T('crt')} [data-tx-status="error"] { --tx-glyph-fg: #ff6a3d; }
|
|
19
|
+
${T('crt')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #ff6a3d; text-shadow: 0 0 6px rgba(255,90,40,0.7); }
|
|
20
|
+
${T('crt')} [data-tx-part="turn"]:last-child [data-tx-last]::after {
|
|
21
|
+
content: ""; display: inline-block; width: 0.6em; height: 1em; margin-left: 4px; vertical-align: -2px;
|
|
22
|
+
background: #ffb347; box-shadow: 0 0 8px rgba(255,170,60,0.7); animation: tx-crt-blink 1.1s steps(1) infinite; }
|
|
23
|
+
@keyframes tx-crt-blink { 50% { opacity: 0; } }
|
|
24
|
+
@media (prefers-reduced-motion: reduce) {
|
|
25
|
+
${T('crt')} [data-tx-part="turn"]:last-child [data-tx-last]::after { animation: none; }
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const minimal = `
|
|
29
|
+
${T('minimal')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #e0776b; }
|
|
30
|
+
${T('minimal')} [data-tx-part="tool-head"]:hover [data-tx-part="tool-name"] { color: #e9e6e1; }
|
|
31
|
+
`;
|
|
32
|
+
const paper = `
|
|
33
|
+
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');
|
|
34
|
+
${T('paper')} [data-tx-part="user"] { box-shadow: inset 2px 0 0 #b9ac98; }
|
|
35
|
+
${T('paper')} [data-tx-part="tool-name"] { font-variant: small-caps; letter-spacing: 0.03em; }
|
|
36
|
+
${T('paper')} [data-tx-part="tool-group"] { border-top: 1px solid #ddd3c2; border-bottom: 1px solid #ddd3c2; padding: 4px 0; }
|
|
37
|
+
${T('paper')} [data-tx-part="tool"] { box-shadow: inset 0 1px #ddd3c2, inset 0 -1px #ddd3c2; }
|
|
38
|
+
${T('paper')} [data-tx-status="error"] { --tx-glyph-fg: #a8412f; }
|
|
39
|
+
${T('paper')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #a8412f; }
|
|
40
|
+
`;
|
|
41
|
+
const blueprint = `
|
|
42
|
+
${T('blueprint')} [data-tx-part="user"]::before { content: "REQ "; color: #7fc4ff; font-size: 11px; letter-spacing: 0.1em; }
|
|
43
|
+
${T('blueprint')} [data-tx-part="tool"] { position: relative; margin-left: 18px; }
|
|
44
|
+
${T('blueprint')} [data-tx-part="tool"]::before { content: ""; position: absolute; left: -13px; top: 13px; width: 12px; border-top: 1px solid #7fc4ff; }
|
|
45
|
+
${T('blueprint')} [data-tx-part="tool"]::after { content: ""; position: absolute; left: -13px; top: -8px; bottom: -8px; border-left: 1px solid #7fc4ff; }
|
|
46
|
+
${T('blueprint')} [data-tx-part="tool-name"] { text-transform: uppercase; letter-spacing: 0.08em; }
|
|
47
|
+
${T('blueprint')} [data-tx-part="tool-body"] { border-top: 1px dashed rgba(159,208,255,0.5); }
|
|
48
|
+
${T('blueprint')} [data-tx-status="error"] { outline: 1px dashed #ff9f7a; outline-offset: -1px; --tx-glyph-fg: #ff9f7a; }
|
|
49
|
+
${T('blueprint')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #ff9f7a; }
|
|
50
|
+
${T('blueprint')} [data-tx-part="stats"] { letter-spacing: 0.06em; }
|
|
51
|
+
`;
|
|
52
|
+
/* Nicks are generic on purpose: the same code serves both apps, so the agent
|
|
53
|
+
* is "<agent>", never a product name. Exported so the Netsplit arrival effect's
|
|
54
|
+
* join line uses the very same nick. */
|
|
55
|
+
export const IRC_AGENT_NICK = 'agent';
|
|
56
|
+
const N = IRC_AGENT_NICK;
|
|
57
|
+
const irc = `
|
|
58
|
+
${T('irc')} [data-tx-part="user"]::before { content: "<you> "; color: #79c0ff; }
|
|
59
|
+
${T('irc')} [data-tx-part="assistant"]::before { content: "<${N}> "; float: left; margin-right: 1ch; color: #d2a8ff; }
|
|
60
|
+
${T('irc')} [data-tx-part="tool-name"] { color: #e3b341; font-style: italic; }
|
|
61
|
+
${T('irc')} [data-tx-part="tool-name"]::before { content: "* ${N} ran "; }
|
|
62
|
+
${T('irc')} [data-tx-status="running"] [data-tx-part="tool-name"]::before { content: "* ${N} is running "; }
|
|
63
|
+
${T('irc')} [data-tx-status="error"] [data-tx-part="tool-name"] { color: #ff7b72; }
|
|
64
|
+
${T('irc')} [data-tx-status="error"] [data-tx-part="tool-name"]::before { content: "* ${N} failed "; }
|
|
65
|
+
${T('irc')} [data-tx-part="stats"]::before { content: "-!- "; color: #3fb950; }
|
|
66
|
+
`;
|
|
67
|
+
const handheld = `
|
|
68
|
+
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
|
|
69
|
+
${T('handheld')} [data-tx-part="assistant"] { position: relative; margin: 3px; padding: 10px 12px 16px; background: #9bbc0f;
|
|
70
|
+
box-shadow: 0 0 0 3px #0f380f, inset 0 0 0 2px #9bbc0f, inset 0 0 0 4px #306230; }
|
|
71
|
+
${T('handheld')} [data-tx-part="turn"]:last-child [data-tx-last]::after { content: ""; position: absolute; right: 10px; bottom: 5px;
|
|
72
|
+
border: 5px solid transparent; border-top: 6px solid #0f380f; border-bottom: 0; animation: tx-hh-bob 1s steps(2) infinite; }
|
|
73
|
+
@keyframes tx-hh-bob { 50% { transform: translateY(2px); } }
|
|
74
|
+
@media (prefers-reduced-motion: reduce) {
|
|
75
|
+
${T('handheld')} [data-tx-part="turn"]:last-child [data-tx-last]::after { animation: none; }
|
|
76
|
+
}
|
|
77
|
+
${T('handheld')} [data-tx-status="error"] { --tx-glyph-bg: #9bbc0f; --tx-glyph-fg: #0f380f; }
|
|
78
|
+
${T('handheld')} [data-tx-status="error"] [data-tx-part="glyph"] { box-shadow: inset 0 0 0 2px #0f380f; }
|
|
79
|
+
${T('handheld')} [data-tx-status="error"] [data-tx-part="tool-name"] { text-decoration: underline wavy; }
|
|
80
|
+
`;
|
|
81
|
+
const receipt = `
|
|
82
|
+
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');
|
|
83
|
+
${T('receipt')} [data-tx-part="list"] { max-width: 40ch; margin: 0 auto; padding: 16px 16px 26px; background: #fbfaf6;
|
|
84
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.18);
|
|
85
|
+
-webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 8px repeat-x;
|
|
86
|
+
mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 8px repeat-x; }
|
|
87
|
+
${T('receipt')} [data-tx-part="list"]::before { content: "*** RECEIPT ***"; display: block; text-align: center; font-weight: 700; }
|
|
88
|
+
${T('receipt')} [data-tx-part="turn"] + [data-tx-part="turn"] { border-top: 1px dashed #999; padding-top: 12px; }
|
|
89
|
+
${T('receipt')} [data-tx-part="stats"] { font-weight: 700; border-top: 1px dashed #999; padding-top: 4px; }
|
|
90
|
+
${T('receipt')} [data-tx-part="stats"]::before { content: "TOTAL "; }
|
|
91
|
+
${T('receipt')} [data-tx-status="error"] [data-tx-part="tool-name"] { text-decoration: line-through; }
|
|
92
|
+
`;
|
|
93
|
+
/* T+ is the agent's working time (data-tx-elapsed, Transcript.tsx), not a
|
|
94
|
+
* wall clock. */
|
|
95
|
+
const mission = `
|
|
96
|
+
${T('mission')} [data-tx-part="list"]::before { content: "\\25CF LIVE MISSION LOG"; display: block; padding-bottom: 6px; border-bottom: 1px solid #22313f;
|
|
97
|
+
color: #3ddc84; font-size: 10.5px; letter-spacing: 0.14em; }
|
|
98
|
+
${T('mission')} [data-tx-part="turn"][data-tx-elapsed]::before { content: attr(data-tx-elapsed); color: #5d7488; font-size: 10.5px; letter-spacing: 0.08em; }
|
|
99
|
+
${T('mission')} [data-tx-part="user"]::before { content: "FLIGHT "; color: #ffb454; font-size: 10.5px; letter-spacing: 0.1em; }
|
|
100
|
+
${T('mission')} [data-tx-part="assistant"]::before { content: "CAPCOM "; float: left; margin-right: 1ch; color: #6cc4ff; font-size: 10.5px; letter-spacing: 0.1em; }
|
|
101
|
+
${T('mission')} [data-tx-part="tool-name"]::before { content: "GO"; display: inline-block; margin-right: 8px; padding: 0 6px; border: 1px solid #3ddc84;
|
|
102
|
+
border-radius: 3px; color: #3ddc84; font-size: 9.5px; letter-spacing: 0.1em; line-height: 1.6; }
|
|
103
|
+
${T('mission')} [data-tx-status="running"] [data-tx-part="tool-name"]::before { content: "HOLD"; border-color: #ffb454; color: #ffb454; }
|
|
104
|
+
${T('mission')} [data-tx-status="error"] [data-tx-part="tool-name"]::before { content: "NO-GO"; border-color: #ff5d5d; color: #ff5d5d; }
|
|
105
|
+
${T('mission')} [data-tx-part="stats"] { align-self: flex-start; padding: 4px 8px; border: 1px solid #22313f; background: #0f1821; }
|
|
106
|
+
${T('mission')} [data-tx-part="stats"]::before { content: "TELEMETRY "; color: #5d7488; }
|
|
107
|
+
`;
|
|
108
|
+
const BEVEL = 'inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf';
|
|
109
|
+
const SUNKEN = 'inset 1px 1px #808080, inset -1px -1px #fff, inset 2px 2px #0a0a0a, inset -2px -2px #dfdfdf';
|
|
110
|
+
const retro = `
|
|
111
|
+
${T('retro')} [data-tx-part="list"] { counter-reset: tx-win; }
|
|
112
|
+
${T('retro')} [data-tx-part="turn"] { counter-increment: tx-win; padding: 3px 3px 8px; background: #c0c0c0; box-shadow: ${BEVEL}; }
|
|
113
|
+
${T('retro')} [data-tx-part="turn"]::before { content: "Transcript - turn " counter(tx-win); display: block; padding: 3px 6px;
|
|
114
|
+
background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font-weight: 700; font-size: 11.5px; }
|
|
115
|
+
${T('retro')} [data-tx-part="turn"] > [data-tx-part] { margin-left: 6px; margin-right: 6px; }
|
|
116
|
+
${T('retro')} [data-tx-part="user"] { box-shadow: ${SUNKEN}; }
|
|
117
|
+
${T('retro')} [data-tx-part="assistant"] { padding: 6px 8px; background: #fff; box-shadow: ${SUNKEN}; }
|
|
118
|
+
${T('retro')} [data-tx-part="stats"] { padding: 2px 6px; box-shadow: inset 1px 1px #808080, inset -1px -1px #fff; }
|
|
119
|
+
${T('retro')} [data-tx-status="error"] { padding: 3px; box-shadow: ${BEVEL}; }
|
|
120
|
+
${T('retro')} [data-tx-status="error"]::before { content: "Error"; display: block; padding: 2px 6px;
|
|
121
|
+
background: linear-gradient(90deg, #800000, #c04040); color: #fff; font-weight: 700; font-size: 11.5px; }
|
|
122
|
+
`;
|
|
123
|
+
export const SKIN_CSS = {
|
|
124
|
+
default: '',
|
|
125
|
+
terminal,
|
|
126
|
+
crt,
|
|
127
|
+
minimal,
|
|
128
|
+
paper,
|
|
129
|
+
blueprint,
|
|
130
|
+
irc,
|
|
131
|
+
handheld,
|
|
132
|
+
receipt,
|
|
133
|
+
mission,
|
|
134
|
+
retro,
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=transcriptSkinCss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcriptSkinCss.js","sourceRoot":"","sources":["../transcriptSkinCss.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,GAAG,CAAC,IAAoB,EAAU,EAAE,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAE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C7H,CAAC,CAAC,OAAO,CAAC;;EAEV,CAAC,CAAC,OAAO,CAAC;EACV,CAAC,CAAC,OAAO,CAAC,wCAAwC,MAAM;EACxD,CAAC,CAAC,OAAO,CAAC,iFAAiF,MAAM;EACjG,CAAC,CAAC,OAAO,CAAC;EACV,CAAC,CAAC,OAAO,CAAC,yDAAyD,KAAK;EACxE,CAAC,CAAC,OAAO,CAAC;;CAEX,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAmC;IACtD,OAAO,EAAE,EAAE;IACX,QAAQ;IACR,GAAG;IACH,OAAO;IACP,KAAK;IACL,SAAS;IACT,GAAG;IACH,QAAQ;IACR,OAAO;IACP,OAAO;IACP,KAAK;CACN,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ConversationTurn } from '@corenel/harness/conversation';
|
|
2
|
+
export interface UsageTotals {
|
|
3
|
+
inTok: number;
|
|
4
|
+
outTok: number;
|
|
5
|
+
/** Null when no turn measured it: unknown, not "none cached". */
|
|
6
|
+
cachedTok: number | null;
|
|
7
|
+
cost: number;
|
|
8
|
+
turns: number;
|
|
9
|
+
/** Model calls across the session; null when no turn recorded its count. */
|
|
10
|
+
calls: number | null;
|
|
11
|
+
}
|
|
12
|
+
export interface UsageRow {
|
|
13
|
+
id: string;
|
|
14
|
+
/** 1-based position among the turns that ran, so "Turn 4" means the fourth. */
|
|
15
|
+
index: number;
|
|
16
|
+
/** The turn's largest single request, or null when it was not measured. */
|
|
17
|
+
ctxTok: number | null;
|
|
18
|
+
calls: number | null;
|
|
19
|
+
inTok: number;
|
|
20
|
+
outTok: number;
|
|
21
|
+
cachedTok: number | null;
|
|
22
|
+
cost: number;
|
|
23
|
+
}
|
|
24
|
+
/** Session totals, the last `n` turns that ran (newest first), and the latest
|
|
25
|
+
* request's size -- the figure the gauge can be checked against. */
|
|
26
|
+
export declare function usageSummary(turns: readonly ConversationTurn[], n: number): {
|
|
27
|
+
session: UsageTotals;
|
|
28
|
+
recent: UsageRow[];
|
|
29
|
+
lastContext: number | null;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=usageSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usageSummary.d.ts","sourceRoot":"","sources":["../usageSummary.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;oEACoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAkCpJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Session totals, the last `n` turns that ran (newest first), and the latest
|
|
2
|
+
* request's size -- the figure the gauge can be checked against. */
|
|
3
|
+
export function usageSummary(turns, n) {
|
|
4
|
+
const ran = [];
|
|
5
|
+
for (const t of turns) {
|
|
6
|
+
if (!t.stats)
|
|
7
|
+
continue;
|
|
8
|
+
const calls = t.stats.calls ?? null;
|
|
9
|
+
ran.push({
|
|
10
|
+
id: t.id,
|
|
11
|
+
index: ran.length + 1,
|
|
12
|
+
// One call means the turn's billed `in` was its only request.
|
|
13
|
+
ctxTok: t.stats.ctxTok ?? (calls === 1 ? t.stats.inTok : null),
|
|
14
|
+
calls,
|
|
15
|
+
inTok: t.stats.inTok,
|
|
16
|
+
outTok: t.stats.outTok,
|
|
17
|
+
cachedTok: t.stats.cachedTok ?? null,
|
|
18
|
+
cost: t.stats.cost,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const sumKnown = (pick) => {
|
|
22
|
+
const known = ran.map(pick).filter((v) => v !== null);
|
|
23
|
+
return known.length ? known.reduce((a, v) => a + v, 0) : null;
|
|
24
|
+
};
|
|
25
|
+
const session = {
|
|
26
|
+
inTok: ran.reduce((a, r) => a + r.inTok, 0),
|
|
27
|
+
outTok: ran.reduce((a, r) => a + r.outTok, 0),
|
|
28
|
+
cachedTok: sumKnown((r) => r.cachedTok),
|
|
29
|
+
cost: ran.reduce((a, r) => a + r.cost, 0),
|
|
30
|
+
turns: ran.length,
|
|
31
|
+
calls: sumKnown((r) => r.calls),
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
session,
|
|
35
|
+
recent: ran.slice(-Math.max(0, n)).reverse(),
|
|
36
|
+
lastContext: ran.length ? ran[ran.length - 1].ctxTok : null,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=usageSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usageSummary.js","sourceRoot":"","sources":["../usageSummary.ts"],"names":[],"mappings":"AAuCA;oEACoE;AACpE,MAAM,UAAU,YAAY,CAAC,KAAkC,EAAE,CAAS;IACxE,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,CA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AM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7C,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACzC,KAAK,EAAE,GAAG,CAAC,MAAM;QACjB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KAChC,CAAC;IACF,OAAO;QACL,OAAO;QACP,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;QAC5C,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verificationView.d.ts","sourceRoot":"","sources":["../verificationView.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC;AAaxD,wBAAgB,mBAAmB,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,CAoBvF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* Turn verification summary — whether the "Observed: …" block under an agent
|
|
2
|
+
* turn starts collapsed (one line) or expanded (with the observed changes).
|
|
3
|
+
* A starting state only: each summary still toggles on its own. Persisted and
|
|
4
|
+
* synced across instances the same way as transcriptView.tsx. */
|
|
5
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
6
|
+
const KEY = 'prompd.web.verificationView';
|
|
7
|
+
const EVENT = 'prompd:verificationView';
|
|
8
|
+
function read() {
|
|
9
|
+
try {
|
|
10
|
+
return localStorage.getItem(KEY) === 'expanded' ? 'expanded' : 'collapsed';
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return 'collapsed';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function useVerificationView() {
|
|
17
|
+
const [view, setViewState] = useState(read);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const sync = () => setViewState(read());
|
|
20
|
+
window.addEventListener('storage', sync);
|
|
21
|
+
window.addEventListener(EVENT, sync);
|
|
22
|
+
return () => {
|
|
23
|
+
window.removeEventListener('storage', sync);
|
|
24
|
+
window.removeEventListener(EVENT, sync);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
const setView = useCallback((v) => {
|
|
28
|
+
setViewState(v);
|
|
29
|
+
try {
|
|
30
|
+
localStorage.setItem(KEY, v);
|
|
31
|
+
}
|
|
32
|
+
catch { /* storage unavailable: the choice lasts this session */ }
|
|
33
|
+
window.dispatchEvent(new CustomEvent(EVENT));
|
|
34
|
+
}, []);
|
|
35
|
+
return [view, setView];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=verificationView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verificationView.js","sourceRoot":"","sources":["../verificationView.tsx"],"names":[],"mappings":"AAAA;;;iEAGiE;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIzD,MAAM,GAAG,GAAG,6BAA6B,CAAC;AAC1C,MAAM,KAAK,GAAG,yBAAyB,CAAC;AAExC,SAAS,IAAI;IACX,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC,CAA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|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Corenel browser dock/agent UI — the presentational components (transcript, composer, rich content, tool render, context manager, etc.). The prompd app's AgentPanel/PolicyEditor compose these on top.",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@corenel/protocol": "0.
|
|
19
|
-
"@corenel/
|
|
20
|
-
"@corenel/
|
|
21
|
-
"@corenel/
|
|
18
|
+
"@corenel/protocol": "0.10.0",
|
|
19
|
+
"@corenel/harness": "0.11.0",
|
|
20
|
+
"@corenel/tools-web": "0.6.0",
|
|
21
|
+
"@corenel/ui-kit": "0.7.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.3.1",
|