@bli-cockpit/telemetry-core 0.1.10 → 0.1.13
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/dist/evidence-upload.d.ts +46 -2
- package/dist/evidence-upload.js +36 -3
- package/package.json +1 -1
|
@@ -7,12 +7,54 @@ import { z } from "zod";
|
|
|
7
7
|
* durable per-object ledger so interrupted uploads resume instead of
|
|
8
8
|
* re-sending bytes, and identical content is acknowledged without re-upload.
|
|
9
9
|
*/
|
|
10
|
-
export declare const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES: number;
|
|
11
10
|
export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES: number;
|
|
12
11
|
export declare const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES: number;
|
|
13
|
-
export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT =
|
|
12
|
+
export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 192;
|
|
13
|
+
export declare const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES: number;
|
|
14
14
|
export declare const RAW_EVIDENCE_UPLOAD_MAX_OBJECTS_PER_BEGIN = 25;
|
|
15
15
|
export declare const CODEX_SESSION_REPORT_MAX_SESSIONS = 200;
|
|
16
|
+
/**
|
|
17
|
+
* Receipt returned by the pre-ledger single-shot upload route. Older
|
|
18
|
+
* dashboards still use this path, so the collector must prove that a 2xx
|
|
19
|
+
* response names the exact durable object it requested.
|
|
20
|
+
*/
|
|
21
|
+
export declare const RawEvidenceLegacyUploadResponseSchema: z.ZodObject<{
|
|
22
|
+
ok: z.ZodLiteral<true>;
|
|
23
|
+
bucket: z.ZodString;
|
|
24
|
+
uploaded: z.ZodArray<z.ZodObject<{
|
|
25
|
+
raw_evidence_pointer_id: z.ZodString;
|
|
26
|
+
object_key: z.ZodString;
|
|
27
|
+
content_hash_sha256: z.ZodString;
|
|
28
|
+
byte_size: z.ZodNumber;
|
|
29
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
schema_version: z.ZodLiteral<"raw-evidence-redaction.v1">;
|
|
31
|
+
status: z.ZodLiteral<"sanitized">;
|
|
32
|
+
mode: z.ZodLiteral<"deterministic_text_replacement">;
|
|
33
|
+
applied_by: z.ZodArray<z.ZodEnum<{
|
|
34
|
+
local_collector: "local_collector";
|
|
35
|
+
server_commit: "server_commit";
|
|
36
|
+
legacy_upload: "legacy_upload";
|
|
37
|
+
}>>;
|
|
38
|
+
rule_counts: z.ZodArray<z.ZodObject<{
|
|
39
|
+
rule_id: z.ZodString;
|
|
40
|
+
match_count: z.ZodNumber;
|
|
41
|
+
redacted_char_count: z.ZodNumber;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
secret_like_match_count: z.ZodNumber;
|
|
44
|
+
redacted_fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
45
|
+
redacted_ranges: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
46
|
+
start: z.ZodNumber;
|
|
47
|
+
end: z.ZodNumber;
|
|
48
|
+
rule_id: z.ZodString;
|
|
49
|
+
}, z.core.$strict>>>;
|
|
50
|
+
original_content_hash_sha256: z.ZodOptional<z.ZodString>;
|
|
51
|
+
sanitized_content_hash_sha256: z.ZodOptional<z.ZodString>;
|
|
52
|
+
original_byte_size: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
sanitized_byte_size: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export type RawEvidenceLegacyUploadResponse = z.infer<typeof RawEvidenceLegacyUploadResponseSchema>;
|
|
16
58
|
export declare const RawEvidenceUploadBeginObjectSchema: z.ZodObject<{
|
|
17
59
|
pointer: z.ZodObject<{
|
|
18
60
|
raw_evidence_pointer_id: z.ZodString;
|
|
@@ -192,6 +234,7 @@ export declare const RawEvidenceUploadBeginResponseObjectSchema: z.ZodObject<{
|
|
|
192
234
|
}>;
|
|
193
235
|
upload_id: z.ZodOptional<z.ZodString>;
|
|
194
236
|
received_chunk_indexes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
237
|
+
commit_ready: z.ZodOptional<z.ZodBoolean>;
|
|
195
238
|
reason: z.ZodOptional<z.ZodString>;
|
|
196
239
|
}, z.core.$strict>;
|
|
197
240
|
export type RawEvidenceUploadBeginResponseObject = z.infer<typeof RawEvidenceUploadBeginResponseObjectSchema>;
|
|
@@ -208,6 +251,7 @@ export declare const RawEvidenceUploadBeginResponseSchema: z.ZodObject<{
|
|
|
208
251
|
}>;
|
|
209
252
|
upload_id: z.ZodOptional<z.ZodString>;
|
|
210
253
|
received_chunk_indexes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
254
|
+
commit_ready: z.ZodOptional<z.ZodBoolean>;
|
|
211
255
|
reason: z.ZodOptional<z.ZodString>;
|
|
212
256
|
}, z.core.$strict>>;
|
|
213
257
|
}, z.core.$strict>;
|
package/dist/evidence-upload.js
CHANGED
|
@@ -10,10 +10,20 @@ import { RawEvidenceRedactionMetadataSchema } from "./secret-guards.js";
|
|
|
10
10
|
* durable per-object ledger so interrupted uploads resume instead of
|
|
11
11
|
* re-sending bytes, and identical content is acknowledged without re-upload.
|
|
12
12
|
*/
|
|
13
|
-
export const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES = 10 * 1024 * 1024;
|
|
14
13
|
export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES = 3 * 1024 * 1024;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
// The normal collector does not override this value. Keep the default large
|
|
15
|
+
// enough that the advertised file cap fits within the maximum chunk count,
|
|
16
|
+
// while the base64 JSON request remains below Vercel's 4.5 MB body limit.
|
|
17
|
+
export const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES = RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES;
|
|
18
|
+
// Chunk COUNT is the safe axis for growing the file cap: chunk SIZE is pinned
|
|
19
|
+
// by Vercel's ~4.5MB request-body limit (see header comment). 192 chunks
|
|
20
|
+
// * 3 MiB gives a 576 MiB protocol ceiling above the current file cap.
|
|
21
|
+
export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 192;
|
|
22
|
+
// Final-object cap. The commit route still assembles and redaction-scans text
|
|
23
|
+
// in memory, so keep this below V8's string ceiling with practical headroom for
|
|
24
|
+
// buffers and redaction copies. 256 MiB covers the largest observed fleet
|
|
25
|
+
// session (118 MiB) with >2x headroom. Raising it requires a streaming commit.
|
|
26
|
+
export const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES = 256 * 1024 * 1024;
|
|
17
27
|
export const RAW_EVIDENCE_UPLOAD_MAX_OBJECTS_PER_BEGIN = 25;
|
|
18
28
|
export const CODEX_SESSION_REPORT_MAX_SESSIONS = 200;
|
|
19
29
|
const SafeLabelSchema = z
|
|
@@ -28,6 +38,26 @@ const BasenameSchema = z
|
|
|
28
38
|
.min(1)
|
|
29
39
|
.max(160)
|
|
30
40
|
.regex(/^[^/\\]+$/);
|
|
41
|
+
/**
|
|
42
|
+
* Receipt returned by the pre-ledger single-shot upload route. Older
|
|
43
|
+
* dashboards still use this path, so the collector must prove that a 2xx
|
|
44
|
+
* response names the exact durable object it requested.
|
|
45
|
+
*/
|
|
46
|
+
export const RawEvidenceLegacyUploadResponseSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
ok: z.literal(true),
|
|
49
|
+
bucket: NonEmptyStringSchema,
|
|
50
|
+
uploaded: z.array(z
|
|
51
|
+
.object({
|
|
52
|
+
raw_evidence_pointer_id: NonEmptyStringSchema,
|
|
53
|
+
object_key: NonEmptyStringSchema,
|
|
54
|
+
content_hash_sha256: Sha256Schema,
|
|
55
|
+
byte_size: z.number().int().nonnegative(),
|
|
56
|
+
redaction: RawEvidenceRedactionMetadataSchema.optional(),
|
|
57
|
+
})
|
|
58
|
+
.strict()),
|
|
59
|
+
})
|
|
60
|
+
.strict();
|
|
31
61
|
export const RawEvidenceUploadBeginObjectSchema = z
|
|
32
62
|
.object({
|
|
33
63
|
pointer: RawEvidencePointerSchema,
|
|
@@ -67,6 +97,9 @@ export const RawEvidenceUploadBeginResponseObjectSchema = z
|
|
|
67
97
|
disposition: RawEvidenceUploadDispositionSchema,
|
|
68
98
|
upload_id: NonEmptyStringSchema.optional(),
|
|
69
99
|
received_chunk_indexes: z.array(z.number().int().nonnegative()).default([]),
|
|
100
|
+
// A completed staged plan may use a chunk layout from an older collector.
|
|
101
|
+
// The client must commit it directly instead of mixing in its current plan.
|
|
102
|
+
commit_ready: z.boolean().optional(),
|
|
70
103
|
reason: SafeLabelSchema.optional(),
|
|
71
104
|
})
|
|
72
105
|
.strict();
|