veryfront 0.1.246 → 0.1.248
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/esm/cli/mcp/tools/project-tools.d.ts +1 -1
- package/esm/cli/mcp/tools/scaffold-tools.d.ts +2 -2
- package/esm/cli/shared/server-startup.d.ts.map +1 -1
- package/esm/cli/shared/server-startup.js +8 -0
- package/esm/deno.d.ts +0 -9
- package/esm/deno.js +5 -12
- package/esm/src/agent/durable.d.ts +67 -0
- package/esm/src/agent/durable.d.ts.map +1 -1
- package/esm/src/agent/durable.js +134 -0
- package/esm/src/agent/index.d.ts +1 -1
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +1 -1
- package/esm/src/embedding/upload-loader.d.ts +2 -2
- package/esm/src/embedding/upload-loader.d.ts.map +1 -1
- package/esm/src/embedding/upload-loader.js +11 -48
- package/esm/src/errors/middleware/cli-error-boundary.js +1 -1
- package/esm/src/errors/middleware/http-error-boundary.js +1 -1
- package/esm/src/errors/tracing.d.ts +3 -3
- package/esm/src/errors/tracing.d.ts.map +1 -1
- package/esm/src/errors/tracing.js +3 -3
- package/esm/src/extensions/interfaces/index.d.ts +2 -2
- package/esm/src/extensions/interfaces/index.d.ts.map +1 -1
- package/esm/src/extensions/interfaces/node-compat.d.ts +68 -10
- package/esm/src/extensions/interfaces/node-compat.d.ts.map +1 -1
- package/esm/src/extensions/interfaces/tracing-exporter.d.ts +35 -1
- package/esm/src/extensions/interfaces/tracing-exporter.d.ts.map +1 -1
- package/esm/src/integrations/schema.d.ts +10 -10
- package/esm/src/mcp/index.d.ts +7 -2
- package/esm/src/mcp/index.d.ts.map +1 -1
- package/esm/src/mcp/index.js +7 -2
- package/esm/src/mcp/schemas/index.d.ts +1 -1
- package/esm/src/mcp/schemas/index.d.ts.map +1 -1
- package/esm/src/mcp/schemas/index.js +1 -1
- package/esm/src/mcp/schemas/mcp.schema.d.ts +13 -7
- package/esm/src/mcp/schemas/mcp.schema.d.ts.map +1 -1
- package/esm/src/mcp/schemas/mcp.schema.js +17 -7
- package/esm/src/mcp/server.d.ts +13 -0
- package/esm/src/mcp/server.d.ts.map +1 -1
- package/esm/src/mcp/server.js +43 -6
- package/esm/src/observability/auto-instrument/http-instrumentation.js +1 -1
- package/esm/src/observability/auto-instrument/react-instrumentation.js +1 -1
- package/esm/src/observability/instruments/build-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/build-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/cache-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/cache-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/data-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/data-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/error-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/error-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/http-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/http-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts +1 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts.map +1 -1
- package/esm/src/observability/instruments/memory-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/memory-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/render-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/render-instruments.d.ts.map +1 -1
- package/esm/src/observability/instruments/rsc-instruments.d.ts +1 -1
- package/esm/src/observability/instruments/rsc-instruments.d.ts.map +1 -1
- package/esm/src/observability/metrics/manager.d.ts.map +1 -1
- package/esm/src/observability/metrics/manager.js +10 -2
- package/esm/src/observability/metrics/types.d.ts +1 -1
- package/esm/src/observability/metrics/types.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/otel-instruments.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/otel-instruments.js +7 -2
- package/esm/src/observability/simple-metrics/types.d.ts +1 -1
- package/esm/src/observability/simple-metrics/types.d.ts.map +1 -1
- package/esm/src/observability/tracing/api-shim.d.ts +177 -0
- package/esm/src/observability/tracing/api-shim.d.ts.map +1 -0
- package/esm/src/observability/tracing/api-shim.js +234 -0
- package/esm/src/observability/tracing/manager.d.ts.map +1 -1
- package/esm/src/observability/tracing/manager.js +29 -4
- package/esm/src/observability/tracing/otlp-setup.d.ts +12 -8
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -1
- package/esm/src/observability/tracing/otlp-setup.js +59 -136
- package/esm/src/observability/tracing/types.d.ts +1 -1
- package/esm/src/observability/tracing/types.d.ts.map +1 -1
- package/esm/src/platform/compat/kv/factory.d.ts.map +1 -1
- package/esm/src/platform/compat/kv/factory.js +15 -6
- package/esm/src/platform/compat/opaque-deps.d.ts +6 -5
- package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
- package/esm/src/platform/compat/opaque-deps.js +13 -37
- package/esm/src/proxy/tracing.d.ts +7 -2
- package/esm/src/proxy/tracing.d.ts.map +1 -1
- package/esm/src/proxy/tracing.js +31 -96
- package/esm/src/rendering/rsc/client-module-strategy.d.ts.map +1 -1
- package/esm/src/rendering/rsc/client-module-strategy.js +9 -1
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +27 -1
- package/esm/src/server/context/request-context.d.ts.map +1 -1
- package/esm/src/server/context/request-context.js +7 -4
- package/esm/src/server/dev-server/middleware.js +1 -1
- package/esm/src/server/handlers/dev/files/dev-file.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/dev-file.handler.js +4 -14
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +4 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/workspace-sync.d.ts +17 -2
- package/esm/src/workflow/claude-code/workspace-sync.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/workspace-sync.js +106 -19
- package/esm/src/workflow/schemas/workflow.schema.d.ts +3 -3
- package/package.json +1 -9
- package/src/cli/shared/server-startup.ts +8 -0
- package/src/deno.js +5 -12
- package/src/src/agent/durable.ts +237 -0
- package/src/src/agent/index.ts +4 -0
- package/src/src/cache/backends/factory.ts +1 -1
- package/src/src/cache/backends/redis.ts +1 -1
- package/src/src/cache/keys/utils.ts +1 -1
- package/src/src/cache/registry.ts +1 -1
- package/src/src/data/static-paths-fetcher.ts +1 -1
- package/src/src/embedding/upload-loader.ts +14 -63
- package/src/src/errors/middleware/cli-error-boundary.ts +1 -1
- package/src/src/errors/middleware/http-error-boundary.ts +1 -1
- package/src/src/errors/tracing.ts +4 -4
- package/src/src/extensions/interfaces/index.ts +7 -2
- package/src/src/extensions/interfaces/node-compat.ts +74 -10
- package/src/src/extensions/interfaces/tracing-exporter.ts +36 -1
- package/src/src/mcp/index.ts +7 -2
- package/src/src/mcp/schemas/index.ts +1 -0
- package/src/src/mcp/schemas/mcp.schema.ts +20 -7
- package/src/src/mcp/server.ts +60 -6
- package/src/src/observability/auto-instrument/http-instrumentation.ts +1 -1
- package/src/src/observability/auto-instrument/react-instrumentation.ts +1 -1
- package/src/src/observability/auto-instrument/wrappers.ts +1 -1
- package/src/src/observability/instruments/build-instruments.ts +1 -1
- package/src/src/observability/instruments/cache-instruments.ts +6 -1
- package/src/src/observability/instruments/data-instruments.ts +1 -1
- package/src/src/observability/instruments/error-instruments.ts +1 -1
- package/src/src/observability/instruments/http-instruments.ts +6 -1
- package/src/src/observability/instruments/instruments-factory.ts +1 -1
- package/src/src/observability/instruments/memory-instruments.ts +5 -1
- package/src/src/observability/instruments/render-instruments.ts +1 -1
- package/src/src/observability/instruments/rsc-instruments.ts +1 -1
- package/src/src/observability/metrics/manager.ts +11 -3
- package/src/src/observability/metrics/types.ts +7 -1
- package/src/src/observability/simple-metrics/otel-instruments.ts +7 -2
- package/src/src/observability/simple-metrics/types.ts +1 -1
- package/src/src/observability/tracing/api-shim.ts +409 -0
- package/src/src/observability/tracing/manager.ts +29 -4
- package/src/src/observability/tracing/otlp-setup.ts +76 -168
- package/src/src/observability/tracing/types.ts +1 -1
- package/src/src/platform/compat/kv/factory.ts +18 -7
- package/src/src/platform/compat/opaque-deps.ts +16 -44
- package/src/src/proxy/tracing.ts +43 -117
- package/src/src/rendering/rsc/client-module-strategy.ts +9 -1
- package/src/src/server/bootstrap.ts +38 -1
- package/src/src/server/context/request-context.ts +10 -7
- package/src/src/server/dev-server/middleware.ts +1 -1
- package/src/src/server/handlers/dev/files/dev-file.handler.ts +4 -22
- package/src/src/server/services/rendering/ssr.service.ts +4 -1
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +1 -1
- package/src/src/utils/version-constant.ts +1 -1
- package/src/src/workflow/claude-code/workspace-sync.ts +109 -20
- package/esm/src/utils/logger/trace-bridge.d.ts +0 -11
- package/esm/src/utils/logger/trace-bridge.d.ts.map +0 -1
- package/esm/src/utils/logger/trace-bridge.js +0 -12
- package/src/src/utils/logger/trace-bridge.ts +0 -14
|
@@ -5,21 +5,79 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module extensions/interfaces/node-compat
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Minimal interface for a prepared SQLite statement, compatible with
|
|
10
|
+
* `better-sqlite3`'s `Statement` shape.
|
|
11
|
+
*/
|
|
12
|
+
export interface SqliteStatement {
|
|
13
|
+
get(...params: unknown[]): unknown;
|
|
14
|
+
run(...params: unknown[]): void;
|
|
15
|
+
all(...params: unknown[]): unknown[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Minimal interface for a SQLite database connection, compatible with
|
|
19
|
+
* `better-sqlite3`'s `Database` shape as consumed by `SqliteKv`.
|
|
20
|
+
*
|
|
21
|
+
* Mirrors `SqliteDatabase` in `src/platform/compat/kv/types.ts` — kept
|
|
22
|
+
* separate here so extensions can import from the public
|
|
23
|
+
* `veryfront/extensions/interfaces` entrypoint without taking a dependency
|
|
24
|
+
* on internal platform paths.
|
|
25
|
+
*/
|
|
26
|
+
export interface NodeCompatSqliteDatabase {
|
|
27
|
+
exec(sql: string): void;
|
|
28
|
+
prepare(sql: string): SqliteStatement;
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Shape returned by the kreuzberg document-extraction module.
|
|
33
|
+
*
|
|
34
|
+
* Matches the subset used by `importKreuzberg()` in `opaque-deps.ts`.
|
|
35
|
+
*/
|
|
36
|
+
export interface KreuzbergExtractor {
|
|
37
|
+
extractBytes(data: Uint8Array, mimeType: string): Promise<{
|
|
38
|
+
content: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
8
41
|
/**
|
|
9
42
|
* NodeCompat contract interface.
|
|
10
43
|
*
|
|
11
|
-
* Implementations provide access to Node.js-
|
|
12
|
-
*
|
|
44
|
+
* Implementations provide access to Node.js-only packages
|
|
45
|
+
* (`@kreuzberg/wasm`, `better-sqlite3`) in environments where those
|
|
46
|
+
* packages are available (i.e. a full Node/Deno runtime, not a compiled
|
|
47
|
+
* binary or edge runtime).
|
|
13
48
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
49
|
+
* Both methods are optional on the interface so that partial
|
|
50
|
+
* implementations (e.g. SQLite-only or kreuzberg-only) are valid.
|
|
16
51
|
*/
|
|
17
52
|
export interface NodeCompat {
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Initialise and return the kreuzberg document-extraction module.
|
|
55
|
+
*
|
|
56
|
+
* Callers should fall back to a "no extraction" path when this
|
|
57
|
+
* method is absent or throws.
|
|
58
|
+
*/
|
|
59
|
+
importKreuzberg?(): Promise<KreuzbergExtractor>;
|
|
60
|
+
/**
|
|
61
|
+
* Run kreuzberg extraction inside an isolated Worker thread.
|
|
62
|
+
*
|
|
63
|
+
* Owned by the extension so that the worker script lives in a module
|
|
64
|
+
* graph where `@kreuzberg/wasm` resolves and the NodeCompat contract
|
|
65
|
+
* is reachable (Deno worker isolates do not share the main-thread
|
|
66
|
+
* contract registry).
|
|
67
|
+
*
|
|
68
|
+
* Callers on Node/Bun can skip workers and use `importKreuzberg()`
|
|
69
|
+
* directly — native bindings don't need WASM-hang isolation.
|
|
70
|
+
*/
|
|
71
|
+
extractInWorker?(buffer: ArrayBuffer, mimeType: string): Promise<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Open (or create) a SQLite database at `path`.
|
|
74
|
+
*
|
|
75
|
+
* Returns a database compatible with `SqliteKv`.
|
|
76
|
+
* When `path` is omitted an in-memory database is created.
|
|
77
|
+
*
|
|
78
|
+
* Callers should fall back to the in-memory KV when this method is
|
|
79
|
+
* absent or throws.
|
|
80
|
+
*/
|
|
81
|
+
openSqliteDatabase?(path?: string): Promise<NodeCompatSqliteDatabase>;
|
|
24
82
|
}
|
|
25
83
|
//# sourceMappingURL=node-compat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-compat.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/node-compat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"node-compat.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/node-compat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACnC,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IACtC,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CACV,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,eAAe,CAAC,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEhD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzE;;;;;;;;OAQG;IACH,kBAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACvE"}
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module extensions/interfaces/tracing-exporter
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Minimal TracerProvider interface for the contract.
|
|
10
|
+
* Structurally compatible with both the core shim and the real OTel SDK.
|
|
11
|
+
*/
|
|
12
|
+
export interface TracerProvider {
|
|
13
|
+
getTracer(name: string, version?: string): unknown;
|
|
14
|
+
}
|
|
8
15
|
/** Data describing a single trace span. */
|
|
9
16
|
export interface SpanData {
|
|
10
17
|
/** Unique span identifier. */
|
|
@@ -33,12 +40,39 @@ export interface SpanData {
|
|
|
33
40
|
* TracingExporter contract interface.
|
|
34
41
|
*
|
|
35
42
|
* Implementations export collected trace spans to an observability
|
|
36
|
-
* backend (e.g. Jaeger, Zipkin, OTLP collector)
|
|
43
|
+
* backend (e.g. Jaeger, Zipkin, OTLP collector) and expose the SDK
|
|
44
|
+
* TracerProvider so the core shim can delegate to it.
|
|
37
45
|
*/
|
|
38
46
|
export interface TracingExporter {
|
|
47
|
+
/**
|
|
48
|
+
* Initialize the SDK provider and exporter.
|
|
49
|
+
* Called during extension setup.
|
|
50
|
+
*/
|
|
51
|
+
start(config: Record<string, unknown>): Promise<void>;
|
|
39
52
|
/** Export a batch of completed spans. */
|
|
40
53
|
export(spans: SpanData[]): Promise<void>;
|
|
41
54
|
/** Flush pending data and release resources. */
|
|
42
55
|
shutdown(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Return the SDK TracerProvider so the core shim can delegate to it.
|
|
58
|
+
* The shim calls this after `start()` completes.
|
|
59
|
+
*/
|
|
60
|
+
getProvider(): TracerProvider;
|
|
61
|
+
/**
|
|
62
|
+
* Return the OTel Metrics API so the metrics subsystem can get meters.
|
|
63
|
+
* Returns `null` when metrics are not available.
|
|
64
|
+
*/
|
|
65
|
+
getMetricsAPI(): {
|
|
66
|
+
getMeter(name: string | undefined, version?: string): unknown;
|
|
67
|
+
} | null;
|
|
68
|
+
/**
|
|
69
|
+
* Return the OTel Trace API so the core shim can look up the active span
|
|
70
|
+
* (for error correlation, proxy trace-id extraction, etc.). Returns `null`
|
|
71
|
+
* when tracing is disabled.
|
|
72
|
+
*/
|
|
73
|
+
getTraceAPI?(): {
|
|
74
|
+
getActiveSpan(): unknown;
|
|
75
|
+
getSpan(ctx: unknown): unknown;
|
|
76
|
+
} | null;
|
|
43
77
|
}
|
|
44
78
|
//# sourceMappingURL=tracing-exporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing-exporter.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/tracing-exporter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IACjE,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACtD,0BAA0B;IAC1B,MAAM,EAAE;QAAE,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED
|
|
1
|
+
{"version":3,"file":"tracing-exporter.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/tracing-exporter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACpD;AAED,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IACjE,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACtD,0BAA0B;IAC1B,MAAM,EAAE;QAAE,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD,yCAAyC;IACzC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,gDAAgD;IAChD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,WAAW,IAAI,cAAc,CAAC;IAE9B;;;OAGG;IACH,aAAa,IAAI;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE1F;;;;OAIG;IACH,WAAW,CAAC,IAAI;QAAE,aAAa,IAAI,OAAO,CAAC;QAAC,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACrF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const IntegrationNameSchema: z.ZodEnum<{
|
|
3
3
|
github: "github";
|
|
4
|
-
aws: "aws";
|
|
5
4
|
twitter: "twitter";
|
|
6
5
|
zoom: "zoom";
|
|
7
6
|
anthropic: "anthropic";
|
|
@@ -50,6 +49,7 @@ export declare const IntegrationNameSchema: z.ZodEnum<{
|
|
|
50
49
|
snowflake: "snowflake";
|
|
51
50
|
mixpanel: "mixpanel";
|
|
52
51
|
twilio: "twilio";
|
|
52
|
+
aws: "aws";
|
|
53
53
|
}>;
|
|
54
54
|
export declare const EnvVarSchema: z.ZodObject<{
|
|
55
55
|
name: z.ZodString;
|
|
@@ -70,9 +70,9 @@ export declare const OAuthFieldSchema: z.ZodObject<{
|
|
|
70
70
|
}, z.core.$strip>;
|
|
71
71
|
export declare const OAuthConfigSchema: z.ZodObject<{
|
|
72
72
|
type: z.ZodEnum<{
|
|
73
|
-
"api-key": "api-key";
|
|
74
73
|
oauth2: "oauth2";
|
|
75
74
|
oauth1: "oauth1";
|
|
75
|
+
"api-key": "api-key";
|
|
76
76
|
}>;
|
|
77
77
|
provider: z.ZodOptional<z.ZodString>;
|
|
78
78
|
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -144,11 +144,11 @@ export declare const IntegrationEndpointSchema: z.ZodObject<{
|
|
|
144
144
|
graphql: "graphql";
|
|
145
145
|
}>>;
|
|
146
146
|
method: z.ZodEnum<{
|
|
147
|
-
DELETE: "DELETE";
|
|
148
147
|
GET: "GET";
|
|
149
|
-
PATCH: "PATCH";
|
|
150
148
|
POST: "POST";
|
|
151
149
|
PUT: "PUT";
|
|
150
|
+
PATCH: "PATCH";
|
|
151
|
+
DELETE: "DELETE";
|
|
152
152
|
}>;
|
|
153
153
|
url: z.ZodString;
|
|
154
154
|
query: z.ZodOptional<z.ZodString>;
|
|
@@ -200,11 +200,11 @@ export declare const IntegrationToolSchema: z.ZodObject<{
|
|
|
200
200
|
graphql: "graphql";
|
|
201
201
|
}>>;
|
|
202
202
|
method: z.ZodEnum<{
|
|
203
|
-
DELETE: "DELETE";
|
|
204
203
|
GET: "GET";
|
|
205
|
-
PATCH: "PATCH";
|
|
206
204
|
POST: "POST";
|
|
207
205
|
PUT: "PUT";
|
|
206
|
+
PATCH: "PATCH";
|
|
207
|
+
DELETE: "DELETE";
|
|
208
208
|
}>;
|
|
209
209
|
url: z.ZodString;
|
|
210
210
|
query: z.ZodOptional<z.ZodString>;
|
|
@@ -255,7 +255,6 @@ export declare const IntegrationPromptSchema: z.ZodObject<{
|
|
|
255
255
|
export declare const IntegrationConfigSchema: z.ZodObject<{
|
|
256
256
|
name: z.ZodEnum<{
|
|
257
257
|
github: "github";
|
|
258
|
-
aws: "aws";
|
|
259
258
|
twitter: "twitter";
|
|
260
259
|
zoom: "zoom";
|
|
261
260
|
anthropic: "anthropic";
|
|
@@ -304,15 +303,16 @@ export declare const IntegrationConfigSchema: z.ZodObject<{
|
|
|
304
303
|
snowflake: "snowflake";
|
|
305
304
|
mixpanel: "mixpanel";
|
|
306
305
|
twilio: "twilio";
|
|
306
|
+
aws: "aws";
|
|
307
307
|
}>;
|
|
308
308
|
displayName: z.ZodString;
|
|
309
309
|
icon: z.ZodOptional<z.ZodString>;
|
|
310
310
|
description: z.ZodString;
|
|
311
311
|
auth: z.ZodObject<{
|
|
312
312
|
type: z.ZodEnum<{
|
|
313
|
-
"api-key": "api-key";
|
|
314
313
|
oauth2: "oauth2";
|
|
315
314
|
oauth1: "oauth1";
|
|
315
|
+
"api-key": "api-key";
|
|
316
316
|
}>;
|
|
317
317
|
provider: z.ZodOptional<z.ZodString>;
|
|
318
318
|
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -369,11 +369,11 @@ export declare const IntegrationConfigSchema: z.ZodObject<{
|
|
|
369
369
|
graphql: "graphql";
|
|
370
370
|
}>>;
|
|
371
371
|
method: z.ZodEnum<{
|
|
372
|
-
DELETE: "DELETE";
|
|
373
372
|
GET: "GET";
|
|
374
|
-
PATCH: "PATCH";
|
|
375
373
|
POST: "POST";
|
|
376
374
|
PUT: "PUT";
|
|
375
|
+
PATCH: "PATCH";
|
|
376
|
+
DELETE: "DELETE";
|
|
377
377
|
}>;
|
|
378
378
|
url: z.ZodString;
|
|
379
379
|
query: z.ZodOptional<z.ZodString>;
|
package/esm/src/mcp/index.d.ts
CHANGED
|
@@ -17,8 +17,13 @@
|
|
|
17
17
|
* execute: async ({ query }) => ({ results: [] }),
|
|
18
18
|
* });
|
|
19
19
|
*
|
|
20
|
-
* // Start MCP server — registered tools are exposed automatically
|
|
21
|
-
*
|
|
20
|
+
* // Start MCP server — registered tools are exposed automatically.
|
|
21
|
+
* // `auth` is required: use bearer for production, or the explicit
|
|
22
|
+
* // `{ type: "none", allowUnauthenticated: true }` opt-in for local dev only.
|
|
23
|
+
* const server = createMCPServer({
|
|
24
|
+
* enabled: true,
|
|
25
|
+
* auth: { type: "none", allowUnauthenticated: true },
|
|
26
|
+
* });
|
|
22
27
|
* ```
|
|
23
28
|
*/
|
|
24
29
|
import "../../_dnt.polyfills.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/mcp/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,eAAe,EACf,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,KAAK,uBAAuB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|
package/esm/src/mcp/index.js
CHANGED
|
@@ -17,8 +17,13 @@
|
|
|
17
17
|
* execute: async ({ query }) => ({ results: [] }),
|
|
18
18
|
* });
|
|
19
19
|
*
|
|
20
|
-
* // Start MCP server — registered tools are exposed automatically
|
|
21
|
-
*
|
|
20
|
+
* // Start MCP server — registered tools are exposed automatically.
|
|
21
|
+
* // `auth` is required: use bearer for production, or the explicit
|
|
22
|
+
* // `{ type: "none", allowUnauthenticated: true }` opt-in for local dev only.
|
|
23
|
+
* const server = createMCPServer({
|
|
24
|
+
* enabled: true,
|
|
25
|
+
* auth: { type: "none", allowUnauthenticated: true },
|
|
26
|
+
* });
|
|
22
27
|
* ```
|
|
23
28
|
*/
|
|
24
29
|
import "../../_dnt.polyfills.js";
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module mcp/schemas
|
|
5
5
|
*/
|
|
6
|
-
export { type MCPServerConfig, MCPServerConfigSchema, type MCPStats, MCPStatsSchema, } from "./mcp.schema.js";
|
|
6
|
+
export { MCPAuthConfigSchema, type MCPServerConfig, MCPServerConfigSchema, type MCPStats, MCPStatsSchema, } from "./mcp.schema.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/mcp/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,QAAQ,EACb,cAAc,GACf,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/mcp/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,QAAQ,EACb,cAAc,GACf,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const MCPAuthConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"bearer">;
|
|
4
|
+
validate: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"none">;
|
|
7
|
+
allowUnauthenticated: z.ZodLiteral<true>;
|
|
8
|
+
}, z.core.$strip>]>;
|
|
2
9
|
export declare const MCPServerConfigSchema: z.ZodObject<{
|
|
3
10
|
enabled: z.ZodBoolean;
|
|
4
11
|
port: z.ZodOptional<z.ZodNumber>;
|
|
5
|
-
auth: z.
|
|
6
|
-
type: z.
|
|
7
|
-
bearer: "bearer";
|
|
8
|
-
none: "none";
|
|
9
|
-
"api-key": "api-key";
|
|
10
|
-
}>;
|
|
12
|
+
auth: z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"bearer">;
|
|
11
14
|
validate: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
12
|
-
}, z.core.$strip
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"none">;
|
|
17
|
+
allowUnauthenticated: z.ZodLiteral<true>;
|
|
18
|
+
}, z.core.$strip>]>;
|
|
13
19
|
cors: z.ZodOptional<z.ZodObject<{
|
|
14
20
|
enabled: z.ZodBoolean;
|
|
15
21
|
origins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/mcp/schemas/mcp.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/mcp/schemas/mcp.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,mBAAmB;;;;;;mBAAiD,CAAC;AAElF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAUhC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;iBAKzB,CAAC;AAGH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* MCP auth configuration. One of:
|
|
4
|
+
* - `{ type: "bearer", validate?: (token) => Promise<boolean> }` — bearer-token auth.
|
|
5
|
+
* - `{ type: "none", allowUnauthenticated: true }` — explicit opt-in to an
|
|
6
|
+
* unauthenticated server. Required for local dev/testing; prevents accidental
|
|
7
|
+
* exposure of the JSON-RPC surface in production (VULN-SRV-5).
|
|
8
|
+
*/
|
|
9
|
+
const AuthValidatedSchema = z.object({
|
|
10
|
+
type: z.literal("bearer"),
|
|
11
|
+
validate: z.function().optional(),
|
|
12
|
+
});
|
|
13
|
+
const AuthNoneSchema = z.object({
|
|
14
|
+
type: z.literal("none"),
|
|
15
|
+
allowUnauthenticated: z.literal(true),
|
|
16
|
+
});
|
|
17
|
+
export const MCPAuthConfigSchema = z.union([AuthValidatedSchema, AuthNoneSchema]);
|
|
2
18
|
export const MCPServerConfigSchema = z.object({
|
|
3
19
|
enabled: z.boolean(),
|
|
4
20
|
port: z.number().int().positive().optional(),
|
|
5
|
-
auth:
|
|
6
|
-
.object({
|
|
7
|
-
type: z.enum(["bearer", "api-key", "none"]),
|
|
8
|
-
validate: z.function()
|
|
9
|
-
.optional(),
|
|
10
|
-
})
|
|
11
|
-
.optional(),
|
|
21
|
+
auth: MCPAuthConfigSchema,
|
|
12
22
|
cors: z
|
|
13
23
|
.object({
|
|
14
24
|
enabled: z.boolean(),
|
package/esm/src/mcp/server.d.ts
CHANGED
|
@@ -41,6 +41,19 @@ export declare class MCPServer {
|
|
|
41
41
|
params?: unknown;
|
|
42
42
|
}) => void;
|
|
43
43
|
constructor(config: MCPServerConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Fail-closed validation of the auth configuration (VULN-SRV-5).
|
|
46
|
+
*
|
|
47
|
+
* Historically, an unset `auth` field — or `{ type: "none" }` — silently
|
|
48
|
+
* accepted every request with only a warning log. That meant an operator who
|
|
49
|
+
* forgot to configure auth shipped an unauthenticated JSON-RPC surface.
|
|
50
|
+
*
|
|
51
|
+
* The new contract: `auth` is required, and the only way to accept
|
|
52
|
+
* unauthenticated traffic is to explicitly set
|
|
53
|
+
* `{ type: "none", allowUnauthenticated: true }`. Any other shape is
|
|
54
|
+
* rejected at construction time.
|
|
55
|
+
*/
|
|
56
|
+
private static validateAuthConfig;
|
|
44
57
|
notifyToolsChanged(): void;
|
|
45
58
|
notifyResourcesChanged(): void;
|
|
46
59
|
notifyPromptsChanged(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/src/mcp/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAIjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAWzE,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC;AA2CzD,UAAU,cAAc;IACtB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC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73
|
/** Callback for server-initiated notifications. Set by transport layer. */
|
|
74
74
|
onNotification;
|
|
75
75
|
constructor(config) {
|
|
76
|
+
MCPServer.validateAuthConfig(config);
|
|
76
77
|
this.config = config;
|
|
77
|
-
if (
|
|
78
|
-
logger.warn("MCP server
|
|
78
|
+
if (config.auth.type === "none") {
|
|
79
|
+
logger.warn("MCP server started with auth.type='none' (allowUnauthenticated) — all requests will be accepted");
|
|
79
80
|
}
|
|
80
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Fail-closed validation of the auth configuration (VULN-SRV-5).
|
|
84
|
+
*
|
|
85
|
+
* Historically, an unset `auth` field — or `{ type: "none" }` — silently
|
|
86
|
+
* accepted every request with only a warning log. That meant an operator who
|
|
87
|
+
* forgot to configure auth shipped an unauthenticated JSON-RPC surface.
|
|
88
|
+
*
|
|
89
|
+
* The new contract: `auth` is required, and the only way to accept
|
|
90
|
+
* unauthenticated traffic is to explicitly set
|
|
91
|
+
* `{ type: "none", allowUnauthenticated: true }`. Any other shape is
|
|
92
|
+
* rejected at construction time.
|
|
93
|
+
*/
|
|
94
|
+
static validateAuthConfig(config) {
|
|
95
|
+
const auth = config.auth;
|
|
96
|
+
if (auth === undefined || auth === null) {
|
|
97
|
+
throw new Error("MCP auth must be configured. For local dev, pass " +
|
|
98
|
+
"{ auth: { type: 'none', allowUnauthenticated: true } } explicitly.");
|
|
99
|
+
}
|
|
100
|
+
if (typeof auth !== "object") {
|
|
101
|
+
throw new Error("MCP auth must be an object. For local dev, pass " +
|
|
102
|
+
"{ auth: { type: 'none', allowUnauthenticated: true } } explicitly.");
|
|
103
|
+
}
|
|
104
|
+
const type = auth.type;
|
|
105
|
+
if (type === "none") {
|
|
106
|
+
const allow = auth.allowUnauthenticated;
|
|
107
|
+
if (allow !== true) {
|
|
108
|
+
throw new Error("MCP auth type 'none' requires allowUnauthenticated: true to acknowledge " +
|
|
109
|
+
"the server will accept all requests.");
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (type === "bearer") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
throw new Error(`MCP auth type '${String(type)}' is not supported. Use 'bearer' ` +
|
|
117
|
+
"or { type: 'none', allowUnauthenticated: true } for explicit opt-in to " +
|
|
118
|
+
"unauthenticated traffic.");
|
|
119
|
+
}
|
|
81
120
|
notifyToolsChanged() {
|
|
82
121
|
this.onNotification?.({ jsonrpc: "2.0", method: "notifications/tools/list_changed" });
|
|
83
122
|
}
|
|
@@ -470,7 +509,7 @@ export class MCPServer {
|
|
|
470
509
|
}
|
|
471
510
|
createHTTPHandler() {
|
|
472
511
|
return createMCPHTTPHandler({
|
|
473
|
-
authEnabled:
|
|
512
|
+
authEnabled: this.config.auth.type !== "none",
|
|
474
513
|
getCORSHeaders: (requestOrigin) => this.getCORSHeaders(requestOrigin),
|
|
475
514
|
validateAuth: (request) => this.validateAuth(request),
|
|
476
515
|
handleRequest: (request, context) => this.handleRequest(request, context),
|
|
@@ -497,13 +536,11 @@ export class MCPServer {
|
|
|
497
536
|
}
|
|
498
537
|
async validateAuth(request) {
|
|
499
538
|
const auth = this.config.auth;
|
|
500
|
-
if (
|
|
539
|
+
if (auth.type === "none")
|
|
501
540
|
return true;
|
|
502
541
|
const authHeader = request.headers.get("Authorization");
|
|
503
542
|
if (!authHeader)
|
|
504
543
|
return false;
|
|
505
|
-
if (auth.type !== "bearer")
|
|
506
|
-
return false;
|
|
507
544
|
const token = authHeader.replace("Bearer ", "");
|
|
508
545
|
// When bearer auth is configured without a validate function, reject all requests
|
|
509
546
|
if (!auth.validate) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serverLogger } from "../../utils/index.js";
|
|
2
|
-
import { context as otContext, propagation, SpanKind, SpanStatusCode, trace, } from "
|
|
2
|
+
import { context as otContext, propagation, SpanKind, SpanStatusCode, trace, } from "../tracing/api-shim.js";
|
|
3
3
|
const logger = serverLogger.component("auto-instrument");
|
|
4
4
|
const tracer = trace.getTracer("veryfront-http");
|
|
5
5
|
const headersGetter = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpanStatusCode } from "
|
|
1
|
+
import { SpanStatusCode } from "../tracing/api-shim.js";
|
|
2
2
|
import { endSpan, setSpanAttributes, SpanNames, startSpan, withSpan } from "../tracing/index.js";
|
|
3
3
|
import { recordRenderError } from "../metrics/index.js";
|
|
4
4
|
export function instrumentReactRender(renderFn, componentName) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Counter, Histogram, Meter } from "
|
|
1
|
+
import type { Counter, Histogram, Meter } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
3
3
|
export interface BuildInstruments {
|
|
4
4
|
buildDuration: Histogram | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/build-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"build-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/build-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAKxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,GACpB,gBAAgB,CAmBlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Counter, Meter, ObservableGauge } from "
|
|
1
|
+
import type { Counter, Meter, ObservableGauge } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig, RuntimeState } from "../metrics/types.js";
|
|
3
3
|
export interface CacheInstruments {
|
|
4
4
|
cacheGetCounter: Counter | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/cache-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cache-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/cache-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,sBAAsB,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,YAAY,GACzB,gBAAgB,CA2ClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Counter, Histogram, Meter } from "
|
|
1
|
+
import type { Counter, Histogram, Meter } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
3
3
|
export interface DataInstruments {
|
|
4
4
|
dataFetchDuration: Histogram | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/data-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/data-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,iBAAiB,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;CACvC;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,GACpB,eAAe,CAkBjB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides unified error tracking with slug-based identification for
|
|
5
5
|
* observability dashboards and alerting.
|
|
6
6
|
*/
|
|
7
|
-
import type { Counter, Meter } from "
|
|
7
|
+
import type { Counter, Meter } from "../tracing/api-shim.js";
|
|
8
8
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
9
9
|
import type { VeryfrontError } from "../../errors/types.js";
|
|
10
10
|
export interface ErrorInstruments {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/error-instruments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"error-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/error-instruments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAS5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,EACrB,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,GAC5B,IAAI,CAUN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Counter, Histogram, Meter, UpDownCounter } from "
|
|
1
|
+
import type { Counter, Histogram, Meter, UpDownCounter } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
3
3
|
export interface HttpInstruments {
|
|
4
4
|
httpRequestCounter: Counter | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/http-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"http-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/http-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,KAAK,EACL,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC;IACtC,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,eAAe,CAkB1F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Meter } from "
|
|
1
|
+
import type { Meter } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig, MetricsInstruments, RuntimeState } from "../metrics/types.js";
|
|
3
3
|
export declare function initializeInstruments(meter: Meter, config: MetricsConfig, runtimeState: RuntimeState): MetricsInstruments;
|
|
4
4
|
//# sourceMappingURL=instruments-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruments-factory.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/instruments-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"instruments-factory.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/instruments-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAY3F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,YAAY,GACzB,kBAAkB,CAoDpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Meter, ObservableGauge } from "
|
|
1
|
+
import type { Meter, ObservableGauge } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
3
3
|
export interface MemoryInstruments {
|
|
4
4
|
memoryUsageGauge: ObservableGauge | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/memory-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"memory-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/memory-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWzD,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C;AAgBD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,iBAAiB,CAgC9F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Counter, Histogram, Meter } from "
|
|
1
|
+
import type { Counter, Histogram, Meter } from "../tracing/api-shim.js";
|
|
2
2
|
import type { MetricsConfig } from "../metrics/types.js";
|
|
3
3
|
export interface RenderInstruments {
|
|
4
4
|
renderDuration: Histogram | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/render-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"render-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/instruments/render-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,GACpB,iBAAiB,CAkBnB"}
|