@vibesdotdev/logging 0.0.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.
- package/README.md +80 -0
- package/SPEC.md +65 -0
- package/dist/audit/audit.descriptor.d.ts +11 -0
- package/dist/audit/audit.descriptor.d.ts.map +1 -0
- package/dist/audit/audit.descriptor.js +40 -0
- package/dist/audit/audit.descriptor.js.map +1 -0
- package/dist/audit/audit.storage.schema.d.ts +79 -0
- package/dist/audit/audit.storage.schema.d.ts.map +1 -0
- package/dist/audit/audit.storage.schema.js +33 -0
- package/dist/audit/audit.storage.schema.js.map +1 -0
- package/dist/audit/index.d.ts +2 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +2 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/cli/logs.descriptor.d.ts +9 -0
- package/dist/cli/logs.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.descriptor.js +16 -0
- package/dist/cli/logs.descriptor.js.map +1 -0
- package/dist/cli/logs.list.descriptor.d.ts +9 -0
- package/dist/cli/logs.list.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.list.descriptor.js +23 -0
- package/dist/cli/logs.list.descriptor.js.map +1 -0
- package/dist/cli/logs.list.impl.d.ts +13 -0
- package/dist/cli/logs.list.impl.d.ts.map +1 -0
- package/dist/cli/logs.list.impl.js +81 -0
- package/dist/cli/logs.list.impl.js.map +1 -0
- package/dist/cli/logs.rotate.descriptor.d.ts +9 -0
- package/dist/cli/logs.rotate.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.rotate.descriptor.js +34 -0
- package/dist/cli/logs.rotate.descriptor.js.map +1 -0
- package/dist/cli/logs.rotate.impl.d.ts +17 -0
- package/dist/cli/logs.rotate.impl.d.ts.map +1 -0
- package/dist/cli/logs.rotate.impl.js +48 -0
- package/dist/cli/logs.rotate.impl.js.map +1 -0
- package/dist/cli/logs.search.descriptor.d.ts +9 -0
- package/dist/cli/logs.search.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.search.descriptor.js +55 -0
- package/dist/cli/logs.search.descriptor.js.map +1 -0
- package/dist/cli/logs.search.impl.d.ts +22 -0
- package/dist/cli/logs.search.impl.d.ts.map +1 -0
- package/dist/cli/logs.search.impl.js +145 -0
- package/dist/cli/logs.search.impl.js.map +1 -0
- package/dist/cli/logs.tail.descriptor.d.ts +9 -0
- package/dist/cli/logs.tail.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.tail.descriptor.js +43 -0
- package/dist/cli/logs.tail.descriptor.js.map +1 -0
- package/dist/cli/logs.tail.impl.d.ts +19 -0
- package/dist/cli/logs.tail.impl.d.ts.map +1 -0
- package/dist/cli/logs.tail.impl.js +78 -0
- package/dist/cli/logs.tail.impl.js.map +1 -0
- package/dist/cli/logs.view.descriptor.d.ts +9 -0
- package/dist/cli/logs.view.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.view.descriptor.js +51 -0
- package/dist/cli/logs.view.descriptor.js.map +1 -0
- package/dist/cli/logs.view.impl.d.ts +21 -0
- package/dist/cli/logs.view.impl.d.ts.map +1 -0
- package/dist/cli/logs.view.impl.js +85 -0
- package/dist/cli/logs.view.impl.js.map +1 -0
- package/dist/cli/types.d.ts +57 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +9 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/contexts/audit.d.ts +34 -0
- package/dist/contexts/audit.d.ts.map +1 -0
- package/dist/contexts/audit.js +13 -0
- package/dist/contexts/audit.js.map +1 -0
- package/dist/contexts/fallback-logger.d.ts +3 -0
- package/dist/contexts/fallback-logger.d.ts.map +1 -0
- package/dist/contexts/fallback-logger.js +67 -0
- package/dist/contexts/fallback-logger.js.map +1 -0
- package/dist/contexts/index.d.ts +8 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +9 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/contexts/logger.d.ts +26 -0
- package/dist/contexts/logger.d.ts.map +1 -0
- package/dist/contexts/logger.js +88 -0
- package/dist/contexts/logger.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +118 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/namespace.d.ts +69 -0
- package/dist/core/namespace.d.ts.map +1 -0
- package/dist/core/namespace.js +136 -0
- package/dist/core/namespace.js.map +1 -0
- package/dist/core/parsing.d.ts +3 -0
- package/dist/core/parsing.d.ts.map +1 -0
- package/dist/core/parsing.js +25 -0
- package/dist/core/parsing.js.map +1 -0
- package/dist/core/types.d.ts +69 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +7 -0
- package/dist/core/types.js.map +1 -0
- package/dist/docs/levels.docs.descriptor.d.ts +4 -0
- package/dist/docs/levels.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/levels.docs.descriptor.js +342 -0
- package/dist/docs/levels.docs.descriptor.js.map +1 -0
- package/dist/docs/structured.docs.descriptor.d.ts +4 -0
- package/dist/docs/structured.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/structured.docs.descriptor.js +442 -0
- package/dist/docs/structured.docs.descriptor.js.map +1 -0
- package/dist/docs/transports.docs.descriptor.d.ts +4 -0
- package/dist/docs/transports.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/transports.docs.descriptor.js +426 -0
- package/dist/docs/transports.docs.descriptor.js.map +1 -0
- package/dist/formatters/index.d.ts +7 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +8 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/json/json.formatters.descriptor.d.ts +9 -0
- package/dist/formatters/json/json.formatters.descriptor.d.ts.map +1 -0
- package/dist/formatters/json/json.formatters.descriptor.js +22 -0
- package/dist/formatters/json/json.formatters.descriptor.js.map +1 -0
- package/dist/formatters/json/json.impl.d.ts +22 -0
- package/dist/formatters/json/json.impl.d.ts.map +1 -0
- package/dist/formatters/json/json.impl.js +32 -0
- package/dist/formatters/json/json.impl.js.map +1 -0
- package/dist/formatters/json5/json5.descriptor.d.ts +9 -0
- package/dist/formatters/json5/json5.descriptor.d.ts.map +1 -0
- package/dist/formatters/json5/json5.descriptor.js +22 -0
- package/dist/formatters/json5/json5.descriptor.js.map +1 -0
- package/dist/formatters/json5/json5.impl.d.ts +23 -0
- package/dist/formatters/json5/json5.impl.d.ts.map +1 -0
- package/dist/formatters/json5/json5.impl.js +34 -0
- package/dist/formatters/json5/json5.impl.js.map +1 -0
- package/dist/formatters/jsonl/jsonl.descriptor.d.ts +10 -0
- package/dist/formatters/jsonl/jsonl.descriptor.d.ts.map +1 -0
- package/dist/formatters/jsonl/jsonl.descriptor.js +23 -0
- package/dist/formatters/jsonl/jsonl.descriptor.js.map +1 -0
- package/dist/formatters/jsonl/jsonl.impl.d.ts +21 -0
- package/dist/formatters/jsonl/jsonl.impl.d.ts.map +1 -0
- package/dist/formatters/jsonl/jsonl.impl.js +30 -0
- package/dist/formatters/jsonl/jsonl.impl.js.map +1 -0
- package/dist/formatters/pretty/pretty.descriptor.d.ts +9 -0
- package/dist/formatters/pretty/pretty.descriptor.d.ts.map +1 -0
- package/dist/formatters/pretty/pretty.descriptor.js +23 -0
- package/dist/formatters/pretty/pretty.descriptor.js.map +1 -0
- package/dist/formatters/pretty/pretty.impl.cli.d.ts +23 -0
- package/dist/formatters/pretty/pretty.impl.cli.d.ts.map +1 -0
- package/dist/formatters/pretty/pretty.impl.cli.js +81 -0
- package/dist/formatters/pretty/pretty.impl.cli.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -0
- package/dist/kinds/audit.d.ts +85 -0
- package/dist/kinds/audit.d.ts.map +1 -0
- package/dist/kinds/audit.js +71 -0
- package/dist/kinds/audit.js.map +1 -0
- package/dist/kinds/contexts.d.ts +21 -0
- package/dist/kinds/contexts.d.ts.map +1 -0
- package/dist/kinds/contexts.js +8 -0
- package/dist/kinds/contexts.js.map +1 -0
- package/dist/kinds/formatter.d.ts +42 -0
- package/dist/kinds/formatter.d.ts.map +1 -0
- package/dist/kinds/formatter.js +69 -0
- package/dist/kinds/formatter.js.map +1 -0
- package/dist/kinds/index.d.ts +13 -0
- package/dist/kinds/index.d.ts.map +1 -0
- package/dist/kinds/index.js +13 -0
- package/dist/kinds/index.js.map +1 -0
- package/dist/kinds/logger.contracts.d.ts +16 -0
- package/dist/kinds/logger.contracts.d.ts.map +1 -0
- package/dist/kinds/logger.contracts.js +9 -0
- package/dist/kinds/logger.contracts.js.map +1 -0
- package/dist/kinds/logger.d.ts +15 -0
- package/dist/kinds/logger.d.ts.map +1 -0
- package/dist/kinds/logger.impl.d.ts +40 -0
- package/dist/kinds/logger.impl.d.ts.map +1 -0
- package/dist/kinds/logger.impl.js +139 -0
- package/dist/kinds/logger.impl.js.map +1 -0
- package/dist/kinds/logger.js +28 -0
- package/dist/kinds/logger.js.map +1 -0
- package/dist/kinds/logger.utils.d.ts +15 -0
- package/dist/kinds/logger.utils.d.ts.map +1 -0
- package/dist/kinds/logger.utils.js +55 -0
- package/dist/kinds/logger.utils.js.map +1 -0
- package/dist/kinds/output.contracts.d.ts +50 -0
- package/dist/kinds/output.contracts.d.ts.map +1 -0
- package/dist/kinds/output.contracts.js +10 -0
- package/dist/kinds/output.contracts.js.map +1 -0
- package/dist/kinds/output.d.ts +20 -0
- package/dist/kinds/output.d.ts.map +1 -0
- package/dist/kinds/output.impl.d.ts +22 -0
- package/dist/kinds/output.impl.d.ts.map +1 -0
- package/dist/kinds/output.impl.js +84 -0
- package/dist/kinds/output.impl.js.map +1 -0
- package/dist/kinds/output.js +29 -0
- package/dist/kinds/output.js.map +1 -0
- package/dist/kinds/output.types.d.ts +92 -0
- package/dist/kinds/output.types.d.ts.map +1 -0
- package/dist/kinds/output.types.js +7 -0
- package/dist/kinds/output.types.js.map +1 -0
- package/dist/kinds/sink.d.ts +40 -0
- package/dist/kinds/sink.d.ts.map +1 -0
- package/dist/kinds/sink.js +61 -0
- package/dist/kinds/sink.js.map +1 -0
- package/dist/logger.context.descriptor.d.ts +21 -0
- package/dist/logger.context.descriptor.d.ts.map +1 -0
- package/dist/logger.context.descriptor.js +12 -0
- package/dist/logger.context.descriptor.js.map +1 -0
- package/dist/logging.cli.plugin.d.ts +20 -0
- package/dist/logging.cli.plugin.d.ts.map +1 -0
- package/dist/logging.cli.plugin.js +39 -0
- package/dist/logging.cli.plugin.js.map +1 -0
- package/dist/logging.plugin.d.ts +16 -0
- package/dist/logging.plugin.d.ts.map +1 -0
- package/dist/logging.plugin.js +83 -0
- package/dist/logging.plugin.js.map +1 -0
- package/dist/outputs/index.d.ts +7 -0
- package/dist/outputs/index.d.ts.map +1 -0
- package/dist/outputs/index.js +8 -0
- package/dist/outputs/index.js.map +1 -0
- package/dist/outputs/remote/remote.descriptor.d.ts +10 -0
- package/dist/outputs/remote/remote.descriptor.d.ts.map +1 -0
- package/dist/outputs/remote/remote.descriptor.js +24 -0
- package/dist/outputs/remote/remote.descriptor.js.map +1 -0
- package/dist/outputs/remote/remote.impl.d.ts +50 -0
- package/dist/outputs/remote/remote.impl.d.ts.map +1 -0
- package/dist/outputs/remote/remote.impl.js +178 -0
- package/dist/outputs/remote/remote.impl.js.map +1 -0
- package/dist/outputs.context.descriptor.d.ts +19 -0
- package/dist/outputs.context.descriptor.d.ts.map +1 -0
- package/dist/outputs.context.descriptor.js +9 -0
- package/dist/outputs.context.descriptor.js.map +1 -0
- package/dist/outputs.context.impl.d.ts +9 -0
- package/dist/outputs.context.impl.d.ts.map +1 -0
- package/dist/outputs.context.impl.js +18 -0
- package/dist/outputs.context.impl.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +10 -0
- package/dist/paths.js.map +1 -0
- package/dist/schemas/audit.d.ts +133 -0
- package/dist/schemas/audit.d.ts.map +1 -0
- package/dist/schemas/audit.js +80 -0
- package/dist/schemas/audit.js.map +1 -0
- package/dist/schemas/entry.d.ts +74 -0
- package/dist/schemas/entry.d.ts.map +1 -0
- package/dist/schemas/entry.js +62 -0
- package/dist/schemas/entry.js.map +1 -0
- package/dist/schemas/formatter.d.ts +46 -0
- package/dist/schemas/formatter.d.ts.map +1 -0
- package/dist/schemas/formatter.js +31 -0
- package/dist/schemas/formatter.js.map +1 -0
- package/dist/schemas/index.d.ts +12 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +18 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/logger.d.ts +48 -0
- package/dist/schemas/logger.d.ts.map +1 -0
- package/dist/schemas/logger.js +27 -0
- package/dist/schemas/logger.js.map +1 -0
- package/dist/schemas/output.d.ts +68 -0
- package/dist/schemas/output.d.ts.map +1 -0
- package/dist/schemas/output.js +48 -0
- package/dist/schemas/output.js.map +1 -0
- package/dist/schemas/sink.d.ts +52 -0
- package/dist/schemas/sink.d.ts.map +1 -0
- package/dist/schemas/sink.js +30 -0
- package/dist/schemas/sink.js.map +1 -0
- package/dist/sinks/buffer/buffer.descriptor.d.ts +4 -0
- package/dist/sinks/buffer/buffer.descriptor.d.ts.map +1 -0
- package/dist/sinks/buffer/buffer.descriptor.js +11 -0
- package/dist/sinks/buffer/buffer.descriptor.js.map +1 -0
- package/dist/sinks/buffer/buffer.impl.cli.d.ts +21 -0
- package/dist/sinks/buffer/buffer.impl.cli.d.ts.map +1 -0
- package/dist/sinks/buffer/buffer.impl.cli.js +34 -0
- package/dist/sinks/buffer/buffer.impl.cli.js.map +1 -0
- package/dist/sinks/console/console.descriptor.d.ts +10 -0
- package/dist/sinks/console/console.descriptor.d.ts.map +1 -0
- package/dist/sinks/console/console.descriptor.js +17 -0
- package/dist/sinks/console/console.descriptor.js.map +1 -0
- package/dist/sinks/console/console.impl.browser.d.ts +21 -0
- package/dist/sinks/console/console.impl.browser.d.ts.map +1 -0
- package/dist/sinks/console/console.impl.browser.js +57 -0
- package/dist/sinks/console/console.impl.browser.js.map +1 -0
- package/dist/sinks/console/console.impl.cli.d.ts +21 -0
- package/dist/sinks/console/console.impl.cli.d.ts.map +1 -0
- package/dist/sinks/console/console.impl.cli.js +57 -0
- package/dist/sinks/console/console.impl.cli.js.map +1 -0
- package/dist/sinks/index.d.ts +8 -0
- package/dist/sinks/index.d.ts.map +1 -0
- package/dist/sinks/index.js +8 -0
- package/dist/sinks/index.js.map +1 -0
- package/dist/sinks/memory/memory.descriptor.d.ts +10 -0
- package/dist/sinks/memory/memory.descriptor.d.ts.map +1 -0
- package/dist/sinks/memory/memory.descriptor.js +17 -0
- package/dist/sinks/memory/memory.descriptor.js.map +1 -0
- package/dist/sinks/memory/memory.impl.d.ts +50 -0
- package/dist/sinks/memory/memory.impl.d.ts.map +1 -0
- package/dist/sinks/memory/memory.impl.js +88 -0
- package/dist/sinks/memory/memory.impl.js.map +1 -0
- package/dist/sinks/stdout/stdout.descriptor.d.ts +4 -0
- package/dist/sinks/stdout/stdout.descriptor.d.ts.map +1 -0
- package/dist/sinks/stdout/stdout.descriptor.js +11 -0
- package/dist/sinks/stdout/stdout.descriptor.js.map +1 -0
- package/dist/sinks/stdout/stdout.impl.cli.d.ts +10 -0
- package/dist/sinks/stdout/stdout.impl.cli.d.ts.map +1 -0
- package/dist/sinks/stdout/stdout.impl.cli.js +21 -0
- package/dist/sinks/stdout/stdout.impl.cli.js.map +1 -0
- package/dist/sinks.context.descriptor.d.ts +19 -0
- package/dist/sinks.context.descriptor.d.ts.map +1 -0
- package/dist/sinks.context.descriptor.js +9 -0
- package/dist/sinks.context.descriptor.js.map +1 -0
- package/dist/sinks.context.impl.d.ts +9 -0
- package/dist/sinks.context.impl.d.ts.map +1 -0
- package/dist/sinks.context.impl.js +18 -0
- package/dist/sinks.context.impl.js.map +1 -0
- package/package.json +331 -0
- package/src/audit/audit.descriptor.ts +45 -0
- package/src/audit/audit.storage.schema.ts +57 -0
- package/src/audit/index.ts +8 -0
- package/src/cli/logs.descriptor.ts +19 -0
- package/src/cli/logs.list.descriptor.ts +28 -0
- package/src/cli/logs.list.impl.ts +93 -0
- package/src/cli/logs.rotate.descriptor.ts +40 -0
- package/src/cli/logs.rotate.impl.ts +61 -0
- package/src/cli/logs.search.descriptor.ts +61 -0
- package/src/cli/logs.search.impl.ts +173 -0
- package/src/cli/logs.tail.descriptor.ts +49 -0
- package/src/cli/logs.tail.impl.ts +105 -0
- package/src/cli/logs.view.descriptor.ts +57 -0
- package/src/cli/logs.view.impl.ts +108 -0
- package/src/cli/types.ts +59 -0
- package/src/contexts/audit.ts +36 -0
- package/src/contexts/fallback-logger.ts +80 -0
- package/src/contexts/index.ts +23 -0
- package/src/contexts/logger.ts +119 -0
- package/src/core/index.ts +32 -0
- package/src/core/logger.ts +150 -0
- package/src/core/namespace.ts +195 -0
- package/src/core/parsing.ts +21 -0
- package/src/core/types.ts +82 -0
- package/src/docs/levels.docs.descriptor.ts +344 -0
- package/src/docs/structured.docs.descriptor.ts +444 -0
- package/src/docs/transports.docs.descriptor.ts +428 -0
- package/src/formatters/index.ts +6 -0
- package/src/formatters/json/json.formatters.descriptor.ts +25 -0
- package/src/formatters/json/json.impl.ts +41 -0
- package/src/formatters/json5/json5.descriptor.ts +25 -0
- package/src/formatters/json5/json5.impl.ts +43 -0
- package/src/formatters/jsonl/jsonl.descriptor.ts +26 -0
- package/src/formatters/jsonl/jsonl.impl.ts +39 -0
- package/src/formatters/pretty/pretty.descriptor.ts +26 -0
- package/src/formatters/pretty/pretty.impl.cli.ts +101 -0
- package/src/index.ts +190 -0
- package/src/kinds/audit.ts +169 -0
- package/src/kinds/contexts.ts +22 -0
- package/src/kinds/formatter.ts +117 -0
- package/src/kinds/index.ts +25 -0
- package/src/kinds/logger.contracts.ts +17 -0
- package/src/kinds/logger.impl.ts +206 -0
- package/src/kinds/logger.ts +46 -0
- package/src/kinds/logger.utils.ts +91 -0
- package/src/kinds/output.contracts.ts +54 -0
- package/src/kinds/output.impl.ts +118 -0
- package/src/kinds/output.ts +59 -0
- package/src/kinds/output.types.ts +105 -0
- package/src/kinds/sink.ts +100 -0
- package/src/logger.context.descriptor.ts +13 -0
- package/src/logging.cli.plugin.ts +43 -0
- package/src/logging.plugin.ts +93 -0
- package/src/outputs/index.ts +6 -0
- package/src/outputs/remote/remote.descriptor.ts +27 -0
- package/src/outputs/remote/remote.impl.ts +218 -0
- package/src/outputs.context.descriptor.ts +10 -0
- package/src/outputs.context.impl.ts +30 -0
- package/src/paths.ts +10 -0
- package/src/schemas/audit.ts +98 -0
- package/src/schemas/entry.ts +88 -0
- package/src/schemas/formatter.ts +37 -0
- package/src/schemas/index.ts +80 -0
- package/src/schemas/logger.ts +38 -0
- package/src/schemas/output.ts +62 -0
- package/src/schemas/sink.ts +39 -0
- package/src/sinks/buffer/buffer.descriptor.ts +13 -0
- package/src/sinks/buffer/buffer.impl.cli.ts +49 -0
- package/src/sinks/console/console.descriptor.ts +20 -0
- package/src/sinks/console/console.impl.browser.ts +69 -0
- package/src/sinks/console/console.impl.cli.ts +71 -0
- package/src/sinks/index.ts +8 -0
- package/src/sinks/memory/memory.descriptor.ts +20 -0
- package/src/sinks/memory/memory.impl.ts +119 -0
- package/src/sinks/stdout/stdout.descriptor.ts +13 -0
- package/src/sinks/stdout/stdout.impl.cli.ts +27 -0
- package/src/sinks.context.descriptor.ts +10 -0
- package/src/sinks.context.impl.ts +30 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging Formatter Kind Definition
|
|
3
|
+
*
|
|
4
|
+
* Formatters serialize log entries to various output formats.
|
|
5
|
+
*/
|
|
6
|
+
import type { RuntimeKindDescriptor, KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
7
|
+
import { type FormatterDescriptor } from '../schemas/formatter.ts';
|
|
8
|
+
import type { RuntimeLogEntry } from '../schemas/entry.ts';
|
|
9
|
+
/**
|
|
10
|
+
* Formatter implementation interface.
|
|
11
|
+
* Implementations convert log entries to/from string representation.
|
|
12
|
+
*/
|
|
13
|
+
export interface FormatterImplementation {
|
|
14
|
+
/** Format a single log entry */
|
|
15
|
+
format(entry: RuntimeLogEntry): string;
|
|
16
|
+
/** Parse a formatted string back to log entry */
|
|
17
|
+
parse(formatted: string): RuntimeLogEntry;
|
|
18
|
+
/** Format multiple entries (batch optimization) */
|
|
19
|
+
formatBatch?(entries: RuntimeLogEntry[]): string;
|
|
20
|
+
/** Parse multiple formatted strings */
|
|
21
|
+
parseBatch?(formatted: string): RuntimeLogEntry[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Context provided to formatter implementations.
|
|
25
|
+
*/
|
|
26
|
+
export interface FormatterContext extends KindContext {
|
|
27
|
+
/** Runtime reference */
|
|
28
|
+
readonly runtime: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Formatter kind definition for runtime registration.
|
|
32
|
+
*/
|
|
33
|
+
export declare const formatterKind: RuntimeKindDescriptor<FormatterDescriptor, FormatterImplementation, FormatterContext>;
|
|
34
|
+
declare module '@vibesdotdev/runtime/schemas/kind-types' {
|
|
35
|
+
interface KindTypeMap {
|
|
36
|
+
'logging/formatter': {
|
|
37
|
+
descriptor: FormatterDescriptor;
|
|
38
|
+
impl: FormatterImplementation;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/kinds/formatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAqB,MAAM,mCAAmC,CAAC;AAE/G,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC,gCAAgC;IAChC,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC;IACvC,iDAAiD;IACjD,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IAC1C,mDAAmD;IACnD,WAAW,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IACjD,uCAAuC;IACvC,UAAU,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACpD,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAiED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAChD,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,CAOhB,CAAC;AAEF,OAAO,QAAQ,yCAAyC,CAAC;IACxD,UAAU,WAAW;QACpB,mBAAmB,EAAE;YAAE,UAAU,EAAE,mBAAmB,CAAC;YAAC,IAAI,EAAE,uBAAuB,CAAA;SAAE,CAAC;KACxF;CACD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging Formatter Kind Definition
|
|
3
|
+
*
|
|
4
|
+
* Formatters serialize log entries to various output formats.
|
|
5
|
+
*/
|
|
6
|
+
import { FormatterDescriptorSchema } from "../schemas/formatter.js";
|
|
7
|
+
/**
|
|
8
|
+
* Default formatter implementation - JSON output.
|
|
9
|
+
* Used when no specific implementation is registered.
|
|
10
|
+
*/
|
|
11
|
+
class DefaultFormatterImplementation {
|
|
12
|
+
id;
|
|
13
|
+
descriptor;
|
|
14
|
+
constructor(descriptor, _context) {
|
|
15
|
+
this.id = descriptor.id;
|
|
16
|
+
this.descriptor = descriptor;
|
|
17
|
+
}
|
|
18
|
+
format(entry) {
|
|
19
|
+
return JSON.stringify(entry);
|
|
20
|
+
}
|
|
21
|
+
parse(formatted) {
|
|
22
|
+
return JSON.parse(formatted);
|
|
23
|
+
}
|
|
24
|
+
formatBatch(entries) {
|
|
25
|
+
return entries.map((e) => this.format(e)).join('\n');
|
|
26
|
+
}
|
|
27
|
+
parseBatch(formatted) {
|
|
28
|
+
return formatted
|
|
29
|
+
.split('\n')
|
|
30
|
+
.filter((line) => line.trim())
|
|
31
|
+
.map((line) => this.parse(line));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Formatter kind resolution logic.
|
|
36
|
+
* Selects formatter based on format and hardware.
|
|
37
|
+
*/
|
|
38
|
+
function resolveFormatter(candidates, scope, _context) {
|
|
39
|
+
const typed = candidates;
|
|
40
|
+
if (typed.length === 0)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (typed.length === 1)
|
|
43
|
+
return typed[0];
|
|
44
|
+
const hardware = scope.hardware;
|
|
45
|
+
// Filter by hardware compatibility
|
|
46
|
+
const matching = typed.filter((d) => {
|
|
47
|
+
if (!d.hardware || d.hardware.length === 0)
|
|
48
|
+
return true;
|
|
49
|
+
return d.hardware.includes(hardware);
|
|
50
|
+
});
|
|
51
|
+
if (matching.length === 0)
|
|
52
|
+
return undefined;
|
|
53
|
+
// Prefer formatters with explicit hardware match
|
|
54
|
+
const explicit = matching.filter((d) => d.hardware && d.hardware.length > 0);
|
|
55
|
+
if (explicit.length > 0)
|
|
56
|
+
return explicit[0];
|
|
57
|
+
return matching[0];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Formatter kind definition for runtime registration.
|
|
61
|
+
*/
|
|
62
|
+
export const formatterKind = {
|
|
63
|
+
id: 'logging/formatter',
|
|
64
|
+
descriptorSchema: FormatterDescriptorSchema,
|
|
65
|
+
defaultImplementation: DefaultFormatterImplementation,
|
|
66
|
+
resolve: resolveFormatter,
|
|
67
|
+
contexts: []
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../src/kinds/formatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,yBAAyB,EAA4B,MAAM,yBAAyB,CAAC;AA0B9F;;;GAGG;AACH,MAAM,8BAA8B;IAC1B,EAAE,CAAS;IACX,UAAU,CAAsB;IAEzC,YAAY,UAA6B,EAAE,QAA0B;QACpE,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAiC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,KAAsB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAoB,CAAC;IACjD,CAAC;IAED,WAAW,CAAC,OAA0B;QACrC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,UAAU,CAAC,SAAiB;QAC3B,OAAO,SAAS;aACd,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;GAGG;AACH,SAAS,gBAAgB,CACxB,UAA+B,EAC/B,KAAmB,EACnB,QAAqB;IAErB,MAAM,KAAK,GAAG,UAAmC,CAAC;IAClD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAExC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAEhC,mCAAmC;IACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACnC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACxD,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE5C,iDAAiD;IACjD,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAItB;IACH,EAAE,EAAE,mBAAmB;IACvB,gBAAgB,EAAE,yBAAyB;IAC3C,qBAAqB,EAAE,8BAA8B;IACrD,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,EAAE;CACZ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { sinkKind, type SinkImplementation, type SinkContext } from './sink.ts';
|
|
2
|
+
import { formatterKind, type FormatterImplementation, type FormatterContext } from './formatter.ts';
|
|
3
|
+
import { outputKind, type OutputImplementation, type OutputContext } from './output.ts';
|
|
4
|
+
import { auditKind, type AuditImplementation, type AuditContext, type AuditLogInput, type AuditQueryOptions } from './audit.ts';
|
|
5
|
+
import { loggerKind } from './logger.ts';
|
|
6
|
+
import DefaultLoggerImplementation, { type LoggerImplementation, type LoggerContext } from './logger.impl';
|
|
7
|
+
export { sinkKind, type SinkImplementation, type SinkContext };
|
|
8
|
+
export { formatterKind, type FormatterImplementation, type FormatterContext };
|
|
9
|
+
export { outputKind, type OutputImplementation, type OutputContext };
|
|
10
|
+
export { auditKind, type AuditImplementation, type AuditContext, type AuditLogInput, type AuditQueryOptions };
|
|
11
|
+
export { loggerKind };
|
|
12
|
+
export { DefaultLoggerImplementation, type LoggerImplementation, type LoggerContext };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kinds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,KAAK,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EACN,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,2BAA2B,EAAE,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAE3G,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,CAAC;AACrE,OAAO,EACN,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,CAAC;AACF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { sinkKind } from "./sink.js";
|
|
2
|
+
import { formatterKind } from "./formatter.js";
|
|
3
|
+
import { outputKind } from "./output.js";
|
|
4
|
+
import { auditKind } from "./audit.js";
|
|
5
|
+
import { loggerKind } from "./logger.js";
|
|
6
|
+
import DefaultLoggerImplementation, {} from './logger.impl.js';
|
|
7
|
+
export { sinkKind };
|
|
8
|
+
export { formatterKind };
|
|
9
|
+
export { outputKind };
|
|
10
|
+
export { auditKind };
|
|
11
|
+
export { loggerKind };
|
|
12
|
+
export { DefaultLoggerImplementation };
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/kinds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA6C,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,aAAa,EAAuD,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAiD,MAAM,aAAa,CAAC;AACxF,OAAO,EACN,SAAS,EAKT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,2BAA2B,EAAE,EAAiD,MAAM,eAAe,CAAC;AAE3G,OAAO,EAAE,QAAQ,EAA6C,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAuD,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAiD,CAAC;AACrE,OAAO,EACN,SAAS,EAKT,CAAC;AACF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAiD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger kind context contract.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `./logger.impl.ts` so the helper module
|
|
5
|
+
* (`./logger.utils.ts`) can reference `LoggerContext` without forming a
|
|
6
|
+
* cycle (logger.impl imports value helpers from logger.utils).
|
|
7
|
+
*/
|
|
8
|
+
import type { KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
9
|
+
import type { OutputImplementation } from './output.contracts';
|
|
10
|
+
import type { SinkImplementation } from './sink.ts';
|
|
11
|
+
export interface LoggerContext extends KindContext {
|
|
12
|
+
readonly runtime: unknown;
|
|
13
|
+
readonly sinks?: Map<string, SinkImplementation> | SinkImplementation[];
|
|
14
|
+
readonly outputs?: Map<string, OutputImplementation> | OutputImplementation[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=logger.contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.contracts.d.ts","sourceRoot":"","sources":["../../src/kinds/logger.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,kBAAkB,EAAE,CAAC;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,oBAAoB,EAAE,CAAC;CAC9E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger kind context contract.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `./logger.impl.ts` so the helper module
|
|
5
|
+
* (`./logger.utils.ts`) can reference `LoggerContext` without forming a
|
|
6
|
+
* cycle (logger.impl imports value helpers from logger.utils).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=logger.contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.contracts.js","sourceRoot":"","sources":["../../src/kinds/logger.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RuntimeKindDescriptor } from '@vibesdotdev/runtime/schemas/kind';
|
|
2
|
+
import { type LoggerDescriptor } from '../schemas/logger.ts';
|
|
3
|
+
import { type LoggerImplementation } from './logger.impl';
|
|
4
|
+
import type { LoggerContext } from './contexts.ts';
|
|
5
|
+
export type { LoggerImplementation, LoggerContext };
|
|
6
|
+
export declare const loggerKind: RuntimeKindDescriptor<LoggerDescriptor, LoggerImplementation, LoggerContext>;
|
|
7
|
+
declare module '@vibesdotdev/runtime/schemas/kind-types' {
|
|
8
|
+
interface KindTypeMap {
|
|
9
|
+
'logging/logger': {
|
|
10
|
+
descriptor: LoggerDescriptor;
|
|
11
|
+
impl: LoggerImplementation;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/kinds/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAkC,MAAM,mCAAmC,CAAC;AAE/G,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAoC,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,CAAC;AAuBpD,eAAO,MAAM,UAAU,EAAE,qBAAqB,CAC7C,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,CAOb,CAAC;AAEF,OAAO,QAAQ,yCAAyC,CAAC;IACxD,UAAU,WAAW;QACpB,gBAAgB,EAAE;YAAE,UAAU,EAAE,gBAAgB,CAAC;YAAC,IAAI,EAAE,oBAAoB,CAAA;SAAE,CAAC;KAC/E;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LogContext, LoggerChildOptions, RequestLogContext, JobLogContext, PerformanceTrackerParams, PerformanceTracker } from '../schemas/entry.ts';
|
|
2
|
+
export type { PerformanceTracker } from '../schemas/entry.ts';
|
|
3
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/runtime/schemas/kind';
|
|
4
|
+
import type { KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
5
|
+
export type { LoggerContext } from './contexts.ts';
|
|
6
|
+
export interface LoggerImplementation {
|
|
7
|
+
readonly namespace: string;
|
|
8
|
+
readonly fullNamespace: string;
|
|
9
|
+
debug(message: string, context?: unknown): void;
|
|
10
|
+
info(message: string, context?: unknown): void;
|
|
11
|
+
warn(message: string, context?: unknown): void;
|
|
12
|
+
error(message: string, context?: unknown): void;
|
|
13
|
+
child(options: LoggerChildOptions): LoggerImplementation;
|
|
14
|
+
withContext(context: LogContext): LoggerImplementation;
|
|
15
|
+
withRequestContext(context: RequestLogContext): LoggerImplementation;
|
|
16
|
+
withJobContext(context: JobLogContext): LoggerImplementation;
|
|
17
|
+
performanceTracker(params: PerformanceTrackerParams): PerformanceTracker;
|
|
18
|
+
}
|
|
19
|
+
export default class DefaultLoggerImplementation implements LoggerImplementation {
|
|
20
|
+
readonly namespace: string;
|
|
21
|
+
readonly fullNamespace: string;
|
|
22
|
+
private readonly descriptor;
|
|
23
|
+
private readonly sinks;
|
|
24
|
+
private readonly outputs;
|
|
25
|
+
private readonly staticMetadata;
|
|
26
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext, fullNamespace?: string, additionalMetadata?: LogContext);
|
|
27
|
+
private getLevelSettings;
|
|
28
|
+
private emit;
|
|
29
|
+
debug(message: string, context?: unknown): void;
|
|
30
|
+
info(message: string, context?: unknown): void;
|
|
31
|
+
warn(message: string, context?: unknown): void;
|
|
32
|
+
error(message: string, context?: unknown): void;
|
|
33
|
+
private createContextualLogger;
|
|
34
|
+
child(options: LoggerChildOptions): LoggerImplementation;
|
|
35
|
+
withContext(context: LogContext): LoggerImplementation;
|
|
36
|
+
withRequestContext(context: RequestLogContext): LoggerImplementation;
|
|
37
|
+
withJobContext(context: JobLogContext): LoggerImplementation;
|
|
38
|
+
performanceTracker(params: PerformanceTrackerParams): PerformanceTracker;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=logger.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.impl.d.ts","sourceRoot":"","sources":["../../src/kinds/logger.impl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEX,UAAU,EAEV,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAa9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,OAAO,EAAE,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,CAAC,EAAE,OAAO,GAAG,IAAI;IAC9C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAC9C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAE/C,OAAO,CAAC,sBAAsB;IAS9B,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,oBAAoB;IAUxD,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;IAItD,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,oBAAoB;IAepE,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,oBAAoB;IAc5D,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;CAsBxE"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { shouldLog, getNamespaceSettings } from "../core/namespace.js";
|
|
2
|
+
import { resolveSinkContext, resolveOutputContext, createDefaultConsoleSink, deriveChildConfig, resolveSinks, resolveOutputs } from './logger.utils.js';
|
|
3
|
+
const defaultSink = createDefaultConsoleSink();
|
|
4
|
+
function normalizeLogContext(context) {
|
|
5
|
+
if (context === undefined || context === null) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
if (context instanceof Error) {
|
|
9
|
+
return {
|
|
10
|
+
errorName: context.name,
|
|
11
|
+
errorMessage: context.message,
|
|
12
|
+
stack: context.stack
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (typeof context === 'object' && !Array.isArray(context)) {
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
return { value: context };
|
|
19
|
+
}
|
|
20
|
+
export default class DefaultLoggerImplementation {
|
|
21
|
+
namespace;
|
|
22
|
+
fullNamespace;
|
|
23
|
+
descriptor;
|
|
24
|
+
sinks;
|
|
25
|
+
outputs;
|
|
26
|
+
staticMetadata;
|
|
27
|
+
constructor(descriptor, context, fullNamespace, additionalMetadata) {
|
|
28
|
+
this.descriptor = descriptor;
|
|
29
|
+
this.namespace = descriptor.namespace;
|
|
30
|
+
this.fullNamespace = fullNamespace ?? descriptor.namespace;
|
|
31
|
+
const typedCtx = context;
|
|
32
|
+
this.sinks = resolveSinks(descriptor, resolveSinkContext(typedCtx), defaultSink);
|
|
33
|
+
this.outputs = resolveOutputs(descriptor, resolveOutputContext(typedCtx));
|
|
34
|
+
this.staticMetadata = {
|
|
35
|
+
runtime: descriptor.runtime,
|
|
36
|
+
...descriptor.metadata,
|
|
37
|
+
...additionalMetadata
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
getLevelSettings() {
|
|
41
|
+
const base = getNamespaceSettings();
|
|
42
|
+
if (this.descriptor.level && base.defaultLevel !== this.descriptor.level) {
|
|
43
|
+
return { ...base, defaultLevel: this.descriptor.level };
|
|
44
|
+
}
|
|
45
|
+
return base;
|
|
46
|
+
}
|
|
47
|
+
emit(level, message, context) {
|
|
48
|
+
const settings = this.getLevelSettings();
|
|
49
|
+
if (!shouldLog({ namespace: this.fullNamespace, level, settings }))
|
|
50
|
+
return;
|
|
51
|
+
const entry = {
|
|
52
|
+
timestamp: new Date().toISOString(),
|
|
53
|
+
level,
|
|
54
|
+
namespace: this.fullNamespace,
|
|
55
|
+
message,
|
|
56
|
+
context: { ...this.staticMetadata, ...normalizeLogContext(context) }
|
|
57
|
+
};
|
|
58
|
+
for (const sink of this.sinks) {
|
|
59
|
+
try {
|
|
60
|
+
sink.emit(entry);
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
defaultSink.emit(entry);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const output of this.outputs) {
|
|
67
|
+
try {
|
|
68
|
+
output.write(entry).catch(() => { });
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
/* output sync error */
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
debug(message, context) { this.emit('debug', message, context); }
|
|
76
|
+
info(message, context) { this.emit('info', message, context); }
|
|
77
|
+
warn(message, context) { this.emit('warn', message, context); }
|
|
78
|
+
error(message, context) { this.emit('error', message, context); }
|
|
79
|
+
createContextualLogger(merged) {
|
|
80
|
+
return new DefaultLoggerImplementation(this.descriptor, { runtime: undefined, sinks: this.sinks, outputs: this.outputs }, this.fullNamespace, merged);
|
|
81
|
+
}
|
|
82
|
+
child(options) {
|
|
83
|
+
const { nextNamespace, childMetadata } = deriveChildConfig(this.fullNamespace, options);
|
|
84
|
+
return new DefaultLoggerImplementation(this.descriptor, { runtime: undefined, sinks: this.sinks, outputs: this.outputs }, nextNamespace, { ...this.staticMetadata, ...childMetadata });
|
|
85
|
+
}
|
|
86
|
+
withContext(context) {
|
|
87
|
+
return this.createContextualLogger({ ...this.staticMetadata, ...context });
|
|
88
|
+
}
|
|
89
|
+
withRequestContext(context) {
|
|
90
|
+
const s = this.staticMetadata;
|
|
91
|
+
return this.createContextualLogger({
|
|
92
|
+
...s,
|
|
93
|
+
requestId: context.requestId ?? s.requestId,
|
|
94
|
+
correlationId: context.correlationId ?? s.correlationId,
|
|
95
|
+
sessionId: context.sessionId ?? s.sessionId,
|
|
96
|
+
userId: context.userId ?? s.userId,
|
|
97
|
+
userAgent: context.userAgent ?? s.userAgent,
|
|
98
|
+
ip: context.ip ?? s.ip,
|
|
99
|
+
route: context.route ?? s.route,
|
|
100
|
+
method: context.method ?? s.method
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
withJobContext(context) {
|
|
104
|
+
const s = this.staticMetadata;
|
|
105
|
+
return this.createContextualLogger({
|
|
106
|
+
...s,
|
|
107
|
+
jobId: context.jobId ?? s.jobId,
|
|
108
|
+
queueId: context.queueId ?? s.queueId,
|
|
109
|
+
queueName: context.queueName ?? s.queueName,
|
|
110
|
+
toolId: context.toolId ?? s.toolId,
|
|
111
|
+
parentJobId: context.parentJobId ?? s.parentJobId,
|
|
112
|
+
attempt: context.attempt ?? s.attempt,
|
|
113
|
+
maxAttempts: context.maxAttempts ?? s.maxAttempts
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
performanceTracker(params) {
|
|
117
|
+
let startTime = 0;
|
|
118
|
+
const tracker = this.withContext({ operation: params.operation, ...params.metadata });
|
|
119
|
+
return {
|
|
120
|
+
start() {
|
|
121
|
+
startTime = Date.now();
|
|
122
|
+
tracker.debug(`operation.${params.operation}.start`);
|
|
123
|
+
},
|
|
124
|
+
end(successContext) {
|
|
125
|
+
const duration = Date.now() - startTime;
|
|
126
|
+
tracker.info(`operation.${params.operation}.success`, { duration, ...successContext });
|
|
127
|
+
},
|
|
128
|
+
fail(error, errorContext) {
|
|
129
|
+
const duration = Date.now() - startTime;
|
|
130
|
+
tracker.error(`operation.${params.operation}.failure`, {
|
|
131
|
+
duration,
|
|
132
|
+
error,
|
|
133
|
+
...errorContext
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=logger.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.impl.js","sourceRoot":"","sources":["../../src/kinds/logger.impl.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAA0B,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,GAAG,wBAAwB,EAAE,CAAC;AAgB/C,SAAS,mBAAmB,CAAC,OAAgB;IAC5C,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,OAAO,YAAY,KAAK,EAAE,CAAC;QAC9B,OAAO;YACN,SAAS,EAAE,OAAO,CAAC,IAAI;YACvB,YAAY,EAAE,OAAO,CA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M,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtF,OAAO;YACN,KAAK;gBACJ,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,SAAS,QAAQ,CAAC,CAAC;YACtD,CAAC;YACD,GAAG,CAAC,cAA2B;gBAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;gBACxC,OAAO,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,SAAS,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,IAAI,CAAC,KAAc,EAAE,YAAyB;gBAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;gBACxC,OAAO,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,SAAS,UAAU,EAAE;oBACtD,QAAQ;oBACR,KAAK;oBACL,GAAG,YAAY;iBACf,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LoggerDescriptorSchema } from "../schemas/logger.js";
|
|
2
|
+
import DefaultLoggerImplementation, {} from './logger.impl.js';
|
|
3
|
+
function resolveLogger(candidates, scope, _context) {
|
|
4
|
+
const typed = candidates;
|
|
5
|
+
if (typed.length === 0)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (typed.length === 1)
|
|
8
|
+
return typed[0];
|
|
9
|
+
const purposeToRuntime = {
|
|
10
|
+
cli: 'cli',
|
|
11
|
+
worker: 'worker',
|
|
12
|
+
mcp: 'mcp',
|
|
13
|
+
agent: 'server'
|
|
14
|
+
};
|
|
15
|
+
const runtime = purposeToRuntime[scope.purpose ?? ''] ?? 'server';
|
|
16
|
+
const matching = typed.filter((d) => d.runtime === runtime);
|
|
17
|
+
if (matching.length > 0)
|
|
18
|
+
return matching[0];
|
|
19
|
+
return typed[0];
|
|
20
|
+
}
|
|
21
|
+
export const loggerKind = {
|
|
22
|
+
id: 'logging/logger',
|
|
23
|
+
descriptorSchema: LoggerDescriptorSchema,
|
|
24
|
+
defaultImplementation: DefaultLoggerImplementation,
|
|
25
|
+
resolve: resolveLogger,
|
|
26
|
+
contexts: ['logging/sinks', 'logging/outputs']
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/kinds/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,sBAAsB,CAAC;AACrF,OAAO,2BAA2B,EAAE,EAA6B,MAAM,eAAe,CAAC;AAKvF,SAAS,aAAa,CACrB,UAA+B,EAC/B,KAAmB,EACnB,QAAqB;IAErB,MAAM,KAAK,GAAG,UAAgC,CAAC;IAC/C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAExC,MAAM,gBAAgB,GAA2B;QAChD,GAAG,EAAE,KAAK;QACV,MAAM,EAAE,QAAQ;QAChB,GAAG,EAAE,KAAK;QACV,KAAK,EAAE,QAAQ;KACf,CAAC;IACF,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,IAAI,QAAQ,CAAC;IAClE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC5D,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAInB;IACH,EAAE,EAAE,gBAAgB;IACpB,gBAAgB,EAAE,sBAAsB;IACxC,qBAAqB,EAAE,2BAA2B;IAClD,OAAO,EAAE,aAAa;IACtB,QAAQ,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;CAC9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LoggerDescriptor } from '../schemas/logger.ts';
|
|
2
|
+
import type { LogContext, LoggerChildOptions } from '../schemas/entry.ts';
|
|
3
|
+
import type { SinkImplementation } from './sink.ts';
|
|
4
|
+
import type { OutputImplementation } from './output.ts';
|
|
5
|
+
import type { LoggerContext } from './contexts.ts';
|
|
6
|
+
export declare function resolveSinkContext(context: LoggerContext): Map<string, SinkImplementation> | SinkImplementation[] | undefined;
|
|
7
|
+
export declare function resolveOutputContext(context: LoggerContext): Map<string, OutputImplementation> | OutputImplementation[] | undefined;
|
|
8
|
+
export declare function createDefaultConsoleSink(): SinkImplementation;
|
|
9
|
+
export declare function deriveChildConfig(parentNamespace: string, options: LoggerChildOptions): {
|
|
10
|
+
nextNamespace: string;
|
|
11
|
+
childMetadata: LogContext;
|
|
12
|
+
};
|
|
13
|
+
export declare function resolveSinks(descriptor: LoggerDescriptor, resolvedSinkContext: Map<string, SinkImplementation> | SinkImplementation[] | undefined, fallback: SinkImplementation): SinkImplementation[];
|
|
14
|
+
export declare function resolveOutputs(descriptor: LoggerDescriptor, resolvedOutputContext: Map<string, OutputImplementation> | OutputImplementation[] | undefined): OutputImplementation[];
|
|
15
|
+
//# sourceMappingURL=logger.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.utils.d.ts","sourceRoot":"","sources":["../../src/kinds/logger.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,aAAa,GACpB,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,kBAAkB,EAAE,GAAG,SAAS,CAOpE;AAED,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,aAAa,GACpB,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,oBAAoB,EAAE,GAAG,SAAS,CAOxE;AAED,wBAAgB,wBAAwB,IAAI,kBAAkB,CAQ7D;AAED,wBAAgB,iBAAiB,CAChC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,kBAAkB,GACzB;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,UAAU,CAAA;CAAE,CActD;AAED,wBAAgB,YAAY,CAC3B,UAAU,EAAE,gBAAgB,EAC5B,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,kBAAkB,EAAE,GAAG,SAAS,EACvF,QAAQ,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CAYtB;AAED,wBAAgB,cAAc,CAC7B,UAAU,EAAE,gBAAgB,EAC5B,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,oBAAoB,EAAE,GAAG,SAAS,GAC3F,oBAAoB,EAAE,CAYxB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function resolveSinkContext(context) {
|
|
2
|
+
const runtimeKeyed = context['logging/sinks'];
|
|
3
|
+
return context.sinks ?? runtimeKeyed;
|
|
4
|
+
}
|
|
5
|
+
export function resolveOutputContext(context) {
|
|
6
|
+
const runtimeKeyed = context['logging/outputs'];
|
|
7
|
+
return context.outputs ?? runtimeKeyed;
|
|
8
|
+
}
|
|
9
|
+
export function createDefaultConsoleSink() {
|
|
10
|
+
return {
|
|
11
|
+
emit(entry) {
|
|
12
|
+
const payload = JSON.stringify(entry.context);
|
|
13
|
+
const line = `[${entry.level.toUpperCase()}] [${entry.namespace}] ${entry.message} ${payload}`;
|
|
14
|
+
console.error(line);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function deriveChildConfig(parentNamespace, options) {
|
|
19
|
+
if (typeof options === 'string') {
|
|
20
|
+
return { nextNamespace: `${parentNamespace}:${options}`, childMetadata: {} };
|
|
21
|
+
}
|
|
22
|
+
const namespaceSuffix = typeof options.namespace === 'string'
|
|
23
|
+
? options.namespace
|
|
24
|
+
: typeof options.context === 'string'
|
|
25
|
+
? options.context
|
|
26
|
+
: undefined;
|
|
27
|
+
return {
|
|
28
|
+
nextNamespace: namespaceSuffix ? `${parentNamespace}:${namespaceSuffix}` : parentNamespace,
|
|
29
|
+
childMetadata: { ...options }
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function resolveSinks(descriptor, resolvedSinkContext, fallback) {
|
|
33
|
+
if (resolvedSinkContext instanceof Map) {
|
|
34
|
+
const resolved = descriptor.sinks
|
|
35
|
+
?.map((id) => resolvedSinkContext.get(id))
|
|
36
|
+
.filter((s) => s !== undefined) ?? [];
|
|
37
|
+
return resolved.length > 0 ? resolved : [fallback];
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(resolvedSinkContext) && resolvedSinkContext.length > 0) {
|
|
40
|
+
return resolvedSinkContext;
|
|
41
|
+
}
|
|
42
|
+
return [fallback];
|
|
43
|
+
}
|
|
44
|
+
export function resolveOutputs(descriptor, resolvedOutputContext) {
|
|
45
|
+
if (resolvedOutputContext instanceof Map) {
|
|
46
|
+
return (descriptor.outputs
|
|
47
|
+
?.map((id) => resolvedOutputContext.get(id))
|
|
48
|
+
.filter((o) => o !== undefined) ?? []);
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(resolvedOutputContext) && resolvedOutputContext.length > 0) {
|
|
51
|
+
return resolvedOutputContext;
|
|
52
|
+
}
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=logger.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.utils.js","sourceRoot":"","sources":["../../src/kinds/logger.utils.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,kBAAkB,CACjC,OAAsB;IAEtB,MAAM,YAAY,GACjB,OAGA,CAAC,eAAe,CAAC,CAAC;IACnB,OAAO,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,oBAAoB,CACnC,OAAsB;IAEtB,MAAM,YAAY,GACjB,OAGA,CAAC,iBAAiB,CAAC,CAAC;IACrB,OAAO,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,wBAAwB;IACvC,OAAO;QACN,IAAI,CAAC,KAAiF;YACrF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC9C,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,OAAO,IAAI,OAAO,EAAE,CAAC;YAC/F,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAChC,eAAuB,EACvB,OAA2B;IAE3B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,EAAE,aAAa,EAAE,GAAG,eAAe,IAAI,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;IAC9E,CAAC;IACD,MAAM,eAAe,GACpB,OAAO,OAAO,CAAC,SAAS,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;aAC3C,MAAM,CAAC,CAAC,CAAC,EAA6B,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,EAAE,CACjE,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9E,OAAO,qBAAqB,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output kind contract types.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `./output.ts` so the default implementation
|
|
5
|
+
* (`./output.impl.ts`) can implement these contracts without forming a
|
|
6
|
+
* cycle (output.ts itself imports the default implementation to wire it
|
|
7
|
+
* into the kind descriptor).
|
|
8
|
+
*/
|
|
9
|
+
import type { KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
10
|
+
import type { RuntimeLogEntry } from '../schemas/entry.ts';
|
|
11
|
+
import type { FormatterImplementation } from './formatter.ts';
|
|
12
|
+
export interface OutputReadOptions {
|
|
13
|
+
lines?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
filter?: string | RegExp;
|
|
16
|
+
ignoreCase?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface OutputTailOptions {
|
|
19
|
+
lines?: number;
|
|
20
|
+
filter?: string | RegExp;
|
|
21
|
+
ignoreCase?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface TailHandle {
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
export interface OutputStats {
|
|
27
|
+
size: number;
|
|
28
|
+
lines?: number;
|
|
29
|
+
modifiedAt?: Date;
|
|
30
|
+
exists: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface OutputImplementation {
|
|
33
|
+
write(entry: RuntimeLogEntry): Promise<void>;
|
|
34
|
+
writeBatch?(entries: RuntimeLogEntry[]): Promise<void>;
|
|
35
|
+
writeLine?(line: string): Promise<void>;
|
|
36
|
+
flush(): Promise<void>;
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
rotate?(): Promise<{
|
|
39
|
+
archived: string;
|
|
40
|
+
}>;
|
|
41
|
+
read(options?: OutputReadOptions): Promise<string[]>;
|
|
42
|
+
tail(callback: (line: string) => void, options?: OutputTailOptions): TailHandle;
|
|
43
|
+
stats(): Promise<OutputStats>;
|
|
44
|
+
}
|
|
45
|
+
export interface OutputContext extends KindContext {
|
|
46
|
+
readonly runtime: unknown;
|
|
47
|
+
readonly formatter?: FormatterImplementation;
|
|
48
|
+
readonly workspacePath?: string;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=output.contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.contracts.d.ts","sourceRoot":"","sources":["../../src/kinds/output.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IAC1B,KAAK,IAAI,IAAI,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACpC,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,UAAU,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,CAAC,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAAC;IAChF,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output kind contract types.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `./output.ts` so the default implementation
|
|
5
|
+
* (`./output.impl.ts`) can implement these contracts without forming a
|
|
6
|
+
* cycle (output.ts itself imports the default implementation to wire it
|
|
7
|
+
* into the kind descriptor).
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=output.contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.contracts.js","sourceRoot":"","sources":["../../src/kinds/output.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RuntimeKindDescriptor, KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
2
|
+
import { type OutputDescriptor } from '../schemas/output.ts';
|
|
3
|
+
import type { FormatterImplementation } from './formatter.ts';
|
|
4
|
+
import type { OutputImplementation } from './output.types';
|
|
5
|
+
export type { OutputReadOptions, OutputTailOptions, TailHandle, OutputStats, OutputImplementation } from './output.types';
|
|
6
|
+
export interface OutputContext extends KindContext {
|
|
7
|
+
readonly runtime: unknown;
|
|
8
|
+
readonly formatter?: FormatterImplementation;
|
|
9
|
+
readonly workspacePath?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const outputKind: RuntimeKindDescriptor<OutputDescriptor, OutputImplementation, OutputContext>;
|
|
12
|
+
declare module '@vibesdotdev/runtime/schemas/kind-types' {
|
|
13
|
+
interface KindTypeMap {
|
|
14
|
+
'logging/output': {
|
|
15
|
+
descriptor: OutputDescriptor;
|
|
16
|
+
impl: OutputImplementation;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/kinds/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAqB,MAAM,mCAAmC,CAAC;AAE/G,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,YAAY,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAChC;AAuBD,eAAO,MAAM,UAAU,EAAE,qBAAqB,CAC7C,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,CAOb,CAAC;AAEF,OAAO,QAAQ,yCAAyC,CAAC;IACxD,UAAU,WAAW;QACpB,gBAAgB,EAAE;YAAE,UAAU,EAAE,gBAAgB,CAAC;YAAC,IAAI,EAAE,oBAAoB,CAAA;SAAE,CAAC;KAC/E;CACD"}
|