dsh-observe 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/LICENSE +201 -0
- package/README.es.md +198 -0
- package/README.hi.md +198 -0
- package/README.md +198 -0
- package/README.pt.md +198 -0
- package/README.zh.md +198 -0
- package/THIRD_PARTY_NOTICES.md +21 -0
- package/cordis.patch.yml +86 -0
- package/lib/index.js +1947 -0
- package/lib/typert.host.js +109 -0
- package/lib/types/backoff.d.ts +17 -0
- package/lib/types/backoff.d.ts.map +1 -0
- package/lib/types/backoff.js +17 -0
- package/lib/types/backoff.js.map +1 -0
- package/lib/types/collector.d.ts +83 -0
- package/lib/types/collector.d.ts.map +1 -0
- package/lib/types/collector.js +506 -0
- package/lib/types/collector.js.map +1 -0
- package/lib/types/config.d.ts +286 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +312 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/ids.d.ts +43 -0
- package/lib/types/ids.d.ts.map +1 -0
- package/lib/types/ids.js +63 -0
- package/lib/types/ids.js.map +1 -0
- package/lib/types/index.d.ts +35 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +162 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/model.d.ts +89 -0
- package/lib/types/model.d.ts.map +1 -0
- package/lib/types/model.js +25 -0
- package/lib/types/model.js.map +1 -0
- package/lib/types/pipeline.d.ts +71 -0
- package/lib/types/pipeline.d.ts.map +1 -0
- package/lib/types/pipeline.js +193 -0
- package/lib/types/pipeline.js.map +1 -0
- package/lib/types/pricing.d.ts +34 -0
- package/lib/types/pricing.d.ts.map +1 -0
- package/lib/types/pricing.js +45 -0
- package/lib/types/pricing.js.map +1 -0
- package/lib/types/project.d.ts +26 -0
- package/lib/types/project.d.ts.map +1 -0
- package/lib/types/project.js +52 -0
- package/lib/types/project.js.map +1 -0
- package/lib/types/remote.d.ts +28 -0
- package/lib/types/remote.d.ts.map +1 -0
- package/lib/types/remote.js +45 -0
- package/lib/types/remote.js.map +1 -0
- package/lib/types/sanitize.d.ts +78 -0
- package/lib/types/sanitize.d.ts.map +1 -0
- package/lib/types/sanitize.js +132 -0
- package/lib/types/sanitize.js.map +1 -0
- package/lib/types/sinks.d.ts +84 -0
- package/lib/types/sinks.d.ts.map +1 -0
- package/lib/types/sinks.js +434 -0
- package/lib/types/sinks.js.map +1 -0
- package/lib/types/spool.d.ts +113 -0
- package/lib/types/spool.d.ts.map +1 -0
- package/lib/types/spool.js +167 -0
- package/lib/types/spool.js.map +1 -0
- package/lib/types/typert.host.d.ts +93 -0
- package/lib/types/typert.host.d.ts.map +1 -0
- package/lib/types/typert.host.js +23 -0
- package/lib/types/typert.host.js.map +1 -0
- package/lib/types/version.d.ts +10 -0
- package/lib/types/version.d.ts.map +1 -0
- package/lib/types/version.js +10 -0
- package/lib/types/version.js.map +1 -0
- package/lib/types/wire.d.ts +206 -0
- package/lib/types/wire.d.ts.map +1 -0
- package/lib/types/wire.js +71 -0
- package/lib/types/wire.js.map +1 -0
- package/package.json +147 -0
- package/src/backoff.ts +20 -0
- package/src/collector.ts +561 -0
- package/src/config.ts +604 -0
- package/src/ids.ts +68 -0
- package/src/index.ts +186 -0
- package/src/model.ts +100 -0
- package/src/pipeline.ts +205 -0
- package/src/pricing.ts +55 -0
- package/src/project.ts +55 -0
- package/src/remote.ts +56 -0
- package/src/sanitize.ts +132 -0
- package/src/sinks.ts +471 -0
- package/src/spool.ts +196 -0
- package/src/typert.host.ts +24 -0
- package/src/version.ts +10 -0
- package/src/wire.ts +97 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-08-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- OpenTelemetry OTLP/HTTP and Langfuse export backends over the `session/event` stream: turn/step/tool/LLM spans, token and cost metrics, and sanitized LLM prompt/completion capture.
|
|
13
|
+
- Async batching with size- and timer-triggered flushes, a bounded durable offline buffer (storage-domain spool) with oldest-first eviction, and deterministic exponential-backoff retries.
|
|
14
|
+
- Pre-send sanitization layer: structural key-name redaction, built-in and configurable secret patterns, and per-surface character budgets.
|
|
15
|
+
- Optional Typert remote surface (`observe/status`, `observe/setEnabled`) with a runtime kill switch.
|
|
16
|
+
- Off-by-default mounting: `enabled: true` plus at least one backend is an explicit opt-in.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Config schema migrated to the current Schemastery API (`z.union([…, z.const(null)])` backends, explicit full-object defaults).
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Deterministic id digests now separate numeric and string structural parts (no `1`/`'1'` collisions).
|
|
25
|
+
- Langfuse batches emit exactly one `trace-create` per trace even when one batch carries several spans of the same trace.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.es.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 📊 dsh-observe
|
|
4
|
+
|
|
5
|
+
**Exportador de observabilidad OpenTelemetry y Langfuse para DeepSeek Harness.**
|
|
6
|
+
|
|
7
|
+
*Convierte los eventos de sesión en trazas OTLP y observaciones de Langfuse — saneado, con buffer y apagado por defecto.*
|
|
8
|
+
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://github.com/topics/dsh-plugin)
|
|
11
|
+
[](#)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-observe/actions)
|
|
13
|
+
[](https://github.com/PerryLink/dsh-observe/releases)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-observe)
|
|
15
|
+
[](https://www.npmjs.com/package/dsh-observe)
|
|
16
|
+
|
|
17
|
+
[English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Compatibility
|
|
24
|
+
|
|
25
|
+
| Superficie | Estado |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.0-rc.6` |
|
|
28
|
+
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
|
+
| Backends | OpenTelemetry OTLP/HTTP (traces + metrics, codificación JSON) y Langfuse (observabilidad de LLM) — uno o ambos |
|
|
30
|
+
| Modelo | Independiente del modelo: exporta el flujo `session/event`; no realiza llamadas a modelos |
|
|
31
|
+
|
|
32
|
+
## What you get
|
|
33
|
+
|
|
34
|
+
`dsh-observe` convierte el flujo `session/event` del harness en protocolos estándar de observabilidad:
|
|
35
|
+
|
|
36
|
+
- **Spans** — spans de turno, paso, llamada a herramienta (duración, estado, derivación de reintentos) y generación de LLM, enlazados en trazas por turno con ids deterministas.
|
|
37
|
+
- **Metrics** — contadores de tokens por provider/modelo, contadores de coste en USD (tabla de precios configurable) y el gauge opcional de presión de contexto desde `ctx.tokenMeter`.
|
|
38
|
+
- **Captura saneada** — los cuerpos de prompt y completion se redactan (nombres de clave estructurales + patrones de secretos integrados + tus patrones) y se truncan antes de encolar o enviar nada.
|
|
39
|
+
- **Fiabilidad** — lotes asíncronos (por tamaño y por temporizador), un buffer offline duradero y acotado (storage-domain) con desalojo del más antiguo, y reintentos con backoff exponencial determinista; los lotes no entregados sobreviven a reinicios.
|
|
40
|
+
- **Interruptor en tiempo de ejecución** — el Typert remote opcional (`observe/status`, `observe/setEnabled`) permite a una página de ajustes detener y reanudar la exportación sin desmontar.
|
|
41
|
+
- **Apagado por defecto** — `enabled: true` más al menos un backend es la adhesión explícita; de lo contrario no se captura ni se exporta nada.
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
flujo session/event
|
|
45
|
+
│ collector (spans de turno/paso/herramienta/LLM, métricas)
|
|
46
|
+
│ sanitize (claves, secretos, presupuestos)
|
|
47
|
+
├──▶ pipeline "otlp" ── cola ── flush ──▶ OTLP /v1/traces + /v1/metrics
|
|
48
|
+
│ └─ reintento/backoff ─┐
|
|
49
|
+
├──▶ pipeline "langfuse" ── cola ── flush ──▶ ingesta de Langfuse
|
|
50
|
+
│ └─ reintento/backoff ─┤
|
|
51
|
+
└────────── spool duradero (buffer offline, acotado) ◀┘
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
# 1. instala el bundle en tu perfil
|
|
58
|
+
dsh plugin --profile web add "github:PerryLink/dsh-observe#main"
|
|
59
|
+
|
|
60
|
+
# o desde npm (versiones publicadas)
|
|
61
|
+
dsh plugin --profile web add dsh-observe
|
|
62
|
+
|
|
63
|
+
# 2. configura un backend en el parche de tu perfil (cordis.yml) y reinicia
|
|
64
|
+
dsh --profile web
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Configuración OTLP mínima (la fila viene comentada en `cordis.patch.yml`):
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
- insert:
|
|
71
|
+
- id: dsh-observe
|
|
72
|
+
name: dsh-observe
|
|
73
|
+
config:
|
|
74
|
+
enabled: true
|
|
75
|
+
otlp:
|
|
76
|
+
endpoint: http://localhost:4318
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Luego verifica que la fila monta:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
dsh --profile web --dump-config | grep -A2 'id: dsh-observe'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Install & uninstall
|
|
86
|
+
|
|
87
|
+
- **Canal git** (último `main`): `dsh plugin --profile web add "github:PerryLink/dsh-observe#main"` — el script `prepare` compila solo con dependencias de producción.
|
|
88
|
+
- **Canal npm** (versiones publicadas): `dsh plugin --profile web add dsh-observe`.
|
|
89
|
+
- **Canal tarball**: `pnpm pack` en este repositorio y luego `dsh plugin --profile web add ./dsh-observe-<version>.tgz`.
|
|
90
|
+
- **Desinstalar**: `dsh plugin --profile web remove dsh-observe` (o elimina la fila del parche del perfil).
|
|
91
|
+
|
|
92
|
+
> Si pnpm informa `ERR_PNPM_IGNORED_BUILDS` para este paquete (la validación inofensiva del binario de plataforma de esbuild), añade `allowBuilds: { esbuild: true }` a tu `pnpm-workspace.yaml` — el CLI `dsh` imprime el fragmento exacto.
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
Todos los ajustes son campos `Config` de Schemastery (modificables desde cordis.yml). Una sobrescritura dirigida por id reemplaza toda la fila — vuelve a declarar cada clave que necesites. `cordis.patch.yml` documenta cada clave en línea.
|
|
97
|
+
|
|
98
|
+
| Key | Default | Meaning |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `enabled` | `false` | Interruptor maestro; `true` más al menos un backend es la adhesión explícita |
|
|
101
|
+
| `otlp` | `null` | Configuración del backend OTLP, o `null` para desactivarlo |
|
|
102
|
+
| `otlp.endpoint` | *(obligatorio)* | URL base de OTLP; `/v1/traces` y `/v1/metrics` se añaden |
|
|
103
|
+
| `otlp.serviceName` | `deepseek-harness` | Atributo de recurso `service.name` |
|
|
104
|
+
| `otlp.serviceVersion` | *(ninguno)* | Atributo de recurso `service.version` |
|
|
105
|
+
| `otlp.headers` | `{}` | Cabeceras extra fusionadas en cada petición de exportación |
|
|
106
|
+
| `otlp.timeoutMs` | `10000` | Tiempo de espera por petición |
|
|
107
|
+
| `langfuse` | `null` | Configuración del backend Langfuse, o `null` para desactivarlo |
|
|
108
|
+
| `langfuse.baseUrl` | `https://cloud.langfuse.com` | URL base de Langfuse |
|
|
109
|
+
| `langfuse.publicKey` | *(obligatorio)* | Clave pública del proyecto |
|
|
110
|
+
| `langfuse.secretKey` | *(obligatorio)* | Clave secreta del proyecto |
|
|
111
|
+
| `langfuse.release` | *(ninguno)* | Etiqueta release estampada en las trazas |
|
|
112
|
+
| `langfuse.timeoutMs` | `10000` | Tiempo de espera por petición |
|
|
113
|
+
| `capture.turns` | `true` | Spans de ciclo de vida del turno |
|
|
114
|
+
| `capture.steps` | `true` | Spans de ciclo de vida del paso |
|
|
115
|
+
| `capture.tools` | `true` | Spans de llamada a herramienta con argumentos/resultados saneados |
|
|
116
|
+
| `capture.llm` | `true` | Spans de generación de LLM |
|
|
117
|
+
| `llm.prompt` | `true` | Captura el prompt de petición saneado (`false` = solo tamaños) |
|
|
118
|
+
| `llm.completion` | `true` | Captura la completion saneada (`false` = solo tamaños) |
|
|
119
|
+
| `metadata.sessionId` | `true` | Atributo de id de sesión |
|
|
120
|
+
| `metadata.cwd` | `false` | Directorio de trabajo de la sesión (una ruta local — apagado por defecto) |
|
|
121
|
+
| `metadata.agentPreset` | `true` | Atributo de id del agent preset |
|
|
122
|
+
| `metadata.model` | `true` | Atributos de provider/modelo |
|
|
123
|
+
| `metrics.tokens` | `true` | Contadores de tokens por provider/modelo |
|
|
124
|
+
| `metrics.cost` | `true` | Contadores de coste en USD (necesitan reglas `pricing` que coincidan) |
|
|
125
|
+
| `metrics.contextTokens` | `true` | Gauge de presión de contexto (necesita `ctx.tokenMeter`) |
|
|
126
|
+
| `pricing` | `[]` | Tabla de precios, primera coincidencia gana: `{ provider?, model, inputPerToken, outputPerToken, cacheReadPerToken?, cacheWritePerToken? }` |
|
|
127
|
+
| `sanitize.enabled` | `true` | Interruptor maestro de redacción (`false` desactiva la redacción, nunca el truncado) |
|
|
128
|
+
| `sanitize.redactKeys` | `[]` | Subcadenas de nombre de clave extra (key/token/secret/password/authorization/credential/apiKey siempre se incluyen) |
|
|
129
|
+
| `sanitize.redactPatterns` | `[]` | Expresiones regulares de secretos extra |
|
|
130
|
+
| `sanitize.truncatePromptChars` | `4000` | Presupuesto de caracteres del prompt |
|
|
131
|
+
| `sanitize.truncateCompletionChars` | `4000` | Presupuesto de caracteres de la completion |
|
|
132
|
+
| `sanitize.truncateToolInputChars` | `2000` | Presupuesto de caracteres de los argumentos de herramienta |
|
|
133
|
+
| `sanitize.truncateToolOutputChars` | `2000` | Presupuesto de caracteres del resultado de herramienta |
|
|
134
|
+
| `sanitize.truncateAttributeChars` | `512` | Presupuesto de cadenas de atributos de span |
|
|
135
|
+
| `batch.maxRecords` | `256` | Flush cuando la cola alcanza este número de registros |
|
|
136
|
+
| `batch.flushIntervalMs` | `5000` | Intervalo de flush por temporizador |
|
|
137
|
+
| `batch.maxQueueRecords` | `2000` | Límite de la cola en memoria; el exceso se derrama al buffer |
|
|
138
|
+
| `batch.maxBufferRecords` | `10000` | Límite del buffer offline duradero; los registros más antiguos caen primero |
|
|
139
|
+
| `batch.bufferRetryIntervalMs` | `30000` | Intervalo de reintento del buffer offline |
|
|
140
|
+
| `retry.maxAttempts` | `5` | Intentos por lote, incluido el primero |
|
|
141
|
+
| `retry.baseDelayMs` | `1000` | Primer retardo de backoff |
|
|
142
|
+
| `retry.factor` | `2` | Multiplicador de backoff por fallo consecutivo |
|
|
143
|
+
| `retry.maxDelayMs` | `60000` | Techo de backoff |
|
|
144
|
+
| `remote.enabled` | `false` | Monta el Typert remote `observe` (interruptor) |
|
|
145
|
+
|
|
146
|
+
## Tools & surfaces
|
|
147
|
+
|
|
148
|
+
Este plugin **no registra herramientas de modelo** — es un exportador en segundo plano. Sus superficies:
|
|
149
|
+
|
|
150
|
+
- **Consume** `session/event` (recolección de spans/métricas), `session/flush` (impulso de exportación best-effort — el checkpoint de durabilidad nunca espera a un backend remoto) y `session/disposed`.
|
|
151
|
+
- **Servicio remote opcional** `observe` — `observe/status` devuelve el estado del interruptor, los backends configurados, la profundidad de cola y la ocupación del buffer; `observe/setEnabled` detiene y reanuda la exportación en tiempo de ejecución.
|
|
152
|
+
|
|
153
|
+
## Permissions & data
|
|
154
|
+
|
|
155
|
+
- **Permisos**: `network:outbound` hacia los endpoints que configures, `session:read` para el flujo de eventos, `storage:write` para el buffer offline; sin código nativo, sin acceso al sistema de archivos.
|
|
156
|
+
- **Datos**: todo lo enviado se deriva del registro de sesión y se sanea (redacción + truncado) antes de encolarse, almacenarse o transmitirse. El buffer offline solo guarda registros saneados, re-validados al leerlos.
|
|
157
|
+
- **Credenciales**: las claves pública/secreta de Langfuse viajan solo al endpoint de Langfuse configurado; las cabeceras OTLP solo al endpoint OTLP configurado. El plugin no almacena credenciales — guárdalas en referencias de credenciales o valores inyectados por entorno.
|
|
158
|
+
|
|
159
|
+
## Security boundaries
|
|
160
|
+
|
|
161
|
+
- **Apagado por defecto** — nada se captura ni se exporta salvo adhesión explícita.
|
|
162
|
+
- **Sanear antes de enviar** — redacción estructural de claves, patrones de secretos integrados (claves de API, tokens de GitHub, claves de AWS, credenciales bearer, claves privadas), tus patrones y presupuestos de caracteres se aplican antes de que un registro salga de memoria.
|
|
163
|
+
- **Re-validación en el límite duradero** — los registros leídos del almacenamiento se comprueban de nuevo antes de que un sink pueda verlos.
|
|
164
|
+
- **Fallo ruidoso, fallo contenido** — los fallos de exportación avisan, cuentan, reintentan y finalmente se guardan en el spool; un manejador de sesión que falla se captura y registra, de modo que la observabilidad nunca puede romper la ruta caliente del harness.
|
|
165
|
+
- **Model-visible ⟺ logged** — las exportaciones de prompt/completion proyectan solo la cabecera registrada y la superficie de sesión; el exportador no inventa contenido.
|
|
166
|
+
|
|
167
|
+
## Known limitations
|
|
168
|
+
|
|
169
|
+
- **Solo rc.6** — el plugin se desarrolla y prueba contra `@deepseek-ai/dsh@0.1.0-rc.6`; se espera que baselines más nuevos funcionen y el workflow compat mensual los verifica.
|
|
170
|
+
- **Las métricas evitan la ruta de reintento/spool** — las métricas OTLP se agregan de forma acumulativa, así que un flush perdido se autocura en el siguiente (por diseño, no es un fallo).
|
|
171
|
+
- **Sin muestreo** — toda familia de spans habilitada se exporta; ajusta los interruptores `capture.*` y `batch.maxBufferRecords` para sesiones de alto volumen.
|
|
172
|
+
|
|
173
|
+
## Development
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
pnpm install # node ^22.19 || >=24
|
|
177
|
+
pnpm run typecheck # tsc: src + tests contra el checkout local del harness
|
|
178
|
+
pnpm run typecheck:ci # tsc contra los tipos publicados 0.1.0-rc.6 (sin paths)
|
|
179
|
+
pnpm test # vitest: 95 tests, 13 suites (Context/Session/storage seam reales)
|
|
180
|
+
pnpm run test:coverage # puerta de cobertura (90/80/90/90)
|
|
181
|
+
pnpm run build # bundle tsdown + declaraciones tsc (lib/)
|
|
182
|
+
pnpm run verify:self-contained # las especificaciones de dependencias resuelven desde el registry
|
|
183
|
+
pnpm run verify:artifacts # cara ESM construida + bundle patch presentes
|
|
184
|
+
node scripts/check-readme-sync.mjs # puerta de sincronía de los cinco READMEs
|
|
185
|
+
pnpm pack # el tarball publicado
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Topics
|
|
189
|
+
|
|
190
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `deepseek`, `cordis`, `observability`, `opentelemetry`, `otlp`, `langfuse`, `tracing`
|
|
191
|
+
|
|
192
|
+
## Contributors
|
|
193
|
+
|
|
194
|
+
- [@PerryLink](https://github.com/PerryLink) — creador y mantenedor: collector, pipelines, spool, sinks OTLP/Langfuse, saneamiento y la documentación en cinco idiomas.
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
[Apache License 2.0](LICENSE) © 2026 dsh-observe contributors
|
package/README.hi.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 📊 dsh-observe
|
|
4
|
+
|
|
5
|
+
**DeepSeek Harness के लिए OpenTelemetry और Langfuse ऑब्ज़र्वेबिलिटी एक्सपोर्टर।**
|
|
6
|
+
|
|
7
|
+
*सेशन इवेंट्स को OTLP traces और Langfuse observations में बदलें — सैनिटाइज़्ड, बफ़र्ड, डिफ़ॉल्ट रूप से बंद।*
|
|
8
|
+
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://github.com/topics/dsh-plugin)
|
|
11
|
+
[](#)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-observe/actions)
|
|
13
|
+
[](https://github.com/PerryLink/dsh-observe/releases)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-observe)
|
|
15
|
+
[](https://www.npmjs.com/package/dsh-observe)
|
|
16
|
+
|
|
17
|
+
[English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Compatibility
|
|
24
|
+
|
|
25
|
+
| सतह | स्थिति |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.0-rc.6` |
|
|
28
|
+
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
|
+
| बैकएंड | OpenTelemetry OTLP/HTTP (traces + metrics, JSON एन्कोडिंग) और Langfuse (LLM ऑब्ज़र्वेबिलिटी) — एक या दोनों |
|
|
30
|
+
| मॉडल | मॉडल-स्वतंत्र: यह `session/event` स्ट्रीम निर्यात करता है; कोई मॉडल कॉल नहीं करता |
|
|
31
|
+
|
|
32
|
+
## What you get
|
|
33
|
+
|
|
34
|
+
`dsh-observe` हार्नेस की `session/event` स्ट्रीम को मानक ऑब्ज़र्वेबिलिटी प्रोटोकॉल में बदलता है:
|
|
35
|
+
|
|
36
|
+
- **Spans** — turn, step, टूल-कॉल (अवधि, स्थिति, पुनर्प्रयास व्युत्पत्ति) और LLM जनरेशन span, प्रति turn traces में जुड़े, नियतात्मक ids के साथ।
|
|
37
|
+
- **Metrics** — प्रति provider/model टोकन काउंटर, USD लागत काउंटर (कॉन्फ़िगर करने योग्य मूल्य तालिका) और `ctx.tokenMeter` से वैकल्पिक कॉन्टेक्स्ट-प्रेशर gauge।
|
|
38
|
+
- **सैनिटाइज़्ड कैप्चर** — prompt और completion बॉडी किसी भी कतार या भेजने से पहले रिडैक्ट (संरचनात्मक कुंजी नाम + अंतर्निहित गुप्त पैटर्न + आपके पैटर्न) और ट्रंकेट होते हैं।
|
|
39
|
+
- **विश्वसनीयता** — असिंक्रोनस बैचिंग (आकार- और टाइमर-ट्रिगर), एक सीमित टिकाऊ ऑफ़लाइन बफ़र (storage-domain) जिसमें सबसे पुराना पहले हटता है, और नियतात्मक एक्सपोनेंशियल-बैकऑफ पुनर्प्रयास; न पहुँचे बैच रीस्टार्ट के बाद भी बचे रहते हैं।
|
|
40
|
+
- **रनटाइम किल स्विच** — वैकल्पिक Typert remote (`observe/status`, `observe/setEnabled`) किसी सेटिंग पृष्ठ को बिना अनमाउंट किए निर्यात रोकने/फिर शुरू करने देता है।
|
|
41
|
+
- **डिफ़ॉल्ट रूप से बंद** — `enabled: true` और कम से कम एक बैकएंड ही स्पष्ट ऑप्ट-इन है; अन्यथा कुछ भी कैप्चर या निर्यात नहीं होता।
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
session/event स्ट्रीम
|
|
45
|
+
│ collector (turn/step/tool/llm spans, मेट्रिक्स)
|
|
46
|
+
│ sanitize (कुंजियाँ, रहस्य, बजट)
|
|
47
|
+
├──▶ pipeline "otlp" ── कतार ── flush ──▶ OTLP /v1/traces + /v1/metrics
|
|
48
|
+
│ └─ पुनर्प्रयास/बैकऑफ ─┐
|
|
49
|
+
├──▶ pipeline "langfuse" ── कतार ── flush ──▶ Langfuse ingestion
|
|
50
|
+
│ └─ पुनर्प्रयास/बैकऑफ ─┤
|
|
51
|
+
└────────── टिकाऊ spool (ऑफ़लाइन बफ़र, सीमित) ◀┘
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
# 1. बंडल को अपने प्रोफ़ाइल में इंस्टॉल करें
|
|
58
|
+
dsh plugin --profile web add "github:PerryLink/dsh-observe#main"
|
|
59
|
+
|
|
60
|
+
# या npm से (प्रकाशित रिलीज़)
|
|
61
|
+
dsh plugin --profile web add dsh-observe
|
|
62
|
+
|
|
63
|
+
# 2. अपने प्रोफ़ाइल पैच (cordis.yml) में एक बैकएंड कॉन्फ़िगर करें और पुनः आरंभ करें
|
|
64
|
+
dsh --profile web
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
न्यूनतम OTLP कॉन्फ़िगरेशन (`cordis.patch.yml` में पंक्ति कमेंट की हुई आती है):
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
- insert:
|
|
71
|
+
- id: dsh-observe
|
|
72
|
+
name: dsh-observe
|
|
73
|
+
config:
|
|
74
|
+
enabled: true
|
|
75
|
+
otlp:
|
|
76
|
+
endpoint: http://localhost:4318
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
फिर सत्यापित करें कि पंक्ति माउंट हुई:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
dsh --profile web --dump-config | grep -A2 'id: dsh-observe'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Install & uninstall
|
|
86
|
+
|
|
87
|
+
- **git चैनल** (नवीनतम `main`): `dsh plugin --profile web add "github:PerryLink/dsh-observe#main"` — `prepare` स्क्रिप्ट केवल प्रोडक्शन निर्भरताओं से बिल्ड करती है।
|
|
88
|
+
- **npm चैनल** (प्रकाशित रिलीज़): `dsh plugin --profile web add dsh-observe`।
|
|
89
|
+
- **tarball चैनल**: इस रेपो में `pnpm pack`, फिर `dsh plugin --profile web add ./dsh-observe-<version>.tgz`।
|
|
90
|
+
- **अनइंस्टॉल**: `dsh plugin --profile web remove dsh-observe` (या प्रोफ़ाइल पैच से पंक्ति हटाएँ)।
|
|
91
|
+
|
|
92
|
+
> यदि pnpm इस पैकेज के लिए `ERR_PNPM_IGNORED_BUILDS` दिखाता है (esbuild का हानिरहित प्लेटफ़ॉर्म-बाइनरी सत्यापन), तो अपने `pnpm-workspace.yaml` में `allowBuilds: { esbuild: true }` जोड़ें — `dsh` CLI सटीक स्निपेट प्रिंट करता है।
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
सभी समायोजन Schemastery `Config` फ़ील्ड हैं (cordis.yml से बदले जा सकते हैं)। id-लक्षित ओवरराइड पूरी पंक्ति बदल देता है — ज़रूरत की हर कुंजी फिर से लिखें। `cordis.patch.yml` हर कुंजी को इनलाइन समझाता है।
|
|
97
|
+
|
|
98
|
+
| Key | Default | Meaning |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `enabled` | `false` | मास्टर स्विच; `true` और कम से कम एक बैकएंड ही स्पष्ट ऑप्ट-इन है |
|
|
101
|
+
| `otlp` | `null` | OTLP बैकएंड कॉन्फ़िग, या इसे बंद करने के लिए `null` |
|
|
102
|
+
| `otlp.endpoint` | *(आवश्यक)* | OTLP आधार URL; `/v1/traces` और `/v1/metrics` जोड़े जाते हैं |
|
|
103
|
+
| `otlp.serviceName` | `deepseek-harness` | `service.name` रिसोर्स एट्रिब्यूट |
|
|
104
|
+
| `otlp.serviceVersion` | *(कोई नहीं)* | `service.version` रिसोर्स एट्रिब्यूट |
|
|
105
|
+
| `otlp.headers` | `{}` | हर निर्यात अनुरोध में मर्ज किए गए अतिरिक्त हेडर |
|
|
106
|
+
| `otlp.timeoutMs` | `10000` | प्रति-अनुरोध टाइमआउट |
|
|
107
|
+
| `langfuse` | `null` | Langfuse बैकएंड कॉन्फ़िग, या इसे बंद करने के लिए `null` |
|
|
108
|
+
| `langfuse.baseUrl` | `https://cloud.langfuse.com` | Langfuse आधार URL |
|
|
109
|
+
| `langfuse.publicKey` | *(आवश्यक)* | प्रोजेक्ट सार्वजनिक कुंजी |
|
|
110
|
+
| `langfuse.secretKey` | *(आवश्यक)* | प्रोजेक्ट गुप्त कुंजी |
|
|
111
|
+
| `langfuse.release` | *(कोई नहीं)* | traces पर मुहर लगा release टैग |
|
|
112
|
+
| `langfuse.timeoutMs` | `10000` | प्रति-अनुरोध टाइमआउट |
|
|
113
|
+
| `capture.turns` | `true` | turn जीवनचक्र spans |
|
|
114
|
+
| `capture.steps` | `true` | step जीवनचक्र spans |
|
|
115
|
+
| `capture.tools` | `true` | सैनिटाइज़्ड तर्कों/परिणामों के साथ टूल-कॉल spans |
|
|
116
|
+
| `capture.llm` | `true` | LLM जनरेशन spans |
|
|
117
|
+
| `llm.prompt` | `true` | सैनिटाइज़्ड अनुरोध prompt कैप्चर करें (`false` = केवल आकार) |
|
|
118
|
+
| `llm.completion` | `true` | सैनिटाइज़्ड completion कैप्चर करें (`false` = केवल आकार) |
|
|
119
|
+
| `metadata.sessionId` | `true` | सत्र id एट्रिब्यूट |
|
|
120
|
+
| `metadata.cwd` | `false` | सत्र कार्य निर्देशिका (स्थानीय पथ — डिफ़ॉल्ट रूप से बंद) |
|
|
121
|
+
| `metadata.agentPreset` | `true` | agent preset id एट्रिब्यूट |
|
|
122
|
+
| `metadata.model` | `true` | provider/model एट्रिब्यूट |
|
|
123
|
+
| `metrics.tokens` | `true` | प्रति provider/model टोकन काउंटर |
|
|
124
|
+
| `metrics.cost` | `true` | USD लागत काउंटर (मिलान के लिए `pricing` नियम चाहिए) |
|
|
125
|
+
| `metrics.contextTokens` | `true` | कॉन्टेक्स्ट-प्रेशर gauge (`ctx.tokenMeter` चाहिए) |
|
|
126
|
+
| `pricing` | `[]` | मूल्य तालिका, पहला मिलान जीतता है: `{ provider?, model, inputPerToken, outputPerToken, cacheReadPerToken?, cacheWritePerToken? }` |
|
|
127
|
+
| `sanitize.enabled` | `true` | रिडैक्शन मास्टर स्विच (`false` केवल रिडैक्शन बंद करता है, ट्रंकेशन कभी नहीं) |
|
|
128
|
+
| `sanitize.redactKeys` | `[]` | अतिरिक्त कुंजी-नाम सबस्ट्रिंग (key/token/secret/password/authorization/credential/apiKey हमेशा शामिल) |
|
|
129
|
+
| `sanitize.redactPatterns` | `[]` | अतिरिक्त गुप्त नियमित अभिव्यक्तियाँ |
|
|
130
|
+
| `sanitize.truncatePromptChars` | `4000` | prompt वर्ण बजट |
|
|
131
|
+
| `sanitize.truncateCompletionChars` | `4000` | completion वर्ण बजट |
|
|
132
|
+
| `sanitize.truncateToolInputChars` | `2000` | टूल तर्क वर्ण बजट |
|
|
133
|
+
| `sanitize.truncateToolOutputChars` | `2000` | टूल परिणाम वर्ण बजट |
|
|
134
|
+
| `sanitize.truncateAttributeChars` | `512` | span एट्रिब्यूट स्ट्रिंग बजट |
|
|
135
|
+
| `batch.maxRecords` | `256` | कतार में इतने रिकॉर्ड होते ही flush |
|
|
136
|
+
| `batch.flushIntervalMs` | `5000` | टाइमर flush अंतराल |
|
|
137
|
+
| `batch.maxQueueRecords` | `2000` | इन-मेमोरी कतार सीमा; अतिरिक्त बफ़र में जाता है |
|
|
138
|
+
| `batch.maxBufferRecords` | `10000` | टिकाऊ ऑफ़लाइन बफ़र सीमा; सबसे पुराने रिकॉर्ड पहले गिरते हैं |
|
|
139
|
+
| `batch.bufferRetryIntervalMs` | `30000` | ऑफ़लाइन बफ़र पुनर्प्रयास अंतराल |
|
|
140
|
+
| `retry.maxAttempts` | `5` | प्रति बैच प्रयास, पहली कोशिश सहित |
|
|
141
|
+
| `retry.baseDelayMs` | `1000` | पहला बैकऑफ विलंब |
|
|
142
|
+
| `retry.factor` | `2` | प्रति लगातार विफलता बैकऑफ गुणक |
|
|
143
|
+
| `retry.maxDelayMs` | `60000` | बैकऑफ सीमा |
|
|
144
|
+
| `remote.enabled` | `false` | `observe` Typert remote माउंट करें (किल स्विच) |
|
|
145
|
+
|
|
146
|
+
## Tools & surfaces
|
|
147
|
+
|
|
148
|
+
यह प्लगइन **कोई मॉडल टूल पंजीकृत नहीं करता** — यह एक पृष्ठभूमि निर्यातक है। इसकी सतहें:
|
|
149
|
+
|
|
150
|
+
- **उपभोग करता है** `session/event` (span/metric संग्रह), `session/flush` (बेस्ट-एफ़र्ट निर्यात किक — टिकाऊपन चेकपॉइंट कभी दूरस्थ बैकएंड का इंतज़ार नहीं करता) और `session/disposed`।
|
|
151
|
+
- **वैकल्पिक remote सेवा** `observe` — `observe/status` किल-स्विच स्थिति, कॉन्फ़िगर किए बैकएंड, कतार गहराई और बफ़र अधिभोग लौटाता है; `observe/setEnabled` रनटाइम पर निर्यात रोकता/फिर शुरू करता है।
|
|
152
|
+
|
|
153
|
+
## Permissions & data
|
|
154
|
+
|
|
155
|
+
- **अनुमतियाँ**: आपके कॉन्फ़िगर किए एंडपॉइंट तक `network:outbound`, इवेंट स्ट्रीम के लिए `session:read`, ऑफ़लाइन बफ़र के लिए `storage:write`; कोई नेटिव कोड नहीं, कोई फ़ाइल-सिस्टम पहुँच नहीं।
|
|
156
|
+
- **डेटा**: भेजी गई हर चीज़ सत्र लॉग से निकलती है और कतारबद्ध, बफ़र या प्रेषित होने से पहले सैनिटाइज़ होती है (रिडैक्शन + ट्रंकेशन)। ऑफ़लाइन बफ़र केवल सैनिटाइज़्ड रिकॉर्ड रखता है, जो पढ़े जाने पर फिर से सत्यापित होते हैं।
|
|
157
|
+
- **क्रेडेंशियल**: Langfuse सार्वजनिक/गुप्त कुंजियाँ केवल कॉन्फ़िगर किए Langfuse एंडपॉइंट तक जाती हैं; OTLP हेडर केवल कॉन्फ़िगर किए OTLP एंडपॉइंट तक। प्लगइन स्वयं कोई क्रेडेंशियल नहीं रखता — उन्हें क्रेडेंशियल संदर्भों या पर्यावरण-इंजेक्ट मानों में रखें।
|
|
158
|
+
|
|
159
|
+
## Security boundaries
|
|
160
|
+
|
|
161
|
+
- **डिफ़ॉल्ट रूप से बंद** — स्पष्ट ऑप्ट-इन के बिना कुछ भी कैप्चर या निर्यात नहीं होता।
|
|
162
|
+
- **भेजने से पहले सैनिटाइज़** — संरचनात्मक कुंजी रिडैक्शन, अंतर्निहित गुप्त पैटर्न (API कुंजियाँ, GitHub टोकन, AWS कुंजियाँ, bearer क्रेडेंशियल, निजी कुंजियाँ), आपके पैटर्न और वर्ण बजट सभी किसी भी रिकॉर्ड के मेमोरी छोड़ने से पहले लागू होते हैं।
|
|
163
|
+
- **टिकाऊ सीमा पर पुनः सत्यापन** — स्टोरेज से पढ़े रिकॉर्ड किसी sink के देखने से पहले फिर जाँचे जाते हैं।
|
|
164
|
+
- **विफलता ज़ोर से, विफलता सीमित** — निर्यात विफलताएँ चेतावनी देती हैं, गिनती करती हैं, पुनर्प्रयास करती हैं और अंत में spool में जाती हैं; विफल सत्र हैंडलर पकड़ा और लॉग होता है, इसलिए ऑब्ज़र्वेबिलिटी कभी हार्नेस का हॉट पाथ नहीं तोड़ सकती।
|
|
165
|
+
- **Model-visible ⟺ logged** — prompt/completion निर्यात केवल लॉग किए हेडर और सत्र सतह को प्रोजेक्ट करते हैं; निर्यातक कोई सामग्री नहीं गढ़ता।
|
|
166
|
+
|
|
167
|
+
## Known limitations
|
|
168
|
+
|
|
169
|
+
- **केवल rc.6** — प्लगइन `@deepseek-ai/dsh@0.1.0-rc.6` के विरुद्ध विकसित और परीक्षित है; नए हार्नेस बेसलाइन काम करने चाहिए और मासिक compat वर्कफ़्लो उन्हें सत्यापित करता है।
|
|
170
|
+
- **मेट्रिक्स पुनर्प्रयास/spool पथ से बचती हैं** — OTLP मेट्रिक्स संचयी रूप से एकत्र होती हैं, इसलिए खोया flush अगले में स्वयं-सुधर जाता है (डिज़ाइन से, बग नहीं)।
|
|
171
|
+
- **कोई सैंपलिंग नहीं** — हर सक्षम span परिवार निर्यात होता है; उच्च-मात्रा सत्रों के लिए `capture.*` स्विच और `batch.maxBufferRecords` समायोजित करें।
|
|
172
|
+
|
|
173
|
+
## Development
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
pnpm install # node ^22.19 || >=24
|
|
177
|
+
pnpm run typecheck # tsc: src + tests स्थानीय हार्नेस चेकआउट के विरुद्ध
|
|
178
|
+
pnpm run typecheck:ci # tsc प्रकाशित 0.1.0-rc.6 प्रकारों के विरुद्ध (बिना paths)
|
|
179
|
+
pnpm test # vitest: 95 टेस्ट, 13 सुइट (वास्तविक Context/Session/storage seam)
|
|
180
|
+
pnpm run test:coverage # कवरेज द्वार (90/80/90/90)
|
|
181
|
+
pnpm run build # tsdown बंडल + tsc घोषणाएँ (lib/)
|
|
182
|
+
pnpm run verify:self-contained # निर्भरता स्पेक registry से हल होती हैं
|
|
183
|
+
pnpm run verify:artifacts # निर्मित ESM फ़ेस + बंडल पैच मौजूद
|
|
184
|
+
node scripts/check-readme-sync.mjs # पाँच-भाषा README समन्वय द्वार
|
|
185
|
+
pnpm pack # प्रकाशित tarball
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Topics
|
|
189
|
+
|
|
190
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `deepseek`, `cordis`, `observability`, `opentelemetry`, `otlp`, `langfuse`, `tracing`
|
|
191
|
+
|
|
192
|
+
## Contributors
|
|
193
|
+
|
|
194
|
+
- [@PerryLink](https://github.com/PerryLink) — निर्माता और मेंटेनर: collector, pipelines, spool, OTLP/Langfuse sinks, सैनिटाइज़ेशन और पाँच-भाषा दस्तावेज़।
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
[Apache License 2.0](LICENSE) © 2026 dsh-observe contributors
|