@code-yeongyu/senpi-agent-core 2026.8.12 → 2026.8.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.
Files changed (153) hide show
  1. package/README.md +13 -7
  2. package/dist/agent-loop.js +5 -1
  3. package/dist/agent-loop.js.map +1 -1
  4. package/dist/agent.d.ts +3 -1
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +8 -0
  7. package/dist/agent.js.map +1 -1
  8. package/dist/harness/agent-harness.d.ts +452 -96
  9. package/dist/harness/agent-harness.d.ts.map +1 -1
  10. package/dist/harness/agent-harness.js +162 -1005
  11. package/dist/harness/agent-harness.js.map +1 -1
  12. package/dist/harness/compaction/branch-summarization.d.ts +13 -6
  13. package/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  14. package/dist/harness/compaction/branch-summarization.js +10 -14
  15. package/dist/harness/compaction/branch-summarization.js.map +1 -1
  16. package/dist/harness/compaction/compaction.d.ts +14 -17
  17. package/dist/harness/compaction/compaction.d.ts.map +1 -1
  18. package/dist/harness/compaction/compaction.js +23 -36
  19. package/dist/harness/compaction/compaction.js.map +1 -1
  20. package/dist/harness/env/nodejs.d.ts +1 -0
  21. package/dist/harness/env/nodejs.d.ts.map +1 -1
  22. package/dist/harness/env/nodejs.js +23 -7
  23. package/dist/harness/env/nodejs.js.map +1 -1
  24. package/dist/harness/messages.d.ts +3 -3
  25. package/dist/harness/messages.d.ts.map +1 -1
  26. package/dist/harness/messages.js +3 -3
  27. package/dist/harness/messages.js.map +1 -1
  28. package/dist/harness/prompt-templates.d.ts.map +1 -1
  29. package/dist/harness/prompt-templates.js +4 -9
  30. package/dist/harness/prompt-templates.js.map +1 -1
  31. package/dist/harness/reducer.d.ts +100 -0
  32. package/dist/harness/reducer.d.ts.map +1 -0
  33. package/dist/harness/reducer.js +414 -0
  34. package/dist/harness/reducer.js.map +1 -0
  35. package/dist/harness/result.d.ts +40 -0
  36. package/dist/harness/result.d.ts.map +1 -0
  37. package/dist/harness/result.js +41 -0
  38. package/dist/harness/result.js.map +1 -0
  39. package/dist/harness/session/context.d.ts +22 -0
  40. package/dist/harness/session/context.d.ts.map +1 -0
  41. package/dist/harness/session/context.js +67 -0
  42. package/dist/harness/session/context.js.map +1 -0
  43. package/dist/harness/session/index.d.ts +7 -0
  44. package/dist/harness/session/index.d.ts.map +1 -0
  45. package/dist/harness/session/index.js +6 -0
  46. package/dist/harness/session/index.js.map +1 -0
  47. package/dist/harness/session/jsonl/codec.d.ts +8 -0
  48. package/dist/harness/session/jsonl/codec.d.ts.map +1 -0
  49. package/dist/harness/session/jsonl/codec.js +190 -0
  50. package/dist/harness/session/jsonl/codec.js.map +1 -0
  51. package/dist/harness/session/jsonl/errors.d.ts +5 -0
  52. package/dist/harness/session/jsonl/errors.d.ts.map +1 -0
  53. package/dist/harness/session/jsonl/errors.js +11 -0
  54. package/dist/harness/session/jsonl/errors.js.map +1 -0
  55. package/dist/harness/session/jsonl/repo.d.ts +23 -0
  56. package/dist/harness/session/jsonl/repo.d.ts.map +1 -0
  57. package/dist/harness/session/jsonl/repo.js +129 -0
  58. package/dist/harness/session/jsonl/repo.js.map +1 -0
  59. package/dist/harness/session/jsonl/storage.d.ts +43 -0
  60. package/dist/harness/session/jsonl/storage.d.ts.map +1 -0
  61. package/dist/harness/session/jsonl/storage.js +206 -0
  62. package/dist/harness/session/jsonl/storage.js.map +1 -0
  63. package/dist/harness/session/jsonl/types.d.ts +38 -0
  64. package/dist/harness/session/jsonl/types.d.ts.map +1 -0
  65. package/dist/harness/session/jsonl/types.js +2 -0
  66. package/dist/harness/session/jsonl/types.js.map +1 -0
  67. package/dist/harness/session/jsonl.d.ts +3 -0
  68. package/dist/harness/session/jsonl.d.ts.map +1 -0
  69. package/dist/harness/session/jsonl.js +2 -0
  70. package/dist/harness/session/jsonl.js.map +1 -0
  71. package/dist/harness/session/memory.d.ts +44 -0
  72. package/dist/harness/session/memory.d.ts.map +1 -0
  73. package/dist/harness/session/memory.js +142 -0
  74. package/dist/harness/session/memory.js.map +1 -0
  75. package/dist/harness/session/search.d.ts +19 -0
  76. package/dist/harness/session/search.d.ts.map +1 -0
  77. package/dist/harness/session/search.js +41 -0
  78. package/dist/harness/session/search.js.map +1 -0
  79. package/dist/harness/session/session.d.ts +43 -38
  80. package/dist/harness/session/session.d.ts.map +1 -1
  81. package/dist/harness/session/session.js +186 -304
  82. package/dist/harness/session/session.js.map +1 -1
  83. package/dist/harness/session/state.d.ts +65 -0
  84. package/dist/harness/session/state.d.ts.map +1 -0
  85. package/dist/harness/session/state.js +320 -0
  86. package/dist/harness/session/state.js.map +1 -0
  87. package/dist/harness/session/testing/conformance.d.ts +4 -0
  88. package/dist/harness/session/testing/conformance.d.ts.map +1 -0
  89. package/dist/harness/session/testing/conformance.js +743 -0
  90. package/dist/harness/session/testing/conformance.js.map +1 -0
  91. package/dist/harness/session/testing/index.d.ts +3 -0
  92. package/dist/harness/session/testing/index.d.ts.map +1 -0
  93. package/dist/harness/session/testing/index.js +2 -0
  94. package/dist/harness/session/testing/index.js.map +1 -0
  95. package/dist/harness/session/testing/types.d.ts +14 -0
  96. package/dist/harness/session/testing/types.d.ts.map +1 -0
  97. package/dist/harness/session/testing/types.js +2 -0
  98. package/dist/harness/session/testing/types.js.map +1 -0
  99. package/dist/harness/session/types.d.ts +333 -0
  100. package/dist/harness/session/types.d.ts.map +1 -0
  101. package/dist/harness/session/types.js +9 -0
  102. package/dist/harness/session/types.js.map +1 -0
  103. package/dist/harness/skills.js +21 -19
  104. package/dist/harness/skills.js.map +1 -1
  105. package/dist/harness/telemetry.d.ts +1221 -0
  106. package/dist/harness/telemetry.d.ts.map +1 -0
  107. package/dist/harness/telemetry.js +508 -0
  108. package/dist/harness/telemetry.js.map +1 -0
  109. package/dist/harness/types.d.ts +8 -485
  110. package/dist/harness/types.d.ts.map +1 -1
  111. package/dist/harness/types.js +4 -16
  112. package/dist/harness/types.js.map +1 -1
  113. package/dist/harness/utils/truncate.js.map +1 -1
  114. package/dist/index.d.ts +10 -9
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +7 -8
  117. package/dist/index.js.map +1 -1
  118. package/dist/proxy.d.ts +1 -1
  119. package/dist/proxy.d.ts.map +1 -1
  120. package/dist/proxy.js +1 -0
  121. package/dist/proxy.js.map +1 -1
  122. package/dist/types.d.ts +6 -0
  123. package/dist/types.d.ts.map +1 -1
  124. package/dist/types.js.map +1 -1
  125. package/package.json +9 -2
  126. package/dist/harness/session/array-session-reader.d.ts +0 -3
  127. package/dist/harness/session/array-session-reader.d.ts.map +0 -1
  128. package/dist/harness/session/array-session-reader.js +0 -70
  129. package/dist/harness/session/array-session-reader.js.map +0 -1
  130. package/dist/harness/session/fork.d.ts +0 -4
  131. package/dist/harness/session/fork.d.ts.map +0 -1
  132. package/dist/harness/session/fork.js +0 -22
  133. package/dist/harness/session/fork.js.map +0 -1
  134. package/dist/harness/session/jsonl-store.d.ts +0 -13
  135. package/dist/harness/session/jsonl-store.d.ts.map +0 -1
  136. package/dist/harness/session/jsonl-store.js +0 -304
  137. package/dist/harness/session/jsonl-store.js.map +0 -1
  138. package/dist/harness/session/keyed-operation-queue.d.ts +0 -17
  139. package/dist/harness/session/keyed-operation-queue.d.ts.map +0 -1
  140. package/dist/harness/session/keyed-operation-queue.js +0 -60
  141. package/dist/harness/session/keyed-operation-queue.js.map +0 -1
  142. package/dist/harness/session/memory-store.d.ts +0 -6
  143. package/dist/harness/session/memory-store.d.ts.map +0 -1
  144. package/dist/harness/session/memory-store.js +0 -107
  145. package/dist/harness/session/memory-store.js.map +0 -1
  146. package/dist/harness/session/repository.d.ts +0 -28
  147. package/dist/harness/session/repository.d.ts.map +0 -1
  148. package/dist/harness/session/repository.js +0 -61
  149. package/dist/harness/session/repository.js.map +0 -1
  150. package/dist/harness/session/search-backend.d.ts +0 -8
  151. package/dist/harness/session/search-backend.d.ts.map +0 -1
  152. package/dist/harness/session/search-backend.js +0 -22
  153. package/dist/harness/session/search-backend.js.map +0 -1
@@ -0,0 +1,1221 @@
1
+ import type { ExactTelemetryAttributes, SchemaTelemetrySpan, TelemetryContext, TelemetrySchemaSpanEndAttributes, TelemetrySchemaSpanEventAttributes, TelemetrySchemaSpanEventName, TelemetrySchemaSpanName, TelemetrySchemaSpanStartAttributes, TelemetrySchemaSpanUnion } from "@earendil-works/pi-telemetry";
2
+ export type { AttributeValue, ExactTelemetryAttributes, SchemaTelemetrySpan, SpanAttributes, SpanOptions, SpanStatus, TelemetryAttributeDefinition, TelemetryAttributeMetadata, TelemetryAttributeType, TelemetryContext, TelemetryEventAttributeDefinition, TelemetryEventDefinition, TelemetryParentDefinition, TelemetrySchemaDefinition, TelemetrySchemaSpanEndAttributes, TelemetrySchemaSpanEventAttributes, TelemetrySchemaSpanEventName, TelemetrySchemaSpanName, TelemetrySchemaSpanStartAttributes, TelemetrySchemaSpanUnion, TelemetrySpan, TelemetrySpanDefinition, TelemetryStartAttributeDefinition, TypedSpanStarter, } from "@earendil-works/pi-telemetry";
3
+ export declare const AI_TELEMETRY_SCHEMA: {
4
+ readonly version: 1;
5
+ readonly spans: {
6
+ readonly "pi.ai.request": {
7
+ readonly description: "One logical request to an AI provider";
8
+ readonly parents: {
9
+ readonly kind: "any";
10
+ };
11
+ readonly startAttributes: {
12
+ readonly "pi.ai.operation": {
13
+ readonly type: "string";
14
+ readonly required: true;
15
+ readonly values: readonly ["stream", "fetch_deferred", "cancel_deferred", "generate_images"];
16
+ readonly description: "Logical provider operation";
17
+ };
18
+ readonly "pi.ai.provider": {
19
+ readonly type: "string";
20
+ readonly required: true;
21
+ readonly description: "Selected provider id";
22
+ };
23
+ readonly "pi.ai.model": {
24
+ readonly type: "string";
25
+ readonly required: true;
26
+ readonly description: "Requested model id";
27
+ };
28
+ readonly "pi.ai.api": {
29
+ readonly type: "string";
30
+ readonly required: true;
31
+ readonly description: "Provider API id";
32
+ };
33
+ readonly "pi.ai.streaming": {
34
+ readonly type: "boolean";
35
+ readonly required: true;
36
+ readonly description: "Whether this operation returns a stream";
37
+ };
38
+ readonly "pi.ai.deferred": {
39
+ readonly type: "boolean";
40
+ readonly required: false;
41
+ readonly description: "Whether the operation requests or participates in deferred execution";
42
+ };
43
+ };
44
+ readonly endAttributes: {
45
+ readonly "pi.ai.response.model": {
46
+ readonly type: "string";
47
+ readonly description: "Concrete response model";
48
+ };
49
+ readonly "pi.ai.response.id": {
50
+ readonly type: "string";
51
+ readonly cardinality: "high";
52
+ readonly description: "Provider response id";
53
+ };
54
+ readonly "pi.ai.response.stop_reason": {
55
+ readonly type: "string";
56
+ readonly values: readonly ["stop", "length", "tool_use", "error", "aborted", "deferred"];
57
+ readonly description: "Normalized terminal response reason";
58
+ };
59
+ readonly "pi.ai.http.status_code": {
60
+ readonly type: "number";
61
+ readonly description: "Final HTTP status";
62
+ };
63
+ readonly "pi.ai.usage.input_tokens": {
64
+ readonly type: "number";
65
+ readonly description: "Reported input tokens";
66
+ };
67
+ readonly "pi.ai.usage.output_tokens": {
68
+ readonly type: "number";
69
+ readonly description: "Reported output tokens";
70
+ };
71
+ readonly "pi.ai.usage.cache_read_tokens": {
72
+ readonly type: "number";
73
+ readonly description: "Reported cache-read tokens";
74
+ };
75
+ readonly "pi.ai.usage.cache_write_tokens": {
76
+ readonly type: "number";
77
+ readonly description: "Reported cache-write tokens";
78
+ };
79
+ readonly "pi.ai.usage.reasoning_tokens": {
80
+ readonly type: "number";
81
+ readonly description: "Reported reasoning tokens";
82
+ };
83
+ readonly "pi.ai.usage.total_tokens": {
84
+ readonly type: "number";
85
+ readonly description: "Reported total tokens";
86
+ };
87
+ readonly "pi.ai.usage.cost": {
88
+ readonly type: "number";
89
+ readonly description: "Reported total cost";
90
+ };
91
+ readonly "pi.ai.stream.chunk_count": {
92
+ readonly type: "number";
93
+ readonly description: "Streamed update chunk count";
94
+ };
95
+ readonly "pi.ai.stream.time_to_first_chunk_ms": {
96
+ readonly type: "number";
97
+ readonly description: "Elapsed milliseconds to first update chunk";
98
+ };
99
+ readonly "pi.ai.error.type": {
100
+ readonly type: "string";
101
+ readonly cardinality: "low";
102
+ readonly description: "Provider or transport error class";
103
+ };
104
+ };
105
+ readonly status: {
106
+ readonly default: "ok";
107
+ readonly errorWhen: "The operation throws or returns an error result";
108
+ };
109
+ };
110
+ };
111
+ };
112
+ export type AiSpanName = TelemetrySchemaSpanName<typeof AI_TELEMETRY_SCHEMA>;
113
+ export type AiSpanStartAttributes<Name extends AiSpanName> = TelemetrySchemaSpanStartAttributes<typeof AI_TELEMETRY_SCHEMA, Name>;
114
+ export type AiSpanEndAttributes<Name extends AiSpanName> = TelemetrySchemaSpanEndAttributes<typeof AI_TELEMETRY_SCHEMA, Name>;
115
+ export type AiSpanAttributes<Name extends AiSpanName> = AiSpanStartAttributes<Name> & AiSpanEndAttributes<Name>;
116
+ export type AiSpanEventName<Name extends AiSpanName> = TelemetrySchemaSpanEventName<typeof AI_TELEMETRY_SCHEMA, Name>;
117
+ export type AiSpanEventAttributes<Name extends AiSpanName, EventName extends AiSpanEventName<Name>> = TelemetrySchemaSpanEventAttributes<typeof AI_TELEMETRY_SCHEMA, Name, EventName>;
118
+ export type AiTelemetrySpan<Name extends AiSpanName> = SchemaTelemetrySpan<typeof AI_TELEMETRY_SCHEMA, Name>;
119
+ export type AiSpan = TelemetrySchemaSpanUnion<typeof AI_TELEMETRY_SCHEMA>;
120
+ export declare function startAiSpan<Name extends AiSpanName, const Attributes extends AiSpanStartAttributes<Name>, Result>(telemetryContext: TelemetryContext, name: Name, attributes: ExactTelemetryAttributes<AiSpanStartAttributes<Name>, Attributes>, callback: (span: AiTelemetrySpan<Name>) => Result | Promise<Result>): Promise<Result>;
121
+ export declare const HARNESS_TELEMETRY_SCHEMA: {
122
+ readonly version: 1;
123
+ readonly spans: {
124
+ readonly "pi.harness.run": {
125
+ readonly description: "One admitted in-process run invocation";
126
+ readonly parents: {
127
+ readonly kind: "root_or_external";
128
+ };
129
+ readonly startAttributes: {
130
+ readonly "pi.operation.kind": {
131
+ readonly type: "string";
132
+ readonly required: true;
133
+ readonly values: readonly ["run"];
134
+ readonly description: "Run operation kind";
135
+ };
136
+ readonly "pi.session.id": {
137
+ readonly type: "string";
138
+ readonly required: true;
139
+ readonly cardinality: "high";
140
+ readonly description: "Session id";
141
+ };
142
+ readonly "pi.lane.name": {
143
+ readonly type: "string";
144
+ readonly required: true;
145
+ readonly cardinality: "high";
146
+ readonly description: "Lane name";
147
+ };
148
+ readonly "pi.operation.id": {
149
+ readonly type: "string";
150
+ readonly required: true;
151
+ readonly cardinality: "high";
152
+ readonly description: "Durable operation id";
153
+ };
154
+ readonly "pi.operation.recovery": {
155
+ readonly type: "boolean";
156
+ readonly required: true;
157
+ readonly description: "Whether this invocation resumes durable work";
158
+ };
159
+ };
160
+ readonly endAttributes: {
161
+ readonly "pi.error.code": {
162
+ readonly type: "string";
163
+ readonly cardinality: "low";
164
+ readonly description: "Stable operation error code";
165
+ };
166
+ readonly "pi.error.type": {
167
+ readonly type: "string";
168
+ readonly cardinality: "low";
169
+ readonly description: "Low-cardinality operation error class";
170
+ };
171
+ readonly "pi.operation.outcome": {
172
+ readonly type: "string";
173
+ readonly values: readonly ["completed", "aborted", "failed", "suspended"];
174
+ readonly description: "Run invocation outcome";
175
+ };
176
+ };
177
+ readonly status: {
178
+ readonly default: "ok";
179
+ readonly errorWhen: "The run fails or throws";
180
+ };
181
+ };
182
+ readonly "pi.harness.compaction": {
183
+ readonly description: "One admitted in-process manual compaction invocation";
184
+ readonly parents: {
185
+ readonly kind: "root_or_external";
186
+ };
187
+ readonly startAttributes: {
188
+ readonly "pi.operation.kind": {
189
+ readonly type: "string";
190
+ readonly required: true;
191
+ readonly values: readonly ["compaction"];
192
+ readonly description: "Compaction operation kind";
193
+ };
194
+ readonly "pi.session.id": {
195
+ readonly type: "string";
196
+ readonly required: true;
197
+ readonly cardinality: "high";
198
+ readonly description: "Session id";
199
+ };
200
+ readonly "pi.lane.name": {
201
+ readonly type: "string";
202
+ readonly required: true;
203
+ readonly cardinality: "high";
204
+ readonly description: "Lane name";
205
+ };
206
+ readonly "pi.operation.id": {
207
+ readonly type: "string";
208
+ readonly required: true;
209
+ readonly cardinality: "high";
210
+ readonly description: "Durable operation id";
211
+ };
212
+ readonly "pi.operation.recovery": {
213
+ readonly type: "boolean";
214
+ readonly required: true;
215
+ readonly description: "Whether this invocation resumes durable work";
216
+ };
217
+ };
218
+ readonly endAttributes: {
219
+ readonly "pi.error.code": {
220
+ readonly type: "string";
221
+ readonly cardinality: "low";
222
+ readonly description: "Stable operation error code";
223
+ };
224
+ readonly "pi.error.type": {
225
+ readonly type: "string";
226
+ readonly cardinality: "low";
227
+ readonly description: "Low-cardinality operation error class";
228
+ };
229
+ readonly "pi.operation.outcome": {
230
+ readonly type: "string";
231
+ readonly values: readonly ["completed", "declined", "aborted", "failed"];
232
+ readonly description: "Compaction invocation outcome";
233
+ };
234
+ };
235
+ readonly status: {
236
+ readonly default: "ok";
237
+ readonly errorWhen: "The compaction fails or throws";
238
+ };
239
+ };
240
+ readonly "pi.harness.navigation": {
241
+ readonly description: "One admitted in-process navigation invocation";
242
+ readonly parents: {
243
+ readonly kind: "root_or_external";
244
+ };
245
+ readonly startAttributes: {
246
+ readonly "pi.operation.kind": {
247
+ readonly type: "string";
248
+ readonly required: true;
249
+ readonly values: readonly ["navigation"];
250
+ readonly description: "Navigation operation kind";
251
+ };
252
+ readonly "pi.session.id": {
253
+ readonly type: "string";
254
+ readonly required: true;
255
+ readonly cardinality: "high";
256
+ readonly description: "Session id";
257
+ };
258
+ readonly "pi.lane.name": {
259
+ readonly type: "string";
260
+ readonly required: true;
261
+ readonly cardinality: "high";
262
+ readonly description: "Lane name";
263
+ };
264
+ readonly "pi.operation.id": {
265
+ readonly type: "string";
266
+ readonly required: true;
267
+ readonly cardinality: "high";
268
+ readonly description: "Durable operation id";
269
+ };
270
+ readonly "pi.operation.recovery": {
271
+ readonly type: "boolean";
272
+ readonly required: true;
273
+ readonly description: "Whether this invocation resumes durable work";
274
+ };
275
+ };
276
+ readonly endAttributes: {
277
+ readonly "pi.error.code": {
278
+ readonly type: "string";
279
+ readonly cardinality: "low";
280
+ readonly description: "Stable operation error code";
281
+ };
282
+ readonly "pi.error.type": {
283
+ readonly type: "string";
284
+ readonly cardinality: "low";
285
+ readonly description: "Low-cardinality operation error class";
286
+ };
287
+ readonly "pi.operation.outcome": {
288
+ readonly type: "string";
289
+ readonly values: readonly ["completed", "declined", "aborted", "failed"];
290
+ readonly description: "Navigation invocation outcome";
291
+ };
292
+ };
293
+ readonly status: {
294
+ readonly default: "ok";
295
+ readonly errorWhen: "The navigation fails or throws";
296
+ };
297
+ };
298
+ readonly "pi.harness.checkpoint": {
299
+ readonly description: "One run checkpoint";
300
+ readonly parents: {
301
+ readonly kind: "spans";
302
+ readonly spans: readonly ["pi.harness.run"];
303
+ };
304
+ readonly startAttributes: {
305
+ readonly "pi.lane.name": {
306
+ readonly type: "string";
307
+ readonly required: true;
308
+ readonly cardinality: "high";
309
+ readonly description: "Lane name";
310
+ };
311
+ readonly "pi.operation.id": {
312
+ readonly type: "string";
313
+ readonly required: true;
314
+ readonly cardinality: "high";
315
+ readonly description: "Durable operation id";
316
+ };
317
+ readonly "pi.checkpoint.kind": {
318
+ readonly type: "string";
319
+ readonly required: true;
320
+ readonly values: readonly ["normal", "failure_drain", "abort_reconcile"];
321
+ readonly description: "Checkpoint purpose";
322
+ };
323
+ };
324
+ readonly endAttributes: {};
325
+ readonly status: {
326
+ readonly default: "ok";
327
+ readonly errorWhen: "Checkpoint work throws";
328
+ };
329
+ };
330
+ readonly "pi.harness.turn": {
331
+ readonly description: "One assistant response and its tool batch";
332
+ readonly parents: {
333
+ readonly kind: "spans";
334
+ readonly spans: readonly ["pi.harness.run"];
335
+ };
336
+ readonly startAttributes: {
337
+ readonly "pi.lane.name": {
338
+ readonly type: "string";
339
+ readonly required: true;
340
+ readonly cardinality: "high";
341
+ readonly description: "Lane name";
342
+ };
343
+ readonly "pi.operation.id": {
344
+ readonly type: "string";
345
+ readonly required: true;
346
+ readonly cardinality: "high";
347
+ readonly description: "Durable operation id";
348
+ };
349
+ readonly "pi.turn.id": {
350
+ readonly type: "string";
351
+ readonly required: true;
352
+ readonly cardinality: "high";
353
+ readonly description: "Invocation-local turn id";
354
+ };
355
+ };
356
+ readonly endAttributes: {};
357
+ readonly status: {
358
+ readonly default: "ok";
359
+ readonly errorWhen: "Turn work throws";
360
+ };
361
+ };
362
+ readonly "pi.harness.step": {
363
+ readonly description: "One durable retry attempt";
364
+ readonly parents: {
365
+ readonly kind: "spans";
366
+ readonly spans: readonly ["pi.harness.turn", "pi.harness.checkpoint", "pi.harness.compaction", "pi.harness.navigation"];
367
+ };
368
+ readonly startAttributes: {
369
+ readonly "pi.lane.name": {
370
+ readonly type: "string";
371
+ readonly required: true;
372
+ readonly cardinality: "high";
373
+ readonly description: "Lane name";
374
+ };
375
+ readonly "pi.operation.id": {
376
+ readonly type: "string";
377
+ readonly required: true;
378
+ readonly cardinality: "high";
379
+ readonly description: "Durable operation id";
380
+ };
381
+ readonly "pi.step.kind": {
382
+ readonly type: "string";
383
+ readonly required: true;
384
+ readonly values: readonly ["assistant", "compaction", "branch_summary"];
385
+ readonly description: "Retryable step kind";
386
+ };
387
+ readonly "pi.step.attempt": {
388
+ readonly type: "number";
389
+ readonly required: true;
390
+ readonly description: "One-based durable attempt number";
391
+ };
392
+ readonly "pi.compaction.reason": {
393
+ readonly type: "string";
394
+ readonly required: false;
395
+ readonly values: readonly ["manual", "threshold", "overflow"];
396
+ readonly description: "Compaction trigger";
397
+ };
398
+ };
399
+ readonly endAttributes: {
400
+ readonly "pi.step.outcome": {
401
+ readonly type: "string";
402
+ readonly values: readonly ["succeeded", "retry", "failed", "aborted", "deferred", "overflow"];
403
+ readonly description: "Attempt outcome";
404
+ };
405
+ };
406
+ readonly status: {
407
+ readonly default: "ok";
408
+ readonly errorWhen: "The attempt retries, fails, or throws";
409
+ };
410
+ };
411
+ readonly "pi.harness.tool": {
412
+ readonly description: "One raw phase-2 tool execution";
413
+ readonly parents: {
414
+ readonly kind: "spans";
415
+ readonly spans: readonly ["pi.harness.turn", "pi.harness.run"];
416
+ };
417
+ readonly startAttributes: {
418
+ readonly "pi.lane.name": {
419
+ readonly type: "string";
420
+ readonly required: true;
421
+ readonly cardinality: "high";
422
+ readonly description: "Lane name";
423
+ };
424
+ readonly "pi.operation.id": {
425
+ readonly type: "string";
426
+ readonly required: true;
427
+ readonly cardinality: "high";
428
+ readonly description: "Durable operation id";
429
+ };
430
+ readonly "pi.turn.id": {
431
+ readonly type: "string";
432
+ readonly required: false;
433
+ readonly cardinality: "high";
434
+ readonly description: "Invocation-local live turn id";
435
+ };
436
+ readonly "pi.tool.name": {
437
+ readonly type: "string";
438
+ readonly required: true;
439
+ readonly description: "Tool name";
440
+ };
441
+ readonly "pi.tool.call_id": {
442
+ readonly type: "string";
443
+ readonly required: true;
444
+ readonly cardinality: "high";
445
+ readonly description: "Tool call id";
446
+ };
447
+ readonly "pi.tool.replay": {
448
+ readonly type: "string";
449
+ readonly required: true;
450
+ readonly values: readonly ["never", "safe"];
451
+ readonly description: "Declared replay policy";
452
+ };
453
+ readonly "pi.tool.recovery": {
454
+ readonly type: "boolean";
455
+ readonly required: true;
456
+ readonly description: "Whether this is recovery execution";
457
+ };
458
+ };
459
+ readonly endAttributes: {
460
+ readonly "pi.tool.is_error": {
461
+ readonly type: "boolean";
462
+ readonly description: "Whether raw phase-2 execution returned an error";
463
+ };
464
+ };
465
+ readonly status: {
466
+ readonly default: "ok";
467
+ readonly errorWhen: "Raw phase-2 execution returns an error";
468
+ };
469
+ };
470
+ readonly "pi.harness.hook": {
471
+ readonly description: "One registered hook handler invocation";
472
+ readonly parents: {
473
+ readonly kind: "any";
474
+ };
475
+ readonly startAttributes: {
476
+ readonly "pi.lane.name": {
477
+ readonly type: "string";
478
+ readonly required: true;
479
+ readonly cardinality: "high";
480
+ readonly description: "Lane name";
481
+ };
482
+ readonly "pi.operation.id": {
483
+ readonly type: "string";
484
+ readonly required: false;
485
+ readonly cardinality: "high";
486
+ readonly description: "Durable operation id when accepted";
487
+ };
488
+ readonly "pi.hook.name": {
489
+ readonly type: "string";
490
+ readonly required: true;
491
+ readonly values: readonly ["before_run", "before_resume", "before_run_end", "transform_context", "before_request", "before_payload", "after_response", "before_tool", "after_tool", "before_compaction", "before_navigation"];
492
+ readonly description: "Hook name";
493
+ };
494
+ readonly "pi.hook.registration_id": {
495
+ readonly type: "string";
496
+ readonly required: false;
497
+ readonly description: "Stable hook registration id";
498
+ };
499
+ };
500
+ readonly endAttributes: {
501
+ readonly "pi.hook.outcome": {
502
+ readonly type: "string";
503
+ readonly values: readonly ["completed", "skipped", "blocked", "failed"];
504
+ readonly description: "Handler outcome";
505
+ };
506
+ };
507
+ readonly status: {
508
+ readonly default: "ok";
509
+ readonly errorWhen: "The handler throws";
510
+ };
511
+ };
512
+ readonly "pi.harness.sleep": {
513
+ readonly description: "One retry delay";
514
+ readonly parents: {
515
+ readonly kind: "spans";
516
+ readonly spans: readonly ["pi.harness.step", "pi.harness.run"];
517
+ };
518
+ readonly startAttributes: {
519
+ readonly "pi.operation.id": {
520
+ readonly type: "string";
521
+ readonly required: true;
522
+ readonly cardinality: "high";
523
+ readonly description: "Durable operation id";
524
+ };
525
+ readonly "pi.sleep.delay_ms": {
526
+ readonly type: "number";
527
+ readonly required: true;
528
+ readonly description: "Requested delay in milliseconds";
529
+ };
530
+ };
531
+ readonly endAttributes: {
532
+ readonly "pi.sleep.outcome": {
533
+ readonly type: "string";
534
+ readonly values: readonly ["elapsed", "aborted"];
535
+ readonly description: "Delay outcome";
536
+ };
537
+ };
538
+ readonly status: {
539
+ readonly default: "ok";
540
+ readonly errorWhen: "Sleep work throws";
541
+ };
542
+ };
543
+ readonly "pi.harness.event_handler": {
544
+ readonly description: "One passive event listener invocation";
545
+ readonly parents: {
546
+ readonly kind: "any";
547
+ };
548
+ readonly startAttributes: {
549
+ readonly "pi.event.type": {
550
+ readonly type: "string";
551
+ readonly required: true;
552
+ readonly cardinality: "low";
553
+ readonly values: readonly ["run_start", "run_resume", "run_suspend", "run_abort", "run_end", "fault", "handler_error", "turn_start", "turn_end", "retry_scheduled", "retry_start", "retry_end", "message_start", "message_update", "message_end", "tool_start", "tool_update", "tool_end", "entry_added", "write_pending", "queue_update", "fact_update", "config_update", "compaction_start", "compaction_end", "navigation_start", "navigation_end", "lane_created", "usage"];
554
+ readonly description: "Delivered harness event type";
555
+ };
556
+ readonly "pi.lane.name": {
557
+ readonly type: "string";
558
+ readonly required: false;
559
+ readonly cardinality: "high";
560
+ readonly description: "Lane name for lane-scoped events";
561
+ };
562
+ };
563
+ readonly endAttributes: {};
564
+ readonly status: {
565
+ readonly default: "ok";
566
+ readonly errorWhen: "The listener throws";
567
+ };
568
+ };
569
+ readonly "pi.session.write": {
570
+ readonly description: "One committed session mutation";
571
+ readonly parents: {
572
+ readonly kind: "any";
573
+ };
574
+ readonly startAttributes: {
575
+ readonly "pi.lane.name": {
576
+ readonly type: "string";
577
+ readonly required: true;
578
+ readonly cardinality: "high";
579
+ readonly description: "Lane name";
580
+ };
581
+ readonly "pi.operation.id": {
582
+ readonly type: "string";
583
+ readonly required: false;
584
+ readonly cardinality: "high";
585
+ readonly description: "Durable operation id when accepted";
586
+ };
587
+ readonly "pi.session.mutation": {
588
+ readonly type: "string";
589
+ readonly required: true;
590
+ readonly values: readonly ["entry", "record", "lane", "fact"];
591
+ readonly description: "Session mutation kind";
592
+ };
593
+ readonly "pi.session.item_type": {
594
+ readonly type: "string";
595
+ readonly required: false;
596
+ readonly description: "Entry, record, lane, or fact subtype";
597
+ };
598
+ };
599
+ readonly endAttributes: {
600
+ readonly "pi.session.seq": {
601
+ readonly type: "number";
602
+ readonly description: "Committed session sequence when exposed";
603
+ };
604
+ };
605
+ readonly status: {
606
+ readonly default: "ok";
607
+ readonly errorWhen: "Storage rejects the mutation";
608
+ };
609
+ };
610
+ };
611
+ };
612
+ /** Combined typed span vocabulary for agent-owned AI-request and harness telemetry. */
613
+ export declare const AGENT_TELEMETRY_SCHEMAS: readonly [{
614
+ readonly version: 1;
615
+ readonly spans: {
616
+ readonly "pi.ai.request": {
617
+ readonly description: "One logical request to an AI provider";
618
+ readonly parents: {
619
+ readonly kind: "any";
620
+ };
621
+ readonly startAttributes: {
622
+ readonly "pi.ai.operation": {
623
+ readonly type: "string";
624
+ readonly required: true;
625
+ readonly values: readonly ["stream", "fetch_deferred", "cancel_deferred", "generate_images"];
626
+ readonly description: "Logical provider operation";
627
+ };
628
+ readonly "pi.ai.provider": {
629
+ readonly type: "string";
630
+ readonly required: true;
631
+ readonly description: "Selected provider id";
632
+ };
633
+ readonly "pi.ai.model": {
634
+ readonly type: "string";
635
+ readonly required: true;
636
+ readonly description: "Requested model id";
637
+ };
638
+ readonly "pi.ai.api": {
639
+ readonly type: "string";
640
+ readonly required: true;
641
+ readonly description: "Provider API id";
642
+ };
643
+ readonly "pi.ai.streaming": {
644
+ readonly type: "boolean";
645
+ readonly required: true;
646
+ readonly description: "Whether this operation returns a stream";
647
+ };
648
+ readonly "pi.ai.deferred": {
649
+ readonly type: "boolean";
650
+ readonly required: false;
651
+ readonly description: "Whether the operation requests or participates in deferred execution";
652
+ };
653
+ };
654
+ readonly endAttributes: {
655
+ readonly "pi.ai.response.model": {
656
+ readonly type: "string";
657
+ readonly description: "Concrete response model";
658
+ };
659
+ readonly "pi.ai.response.id": {
660
+ readonly type: "string";
661
+ readonly cardinality: "high";
662
+ readonly description: "Provider response id";
663
+ };
664
+ readonly "pi.ai.response.stop_reason": {
665
+ readonly type: "string";
666
+ readonly values: readonly ["stop", "length", "tool_use", "error", "aborted", "deferred"];
667
+ readonly description: "Normalized terminal response reason";
668
+ };
669
+ readonly "pi.ai.http.status_code": {
670
+ readonly type: "number";
671
+ readonly description: "Final HTTP status";
672
+ };
673
+ readonly "pi.ai.usage.input_tokens": {
674
+ readonly type: "number";
675
+ readonly description: "Reported input tokens";
676
+ };
677
+ readonly "pi.ai.usage.output_tokens": {
678
+ readonly type: "number";
679
+ readonly description: "Reported output tokens";
680
+ };
681
+ readonly "pi.ai.usage.cache_read_tokens": {
682
+ readonly type: "number";
683
+ readonly description: "Reported cache-read tokens";
684
+ };
685
+ readonly "pi.ai.usage.cache_write_tokens": {
686
+ readonly type: "number";
687
+ readonly description: "Reported cache-write tokens";
688
+ };
689
+ readonly "pi.ai.usage.reasoning_tokens": {
690
+ readonly type: "number";
691
+ readonly description: "Reported reasoning tokens";
692
+ };
693
+ readonly "pi.ai.usage.total_tokens": {
694
+ readonly type: "number";
695
+ readonly description: "Reported total tokens";
696
+ };
697
+ readonly "pi.ai.usage.cost": {
698
+ readonly type: "number";
699
+ readonly description: "Reported total cost";
700
+ };
701
+ readonly "pi.ai.stream.chunk_count": {
702
+ readonly type: "number";
703
+ readonly description: "Streamed update chunk count";
704
+ };
705
+ readonly "pi.ai.stream.time_to_first_chunk_ms": {
706
+ readonly type: "number";
707
+ readonly description: "Elapsed milliseconds to first update chunk";
708
+ };
709
+ readonly "pi.ai.error.type": {
710
+ readonly type: "string";
711
+ readonly cardinality: "low";
712
+ readonly description: "Provider or transport error class";
713
+ };
714
+ };
715
+ readonly status: {
716
+ readonly default: "ok";
717
+ readonly errorWhen: "The operation throws or returns an error result";
718
+ };
719
+ };
720
+ };
721
+ }, {
722
+ readonly version: 1;
723
+ readonly spans: {
724
+ readonly "pi.harness.run": {
725
+ readonly description: "One admitted in-process run invocation";
726
+ readonly parents: {
727
+ readonly kind: "root_or_external";
728
+ };
729
+ readonly startAttributes: {
730
+ readonly "pi.operation.kind": {
731
+ readonly type: "string";
732
+ readonly required: true;
733
+ readonly values: readonly ["run"];
734
+ readonly description: "Run operation kind";
735
+ };
736
+ readonly "pi.session.id": {
737
+ readonly type: "string";
738
+ readonly required: true;
739
+ readonly cardinality: "high";
740
+ readonly description: "Session id";
741
+ };
742
+ readonly "pi.lane.name": {
743
+ readonly type: "string";
744
+ readonly required: true;
745
+ readonly cardinality: "high";
746
+ readonly description: "Lane name";
747
+ };
748
+ readonly "pi.operation.id": {
749
+ readonly type: "string";
750
+ readonly required: true;
751
+ readonly cardinality: "high";
752
+ readonly description: "Durable operation id";
753
+ };
754
+ readonly "pi.operation.recovery": {
755
+ readonly type: "boolean";
756
+ readonly required: true;
757
+ readonly description: "Whether this invocation resumes durable work";
758
+ };
759
+ };
760
+ readonly endAttributes: {
761
+ readonly "pi.error.code": {
762
+ readonly type: "string";
763
+ readonly cardinality: "low";
764
+ readonly description: "Stable operation error code";
765
+ };
766
+ readonly "pi.error.type": {
767
+ readonly type: "string";
768
+ readonly cardinality: "low";
769
+ readonly description: "Low-cardinality operation error class";
770
+ };
771
+ readonly "pi.operation.outcome": {
772
+ readonly type: "string";
773
+ readonly values: readonly ["completed", "aborted", "failed", "suspended"];
774
+ readonly description: "Run invocation outcome";
775
+ };
776
+ };
777
+ readonly status: {
778
+ readonly default: "ok";
779
+ readonly errorWhen: "The run fails or throws";
780
+ };
781
+ };
782
+ readonly "pi.harness.compaction": {
783
+ readonly description: "One admitted in-process manual compaction invocation";
784
+ readonly parents: {
785
+ readonly kind: "root_or_external";
786
+ };
787
+ readonly startAttributes: {
788
+ readonly "pi.operation.kind": {
789
+ readonly type: "string";
790
+ readonly required: true;
791
+ readonly values: readonly ["compaction"];
792
+ readonly description: "Compaction operation kind";
793
+ };
794
+ readonly "pi.session.id": {
795
+ readonly type: "string";
796
+ readonly required: true;
797
+ readonly cardinality: "high";
798
+ readonly description: "Session id";
799
+ };
800
+ readonly "pi.lane.name": {
801
+ readonly type: "string";
802
+ readonly required: true;
803
+ readonly cardinality: "high";
804
+ readonly description: "Lane name";
805
+ };
806
+ readonly "pi.operation.id": {
807
+ readonly type: "string";
808
+ readonly required: true;
809
+ readonly cardinality: "high";
810
+ readonly description: "Durable operation id";
811
+ };
812
+ readonly "pi.operation.recovery": {
813
+ readonly type: "boolean";
814
+ readonly required: true;
815
+ readonly description: "Whether this invocation resumes durable work";
816
+ };
817
+ };
818
+ readonly endAttributes: {
819
+ readonly "pi.error.code": {
820
+ readonly type: "string";
821
+ readonly cardinality: "low";
822
+ readonly description: "Stable operation error code";
823
+ };
824
+ readonly "pi.error.type": {
825
+ readonly type: "string";
826
+ readonly cardinality: "low";
827
+ readonly description: "Low-cardinality operation error class";
828
+ };
829
+ readonly "pi.operation.outcome": {
830
+ readonly type: "string";
831
+ readonly values: readonly ["completed", "declined", "aborted", "failed"];
832
+ readonly description: "Compaction invocation outcome";
833
+ };
834
+ };
835
+ readonly status: {
836
+ readonly default: "ok";
837
+ readonly errorWhen: "The compaction fails or throws";
838
+ };
839
+ };
840
+ readonly "pi.harness.navigation": {
841
+ readonly description: "One admitted in-process navigation invocation";
842
+ readonly parents: {
843
+ readonly kind: "root_or_external";
844
+ };
845
+ readonly startAttributes: {
846
+ readonly "pi.operation.kind": {
847
+ readonly type: "string";
848
+ readonly required: true;
849
+ readonly values: readonly ["navigation"];
850
+ readonly description: "Navigation operation kind";
851
+ };
852
+ readonly "pi.session.id": {
853
+ readonly type: "string";
854
+ readonly required: true;
855
+ readonly cardinality: "high";
856
+ readonly description: "Session id";
857
+ };
858
+ readonly "pi.lane.name": {
859
+ readonly type: "string";
860
+ readonly required: true;
861
+ readonly cardinality: "high";
862
+ readonly description: "Lane name";
863
+ };
864
+ readonly "pi.operation.id": {
865
+ readonly type: "string";
866
+ readonly required: true;
867
+ readonly cardinality: "high";
868
+ readonly description: "Durable operation id";
869
+ };
870
+ readonly "pi.operation.recovery": {
871
+ readonly type: "boolean";
872
+ readonly required: true;
873
+ readonly description: "Whether this invocation resumes durable work";
874
+ };
875
+ };
876
+ readonly endAttributes: {
877
+ readonly "pi.error.code": {
878
+ readonly type: "string";
879
+ readonly cardinality: "low";
880
+ readonly description: "Stable operation error code";
881
+ };
882
+ readonly "pi.error.type": {
883
+ readonly type: "string";
884
+ readonly cardinality: "low";
885
+ readonly description: "Low-cardinality operation error class";
886
+ };
887
+ readonly "pi.operation.outcome": {
888
+ readonly type: "string";
889
+ readonly values: readonly ["completed", "declined", "aborted", "failed"];
890
+ readonly description: "Navigation invocation outcome";
891
+ };
892
+ };
893
+ readonly status: {
894
+ readonly default: "ok";
895
+ readonly errorWhen: "The navigation fails or throws";
896
+ };
897
+ };
898
+ readonly "pi.harness.checkpoint": {
899
+ readonly description: "One run checkpoint";
900
+ readonly parents: {
901
+ readonly kind: "spans";
902
+ readonly spans: readonly ["pi.harness.run"];
903
+ };
904
+ readonly startAttributes: {
905
+ readonly "pi.lane.name": {
906
+ readonly type: "string";
907
+ readonly required: true;
908
+ readonly cardinality: "high";
909
+ readonly description: "Lane name";
910
+ };
911
+ readonly "pi.operation.id": {
912
+ readonly type: "string";
913
+ readonly required: true;
914
+ readonly cardinality: "high";
915
+ readonly description: "Durable operation id";
916
+ };
917
+ readonly "pi.checkpoint.kind": {
918
+ readonly type: "string";
919
+ readonly required: true;
920
+ readonly values: readonly ["normal", "failure_drain", "abort_reconcile"];
921
+ readonly description: "Checkpoint purpose";
922
+ };
923
+ };
924
+ readonly endAttributes: {};
925
+ readonly status: {
926
+ readonly default: "ok";
927
+ readonly errorWhen: "Checkpoint work throws";
928
+ };
929
+ };
930
+ readonly "pi.harness.turn": {
931
+ readonly description: "One assistant response and its tool batch";
932
+ readonly parents: {
933
+ readonly kind: "spans";
934
+ readonly spans: readonly ["pi.harness.run"];
935
+ };
936
+ readonly startAttributes: {
937
+ readonly "pi.lane.name": {
938
+ readonly type: "string";
939
+ readonly required: true;
940
+ readonly cardinality: "high";
941
+ readonly description: "Lane name";
942
+ };
943
+ readonly "pi.operation.id": {
944
+ readonly type: "string";
945
+ readonly required: true;
946
+ readonly cardinality: "high";
947
+ readonly description: "Durable operation id";
948
+ };
949
+ readonly "pi.turn.id": {
950
+ readonly type: "string";
951
+ readonly required: true;
952
+ readonly cardinality: "high";
953
+ readonly description: "Invocation-local turn id";
954
+ };
955
+ };
956
+ readonly endAttributes: {};
957
+ readonly status: {
958
+ readonly default: "ok";
959
+ readonly errorWhen: "Turn work throws";
960
+ };
961
+ };
962
+ readonly "pi.harness.step": {
963
+ readonly description: "One durable retry attempt";
964
+ readonly parents: {
965
+ readonly kind: "spans";
966
+ readonly spans: readonly ["pi.harness.turn", "pi.harness.checkpoint", "pi.harness.compaction", "pi.harness.navigation"];
967
+ };
968
+ readonly startAttributes: {
969
+ readonly "pi.lane.name": {
970
+ readonly type: "string";
971
+ readonly required: true;
972
+ readonly cardinality: "high";
973
+ readonly description: "Lane name";
974
+ };
975
+ readonly "pi.operation.id": {
976
+ readonly type: "string";
977
+ readonly required: true;
978
+ readonly cardinality: "high";
979
+ readonly description: "Durable operation id";
980
+ };
981
+ readonly "pi.step.kind": {
982
+ readonly type: "string";
983
+ readonly required: true;
984
+ readonly values: readonly ["assistant", "compaction", "branch_summary"];
985
+ readonly description: "Retryable step kind";
986
+ };
987
+ readonly "pi.step.attempt": {
988
+ readonly type: "number";
989
+ readonly required: true;
990
+ readonly description: "One-based durable attempt number";
991
+ };
992
+ readonly "pi.compaction.reason": {
993
+ readonly type: "string";
994
+ readonly required: false;
995
+ readonly values: readonly ["manual", "threshold", "overflow"];
996
+ readonly description: "Compaction trigger";
997
+ };
998
+ };
999
+ readonly endAttributes: {
1000
+ readonly "pi.step.outcome": {
1001
+ readonly type: "string";
1002
+ readonly values: readonly ["succeeded", "retry", "failed", "aborted", "deferred", "overflow"];
1003
+ readonly description: "Attempt outcome";
1004
+ };
1005
+ };
1006
+ readonly status: {
1007
+ readonly default: "ok";
1008
+ readonly errorWhen: "The attempt retries, fails, or throws";
1009
+ };
1010
+ };
1011
+ readonly "pi.harness.tool": {
1012
+ readonly description: "One raw phase-2 tool execution";
1013
+ readonly parents: {
1014
+ readonly kind: "spans";
1015
+ readonly spans: readonly ["pi.harness.turn", "pi.harness.run"];
1016
+ };
1017
+ readonly startAttributes: {
1018
+ readonly "pi.lane.name": {
1019
+ readonly type: "string";
1020
+ readonly required: true;
1021
+ readonly cardinality: "high";
1022
+ readonly description: "Lane name";
1023
+ };
1024
+ readonly "pi.operation.id": {
1025
+ readonly type: "string";
1026
+ readonly required: true;
1027
+ readonly cardinality: "high";
1028
+ readonly description: "Durable operation id";
1029
+ };
1030
+ readonly "pi.turn.id": {
1031
+ readonly type: "string";
1032
+ readonly required: false;
1033
+ readonly cardinality: "high";
1034
+ readonly description: "Invocation-local live turn id";
1035
+ };
1036
+ readonly "pi.tool.name": {
1037
+ readonly type: "string";
1038
+ readonly required: true;
1039
+ readonly description: "Tool name";
1040
+ };
1041
+ readonly "pi.tool.call_id": {
1042
+ readonly type: "string";
1043
+ readonly required: true;
1044
+ readonly cardinality: "high";
1045
+ readonly description: "Tool call id";
1046
+ };
1047
+ readonly "pi.tool.replay": {
1048
+ readonly type: "string";
1049
+ readonly required: true;
1050
+ readonly values: readonly ["never", "safe"];
1051
+ readonly description: "Declared replay policy";
1052
+ };
1053
+ readonly "pi.tool.recovery": {
1054
+ readonly type: "boolean";
1055
+ readonly required: true;
1056
+ readonly description: "Whether this is recovery execution";
1057
+ };
1058
+ };
1059
+ readonly endAttributes: {
1060
+ readonly "pi.tool.is_error": {
1061
+ readonly type: "boolean";
1062
+ readonly description: "Whether raw phase-2 execution returned an error";
1063
+ };
1064
+ };
1065
+ readonly status: {
1066
+ readonly default: "ok";
1067
+ readonly errorWhen: "Raw phase-2 execution returns an error";
1068
+ };
1069
+ };
1070
+ readonly "pi.harness.hook": {
1071
+ readonly description: "One registered hook handler invocation";
1072
+ readonly parents: {
1073
+ readonly kind: "any";
1074
+ };
1075
+ readonly startAttributes: {
1076
+ readonly "pi.lane.name": {
1077
+ readonly type: "string";
1078
+ readonly required: true;
1079
+ readonly cardinality: "high";
1080
+ readonly description: "Lane name";
1081
+ };
1082
+ readonly "pi.operation.id": {
1083
+ readonly type: "string";
1084
+ readonly required: false;
1085
+ readonly cardinality: "high";
1086
+ readonly description: "Durable operation id when accepted";
1087
+ };
1088
+ readonly "pi.hook.name": {
1089
+ readonly type: "string";
1090
+ readonly required: true;
1091
+ readonly values: readonly ["before_run", "before_resume", "before_run_end", "transform_context", "before_request", "before_payload", "after_response", "before_tool", "after_tool", "before_compaction", "before_navigation"];
1092
+ readonly description: "Hook name";
1093
+ };
1094
+ readonly "pi.hook.registration_id": {
1095
+ readonly type: "string";
1096
+ readonly required: false;
1097
+ readonly description: "Stable hook registration id";
1098
+ };
1099
+ };
1100
+ readonly endAttributes: {
1101
+ readonly "pi.hook.outcome": {
1102
+ readonly type: "string";
1103
+ readonly values: readonly ["completed", "skipped", "blocked", "failed"];
1104
+ readonly description: "Handler outcome";
1105
+ };
1106
+ };
1107
+ readonly status: {
1108
+ readonly default: "ok";
1109
+ readonly errorWhen: "The handler throws";
1110
+ };
1111
+ };
1112
+ readonly "pi.harness.sleep": {
1113
+ readonly description: "One retry delay";
1114
+ readonly parents: {
1115
+ readonly kind: "spans";
1116
+ readonly spans: readonly ["pi.harness.step", "pi.harness.run"];
1117
+ };
1118
+ readonly startAttributes: {
1119
+ readonly "pi.operation.id": {
1120
+ readonly type: "string";
1121
+ readonly required: true;
1122
+ readonly cardinality: "high";
1123
+ readonly description: "Durable operation id";
1124
+ };
1125
+ readonly "pi.sleep.delay_ms": {
1126
+ readonly type: "number";
1127
+ readonly required: true;
1128
+ readonly description: "Requested delay in milliseconds";
1129
+ };
1130
+ };
1131
+ readonly endAttributes: {
1132
+ readonly "pi.sleep.outcome": {
1133
+ readonly type: "string";
1134
+ readonly values: readonly ["elapsed", "aborted"];
1135
+ readonly description: "Delay outcome";
1136
+ };
1137
+ };
1138
+ readonly status: {
1139
+ readonly default: "ok";
1140
+ readonly errorWhen: "Sleep work throws";
1141
+ };
1142
+ };
1143
+ readonly "pi.harness.event_handler": {
1144
+ readonly description: "One passive event listener invocation";
1145
+ readonly parents: {
1146
+ readonly kind: "any";
1147
+ };
1148
+ readonly startAttributes: {
1149
+ readonly "pi.event.type": {
1150
+ readonly type: "string";
1151
+ readonly required: true;
1152
+ readonly cardinality: "low";
1153
+ readonly values: readonly ["run_start", "run_resume", "run_suspend", "run_abort", "run_end", "fault", "handler_error", "turn_start", "turn_end", "retry_scheduled", "retry_start", "retry_end", "message_start", "message_update", "message_end", "tool_start", "tool_update", "tool_end", "entry_added", "write_pending", "queue_update", "fact_update", "config_update", "compaction_start", "compaction_end", "navigation_start", "navigation_end", "lane_created", "usage"];
1154
+ readonly description: "Delivered harness event type";
1155
+ };
1156
+ readonly "pi.lane.name": {
1157
+ readonly type: "string";
1158
+ readonly required: false;
1159
+ readonly cardinality: "high";
1160
+ readonly description: "Lane name for lane-scoped events";
1161
+ };
1162
+ };
1163
+ readonly endAttributes: {};
1164
+ readonly status: {
1165
+ readonly default: "ok";
1166
+ readonly errorWhen: "The listener throws";
1167
+ };
1168
+ };
1169
+ readonly "pi.session.write": {
1170
+ readonly description: "One committed session mutation";
1171
+ readonly parents: {
1172
+ readonly kind: "any";
1173
+ };
1174
+ readonly startAttributes: {
1175
+ readonly "pi.lane.name": {
1176
+ readonly type: "string";
1177
+ readonly required: true;
1178
+ readonly cardinality: "high";
1179
+ readonly description: "Lane name";
1180
+ };
1181
+ readonly "pi.operation.id": {
1182
+ readonly type: "string";
1183
+ readonly required: false;
1184
+ readonly cardinality: "high";
1185
+ readonly description: "Durable operation id when accepted";
1186
+ };
1187
+ readonly "pi.session.mutation": {
1188
+ readonly type: "string";
1189
+ readonly required: true;
1190
+ readonly values: readonly ["entry", "record", "lane", "fact"];
1191
+ readonly description: "Session mutation kind";
1192
+ };
1193
+ readonly "pi.session.item_type": {
1194
+ readonly type: "string";
1195
+ readonly required: false;
1196
+ readonly description: "Entry, record, lane, or fact subtype";
1197
+ };
1198
+ };
1199
+ readonly endAttributes: {
1200
+ readonly "pi.session.seq": {
1201
+ readonly type: "number";
1202
+ readonly description: "Committed session sequence when exposed";
1203
+ };
1204
+ };
1205
+ readonly status: {
1206
+ readonly default: "ok";
1207
+ readonly errorWhen: "Storage rejects the mutation";
1208
+ };
1209
+ };
1210
+ };
1211
+ }];
1212
+ export type HarnessSpanName = TelemetrySchemaSpanName<typeof HARNESS_TELEMETRY_SCHEMA>;
1213
+ export type HarnessSpanStartAttributes<Name extends HarnessSpanName> = TelemetrySchemaSpanStartAttributes<typeof HARNESS_TELEMETRY_SCHEMA, Name>;
1214
+ export type HarnessSpanEndAttributes<Name extends HarnessSpanName> = TelemetrySchemaSpanEndAttributes<typeof HARNESS_TELEMETRY_SCHEMA, Name>;
1215
+ export type HarnessSpanAttributes<Name extends HarnessSpanName> = HarnessSpanStartAttributes<Name> & HarnessSpanEndAttributes<Name>;
1216
+ export type HarnessSpanEventName<Name extends HarnessSpanName> = TelemetrySchemaSpanEventName<typeof HARNESS_TELEMETRY_SCHEMA, Name>;
1217
+ export type HarnessSpanEventAttributes<Name extends HarnessSpanName, EventName extends HarnessSpanEventName<Name>> = TelemetrySchemaSpanEventAttributes<typeof HARNESS_TELEMETRY_SCHEMA, Name, EventName>;
1218
+ export type HarnessTelemetrySpan<Name extends HarnessSpanName> = SchemaTelemetrySpan<typeof HARNESS_TELEMETRY_SCHEMA, Name>;
1219
+ export type HarnessSpan = TelemetrySchemaSpanUnion<typeof HARNESS_TELEMETRY_SCHEMA>;
1220
+ export declare function startHarnessSpan<Name extends HarnessSpanName, const Attributes extends HarnessSpanStartAttributes<Name>, Result>(telemetryContext: TelemetryContext, name: Name, attributes: ExactTelemetryAttributes<HarnessSpanStartAttributes<Name>, Attributes>, callback: (span: HarnessTelemetrySpan<Name>) => Result | Promise<Result>): Promise<Result>;
1221
+ //# sourceMappingURL=telemetry.d.ts.map