@debugbundle/shared-types 0.1.0-next.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.
@@ -0,0 +1,95 @@
1
+ import { z } from "zod";
2
+ export declare const EventClassValues: readonly ["incident_signal", "context_signal", "operational_signal"];
3
+ export declare const EventClassSchema: z.ZodEnum<["incident_signal", "context_signal", "operational_signal"]>;
4
+ export type EventClass = z.infer<typeof EventClassSchema>;
5
+ export declare const CapturePresetValues: readonly ["minimal", "balanced", "investigative"];
6
+ export declare const CapturePresetSchema: z.ZodEnum<["minimal", "balanced", "investigative"]>;
7
+ export type CapturePreset = z.infer<typeof CapturePresetSchema>;
8
+ export declare const CaptureLogsValues: readonly ["off", "error", "warning", "info"];
9
+ export declare const CaptureLogsSchema: z.ZodEnum<["off", "error", "warning", "info"]>;
10
+ export type CaptureLogs = z.infer<typeof CaptureLogsSchema>;
11
+ export declare const CaptureRequestEventsValues: readonly ["off", "failures_only", "filtered", "all"];
12
+ export declare const CaptureRequestEventsSchema: z.ZodEnum<["off", "failures_only", "filtered", "all"]>;
13
+ export type CaptureRequestEvents = z.infer<typeof CaptureRequestEventsSchema>;
14
+ export declare const CaptureBreadcrumbsValues: readonly ["local_only", "exception_only", "standalone"];
15
+ export declare const CaptureBreadcrumbsSchema: z.ZodEnum<["local_only", "exception_only", "standalone"]>;
16
+ export type CaptureBreadcrumbs = z.infer<typeof CaptureBreadcrumbsSchema>;
17
+ export declare const CaptureProbeEventsValues: readonly ["buffer_only", "standalone_when_activated"];
18
+ export declare const CaptureProbeEventsSchema: z.ZodEnum<["buffer_only", "standalone_when_activated"]>;
19
+ export type CaptureProbeEvents = z.infer<typeof CaptureProbeEventsSchema>;
20
+ export interface ResolvedCapturePolicy {
21
+ preset: CapturePreset;
22
+ capture_logs: CaptureLogs;
23
+ capture_request_events: CaptureRequestEvents;
24
+ capture_breadcrumbs: CaptureBreadcrumbs;
25
+ capture_probe_events: CaptureProbeEvents;
26
+ }
27
+ export declare const CapturePolicySchema: z.ZodObject<{
28
+ project_id: z.ZodString;
29
+ preset: z.ZodEnum<["minimal", "balanced", "investigative"]>;
30
+ capture_logs: z.ZodNullable<z.ZodEnum<["off", "error", "warning", "info"]>>;
31
+ capture_request_events: z.ZodNullable<z.ZodEnum<["off", "failures_only", "filtered", "all"]>>;
32
+ capture_breadcrumbs: z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>;
33
+ capture_probe_events: z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>;
34
+ updated_at: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ project_id: string;
37
+ preset: "minimal" | "balanced" | "investigative";
38
+ capture_logs: "off" | "error" | "warning" | "info" | null;
39
+ capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
40
+ capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
41
+ capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
42
+ updated_at: string;
43
+ }, {
44
+ project_id: string;
45
+ preset: "minimal" | "balanced" | "investigative";
46
+ capture_logs: "off" | "error" | "warning" | "info" | null;
47
+ capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
48
+ capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
49
+ capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
50
+ updated_at: string;
51
+ }>;
52
+ export type CapturePolicyRecord = z.infer<typeof CapturePolicySchema>;
53
+ export declare const CapturePolicyUpdateSchema: z.ZodObject<{
54
+ preset: z.ZodOptional<z.ZodEnum<["minimal", "balanced", "investigative"]>>;
55
+ capture_logs: z.ZodOptional<z.ZodNullable<z.ZodEnum<["off", "error", "warning", "info"]>>>;
56
+ capture_request_events: z.ZodOptional<z.ZodNullable<z.ZodEnum<["off", "failures_only", "filtered", "all"]>>>;
57
+ capture_breadcrumbs: z.ZodOptional<z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>>;
58
+ capture_probe_events: z.ZodOptional<z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ preset?: "minimal" | "balanced" | "investigative" | undefined;
61
+ capture_logs?: "off" | "error" | "warning" | "info" | null | undefined;
62
+ capture_request_events?: "off" | "failures_only" | "filtered" | "all" | null | undefined;
63
+ capture_breadcrumbs?: "local_only" | "exception_only" | "standalone" | null | undefined;
64
+ capture_probe_events?: "buffer_only" | "standalone_when_activated" | null | undefined;
65
+ }, {
66
+ preset?: "minimal" | "balanced" | "investigative" | undefined;
67
+ capture_logs?: "off" | "error" | "warning" | "info" | null | undefined;
68
+ capture_request_events?: "off" | "failures_only" | "filtered" | "all" | null | undefined;
69
+ capture_breadcrumbs?: "local_only" | "exception_only" | "standalone" | null | undefined;
70
+ capture_probe_events?: "buffer_only" | "standalone_when_activated" | null | undefined;
71
+ }>;
72
+ export type CapturePolicyUpdate = z.infer<typeof CapturePolicyUpdateSchema>;
73
+ export declare const PRESET_DEFAULTS: Record<CapturePreset, Omit<ResolvedCapturePolicy, "preset">>;
74
+ export declare const DEFAULT_PRESET_BY_TIER: Record<string, CapturePreset>;
75
+ /**
76
+ * Resolve a capture policy record into a fully-resolved policy.
77
+ * Override columns win over preset defaults when non-null.
78
+ */
79
+ export declare function resolvePolicy(record: CapturePolicyRecord): ResolvedCapturePolicy;
80
+ /**
81
+ * Get the default preset for a plan string. Unknown plans fall back to "minimal".
82
+ */
83
+ export declare function getDefaultPreset(plan: string | undefined): CapturePreset;
84
+ /**
85
+ * Determine whether a given event should be captured (accepted) under the
86
+ * provided resolved capture policy.
87
+ *
88
+ * Returns `true` if the event should be persisted, `false` if it must
89
+ * be rejected with `capture_policy_rejected`.
90
+ *
91
+ * Exceptions (backend_exception, frontend_exception), deploy_metadata,
92
+ * and error_suppressed are always accepted regardless of policy.
93
+ */
94
+ export declare function shouldCaptureEvent(policy: ResolvedCapturePolicy, eventType: string, payload: Record<string, unknown>): boolean;
95
+ //# sourceM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AAW,CAAC;IAC1B,sBAAsB,EAAE,oBAAoB,CAAC;IAC7C,mBAAmB,EAAE,kBAAkB,CAAC;IACxC,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAMD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAQ9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMtE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAmBxF,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAIhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,qBAAqB,CAShF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAKxE;AAqBD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAoCT"}
@@ -0,0 +1,167 @@
1
+ import { z } from "zod";
2
+ // ---------------------------------------------------------------------------
3
+ // Event Classification
4
+ // ---------------------------------------------------------------------------
5
+ export const EventClassValues = [
6
+ "incident_signal",
7
+ "context_signal",
8
+ "operational_signal",
9
+ ];
10
+ export const EventClassSchema = z.enum(EventClassValues);
11
+ // ---------------------------------------------------------------------------
12
+ // Capture Presets
13
+ // ---------------------------------------------------------------------------
14
+ export const CapturePresetValues = [
15
+ "minimal",
16
+ "balanced",
17
+ "investigative",
18
+ ];
19
+ export const CapturePresetSchema = z.enum(CapturePresetValues);
20
+ // ---------------------------------------------------------------------------
21
+ // Capture Control Enums
22
+ // ---------------------------------------------------------------------------
23
+ export const CaptureLogsValues = ["off", "error", "warning", "info"];
24
+ export const CaptureLogsSchema = z.enum(CaptureLogsValues);
25
+ export const CaptureRequestEventsValues = ["off", "failures_only", "filtered", "all"];
26
+ export const CaptureRequestEventsSchema = z.enum(CaptureRequestEventsValues);
27
+ export const CaptureBreadcrumbsValues = ["local_only", "exception_only", "standalone"];
28
+ export const CaptureBreadcrumbsSchema = z.enum(CaptureBreadcrumbsValues);
29
+ export const CaptureProbeEventsValues = ["buffer_only", "standalone_when_activated"];
30
+ export const CaptureProbeEventsSchema = z.enum(CaptureProbeEventsValues);
31
+ // ---------------------------------------------------------------------------
32
+ // Capture Policy Record (DB row — overrides are nullable)
33
+ // ---------------------------------------------------------------------------
34
+ export const CapturePolicySchema = z.object({
35
+ project_id: z.string().uuid(),
36
+ preset: CapturePresetSchema,
37
+ capture_logs: CaptureLogsSchema.nullable(),
38
+ capture_request_events: CaptureRequestEventsSchema.nullable(),
39
+ capture_breadcrumbs: CaptureBreadcrumbsSchema.nullable(),
40
+ capture_probe_events: CaptureProbeEventsSchema.nullable(),
41
+ updated_at: z.string().datetime(),
42
+ });
43
+ // ---------------------------------------------------------------------------
44
+ // Capture Policy Update Input (for PATCH)
45
+ // ---------------------------------------------------------------------------
46
+ export const CapturePolicyUpdateSchema = z.object({
47
+ preset: CapturePresetSchema.optional(),
48
+ capture_logs: CaptureLogsSchema.nullable().optional(),
49
+ capture_request_events: CaptureRequestEventsSchema.nullable().optional(),
50
+ capture_breadcrumbs: CaptureBreadcrumbsSchema.nullable().optional(),
51
+ capture_probe_events: CaptureProbeEventsSchema.nullable().optional(),
52
+ });
53
+ // ---------------------------------------------------------------------------
54
+ // Preset Defaults — canonical preset → resolved control values
55
+ // ---------------------------------------------------------------------------
56
+ export const PRESET_DEFAULTS = {
57
+ minimal: {
58
+ capture_logs: "error",
59
+ capture_request_events: "off",
60
+ capture_breadcrumbs: "local_only",
61
+ capture_probe_events: "buffer_only",
62
+ },
63
+ balanced: {
64
+ capture_logs: "warning",
65
+ capture_request_events: "failures_only",
66
+ capture_breadcrumbs: "exception_only",
67
+ capture_probe_events: "buffer_only",
68
+ },
69
+ investigative: {
70
+ capture_logs: "info",
71
+ capture_request_events: "all",
72
+ capture_breadcrumbs: "standalone",
73
+ capture_probe_events: "standalone_when_activated",
74
+ },
75
+ };
76
+ // ---------------------------------------------------------------------------
77
+ // Default preset per tier
78
+ // ---------------------------------------------------------------------------
79
+ export const DEFAULT_PRESET_BY_TIER = {
80
+ free: "minimal",
81
+ solo: "balanced",
82
+ team: "balanced",
83
+ };
84
+ /**
85
+ * Resolve a capture policy record into a fully-resolved policy.
86
+ * Override columns win over preset defaults when non-null.
87
+ */
88
+ export function resolvePolicy(record) {
89
+ const defaults = PRESET_DEFAULTS[record.preset];
90
+ return {
91
+ preset: record.preset,
92
+ capture_logs: record.capture_logs ?? defaults.capture_logs,
93
+ capture_request_events: record.capture_request_events ?? defaults.capture_request_events,
94
+ capture_breadcrumbs: record.capture_breadcrumbs ?? defaults.capture_breadcrumbs,
95
+ capture_probe_events: record.capture_probe_events ?? defaults.capture_probe_events,
96
+ };
97
+ }
98
+ /**
99
+ * Get the default preset for a plan string. Unknown plans fall back to "minimal".
100
+ */
101
+ export function getDefaultPreset(plan) {
102
+ if (plan !== undefined && plan in DEFAULT_PRESET_BY_TIER) {
103
+ return DEFAULT_PRESET_BY_TIER[plan];
104
+ }
105
+ return "minimal";
106
+ }
107
+ // ---------------------------------------------------------------------------
108
+ // Server-Side Capture Policy Enforcement (INV-16)
109
+ // ---------------------------------------------------------------------------
110
+ const LOG_LEVEL_SEVERITY = {
111
+ info: 0,
112
+ warning: 1,
113
+ error: 2,
114
+ fatal: 3,
115
+ critical: 3,
116
+ };
117
+ const CAPTURE_LOGS_THRESHOLD = {
118
+ off: null,
119
+ error: 2,
120
+ warning: 1,
121
+ info: 0,
122
+ };
123
+ /**
124
+ * Determine whether a given event should be captured (accepted) under the
125
+ * provided resolved capture policy.
126
+ *
127
+ * Returns `true` if the event should be persisted, `false` if it must
128
+ * be rejected with `capture_policy_rejected`.
129
+ *
130
+ * Exceptions (backend_exception, frontend_exception), deploy_metadata,
131
+ * and error_suppressed are always accepted regardless of policy.
132
+ */
133
+ export function shouldCaptureEvent(policy, eventType, payload) {
134
+ switch (eventType) {
135
+ // Incident signals and operational metadata — always accepted
136
+ case "backend_exception":
137
+ case "frontend_exception":
138
+ case "deploy_metadata":
139
+ case "error_suppressed":
140
+ return true;
141
+ case "log_event": {
142
+ const threshold = CAPTURE_LOGS_THRESHOLD[policy.capture_logs];
143
+ if (threshold === null)
144
+ return false; // "off"
145
+ const level = typeof payload["level"] === "string" ? payload["level"] : "";
146
+ const severity = LOG_LEVEL_SEVERITY[level] ?? 0;
147
+ return severity >= threshold;
148
+ }
149
+ case "request_event": {
150
+ if (policy.capture_request_events === "off")
151
+ return false;
152
+ if (policy.capture_request_events === "failures_only") {
153
+ const status = typeof payload["response_status"] === "number" ? payload["response_status"] : 0;
154
+ return status >= 400;
155
+ }
156
+ return true; // "filtered" | "all"
157
+ }
158
+ case "frontend_breadcrumb":
159
+ return policy.capture_breadcrumbs === "standalone";
160
+ case "probe_event":
161
+ return policy.capture_probe_events === "standalone_when_activated";
162
+ default:
163
+ // Unknown event types — accept to avoid silent drops
164
+ return true;
165
+ }
166
+ }
167
+ //# sourceMappingURL=capture-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-policy.js","sourceRoot":"","sources":["../src/capture-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,gB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