@lunora/observability 0.0.0 → 1.0.0-alpha.2

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.md ADDED
@@ -0,0 +1,282 @@
1
+ # Functional Source License, Version 1.1, Apache 2.0 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-Apache-2.0
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 anolilab and contributors
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or service
34
+ that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software that
39
+ exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee using
52
+ the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to the
59
+ infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
79
+ IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following will
93
+ apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
106
+
107
+ <!-- DEPENDENCIES -->
108
+
109
+ # Licenses of bundled dependencies
110
+ The published @lunora/observability artifact additionally contains code with the following licenses:
111
+ MIT
112
+
113
+ # Bundled dependencies:
114
+ ## @visulima/redact
115
+ License: MIT
116
+ By: Daniel Bannert
117
+ Repository: git+https://github.com/visulima/visulima.git
118
+
119
+ > MIT License
120
+ >
121
+ > Copyright (c) 2026 visulima
122
+ >
123
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
124
+ > of this software and associated documentation files (the "Software"), to deal
125
+ > in the Software without restriction, including without limitation the rights
126
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127
+ > copies of the Software, and to permit persons to whom the Software is
128
+ > furnished to do so, subject to the following conditions:
129
+ >
130
+ > The above copyright notice and this permission notice shall be included in all
131
+ > copies or substantial portions of the Software.
132
+ >
133
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
134
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
135
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
136
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
137
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
138
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
139
+ > SOFTWARE.
140
+ >
141
+ >
142
+ >
143
+ > # Licenses of bundled dependencies
144
+ > The published @visulima/redact artifact additionally contains code with the following licenses:
145
+ > MIT
146
+ >
147
+ > # Bundled dependencies:
148
+ > ## dot-prop
149
+ > License: MIT
150
+ > By: Sindre Sorhus
151
+ > Repository: sindresorhus/dot-prop
152
+ >
153
+ > > MIT License
154
+ > >
155
+ > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
156
+ > >
157
+ > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
158
+ > >
159
+ > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
160
+ > >
161
+ > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
162
+
163
+ ---------------------------------------
164
+
165
+ ## compromise
166
+ License: MIT
167
+ By: Spencer Kelly
168
+ Repository: git://github.com/spencermountain/compromise.git
169
+
170
+ > The MIT License (MIT)
171
+ >
172
+ > Copyright (c) 2019 Spencer Kelly
173
+ >
174
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
175
+ > of this software and associated documentation files (the "Software"), to deal
176
+ > in the Software without restriction, including without limitation the rights
177
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
178
+ > copies of the Software, and to permit persons to whom the Software is
179
+ > furnished to do so, subject to the following conditions:
180
+ >
181
+ > The above copyright notice and this permission notice shall be included in all
182
+ > copies or substantial portions of the Software.
183
+ >
184
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
185
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
186
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
187
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
188
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
189
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
190
+ > SOFTWARE.
191
+
192
+ ---------------------------------------
193
+
194
+ ## efrt
195
+ License: MIT
196
+ By: Spencer Kelly
197
+ Repository: git://github.com/spencermountain/efrt.git
198
+
199
+ > The MIT License (MIT)
200
+ >
201
+ > Copyright (c) 2020 Spencer Kelly
202
+ >
203
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
204
+ > of this software and associated documentation files (the "Software"), to deal
205
+ > in the Software without restriction, including without limitation the rights
206
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
207
+ > copies of the Software, and to permit persons to whom the Software is
208
+ > furnished to do so, subject to the following conditions:
209
+ >
210
+ > The above copyright notice and this permission notice shall be included in all
211
+ > copies or substantial portions of the Software.
212
+ >
213
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
214
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
215
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
216
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
217
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
218
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
219
+ > SOFTWARE.
220
+
221
+ ---------------------------------------
222
+
223
+ ## grad-school
224
+ License: MIT
225
+ By: Spencer Kelly
226
+ Repository: git+https://github.com/spencermountain/grounder.git
227
+
228
+ > MIT License
229
+ >
230
+ > Copyright (c) 2021 spencer kelly
231
+ >
232
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
233
+ > of this software and associated documentation files (the "Software"), to deal
234
+ > in the Software without restriction, including without limitation the rights
235
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
236
+ > copies of the Software, and to permit persons to whom the Software is
237
+ > furnished to do so, subject to the following conditions:
238
+ >
239
+ > The above copyright notice and this permission notice shall be included in all
240
+ > copies or substantial portions of the Software.
241
+ >
242
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
243
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
244
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
245
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
246
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
247
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
248
+ > SOFTWARE.
249
+
250
+ ---------------------------------------
251
+
252
+ ## suffix-thumb
253
+ License: MIT
254
+ By: Spencer Kelly
255
+ Repository: git://github.com/spencermountain/suffix-thumb.git
256
+
257
+ > The MIT License (MIT)
258
+ >
259
+ > Copyright (c) 2016 Spencer Kelly
260
+ >
261
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
262
+ > of this software and associated documentation files (the "Software"), to deal
263
+ > in the Software without restriction, including without limitation the rights
264
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
265
+ > copies of the Software, and to permit persons to whom the Software is
266
+ > furnished to do so, subject to the following conditions:
267
+ >
268
+ > The above copyright notice and this permission notice shall be included in all
269
+ > copies or substantial portions of the Software.
270
+ >
271
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
272
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
273
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
274
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
275
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
276
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
277
+ > SOFTWARE.
278
+
279
+ <!-- /DEPENDENCIES -->
280
+
281
+ <!-- TYPE_DEPENDENCIES -->
282
+ <!-- /TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -1,45 +1,34 @@
1
- # @lunora/observability
1
+ # `@lunora/observability`
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ Host-neutral telemetry storage and read models for Lunora — the data behind the Studio's Logs, Traces, Metrics and Issues views.
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ ## What's in it
6
6
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
7
+ | Area | Modules |
8
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
9
+ | **Logs** | `request-log` (durable, redacted request records), `log-buffer` (in-memory ring for the live tail) |
10
+ | **Traces** | `context-telemetry` (`ctx.trace` / span creation), `span-buffer` (ring + waterfall folding), `trace-context` (W3C traceparent) |
11
+ | **Metrics** | `function-metrics`, `query-metrics`, `auth-metrics`, `database-telemetry`, `metric-buffer`, `metric-history` |
12
+ | **Issues** | `issue-state` (grouping + status), `issue-explainer` (AI explanation of a grouped issue) |
13
+ | **Audit** | `security-audit` (configuration findings) |
14
+ | **Correlation** | `storage-correlation` |
8
15
 
9
- ## Purpose
16
+ ## Why it is its own package
10
17
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@lunora/observability`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
18
+ None of it is Cloudflare-specific. It reads and writes through the SQL handle the engine hands it, and it lived inside `@lunora/do` only because that is where the Durable Object it instruments happens to live.
15
19
 
16
- ## What is OIDC Trusted Publishing?
20
+ That mattered in practice: anything wanting request logs or metrics had to depend on the Cloudflare Durable Object package to get them. The dependency now runs `@lunora/do` → `@lunora/observability` → `@lunora/shard-engine`, so a second host consumes this directly rather than inheriting a provider-bound edge.
17
21
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
22
+ `@lunora/do` re-exports every symbol it previously exposed from these modules, so existing imports and the codegen-emitted surface are unchanged.
19
23
 
20
- ## Setup Instructions
24
+ ## Host-specific values are injected, not baked in
21
25
 
22
- To properly configure OIDC trusted publishing for this package:
26
+ Three details are Cloudflare's rather than this package's, so the host passes them:
23
27
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
+ - **AI model** — `explainIssue(binding, args, { defaultModel })`. `DEFAULT_EXPLAIN_ISSUE_MODEL` is a Workers AI id, exported so the Cloudflare host has a name to pass rather than a string literal.
29
+ - **Query batch size** `readIssueStates(sql, hashes, { hashQueryBatch })`. `DEFAULT_HASH_QUERY_BATCH` is 100, the Durable Object SQLite bound-parameter cap; a host with a different cap passes its own.
30
+ - **Span projections** — `HostSpanLike`, `HostTracingLike`, `HostTracingResolver`, `resolveHostTracing`, `fuseHostSpans`, `applyHostSpanAttributes`. Named for the role, not the provider. Cloudflare's `enterSpan` callback argument is one shape that satisfies them.
28
31
 
29
- ## DO NOT USE THIS PACKAGE
32
+ ## Importing it
30
33
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
34
+ Import from this package directly. `@lunora/do` deliberately does **not** re-export it — doing so would put the Cloudflare package back in the middle of a dependency it does not own, and would mean a second host reaching telemetry _through_ Cloudflare.