@jinn-network/core 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.
Files changed (111) hide show
  1. package/dist/canonical-json.d.ts +1 -0
  2. package/dist/canonical-json.js +67 -0
  3. package/dist/captured-task.d.ts +140 -0
  4. package/dist/captured-task.js +122 -0
  5. package/dist/contribution-store.d.ts +97 -0
  6. package/dist/contribution-store.js +770 -0
  7. package/dist/corpus-read/acquire.d.ts +39 -0
  8. package/dist/corpus-read/acquire.js +212 -0
  9. package/dist/corpus-read/cache.d.ts +14 -0
  10. package/dist/corpus-read/cache.js +17 -0
  11. package/dist/corpus-read/capture-meta.d.ts +16 -0
  12. package/dist/corpus-read/capture-meta.js +18 -0
  13. package/dist/corpus-read/create-corpus.d.ts +2 -0
  14. package/dist/corpus-read/create-corpus.js +97 -0
  15. package/dist/corpus-read/fetch-artifact.d.ts +21 -0
  16. package/dist/corpus-read/fetch-artifact.js +32 -0
  17. package/dist/corpus-read/fetch.d.ts +12 -0
  18. package/dist/corpus-read/fetch.js +24 -0
  19. package/dist/corpus-read/http-discovery.d.ts +9 -0
  20. package/dist/corpus-read/http-discovery.js +128 -0
  21. package/dist/corpus-read/index.d.ts +10 -0
  22. package/dist/corpus-read/index.js +10 -0
  23. package/dist/corpus-read/ipfs.d.ts +5 -0
  24. package/dist/corpus-read/ipfs.js +72 -0
  25. package/dist/corpus-read/route-resolver.d.ts +16 -0
  26. package/dist/corpus-read/route-resolver.js +19 -0
  27. package/dist/corpus-read/types.d.ts +177 -0
  28. package/dist/corpus-read/types.js +42 -0
  29. package/dist/envelope.d.ts +134 -0
  30. package/dist/envelope.js +162 -0
  31. package/dist/evidence-adapter.d.ts +26 -0
  32. package/dist/evidence-adapter.js +321 -0
  33. package/dist/evidence-filesystem.d.ts +40 -0
  34. package/dist/evidence-filesystem.js +267 -0
  35. package/dist/evidence-index.d.ts +117 -0
  36. package/dist/evidence-index.js +1083 -0
  37. package/dist/evidence-store-lock.d.ts +2 -0
  38. package/dist/evidence-store-lock.js +208 -0
  39. package/dist/execution-envelope.d.ts +3142 -0
  40. package/dist/execution-envelope.js +203 -0
  41. package/dist/index.d.ts +12 -0
  42. package/dist/index.js +12 -0
  43. package/dist/manifest.d.ts +75 -0
  44. package/dist/manifest.js +184 -0
  45. package/dist/paired.d.ts +68 -0
  46. package/dist/paired.js +92 -0
  47. package/dist/scrub/build.d.ts +52 -0
  48. package/dist/scrub/build.js +84 -0
  49. package/dist/scrub/emit-scrub.d.ts +41 -0
  50. package/dist/scrub/emit-scrub.js +87 -0
  51. package/dist/scrub/index.d.ts +12 -0
  52. package/dist/scrub/index.js +12 -0
  53. package/dist/scrub/key-policy.d.ts +20 -0
  54. package/dist/scrub/key-policy.js +42 -0
  55. package/dist/scrub/layer2.d.ts +23 -0
  56. package/dist/scrub/layer2.js +32 -0
  57. package/dist/scrub/ml-pii-stage.d.ts +24 -0
  58. package/dist/scrub/ml-pii-stage.js +42 -0
  59. package/dist/scrub/openredaction-stage.d.ts +196 -0
  60. package/dist/scrub/openredaction-stage.js +270 -0
  61. package/dist/scrub/pii-build.d.ts +38 -0
  62. package/dist/scrub/pii-build.js +67 -0
  63. package/dist/scrub/pipeline.d.ts +38 -0
  64. package/dist/scrub/pipeline.js +83 -0
  65. package/dist/scrub/plain-patterns-stage.d.ts +31 -0
  66. package/dist/scrub/plain-patterns-stage.js +84 -0
  67. package/dist/scrub/secretlint-stage.d.ts +36 -0
  68. package/dist/scrub/secretlint-stage.js +249 -0
  69. package/dist/scrub/transformers-detector.d.ts +35 -0
  70. package/dist/scrub/transformers-detector.js +67 -0
  71. package/dist/scrub/types.d.ts +25 -0
  72. package/dist/scrub/types.js +1 -0
  73. package/dist/session-provenance.d.ts +75 -0
  74. package/dist/session-provenance.js +20 -0
  75. package/dist/skill-artifact.d.ts +442 -0
  76. package/dist/skill-artifact.js +136 -0
  77. package/dist/trajectory/hash-chain.d.ts +18 -0
  78. package/dist/trajectory/hash-chain.js +47 -0
  79. package/dist/trajectory/index.d.ts +4 -0
  80. package/dist/trajectory/index.js +4 -0
  81. package/dist/trajectory/schema.d.ts +606 -0
  82. package/dist/trajectory/schema.js +110 -0
  83. package/dist/trajectory/transcript-parsers/aider-history.d.ts +42 -0
  84. package/dist/trajectory/transcript-parsers/aider-history.js +181 -0
  85. package/dist/trajectory/transcript-parsers/claude-code-jsonl.d.ts +37 -0
  86. package/dist/trajectory/transcript-parsers/claude-code-jsonl.js +142 -0
  87. package/dist/trajectory/transcript-parsers/codex-session.d.ts +42 -0
  88. package/dist/trajectory/transcript-parsers/codex-session.js +235 -0
  89. package/dist/trajectory/transcript-parsers/continue-devdata.d.ts +41 -0
  90. package/dist/trajectory/transcript-parsers/continue-devdata.js +190 -0
  91. package/dist/trajectory/transcript-parsers/cursor-sqlite.d.ts +38 -0
  92. package/dist/trajectory/transcript-parsers/cursor-sqlite.js +118 -0
  93. package/dist/trajectory/transcript-parsers/gemini-session.d.ts +35 -0
  94. package/dist/trajectory/transcript-parsers/gemini-session.js +137 -0
  95. package/dist/trajectory/transcript-parsers/index.d.ts +7 -0
  96. package/dist/trajectory/transcript-parsers/index.js +7 -0
  97. package/dist/trajectory/transcript-parsers/types.d.ts +101 -0
  98. package/dist/trajectory/transcript-parsers/types.js +32 -0
  99. package/dist/trajectory/transcript-to-spans/attrs.d.ts +4 -0
  100. package/dist/trajectory/transcript-to-spans/attrs.js +30 -0
  101. package/dist/trajectory/transcript-to-spans/claude-code-stream-json.d.ts +8 -0
  102. package/dist/trajectory/transcript-to-spans/claude-code-stream-json.js +162 -0
  103. package/dist/trajectory/transcript-to-spans/codex-exec-json.d.ts +8 -0
  104. package/dist/trajectory/transcript-to-spans/codex-exec-json.js +253 -0
  105. package/dist/trajectory/transcript-to-spans/index.d.ts +4 -0
  106. package/dist/trajectory/transcript-to-spans/index.js +4 -0
  107. package/dist/trajectory/transcript-to-spans/types.d.ts +18 -0
  108. package/dist/trajectory/transcript-to-spans/types.js +1 -0
  109. package/dist/window.d.ts +12 -0
  110. package/dist/window.js +5 -0
  111. package/package.json +67 -0
@@ -0,0 +1,47 @@
1
+ /**
2
+ * In-run per-span hash chain.
3
+ *
4
+ * Scope: §3.1 trajectory-signing-granularity row — "each span carries
5
+ * jinn.prevSpanHash linking to the previous span's hash; first span
6
+ * links to a run-start genesis value derived from envelope task CID."
7
+ *
8
+ * Motivation: a crashed run that failed to upload the signed trajectory
9
+ * blob still produces a verifiable-as-prefix trace if spans are recovered
10
+ * elsewhere (enclave memory dump, challenger capture). Partial authenticity
11
+ * is not zero.
12
+ */
13
+ import { bytesToHex } from '@noble/hashes/utils.js';
14
+ import { keccak_256 } from '@noble/hashes/sha3.js';
15
+ import canonicalize from 'canonicalize';
16
+ function coerceNonFinite(value) {
17
+ if (typeof value === 'number' && !Number.isFinite(value))
18
+ return null;
19
+ if (Array.isArray(value))
20
+ return value.map(coerceNonFinite);
21
+ if (value !== null && typeof value === 'object') {
22
+ const toJson = value.toJSON;
23
+ if (typeof toJson === 'function')
24
+ return coerceNonFinite(toJson.call(value));
25
+ const output = {};
26
+ for (const [key, entry] of Object.entries(value)) {
27
+ output[key] = coerceNonFinite(entry);
28
+ }
29
+ return output;
30
+ }
31
+ return value;
32
+ }
33
+ function canonicalJson(value) {
34
+ const result = canonicalize(coerceNonFinite(value));
35
+ return result ?? 'null';
36
+ }
37
+ function keccakUtf8(value) {
38
+ return `0x${bytesToHex(keccak_256(new TextEncoder().encode(value)))}`;
39
+ }
40
+ /** Genesis value for the chain — keccak256(JCS({runStart: taskCid})). */
41
+ export function computeGenesisHash(taskCid) {
42
+ return keccakUtf8(canonicalJson({ runStart: taskCid }));
43
+ }
44
+ /** Hash of a finalized span, to be set as jinn.prevSpanHash on the next one. */
45
+ export function computePrevSpanHash(span) {
46
+ return keccakUtf8(canonicalJson(span));
47
+ }
@@ -0,0 +1,4 @@
1
+ export * from './hash-chain.js';
2
+ export * from './schema.js';
3
+ export * from './transcript-parsers/index.js';
4
+ export * from './transcript-to-spans/index.js';
@@ -0,0 +1,4 @@
1
+ export * from './hash-chain.js';
2
+ export * from './schema.js';
3
+ export * from './transcript-parsers/index.js';
4
+ export * from './transcript-to-spans/index.js';
@@ -0,0 +1,606 @@
1
+ /**
2
+ * jinn.trajectory.v1 — OTLP-JSON-shaped trace blob signed and uploaded once
3
+ * per run. Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
4
+ * §3.1 trajectory row + K6 span profile, §4.3 trajectory profile deliverable.
5
+ *
6
+ * Each span carries jinn.prevSpanHash (in-run hash chain) + jinn.span.kind
7
+ * (normative profile). Secret-scrub (§4.3 V1 minimum) produces a run-level
8
+ * redactionManifest signed alongside the spans.
9
+ */
10
+ import { z } from 'zod/v3';
11
+ export declare const JinnSpanKindSchema: z.ZodEnum<["jinn.phase", "jinn.llm_call", "jinn.mcp_call", "jinn.artifact.emit", "jinn.venue_io", "jinn.state_transition", "jinn.agent_turn", "jinn.tool_call"]>;
12
+ export type JinnSpanKind = z.infer<typeof JinnSpanKindSchema>;
13
+ /** An OTLP-shaped span with Jinn-required attributes. */
14
+ export declare const SpanSchema: z.ZodObject<{
15
+ traceId: z.ZodString;
16
+ spanId: z.ZodString;
17
+ parentSpanId: z.ZodNullable<z.ZodString>;
18
+ name: z.ZodString;
19
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
20
+ startTimeUnixNano: z.ZodString;
21
+ endTimeUnixNano: z.ZodString;
22
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
23
+ events: z.ZodArray<z.ZodObject<{
24
+ timeUnixNano: z.ZodString;
25
+ name: z.ZodString;
26
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ name: string;
29
+ timeUnixNano: string;
30
+ attributes?: Record<string, unknown> | undefined;
31
+ }, {
32
+ name: string;
33
+ timeUnixNano: string;
34
+ attributes?: Record<string, unknown> | undefined;
35
+ }>, "many">;
36
+ status: z.ZodObject<{
37
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
38
+ message: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ code: "UNSET" | "OK" | "ERROR";
41
+ message?: string | undefined;
42
+ }, {
43
+ code: "UNSET" | "OK" | "ERROR";
44
+ message?: string | undefined;
45
+ }>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ spanId: string;
48
+ parentSpanId: string | null;
49
+ name: string;
50
+ startTimeUnixNano: string;
51
+ endTimeUnixNano: string;
52
+ attributes: Record<string, unknown>;
53
+ status: {
54
+ code: "UNSET" | "OK" | "ERROR";
55
+ message?: string | undefined;
56
+ };
57
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
58
+ events: {
59
+ name: string;
60
+ timeUnixNano: string;
61
+ attributes?: Record<string, unknown> | undefined;
62
+ }[];
63
+ traceId: string;
64
+ }, {
65
+ spanId: string;
66
+ parentSpanId: string | null;
67
+ name: string;
68
+ startTimeUnixNano: string;
69
+ endTimeUnixNano: string;
70
+ attributes: Record<string, unknown>;
71
+ status: {
72
+ code: "UNSET" | "OK" | "ERROR";
73
+ message?: string | undefined;
74
+ };
75
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
76
+ events: {
77
+ name: string;
78
+ timeUnixNano: string;
79
+ attributes?: Record<string, unknown> | undefined;
80
+ }[];
81
+ traceId: string;
82
+ }>;
83
+ export type Span = z.infer<typeof SpanSchema>;
84
+ export declare const RedactionManifestSchema: z.ZodEffects<z.ZodObject<{
85
+ spans: z.ZodArray<z.ZodObject<{
86
+ spanId: z.ZodString;
87
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
88
+ }, "strip", z.ZodTypeAny, {
89
+ spanId: string;
90
+ redactedKeys: string[];
91
+ }, {
92
+ spanId: string;
93
+ redactedKeys: string[];
94
+ }>, "many">;
95
+ totalRedactions: z.ZodNumber;
96
+ }, "strip", z.ZodTypeAny, {
97
+ spans: {
98
+ spanId: string;
99
+ redactedKeys: string[];
100
+ }[];
101
+ totalRedactions: number;
102
+ }, {
103
+ spans: {
104
+ spanId: string;
105
+ redactedKeys: string[];
106
+ }[];
107
+ totalRedactions: number;
108
+ }>, {
109
+ spans: {
110
+ spanId: string;
111
+ redactedKeys: string[];
112
+ }[];
113
+ totalRedactions: number;
114
+ }, {
115
+ spans: {
116
+ spanId: string;
117
+ redactedKeys: string[];
118
+ }[];
119
+ totalRedactions: number;
120
+ }>;
121
+ export type RedactionManifest = z.infer<typeof RedactionManifestSchema>;
122
+ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
123
+ schemaVersion: z.ZodLiteral<"jinn.trajectory.v1">;
124
+ runId: z.ZodString;
125
+ parentEnvelopeCid: z.ZodNullable<z.ZodString>;
126
+ spans: z.ZodArray<z.ZodObject<{
127
+ traceId: z.ZodString;
128
+ spanId: z.ZodString;
129
+ parentSpanId: z.ZodNullable<z.ZodString>;
130
+ name: z.ZodString;
131
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
132
+ startTimeUnixNano: z.ZodString;
133
+ endTimeUnixNano: z.ZodString;
134
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
135
+ events: z.ZodArray<z.ZodObject<{
136
+ timeUnixNano: z.ZodString;
137
+ name: z.ZodString;
138
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ name: string;
141
+ timeUnixNano: string;
142
+ attributes?: Record<string, unknown> | undefined;
143
+ }, {
144
+ name: string;
145
+ timeUnixNano: string;
146
+ attributes?: Record<string, unknown> | undefined;
147
+ }>, "many">;
148
+ status: z.ZodObject<{
149
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
150
+ message: z.ZodOptional<z.ZodString>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ code: "UNSET" | "OK" | "ERROR";
153
+ message?: string | undefined;
154
+ }, {
155
+ code: "UNSET" | "OK" | "ERROR";
156
+ message?: string | undefined;
157
+ }>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ spanId: string;
160
+ parentSpanId: string | null;
161
+ name: string;
162
+ startTimeUnixNano: string;
163
+ endTimeUnixNano: string;
164
+ attributes: Record<string, unknown>;
165
+ status: {
166
+ code: "UNSET" | "OK" | "ERROR";
167
+ message?: string | undefined;
168
+ };
169
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
170
+ events: {
171
+ name: string;
172
+ timeUnixNano: string;
173
+ attributes?: Record<string, unknown> | undefined;
174
+ }[];
175
+ traceId: string;
176
+ }, {
177
+ spanId: string;
178
+ parentSpanId: string | null;
179
+ name: string;
180
+ startTimeUnixNano: string;
181
+ endTimeUnixNano: string;
182
+ attributes: Record<string, unknown>;
183
+ status: {
184
+ code: "UNSET" | "OK" | "ERROR";
185
+ message?: string | undefined;
186
+ };
187
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
188
+ events: {
189
+ name: string;
190
+ timeUnixNano: string;
191
+ attributes?: Record<string, unknown> | undefined;
192
+ }[];
193
+ traceId: string;
194
+ }>, "many">;
195
+ redactionManifest: z.ZodEffects<z.ZodObject<{
196
+ spans: z.ZodArray<z.ZodObject<{
197
+ spanId: z.ZodString;
198
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
199
+ }, "strip", z.ZodTypeAny, {
200
+ spanId: string;
201
+ redactedKeys: string[];
202
+ }, {
203
+ spanId: string;
204
+ redactedKeys: string[];
205
+ }>, "many">;
206
+ totalRedactions: z.ZodNumber;
207
+ }, "strip", z.ZodTypeAny, {
208
+ spans: {
209
+ spanId: string;
210
+ redactedKeys: string[];
211
+ }[];
212
+ totalRedactions: number;
213
+ }, {
214
+ spans: {
215
+ spanId: string;
216
+ redactedKeys: string[];
217
+ }[];
218
+ totalRedactions: number;
219
+ }>, {
220
+ spans: {
221
+ spanId: string;
222
+ redactedKeys: string[];
223
+ }[];
224
+ totalRedactions: number;
225
+ }, {
226
+ spans: {
227
+ spanId: string;
228
+ redactedKeys: string[];
229
+ }[];
230
+ totalRedactions: number;
231
+ }>;
232
+ signature: z.ZodObject<{
233
+ algo: z.ZodLiteral<"secp256k1">;
234
+ signer: z.ZodString;
235
+ hash: z.ZodString;
236
+ sig: z.ZodString;
237
+ }, "strip", z.ZodTypeAny, {
238
+ algo: "secp256k1";
239
+ signer: string;
240
+ hash: string;
241
+ sig: string;
242
+ }, {
243
+ algo: "secp256k1";
244
+ signer: string;
245
+ hash: string;
246
+ sig: string;
247
+ }>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ schemaVersion: "jinn.trajectory.v1";
250
+ signature: {
251
+ algo: "secp256k1";
252
+ signer: string;
253
+ hash: string;
254
+ sig: string;
255
+ };
256
+ spans: {
257
+ spanId: string;
258
+ parentSpanId: string | null;
259
+ name: string;
260
+ startTimeUnixNano: string;
261
+ endTimeUnixNano: string;
262
+ attributes: Record<string, unknown>;
263
+ status: {
264
+ code: "UNSET" | "OK" | "ERROR";
265
+ message?: string | undefined;
266
+ };
267
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
268
+ events: {
269
+ name: string;
270
+ timeUnixNano: string;
271
+ attributes?: Record<string, unknown> | undefined;
272
+ }[];
273
+ traceId: string;
274
+ }[];
275
+ runId: string;
276
+ parentEnvelopeCid: string | null;
277
+ redactionManifest: {
278
+ spans: {
279
+ spanId: string;
280
+ redactedKeys: string[];
281
+ }[];
282
+ totalRedactions: number;
283
+ };
284
+ }, {
285
+ schemaVersion: "jinn.trajectory.v1";
286
+ signature: {
287
+ algo: "secp256k1";
288
+ signer: string;
289
+ hash: string;
290
+ sig: string;
291
+ };
292
+ spans: {
293
+ spanId: string;
294
+ parentSpanId: string | null;
295
+ name: string;
296
+ startTimeUnixNano: string;
297
+ endTimeUnixNano: string;
298
+ attributes: Record<string, unknown>;
299
+ status: {
300
+ code: "UNSET" | "OK" | "ERROR";
301
+ message?: string | undefined;
302
+ };
303
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
304
+ events: {
305
+ name: string;
306
+ timeUnixNano: string;
307
+ attributes?: Record<string, unknown> | undefined;
308
+ }[];
309
+ traceId: string;
310
+ }[];
311
+ runId: string;
312
+ parentEnvelopeCid: string | null;
313
+ redactionManifest: {
314
+ spans: {
315
+ spanId: string;
316
+ redactedKeys: string[];
317
+ }[];
318
+ totalRedactions: number;
319
+ };
320
+ }>;
321
+ export type JinnTrajectoryV1 = z.infer<typeof JinnTrajectoryV1Schema>;
322
+ /** Unsigned form — what we hash + sign. */
323
+ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
324
+ schemaVersion: z.ZodLiteral<"jinn.trajectory.v1">;
325
+ runId: z.ZodString;
326
+ parentEnvelopeCid: z.ZodNullable<z.ZodString>;
327
+ spans: z.ZodArray<z.ZodObject<{
328
+ traceId: z.ZodString;
329
+ spanId: z.ZodString;
330
+ parentSpanId: z.ZodNullable<z.ZodString>;
331
+ name: z.ZodString;
332
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
333
+ startTimeUnixNano: z.ZodString;
334
+ endTimeUnixNano: z.ZodString;
335
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
336
+ events: z.ZodArray<z.ZodObject<{
337
+ timeUnixNano: z.ZodString;
338
+ name: z.ZodString;
339
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ name: string;
342
+ timeUnixNano: string;
343
+ attributes?: Record<string, unknown> | undefined;
344
+ }, {
345
+ name: string;
346
+ timeUnixNano: string;
347
+ attributes?: Record<string, unknown> | undefined;
348
+ }>, "many">;
349
+ status: z.ZodObject<{
350
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
351
+ message: z.ZodOptional<z.ZodString>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ code: "UNSET" | "OK" | "ERROR";
354
+ message?: string | undefined;
355
+ }, {
356
+ code: "UNSET" | "OK" | "ERROR";
357
+ message?: string | undefined;
358
+ }>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ spanId: string;
361
+ parentSpanId: string | null;
362
+ name: string;
363
+ startTimeUnixNano: string;
364
+ endTimeUnixNano: string;
365
+ attributes: Record<string, unknown>;
366
+ status: {
367
+ code: "UNSET" | "OK" | "ERROR";
368
+ message?: string | undefined;
369
+ };
370
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
371
+ events: {
372
+ name: string;
373
+ timeUnixNano: string;
374
+ attributes?: Record<string, unknown> | undefined;
375
+ }[];
376
+ traceId: string;
377
+ }, {
378
+ spanId: string;
379
+ parentSpanId: string | null;
380
+ name: string;
381
+ startTimeUnixNano: string;
382
+ endTimeUnixNano: string;
383
+ attributes: Record<string, unknown>;
384
+ status: {
385
+ code: "UNSET" | "OK" | "ERROR";
386
+ message?: string | undefined;
387
+ };
388
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
389
+ events: {
390
+ name: string;
391
+ timeUnixNano: string;
392
+ attributes?: Record<string, unknown> | undefined;
393
+ }[];
394
+ traceId: string;
395
+ }>, "many">;
396
+ redactionManifest: z.ZodEffects<z.ZodObject<{
397
+ spans: z.ZodArray<z.ZodObject<{
398
+ spanId: z.ZodString;
399
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
400
+ }, "strip", z.ZodTypeAny, {
401
+ spanId: string;
402
+ redactedKeys: string[];
403
+ }, {
404
+ spanId: string;
405
+ redactedKeys: string[];
406
+ }>, "many">;
407
+ totalRedactions: z.ZodNumber;
408
+ }, "strip", z.ZodTypeAny, {
409
+ spans: {
410
+ spanId: string;
411
+ redactedKeys: string[];
412
+ }[];
413
+ totalRedactions: number;
414
+ }, {
415
+ spans: {
416
+ spanId: string;
417
+ redactedKeys: string[];
418
+ }[];
419
+ totalRedactions: number;
420
+ }>, {
421
+ spans: {
422
+ spanId: string;
423
+ redactedKeys: string[];
424
+ }[];
425
+ totalRedactions: number;
426
+ }, {
427
+ spans: {
428
+ spanId: string;
429
+ redactedKeys: string[];
430
+ }[];
431
+ totalRedactions: number;
432
+ }>;
433
+ signature: z.ZodObject<{
434
+ algo: z.ZodLiteral<"secp256k1">;
435
+ signer: z.ZodString;
436
+ hash: z.ZodString;
437
+ sig: z.ZodString;
438
+ }, "strip", z.ZodTypeAny, {
439
+ algo: "secp256k1";
440
+ signer: string;
441
+ hash: string;
442
+ sig: string;
443
+ }, {
444
+ algo: "secp256k1";
445
+ signer: string;
446
+ hash: string;
447
+ sig: string;
448
+ }>;
449
+ }, "signature">, "strip", z.ZodTypeAny, {
450
+ schemaVersion: "jinn.trajectory.v1";
451
+ spans: {
452
+ spanId: string;
453
+ parentSpanId: string | null;
454
+ name: string;
455
+ startTimeUnixNano: string;
456
+ endTimeUnixNano: string;
457
+ attributes: Record<string, unknown>;
458
+ status: {
459
+ code: "UNSET" | "OK" | "ERROR";
460
+ message?: string | undefined;
461
+ };
462
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
463
+ events: {
464
+ name: string;
465
+ timeUnixNano: string;
466
+ attributes?: Record<string, unknown> | undefined;
467
+ }[];
468
+ traceId: string;
469
+ }[];
470
+ runId: string;
471
+ parentEnvelopeCid: string | null;
472
+ redactionManifest: {
473
+ spans: {
474
+ spanId: string;
475
+ redactedKeys: string[];
476
+ }[];
477
+ totalRedactions: number;
478
+ };
479
+ }, {
480
+ schemaVersion: "jinn.trajectory.v1";
481
+ spans: {
482
+ spanId: string;
483
+ parentSpanId: string | null;
484
+ name: string;
485
+ startTimeUnixNano: string;
486
+ endTimeUnixNano: string;
487
+ attributes: Record<string, unknown>;
488
+ status: {
489
+ code: "UNSET" | "OK" | "ERROR";
490
+ message?: string | undefined;
491
+ };
492
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
493
+ events: {
494
+ name: string;
495
+ timeUnixNano: string;
496
+ attributes?: Record<string, unknown> | undefined;
497
+ }[];
498
+ traceId: string;
499
+ }[];
500
+ runId: string;
501
+ parentEnvelopeCid: string | null;
502
+ redactionManifest: {
503
+ spans: {
504
+ spanId: string;
505
+ redactedKeys: string[];
506
+ }[];
507
+ totalRedactions: number;
508
+ };
509
+ }>;
510
+ export type UnsignedTrajectory = z.infer<typeof UnsignedTrajectorySchema>;
511
+ /**
512
+ * Per-run capture manifest — records the operator's authorisation and
513
+ * coarse harness-bundle metadata for telemetry capture. v0 deliberately
514
+ * keeps operator control at the bundle level (no per-file curation) per
515
+ * DR-2026-05-07-g; the audit surface is "what did the operator authorise
516
+ * the daemon to read?" not "what did the daemon ultimately read?"
517
+ *
518
+ * Spec: spec/2026-05-07-telemetry-collector-and-task-generator.md §3.3
519
+ */
520
+ export declare const CaptureManifestSchema: z.ZodObject<{
521
+ scrubProcessors: z.ZodArray<z.ZodObject<{
522
+ name: z.ZodString;
523
+ version: z.ZodString;
524
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ name: string;
527
+ version: string;
528
+ config?: Record<string, unknown> | undefined;
529
+ }, {
530
+ name: string;
531
+ version: string;
532
+ config?: Record<string, unknown> | undefined;
533
+ }>, "many">;
534
+ reviewedBy: z.ZodObject<{
535
+ safeAddress: z.ZodString;
536
+ reviewedAt: z.ZodString;
537
+ }, "strip", z.ZodTypeAny, {
538
+ safeAddress: string;
539
+ reviewedAt: string;
540
+ }, {
541
+ safeAddress: string;
542
+ reviewedAt: string;
543
+ }>;
544
+ trustedRepoToggle: z.ZodBoolean;
545
+ harnessBundle: z.ZodObject<{
546
+ included: z.ZodBoolean;
547
+ sha256: z.ZodString;
548
+ allowedDirectoriesHash: z.ZodString;
549
+ capturePath: z.ZodEnum<["A", "B", "C", "D"]>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ sha256: string;
552
+ included: boolean;
553
+ allowedDirectoriesHash: string;
554
+ capturePath: "A" | "B" | "C" | "D";
555
+ }, {
556
+ sha256: string;
557
+ included: boolean;
558
+ allowedDirectoriesHash: string;
559
+ capturePath: "A" | "B" | "C" | "D";
560
+ }>;
561
+ /**
562
+ * The single `share` consent (mono#1714): may a mined task be published off
563
+ * the box (enforced at the mint publish gate). Local retention is
564
+ * unconditional, so there is no separate retention-consent field.
565
+ */
566
+ publishMinedTasksConsent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ publishMinedTasksConsent: boolean;
569
+ scrubProcessors: {
570
+ name: string;
571
+ version: string;
572
+ config?: Record<string, unknown> | undefined;
573
+ }[];
574
+ reviewedBy: {
575
+ safeAddress: string;
576
+ reviewedAt: string;
577
+ };
578
+ trustedRepoToggle: boolean;
579
+ harnessBundle: {
580
+ sha256: string;
581
+ included: boolean;
582
+ allowedDirectoriesHash: string;
583
+ capturePath: "A" | "B" | "C" | "D";
584
+ };
585
+ }, {
586
+ scrubProcessors: {
587
+ name: string;
588
+ version: string;
589
+ config?: Record<string, unknown> | undefined;
590
+ }[];
591
+ reviewedBy: {
592
+ safeAddress: string;
593
+ reviewedAt: string;
594
+ };
595
+ trustedRepoToggle: boolean;
596
+ harnessBundle: {
597
+ sha256: string;
598
+ included: boolean;
599
+ allowedDirectoriesHash: string;
600
+ capturePath: "A" | "B" | "C" | "D";
601
+ };
602
+ publishMinedTasksConsent?: boolean | undefined;
603
+ }>;
604
+ export type CaptureManifest = z.infer<typeof CaptureManifestSchema>;
605
+ /** sha256 of an empty (no-files) bundle. Used when the operator opts out of harness-bundle capture. */
606
+ export declare const EMPTY_BUNDLE_SHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";