@expressots/studio-agent 4.0.0-preview.1

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.
Files changed (86) hide show
  1. package/README.md +143 -0
  2. package/dist/agent.d.ts +127 -0
  3. package/dist/agent.d.ts.map +1 -0
  4. package/dist/agent.js +1031 -0
  5. package/dist/agent.js.map +1 -0
  6. package/dist/discovery/index.d.ts +2 -0
  7. package/dist/discovery/index.d.ts.map +1 -0
  8. package/dist/discovery/index.js +2 -0
  9. package/dist/discovery/index.js.map +1 -0
  10. package/dist/discovery/route-scanner.d.ts +35 -0
  11. package/dist/discovery/route-scanner.d.ts.map +1 -0
  12. package/dist/discovery/route-scanner.js +385 -0
  13. package/dist/discovery/route-scanner.js.map +1 -0
  14. package/dist/index.d.ts +15 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +15 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/instrumentation/index.d.ts +2 -0
  19. package/dist/instrumentation/index.d.ts.map +1 -0
  20. package/dist/instrumentation/index.js +2 -0
  21. package/dist/instrumentation/index.js.map +1 -0
  22. package/dist/instrumentation/tracer.d.ts +40 -0
  23. package/dist/instrumentation/tracer.d.ts.map +1 -0
  24. package/dist/instrumentation/tracer.js +190 -0
  25. package/dist/instrumentation/tracer.js.map +1 -0
  26. package/dist/introspection/container-introspector.d.ts +81 -0
  27. package/dist/introspection/container-introspector.d.ts.map +1 -0
  28. package/dist/introspection/container-introspector.js +251 -0
  29. package/dist/introspection/container-introspector.js.map +1 -0
  30. package/dist/logging/log-capture.d.ts +58 -0
  31. package/dist/logging/log-capture.d.ts.map +1 -0
  32. package/dist/logging/log-capture.js +184 -0
  33. package/dist/logging/log-capture.js.map +1 -0
  34. package/dist/recording/index.d.ts +2 -0
  35. package/dist/recording/index.d.ts.map +1 -0
  36. package/dist/recording/index.js +2 -0
  37. package/dist/recording/index.js.map +1 -0
  38. package/dist/recording/request-recorder.d.ts +43 -0
  39. package/dist/recording/request-recorder.d.ts.map +1 -0
  40. package/dist/recording/request-recorder.js +373 -0
  41. package/dist/recording/request-recorder.js.map +1 -0
  42. package/dist/security/fix-resolver.d.ts +40 -0
  43. package/dist/security/fix-resolver.d.ts.map +1 -0
  44. package/dist/security/fix-resolver.js +283 -0
  45. package/dist/security/fix-resolver.js.map +1 -0
  46. package/dist/security/fix-runner.d.ts +60 -0
  47. package/dist/security/fix-runner.d.ts.map +1 -0
  48. package/dist/security/fix-runner.js +188 -0
  49. package/dist/security/fix-runner.js.map +1 -0
  50. package/dist/security/index.d.ts +140 -0
  51. package/dist/security/index.d.ts.map +1 -0
  52. package/dist/security/index.js +460 -0
  53. package/dist/security/index.js.map +1 -0
  54. package/dist/security/lockfile-graph.d.ts +69 -0
  55. package/dist/security/lockfile-graph.d.ts.map +1 -0
  56. package/dist/security/lockfile-graph.js +245 -0
  57. package/dist/security/lockfile-graph.js.map +1 -0
  58. package/dist/security/npm-audit.d.ts +67 -0
  59. package/dist/security/npm-audit.d.ts.map +1 -0
  60. package/dist/security/npm-audit.js +320 -0
  61. package/dist/security/npm-audit.js.map +1 -0
  62. package/dist/security/osv-cache.d.ts +51 -0
  63. package/dist/security/osv-cache.d.ts.map +1 -0
  64. package/dist/security/osv-cache.js +99 -0
  65. package/dist/security/osv-cache.js.map +1 -0
  66. package/dist/security/osv-client.d.ts +47 -0
  67. package/dist/security/osv-client.d.ts.map +1 -0
  68. package/dist/security/osv-client.js +247 -0
  69. package/dist/security/osv-client.js.map +1 -0
  70. package/dist/security/posture-analyzer.d.ts +44 -0
  71. package/dist/security/posture-analyzer.d.ts.map +1 -0
  72. package/dist/security/posture-analyzer.js +397 -0
  73. package/dist/security/posture-analyzer.js.map +1 -0
  74. package/dist/security/reachability.d.ts +59 -0
  75. package/dist/security/reachability.d.ts.map +1 -0
  76. package/dist/security/reachability.js +302 -0
  77. package/dist/security/reachability.js.map +1 -0
  78. package/dist/security/score.d.ts +36 -0
  79. package/dist/security/score.d.ts.map +1 -0
  80. package/dist/security/score.js +94 -0
  81. package/dist/security/score.js.map +1 -0
  82. package/dist/types/index.d.ts +587 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/index.js +14 -0
  85. package/dist/types/index.js.map +1 -0
  86. package/package.json +75 -0
@@ -0,0 +1,587 @@
1
+ /**
2
+ * Core types for ExpressoTS Studio Agent
3
+ */
4
+ /** HTTP methods supported */
5
+ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
6
+ /** Route information discovered from the application */
7
+ export interface RouteInfo {
8
+ path: string;
9
+ method: HttpMethod;
10
+ controller: string;
11
+ controllerMethod: string;
12
+ filePath?: string;
13
+ lineNumber?: number;
14
+ middleware?: string[];
15
+ parameters?: ParameterInfo[];
16
+ }
17
+ /** Parameter information for a route */
18
+ export interface ParameterInfo {
19
+ name: string;
20
+ type: 'path' | 'query' | 'body' | 'header';
21
+ required: boolean;
22
+ dataType?: string;
23
+ }
24
+ /** Span information from OpenTelemetry */
25
+ export interface SpanInfo {
26
+ traceId: string;
27
+ spanId: string;
28
+ parentSpanId?: string;
29
+ name: string;
30
+ kind: 'SERVER' | 'CLIENT' | 'INTERNAL' | 'PRODUCER' | 'CONSUMER';
31
+ startTime: number;
32
+ endTime: number;
33
+ duration: number;
34
+ status: 'OK' | 'ERROR' | 'UNSET';
35
+ attributes: Record<string, string | number | boolean>;
36
+ events: SpanEvent[];
37
+ }
38
+ /** Event within a span */
39
+ export interface SpanEvent {
40
+ name: string;
41
+ timestamp: number;
42
+ attributes?: Record<string, string | number | boolean>;
43
+ }
44
+ /** Complete trace containing multiple spans */
45
+ export interface TraceInfo {
46
+ traceId: string;
47
+ rootSpan: SpanInfo;
48
+ spans: SpanInfo[];
49
+ startTime: number;
50
+ endTime: number;
51
+ duration: number;
52
+ }
53
+ /** Recorded HTTP request */
54
+ export interface RecordedRequest {
55
+ id: string;
56
+ traceId: string;
57
+ timestamp: number;
58
+ method: HttpMethod;
59
+ path: string;
60
+ url: string;
61
+ headers: Record<string, string>;
62
+ query: Record<string, string>;
63
+ body?: unknown;
64
+ cookies?: Record<string, string>;
65
+ }
66
+ /** Recorded HTTP response */
67
+ export interface RecordedResponse {
68
+ id: string;
69
+ requestId: string;
70
+ traceId: string;
71
+ timestamp: number;
72
+ statusCode: number;
73
+ statusMessage: string;
74
+ headers: Record<string, string>;
75
+ body?: unknown;
76
+ duration: number;
77
+ }
78
+ /** Complete request/response pair for replay */
79
+ export interface RecordedExchange {
80
+ id: string;
81
+ request: RecordedRequest;
82
+ response: RecordedResponse;
83
+ trace?: TraceInfo;
84
+ }
85
+ /** Agent configuration options */
86
+ export interface AgentConfig {
87
+ /** Port for the agent WebSocket server */
88
+ port: number;
89
+ /** Path to store SQLite database */
90
+ dbPath: string;
91
+ /** Enable request/response recording */
92
+ enableRecording: boolean;
93
+ /** Maximum number of recorded exchanges to keep */
94
+ maxRecordedExchanges: number;
95
+ /** Enable performance profiling */
96
+ enableProfiling: boolean;
97
+ /** Sample rate for tracing (0-1) */
98
+ traceSampleRate: number;
99
+ /** Custom service name */
100
+ serviceName: string;
101
+ /** Express app instance (if available) */
102
+ expressApp?: unknown;
103
+ /**
104
+ * ExpressoTS AppContainer instance (if available). When provided the agent
105
+ * will capture a DI snapshot (bindings + dependency graph) and track which
106
+ * bindings are resolved during each request.
107
+ */
108
+ appContainer?: unknown;
109
+ /**
110
+ * HTTP port the host application is listening on. Used by the Studio
111
+ * Status page to display the app URL. Optional — when omitted the
112
+ * Status page falls back to "—".
113
+ */
114
+ appPort?: number;
115
+ /**
116
+ * Global URL prefix of the host application (e.g. "/" or "/api/v1").
117
+ * Used for display purposes only.
118
+ */
119
+ globalPrefix?: string;
120
+ /**
121
+ * How long the host application took to start (ms). Reported by
122
+ * `@expressots/adapter-express` after `app.listen()` resolves.
123
+ */
124
+ startupMs?: number;
125
+ /**
126
+ * Number of registered interceptors (middleware applied via the adapter
127
+ * configuration). Reported by the adapter; falls back to scanned
128
+ * `@middleware` decorators when unavailable.
129
+ */
130
+ interceptorCount?: number;
131
+ /**
132
+ * Number of providers registered with the DI container at runtime.
133
+ * Includes framework-registered providers (e.g. lifecycle hooks),
134
+ * which static file scanning misses. Reported by the adapter via
135
+ * `MetricsCollector` so the Status page agrees with the CLI banner.
136
+ */
137
+ providerCount?: number;
138
+ /**
139
+ * Number of HTTP middleware registered in the adapter's pipeline
140
+ * (distinct from `interceptorCount`). Reported by the adapter for
141
+ * the Status page.
142
+ */
143
+ middlewareCount?: number;
144
+ /**
145
+ * Itemised runtime lists for the Status page drill-down. Class names
146
+ * harvested from DI metadata at boot, including framework items the
147
+ * static scanner can't see.
148
+ */
149
+ runtimeItems?: RuntimeItems;
150
+ }
151
+ /**
152
+ * Itemised runtime view used by the Studio Status page drill-down.
153
+ *
154
+ * Each entry is just a display name (typically `Class.name`). The UI
155
+ * cross-references against the static `AppStructure` to enrich entries
156
+ * with file paths / "Open in editor" links when a name matches.
157
+ */
158
+ export interface RuntimeItems {
159
+ /** Provider class names registered via `@provide` family decorators. */
160
+ providers?: RuntimeItem[];
161
+ /** Interceptor class names registered via `@Interceptor()`. */
162
+ interceptors?: RuntimeItem[];
163
+ }
164
+ /** A single runtime-discovered item (provider, interceptor, etc.). */
165
+ export interface RuntimeItem {
166
+ /** Display name (typically the class constructor name). */
167
+ name: string;
168
+ /**
169
+ * Optional priority — surfaced for interceptors so the dashboard can
170
+ * mirror the execution order shown in the CLI.
171
+ */
172
+ priority?: number;
173
+ /** Optional source — purely informational ("metadata", "registry", …). */
174
+ source?: string;
175
+ }
176
+ /** Default agent configuration */
177
+ export declare const defaultAgentConfig: AgentConfig;
178
+ /** WebSocket message types */
179
+ export type WSMessageType = 'routes' | 'trace' | 'request' | 'response' | 'metrics' | 'error' | 'replay_result' | 'health' | 'structure' | 'exchanges' | 'exchange' | 'stats' | 'endpoint_stats' | 'cleared' | 'runtime' | 'security' | 'security_scan_state' | 'fix_progress' | 'fix_result';
180
+ /** WebSocket message structure */
181
+ export interface WSMessage<T = unknown> {
182
+ type: WSMessageType;
183
+ timestamp: number;
184
+ data: T;
185
+ }
186
+ /** Application metrics */
187
+ export interface AppMetrics {
188
+ uptime: number;
189
+ requestCount: number;
190
+ errorCount: number;
191
+ avgResponseTime: number;
192
+ p50ResponseTime: number;
193
+ p95ResponseTime: number;
194
+ p99ResponseTime: number;
195
+ memoryUsage: NodeJS.MemoryUsage;
196
+ activeConnections: number;
197
+ }
198
+ /** Endpoint statistics */
199
+ export interface EndpointStats {
200
+ path: string;
201
+ method: HttpMethod;
202
+ requestCount: number;
203
+ errorCount: number;
204
+ avgDuration: number;
205
+ minDuration: number;
206
+ maxDuration: number;
207
+ p50Duration: number;
208
+ p95Duration: number;
209
+ p99Duration: number;
210
+ lastRequestTime: number;
211
+ /** Internal: durations array for percentile calculation (not sent to UI) */
212
+ durations?: number[];
213
+ }
214
+ /** Dependency information for architecture map */
215
+ export interface DependencyInfo {
216
+ source: string;
217
+ target: string;
218
+ type: 'controller' | 'service' | 'provider' | 'middleware' | 'repository';
219
+ }
220
+ /** Controller metadata */
221
+ export interface ControllerInfo {
222
+ name: string;
223
+ filePath: string;
224
+ routes: RouteInfo[];
225
+ dependencies: string[];
226
+ }
227
+ /** Service metadata */
228
+ export interface ServiceInfo {
229
+ name: string;
230
+ filePath: string;
231
+ dependencies: string[];
232
+ methods: string[];
233
+ }
234
+ /** Application structure for architecture visualization */
235
+ export interface AppStructure {
236
+ controllers: ControllerInfo[];
237
+ services: ServiceInfo[];
238
+ providers: ServiceInfo[];
239
+ middleware: string[];
240
+ dependencies: DependencyInfo[];
241
+ }
242
+ /**
243
+ * Runtime information about the host application + the agent itself.
244
+ *
245
+ * Surfaced on the Studio "Status" page so users get a browser-side view
246
+ * of the same information the CLI prints in its boot banner — but live
247
+ * and refreshable, instead of frozen at startup.
248
+ */
249
+ export interface RuntimeInfo {
250
+ /** Service name passed to the agent (e.g. "expressots-app"). */
251
+ serviceName: string;
252
+ /** Process id of the host app (the agent runs in-process). */
253
+ pid: number;
254
+ /** Node.js version, e.g. "v22.15.1". */
255
+ nodeVersion: string;
256
+ /** Platform string, e.g. "win32" / "linux" / "darwin". */
257
+ platform: NodeJS.Platform;
258
+ /** CPU architecture, e.g. "x64" / "arm64". */
259
+ arch: string;
260
+ /** NODE_ENV, defaulting to "development" if unset. */
261
+ env: string;
262
+ /** Port the WebSocket agent itself is listening on. */
263
+ agentPort: number;
264
+ /**
265
+ * Application HTTP port (best-effort). The agent doesn't bind the user's
266
+ * server, so this is provided via config and may be undefined.
267
+ */
268
+ appPort?: number;
269
+ /** App base URL, e.g. "http://localhost:3000" — also best-effort. */
270
+ appUrl?: string;
271
+ /**
272
+ * Global path prefix for the app, e.g. "/" or "/api/v1". Best-effort
273
+ * because we can only know it when the host passes it via config.
274
+ */
275
+ globalPrefix?: string;
276
+ /** Wall-clock timestamp of when the agent started (ms since epoch). */
277
+ startedAt: number;
278
+ /** How long the host has been up (ms). */
279
+ uptimeMs: number;
280
+ /** How long the host took to boot (ms), if the user app reports it. */
281
+ startupMs?: number;
282
+ /** Versions of the framework and adapter, when discoverable. */
283
+ versions: {
284
+ agent: string;
285
+ core?: string;
286
+ adapterExpress?: string;
287
+ };
288
+ /** Counts derived from the latest scan, for the dashboard. */
289
+ counts: {
290
+ controllers: number;
291
+ services: number;
292
+ providers: number;
293
+ routes: number;
294
+ middleware: number;
295
+ interceptors?: number;
296
+ };
297
+ /**
298
+ * Itemised runtime lists. Powers the Status page drill-down for items
299
+ * the static file scanner can't see (framework providers, container-
300
+ * resolved interceptors). When omitted, the UI falls back to the
301
+ * static `AppStructure` lists.
302
+ */
303
+ runtimeItems?: RuntimeItems;
304
+ /** Whether request/response recording is currently enabled. */
305
+ recordingEnabled: boolean;
306
+ }
307
+ /**
308
+ * Severity classes used across both supply-chain (CVE) and runtime
309
+ * posture findings. Mirrors the npm-audit / OSV / CVSS vocabulary, plus
310
+ * an `INFO` bucket for advisory-grade hints (e.g. heuristic secret
311
+ * detections) that aren't strictly vulnerabilities.
312
+ */
313
+ export type Severity = 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'INFO';
314
+ /**
315
+ * How likely is it that the vulnerable code is actually executed in the
316
+ * running app? Computed from imports in `src/`, the DI/route graph, and
317
+ * recorded HTTP exchanges. Drives risk-weighted prioritisation: a
318
+ * `confirmed` MEDIUM finding usually deserves attention before an
319
+ * `unreachable` CRITICAL one.
320
+ */
321
+ export type Reachability = 'confirmed' | 'likely' | 'unreachable' | 'unknown';
322
+ /** Why a finding got the reachability label it did, plus the evidence trail. */
323
+ export interface ReachabilityInfo {
324
+ level: Reachability;
325
+ /** Files under `src/` that import (or `require`) the vulnerable package. */
326
+ importedBy: string[];
327
+ /**
328
+ * Routes whose controller (or transitively a service it depends on)
329
+ * imports the vulnerable package. Drives the "exercised X times in
330
+ * the last Y exchanges" chip in the UI.
331
+ */
332
+ routes: {
333
+ method: string;
334
+ path: string;
335
+ }[];
336
+ /** How many recorded exchanges hit one of `routes`. */
337
+ runtimeHits: number;
338
+ /** Short human reason — feeds the tooltip on the reachability chip. */
339
+ reason: string;
340
+ }
341
+ /**
342
+ * Concrete, runnable remediation for a finding. The agent computes this
343
+ * server-side so the UI never has to assemble shell commands. Two flavours:
344
+ *
345
+ * - `install` → `npm install <pkg>@<ver>` (direct dep, exact target).
346
+ * - `audit-fix` → `npm audit fix` (npm can resolve a non-major upgrade).
347
+ * - `audit-fix-force` → `npm audit fix --force` (semver-major; warn).
348
+ * - `override` → user has to edit `package.json` `overrides` themselves.
349
+ * - `none` → no upstream fix exists yet; advisory-only.
350
+ */
351
+ export interface FixSpec {
352
+ kind: 'install' | 'audit-fix' | 'audit-fix-force' | 'override' | 'none';
353
+ /** Verbatim command the agent will run if "Apply fix" is clicked. */
354
+ command: string;
355
+ /** True when the upgrade crosses a semver-major boundary on the root. */
356
+ breaking: boolean;
357
+ /** Short button label, e.g. "Upgrade lodash 4.17.10 → 4.17.21". */
358
+ label: string;
359
+ /** Optional human note (e.g. "requires `npm audit fix --force`"). */
360
+ note?: string;
361
+ }
362
+ /**
363
+ * For transitive vulnerabilities, the *real* package the user needs to
364
+ * upgrade to fix the issue. npm audit's stock output buries this — we
365
+ * reconstruct it from the lockfile so the UI can show
366
+ * "Vulnerable lodash@4.17.10 reached via express-session → fix by
367
+ * upgrading express-session 1.17.0 → 1.17.3".
368
+ */
369
+ export interface RootCause {
370
+ /** Top-level package (direct dep) the user actually owns. */
371
+ rootPackage: string;
372
+ /** Version currently installed for the root. */
373
+ rootInstalledVersion: string;
374
+ /** Shortest path through node_modules from root → vulnerable pkg. */
375
+ chain: string[];
376
+ /** True when the vulnerable package *is* the root (direct dep). */
377
+ isDirect: boolean;
378
+ /**
379
+ * Optional version of the root that ships a fixed transitive. Set when
380
+ * npm audit / OSV can tell us; absent means user has to bump manually
381
+ * or wait for upstream.
382
+ */
383
+ rootFixedVersion?: string;
384
+ }
385
+ /**
386
+ * A single supply-chain vulnerability finding. Produced by reconciling
387
+ * `npm audit --json` output with the OSV.dev advisory database — the
388
+ * agent dedupes by `id` (CVE / GHSA) across both sources, then enriches
389
+ * each finding with a concrete `fix`, the transitive `rootCause`, and a
390
+ * runtime `reachability` assessment.
391
+ */
392
+ export interface DependencyFinding {
393
+ /** Canonical advisory id (CVE-… or GHSA-…). Stable across rescans. */
394
+ id: string;
395
+ /** npm package name. */
396
+ package: string;
397
+ /** Version currently installed in the host's lockfile. */
398
+ installedVersion: string;
399
+ /** Minimum version that includes the fix, when known. */
400
+ fixedVersion?: string;
401
+ severity: Severity;
402
+ /** CVSS v3.x base score, when published. */
403
+ cvss?: number;
404
+ title: string;
405
+ summary: string;
406
+ /** External links (advisory pages, blog posts, commits). */
407
+ references: string[];
408
+ /**
409
+ * Transitive resolution chain from a root dependency to the vulnerable
410
+ * package. First entry is the root, last entry is the vulnerable
411
+ * package itself. Empty when the agent can't resolve a path.
412
+ */
413
+ path: string[];
414
+ /**
415
+ * Concrete remediation. Always populated, even if `kind: 'none'` — UI
416
+ * can branch on `kind` instead of doing existence checks.
417
+ */
418
+ fix?: FixSpec;
419
+ /**
420
+ * Root-cause analysis for transitive vulnerabilities. Absent when the
421
+ * finding *is* a direct dependency (in which case `fix` already targets
422
+ * the right package).
423
+ */
424
+ rootCause?: RootCause;
425
+ /** Runtime reachability assessment. Studio's unique contribution. */
426
+ reachability?: ReachabilityInfo;
427
+ }
428
+ /**
429
+ * A grouping of findings that all share a single fix command.
430
+ *
431
+ * Most real-world `npm audit` reports list one upgrade resolving many
432
+ * advisories (a single lodash bump kills four CVEs). Grouping flips the
433
+ * UI from "look at every advisory" to "make this one change to fix N
434
+ * issues" — same data, dramatically less noise.
435
+ */
436
+ export interface FixGroup {
437
+ /** Stable id (hash of package@version + finding ids). */
438
+ id: string;
439
+ /** Package being upgraded (typically a direct dep / root cause). */
440
+ package: string;
441
+ /** Current installed version of that package. */
442
+ fromVersion: string;
443
+ /** Target version that fixes every finding in this group. */
444
+ toVersion: string;
445
+ /** True when this is a semver-major upgrade. */
446
+ breaking: boolean;
447
+ /** Top severity across the findings in the group. */
448
+ severity: Severity;
449
+ /** IDs of every finding this group resolves (look up in `dependencies`). */
450
+ findingIds: string[];
451
+ /** The actual fix command — same shape as `DependencyFinding.fix`. */
452
+ fix: FixSpec;
453
+ /** "confirmed" if any member finding is confirmed-reachable. */
454
+ reachability?: Reachability;
455
+ }
456
+ /**
457
+ * Where a posture finding came from. Each kind gives the UI just enough
458
+ * context to deep-link the user to the offending route / exchange / log
459
+ * / file so they can fix the issue without leaving Studio.
460
+ */
461
+ export type PostureEvidence = {
462
+ kind: 'exchange';
463
+ exchangeId: string;
464
+ } | {
465
+ kind: 'route';
466
+ method: string;
467
+ path: string;
468
+ } | {
469
+ kind: 'log';
470
+ logIndex: number;
471
+ } | {
472
+ kind: 'file';
473
+ filePath: string;
474
+ lineNumber?: number;
475
+ };
476
+ /**
477
+ * A runtime posture finding — a check that the posture analyzer
478
+ * performed over the agent's in-memory exchanges/routes/structure/logs
479
+ * and flagged as risky.
480
+ *
481
+ * Distinct from `DependencyFinding` (which is supply-chain only). The
482
+ * runtime posture is Studio's unique contribution: Snyk-style scanners
483
+ * never see the running app.
484
+ */
485
+ export interface PostureFinding {
486
+ /** Stable hash so the UI can dedupe across re-runs of the analyzer. */
487
+ id: string;
488
+ /**
489
+ * Slug identifying the check that produced this finding
490
+ * (e.g. `missing-csp`, `permissive-cors`, `verbose-error`).
491
+ */
492
+ rule: string;
493
+ /** OWASP API Security Top 10 category (e.g. `API1:2023`), when applicable. */
494
+ owasp?: string;
495
+ severity: Severity;
496
+ /** Short, user-facing one-liner. */
497
+ title: string;
498
+ /** Longer explanation — used as the body of the finding card. */
499
+ description: string;
500
+ /** Where to look to verify the finding (deep-link target). */
501
+ evidence: PostureEvidence;
502
+ /** Suggested remediation, when we can be concrete. */
503
+ fixHint?: string;
504
+ }
505
+ /**
506
+ * The whole security view, debounced and broadcast as one envelope so
507
+ * the UI can render with a single state transition. Includes both
508
+ * supply-chain CVEs and runtime posture findings, plus an aggregate
509
+ * letter grade and a `scanState` describing the current scan lifecycle.
510
+ */
511
+ export interface SecurityReport {
512
+ /** When the agent finished assembling this report (ms epoch). */
513
+ generatedAt: number;
514
+ /** Aggregate posture score. F = critical issues; A = no findings. */
515
+ score: 'A' | 'B' | 'C' | 'D' | 'F';
516
+ /** Counts by severity across both dependencies and posture. */
517
+ counts: Record<Severity, number>;
518
+ dependencies: DependencyFinding[];
519
+ posture: PostureFinding[];
520
+ /**
521
+ * Findings grouped by their shared fix command. A single upgrade can
522
+ * resolve many advisories — surfacing those groups lets users act on
523
+ * the *change*, not on every individual CVE.
524
+ */
525
+ fixGroups: FixGroup[];
526
+ /**
527
+ * Lifecycle of the on-demand scan. Use this to drive UI affordances
528
+ * (spinner, error banner) instead of inferring from finding counts.
529
+ */
530
+ scanState: {
531
+ audit: 'idle' | 'running' | 'error';
532
+ /** When the posture analyzer last produced findings. 0 = never. */
533
+ postureLastRunAt: number;
534
+ /** Short reason when `audit === 'error'`. Surfaced to the user. */
535
+ auditError?: string;
536
+ /**
537
+ * True when the host project has no `package-lock.json`, so `npm
538
+ * audit` is skipped entirely. The UI should show an empty state
539
+ * with instructions, not "no vulnerabilities".
540
+ */
541
+ missingLockfile?: boolean;
542
+ /**
543
+ * Lifecycle of the currently-running "Apply fix" job, if any. The
544
+ * agent streams `fix_progress` messages while this is `running`.
545
+ */
546
+ fix?: {
547
+ state: 'running' | 'success' | 'error';
548
+ /** The `FixGroup.id` or `DependencyFinding.id` being applied. */
549
+ targetId: string;
550
+ /** Concrete command being executed. */
551
+ command: string;
552
+ /** Short error reason when `state === 'error'`. */
553
+ error?: string;
554
+ };
555
+ };
556
+ }
557
+ /**
558
+ * Streaming line from an in-flight `apply_security_fix` job. The UI
559
+ * appends these to a terminal-style transcript so users can watch
560
+ * `npm install` progress live without leaving Studio.
561
+ */
562
+ export interface FixProgressMessage {
563
+ /** Matches the `FixGroup.id` / `DependencyFinding.id` that was clicked. */
564
+ targetId: string;
565
+ stream: 'stdout' | 'stderr';
566
+ line: string;
567
+ /** Wall-clock at which the agent observed this line. */
568
+ timestamp: number;
569
+ }
570
+ /**
571
+ * Final outcome of an `apply_security_fix` job. After this fires the
572
+ * agent always re-runs `npm audit` + OSV; the resulting `security`
573
+ * frame is the user's "did it actually work?" confirmation.
574
+ */
575
+ export interface FixResultMessage {
576
+ targetId: string;
577
+ success: boolean;
578
+ exitCode: number | null;
579
+ durationMs: number;
580
+ /** Final command that ran (echoed for the transcript footer). */
581
+ command: string;
582
+ /** Short message for the toast — "Upgrade succeeded" / "npm install failed". */
583
+ summary: string;
584
+ /** Captured stderr tail when `success === false` (truncated to 4 KB). */
585
+ errorTail?: string;
586
+ }
587
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6BAA6B;AAC7B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AM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Core types for ExpressoTS Studio Agent
3
+ */
4
+ /** Default agent configuration */
5
+ export const defaultAgentConfig = {
6
+ port: 3334,
7
+ dbPath: '.studio/studio.db',
8
+ enableRecording: true,
9
+ maxRecordedExchanges: 1000,
10
+ enableProfiling: true,
11
+ traceSampleRate: 1.0,
12
+ serviceName: 'expressots-app',
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0LH,kCAAkC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,mBAAmB;IAC3B,eAAe,EAAE,IAAI;IACrB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,GAAG;IACpB,WAAW,EAAE,gBAAgB;CAC9B,CAAC"}