@arona/core 0.0.1-dev.ff9c398 → 0.0.1-nightly.20261203.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Djobbo Maïga
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1 +1,87 @@
1
1
  # @arona/core
2
+
3
+ The platform-agnostic part of Arona:
4
+
5
+ - the `arona()` Vite plugin, which builds the bot as a Node SSR bundle and
6
+ restarts it in watch mode
7
+ - `BotNode`, `BotHost`, and `BotMessageTarget`: the shared renderer tree, host operations, and coalescing message lifecycle
8
+ - `mountBotMessage`, the scoped mount used by the Discord and Slack integrations
9
+ - `Telemetry`, an Effect Layer for OTLP tracing, metrics, and logs built on `effect/observability`
10
+ - small shared helpers
11
+
12
+ ```ts
13
+ // vite.config.ts
14
+ import Arona from "@arona/core/vite";
15
+ import { defineConfig } from "vite-plus";
16
+
17
+ export default defineConfig({
18
+ plugins: [Arona.plugin({ entry: "./src/index.ts" })],
19
+ });
20
+ ```
21
+
22
+ ```bash
23
+ # watch, rebuild, and restart the bot
24
+ vp build --watch --mode development
25
+
26
+ # build a bot for production into dist/index.js
27
+ vp build
28
+ ```
29
+
30
+ Bots are built as Node SSR bundles. Workspace packages stay external so native
31
+ modules and peer singletons resolve at runtime.
32
+
33
+ ## Observability
34
+
35
+ Arona traces message mounts, sends, edits, interactions, slash commands, Slack
36
+ events, and command reloads with Effect spans, and records matching counters and
37
+ duration histograms. Provide the telemetry Layer at your application root:
38
+
39
+ ```bash
40
+ OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 pnpm dev
41
+ ```
42
+
43
+ For local debugging without a collector, print finished spans to the console:
44
+
45
+ ```bash
46
+ ARONA_TELEMETRY_CONSOLE=true pnpm dev
47
+ ```
48
+
49
+ Or build a Layer explicitly:
50
+
51
+ ```ts
52
+ const Observability = Telemetry.layer({ console: true });
53
+ NodeRuntime.runMain(program.pipe(Effect.provide(Observability)));
54
+ ```
55
+
56
+ Console spans are indented by nesting depth and include duration and attributes.
57
+ Console mode replaces the OTLP trace exporter; metrics and logs still use an
58
+ endpoint when one is configured.
59
+
60
+ Supported variables:
61
+
62
+ - `OTEL_EXPORTER_OTLP_ENDPOINT` — OTLP/HTTP base URL (defaults to `http://localhost:4318` when `ARONA_TELEMETRY=1`)
63
+ - `OTEL_EXPORTER_OTLP_{TRACES,METRICS,LOGS}_ENDPOINT` — per-signal endpoint overrides
64
+ - `ARONA_TELEMETRY_CONSOLE=true` or `OTEL_TRACES_EXPORTER=console` — print spans to the console
65
+ - `OTEL_SERVICE_NAME`, `OTEL_SERVICE_VERSION`, `OTEL_RESOURCE_ATTRIBUTES`
66
+ - `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_EXPORTER_OTLP_COMPRESSION`
67
+ - `OTEL_{TRACES,METRICS,LOGS}_EXPORTER=otlp` and `ARONA_TELEMETRY_{TRACES,METRICS,LOGS}`
68
+ - `OTEL_SDK_DISABLED=true` or `ARONA_TELEMETRY=0` to disable everything
69
+
70
+ Or compose an explicit Layer:
71
+
72
+ ```ts
73
+ import { Telemetry } from "@arona/core";
74
+ import { Effect } from "effect";
75
+
76
+ const Observability = Telemetry.layer({
77
+ endpoint: "http://localhost:4318",
78
+ serviceName: "my-bot",
79
+ });
80
+
81
+ NodeRuntime.runMain(program.pipe(Effect.provide(Observability)));
82
+ ```
83
+
84
+ Use `Telemetry.withSpan` around your own effects when you want the same
85
+ operation duration and error metrics. Because telemetry is a Layer, its
86
+ exporters are flushed and released when the application Scope closes; there is
87
+ no separate shutdown call or process-wide runtime.