@autter/runtime-node 1.5.0 → 1.6.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.
@@ -222,6 +222,34 @@ interface RuntimeCarrier {
222
222
  traceparent?: string;
223
223
  }
224
224
 
225
+ /**
226
+ * Breadcrumbs — the steps before an error (sink contract §1), shared by the
227
+ * Node SDK (request-scoped trail, `autter.breadcrumbs` span attribute) and
228
+ * the browser relay (re-validating what browsers send). Dependency-free.
229
+ */
230
+ type BreadcrumbType = "console" | "request" | "navigation" | "click" | "log" | "custom";
231
+ type BreadcrumbLevel = "debug" | "info" | "warning" | "error";
232
+ interface Breadcrumb {
233
+ type: BreadcrumbType;
234
+ /** ISO timestamp. */
235
+ at: string;
236
+ level?: BreadcrumbLevel;
237
+ /** At most 500 characters, scrubbed. */
238
+ message: string;
239
+ /** At most 10 keys; strings at most 200 characters, scrubbed. */
240
+ data?: Record<string, string | number | boolean | null>;
241
+ }
242
+ interface BreadcrumbInput {
243
+ /** Default "custom". */
244
+ type?: BreadcrumbType;
245
+ message: string;
246
+ level?: BreadcrumbLevel;
247
+ /** Primitive values only; at most 10 keys are kept. */
248
+ data?: Record<string, unknown>;
249
+ /** Default now. */
250
+ at?: string | number | Date;
251
+ }
252
+
225
253
  /**
226
254
  * Where runtime records go. The logger pipeline is
227
255
  * `enrich → redact/bound → sinks[]`; each sink receives the same immutable
@@ -310,4 +338,4 @@ interface MemorySink extends RuntimeSink {
310
338
  /** Keeps every record in memory — for tests (`@autter/runtime-node/testing`). */
311
339
  declare function memorySink(): MemorySink;
312
340
 
313
- export { otlpSink as A, redactAttributes as B, type CapturedException as C, redactText as D, toClientError as E, type FileSinkOptions as F, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, CODE_PATTERN as i, type ClientErrorBody as j, type ConsoleSinkOptions as k, RuntimeError as l, memorySink as m, type RuntimeErrorCatalog as n, type RuntimeErrorDefinition as o, type RuntimeErrorExtras as p, type RuntimeErrorFactory as q, type RuntimeErrorLike as r, type RuntimeErrorOptions as s, type RuntimeLogContextValue as t, type RuntimeSinkContext as u, consoleSink as v, defineRuntimeErrors as w, errorAttributes as x, fileSink as y, isRuntimeErrorLike as z };
341
+ export { errorAttributes as A, type BreadcrumbInput as B, type CapturedException as C, fileSink as D, isRuntimeErrorLike as E, type FileSinkOptions as F, otlpSink as G, redactAttributes as H, redactText as I, toClientError as J, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, type Breadcrumb as i, type BreadcrumbLevel as j, type BreadcrumbType as k, CODE_PATTERN as l, memorySink as m, type ClientErrorBody as n, type ConsoleSinkOptions as o, RuntimeError as p, type RuntimeErrorCatalog as q, type RuntimeErrorDefinition as r, type RuntimeErrorExtras as s, type RuntimeErrorFactory as t, type RuntimeErrorLike as u, type RuntimeErrorOptions as v, type RuntimeLogContextValue as w, type RuntimeSinkContext as x, consoleSink as y, defineRuntimeErrors as z };
@@ -222,6 +222,34 @@ interface RuntimeCarrier {
222
222
  traceparent?: string;
223
223
  }
224
224
 
225
+ /**
226
+ * Breadcrumbs — the steps before an error (sink contract §1), shared by the
227
+ * Node SDK (request-scoped trail, `autter.breadcrumbs` span attribute) and
228
+ * the browser relay (re-validating what browsers send). Dependency-free.
229
+ */
230
+ type BreadcrumbType = "console" | "request" | "navigation" | "click" | "log" | "custom";
231
+ type BreadcrumbLevel = "debug" | "info" | "warning" | "error";
232
+ interface Breadcrumb {
233
+ type: BreadcrumbType;
234
+ /** ISO timestamp. */
235
+ at: string;
236
+ level?: BreadcrumbLevel;
237
+ /** At most 500 characters, scrubbed. */
238
+ message: string;
239
+ /** At most 10 keys; strings at most 200 characters, scrubbed. */
240
+ data?: Record<string, string | number | boolean | null>;
241
+ }
242
+ interface BreadcrumbInput {
243
+ /** Default "custom". */
244
+ type?: BreadcrumbType;
245
+ message: string;
246
+ level?: BreadcrumbLevel;
247
+ /** Primitive values only; at most 10 keys are kept. */
248
+ data?: Record<string, unknown>;
249
+ /** Default now. */
250
+ at?: string | number | Date;
251
+ }
252
+
225
253
  /**
226
254
  * Where runtime records go. The logger pipeline is
227
255
  * `enrich → redact/bound → sinks[]`; each sink receives the same immutable
@@ -310,4 +338,4 @@ interface MemorySink extends RuntimeSink {
310
338
  /** Keeps every record in memory — for tests (`@autter/runtime-node/testing`). */
311
339
  declare function memorySink(): MemorySink;
312
340
 
313
- export { otlpSink as A, redactAttributes as B, type CapturedException as C, redactText as D, toClientError as E, type FileSinkOptions as F, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, CODE_PATTERN as i, type ClientErrorBody as j, type ConsoleSinkOptions as k, RuntimeError as l, memorySink as m, type RuntimeErrorCatalog as n, type RuntimeErrorDefinition as o, type RuntimeErrorExtras as p, type RuntimeErrorFactory as q, type RuntimeErrorLike as r, type RuntimeErrorOptions as s, type RuntimeLogContextValue as t, type RuntimeSinkContext as u, consoleSink as v, defineRuntimeErrors as w, errorAttributes as x, fileSink as y, isRuntimeErrorLike as z };
341
+ export { errorAttributes as A, type BreadcrumbInput as B, type CapturedException as C, fileSink as D, isRuntimeErrorLike as E, type FileSinkOptions as F, otlpSink as G, redactAttributes as H, redactText as I, toClientError as J, type MemorySink as M, type OtlpSinkOptions as O, type RuntimeEvent as R, type RuntimeOutcome as a, type RedactOptions as b, type Redactor$1 as c, type RuntimeLogLevel as d, type RuntimeOperationKind as e, type RuntimeSink as f, type RuntimeLogContext as g, type RuntimeCarrier as h, type Breadcrumb as i, type BreadcrumbLevel as j, type BreadcrumbType as k, CODE_PATTERN as l, memorySink as m, type ClientErrorBody as n, type ConsoleSinkOptions as o, RuntimeError as p, type RuntimeErrorCatalog as q, type RuntimeErrorDefinition as r, type RuntimeErrorExtras as s, type RuntimeErrorFactory as t, type RuntimeErrorLike as u, type RuntimeErrorOptions as v, type RuntimeLogContextValue as w, type RuntimeSinkContext as x, consoleSink as y, defineRuntimeErrors as z };
package/dist/testing.cjs CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkP4VRTFAVcjs = require('./chunk-P4VRTFAV.cjs');
6
- require('./chunk-GI47WGRR.cjs');
5
+ var _chunkUXTIMS3Gcjs = require('./chunk-UXTIMS3G.cjs');
6
+ require('./chunk-4MVWIRBI.cjs');
7
7
 
8
8
  // src/testing.ts
9
9
  function captureRuntime() {
10
- const sink = _chunkP4VRTFAVcjs.memorySink.call(void 0, );
11
- const remove = _chunkP4VRTFAVcjs.addRuntimeSink.call(void 0, sink);
10
+ const sink = _chunkUXTIMS3Gcjs.memorySink.call(void 0, );
11
+ const remove = _chunkUXTIMS3Gcjs.addRuntimeSink.call(void 0, sink);
12
12
  return {
13
13
  get events() {
14
14
  return [...sink.events];
15
15
  },
16
16
  get operations() {
17
- return sink.events.filter(_chunkP4VRTFAVcjs.isSummary);
17
+ return sink.events.filter(_chunkUXTIMS3Gcjs.isSummary);
18
18
  },
19
19
  get logs() {
20
- return sink.events.filter((event) => !_chunkP4VRTFAVcjs.isSummary.call(void 0, event));
20
+ return sink.events.filter((event) => !_chunkUXTIMS3Gcjs.isSummary.call(void 0, event));
21
21
  },
22
22
  get exceptions() {
23
23
  return [...sink.exceptions];
@@ -98,7 +98,7 @@ var OperationExpectation = class {
98
98
  }
99
99
  };
100
100
  function expectOperation(source, name) {
101
- const events = Array.isArray(source) ? source.filter(_chunkP4VRTFAVcjs.isSummary) : source.operations;
101
+ const events = Array.isArray(source) ? source.filter(_chunkUXTIMS3Gcjs.isSummary) : source.operations;
102
102
  const matches = events.filter((event2) => {
103
103
  const actual = String(_nullishCoalesce(event2.attributes["autter.operation.name"], () => ( "")));
104
104
  return typeof name === "string" ? actual === name : name.test(actual);
@@ -118,4 +118,4 @@ function expectOperation(source, name) {
118
118
 
119
119
 
120
120
 
121
- exports.captureRuntime = captureRuntime; exports.expectOperation = expectOperation; exports.memorySink = _chunkP4VRTFAVcjs.memorySink;
121
+ exports.captureRuntime = captureRuntime; exports.expectOperation = expectOperation; exports.memorySink = _chunkUXTIMS3Gcjs.memorySink;
@@ -1,5 +1,5 @@
1
- import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-RFV76lF1.cjs';
2
- export { M as MemorySink, m as memorySink } from './sinks-RFV76lF1.cjs';
1
+ import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-CPGDyfU8.cjs';
2
+ export { M as MemorySink, m as memorySink } from './sinks-CPGDyfU8.cjs';
3
3
 
4
4
  /**
5
5
  * Test helpers — `@autter/runtime-node/testing`. No ingester, no network:
package/dist/testing.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-RFV76lF1.js';
2
- export { M as MemorySink, m as memorySink } from './sinks-RFV76lF1.js';
1
+ import { R as RuntimeEvent, a as RuntimeOutcome, C as CapturedException } from './sinks-CPGDyfU8.js';
2
+ export { M as MemorySink, m as memorySink } from './sinks-CPGDyfU8.js';
3
3
 
4
4
  /**
5
5
  * Test helpers — `@autter/runtime-node/testing`. No ingester, no network:
package/dist/testing.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  addRuntimeSink,
3
3
  isSummary,
4
4
  memorySink
5
- } from "./chunk-3TJHUCZ6.js";
6
- import "./chunk-L7HWKMCZ.js";
5
+ } from "./chunk-5KISVAVB.js";
6
+ import "./chunk-HRDELHZP.js";
7
7
 
8
8
  // src/testing.ts
9
9
  function captureRuntime() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autter/runtime-node",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,6 +51,8 @@
51
51
  "@autter/runtime-core": "0.0.0",
52
52
  "@types/node": "^22.10.0",
53
53
  "express": "^4.21.2",
54
+ "fastify": "^5.12.5",
55
+ "koa": "^3.2.1",
54
56
  "tsup": "^8.3.5",
55
57
  "typescript": "^5.7.0"
56
58
  },