@oneharness/sdk 0.5.9 → 0.5.11

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.
@@ -1,4 +1,8 @@
1
1
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
2
+ /**
3
+ * How a normalized tool interval was obtained.
4
+ */
5
+ export type TimingSource = "provider_measured" | "stdout_observed";
2
6
  /**
3
7
  * The normalized, closed set of failure reasons oneharness can classify from a
4
8
  * harness's output. It is the single source for the `failure_kind` contract
@@ -380,6 +384,10 @@ export interface ActionEvent {
380
384
  * Terminal tool state, populated on history tool-call events.
381
385
  */
382
386
  status: ToolCallStatus | null;
387
+ /**
388
+ * Provenance for the tool interval. Omitted when timing is unavailable.
389
+ */
390
+ timing_source?: TimingSource | null | undefined;
383
391
  /**
384
392
  * Stable call identity within the session. Present on tool calls and their
385
393
  * matching results when the provider exposes an identity; history fills a
@@ -1,16 +1,28 @@
1
1
  /**
2
2
  * One event-sourced history JSONL line.
3
3
  */
4
- export type HistoryLine = {
4
+ export type HistoryLine = ({
5
5
  event: ActionEvent;
6
6
  harness: string;
7
7
  harness_id?: string | null | undefined;
8
8
  run_id: string;
9
+ schema_version: "1.2";
10
+ type: "event";
11
+ variant?: string | null | undefined;
12
+ [k: string]: unknown;
13
+ } | {
14
+ event: ActionEvent & {
15
+ timing_source?: never | undefined;
16
+ [k: string]: unknown;
17
+ };
18
+ harness: string;
19
+ harness_id?: string | null | undefined;
20
+ run_id: string;
9
21
  schema_version: "1.0" | "1.1";
10
22
  type: "event";
11
23
  variant?: string | null | undefined;
12
24
  [k: string]: unknown;
13
- } | ({
25
+ }) | ({
14
26
  duration_ms: number;
15
27
  exit_code: number | null;
16
28
  failure_kind: FailureKind | null;
@@ -22,10 +34,11 @@ export type HistoryLine = {
22
34
  model: string | null;
23
35
  model_ms: number;
24
36
  name: string;
37
+ observed_tool_ms?: never | undefined;
25
38
  permission_mode: PermissionMode;
26
39
  project: string;
27
40
  prompt: string;
28
- schema_version: "1.0" | "1.1";
41
+ schema_version: "1.0" | "1.1" | "1.2";
29
42
  session: string;
30
43
  session_id: string | null;
31
44
  started_at: string;
@@ -51,10 +64,11 @@ export type HistoryLine = {
51
64
  model: string | null;
52
65
  model_ms: number;
53
66
  name: string;
67
+ observed_tool_ms?: never | undefined;
54
68
  permission_mode: PermissionMode;
55
69
  project: string;
56
70
  prompt: string;
57
- schema_version: "1.0" | "1.1";
71
+ schema_version: "1.0" | "1.1" | "1.2";
58
72
  session: string;
59
73
  session_id: string | null;
60
74
  started_at: string;
@@ -68,6 +82,36 @@ export type HistoryLine = {
68
82
  usage: Usage;
69
83
  variant?: string | null | undefined;
70
84
  [k: string]: unknown;
85
+ } | {
86
+ duration_ms: number;
87
+ exit_code: number | null;
88
+ failure_kind: FailureKind | null;
89
+ finished_at: null;
90
+ harness: string;
91
+ harness_id?: string | null | undefined;
92
+ history_id: string;
93
+ labels?: HistoryLabels | undefined;
94
+ model: string | null;
95
+ model_ms?: never | undefined;
96
+ name: string;
97
+ observed_tool_ms: number;
98
+ permission_mode: PermissionMode;
99
+ project: string;
100
+ prompt: string;
101
+ schema_version: "1.2";
102
+ session: string;
103
+ session_id: string | null;
104
+ started_at?: never | undefined;
105
+ status: Status;
106
+ text: string | null;
107
+ text_source: string | null;
108
+ time_to_first_token_ms?: never | undefined;
109
+ timestamp: string;
110
+ tool_ms?: never | undefined;
111
+ type: "run";
112
+ usage: Usage;
113
+ variant?: string | null | undefined;
114
+ [k: string]: unknown;
71
115
  } | {
72
116
  duration_ms: number | null;
73
117
  exit_code: number | null;
@@ -80,10 +124,11 @@ export type HistoryLine = {
80
124
  model: string | null;
81
125
  model_ms?: never | undefined;
82
126
  name: string;
127
+ observed_tool_ms?: never | undefined;
83
128
  permission_mode: PermissionMode;
84
129
  project: string;
85
130
  prompt: string;
86
- schema_version: "1.0" | "1.1";
131
+ schema_version: "1.0" | "1.1" | "1.2";
87
132
  session: string;
88
133
  session_id: string | null;
89
134
  started_at?: never | undefined;
@@ -99,6 +144,10 @@ export type HistoryLine = {
99
144
  [k: string]: unknown;
100
145
  });
101
146
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
147
+ /**
148
+ * How a normalized tool interval was obtained.
149
+ */
150
+ export type TimingSource = "provider_measured" | "stdout_observed";
102
151
  /**
103
152
  * The normalized, closed set of failure reasons oneharness can classify from a
104
153
  * harness's output. It is the single source for the `failure_kind` contract
@@ -166,6 +215,10 @@ export interface ActionEvent {
166
215
  * Terminal tool state, populated on history tool-call events.
167
216
  */
168
217
  status: ToolCallStatus | null;
218
+ /**
219
+ * Provenance for the tool interval. Omitted when timing is unavailable.
220
+ */
221
+ timing_source?: TimingSource | null | undefined;
169
222
  /**
170
223
  * Stable call identity within the session. Present on tool calls and their
171
224
  * matching results when the provider exposes an identity; history fills a