clauddy 1.0.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/preload.js ADDED
@@ -0,0 +1,18 @@
1
+ const { contextBridge, ipcRenderer } = require('electron')
2
+
3
+ contextBridge.exposeInMainWorld('api', {
4
+ onUsage: (cb) => ipcRenderer.on('usage', (_e, data) => cb(data)),
5
+ onError: (cb) => ipcRenderer.on('usage-error', (_e, msg) => cb(msg)),
6
+ onConfig: (cb) => ipcRenderer.on('config', (_e, cfg) => cb(cfg)),
7
+ saveConfig: (patch) => ipcRenderer.send('save-config', patch),
8
+ resize: (w, h) => ipcRenderer.send('resize', w, h),
9
+ openUsage: () => ipcRenderer.send('open-usage'),
10
+ onRealUsage: (cb) => ipcRenderer.on('real-usage', (_e, u) => cb(u)),
11
+ onAuthState: (cb) => ipcRenderer.on('auth-state', (_e, s) => cb(s)),
12
+ onAuthResult: (cb) => ipcRenderer.on('auth-result', (_e, r) => cb(r)),
13
+ authStart: () => ipcRenderer.send('auth-start'),
14
+ authCode: (code) => ipcRenderer.send('auth-code', code),
15
+ authLogout: () => ipcRenderer.send('auth-logout'),
16
+ onDebugState: (cb) => ipcRenderer.on('debug-state', (_e, s) => cb(s)),
17
+ quit: () => ipcRenderer.send('quit'),
18
+ })
@@ -0,0 +1,162 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Claude Usage Monitor</title>
7
+ <link rel="stylesheet" href="style.css" />
8
+ </head>
9
+ <body class="state-idle">
10
+ <div id="card">
11
+ <div id="controls">
12
+ <button id="gear" title="Settings">⚙</button>
13
+ <button id="usage" title="Open Usage page">
14
+ <svg viewBox="0 0 24 24" width="9" height="9" aria-hidden="true">
15
+ <path d="M6 18 L18 6 M10 6 H18 V14" />
16
+ </svg>
17
+ </button>
18
+ <button id="min" title="Minimize / expand">
19
+ <span class="ic-min">–</span>
20
+ <svg class="ic-max" viewBox="0 0 24 24" aria-hidden="true">
21
+ <path d="M5 9V5h4 M15 5h4v4 M5 15v4h4 M19 15v4h-4" />
22
+ </svg>
23
+ </button>
24
+ <button id="close" title="Close">×</button>
25
+ </div>
26
+
27
+ <!-- Claude pixel pet -->
28
+ <div id="stage">
29
+ <svg id="scene" viewBox="0 0 216 135" preserveAspectRatio="none"></svg>
30
+ <div id="shadow"></div>
31
+ <div id="pet">
32
+ <svg id="claude" viewBox="0 0 100 90" width="86" height="77">
33
+ <g id="body"></g>
34
+ <g id="eyes"></g>
35
+ <rect id="mouth" x="38" y="54" width="24" height="10" rx="2" />
36
+ </svg>
37
+ <svg id="zzz" viewBox="0 0 44 44" width="44" height="44">
38
+ <text x="2" y="34" class="z1">Z</text>
39
+ <text x="15" y="23" class="z2">Z</text>
40
+ <text x="26" y="14" class="z3">z</text>
41
+ </svg>
42
+ <div id="flames"><i></i><i></i><i></i></div>
43
+ <div id="sweat"><i></i><i></i></div>
44
+ <div id="dropzone"></div>
45
+ </div>
46
+ </div>
47
+
48
+ <!-- shown only when collapsed -->
49
+ <div id="mini">
50
+ <div class="mini-line"><span id="mini-dot"></span><span id="mini-text">idle</span></div>
51
+ <div id="mini-pct-row"><span id="mini-pct">0%</span> <span class="lbl">session</span></div>
52
+ </div>
53
+
54
+ <!-- collapsible content -->
55
+ <div id="content">
56
+ <!-- status -->
57
+ <div id="statusline">
58
+ <span id="status-dot"></span>
59
+ <span id="status-text">idle</span>
60
+ <span class="sep">·</span>
61
+ <span id="rate">—</span>
62
+ <span class="sep live-only">·</span>
63
+ <span id="live-tag" class="live-only">live</span>
64
+ </div>
65
+
66
+ <div class="divider"></div>
67
+
68
+ <!-- session + weekly (real usage; needs login) -->
69
+ <div id="limits">
70
+ <div id="limits-meters">
71
+ <div class="meter">
72
+ <div class="meter-top"><span>current session</span><span id="session-pct">0%</span></div>
73
+ <div class="track"><div class="fill" id="session-fill"></div></div>
74
+ <div class="sub" id="session-sub">no active session</div>
75
+ </div>
76
+ <div class="meter">
77
+ <div class="meter-top"><span>weekly · all models</span><span id="week-pct">0%</span></div>
78
+ <div class="track"><div class="fill week" id="week-fill"></div></div>
79
+ <div class="sub" id="week-sub">—</div>
80
+ </div>
81
+ </div>
82
+ <button id="limits-connect">
83
+ <svg class="lc-ico" viewBox="0 0 24 24" aria-hidden="true">
84
+ <path d="M9 12h6 M8.5 8.5H6.5a3.5 3.5 0 0 0 0 7h2 M15.5 8.5h2a3.5 3.5 0 0 1 0 7h-2" />
85
+ </svg>
86
+ <span class="lc-text">
87
+ <b>Connect your account</b>
88
+ <i>to see your real usage</i>
89
+ </span>
90
+ </button>
91
+ </div>
92
+
93
+ <div class="divider"></div>
94
+
95
+ <!-- by model (7 days) -->
96
+ <div id="bymodel">
97
+ <div class="bymodel-title">by model · 7 days</div>
98
+ <div id="bymodel-list"></div>
99
+ </div>
100
+
101
+ <div class="divider"></div>
102
+
103
+ <!-- 30-day map -->
104
+ <div id="heat">
105
+ <div id="heat-row"></div>
106
+ <div id="heat-meta">
107
+ <span>30 days</span>
108
+ <span id="month-total">0</span>
109
+ </div>
110
+ </div>
111
+ </div>
112
+
113
+ <!-- settings panel -->
114
+ <div id="settings">
115
+ <div class="set-title">Settings</div>
116
+
117
+ <div id="account">
118
+ <div id="acc-disconnected">
119
+ <div class="set-hint">Connect your account to show your real usage %.</div>
120
+ <button id="acc-connect" class="acc-btn">Log in with browser</button>
121
+ <div id="acc-paste">
122
+ <div class="set-hint">After logging in, paste the code from the browser page:</div>
123
+ <input id="acc-code" type="text" placeholder="authentication code" />
124
+ <button id="acc-confirm" class="acc-btn">Connect</button>
125
+ <div id="acc-msg"></div>
126
+ </div>
127
+ </div>
128
+ <div id="acc-connected">
129
+ <span class="acc-ok">● Connected · live data</span>
130
+ <button id="acc-logout" class="acc-link">Disconnect</button>
131
+ </div>
132
+ </div>
133
+
134
+ <label class="set-check"><input id="set-alerts" type="checkbox" /> Alerts</label>
135
+ <div class="set-hint set-hint-left">macOS notifications when your session or weekly usage crosses these % thresholds.</div>
136
+ <label class="set-field">Alert thresholds (%)
137
+ <span class="set-two">
138
+ <span class="num">
139
+ <input id="set-t1" type="number" min="1" max="100" />
140
+ <span class="num-spin">
141
+ <button type="button" class="num-btn" data-for="set-t1" data-step="1">▲</button>
142
+ <button type="button" class="num-btn" data-for="set-t1" data-step="-1">▼</button>
143
+ </span>
144
+ </span>
145
+ <span class="num">
146
+ <input id="set-t2" type="number" min="1" max="100" />
147
+ <span class="num-spin">
148
+ <button type="button" class="num-btn" data-for="set-t2" data-step="1">▲</button>
149
+ <button type="button" class="num-btn" data-for="set-t2" data-step="-1">▼</button>
150
+ </span>
151
+ </span>
152
+ </span>
153
+ </label>
154
+ <div class="set-actions">
155
+ <button id="set-cancel">Cancel</button>
156
+ <button id="set-save">Save</button>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ <script src="pet.js"></script>
161
+ </body>
162
+ </html>