@autter/runtime-node 1.3.4 → 1.4.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/README.md +8 -1
- package/dist/index.cjs +515 -107
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +481 -78
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -70,6 +70,42 @@ interface RedactOptions {
|
|
|
70
70
|
*/
|
|
71
71
|
declare function redactAttributes(attributes?: Attributes | null, options?: RedactOptions): Attributes;
|
|
72
72
|
|
|
73
|
+
type RuntimeLogContextValue = string | number | boolean | null | undefined | RuntimeLogContextValue[] | {
|
|
74
|
+
[key: string]: RuntimeLogContextValue;
|
|
75
|
+
};
|
|
76
|
+
type RuntimeLogContext = Record<string, RuntimeLogContextValue>;
|
|
77
|
+
type RuntimeLogLevel = "debug" | "info" | "warning" | "error";
|
|
78
|
+
type RuntimeOutcome = "succeeded" | "failed" | "degraded" | "cancelled" | "pending";
|
|
79
|
+
interface RuntimeLoggingOptions {
|
|
80
|
+
console?: boolean;
|
|
81
|
+
minLevel?: RuntimeLogLevel;
|
|
82
|
+
}
|
|
83
|
+
interface RuntimeOperation {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
setContext(attributes: RuntimeLogContext): void;
|
|
86
|
+
outcome(status: RuntimeOutcome, message?: string): void;
|
|
87
|
+
step<T>(name: string, fn: () => T | Promise<T>): Promise<T>;
|
|
88
|
+
}
|
|
89
|
+
declare function runtimeLogStats(): {
|
|
90
|
+
buffered: number;
|
|
91
|
+
dropped: number;
|
|
92
|
+
};
|
|
93
|
+
declare function flushRuntimeLogs(): Promise<void>;
|
|
94
|
+
declare function createRuntimeLogger(attributes?: RuntimeLogContext): {
|
|
95
|
+
debug: (message: string, extra?: RuntimeLogContext) => void;
|
|
96
|
+
info: (message: string, extra?: RuntimeLogContext) => void;
|
|
97
|
+
warn: (message: string, extra?: RuntimeLogContext) => void;
|
|
98
|
+
error: (error: unknown, extra?: RuntimeLogContext) => void;
|
|
99
|
+
};
|
|
100
|
+
declare const runtimeLogger: {
|
|
101
|
+
debug: (message: string, extra?: RuntimeLogContext) => void;
|
|
102
|
+
info: (message: string, extra?: RuntimeLogContext) => void;
|
|
103
|
+
warn: (message: string, extra?: RuntimeLogContext) => void;
|
|
104
|
+
error: (error: unknown, extra?: RuntimeLogContext) => void;
|
|
105
|
+
};
|
|
106
|
+
/** Context stays local to this operation; queues/processes require explicit propagation. */
|
|
107
|
+
declare function withRuntimeOperation<T>(name: string, fn: (operation: RuntimeOperation) => T | Promise<T>, attributes?: RuntimeLogContext): Promise<T>;
|
|
108
|
+
|
|
73
109
|
/**
|
|
74
110
|
* Curated OpenTelemetry setup for Autter Runtime — deliberately NOT the
|
|
75
111
|
* auto-instrumentation metapackage. Default data-volume policy:
|
|
@@ -95,6 +131,8 @@ declare function redactAttributes(attributes?: Attributes | null, options?: Reda
|
|
|
95
131
|
* `/v1/metrics`) with the ingest key as a bearer header.
|
|
96
132
|
*/
|
|
97
133
|
interface AutterServerOptions {
|
|
134
|
+
/** Structured logs and completed operation summaries. */
|
|
135
|
+
logging?: RuntimeLoggingOptions;
|
|
98
136
|
/** Private ingest key (autter_rt_…). */
|
|
99
137
|
apiKey: string;
|
|
100
138
|
/** Ingester base URL. Default: https://otlp.autter.dev */
|
|
@@ -395,4 +433,4 @@ declare function startCaughtExceptionSampler(options?: {
|
|
|
395
433
|
stop(): void;
|
|
396
434
|
};
|
|
397
435
|
|
|
398
|
-
export { type AutoFlushHandle, type AutoFlushOptions, type AutterServer, type AutterServerOptions, type AutterSeverity, type FlushTarget, type InstrumentLlmOptions, type LlmCallHandle, type LlmCallInfo, type LlmUsage, type RedactOptions, type RelayOptions, type SafeCapture, type TrackedLlmCall, captureException, captureMessage, createBrowserRelayFetchHandler, createBrowserRelayHandler, emitLlmSelftestTrace, initAutterServer, installAutterAutoFlush, instrumentLlmClient, makeSafeCapture, redactAttributes, reportOutcome, sanitizeBrowserPayload, startCaughtExceptionSampler, trackLlmCall, withLlmCall, withProcessSpan };
|
|
436
|
+
export { type AutoFlushHandle, type AutoFlushOptions, type AutterServer, type AutterServerOptions, type AutterSeverity, type FlushTarget, type InstrumentLlmOptions, type LlmCallHandle, type LlmCallInfo, type LlmUsage, type RedactOptions, type RelayOptions, type RuntimeLogContext, type RuntimeLogContextValue, type RuntimeLogLevel, type RuntimeLoggingOptions, type RuntimeOperation, type RuntimeOutcome, type SafeCapture, type TrackedLlmCall, captureException, captureMessage, createBrowserRelayFetchHandler, createBrowserRelayHandler, createRuntimeLogger, emitLlmSelftestTrace, flushRuntimeLogs, initAutterServer, installAutterAutoFlush, instrumentLlmClient, makeSafeCapture, redactAttributes, reportOutcome, runtimeLogStats, runtimeLogger, sanitizeBrowserPayload, startCaughtExceptionSampler, trackLlmCall, withLlmCall, withProcessSpan, withRuntimeOperation };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,42 @@ interface RedactOptions {
|
|
|
70
70
|
*/
|
|
71
71
|
declare function redactAttributes(attributes?: Attributes | null, options?: RedactOptions): Attributes;
|
|
72
72
|
|
|
73
|
+
type RuntimeLogContextValue = string | number | boolean | null | undefined | RuntimeLogContextValue[] | {
|
|
74
|
+
[key: string]: RuntimeLogContextValue;
|
|
75
|
+
};
|
|
76
|
+
type RuntimeLogContext = Record<string, RuntimeLogContextValue>;
|
|
77
|
+
type RuntimeLogLevel = "debug" | "info" | "warning" | "error";
|
|
78
|
+
type RuntimeOutcome = "succeeded" | "failed" | "degraded" | "cancelled" | "pending";
|
|
79
|
+
interface RuntimeLoggingOptions {
|
|
80
|
+
console?: boolean;
|
|
81
|
+
minLevel?: RuntimeLogLevel;
|
|
82
|
+
}
|
|
83
|
+
interface RuntimeOperation {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
setContext(attributes: RuntimeLogContext): void;
|
|
86
|
+
outcome(status: RuntimeOutcome, message?: string): void;
|
|
87
|
+
step<T>(name: string, fn: () => T | Promise<T>): Promise<T>;
|
|
88
|
+
}
|
|
89
|
+
declare function runtimeLogStats(): {
|
|
90
|
+
buffered: number;
|
|
91
|
+
dropped: number;
|
|
92
|
+
};
|
|
93
|
+
declare function flushRuntimeLogs(): Promise<void>;
|
|
94
|
+
declare function createRuntimeLogger(attributes?: RuntimeLogContext): {
|
|
95
|
+
debug: (message: string, extra?: RuntimeLogContext) => void;
|
|
96
|
+
info: (message: string, extra?: RuntimeLogContext) => void;
|
|
97
|
+
warn: (message: string, extra?: RuntimeLogContext) => void;
|
|
98
|
+
error: (error: unknown, extra?: RuntimeLogContext) => void;
|
|
99
|
+
};
|
|
100
|
+
declare const runtimeLogger: {
|
|
101
|
+
debug: (message: string, extra?: RuntimeLogContext) => void;
|
|
102
|
+
info: (message: string, extra?: RuntimeLogContext) => void;
|
|
103
|
+
warn: (message: string, extra?: RuntimeLogContext) => void;
|
|
104
|
+
error: (error: unknown, extra?: RuntimeLogContext) => void;
|
|
105
|
+
};
|
|
106
|
+
/** Context stays local to this operation; queues/processes require explicit propagation. */
|
|
107
|
+
declare function withRuntimeOperation<T>(name: string, fn: (operation: RuntimeOperation) => T | Promise<T>, attributes?: RuntimeLogContext): Promise<T>;
|
|
108
|
+
|
|
73
109
|
/**
|
|
74
110
|
* Curated OpenTelemetry setup for Autter Runtime — deliberately NOT the
|
|
75
111
|
* auto-instrumentation metapackage. Default data-volume policy:
|
|
@@ -95,6 +131,8 @@ declare function redactAttributes(attributes?: Attributes | null, options?: Reda
|
|
|
95
131
|
* `/v1/metrics`) with the ingest key as a bearer header.
|
|
96
132
|
*/
|
|
97
133
|
interface AutterServerOptions {
|
|
134
|
+
/** Structured logs and completed operation summaries. */
|
|
135
|
+
logging?: RuntimeLoggingOptions;
|
|
98
136
|
/** Private ingest key (autter_rt_…). */
|
|
99
137
|
apiKey: string;
|
|
100
138
|
/** Ingester base URL. Default: https://otlp.autter.dev */
|
|
@@ -395,4 +433,4 @@ declare function startCaughtExceptionSampler(options?: {
|
|
|
395
433
|
stop(): void;
|
|
396
434
|
};
|
|
397
435
|
|
|
398
|
-
export { type AutoFlushHandle, type AutoFlushOptions, type AutterServer, type AutterServerOptions, type AutterSeverity, type FlushTarget, type InstrumentLlmOptions, type LlmCallHandle, type LlmCallInfo, type LlmUsage, type RedactOptions, type RelayOptions, type SafeCapture, type TrackedLlmCall, captureException, captureMessage, createBrowserRelayFetchHandler, createBrowserRelayHandler, emitLlmSelftestTrace, initAutterServer, installAutterAutoFlush, instrumentLlmClient, makeSafeCapture, redactAttributes, reportOutcome, sanitizeBrowserPayload, startCaughtExceptionSampler, trackLlmCall, withLlmCall, withProcessSpan };
|
|
436
|
+
export { type AutoFlushHandle, type AutoFlushOptions, type AutterServer, type AutterServerOptions, type AutterSeverity, type FlushTarget, type InstrumentLlmOptions, type LlmCallHandle, type LlmCallInfo, type LlmUsage, type RedactOptions, type RelayOptions, type RuntimeLogContext, type RuntimeLogContextValue, type RuntimeLogLevel, type RuntimeLoggingOptions, type RuntimeOperation, type RuntimeOutcome, type SafeCapture, type TrackedLlmCall, captureException, captureMessage, createBrowserRelayFetchHandler, createBrowserRelayHandler, createRuntimeLogger, emitLlmSelftestTrace, flushRuntimeLogs, initAutterServer, installAutterAutoFlush, instrumentLlmClient, makeSafeCapture, redactAttributes, reportOutcome, runtimeLogStats, runtimeLogger, sanitizeBrowserPayload, startCaughtExceptionSampler, trackLlmCall, withLlmCall, withProcessSpan, withRuntimeOperation };
|