@runtimescope/collector 0.7.2 → 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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { SecureContextOptions } from 'node:tls';
2
2
 
3
- type EventType = 'network' | 'console' | 'session' | 'state' | 'render' | 'dom_snapshot' | 'performance' | 'database' | 'custom' | 'navigation' | 'recon_metadata' | 'recon_design_tokens' | 'recon_fonts' | 'recon_layout_tree' | 'recon_accessibility' | 'recon_computed_styles' | 'recon_element_snapshot' | 'recon_asset_inventory';
3
+ type EventType = 'network' | 'console' | 'session' | 'state' | 'render' | 'dom_snapshot' | 'performance' | 'database' | 'custom' | 'navigation' | 'ui' | 'recon_metadata' | 'recon_design_tokens' | 'recon_fonts' | 'recon_layout_tree' | 'recon_accessibility' | 'recon_computed_styles' | 'recon_element_snapshot' | 'recon_asset_inventory';
4
4
  interface BaseEvent {
5
5
  eventId: string;
6
6
  sessionId: string;
@@ -27,7 +27,7 @@ interface NetworkEvent extends BaseEvent {
27
27
  responseBody?: string;
28
28
  errorPhase?: 'error' | 'abort' | 'timeout';
29
29
  errorMessage?: string;
30
- source?: 'fetch' | 'xhr' | 'node-http' | 'node-https';
30
+ source?: 'fetch' | 'xhr' | 'node-http' | 'node-https' | 'workers';
31
31
  }
32
32
  type ConsoleLevel = 'log' | 'warn' | 'error' | 'info' | 'debug' | 'trace';
33
33
  interface ConsoleEvent extends BaseEvent {
@@ -44,12 +44,19 @@ interface BuildMeta {
44
44
  buildTime?: string;
45
45
  deployId?: string;
46
46
  }
47
+ interface UserContext {
48
+ id?: string;
49
+ email?: string;
50
+ name?: string;
51
+ [key: string]: unknown;
52
+ }
47
53
  interface SessionEvent extends BaseEvent {
48
54
  eventType: 'session';
49
55
  appName: string;
50
56
  connectedAt: number;
51
57
  sdkVersion: string;
52
58
  buildMeta?: BuildMeta;
59
+ user?: UserContext;
53
60
  }
54
61
  interface StateEvent extends BaseEvent {
55
62
  eventType: 'state';
@@ -113,7 +120,7 @@ interface PerformanceEvent extends BaseEvent {
113
120
  entries?: unknown[];
114
121
  }
115
122
  type DatabaseOperation = 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' | 'OTHER';
116
- type DatabaseSource = 'prisma' | 'drizzle' | 'knex' | 'pg' | 'mysql2' | 'better-sqlite3' | 'generic';
123
+ type DatabaseSource = 'prisma' | 'drizzle' | 'knex' | 'pg' | 'mysql2' | 'better-sqlite3' | 'd1' | 'kv' | 'r2' | 'generic';
117
124
  interface DatabaseEvent extends BaseEvent {
118
125
  eventType: 'database';
119
126
  query: string;
@@ -140,6 +147,22 @@ interface CustomEvent extends BaseEvent {
140
147
  name: string;
141
148
  properties?: Record<string, unknown>;
142
149
  }
150
+ type UIInteractionAction = 'click' | 'breadcrumb';
151
+ interface UIInteractionEvent extends BaseEvent {
152
+ eventType: 'ui';
153
+ action: UIInteractionAction;
154
+ /** CSS selector or element description */
155
+ target: string;
156
+ /** Visible text (button label, link text) */
157
+ text?: string;
158
+ /** Optional extra context */
159
+ data?: Record<string, unknown>;
160
+ }
161
+ interface UIInteractionFilter {
162
+ action?: UIInteractionAction;
163
+ sinceSeconds?: number;
164
+ sessionId?: string;
165
+ }
143
166
  interface CustomEventFilter {
144
167
  name?: string;
145
168
  sinceSeconds?: number;
@@ -466,7 +489,7 @@ interface ReconFilter {
466
489
  url?: string;
467
490
  }
468
491
  type ReconEventType = 'recon_metadata' | 'recon_design_tokens' | 'recon_fonts' | 'recon_layout_tree' | 'recon_accessibility' | 'recon_computed_styles' | 'recon_element_snapshot' | 'recon_asset_inventory';
469
- type RuntimeEvent = NetworkEvent | ConsoleEvent | SessionEvent | StateEvent | RenderEvent | DomSnapshotEvent | PerformanceEvent | DatabaseEvent | NavigationEvent | CustomEvent | ReconMetadataEvent | ReconDesignTokensEvent | ReconFontsEvent | ReconLayoutTreeEvent | ReconAccessibilityEvent | ReconComputedStylesEvent | ReconElementSnapshotEvent | ReconAssetInventoryEvent;
492
+ type RuntimeEvent = NetworkEvent | ConsoleEvent | SessionEvent | StateEvent | RenderEvent | DomSnapshotEvent | PerformanceEvent | DatabaseEvent | NavigationEvent | CustomEvent | UIInteractionEvent | ReconMetadataEvent | ReconDesignTokensEvent | ReconFontsEvent | ReconLayoutTreeEvent | ReconAccessibilityEvent | ReconComputedStylesEvent | ReconElementSnapshotEvent | ReconAssetInventoryEvent;
470
493
  interface NetworkFilter {
471
494
  sinceSeconds?: number;
472
495
  urlPattern?: string;
@@ -948,6 +971,7 @@ declare class EventStore {
948
971
  getPerformanceMetrics(filter?: PerformanceFilter): PerformanceEvent[];
949
972
  getDatabaseEvents(filter?: DatabaseFilter): DatabaseEvent[];
950
973
  getCustomEvents(filter?: CustomEventFilter): CustomEvent[];
974
+ getUIInteractions(filter?: UIInteractionFilter): UIInteractionEvent[];
951
975
  private getLatestReconEvent;
952
976
  private getReconEvents;
953
977
  getReconMetadata(filter?: ReconFilter): ReconMetadataEvent | null;
@@ -1752,4 +1776,4 @@ declare function calculateCostMicrodollars(model: string, inputTokens: number, o
1752
1776
  */
1753
1777
  declare function parseSessionJsonl(jsonlPath: string, sessionId: string, projectId: string): Promise<ParseResult>;
1754
1778
 
1755
- export { type ApiChangeRecord, type ApiContract, type ApiContractField, ApiDiscoveryEngine, type ApiEndpoint, type ApiEndpointHealth, type ApiKeyEntry, type AuthConfig, type AuthInfo, AuthManager, BUILT_IN_RULES, type BackgroundSpriteSheet, type BaseEvent, type BuildMeta, type BuildStatus, type CSSArchitecture, type CSSCustomProperty, type CapexClassification, type CapexSummary, CollectorServer, type CollectorServerOptions, type ColorToken, type CommandResponse, type ComputedStyleEntry, ConnectionManager, type ConsoleEvent, type ConsoleFilter, type ConsoleLevel, type CustomEvent, type CustomEventFilter, DataBrowser, type DatabaseConnectionConfig, type DatabaseEvent, type DatabaseFilter, type DatabaseOperation, type DatabaseSchema, type DatabaseSource, type DeployLog, type DetectedBuildTool, type DetectedFramework, type DetectedHosting, type DetectedIssue, type DetectedMetaFramework, type DetectedUILibrary, type DevProcess, type DevProcessType, type DomSnapshotEvent, type ElementSnapshotNode, type EventBatchPayload, EventStore, type EventType, type FontFaceInfo, type FontUsage, type FormFieldInfo, type GitCommit, type GitFileChange, type GitFileStatus, type GitStatus, type GlobalConfig, type GraphQLOperation, type HandshakePayload, type HeadingInfo, type HistoricalFilter, HttpServer, type HttpServerOptions, type IconFontInfo, type ImageAsset, type IndexSuggestion, InfraConnector, type InfraOverview, type InfrastructureConfig, type InlineSVGAsset, type InteractiveElementInfo, type IssueSeverity, type LandmarkInfo, type LayoutNode, type ManagedConnection, type MaskSpriteSheet, type MemoryFile, type MetricDelta, type NavigationEvent, type NetworkEvent, type NetworkFilter, type NormalizedQueryStats, type PerformanceEvent, type PerformanceFilter, type PerformanceMetricName, type PmCapexEntry, type PmNote, type PmProject, type PmSession, PmStore, type PmTask, type PortUsage, ProcessMonitor, type ProjectConfig, ProjectDiscovery, ProjectManager, type ProjectPhase, type ProjectStatus, type RateLimitConfig, type ReadOptions, type ReadResult, type ReconAccessibilityEvent, type ReconAssetInventoryEvent, type ReconComputedStylesEvent, type ReconDesignTokensEvent, type ReconElementSnapshotEvent, type ReconEventType, type ReconFilter, type ReconFontsEvent, type ReconLayoutTreeEvent, type ReconMetadataEvent, type RedactionRule, Redactor, type RedactorConfig, type RenderComponentProfile, type RenderEvent, type RenderFilter, RingBuffer, type RulesFiles, type RuntimeEvent, type RuntimeLog, type SVGSpriteSymbol, type SchemaColumn, type SchemaForeignKey, type SchemaIndex, SchemaIntrospector, type SchemaTable, type ServerCommand, type ServerMetricName, type ServiceInfo, type SessionDiffResult, type SessionEvent, type SessionInfo, type SessionInfoExtended, SessionManager, type SessionMetrics, SessionRateLimiter, type SessionSnapshot, type SessionStats, type SpacingValue, type SpriteFrame, SqliteStore, type SqliteStoreOptions, type StateEvent, type StateFilter, type TaskPriority, type TaskSource, type TaskStatus, type TechStackDetection, type TimelineFilter, type TlsConfig, type ToolResponse, type TypographyToken, type WSMessage, type WebVitalRating, type WorkType, type WriteOptions, type WriteResult, aggregateQueryStats, calculateActiveMinutes, calculateCostMicrodollars, compareSessions, detectIssues, detectN1Queries, detectOverfetching, detectSlowQueries, generateApiKey, isSqliteAvailable, loadTlsOptions, parseSessionJsonl, resolveTlsConfig, suggestIndexes };
1779
+ export { type ApiChangeRecord, type ApiContract, type ApiContractField, ApiDiscoveryEngine, type ApiEndpoint, type ApiEndpointHealth, type ApiKeyEntry, type AuthConfig, type AuthInfo, AuthManager, BUILT_IN_RULES, type BackgroundSpriteSheet, type BaseEvent, type BuildMeta, type BuildStatus, type CSSArchitecture, type CSSCustomProperty, type CapexClassification, type CapexSummary, CollectorServer, type CollectorServerOptions, type ColorToken, type CommandResponse, type ComputedStyleEntry, ConnectionManager, type ConsoleEvent, type ConsoleFilter, type ConsoleLevel, type CustomEvent, type CustomEventFilter, DataBrowser, type DatabaseConnectionConfig, type DatabaseEvent, type DatabaseFilter, type DatabaseOperation, type DatabaseSchema, type DatabaseSource, type DeployLog, type DetectedBuildTool, type DetectedFramework, type DetectedHosting, type DetectedIssue, type DetectedMetaFramework, type DetectedUILibrary, type DevProcess, type DevProcessType, type DomSnapshotEvent, type ElementSnapshotNode, type EventBatchPayload, EventStore, type EventType, type FontFaceInfo, type FontUsage, type FormFieldInfo, type GitCommit, type GitFileChange, type GitFileStatus, type GitStatus, type GlobalConfig, type GraphQLOperation, type HandshakePayload, type HeadingInfo, type HistoricalFilter, HttpServer, type HttpServerOptions, type IconFontInfo, type ImageAsset, type IndexSuggestion, InfraConnector, type InfraOverview, type InfrastructureConfig, type InlineSVGAsset, type InteractiveElementInfo, type IssueSeverity, type LandmarkInfo, type LayoutNode, type ManagedConnection, type MaskSpriteSheet, type MemoryFile, type MetricDelta, type NavigationEvent, type NetworkEvent, type NetworkFilter, type NormalizedQueryStats, type PerformanceEvent, type PerformanceFilter, type PerformanceMetricName, type PmCapexEntry, type PmNote, type PmProject, type PmSession, PmStore, type PmTask, type PortUsage, ProcessMonitor, type ProjectConfig, ProjectDiscovery, ProjectManager, type ProjectPhase, type ProjectStatus, type RateLimitConfig, type ReadOptions, type ReadResult, type ReconAccessibilityEvent, type ReconAssetInventoryEvent, type ReconComputedStylesEvent, type ReconDesignTokensEvent, type ReconElementSnapshotEvent, type ReconEventType, type ReconFilter, type ReconFontsEvent, type ReconLayoutTreeEvent, type ReconMetadataEvent, type RedactionRule, Redactor, type RedactorConfig, type RenderComponentProfile, type RenderEvent, type RenderFilter, RingBuffer, type RulesFiles, type RuntimeEvent, type RuntimeLog, type SVGSpriteSymbol, type SchemaColumn, type SchemaForeignKey, type SchemaIndex, SchemaIntrospector, type SchemaTable, type ServerCommand, type ServerMetricName, type ServiceInfo, type SessionDiffResult, type SessionEvent, type SessionInfo, type SessionInfoExtended, SessionManager, type SessionMetrics, SessionRateLimiter, type SessionSnapshot, type SessionStats, type SpacingValue, type SpriteFrame, SqliteStore, type SqliteStoreOptions, type StateEvent, type StateFilter, type TaskPriority, type TaskSource, type TaskStatus, type TechStackDetection, type TimelineFilter, type TlsConfig, type ToolResponse, type TypographyToken, type UIInteractionAction, type UIInteractionEvent, type UIInteractionFilter, type UserContext, type WSMessage, type WebVitalRating, type WorkType, type WriteOptions, type WriteResult, aggregateQueryStats, calculateActiveMinutes, calculateCostMicrodollars, compareSessions, detectIssues, detectN1Queries, detectOverfetching, detectSlowQueries, generateApiKey, isSqliteAvailable, loadTlsOptions, parseSessionJsonl, resolveTlsConfig, suggestIndexes };
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  loadTlsOptions,
21
21
  parseSessionJsonl,
22
22
  resolveTlsConfig
23
- } from "./chunk-TUFSIGGJ.js";
23
+ } from "./chunk-BKRGXAJB.js";
24
24
 
25
25
  // src/issue-detector.ts
26
26
  function detectIssues(events) {
@@ -11,7 +11,7 @@ import {
11
11
  SqliteStore,
12
12
  isSqliteAvailable,
13
13
  resolveTlsConfig
14
- } from "./chunk-TUFSIGGJ.js";
14
+ } from "./chunk-BKRGXAJB.js";
15
15
 
16
16
  // src/standalone.ts
17
17
  import { existsSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtimescope/collector",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Event collector and persistence layer for RuntimeScope",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,9 +26,11 @@
26
26
  "test:watch": "vitest"
27
27
  },
28
28
  "dependencies": {
29
- "better-sqlite3": "^11.0.0",
30
29
  "ws": "^8.16.0"
31
30
  },
31
+ "optionalDependencies": {
32
+ "better-sqlite3": "^11.0.0"
33
+ },
32
34
  "devDependencies": {
33
35
  "@types/better-sqlite3": "^7.6.8",
34
36
  "@types/ws": "^8.5.10",