agent-hub-sdd 0.1.7 → 0.1.9

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 CHANGED
@@ -15,10 +15,10 @@ npm run app
15
15
  Pelo npm (precisa do Node 20+ no PATH):
16
16
 
17
17
  ```powershell
18
- npx --yes agent-hub-sdd@0.1.7
18
+ npx --yes agent-hub-sdd@0.1.9
19
19
  ```
20
20
 
21
- Na primeira abertura a janela diz que está compilando. O **N** no canto é o Next.js em modo dev, não o app. Sem `@0.1.7`, o Windows pode reusar cache antigo.
21
+ Na primeira abertura a janela diz que está compilando. O **N** no canto é o Next.js em modo dev, não o app. Sem `@0.1.9`, o Windows pode reusar cache antigo.
22
22
 
23
23
  Se ainda abrir a 0.1.2, ou se o npm disser `EBUSY` / `resource busy or locked`, o Next da tentativa antiga ainda está com o cache aberto. O `Stop-Process electron` não mata esse `node`:
24
24
 
@@ -27,13 +27,13 @@ Get-CimInstance Win32_Process | Where-Object {
27
27
  $_.CommandLine -and ($_.CommandLine -match 'agent-hub|_npx|next dev|43147')
28
28
  } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }
29
29
  Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx" -ErrorAction SilentlyContinue
30
- npx --yes agent-hub-sdd@0.1.7
30
+ npx --yes agent-hub-sdd@0.1.9
31
31
  ```
32
32
 
33
33
  Instalar global evita o rename do `npx` nessa pasta:
34
34
 
35
35
  ```powershell
36
- npm install -g agent-hub-sdd@0.1.7
36
+ npm install -g agent-hub-sdd@0.1.9
37
37
  agent-hub-sdd
38
38
  ```
39
39
 
@@ -76,7 +76,9 @@ O Hub não carrega skills, MCP, plugins, hooks nem regras. Quem carrega é a CLI
76
76
 
77
77
  ## Simulador
78
78
 
79
- Se a CLI pedida não estiver no `PATH`, o Hub responde no simulador e não edita o projeto.
79
+ Se a CLI pedida (`agent` / `cursor-agent` ou `claude`) não estiver no `PATH`, o Hub **cai no Simulador**: respostas fictícias com prefixo `[mock]`, custo zero, disco intocado. A faixa âmbar e o selo **Simulador · Cursor** (ou Claude) deixam isso explícito — o hub não finge que a CLI está viva.
80
+
81
+ Com a CLI da assinatura no PATH e login feito (`agent login` ou `claude auth login`), os turnos passam a ser reais. O Hub nunca envia chave de API.
80
82
 
81
83
  ## Dados
82
84
 
package/electron/main.mjs CHANGED
@@ -188,7 +188,7 @@ function createWindow() {
188
188
  preload: path.join(here, "preload.cjs"),
189
189
  contextIsolation: true,
190
190
  nodeIntegration: false,
191
- sandbox: true,
191
+ sandbox: false,
192
192
  },
193
193
  });
194
194
  win.once("ready-to-show", () => win.show());
@@ -207,6 +207,13 @@ function createWindow() {
207
207
  void shell.openExternal(url);
208
208
  return { action: "deny" };
209
209
  });
210
+ const paint = () => {
211
+ const cssFile = path.join(hubDir(), "src", "app", "shell.css");
212
+ if (!fs.existsSync(cssFile)) return;
213
+ void win.webContents.insertCSS(fs.readFileSync(cssFile, "utf8"));
214
+ };
215
+ win.webContents.on("did-finish-load", paint);
216
+ win.webContents.on("did-navigate", paint);
210
217
  }
211
218
 
212
219
  ipcMain.handle("pick-folder", async () => {
@@ -21,7 +21,7 @@ describe("stageHub", () => {
21
21
  temps.push(root);
22
22
  const pkg = path.join(root, "node_modules", "agent-hub-sdd");
23
23
  fs.mkdirSync(path.join(pkg, "src", "components"), { recursive: true });
24
- fs.writeFileSync(path.join(pkg, "package.json"), JSON.stringify({ name: "agent-hub-sdd", version: "0.1.7" }));
24
+ fs.writeFileSync(path.join(pkg, "package.json"), JSON.stringify({ name: "agent-hub-sdd", version: "0.1.8" }));
25
25
  fs.writeFileSync(path.join(pkg, "postcss.config.mjs"), "export default { plugins: {} };\n");
26
26
  fs.writeFileSync(path.join(pkg, "src", "components", "desktop-chrome.tsx"), "export const DesktopChrome = () => null;\n");
27
27
  fs.writeFileSync(path.join(root, "node_modules", "sentinel"), "ok");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-hub-sdd",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Agent Hub",
@@ -8,4 +8,4 @@ Get-CimInstance Win32_Process |
8
8
  Stop-Process -Name electron -Force
9
9
  $npx = Join-Path $env:LOCALAPPDATA "npm-cache\_npx"
10
10
  if (Test-Path $npx) { Remove-Item -Recurse -Force $npx }
11
- Write-Host "Cache do npx limpo. Rode: npx --yes agent-hub-sdd@0.1.7"
11
+ Write-Host "Cache do npx limpo. Rode: npx --yes agent-hub-sdd@0.1.9"
@@ -7,5 +7,9 @@ export const dynamic = "force-dynamic";
7
7
 
8
8
  export default function GastosPage() {
9
9
  const events = listUsage();
10
- return <SpendView events={events} agents={listAgents()} summary={aggregateSpend(events)} />;
10
+ return (
11
+ <div className="min-h-0 flex-1 overflow-auto">
12
+ <SpendView events={events} agents={listAgents()} summary={aggregateSpend(events)} />
13
+ </div>
14
+ );
11
15
  }
@@ -1,9 +1,12 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
1
3
  import type { Metadata } from "next";
2
4
  import { DesktopChrome } from "@/components/desktop-chrome";
3
5
  import { TooltipProvider } from "@/components/ui/tooltip";
4
- import "./fallback.css";
5
6
  import "./globals.css";
6
7
 
8
+ const SHELL_CSS = fs.readFileSync(path.join(process.cwd(), "src/app/shell.css"), "utf8");
9
+
7
10
  export const metadata: Metadata = {
8
11
  title: "Agent Hub",
9
12
  description: "Harness visual local para agentes do SDLC",
@@ -13,6 +16,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
13
16
  return (
14
17
  <html lang="pt-BR" className="dark h-full antialiased">
15
18
  <body className="flex min-h-dvh flex-col bg-black text-zinc-100">
19
+ <style id="agent-hub-shell" dangerouslySetInnerHTML={{ __html: SHELL_CSS }} />
16
20
  <TooltipProvider>
17
21
  <DesktopChrome />
18
22
  {children}
@@ -0,0 +1,418 @@
1
+ html, body {
2
+ margin: 0;
3
+ min-height: 100%;
4
+ background: #09090b;
5
+ color: #f4f4f5;
6
+ font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
7
+ }
8
+ a { color: inherit; text-decoration: none; }
9
+ button, input, textarea { font: inherit; color: inherit; }
10
+ button {
11
+ cursor: pointer;
12
+ background: #18181b;
13
+ border: 1px solid #3f3f46;
14
+ border-radius: 0.5rem;
15
+ padding: 0.35rem 0.7rem;
16
+ }
17
+ input, textarea {
18
+ background: #18181b;
19
+ border: 1px solid #3f3f46;
20
+ border-radius: 0.5rem;
21
+ padding: 0.4rem 0.6rem;
22
+ }
23
+ .flex { display: flex; }
24
+ .flex-col { flex-direction: column; }
25
+ .flex-1 { flex: 1 1 0%; }
26
+ .flex-wrap { flex-wrap: wrap; }
27
+ .items-center { align-items: center; }
28
+ .justify-center { justify-content: center; }
29
+ .justify-between { justify-content: space-between; }
30
+ .min-h-0 { min-height: 0; }
31
+ .min-h-dvh { min-height: 100dvh; }
32
+ .min-w-0 { min-width: 0; }
33
+ .h-full { height: 100%; }
34
+ .h-dvh { height: 100dvh; }
35
+ .h-9 { height: 2.25rem; }
36
+ .w-full { width: 100%; }
37
+ .w-\[280px\] { width: 280px; }
38
+ .w-\[300px\] { width: 300px; }
39
+ .max-w-md { max-width: 28rem; }
40
+ .max-w-\[280px\] { max-width: 280px; }
41
+ .max-w-\[300px\] { max-width: 300px; }
42
+ .shrink-0 { flex-shrink: 0; }
43
+ .gap-1 { gap: 0.25rem; }
44
+ .gap-1\.5 { gap: 0.375rem; }
45
+ .gap-2 { gap: 0.5rem; }
46
+ .gap-3 { gap: 0.75rem; }
47
+ .overflow-hidden { overflow: hidden; }
48
+ .overflow-auto { overflow: auto; }
49
+ .grid { display: grid; }
50
+ .hidden { display: none; }
51
+ .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
52
+ .border { border: 1px solid #27272a; }
53
+ .border-r { border-right: 1px solid #27272a; }
54
+ .border-b { border-bottom: 1px solid #27272a; }
55
+ .border-t { border-top: 1px solid #27272a; }
56
+ .border-zinc-800 { border-color: #27272a; }
57
+ .bg-black { background: #09090b; }
58
+ .bg-zinc-950 { background: #09090b; }
59
+ .bg-zinc-900 { background: #18181b; }
60
+ .bg-zinc-800 { background: #27272a; }
61
+ .text-zinc-50 { color: #fafafa; }
62
+ .text-zinc-100 { color: #f4f4f5; }
63
+ .text-zinc-200 { color: #e4e4e7; }
64
+ .text-zinc-300 { color: #d4d4d8; }
65
+ .text-zinc-400 { color: #a1a1aa; }
66
+ .text-zinc-500 { color: #71717a; }
67
+ .text-sm { font-size: 0.875rem; }
68
+ .text-xs { font-size: 0.75rem; }
69
+ .text-lg { font-size: 1.125rem; }
70
+ .font-medium { font-weight: 500; }
71
+ .font-semibold { font-weight: 600; }
72
+ .p-2 { padding: 0.5rem; }
73
+ .p-3 { padding: 0.75rem; }
74
+ .p-4 { padding: 1rem; }
75
+ .p-6 { padding: 1.5rem; }
76
+ .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
77
+ .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
78
+ .px-4 { padding-left: 1rem; padding-right: 1rem; }
79
+ .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
80
+ .py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
81
+ .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
82
+ .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
83
+ .pr-8 { padding-right: 2rem; }
84
+ .ml-auto { margin-left: auto; }
85
+ .mb-1 { margin-bottom: 0.25rem; }
86
+ .size-3 { width: 0.75rem; height: 0.75rem; }
87
+ .size-3\.5 { width: 0.875rem; height: 0.875rem; }
88
+ .rounded-md { border-radius: 0.375rem; }
89
+ .rounded-lg { border-radius: 0.5rem; }
90
+ .rounded-2xl { border-radius: 1rem; }
91
+ .rounded-full { border-radius: 9999px; }
92
+ .leading-6 { line-height: 1.5rem; }
93
+ .text-center { text-align: center; }
94
+ .text-left { text-align: left; }
95
+ .size-2 { width: 0.5rem; height: 0.5rem; }
96
+ .ah-drag { -webkit-app-region: drag; app-region: drag; }
97
+ .ah-no-drag { -webkit-app-region: no-drag; app-region: no-drag; }
98
+
99
+ .hub-sidebar {
100
+ background: #0a0a0a;
101
+ border-right: 1px solid #27272a;
102
+ }
103
+ .hub-brand {
104
+ display: flex;
105
+ align-items: center;
106
+ gap: 0.5rem;
107
+ font-size: 0.95rem;
108
+ font-weight: 650;
109
+ letter-spacing: -0.03em;
110
+ }
111
+ .hub-mark {
112
+ width: 0.7rem;
113
+ height: 0.7rem;
114
+ border-radius: 0.2rem;
115
+ background: #f4f4f5;
116
+ box-shadow: 3px 3px 0 0 #52525b;
117
+ }
118
+ .hub-status {
119
+ border-radius: 0.6rem;
120
+ padding: 0.55rem 0.7rem;
121
+ font-size: 0.75rem;
122
+ line-height: 1.45;
123
+ }
124
+ .hub-status-mock {
125
+ background: rgba(245, 158, 11, 0.12);
126
+ color: #fde68a;
127
+ border: 1px solid rgba(245, 158, 11, 0.35);
128
+ }
129
+ .hub-status-live {
130
+ background: rgba(16, 185, 129, 0.1);
131
+ color: #a7f3d0;
132
+ border: 1px solid rgba(16, 185, 129, 0.28);
133
+ }
134
+ .hub-chip {
135
+ display: inline-flex;
136
+ align-items: center;
137
+ border-radius: 999px;
138
+ border: 1px solid #3f3f46;
139
+ padding: 0.1rem 0.5rem;
140
+ font-size: 0.7rem;
141
+ color: #a1a1aa;
142
+ }
143
+ .hub-chip-on {
144
+ border-color: rgba(16, 185, 129, 0.4);
145
+ background: rgba(16, 185, 129, 0.12);
146
+ color: #6ee7b7;
147
+ }
148
+ .hub-chip-off {
149
+ color: #71717a;
150
+ }
151
+ .hub-chip-mock {
152
+ border-color: rgba(245, 158, 11, 0.45);
153
+ background: rgba(245, 158, 11, 0.12);
154
+ color: #fde68a;
155
+ }
156
+ .hub-agent {
157
+ border: 1px solid #27272a;
158
+ border-radius: 0.7rem;
159
+ margin-bottom: 0.5rem;
160
+ background: #0c0c0e;
161
+ overflow: hidden;
162
+ }
163
+ .hub-agent-title {
164
+ display: flex;
165
+ min-width: 0;
166
+ flex: 1;
167
+ align-items: center;
168
+ gap: 0.5rem;
169
+ }
170
+ .hub-dot {
171
+ width: 0.5rem;
172
+ height: 0.5rem;
173
+ border-radius: 999px;
174
+ flex-shrink: 0;
175
+ }
176
+ .hub-stage {
177
+ margin-left: auto;
178
+ font-size: 0.65rem;
179
+ color: #a1a1aa;
180
+ background: #18181b;
181
+ border: 1px solid #27272a;
182
+ border-radius: 999px;
183
+ padding: 0.1rem 0.45rem;
184
+ flex-shrink: 0;
185
+ }
186
+ .hub-home {
187
+ width: 100%;
188
+ max-width: 36rem;
189
+ display: grid;
190
+ gap: 1rem;
191
+ }
192
+ .hub-home h1 {
193
+ margin: 0;
194
+ font-size: 1.25rem;
195
+ font-weight: 600;
196
+ letter-spacing: -0.03em;
197
+ }
198
+ .hub-card-grid {
199
+ display: grid;
200
+ gap: 0.6rem;
201
+ grid-template-columns: 1fr;
202
+ }
203
+ .hub-card {
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 0.25rem;
207
+ width: 100%;
208
+ text-align: left;
209
+ background: #111113;
210
+ border: 1px solid #27272a;
211
+ border-radius: 0.75rem;
212
+ padding: 0.8rem 0.9rem;
213
+ }
214
+ .hub-card:hover {
215
+ border-color: #3f3f46;
216
+ background: #18181b;
217
+ }
218
+ .hub-banner-mock {
219
+ border-bottom: 1px solid rgba(245, 158, 11, 0.3);
220
+ background: rgba(245, 158, 11, 0.1);
221
+ color: #fde68a;
222
+ padding: 0.6rem 1rem;
223
+ font-size: 0.85rem;
224
+ line-height: 1.45;
225
+ }
226
+ .hub-kicker {
227
+ margin: 0;
228
+ font-size: 0.68rem;
229
+ font-weight: 600;
230
+ letter-spacing: 0.14em;
231
+ text-transform: uppercase;
232
+ color: #71717a;
233
+ }
234
+ .hub-card-row {
235
+ display: flex;
236
+ align-items: center;
237
+ gap: 0.5rem;
238
+ }
239
+ .hub-card-copy {
240
+ color: #a1a1aa;
241
+ font-size: 0.75rem;
242
+ line-height: 1.45;
243
+ }
244
+ .hub-topbar {
245
+ display: flex;
246
+ flex-wrap: wrap;
247
+ align-items: center;
248
+ gap: 0.5rem;
249
+ border-bottom: 1px solid #27272a;
250
+ padding: 0.7rem 1rem;
251
+ background: #0c0c0e;
252
+ }
253
+ .hub-composer {
254
+ display: flex;
255
+ align-items: flex-end;
256
+ gap: 0.5rem;
257
+ margin: 0.75rem;
258
+ padding: 0.55rem 0.6rem;
259
+ border: 1px solid #27272a;
260
+ border-radius: 1rem;
261
+ background: #111113;
262
+ }
263
+ .hub-msg {
264
+ max-width: 85%;
265
+ border-radius: 1rem;
266
+ padding: 0.55rem 0.85rem;
267
+ font-size: 0.875rem;
268
+ line-height: 1.5rem;
269
+ }
270
+ .hub-msg-user {
271
+ margin-left: auto;
272
+ background: #27272a;
273
+ color: #fafafa;
274
+ }
275
+ .hub-msg-agent {
276
+ margin-right: auto;
277
+ background: #18181b;
278
+ color: #f4f4f5;
279
+ border: 1px solid #27272a;
280
+ }
281
+ .hub-msg-tool {
282
+ margin-right: auto;
283
+ max-width: 90%;
284
+ border-radius: 0.5rem;
285
+ border: 1px solid #27272a;
286
+ background: #09090b;
287
+ padding: 0.3rem 0.55rem;
288
+ font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
289
+ font-size: 11px;
290
+ line-height: 1.25rem;
291
+ color: #a1a1aa;
292
+ }
293
+ .hub-msg-handoff {
294
+ margin-right: auto;
295
+ border-radius: 0;
296
+ border-left: 2px solid #fbbf24;
297
+ background: #18181b;
298
+ color: #f4f4f5;
299
+ }
300
+ .hub-msg-error {
301
+ margin-right: auto;
302
+ border: 1px solid rgba(239, 68, 68, 0.4);
303
+ background: rgba(239, 68, 68, 0.1);
304
+ color: #fecaca;
305
+ }
306
+ .hub-empty-chat {
307
+ max-width: 32rem;
308
+ margin: 1.5rem auto 0.5rem;
309
+ display: grid;
310
+ gap: 0.4rem;
311
+ text-align: center;
312
+ color: #a1a1aa;
313
+ font-size: 0.875rem;
314
+ line-height: 1.5rem;
315
+ }
316
+ .hub-empty-chat h2 {
317
+ margin: 0;
318
+ font-size: 1.15rem;
319
+ font-weight: 600;
320
+ color: #fafafa;
321
+ letter-spacing: -0.03em;
322
+ }
323
+ .hub-session {
324
+ display: flex;
325
+ align-items: center;
326
+ gap: 0.4rem;
327
+ width: 100%;
328
+ overflow: hidden;
329
+ text-align: left;
330
+ border: 0;
331
+ background: transparent;
332
+ border-radius: 0.5rem;
333
+ padding: 0.4rem 0.5rem;
334
+ font-size: 0.75rem;
335
+ color: #d4d4d8;
336
+ }
337
+ .hub-session:hover { background: #18181b; }
338
+ .hub-session-active {
339
+ background: #27272a;
340
+ color: #fafafa;
341
+ }
342
+ .hub-session-tag {
343
+ margin-left: auto;
344
+ flex-shrink: 0;
345
+ font-size: 0.62rem;
346
+ color: #6ee7b7;
347
+ }
348
+ .hub-session-tag-err { color: #fca5a5; }
349
+ .hub-quiet-btn {
350
+ display: inline-flex;
351
+ align-items: center;
352
+ gap: 0.3rem;
353
+ border: 0;
354
+ background: transparent;
355
+ padding: 0;
356
+ font-size: 0.75rem;
357
+ color: #a1a1aa;
358
+ }
359
+ .hub-quiet-btn:hover { color: #e4e4e7; }
360
+ .hub-footer-link {
361
+ display: flex;
362
+ align-items: center;
363
+ gap: 0.45rem;
364
+ flex-shrink: 0;
365
+ padding: 0.85rem 1rem;
366
+ font-size: 0.875rem;
367
+ color: #a1a1aa;
368
+ }
369
+ .hub-footer-link:hover { color: #f4f4f5; }
370
+ .hub-spend {
371
+ width: 100%;
372
+ max-width: 56rem;
373
+ margin: 0 auto;
374
+ display: flex;
375
+ flex-direction: column;
376
+ flex: 1;
377
+ gap: 1.5rem;
378
+ padding: 1.5rem;
379
+ }
380
+ .hub-spend h1 {
381
+ margin: 0;
382
+ font-size: 1.25rem;
383
+ font-weight: 600;
384
+ letter-spacing: -0.03em;
385
+ }
386
+ .hub-stat-grid {
387
+ display: grid;
388
+ gap: 0.75rem;
389
+ grid-template-columns: 1fr;
390
+ }
391
+ .hub-stat {
392
+ border: 1px solid #27272a;
393
+ border-radius: 0.85rem;
394
+ padding: 0.9rem 1rem;
395
+ background: #111113;
396
+ }
397
+ .hub-stat p {
398
+ margin: 0;
399
+ font-size: 0.75rem;
400
+ color: #a1a1aa;
401
+ }
402
+ .hub-stat strong {
403
+ display: block;
404
+ margin-top: 0.35rem;
405
+ font-size: 1.15rem;
406
+ font-weight: 600;
407
+ }
408
+ .hub-table-wrap { overflow-x: auto; }
409
+ @media (min-width: 640px) {
410
+ .hub-stat-grid { grid-template-columns: 1fr 1fr 1fr; }
411
+ }
412
+ @media (min-width: 700px) {
413
+ .hub-card-grid { grid-template-columns: 1fr 1fr; }
414
+ }
415
+ @media (min-width: 768px) {
416
+ .md\:block { display: block; }
417
+ .md\:hidden { display: none; }
418
+ }
@@ -81,7 +81,7 @@ export function AgentDialog({
81
81
  <DialogHeader>
82
82
  <DialogTitle>{agent ? "Editar agente" : "Novo agente"}</DialogTitle>
83
83
  <DialogDescription>
84
- Nome, etapa e harness definem como esta persona atua no workspace.
84
+ Nome, etapa e harness definem como esta persona atua no workspace. Simulador não chama CLI e não edita o disco.
85
85
  </DialogDescription>
86
86
  </DialogHeader>
87
87
  <form