@openpond/evals 0.11.15 → 0.11.17

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 (159) hide show
  1. package/CONTRACT.md +9 -0
  2. package/dist/connected-evidence/contracts.js +72 -0
  3. package/dist/connected-evidence/imports.js +71 -0
  4. package/dist/connected-evidence/index.js +5 -0
  5. package/dist/connected-evidence/normalize.js +97 -0
  6. package/dist/connected-evidence/python-correctness.js +73 -0
  7. package/dist/connected-evidence/sources/claude-code.js +71 -0
  8. package/dist/connected-evidence/sources/codex.js +52 -0
  9. package/dist/connected-evidence/sources/history.js +86 -0
  10. package/dist/connected-evidence/sources/usage.js +15 -0
  11. package/dist/connected-evidence/usage-summary.js +52 -0
  12. package/dist/experiments.js +41 -7
  13. package/dist/graders.js +9 -6
  14. package/dist/human-review/comparison.js +161 -0
  15. package/dist/human-review/contracts.js +110 -0
  16. package/dist/human-review/execution.js +61 -0
  17. package/dist/human-review/handoff.js +18 -0
  18. package/dist/human-review/index.js +9 -0
  19. package/dist/human-review/local-publication.js +18 -0
  20. package/dist/human-review/repository.js +1 -0
  21. package/dist/human-review/results.js +18 -0
  22. package/dist/human-review/service.js +268 -0
  23. package/dist/human-review/task-proposals.js +39 -0
  24. package/dist/index.js +1 -0
  25. package/dist/javascript-verifier-contract.js +2 -2
  26. package/dist/learning/authoring.js +2 -1
  27. package/dist/learning/contracts.js +353 -81
  28. package/dist/learning/index.js +1 -0
  29. package/dist/learning/reward-authoring.js +5 -2
  30. package/dist/learning/training-handoff.js +32 -0
  31. package/dist/metrics-node.js +2 -0
  32. package/dist/profile-evaluation-target.js +7 -0
  33. package/dist/profile-evaluations.js +7 -10
  34. package/dist/profile-external-evaluation.js +35 -0
  35. package/dist/profile-source-candidate.js +5 -0
  36. package/dist/rewards.js +5 -3
  37. package/dist/taskset-run-contract.js +10 -0
  38. package/dist/tasksets.js +2 -0
  39. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +75 -1
  40. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -1
  41. package/dist/types/conformance.d.ts +150 -2
  42. package/dist/types/conformance.d.ts.map +1 -1
  43. package/dist/types/connected-evidence/contracts.d.ts +317 -0
  44. package/dist/types/connected-evidence/contracts.d.ts.map +1 -0
  45. package/dist/types/connected-evidence/imports.d.ts +19 -0
  46. package/dist/types/connected-evidence/imports.d.ts.map +1 -0
  47. package/dist/types/connected-evidence/index.d.ts +6 -0
  48. package/dist/types/connected-evidence/index.d.ts.map +1 -0
  49. package/dist/types/connected-evidence/normalize.d.ts +25 -0
  50. package/dist/types/connected-evidence/normalize.d.ts.map +1 -0
  51. package/dist/types/connected-evidence/python-correctness.d.ts +196 -0
  52. package/dist/types/connected-evidence/python-correctness.d.ts.map +1 -0
  53. package/dist/types/connected-evidence/sources/claude-code.d.ts +74 -0
  54. package/dist/types/connected-evidence/sources/claude-code.d.ts.map +1 -0
  55. package/dist/types/connected-evidence/sources/codex.d.ts +74 -0
  56. package/dist/types/connected-evidence/sources/codex.d.ts.map +1 -0
  57. package/dist/types/connected-evidence/sources/history.d.ts +146 -0
  58. package/dist/types/connected-evidence/sources/history.d.ts.map +1 -0
  59. package/dist/types/connected-evidence/sources/usage.d.ts +3 -0
  60. package/dist/types/connected-evidence/sources/usage.d.ts.map +1 -0
  61. package/dist/types/connected-evidence/usage-summary.d.ts +162 -0
  62. package/dist/types/connected-evidence/usage-summary.d.ts.map +1 -0
  63. package/dist/types/evidence/conformance.d.ts +28 -28
  64. package/dist/types/evidence/contracts.d.ts +27 -27
  65. package/dist/types/execution-contracts.d.ts +159 -5
  66. package/dist/types/execution-contracts.d.ts.map +1 -1
  67. package/dist/types/experiments.d.ts +498 -7
  68. package/dist/types/experiments.d.ts.map +1 -1
  69. package/dist/types/graders.d.ts +21 -1
  70. package/dist/types/graders.d.ts.map +1 -1
  71. package/dist/types/human-review/comparison.d.ts +1959 -0
  72. package/dist/types/human-review/comparison.d.ts.map +1 -0
  73. package/dist/types/human-review/contracts.d.ts +2719 -0
  74. package/dist/types/human-review/contracts.d.ts.map +1 -0
  75. package/dist/types/human-review/execution.d.ts +298 -0
  76. package/dist/types/human-review/execution.d.ts.map +1 -0
  77. package/dist/types/human-review/handoff.d.ts +124 -0
  78. package/dist/types/human-review/handoff.d.ts.map +1 -0
  79. package/dist/types/human-review/index.d.ts +10 -0
  80. package/dist/types/human-review/index.d.ts.map +1 -0
  81. package/dist/types/human-review/local-publication.d.ts +165 -0
  82. package/dist/types/human-review/local-publication.d.ts.map +1 -0
  83. package/dist/types/human-review/repository.d.ts +43 -0
  84. package/dist/types/human-review/repository.d.ts.map +1 -0
  85. package/dist/types/human-review/results.d.ts +118 -0
  86. package/dist/types/human-review/results.d.ts.map +1 -0
  87. package/dist/types/human-review/service.d.ts +878 -0
  88. package/dist/types/human-review/service.d.ts.map +1 -0
  89. package/dist/types/human-review/task-proposals.d.ts +70 -0
  90. package/dist/types/human-review/task-proposals.d.ts.map +1 -0
  91. package/dist/types/index.d.ts +1 -0
  92. package/dist/types/index.d.ts.map +1 -1
  93. package/dist/types/javascript-environment-contract.d.ts +1 -1
  94. package/dist/types/javascript-verifier-contract.d.ts +1 -1
  95. package/dist/types/javascript-verifier-contract.d.ts.map +1 -1
  96. package/dist/types/learned-preference.d.ts +2 -2
  97. package/dist/types/learning/acceptance-group.d.ts +13 -13
  98. package/dist/types/learning/acceptance-plan.d.ts +1 -1
  99. package/dist/types/learning/admission.d.ts +78 -1
  100. package/dist/types/learning/admission.d.ts.map +1 -1
  101. package/dist/types/learning/authoring-service.d.ts +2 -0
  102. package/dist/types/learning/authoring-service.d.ts.map +1 -1
  103. package/dist/types/learning/authoring.d.ts +20 -0
  104. package/dist/types/learning/authoring.d.ts.map +1 -1
  105. package/dist/types/learning/batch-service.d.ts +76 -2
  106. package/dist/types/learning/batch-service.d.ts.map +1 -1
  107. package/dist/types/learning/contracts.d.ts +759 -24
  108. package/dist/types/learning/contracts.d.ts.map +1 -1
  109. package/dist/types/learning/index.d.ts +1 -0
  110. package/dist/types/learning/index.d.ts.map +1 -1
  111. package/dist/types/learning/iteration-candidate-decision.d.ts +2 -2
  112. package/dist/types/learning/iteration-dispatch-contracts.d.ts +2 -2
  113. package/dist/types/learning/operations.d.ts +1118 -8
  114. package/dist/types/learning/operations.d.ts.map +1 -1
  115. package/dist/types/learning/repository.d.ts +402 -15
  116. package/dist/types/learning/repository.d.ts.map +1 -1
  117. package/dist/types/learning/reward-authoring.d.ts.map +1 -1
  118. package/dist/types/learning/reward-calibration.d.ts +74 -0
  119. package/dist/types/learning/reward-calibration.d.ts.map +1 -1
  120. package/dist/types/learning/reward-checks.d.ts +14 -2
  121. package/dist/types/learning/reward-checks.d.ts.map +1 -1
  122. package/dist/types/learning/training-handoff.d.ts +201 -0
  123. package/dist/types/learning/training-handoff.d.ts.map +1 -0
  124. package/dist/types/learning/transport.d.ts +963 -21
  125. package/dist/types/learning/transport.d.ts.map +1 -1
  126. package/dist/types/metrics-node.d.ts +3 -1
  127. package/dist/types/metrics-node.d.ts.map +1 -1
  128. package/dist/types/model-improvement-qualification.d.ts +3 -3
  129. package/dist/types/native-harness-experiment-attempt.d.ts +2 -2
  130. package/dist/types/profile-evaluation-comparisons.d.ts +230 -0
  131. package/dist/types/profile-evaluation-comparisons.d.ts.map +1 -1
  132. package/dist/types/profile-evaluation-target.d.ts +14 -0
  133. package/dist/types/profile-evaluation-target.d.ts.map +1 -0
  134. package/dist/types/profile-evaluations.d.ts +117 -14
  135. package/dist/types/profile-evaluations.d.ts.map +1 -1
  136. package/dist/types/profile-external-evaluation.d.ts +404 -0
  137. package/dist/types/profile-external-evaluation.d.ts.map +1 -0
  138. package/dist/types/profile-source-candidate.d.ts +15 -0
  139. package/dist/types/profile-source-candidate.d.ts.map +1 -0
  140. package/dist/types/review-conformance.d.ts +7 -7
  141. package/dist/types/rewards.d.ts +253 -0
  142. package/dist/types/rewards.d.ts.map +1 -1
  143. package/dist/types/rollouts.d.ts +3 -3
  144. package/dist/types/taskset-run-contract.d.ts +230 -0
  145. package/dist/types/taskset-run-contract.d.ts.map +1 -1
  146. package/dist/types/tasksets.d.ts +311 -3
  147. package/dist/types/tasksets.d.ts.map +1 -1
  148. package/dist/types/telemetry-analysis.d.ts +2 -2
  149. package/dist/types/telemetry-bundle.d.ts +6 -6
  150. package/dist/types/telemetry.d.ts +3 -3
  151. package/package.json +9 -1
  152. package/schemas/learning/v1/command-request.schema.json +1745 -409
  153. package/schemas/learning/v1/decision.schema.json +11 -0
  154. package/schemas/learning/v1/draft.schema.json +11 -0
  155. package/schemas/learning/v1/grade.schema.json +11 -0
  156. package/schemas/learning/v1/package.schema.json +532 -12
  157. package/schemas/learning/v1/policy.schema.json +836 -28
  158. package/schemas/learning/v1/reward.schema.json +520 -0
  159. package/schemas/learning/v1/reward_check.schema.json +9 -0
@@ -0,0 +1,74 @@
1
+ import type { ConnectedFile } from "../contracts.js";
2
+ export declare function parseCodexSession(file: ConnectedFile, rows: Record<string, unknown>[]): {
3
+ schemaVersion: "openpond.connectedEvidence.v1";
4
+ normalizerVersion: "connected-evidence-1";
5
+ origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code";
6
+ sessionId: string;
7
+ branchId: string | null;
8
+ parentSessionId: string | null;
9
+ exporterVersion: string | null;
10
+ sourceFiles: {
11
+ path: string;
12
+ contentHash: string;
13
+ sizeBytes: number;
14
+ }[];
15
+ events: {
16
+ id: string;
17
+ sequence: number;
18
+ occurredAt: string | null;
19
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
20
+ role: "user" | "tool" | "assistant" | "system" | null;
21
+ callId: string | null;
22
+ parentId: string | null;
23
+ content: import("zod").JSONType;
24
+ usage: {
25
+ invocationId: string;
26
+ inputTokens: number | null;
27
+ outputTokens: number | null;
28
+ cachedInputTokens: number | null;
29
+ totalTokens: number | null;
30
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
31
+ } | null;
32
+ }[];
33
+ unmappedEvents: {
34
+ id: string;
35
+ sequence: number;
36
+ occurredAt: string | null;
37
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
38
+ role: "user" | "tool" | "assistant" | "system" | null;
39
+ callId: string | null;
40
+ parentId: string | null;
41
+ content: import("zod").JSONType;
42
+ usage: {
43
+ invocationId: string;
44
+ inputTokens: number | null;
45
+ outputTokens: number | null;
46
+ cachedInputTokens: number | null;
47
+ totalTokens: number | null;
48
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
49
+ } | null;
50
+ }[];
51
+ boundaries: {
52
+ id: string;
53
+ familyKey: string;
54
+ projection: "turn" | "conversation";
55
+ requestEventId: string;
56
+ start: number;
57
+ end: number;
58
+ inputHash: string;
59
+ outputHash: string | null;
60
+ revisionHash: string;
61
+ terminal: "unknown" | "cancelled" | "failed" | "completed";
62
+ coverage: {
63
+ answer: boolean;
64
+ context: "unknown" | "retained" | "compacted";
65
+ process: "absent" | "partial" | "retained";
66
+ artifacts: "absent" | "retained" | "references_only";
67
+ replay: "unavailable";
68
+ gaps: string[];
69
+ };
70
+ }[];
71
+ warnings: string[];
72
+ contentHash: string;
73
+ };
74
+ //# sourceMappingURL=codex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCrF"}
@@ -0,0 +1,146 @@
1
+ import type { ConnectedFile } from "../contracts.js";
2
+ export declare function parseHermesEvidence(file: ConnectedFile, row: Record<string, unknown>): {
3
+ schemaVersion: "openpond.connectedEvidence.v1";
4
+ normalizerVersion: "connected-evidence-1";
5
+ origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code";
6
+ sessionId: string;
7
+ branchId: string | null;
8
+ parentSessionId: string | null;
9
+ exporterVersion: string | null;
10
+ sourceFiles: {
11
+ path: string;
12
+ contentHash: string;
13
+ sizeBytes: number;
14
+ }[];
15
+ events: {
16
+ id: string;
17
+ sequence: number;
18
+ occurredAt: string | null;
19
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
20
+ role: "user" | "tool" | "assistant" | "system" | null;
21
+ callId: string | null;
22
+ parentId: string | null;
23
+ content: import("zod").JSONType;
24
+ usage: {
25
+ invocationId: string;
26
+ inputTokens: number | null;
27
+ outputTokens: number | null;
28
+ cachedInputTokens: number | null;
29
+ totalTokens: number | null;
30
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
31
+ } | null;
32
+ }[];
33
+ unmappedEvents: {
34
+ id: string;
35
+ sequence: number;
36
+ occurredAt: string | null;
37
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
38
+ role: "user" | "tool" | "assistant" | "system" | null;
39
+ callId: string | null;
40
+ parentId: string | null;
41
+ content: import("zod").JSONType;
42
+ usage: {
43
+ invocationId: string;
44
+ inputTokens: number | null;
45
+ outputTokens: number | null;
46
+ cachedInputTokens: number | null;
47
+ totalTokens: number | null;
48
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
49
+ } | null;
50
+ }[];
51
+ boundaries: {
52
+ id: string;
53
+ familyKey: string;
54
+ projection: "turn" | "conversation";
55
+ requestEventId: string;
56
+ start: number;
57
+ end: number;
58
+ inputHash: string;
59
+ outputHash: string | null;
60
+ revisionHash: string;
61
+ terminal: "unknown" | "cancelled" | "failed" | "completed";
62
+ coverage: {
63
+ answer: boolean;
64
+ context: "unknown" | "retained" | "compacted";
65
+ process: "absent" | "partial" | "retained";
66
+ artifacts: "absent" | "retained" | "references_only";
67
+ replay: "unavailable";
68
+ gaps: string[];
69
+ };
70
+ }[];
71
+ warnings: string[];
72
+ contentHash: string;
73
+ };
74
+ export declare function parseOpenClawEvidence(files: ConnectedFile[]): {
75
+ schemaVersion: "openpond.connectedEvidence.v1";
76
+ normalizerVersion: "connected-evidence-1";
77
+ origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code";
78
+ sessionId: string;
79
+ branchId: string | null;
80
+ parentSessionId: string | null;
81
+ exporterVersion: string | null;
82
+ sourceFiles: {
83
+ path: string;
84
+ contentHash: string;
85
+ sizeBytes: number;
86
+ }[];
87
+ events: {
88
+ id: string;
89
+ sequence: number;
90
+ occurredAt: string | null;
91
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
92
+ role: "user" | "tool" | "assistant" | "system" | null;
93
+ callId: string | null;
94
+ parentId: string | null;
95
+ content: import("zod").JSONType;
96
+ usage: {
97
+ invocationId: string;
98
+ inputTokens: number | null;
99
+ outputTokens: number | null;
100
+ cachedInputTokens: number | null;
101
+ totalTokens: number | null;
102
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
103
+ } | null;
104
+ }[];
105
+ unmappedEvents: {
106
+ id: string;
107
+ sequence: number;
108
+ occurredAt: string | null;
109
+ kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
110
+ role: "user" | "tool" | "assistant" | "system" | null;
111
+ callId: string | null;
112
+ parentId: string | null;
113
+ content: import("zod").JSONType;
114
+ usage: {
115
+ invocationId: string;
116
+ inputTokens: number | null;
117
+ outputTokens: number | null;
118
+ cachedInputTokens: number | null;
119
+ totalTokens: number | null;
120
+ provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
121
+ } | null;
122
+ }[];
123
+ boundaries: {
124
+ id: string;
125
+ familyKey: string;
126
+ projection: "turn" | "conversation";
127
+ requestEventId: string;
128
+ start: number;
129
+ end: number;
130
+ inputHash: string;
131
+ outputHash: string | null;
132
+ revisionHash: string;
133
+ terminal: "unknown" | "cancelled" | "failed" | "completed";
134
+ coverage: {
135
+ answer: boolean;
136
+ context: "unknown" | "retained" | "compacted";
137
+ process: "absent" | "partial" | "retained";
138
+ artifacts: "absent" | "retained" | "references_only";
139
+ replay: "unavailable";
140
+ gaps: string[];
141
+ };
142
+ }[];
143
+ warnings: string[];
144
+ contentHash: string;
145
+ };
146
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/history.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA8BrE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpF;AACD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC3D"}
@@ -0,0 +1,3 @@
1
+ import type { ConnectedUsage } from "../contracts.js";
2
+ export declare function sourceUsage(value: unknown, invocationId: string, provenance?: ConnectedUsage["provenance"]): ConnectedUsage | null;
3
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,GAAE,cAAc,CAAC,YAAY,CAAyB,GAAG,cAAc,GAAG,IAAI,CAYzJ"}
@@ -0,0 +1,162 @@
1
+ import { z } from "zod";
2
+ export declare const ConnectedInvocationSchema: z.ZodObject<{
3
+ requestId: z.ZodString;
4
+ startedAt: z.ZodString;
5
+ provider: z.ZodString;
6
+ model: z.ZodString;
7
+ mode: z.ZodString;
8
+ status: z.ZodString;
9
+ source: z.ZodString;
10
+ projectId: z.ZodNullable<z.ZodString>;
11
+ inputTokens: z.ZodNullable<z.ZodNumber>;
12
+ cachedInputTokens: z.ZodNullable<z.ZodNumber>;
13
+ outputTokens: z.ZodNullable<z.ZodNumber>;
14
+ totalTokens: z.ZodNullable<z.ZodNumber>;
15
+ }, z.core.$strict>;
16
+ export type ConnectedInvocation = z.infer<typeof ConnectedInvocationSchema>;
17
+ declare const empty: () => {
18
+ invocations: number;
19
+ inputTokens: number;
20
+ cachedInputTokens: number;
21
+ outputTokens: number;
22
+ totalTokens: number;
23
+ missingInput: number;
24
+ missingCachedInput: number;
25
+ missingOutput: number;
26
+ missingTotal: number;
27
+ failures: number;
28
+ unattributed: number;
29
+ };
30
+ export type ConnectedUsageTotals = ReturnType<typeof empty>;
31
+ export declare const ConnectedUsageTotalsSchema: z.ZodObject<{
32
+ invocations: z.ZodNumber;
33
+ inputTokens: z.ZodNumber;
34
+ cachedInputTokens: z.ZodNumber;
35
+ outputTokens: z.ZodNumber;
36
+ totalTokens: z.ZodNumber;
37
+ missingInput: z.ZodNumber;
38
+ missingCachedInput: z.ZodNumber;
39
+ missingOutput: z.ZodNumber;
40
+ missingTotal: z.ZodNumber;
41
+ failures: z.ZodNumber;
42
+ unattributed: z.ZodNumber;
43
+ }, z.core.$strict>;
44
+ export declare const ConnectedUsageSummarySchema: z.ZodObject<{
45
+ total: z.ZodObject<{
46
+ invocations: z.ZodNumber;
47
+ inputTokens: z.ZodNumber;
48
+ cachedInputTokens: z.ZodNumber;
49
+ outputTokens: z.ZodNumber;
50
+ totalTokens: z.ZodNumber;
51
+ missingInput: z.ZodNumber;
52
+ missingCachedInput: z.ZodNumber;
53
+ missingOutput: z.ZodNumber;
54
+ missingTotal: z.ZodNumber;
55
+ failures: z.ZodNumber;
56
+ unattributed: z.ZodNumber;
57
+ }, z.core.$strict>;
58
+ days: z.ZodArray<z.ZodObject<{
59
+ invocations: z.ZodNumber;
60
+ inputTokens: z.ZodNumber;
61
+ cachedInputTokens: z.ZodNumber;
62
+ outputTokens: z.ZodNumber;
63
+ totalTokens: z.ZodNumber;
64
+ missingInput: z.ZodNumber;
65
+ missingCachedInput: z.ZodNumber;
66
+ missingOutput: z.ZodNumber;
67
+ missingTotal: z.ZodNumber;
68
+ failures: z.ZodNumber;
69
+ unattributed: z.ZodNumber;
70
+ key: z.ZodString;
71
+ }, z.core.$strict>>;
72
+ modes: z.ZodArray<z.ZodObject<{
73
+ invocations: z.ZodNumber;
74
+ inputTokens: z.ZodNumber;
75
+ cachedInputTokens: z.ZodNumber;
76
+ outputTokens: z.ZodNumber;
77
+ totalTokens: z.ZodNumber;
78
+ missingInput: z.ZodNumber;
79
+ missingCachedInput: z.ZodNumber;
80
+ missingOutput: z.ZodNumber;
81
+ missingTotal: z.ZodNumber;
82
+ failures: z.ZodNumber;
83
+ unattributed: z.ZodNumber;
84
+ key: z.ZodString;
85
+ }, z.core.$strict>>;
86
+ models: z.ZodArray<z.ZodObject<{
87
+ invocations: z.ZodNumber;
88
+ inputTokens: z.ZodNumber;
89
+ cachedInputTokens: z.ZodNumber;
90
+ outputTokens: z.ZodNumber;
91
+ totalTokens: z.ZodNumber;
92
+ missingInput: z.ZodNumber;
93
+ missingCachedInput: z.ZodNumber;
94
+ missingOutput: z.ZodNumber;
95
+ missingTotal: z.ZodNumber;
96
+ failures: z.ZodNumber;
97
+ unattributed: z.ZodNumber;
98
+ key: z.ZodString;
99
+ }, z.core.$strict>>;
100
+ }, z.core.$strict>;
101
+ /** A billed retry has a new invocation identity; repeated copies of one receipt do not add spend.
102
+ * Unknown token fields remain unknown and are never inferred from another field.
103
+ */
104
+ export declare function summarizeConnectedInvocations(raw: unknown[]): {
105
+ total: {
106
+ invocations: number;
107
+ inputTokens: number;
108
+ cachedInputTokens: number;
109
+ outputTokens: number;
110
+ totalTokens: number;
111
+ missingInput: number;
112
+ missingCachedInput: number;
113
+ missingOutput: number;
114
+ missingTotal: number;
115
+ failures: number;
116
+ unattributed: number;
117
+ };
118
+ days: {
119
+ invocations: number;
120
+ inputTokens: number;
121
+ cachedInputTokens: number;
122
+ outputTokens: number;
123
+ totalTokens: number;
124
+ missingInput: number;
125
+ missingCachedInput: number;
126
+ missingOutput: number;
127
+ missingTotal: number;
128
+ failures: number;
129
+ unattributed: number;
130
+ key: string;
131
+ }[];
132
+ modes: {
133
+ invocations: number;
134
+ inputTokens: number;
135
+ cachedInputTokens: number;
136
+ outputTokens: number;
137
+ totalTokens: number;
138
+ missingInput: number;
139
+ missingCachedInput: number;
140
+ missingOutput: number;
141
+ missingTotal: number;
142
+ failures: number;
143
+ unattributed: number;
144
+ key: string;
145
+ }[];
146
+ models: {
147
+ invocations: number;
148
+ inputTokens: number;
149
+ cachedInputTokens: number;
150
+ outputTokens: number;
151
+ totalTokens: number;
152
+ missingInput: number;
153
+ missingCachedInput: number;
154
+ missingOutput: number;
155
+ missingTotal: number;
156
+ failures: number;
157
+ unattributed: number;
158
+ key: string;
159
+ }[];
160
+ };
161
+ export {};
162
+ //# sourceMappingURL=usage-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-summary.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/usage-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;kBAE6D,CAAC;AACpG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,QAAA,MAAM,KAAK;;;;;;;;;;;;CACiG,CAAC;AAC7G,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AAE5D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;kBAE8E,CAAC;AACtH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEqH,CAAC;AAQ9J;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB3D"}
@@ -9,9 +9,9 @@ export declare const completeWorkProcessTraceFixture: {
9
9
  sequence: number;
10
10
  timestamp: string;
11
11
  layer: "agent" | "environment";
12
- kind: "validation" | "artifact" | "approval" | "tool" | "state_transition" | "question" | "cleanup";
12
+ kind: "validation" | "approval" | "artifact" | "tool" | "state_transition" | "question" | "cleanup";
13
13
  action: "environment_destroyed" | "turn_started" | "turn_completed" | "turn_failed" | "turn_cancelled" | "turn_timed_out" | "tool_invoked" | "tool_completed" | "tool_failed" | "validation_completed" | "validation_failed" | "approval_requested" | "approval_resolved" | "question_asked" | "question_answered" | "question_dismissed" | "artifact_created" | "workspace_changed" | "environment_created" | "environment_reset" | "cleanup_completed" | "cleanup_failed";
14
- status: "failed" | "completed" | "cancelled" | "started";
14
+ status: "cancelled" | "failed" | "completed" | "started";
15
15
  inputHash: string | null;
16
16
  outputHash: string | null;
17
17
  receiptHash: string | null;
@@ -23,16 +23,16 @@ export declare const completeWorkProcessTraceFixture: {
23
23
  id: string;
24
24
  }[];
25
25
  attributes: {
26
- toolCategory: "agent" | "command" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
26
+ toolCategory: "command" | "agent" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
27
27
  validationKind: "test" | "structural" | "visual" | "user_review" | "other" | null;
28
- transitionState: "failed" | "completed" | "cancelled" | "timeout" | "running" | null;
28
+ transitionState: "cancelled" | "failed" | "completed" | "timeout" | "running" | null;
29
29
  interventionOutcome: "requested" | "approved" | "denied" | "answered" | "dismissed" | null;
30
30
  artifactCount: number;
31
31
  exitCode: number | null;
32
32
  durationMs: number | null;
33
33
  cpuTimeMs: number | null;
34
34
  memoryPeakBytes: number | null;
35
- errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
35
+ errorClass: "unknown" | "policy" | "validation" | "cancelled" | "environment" | "timeout" | "infrastructure" | null;
36
36
  };
37
37
  }[];
38
38
  contentHash: string;
@@ -70,8 +70,8 @@ export declare const completeWorkEvidenceFixture: {
70
70
  };
71
71
  inputHash: string;
72
72
  terminal: {
73
- status: "failed" | "completed" | "cancelled" | "timeout";
74
- failureClass: "unknown" | "policy_failure" | "environment_failure" | "cancelled" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
73
+ status: "cancelled" | "failed" | "completed" | "timeout";
74
+ failureClass: "unknown" | "cancelled" | "policy_failure" | "environment_failure" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
75
75
  };
76
76
  trace: {
77
77
  sanitizedRef: {
@@ -186,9 +186,9 @@ export declare const incompleteWorkProcessTraceFixture: {
186
186
  sequence: number;
187
187
  timestamp: string;
188
188
  layer: "agent" | "environment";
189
- kind: "validation" | "artifact" | "approval" | "tool" | "state_transition" | "question" | "cleanup";
189
+ kind: "validation" | "approval" | "artifact" | "tool" | "state_transition" | "question" | "cleanup";
190
190
  action: "environment_destroyed" | "turn_started" | "turn_completed" | "turn_failed" | "turn_cancelled" | "turn_timed_out" | "tool_invoked" | "tool_completed" | "tool_failed" | "validation_completed" | "validation_failed" | "approval_requested" | "approval_resolved" | "question_asked" | "question_answered" | "question_dismissed" | "artifact_created" | "workspace_changed" | "environment_created" | "environment_reset" | "cleanup_completed" | "cleanup_failed";
191
- status: "failed" | "completed" | "cancelled" | "started";
191
+ status: "cancelled" | "failed" | "completed" | "started";
192
192
  inputHash: string | null;
193
193
  outputHash: string | null;
194
194
  receiptHash: string | null;
@@ -200,16 +200,16 @@ export declare const incompleteWorkProcessTraceFixture: {
200
200
  id: string;
201
201
  }[];
202
202
  attributes: {
203
- toolCategory: "agent" | "command" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
203
+ toolCategory: "command" | "agent" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
204
204
  validationKind: "test" | "structural" | "visual" | "user_review" | "other" | null;
205
- transitionState: "failed" | "completed" | "cancelled" | "timeout" | "running" | null;
205
+ transitionState: "cancelled" | "failed" | "completed" | "timeout" | "running" | null;
206
206
  interventionOutcome: "requested" | "approved" | "denied" | "answered" | "dismissed" | null;
207
207
  artifactCount: number;
208
208
  exitCode: number | null;
209
209
  durationMs: number | null;
210
210
  cpuTimeMs: number | null;
211
211
  memoryPeakBytes: number | null;
212
- errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
212
+ errorClass: "unknown" | "policy" | "validation" | "cancelled" | "environment" | "timeout" | "infrastructure" | null;
213
213
  };
214
214
  }[];
215
215
  contentHash: string;
@@ -308,8 +308,8 @@ export declare const invalidRawEvidenceFixture: {
308
308
  };
309
309
  inputHash: string;
310
310
  terminal: {
311
- status: "failed" | "completed" | "cancelled" | "timeout";
312
- failureClass: "unknown" | "policy_failure" | "environment_failure" | "cancelled" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
311
+ status: "cancelled" | "failed" | "completed" | "timeout";
312
+ failureClass: "unknown" | "cancelled" | "policy_failure" | "environment_failure" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
313
313
  };
314
314
  trace: {
315
315
  sanitizedRef: {
@@ -392,9 +392,9 @@ export declare const workEvidenceConformance: {
392
392
  sequence: number;
393
393
  timestamp: string;
394
394
  layer: "agent" | "environment";
395
- kind: "validation" | "artifact" | "approval" | "tool" | "state_transition" | "question" | "cleanup";
395
+ kind: "validation" | "approval" | "artifact" | "tool" | "state_transition" | "question" | "cleanup";
396
396
  action: "environment_destroyed" | "turn_started" | "turn_completed" | "turn_failed" | "turn_cancelled" | "turn_timed_out" | "tool_invoked" | "tool_completed" | "tool_failed" | "validation_completed" | "validation_failed" | "approval_requested" | "approval_resolved" | "question_asked" | "question_answered" | "question_dismissed" | "artifact_created" | "workspace_changed" | "environment_created" | "environment_reset" | "cleanup_completed" | "cleanup_failed";
397
- status: "failed" | "completed" | "cancelled" | "started";
397
+ status: "cancelled" | "failed" | "completed" | "started";
398
398
  inputHash: string | null;
399
399
  outputHash: string | null;
400
400
  receiptHash: string | null;
@@ -406,16 +406,16 @@ export declare const workEvidenceConformance: {
406
406
  id: string;
407
407
  }[];
408
408
  attributes: {
409
- toolCategory: "agent" | "command" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
409
+ toolCategory: "command" | "agent" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
410
410
  validationKind: "test" | "structural" | "visual" | "user_review" | "other" | null;
411
- transitionState: "failed" | "completed" | "cancelled" | "timeout" | "running" | null;
411
+ transitionState: "cancelled" | "failed" | "completed" | "timeout" | "running" | null;
412
412
  interventionOutcome: "requested" | "approved" | "denied" | "answered" | "dismissed" | null;
413
413
  artifactCount: number;
414
414
  exitCode: number | null;
415
415
  durationMs: number | null;
416
416
  cpuTimeMs: number | null;
417
417
  memoryPeakBytes: number | null;
418
- errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
418
+ errorClass: "unknown" | "policy" | "validation" | "cancelled" | "environment" | "timeout" | "infrastructure" | null;
419
419
  };
420
420
  }[];
421
421
  contentHash: string;
@@ -453,8 +453,8 @@ export declare const workEvidenceConformance: {
453
453
  };
454
454
  inputHash: string;
455
455
  terminal: {
456
- status: "failed" | "completed" | "cancelled" | "timeout";
457
- failureClass: "unknown" | "policy_failure" | "environment_failure" | "cancelled" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
456
+ status: "cancelled" | "failed" | "completed" | "timeout";
457
+ failureClass: "unknown" | "cancelled" | "policy_failure" | "environment_failure" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
458
458
  };
459
459
  trace: {
460
460
  sanitizedRef: {
@@ -625,9 +625,9 @@ export declare const workEvidenceConformance: {
625
625
  sequence: number;
626
626
  timestamp: string;
627
627
  layer: "agent" | "environment";
628
- kind: "validation" | "artifact" | "approval" | "tool" | "state_transition" | "question" | "cleanup";
628
+ kind: "validation" | "approval" | "artifact" | "tool" | "state_transition" | "question" | "cleanup";
629
629
  action: "environment_destroyed" | "turn_started" | "turn_completed" | "turn_failed" | "turn_cancelled" | "turn_timed_out" | "tool_invoked" | "tool_completed" | "tool_failed" | "validation_completed" | "validation_failed" | "approval_requested" | "approval_resolved" | "question_asked" | "question_answered" | "question_dismissed" | "artifact_created" | "workspace_changed" | "environment_created" | "environment_reset" | "cleanup_completed" | "cleanup_failed";
630
- status: "failed" | "completed" | "cancelled" | "started";
630
+ status: "cancelled" | "failed" | "completed" | "started";
631
631
  inputHash: string | null;
632
632
  outputHash: string | null;
633
633
  receiptHash: string | null;
@@ -639,16 +639,16 @@ export declare const workEvidenceConformance: {
639
639
  id: string;
640
640
  }[];
641
641
  attributes: {
642
- toolCategory: "agent" | "command" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
642
+ toolCategory: "command" | "agent" | "filesystem" | "source_control" | "browser" | "connected_app" | "sandbox" | "other" | null;
643
643
  validationKind: "test" | "structural" | "visual" | "user_review" | "other" | null;
644
- transitionState: "failed" | "completed" | "cancelled" | "timeout" | "running" | null;
644
+ transitionState: "cancelled" | "failed" | "completed" | "timeout" | "running" | null;
645
645
  interventionOutcome: "requested" | "approved" | "denied" | "answered" | "dismissed" | null;
646
646
  artifactCount: number;
647
647
  exitCode: number | null;
648
648
  durationMs: number | null;
649
649
  cpuTimeMs: number | null;
650
650
  memoryPeakBytes: number | null;
651
- errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
651
+ errorClass: "unknown" | "policy" | "validation" | "cancelled" | "environment" | "timeout" | "infrastructure" | null;
652
652
  };
653
653
  }[];
654
654
  contentHash: string;
@@ -691,8 +691,8 @@ export declare const workEvidenceConformance: {
691
691
  };
692
692
  inputHash: string;
693
693
  terminal: {
694
- status: "failed" | "completed" | "cancelled" | "timeout";
695
- failureClass: "unknown" | "policy_failure" | "environment_failure" | "cancelled" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
694
+ status: "cancelled" | "failed" | "completed" | "timeout";
695
+ failureClass: "unknown" | "cancelled" | "policy_failure" | "environment_failure" | "infrastructure_failure" | "timeout" | "validation_failure" | "model_failure" | null;
696
696
  };
697
697
  trace: {
698
698
  sanitizedRef: {