@shpitdev/convex-cliproxy-observability 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 +11 -0
- package/LICENSE +201 -0
- package/README.md +40 -0
- package/dist/capture/index.d.ts +79 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/index.js +182 -0
- package/dist/capture/index.js.map +1 -0
- package/dist/client.d.ts +129 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +232 -0
- package/dist/client.js.map +1 -0
- package/dist/component/_generated/api.d.ts +12 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +7 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +17 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +3 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +8 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +3 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +21 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +11 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +4 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +4 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/ingest.d.ts +64 -0
- package/dist/component/ingest.d.ts.map +1 -0
- package/dist/component/ingest.js +309 -0
- package/dist/component/ingest.js.map +1 -0
- package/dist/component/queries.d.ts +136 -0
- package/dist/component/queries.d.ts.map +1 -0
- package/dist/component/queries.js +219 -0
- package/dist/component/queries.js.map +1 -0
- package/dist/component/schema.d.ts +159 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +74 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/content/index.d.ts +8 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +41 -0
- package/dist/content/index.js.map +1 -0
- package/dist/model-call/index.d.ts +120 -0
- package/dist/model-call/index.d.ts.map +1 -0
- package/dist/model-call/index.js +96 -0
- package/dist/model-call/index.js.map +1 -0
- package/dist/projection.d.ts +19 -0
- package/dist/projection.d.ts.map +1 -0
- package/dist/projection.js +83 -0
- package/dist/projection.js.map +1 -0
- package/dist/protocols/anthropic-messages.d.ts +11 -0
- package/dist/protocols/anthropic-messages.d.ts.map +1 -0
- package/dist/protocols/anthropic-messages.js +114 -0
- package/dist/protocols/anthropic-messages.js.map +1 -0
- package/dist/protocols/chat-completions.d.ts +10 -0
- package/dist/protocols/chat-completions.d.ts.map +1 -0
- package/dist/protocols/chat-completions.js +89 -0
- package/dist/protocols/chat-completions.js.map +1 -0
- package/dist/protocols/checkpoint.d.ts +20 -0
- package/dist/protocols/checkpoint.d.ts.map +1 -0
- package/dist/protocols/checkpoint.js +318 -0
- package/dist/protocols/checkpoint.js.map +1 -0
- package/dist/protocols/content.d.ts +34 -0
- package/dist/protocols/content.d.ts.map +1 -0
- package/dist/protocols/content.js +40 -0
- package/dist/protocols/content.js.map +1 -0
- package/dist/protocols/framing.d.ts +20 -0
- package/dist/protocols/framing.d.ts.map +1 -0
- package/dist/protocols/framing.js +67 -0
- package/dist/protocols/framing.js.map +1 -0
- package/dist/protocols/index.d.ts +20 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +139 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/output.d.ts +4 -0
- package/dist/protocols/output.d.ts.map +1 -0
- package/dist/protocols/output.js +81 -0
- package/dist/protocols/output.js.map +1 -0
- package/dist/protocols/responses.d.ts +12 -0
- package/dist/protocols/responses.d.ts.map +1 -0
- package/dist/protocols/responses.js +189 -0
- package/dist/protocols/responses.js.map +1 -0
- package/dist/protocols/types.d.ts +27 -0
- package/dist/protocols/types.d.ts.map +1 -0
- package/dist/protocols/types.js +2 -0
- package/dist/protocols/types.js.map +1 -0
- package/dist/protocols/usage.d.ts +3 -0
- package/dist/protocols/usage.d.ts.map +1 -0
- package/dist/protocols/usage.js +27 -0
- package/dist/protocols/usage.js.map +1 -0
- package/dist/protocols/values.d.ts +10 -0
- package/dist/protocols/values.d.ts.map +1 -0
- package/dist/protocols/values.js +32 -0
- package/dist/protocols/values.js.map +1 -0
- package/dist/test.d.ts +155 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +8 -0
- package/dist/test.js.map +1 -0
- package/package.json +90 -0
- package/src/capture/index.ts +277 -0
- package/src/client.ts +286 -0
- package/src/component/_generated/api.ts +19 -0
- package/src/component/_generated/component.ts +32 -0
- package/src/component/_generated/dataModel.ts +15 -0
- package/src/component/_generated/server.ts +43 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/ingest.ts +328 -0
- package/src/component/queries.ts +248 -0
- package/src/component/schema.ts +73 -0
- package/src/content/index.ts +53 -0
- package/src/model-call/index.ts +224 -0
- package/src/projection.ts +99 -0
- package/src/protocols/anthropic-messages.ts +115 -0
- package/src/protocols/chat-completions.ts +94 -0
- package/src/protocols/checkpoint.ts +342 -0
- package/src/protocols/content.ts +41 -0
- package/src/protocols/framing.ts +62 -0
- package/src/protocols/index.ts +140 -0
- package/src/protocols/output.ts +78 -0
- package/src/protocols/responses.ts +188 -0
- package/src/protocols/types.ts +26 -0
- package/src/protocols/usage.ts +36 -0
- package/src/protocols/values.ts +35 -0
- package/src/test.ts +16 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (unreleased)
|
|
4
|
+
|
|
5
|
+
- Stock CLIProxy native capture proof and private Convex component.
|
|
6
|
+
- Immutable batched raw admission, exact receipts, bounded queries and separate projection progress.
|
|
7
|
+
- ModelCallV1, structural OpenRouter/legacy adapters and TypeScript Messages, Responses and Chat parsers.
|
|
8
|
+
- Per-destination durable delivery, exact ACK/replay, private health and reserved control gaps.
|
|
9
|
+
- Fragment-aware credential redaction, all six protocol variants and real cancellation evidence.
|
|
10
|
+
- Checksummed Linux artifact packaging and exact-version npm release checks.
|
|
11
|
+
- No automatic retention expiry. Live activation remains a separate deployment gate.
|
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 2026 Anand Pant
|
|
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.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# CLIProxy observability
|
|
2
|
+
|
|
3
|
+
Private model-call capture for stock CLIProxyAPI 7.3.5. A separate native plugin and durable exporter feed this Convex component; the component stores bounded summaries and immutable private-content references. TypeScript owns client-protocol normalization.
|
|
4
|
+
|
|
5
|
+
This package is a release candidate. Native delivery and receiver normalization are implemented; publication, Meshix adoption and DEV activation require their separate release/deployment gates.
|
|
6
|
+
|
|
7
|
+
| Layer | Coverage | CI |
|
|
8
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
|
|
9
|
+
| Unit | Protocol framing, recorded replay, inherited Responses regressions | `check` |
|
|
10
|
+
| Integration | Authenticated receiver, Convex receipts/projection, private blob ownership | `check` |
|
|
11
|
+
| e2e api | Isolated nginx + official stock binary + simulated provider; six real success fixtures and one real cancellation recording | `native-capture` (offline playback only) |
|
|
12
|
+
| e2e web | None; host Ops integration is pending | No |
|
|
13
|
+
|
|
14
|
+
No deployed receiver or browser proof is claimed by these tests.
|
|
15
|
+
|
|
16
|
+
## Host integration
|
|
17
|
+
|
|
18
|
+
Mount `@shpitdev/convex-cliproxy-observability/convex.config` with `app.use`. Construct `CliproxyObservability(components.cliproxyObservability)` in the host backend. Expose a dedicated HTTP action through `handleCliproxyCaptureRequest`; use private receiver credentials, exact destination/instance enrollment and private blob storage. Never pass receiver credentials to inference sandboxes.
|
|
19
|
+
|
|
20
|
+
The host supplies `PrivateCaptureStorage.put/get` and a durable `scheduleProjection` callback. Projection actions call `projectPendingSegments`, rescheduling when `more` is true. Scheduler failure returns 503 after the raw receipt, making exporter retries safe. The host must monitor and recover failed projection actions; persisted raw content and receipts remain independently readable. No TTL or cleanup cron removes calls, receipts or content by default.
|
|
21
|
+
|
|
22
|
+
The receiver accepts `CaptureSegmentV1` from the `/capture` export: immutable NDJSON batches of up to 256 contiguous observations. A segment is at most 1408 KiB; the outer JSON envelope is at most 2 MiB. Each observation payload is at most 1 MiB. The exporter must persist batch boundaries before retrying. Identical identities and digests deduplicate; changed digests or overlapping ranges conflict.
|
|
23
|
+
|
|
24
|
+
## Reads and evidence
|
|
25
|
+
|
|
26
|
+
- `pageRecentSummaries` and `pageCorrelationSummaries` return at most three summaries under a 32 KiB response budget, using indexed keyset cursors.
|
|
27
|
+
- `getCall` reads one bounded record; `pageEventSegments` pages private references. `resolveCallBlob` requires membership in the host-authorized call manifest and checks size/hash while streaming.
|
|
28
|
+
- Raw admission and projection have separate sequence watermarks. Missing segments stop projection; invalid protocol data and missing usage remain explicit. Boot health retains loss counters and labels incomplete prior-boot calls unknown.
|
|
29
|
+
- `ModelCallV1` is the common read contract. `fromOpenRouterSpan` is a structural adapter with no runtime dependency on the OpenRouter component. `fromLegacyCliproxySpan` labels historical rows distinctly.
|
|
30
|
+
- Gateway identity is known. Selected provider, attempt detail and OAuth cost are unknown unless supported evidence exists. Pre-hook capture is unavailable; previews are not enrolled.
|
|
31
|
+
|
|
32
|
+
`projectCapturedPayloads` reconstructs selected-call content from bounded pages. Its 16 MiB replay limit is a read-operation bound, not a retention limit. Larger calls remain available through raw event pages. Summary checkpoints retain scalar state and private references for large unfinished frames; immutable segments retain text, reasoning, tools and native usage snapshots.
|
|
33
|
+
|
|
34
|
+
## Parser provenance
|
|
35
|
+
|
|
36
|
+
The client-protocol assemblers and Responses regressions were adapted from Meshix commit `737ea929919f82921accaa4171d6abed5c85a1cb` (the reviewed #1371 stack). Synthetic log fixtures are extracted only in tests; this package does not ingest legacy text logs. Sanitized real recordings and their provenance live in `fixtures/real`.
|
|
37
|
+
|
|
38
|
+
Run `pnpm --filter @shpitdev/convex-cliproxy-observability test`, `typecheck`, and `pack:check`. The latter installs the tarball in an isolated consumer with the minimum supported Convex version and checks exported APIs plus executable component test modules.
|
|
39
|
+
|
|
40
|
+
Copyright 2026 Anand Pant. Apache-2.0; the native ABI adapter includes its upstream MIT notice.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ExactCorrelation } from "../model-call/index.js";
|
|
2
|
+
export declare const MAX_ENVELOPE_BYTES: number;
|
|
3
|
+
export declare const MAX_CONTENT_BYTES: number;
|
|
4
|
+
export type CaptureObservationV1 = {
|
|
5
|
+
schemaVersion: 1;
|
|
6
|
+
pluginVersion: string;
|
|
7
|
+
redactionVersion: string;
|
|
8
|
+
destinationId: string;
|
|
9
|
+
instanceId: string;
|
|
10
|
+
pluginBootId: string;
|
|
11
|
+
requestId: string;
|
|
12
|
+
sequence: number;
|
|
13
|
+
kind: "request" | "response" | "stream_init" | "stream_chunk" | "completion" | "capture_health";
|
|
14
|
+
observedAt: string;
|
|
15
|
+
offsetNs: number;
|
|
16
|
+
route: string;
|
|
17
|
+
configRevision: string;
|
|
18
|
+
sourceFormat?: string;
|
|
19
|
+
requestedModel?: string;
|
|
20
|
+
sourceTraceId?: string;
|
|
21
|
+
correlation?: ExactCorrelation;
|
|
22
|
+
correlationConflicts?: string[];
|
|
23
|
+
stockChunkIndex?: number;
|
|
24
|
+
body?: string;
|
|
25
|
+
observedBodyBytes?: number;
|
|
26
|
+
bodyFraming?: "stock_json_chunk" | "stock_sse_candidate";
|
|
27
|
+
contentSha256: string;
|
|
28
|
+
contentBytes: number;
|
|
29
|
+
completionOutcome?: string;
|
|
30
|
+
executionStatusCode?: number;
|
|
31
|
+
executionStartedAt?: string;
|
|
32
|
+
executionCompletedAt?: string;
|
|
33
|
+
error?: string;
|
|
34
|
+
gap?: string;
|
|
35
|
+
bodyFromSequence?: number;
|
|
36
|
+
droppedObservationsTotal?: number;
|
|
37
|
+
scopeConflictsTotal?: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function sha256(bytes: Uint8Array): Promise<string>;
|
|
40
|
+
export declare function observationIdentity(o: CaptureObservationV1): Promise<string>;
|
|
41
|
+
export declare function callIdentity(o: Pick<CaptureObservationV1, "destinationId" | "instanceId" | "pluginBootId" | "requestId">): Promise<string>;
|
|
42
|
+
export declare function decodeBody(o: CaptureObservationV1): Uint8Array;
|
|
43
|
+
export declare function validateObservation(raw: Uint8Array, expected: {
|
|
44
|
+
destinationId: string;
|
|
45
|
+
instanceIds: readonly string[];
|
|
46
|
+
}): Promise<{
|
|
47
|
+
observation: CaptureObservationV1;
|
|
48
|
+
body: Uint8Array<ArrayBufferLike>;
|
|
49
|
+
identity: string;
|
|
50
|
+
callId: string;
|
|
51
|
+
digest: string;
|
|
52
|
+
}>;
|
|
53
|
+
/** One immutable NDJSON segment batches observations: no per-token Convex writes. */
|
|
54
|
+
export type CaptureSegmentV1 = {
|
|
55
|
+
schemaVersion: 1;
|
|
56
|
+
operation: "segment";
|
|
57
|
+
destinationId: string;
|
|
58
|
+
instanceId: string;
|
|
59
|
+
pluginBootId: string;
|
|
60
|
+
requestId: string;
|
|
61
|
+
firstSequence: number;
|
|
62
|
+
throughSequence: number;
|
|
63
|
+
contentSha256: string;
|
|
64
|
+
contentBytes: number;
|
|
65
|
+
contentBase64: string;
|
|
66
|
+
};
|
|
67
|
+
export declare const MAX_SEGMENT_BYTES: number;
|
|
68
|
+
export declare function validateSegment(raw: Uint8Array, expected: {
|
|
69
|
+
destinationId: string;
|
|
70
|
+
instanceIds: readonly string[];
|
|
71
|
+
}): Promise<{
|
|
72
|
+
envelope: CaptureSegmentV1;
|
|
73
|
+
observations: CaptureObservationV1[];
|
|
74
|
+
content: Uint8Array<ArrayBuffer>;
|
|
75
|
+
callId: string;
|
|
76
|
+
identity: string;
|
|
77
|
+
digest: string;
|
|
78
|
+
}>;
|
|
79
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capture/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAClD,eAAO,MAAM,iBAAiB,QAAc,CAAC;AAS7C,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,CAAC,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,gBAAgB,CAAC;IAChG,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,C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ACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AACF,eAAO,MAAM,iBAAiB,QAAc,CAAC;AAC7C,wBAAsB,eAAe,CACnC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;;;;;;;GAmEpE"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export const MAX_ENVELOPE_BYTES = 2 * 1024 * 1024;
|
|
2
|
+
export const MAX_CONTENT_BYTES = 1024 * 1024;
|
|
3
|
+
const id = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/;
|
|
4
|
+
const routes = new Set([
|
|
5
|
+
"GET /v1/models",
|
|
6
|
+
"POST /v1/messages",
|
|
7
|
+
"POST /v1/messages/count_tokens",
|
|
8
|
+
"POST /v1/responses",
|
|
9
|
+
"POST /v1/chat/completions",
|
|
10
|
+
]);
|
|
11
|
+
export async function sha256(bytes) {
|
|
12
|
+
const digest = await crypto.subtle.digest("SHA-256", Uint8Array.from(bytes));
|
|
13
|
+
return Array.from(new Uint8Array(digest), (v) => v.toString(16).padStart(2, "0")).join("");
|
|
14
|
+
}
|
|
15
|
+
export async function observationIdentity(o) {
|
|
16
|
+
return sha256(new TextEncoder().encode(JSON.stringify([
|
|
17
|
+
o.destinationId,
|
|
18
|
+
o.instanceId,
|
|
19
|
+
o.pluginBootId,
|
|
20
|
+
o.requestId,
|
|
21
|
+
o.sequence,
|
|
22
|
+
o.kind,
|
|
23
|
+
])));
|
|
24
|
+
}
|
|
25
|
+
export async function callIdentity(o) {
|
|
26
|
+
return sha256(new TextEncoder().encode(JSON.stringify([o.destinationId, o.instanceId, o.pluginBootId, o.requestId])));
|
|
27
|
+
}
|
|
28
|
+
export function decodeBody(o) {
|
|
29
|
+
const raw = o.body ?? "";
|
|
30
|
+
if (raw.length > Math.ceil(MAX_CONTENT_BYTES / 3) * 4 ||
|
|
31
|
+
!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(raw))
|
|
32
|
+
throw new Error("invalid body encoding");
|
|
33
|
+
const decoded = atob(raw);
|
|
34
|
+
if (decoded.length > MAX_CONTENT_BYTES || decoded.length !== o.contentBytes)
|
|
35
|
+
throw new Error("body size mismatch");
|
|
36
|
+
return Uint8Array.from(decoded, (c) => c.charCodeAt(0));
|
|
37
|
+
}
|
|
38
|
+
export async function validateObservation(raw, expected) {
|
|
39
|
+
if (raw.byteLength > MAX_ENVELOPE_BYTES)
|
|
40
|
+
throw new Error("envelope limit");
|
|
41
|
+
const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(raw));
|
|
42
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
43
|
+
throw new Error("observation required");
|
|
44
|
+
const o = value;
|
|
45
|
+
if (o.schemaVersion !== 1 ||
|
|
46
|
+
o.destinationId !== expected.destinationId ||
|
|
47
|
+
!expected.instanceIds.includes(o.instanceId))
|
|
48
|
+
throw new Error("scope mismatch");
|
|
49
|
+
for (const field of [
|
|
50
|
+
"destinationId",
|
|
51
|
+
"instanceId",
|
|
52
|
+
"pluginBootId",
|
|
53
|
+
"requestId",
|
|
54
|
+
"configRevision",
|
|
55
|
+
]) {
|
|
56
|
+
if (typeof o[field] !== "string" || !id.test(o[field]))
|
|
57
|
+
throw new Error("invalid identity");
|
|
58
|
+
}
|
|
59
|
+
if (!Number.isSafeInteger(o.sequence) ||
|
|
60
|
+
o.sequence < 1 ||
|
|
61
|
+
!Number.isSafeInteger(o.offsetNs) ||
|
|
62
|
+
o.offsetNs < 0 ||
|
|
63
|
+
!Number.isSafeInteger(o.contentBytes) ||
|
|
64
|
+
o.contentBytes < 0 ||
|
|
65
|
+
!routes.has(o.route) ||
|
|
66
|
+
!Number.isFinite(Date.parse(o.observedAt)))
|
|
67
|
+
throw new Error("invalid observation metadata");
|
|
68
|
+
if (!["request", "response", "stream_init", "stream_chunk", "completion"].includes(o.kind) ||
|
|
69
|
+
!/^[a-f0-9]{64}$/.test(o.contentSha256))
|
|
70
|
+
throw new Error("unsupported observation");
|
|
71
|
+
for (const [key, val] of Object.entries(o.correlation ?? {})) {
|
|
72
|
+
if (![
|
|
73
|
+
"requestId",
|
|
74
|
+
"runId",
|
|
75
|
+
"jobId",
|
|
76
|
+
"traceId",
|
|
77
|
+
"rootExecutionId",
|
|
78
|
+
"opencodeSessionId",
|
|
79
|
+
"operationId",
|
|
80
|
+
"stepId",
|
|
81
|
+
"partId",
|
|
82
|
+
"attemptId",
|
|
83
|
+
].includes(key) ||
|
|
84
|
+
typeof val !== "string" ||
|
|
85
|
+
val.length > 256)
|
|
86
|
+
throw new Error("invalid correlation");
|
|
87
|
+
}
|
|
88
|
+
if (o.correlationConflicts &&
|
|
89
|
+
(!Array.isArray(o.correlationConflicts) ||
|
|
90
|
+
o.correlationConflicts.length > 10 ||
|
|
91
|
+
o.correlationConflicts.some((x) => typeof x !== "string" || x.length > 64)))
|
|
92
|
+
throw new Error("invalid correlation conflicts");
|
|
93
|
+
for (const field of [
|
|
94
|
+
"pluginVersion",
|
|
95
|
+
"redactionVersion",
|
|
96
|
+
"sourceFormat",
|
|
97
|
+
"requestedModel",
|
|
98
|
+
"sourceTraceId",
|
|
99
|
+
"gap",
|
|
100
|
+
"completionOutcome",
|
|
101
|
+
]) {
|
|
102
|
+
if (o[field] !== undefined && (typeof o[field] !== "string" || o[field].length > 256))
|
|
103
|
+
throw new Error("invalid optional metadata");
|
|
104
|
+
}
|
|
105
|
+
if (!o.pluginVersion || !o.redactionVersion)
|
|
106
|
+
throw new Error("capture versions required");
|
|
107
|
+
if (o.kind === "completion" &&
|
|
108
|
+
!["succeeded", "failed", "canceled", "rejected"].includes(o.completionOutcome ?? ""))
|
|
109
|
+
throw new Error("invalid completion outcome");
|
|
110
|
+
if (o.bodyFraming !== undefined &&
|
|
111
|
+
!["stock_json_chunk", "stock_sse_candidate"].includes(o.bodyFraming))
|
|
112
|
+
throw new Error("invalid body framing");
|
|
113
|
+
if (o.observedBodyBytes !== undefined &&
|
|
114
|
+
(!Number.isSafeInteger(o.observedBodyBytes) ||
|
|
115
|
+
o.observedBodyBytes < 0 ||
|
|
116
|
+
o.observedBodyBytes > MAX_ENVELOPE_BYTES))
|
|
117
|
+
throw new Error("invalid observed byte count");
|
|
118
|
+
const body = decodeBody(o);
|
|
119
|
+
if ((await sha256(body)) !== o.contentSha256)
|
|
120
|
+
throw new Error("content digest mismatch");
|
|
121
|
+
return {
|
|
122
|
+
observation: o,
|
|
123
|
+
body,
|
|
124
|
+
identity: await observationIdentity(o),
|
|
125
|
+
callId: await callIdentity(o),
|
|
126
|
+
digest: await sha256(raw),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export const MAX_SEGMENT_BYTES = 1408 * 1024;
|
|
130
|
+
export async function validateSegment(raw, expected) {
|
|
131
|
+
if (raw.length > MAX_ENVELOPE_BYTES)
|
|
132
|
+
throw new Error("envelope limit");
|
|
133
|
+
const envelope = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(raw));
|
|
134
|
+
if (envelope.schemaVersion !== 1 ||
|
|
135
|
+
envelope.operation !== "segment" ||
|
|
136
|
+
envelope.destinationId !== expected.destinationId ||
|
|
137
|
+
!expected.instanceIds.includes(envelope.instanceId) ||
|
|
138
|
+
!Number.isSafeInteger(envelope.firstSequence) ||
|
|
139
|
+
!Number.isSafeInteger(envelope.throughSequence) ||
|
|
140
|
+
envelope.firstSequence < 1 ||
|
|
141
|
+
envelope.throughSequence < envelope.firstSequence ||
|
|
142
|
+
envelope.throughSequence - envelope.firstSequence >= 256 ||
|
|
143
|
+
typeof envelope.contentBase64 !== "string" ||
|
|
144
|
+
envelope.contentBase64.length > Math.ceil(MAX_SEGMENT_BYTES / 3) * 4)
|
|
145
|
+
throw new Error("invalid segment");
|
|
146
|
+
const content = Uint8Array.from(atob(envelope.contentBase64), (c) => c.charCodeAt(0));
|
|
147
|
+
if (content.byteLength !== envelope.contentBytes ||
|
|
148
|
+
content.byteLength > MAX_SEGMENT_BYTES ||
|
|
149
|
+
(await sha256(content)) !== envelope.contentSha256)
|
|
150
|
+
throw new Error("segment integrity failure");
|
|
151
|
+
const lines = new TextDecoder("utf-8", { fatal: true }).decode(content).split("\n");
|
|
152
|
+
if (lines.at(-1) === "")
|
|
153
|
+
lines.pop();
|
|
154
|
+
if (lines.length !== envelope.throughSequence - envelope.firstSequence + 1)
|
|
155
|
+
throw new Error("segment sequence count mismatch");
|
|
156
|
+
const observations = [];
|
|
157
|
+
for (const [index, line] of lines.entries()) {
|
|
158
|
+
const { observation } = await validateObservation(new TextEncoder().encode(line), expected);
|
|
159
|
+
if (observation.instanceId !== envelope.instanceId ||
|
|
160
|
+
observation.pluginBootId !== envelope.pluginBootId ||
|
|
161
|
+
observation.requestId !== envelope.requestId ||
|
|
162
|
+
observation.sequence !== envelope.firstSequence + index)
|
|
163
|
+
throw new Error("segment identity mismatch");
|
|
164
|
+
observations.push(observation);
|
|
165
|
+
}
|
|
166
|
+
const first = observations[0];
|
|
167
|
+
if (observations.some((o, index) => o.route !== first.route ||
|
|
168
|
+
o.configRevision !== first.configRevision ||
|
|
169
|
+
(o.kind === "completion" && index !== observations.length - 1)))
|
|
170
|
+
throw new Error("inconsistent segment lifecycle");
|
|
171
|
+
const callId = await callIdentity(first);
|
|
172
|
+
const identity = await sha256(new TextEncoder().encode(JSON.stringify([
|
|
173
|
+
envelope.destinationId,
|
|
174
|
+
envelope.instanceId,
|
|
175
|
+
envelope.pluginBootId,
|
|
176
|
+
envelope.requestId,
|
|
177
|
+
envelope.firstSequence,
|
|
178
|
+
envelope.throughSequence,
|
|
179
|
+
])));
|
|
180
|
+
return { envelope, observations, content, callId, identity, digest: envelope.contentSha256 };
|
|
181
|
+
}
|
|
182
|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