@leostera/evalkit 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +8 -7
  3. package/dist/cli.mjs +525 -72
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/dashboard/assets/index-D9NtA46z.css +2 -0
  6. package/dist/dashboard/assets/{index-CVd_Np_w.js → index-DrBwLKJD.js} +1 -1
  7. package/dist/dashboard/index.html +2 -2
  8. package/dist/files-C-U0-PWW.mjs +26 -0
  9. package/dist/files-C-U0-PWW.mjs.map +1 -0
  10. package/dist/index-db-HdZXelOS.d.mts +142 -0
  11. package/dist/index-db-HdZXelOS.d.mts.map +1 -0
  12. package/dist/index-db-vbqEGFaU.mjs +548 -0
  13. package/dist/index-db-vbqEGFaU.mjs.map +1 -0
  14. package/dist/{index-M5eRlMfd.d.mts → index-lOw0fmak.d.mts} +96 -9
  15. package/dist/index-lOw0fmak.d.mts.map +1 -0
  16. package/dist/index.d.mts +2 -2
  17. package/dist/index.mjs +2 -2
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/runner.d.mts +21 -3
  20. package/dist/runner.d.mts.map +1 -1
  21. package/dist/runner.mjs +1 -1
  22. package/dist/share-worker.d.mts +51 -0
  23. package/dist/share-worker.d.mts.map +1 -0
  24. package/dist/share-worker.mjs +73 -0
  25. package/dist/share-worker.mjs.map +1 -0
  26. package/dist/share.d.mts +116 -0
  27. package/dist/share.d.mts.map +1 -0
  28. package/dist/share.mjs +4 -0
  29. package/dist/{src-DrwwgaPn.mjs → src-ButXPY8P.mjs} +20 -5
  30. package/dist/src-ButXPY8P.mjs.map +1 -0
  31. package/dist/{src-DluldGKn.mjs → src-DoPs9Yug.mjs} +11 -7
  32. package/dist/src-DoPs9Yug.mjs.map +1 -0
  33. package/dist/src-DzZueFn3.mjs +98 -0
  34. package/dist/src-DzZueFn3.mjs.map +1 -0
  35. package/package.json +10 -1
  36. package/dist/dashboard/assets/index-CMr4aulR.css +0 -2
  37. package/dist/index-M5eRlMfd.d.mts.map +0 -1
  38. package/dist/src-DluldGKn.mjs.map +0 -1
  39. package/dist/src-DrwwgaPn.mjs.map +0 -1
@@ -76,6 +76,19 @@ type EvalkitConfig = {
76
76
  };
77
77
  reportDir?: string;
78
78
  sandboxDir?: string;
79
+ share?: ShareConfig;
80
+ };
81
+ /** HTTP header names and values. */
82
+ type ShareHeaders = Record<string, string>;
83
+ type ShareConfig = {
84
+ /** Where `evalkit share` uploads results. `EVALKIT_SHARE_URL` overrides it. */
85
+ url: string;
86
+ /**
87
+ * Extra headers for every request to the share server, e.g. credentials for
88
+ * an auth proxy in front of it. A function is called once per `evalkit share`
89
+ * (it may run a command to fetch a token). Values are never printed.
90
+ */
91
+ headers?: ShareHeaders | (() => ShareHeaders | Promise<ShareHeaders>);
79
92
  };
80
93
  /** Pure, typed project configuration. Loading/discovery belongs to the CLI. */
81
94
  declare function defineConfig<const T extends EvalkitConfig>(configuration: T): T;
@@ -95,8 +108,22 @@ declare const AutIdentitySchema: Schema.Struct<{
95
108
  version: Schema.optional<typeof Schema.String>;
96
109
  }>;
97
110
  declare const JsonValueSchema: Schema.Schema<JsonValue>;
111
+ declare const RunSourceSchema: Schema.Struct<{
112
+ repo: typeof Schema.String;
113
+ project: typeof Schema.String;
114
+ commit: typeof Schema.String;
115
+ ref: Schema.optional<typeof Schema.String>;
116
+ committedAt: Schema.optional<typeof Schema.String>;
117
+ dirty: typeof Schema.Boolean;
118
+ ci: Schema.optional<Schema.Struct<{
119
+ provider: typeof Schema.String;
120
+ pipeline: Schema.optional<typeof Schema.String>;
121
+ job: Schema.optional<typeof Schema.String>;
122
+ url: Schema.optional<typeof Schema.String>;
123
+ }>>;
124
+ }>;
98
125
  declare const RunMetadataSchema: Schema.Struct<{
99
- schemaVersion: Schema.Literal<[2, 3]>;
126
+ schemaVersion: Schema.Literal<[2, 3, 4]>;
100
127
  runUri: Schema.filter<typeof Schema.String>;
101
128
  evalId: typeof Schema.String;
102
129
  suiteId: Schema.optional<typeof Schema.String>;
@@ -112,9 +139,23 @@ declare const RunMetadataSchema: Schema.Struct<{
112
139
  version: Schema.optional<typeof Schema.String>;
113
140
  }>>;
114
141
  startedAt: typeof Schema.String;
142
+ source: Schema.optional<Schema.Struct<{
143
+ repo: typeof Schema.String;
144
+ project: typeof Schema.String;
145
+ commit: typeof Schema.String;
146
+ ref: Schema.optional<typeof Schema.String>;
147
+ committedAt: Schema.optional<typeof Schema.String>;
148
+ dirty: typeof Schema.Boolean;
149
+ ci: Schema.optional<Schema.Struct<{
150
+ provider: typeof Schema.String;
151
+ pipeline: Schema.optional<typeof Schema.String>;
152
+ job: Schema.optional<typeof Schema.String>;
153
+ url: Schema.optional<typeof Schema.String>;
154
+ }>>;
155
+ }>>;
115
156
  }>;
116
157
  declare const TrialMetadataSchema: Schema.Struct<{
117
- schemaVersion: Schema.Literal<[2, 3]>;
158
+ schemaVersion: Schema.Literal<[2, 3, 4]>;
118
159
  runUri: Schema.filter<typeof Schema.String>;
119
160
  trialUri: Schema.filter<typeof Schema.String>;
120
161
  trialIndex: typeof Schema.Number;
@@ -134,7 +175,7 @@ declare const TrialMetadataSchema: Schema.Struct<{
134
175
  }>;
135
176
  /** On-disk manifests include a lifecycle status; older finalized manifests may still say running. */
136
177
  declare const RunManifestSchema: Schema.Struct<{
137
- schemaVersion: Schema.Literal<[2, 3]>;
178
+ schemaVersion: Schema.Literal<[2, 3, 4]>;
138
179
  runUri: Schema.filter<typeof Schema.String>;
139
180
  evalId: typeof Schema.String;
140
181
  suiteId: Schema.optional<typeof Schema.String>;
@@ -150,10 +191,24 @@ declare const RunManifestSchema: Schema.Struct<{
150
191
  version: Schema.optional<typeof Schema.String>;
151
192
  }>>;
152
193
  startedAt: typeof Schema.String;
194
+ source: Schema.optional<Schema.Struct<{
195
+ repo: typeof Schema.String;
196
+ project: typeof Schema.String;
197
+ commit: typeof Schema.String;
198
+ ref: Schema.optional<typeof Schema.String>;
199
+ committedAt: Schema.optional<typeof Schema.String>;
200
+ dirty: typeof Schema.Boolean;
201
+ ci: Schema.optional<Schema.Struct<{
202
+ provider: typeof Schema.String;
203
+ pipeline: Schema.optional<typeof Schema.String>;
204
+ job: Schema.optional<typeof Schema.String>;
205
+ url: Schema.optional<typeof Schema.String>;
206
+ }>>;
207
+ }>>;
153
208
  status: Schema.optional<Schema.Literal<["running", "completed", "failed", "cancelled"]>>;
154
209
  }>;
155
210
  declare const TrialManifestSchema: Schema.Struct<{
156
- schemaVersion: Schema.Literal<[2, 3]>;
211
+ schemaVersion: Schema.Literal<[2, 3, 4]>;
157
212
  runUri: Schema.filter<typeof Schema.String>;
158
213
  trialUri: Schema.filter<typeof Schema.String>;
159
214
  trialIndex: typeof Schema.Number;
@@ -815,8 +870,36 @@ type EvalCatalogEntry = {
815
870
  */
816
871
  declare function registerEvals<const TRegistrations extends readonly EvalRegistration[]>(registrations: TRegistrations): EvalRegistry;
817
872
  type RunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
873
+ /**
874
+ * Where a run's eval code came from: the repository, eval project and commit.
875
+ * Results are tagged with it; they are never stored in the repository itself.
876
+ */
877
+ type RunSource = {
878
+ /** Normalized repository key, e.g. `gitlab.example.com/group/repo`. */
879
+ repo: string;
880
+ /** Eval project directory relative to the repository root; `""` at the root. */
881
+ project: string;
882
+ /** Full commit SHA. */
883
+ commit: string;
884
+ ref?: string;
885
+ committedAt?: string;
886
+ /** True when the working tree had uncommitted changes at run time. */
887
+ dirty: boolean;
888
+ ci?: {
889
+ provider: string;
890
+ pipeline?: string;
891
+ job?: string;
892
+ url?: string;
893
+ };
894
+ };
895
+ /** The project's evals and suites when a run started; written beside its manifest. */
896
+ type RunCatalog = {
897
+ catalog: EvalCatalogEntry[];
898
+ evals: EvalRegistryMetadata[];
899
+ suites: EvalSuiteMetadata[];
900
+ };
818
901
  type RunMetadata = {
819
- schemaVersion: 2 | 3;
902
+ schemaVersion: 2 | 3 | 4;
820
903
  runId: string;
821
904
  runUri: ResourceUri<'run'>;
822
905
  evalId: string;
@@ -828,9 +911,11 @@ type RunMetadata = {
828
911
  };
829
912
  aut?: AutIdentity;
830
913
  startedAt: string;
914
+ /** Present from schema version 4 when the run's commit could be determined. */
915
+ source?: RunSource;
831
916
  };
832
917
  type TrialMetadata = {
833
- schemaVersion: 2 | 3;
918
+ schemaVersion: 2 | 3 | 4;
834
919
  runId: string;
835
920
  runUri: ResourceUri<'run'>;
836
921
  trialId: string;
@@ -905,7 +990,9 @@ type RunWriter = {
905
990
  finalize(summary: RunSummary): Promise<void>;
906
991
  };
907
992
  type ReportStore = {
908
- startRun(metadata: RunMetadata): Promise<RunWriter>;
993
+ startRun(metadata: RunMetadata, context?: {
994
+ catalog?: RunCatalog;
995
+ }): Promise<RunWriter>;
909
996
  };
910
997
  type TrialResult = {
911
998
  runId: string;
@@ -937,5 +1024,5 @@ type RunResult = TrialResult & {
937
1024
  };
938
1025
  declare function recordError(error: unknown): RecordedError;
939
1026
  //#endregion
940
- export { TrialMetadata as $, Uuid as $t, FixtureContext as A, RecordedErrorSchema as At, ReportStore as B, TrialSummarySchema as Bt, EvalRegistryMetadata as C, parseTrajectoryJsonl as Ct, ExpectToolCallStep as D, CheckpointResultSchema as Dt, EvaluatorWorkspace as E, AutIdentitySchema as Et, JsonValue as F, ScoreResultSchema as Ft, RunWriter as G, EvalMatrixCell as Gt, RunResult as H, EvalkitConfig as Ht, JudgeRule as I, TrajectoryEventSchema as It, ScoreValue as J, canonicalParameters as Jt, RunnerEvent as K, MatrixSelection as Kt, JudgeRunInfo as L, TrialManifestSchema as Lt, InlineFixture as M, RunMetadataSchema as Mt, JsonObject as N, RunStatusSchema as Nt, FileFixture as O, JsonValueSchema as Ot, JsonPrimitive as P, RunSummarySchema as Pt, TranscriptStep as Q, ResourceUriSchema as Qt, PredicateScorer as R, TrialMetadataSchema as Rt, EvalRegistry as S, user as St, EvalSuiteMetadata as T, ArtifactEntrySchema as Tt, RunStatus as U, defineConfig as Ut, RunMetadata as V, UsageSchema as Vt, RunSummary as W, EvalMatrix as Wt, ScoringRule as X, ResourceKindSchema as Xt, ScoringContext as Y, ResourceKind as Yt, TrajectoryEvent as Z, ResourceUri as Zt, EvalCatalogEntry as _, inlineFile as _t, AggregateScoring as a, resourceUuid as an, Usage as at, EvalPolicy as b, recordError as bt, AutAdapter as c, agent as ct, AutIdentity as d, defineEval as dt, UuidSchema as en, TrialResult as et, AutSession as f, defineSuite as ft, DynamicFixture as g, file as gt, DirectoryFixture as h, expectToolCall as ht, AgentStep as i, resourceUriSchema as in, TurnView as it, FixtureVisibility as j, RunManifestSchema as jt, Fixture as k, JudgeRunInfoSchema as kt, AutContext as l, authoringId as lt, CheckpointResult as m, dynamic as mt, AgentRuntimeName as n, parseResourceUri as nn, TrialSummary as nt, ArtifactEntry as o, UserStep as ot, CandidateWorkspace as p, directory as pt, ScoreResult as q, defineEvalMatrix as qt, AgentRuntimes as r, resourceUri as rn, TrialWriter as rt, ArtifactView as s, WorkspaceView as st, AgentRuntime as t, authorId as tn, TrialScoring as tt, AutEvent as u, defineAgent as ut, EvalCatalogFixture as v, judge as vt, EvalSuite as w, ApiErrorSchema as wt, EvalRegistration as x, registerEvals as xt, EvalDefinition as y, predicate as yt, RecordedError as z, TrialScoringSchema as zt };
941
- //# sourceMappingURL=index-M5eRlMfd.d.mts.map
1027
+ export { TrajectoryEvent as $, canonicalParameters as $t, FixtureContext as A, JsonValueSchema as At, ReportStore as B, TrialManifestSchema as Bt, EvalRegistryMetadata as C, registerEvals as Ct, ExpectToolCallStep as D, ArtifactEntrySchema as Dt, EvaluatorWorkspace as E, ApiErrorSchema as Et, JsonValue as F, RunSourceSchema as Ft, RunStatus as G, EvalkitConfig as Gt, RunMetadata as H, TrialScoringSchema as Ht, JudgeRule as I, RunStatusSchema as It, RunnerEvent as J, defineConfig as Jt, RunSummary as K, ShareConfig as Kt, JudgeRunInfo as L, RunSummarySchema as Lt, InlineFixture as M, RecordedErrorSchema as Mt, JsonObject as N, RunManifestSchema as Nt, FileFixture as O, AutIdentitySchema as Ot, JsonPrimitive as P, RunMetadataSchema as Pt, ScoringRule as Q, defineEvalMatrix as Qt, PredicateScorer as R, ScoreResultSchema as Rt, EvalRegistry as S, recordError as St, EvalSuiteMetadata as T, parseTrajectoryJsonl as Tt, RunResult as U, TrialSummarySchema as Ut, RunCatalog as V, TrialMetadataSchema as Vt, RunSource as W, UsageSchema as Wt, ScoreValue as X, EvalMatrixCell as Xt, ScoreResult as Y, EvalMatrix as Yt, ScoringContext as Z, MatrixSelection as Zt, EvalCatalogEntry as _, expectToolCall as _t, AggregateScoring as a, UuidSchema as an, TrialWriter as at, EvalPolicy as b, judge as bt, AutAdapter as c, resourceUri as cn, UserStep as ct, AutIdentity as d, authoringId as dt, ResourceKind as en, TranscriptStep as et, AutSession as f, defineAgent as ft, DynamicFixture as g, dynamic as gt, DirectoryFixture as h, directory as ht, AgentStep as i, Uuid as in, TrialSummary as it, FixtureVisibility as j, JudgeRunInfoSchema as jt, Fixture as k, CheckpointResultSchema as kt, AutContext as l, resourceUriSchema as ln, WorkspaceView as lt, CheckpointResult as m, defineSuite as mt, AgentRuntimeName as n, ResourceUri as nn, TrialResult as nt, ArtifactEntry as o, authorId as on, TurnView as ot, CandidateWorkspace as p, defineEval as pt, RunWriter as q, ShareHeaders as qt, AgentRuntimes as r, ResourceUriSchema as rn, TrialScoring as rt, ArtifactView as s, parseResourceUri as sn, Usage as st, AgentRuntime as t, ResourceKindSchema as tn, TrialMetadata as tt, AutEvent as u, resourceUuid as un, agent as ut, EvalCatalogFixture as v, file as vt, EvalSuite as w, user as wt, EvalRegistration as x, predicate as xt, EvalDefinition as y, inlineFile as yt, RecordedError as z, TrajectoryEventSchema as zt };
1028
+ //# sourceMappingURL=index-lOw0fmak.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-lOw0fmak.d.mts","names":[],"sources":["../../core/src/identity.ts","../../core/src/canonical-json.ts","../../core/src/matrix.ts","../../core/src/config.ts","../../core/src/schema.ts","../../core/src/trajectory.ts","../../core/src/index.ts"],"mappings":";;cAEa,oBAAkB,OAAA;KACnB,sBAAsB,mBAAmB;;iBAGrC,SAAS;;cAOZ,YAAU,OAAA,cAAA,OAAA;KAKX,cAAc,WAAW;KAEzB,YAAY,cAAc,eAAe,2BACxC;cAEA,mBAAiB,OAAA,cAAA,OAAA;iBAMd,kBAAkB,cAAc,cAAc,MAAM,QAAK,OAAA,cAAA,OAAA;iBAWzD,YAAY,cAAc,cACxC,MAAM,OACN,MAAM,OACL,YAAY;iBAIC,iBAAiB,cAAc,cAC7C,eACA,eAAe;EACZ,MAAM;EAAO,MAAM;EAAM,KAAK,YAAY;;iBAY/B,aAAa,eAAe,eAAe,eAAe;;;;iBCzD1D,oBAAoB,OAAO;;;KCK/B;;EAEV;;EAEA,aAAa,SAAS,wBAAwB;;EAE9C,YAAY;;KAEF;EACV;;EAEA;EACA,MAAM;EACN,YAAY;;KAEF;EACV;EACA;EACA,gBAAgB;EAChB,YAAY,SAAS,wBAAwB;EAC7C,WAAW;;EAEX,iBAAiB;;EAEjB,mBAAmB;;KAET,aAAa;EACvB;EACA,MAAM,YAAY;EAClB,MAAM,YAAY,kBAAkB,iBAAiB;;iBAWvC,uBAAuB,UAAU,sBAC/C,YAAY,IACX,aAAa;;;KCjDJ;;EAEV;EACA;EACA;;EAEA,iBAAiB;EACjB,WAAW;;EAEX,SAAS,KAAK;IAA0C;;EACxD;IAAc;IAAsB;IAAiB;;EACrD;EACA;EACA,QAAQ;;;KAIE,eAAe;KAEf;;EAEV;;;;;;EAMA,UAAU,sBAAsB,eAAe,QAAQ;;;iBAIzC,mBAAmB,UAAU,eAC3C,eAAe,IACd;;;;cC/BU,iBAAe,OAAA;cAOf,qBAAmB,OAAA;;;;;cAMnB,mBAAiB,OAAA;;;;;;cAQjB,iBAAiB,OAAO,OAAO;cAoB/B,iBAAe,OAAA;;;;;;;;;;;;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A;;EAEV;;EAEA;;EAEA;EACA;EACA;;EAEA;EACA;IAAO;IAAkB;IAAmB;IAAc;;;;KAIhD;EACV,SAAS;EACT,OAAO;EACP,QAAQ;;KAGE;EACV;EACA;EACA,QAAQ;EACR;EACA;EACA,aAAa;EACb;IAAW;IAAY;;EACvB,MAAM;EACN;;EAEA,SAAS;;KAGC;EACV;EACA;EACA,QAAQ;EACR;EACA,UAAU;EACV;EACA;EACA,aAAa;EACb;IAAW;IAAY;;EACvB,MAAM;EACN;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX,QAAQ;EACR;EACA,QAAQ;EACR;IAAoB;IAAoB;;;KAG9B;EACV,SAAS;EACT,cAAc;EACd;EACA;EACA;;KAGU;;EAEV;EACA;EACA;;KAGU;EACV,QAAQ;EACR;EACA;EACA,UAAU;EACV,YAAY;EACZ,QAAQ;;KAGE;EACV,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA,QAAQ;;KAGE;EACV,YAAY,OAAO,kBAAkB;EACrC,YAAY,SAAS,eAAe;;EAEpC,cAAc,cAAc,MAAM,aAAa;EAC/C,SAAS,SAAS,eAAe;;KAGvB;WACD;EACT,WAAW,UAAU,gBAAgB,QAAQ;EAC7C,SAAS,SAAS,aAAa;;KAGrB;EACV,SACE,UAAU,aACV;IAAY,UAAU;MACrB,QAAQ;;KAGD;EACV;EACA,QAAQ;EACR;EACA,UAAU;EACV;EACA;EACA,QAAQ;EACR;EACA;EACA,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;EACA;;KAGU,YAAY;EACtB;EACA;EACA;EACA;EACA,mBAAmB;;EAEnB,SAAS;;iBAOK,YAAY,iBAAiB"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as TrialMetadata, $t as Uuid, A as FixtureContext, At as RecordedErrorSchema, B as ReportStore, Bt as TrialSummarySchema, C as EvalRegistryMetadata, Ct as parseTrajectoryJsonl, D as ExpectToolCallStep, Dt as CheckpointResultSchema, E as EvaluatorWorkspace, Et as AutIdentitySchema, F as JsonValue, Ft as ScoreResultSchema, G as RunWriter, Gt as EvalMatrixCell, H as RunResult, Ht as EvalkitConfig, I as JudgeRule, It as TrajectoryEventSchema, J as ScoreValue, Jt as canonicalParameters, K as RunnerEvent, Kt as MatrixSelection, L as JudgeRunInfo, Lt as TrialManifestSchema, M as InlineFixture, Mt as RunMetadataSchema, N as JsonObject, Nt as RunStatusSchema, O as FileFixture, Ot as JsonValueSchema, P as JsonPrimitive, Pt as RunSummarySchema, Q as TranscriptStep, Qt as ResourceUriSchema, R as PredicateScorer, Rt as TrialMetadataSchema, S as EvalRegistry, St as user, T as EvalSuiteMetadata, Tt as ArtifactEntrySchema, U as RunStatus, Ut as defineConfig, V as RunMetadata, Vt as UsageSchema, W as RunSummary, Wt as EvalMatrix, X as ScoringRule, Xt as ResourceKindSchema, Y as ScoringContext, Yt as ResourceKind, Z as TrajectoryEvent, Zt as ResourceUri, _ as EvalCatalogEntry, _t as inlineFile, a as AggregateScoring, an as resourceUuid, at as Usage, b as EvalPolicy, bt as recordError, c as AutAdapter, ct as agent, d as AutIdentity, dt as defineEval, en as UuidSchema, et as TrialResult, f as AutSession, ft as defineSuite, g as DynamicFixture, gt as file, h as DirectoryFixture, ht as expectToolCall, i as AgentStep, in as resourceUriSchema, it as TurnView, j as FixtureVisibility, jt as RunManifestSchema, k as Fixture, kt as JudgeRunInfoSchema, l as AutContext, lt as authoringId, m as CheckpointResult, mt as dynamic, n as AgentRuntimeName, nn as parseResourceUri, nt as TrialSummary, o as ArtifactEntry, ot as UserStep, p as CandidateWorkspace, pt as directory, q as ScoreResult, qt as defineEvalMatrix, r as AgentRuntimes, rn as resourceUri, rt as TrialWriter, s as ArtifactView, st as WorkspaceView, t as AgentRuntime, tn as authorId, tt as TrialScoring, u as AutEvent, ut as defineAgent, v as EvalCatalogFixture, vt as judge, w as EvalSuite, wt as ApiErrorSchema, x as EvalRegistration, xt as registerEvals, y as EvalDefinition, yt as predicate, z as RecordedError, zt as TrialScoringSchema } from "./index-M5eRlMfd.mjs";
1
+ import { $ as TrajectoryEvent, $t as canonicalParameters, A as FixtureContext, At as JsonValueSchema, B as ReportStore, Bt as TrialManifestSchema, C as EvalRegistryMetadata, Ct as registerEvals, D as ExpectToolCallStep, Dt as ArtifactEntrySchema, E as EvaluatorWorkspace, Et as ApiErrorSchema, F as JsonValue, Ft as RunSourceSchema, G as RunStatus, Gt as EvalkitConfig, H as RunMetadata, Ht as TrialScoringSchema, I as JudgeRule, It as RunStatusSchema, J as RunnerEvent, Jt as defineConfig, K as RunSummary, Kt as ShareConfig, L as JudgeRunInfo, Lt as RunSummarySchema, M as InlineFixture, Mt as RecordedErrorSchema, N as JsonObject, Nt as RunManifestSchema, O as FileFixture, Ot as AutIdentitySchema, P as JsonPrimitive, Pt as RunMetadataSchema, Q as ScoringRule, Qt as defineEvalMatrix, R as PredicateScorer, Rt as ScoreResultSchema, S as EvalRegistry, St as recordError, T as EvalSuiteMetadata, Tt as parseTrajectoryJsonl, U as RunResult, Ut as TrialSummarySchema, V as RunCatalog, Vt as TrialMetadataSchema, W as RunSource, Wt as UsageSchema, X as ScoreValue, Xt as EvalMatrixCell, Y as ScoreResult, Yt as EvalMatrix, Z as ScoringContext, Zt as MatrixSelection, _ as EvalCatalogEntry, _t as expectToolCall, a as AggregateScoring, an as UuidSchema, at as TrialWriter, b as EvalPolicy, bt as judge, c as AutAdapter, cn as resourceUri, ct as UserStep, d as AutIdentity, dt as authoringId, en as ResourceKind, et as TranscriptStep, f as AutSession, ft as defineAgent, g as DynamicFixture, gt as dynamic, h as DirectoryFixture, ht as directory, i as AgentStep, in as Uuid, it as TrialSummary, j as FixtureVisibility, jt as JudgeRunInfoSchema, k as Fixture, kt as CheckpointResultSchema, l as AutContext, ln as resourceUriSchema, lt as WorkspaceView, m as CheckpointResult, mt as defineSuite, n as AgentRuntimeName, nn as ResourceUri, nt as TrialResult, o as ArtifactEntry, on as authorId, ot as TurnView, p as CandidateWorkspace, pt as defineEval, q as RunWriter, qt as ShareHeaders, r as AgentRuntimes, rn as ResourceUriSchema, rt as TrialScoring, s as ArtifactView, sn as parseResourceUri, st as Usage, t as AgentRuntime, tn as ResourceKindSchema, tt as TrialMetadata, u as AutEvent, un as resourceUuid, ut as agent, v as EvalCatalogFixture, vt as file, w as EvalSuite, wt as user, x as EvalRegistration, xt as predicate, y as EvalDefinition, yt as inlineFile, z as RecordedError, zt as TrajectoryEventSchema } from "./index-lOw0fmak.mjs";
2
2
  //#region ../agents/src/index.d.ts
3
3
  type PiAutOptions = {
4
4
  command?: string;
@@ -8,5 +8,5 @@ type PiAutOptions = {
8
8
  /** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */
9
9
  export declare function piAgent(options?: PiAutOptions): AutAdapter;
10
10
  //#endregion
11
- export { AgentRuntime, AgentRuntimeName, AgentRuntimes, AgentStep, AggregateScoring, ApiErrorSchema, ArtifactEntry, ArtifactEntrySchema, ArtifactView, AutAdapter, AutContext, AutEvent, AutIdentity, AutIdentitySchema, AutSession, CandidateWorkspace, CheckpointResult, CheckpointResultSchema, DirectoryFixture, DynamicFixture, EvalCatalogEntry, EvalCatalogFixture, EvalDefinition, type EvalMatrix, type EvalMatrixCell, EvalPolicy, EvalRegistration, EvalRegistry, EvalRegistryMetadata, EvalSuite, EvalSuiteMetadata, type EvalkitConfig, EvaluatorWorkspace, ExpectToolCallStep, FileFixture, Fixture, FixtureContext, FixtureVisibility, InlineFixture, JsonObject, JsonPrimitive, JsonValue, JsonValueSchema, JudgeRule, JudgeRunInfo, JudgeRunInfoSchema, type MatrixSelection, PredicateScorer, RecordedError, RecordedErrorSchema, ReportStore, ResourceKind, ResourceKindSchema, ResourceUri, ResourceUriSchema, RunManifestSchema, RunMetadata, RunMetadataSchema, RunResult, RunStatus, RunStatusSchema, RunSummary, RunSummarySchema, RunWriter, RunnerEvent, ScoreResult, ScoreResultSchema, ScoreValue, ScoringContext, ScoringRule, TrajectoryEvent, TrajectoryEventSchema, TranscriptStep, TrialManifestSchema, TrialMetadata, TrialMetadataSchema, TrialResult, TrialScoring, TrialScoringSchema, TrialSummary, TrialSummarySchema, TrialWriter, TurnView, Usage, UsageSchema, UserStep, Uuid, UuidSchema, WorkspaceView, agent, authorId, authoringId, canonicalParameters, defineAgent, defineConfig, defineEval, defineEvalMatrix, defineSuite, directory, dynamic, expectToolCall, file, inlineFile, judge, parseResourceUri, parseTrajectoryJsonl, predicate, recordError, registerEvals, resourceUri, resourceUriSchema, resourceUuid, user };
11
+ export { AgentRuntime, AgentRuntimeName, AgentRuntimes, AgentStep, AggregateScoring, ApiErrorSchema, ArtifactEntry, ArtifactEntrySchema, ArtifactView, AutAdapter, AutContext, AutEvent, AutIdentity, AutIdentitySchema, AutSession, CandidateWorkspace, CheckpointResult, CheckpointResultSchema, DirectoryFixture, DynamicFixture, EvalCatalogEntry, EvalCatalogFixture, EvalDefinition, type EvalMatrix, type EvalMatrixCell, EvalPolicy, EvalRegistration, EvalRegistry, EvalRegistryMetadata, EvalSuite, EvalSuiteMetadata, type EvalkitConfig, EvaluatorWorkspace, ExpectToolCallStep, FileFixture, Fixture, FixtureContext, FixtureVisibility, InlineFixture, JsonObject, JsonPrimitive, JsonValue, JsonValueSchema, JudgeRule, JudgeRunInfo, JudgeRunInfoSchema, type MatrixSelection, PredicateScorer, RecordedError, RecordedErrorSchema, ReportStore, ResourceKind, ResourceKindSchema, ResourceUri, ResourceUriSchema, RunCatalog, RunManifestSchema, RunMetadata, RunMetadataSchema, RunResult, RunSource, RunSourceSchema, RunStatus, RunStatusSchema, RunSummary, RunSummarySchema, RunWriter, RunnerEvent, ScoreResult, ScoreResultSchema, ScoreValue, ScoringContext, ScoringRule, type ShareConfig, type ShareHeaders, TrajectoryEvent, TrajectoryEventSchema, TranscriptStep, TrialManifestSchema, TrialMetadata, TrialMetadataSchema, TrialResult, TrialScoring, TrialScoringSchema, TrialSummary, TrialSummarySchema, TrialWriter, TurnView, Usage, UsageSchema, UserStep, Uuid, UuidSchema, WorkspaceView, agent, authorId, authoringId, canonicalParameters, defineAgent, defineConfig, defineEval, defineEvalMatrix, defineSuite, directory, dynamic, expectToolCall, file, inlineFile, judge, parseResourceUri, parseTrajectoryJsonl, predicate, recordError, registerEvals, resourceUri, resourceUriSchema, resourceUuid, user };
12
12
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as TrialManifestSchema, B as authorId, C as RecordedErrorSchema, D as RunSummarySchema, E as RunStatusSchema, F as defineEvalMatrix, H as resourceUri, I as canonicalParameters, L as ResourceKindSchema, M as TrialScoringSchema, N as TrialSummarySchema, O as ScoreResultSchema, P as UsageSchema, R as ResourceUriSchema, S as JudgeRunInfoSchema, T as RunMetadataSchema, U as resourceUriSchema, V as parseResourceUri, W as resourceUuid, _ as ApiErrorSchema, a as defineSuite, b as CheckpointResultSchema, c as expectToolCall, d as judge, f as predicate, g as parseTrajectoryJsonl, h as user, i as defineEval, j as TrialMetadataSchema, k as TrajectoryEventSchema, l as file, m as registerEvals, n as authoringId, o as directory, p as recordError, r as defineAgent, s as dynamic, t as agent, u as inlineFile, v as ArtifactEntrySchema, w as RunManifestSchema, x as JsonValueSchema, y as AutIdentitySchema, z as UuidSchema } from "./src-DrwwgaPn.mjs";
1
+ import { A as TrajectoryEventSchema, B as UuidSchema, C as RecordedErrorSchema, D as RunStatusSchema, E as RunSourceSchema, F as UsageSchema, G as resourceUuid, H as parseResourceUri, I as defineEvalMatrix, L as canonicalParameters, M as TrialMetadataSchema, N as TrialScoringSchema, O as RunSummarySchema, P as TrialSummarySchema, R as ResourceKindSchema, S as JudgeRunInfoSchema, T as RunMetadataSchema, U as resourceUri, V as authorId, W as resourceUriSchema, _ as ApiErrorSchema, a as defineSuite, b as CheckpointResultSchema, c as expectToolCall, d as judge, f as predicate, g as parseTrajectoryJsonl, h as user, i as defineEval, j as TrialManifestSchema, k as ScoreResultSchema, l as file, m as registerEvals, n as authoringId, o as directory, p as recordError, r as defineAgent, s as dynamic, t as agent, u as inlineFile, v as ArtifactEntrySchema, w as RunManifestSchema, x as JsonValueSchema, y as AutIdentitySchema, z as ResourceUriSchema } from "./src-ButXPY8P.mjs";
2
2
  //#region ../core/src/config.ts
3
3
  /** Pure, typed project configuration. Loading/discovery belongs to the CLI. */
4
4
  function defineConfig(configuration) {
@@ -74,6 +74,6 @@ function piAgent(options = {}) {
74
74
  });
75
75
  }
76
76
  //#endregion
77
- export { ApiErrorSchema, ArtifactEntrySchema, AutIdentitySchema, CheckpointResultSchema, JsonValueSchema, JudgeRunInfoSchema, RecordedErrorSchema, ResourceKindSchema, ResourceUriSchema, RunManifestSchema, RunMetadataSchema, RunStatusSchema, RunSummarySchema, ScoreResultSchema, TrajectoryEventSchema, TrialManifestSchema, TrialMetadataSchema, TrialScoringSchema, TrialSummarySchema, UsageSchema, UuidSchema, agent, authorId, authoringId, canonicalParameters, defineAgent, defineConfig, defineEval, defineEvalMatrix, defineSuite, directory, dynamic, expectToolCall, file, inlineFile, judge, parseResourceUri, parseTrajectoryJsonl, piAgent, predicate, recordError, registerEvals, resourceUri, resourceUriSchema, resourceUuid, user };
77
+ export { ApiErrorSchema, ArtifactEntrySchema, AutIdentitySchema, CheckpointResultSchema, JsonValueSchema, JudgeRunInfoSchema, RecordedErrorSchema, ResourceKindSchema, ResourceUriSchema, RunManifestSchema, RunMetadataSchema, RunSourceSchema, RunStatusSchema, RunSummarySchema, ScoreResultSchema, TrajectoryEventSchema, TrialManifestSchema, TrialMetadataSchema, TrialScoringSchema, TrialSummarySchema, UsageSchema, UuidSchema, agent, authorId, authoringId, canonicalParameters, defineAgent, defineConfig, defineEval, defineEvalMatrix, defineSuite, directory, dynamic, expectToolCall, file, inlineFile, judge, parseResourceUri, parseTrajectoryJsonl, piAgent, predicate, recordError, registerEvals, resourceUri, resourceUriSchema, resourceUuid, user };
78
78
 
79
79
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/config.ts","../../agents/src/index.ts"],"sourcesContent":["import type { EvalDefinition, EvalRegistry } from './index.js';\nimport type { EvalMatrixDefinition } from './matrix.js';\n\nexport type EvalkitConfig = {\n /** Paths are relative to evalkit.config.js/ts, not the invoking shell directory. */\n testDir?: string;\n include?: readonly string[];\n exclude?: readonly string[];\n /** Explicit definitions are an alternative to discovery (e.g. hosted registries). */\n evals?: readonly EvalDefinition[];\n registry?: EvalRegistry;\n /** Applied to every discovered eval. Values are forwarded, never provider-interpreted. */\n matrix?: Omit<EvalMatrixDefinition, 'evals' | 'id'> & { id?: string };\n execution?: { concurrency?: number; trials?: number; maxCells?: number };\n reportDir?: string;\n sandboxDir?: string;\n};\n\n/** Pure, typed project configuration. Loading/discovery belongs to the CLI. */\nexport function defineConfig<const T extends EvalkitConfig>(\n configuration: T,\n): T {\n return configuration;\n}\n","import { defineAgent, type AutAdapter } from '@evalkit/core';\n\nexport type AgentsSdkAutOptions = {\n endpoint: string;\n agent: string;\n getToken?: () => Promise<string | undefined> | string | undefined;\n instanceName?: (context: { runId: string; trialId: string }) => string;\n};\n\n/** Deferred remote Agents SDK transport. */\nexport function agentsSdk(_options: AgentsSdkAutOptions): AutAdapter {\n throw new Error('Agents SDK transport is not implemented yet');\n}\n\nexport type PiAutOptions = {\n command?: string;\n /** Additional non-secret Pi arguments, such as an explicit model selection. */\n args?: string[];\n};\n\n/** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */\nexport function piAgent(options: PiAutOptions = {}): AutAdapter {\n const command = options.command ?? 'pi';\n return defineAgent({\n identity: {\n name: 'Pi Agent',\n kind: 'process',\n id: 'pi-agent',\n },\n runtimes: { local: { kind: 'process', configuration: { command } } },\n async start({ context, onEvent }) {\n await onEvent({ kind: 'started', timestamp: new Date().toISOString() });\n let turn = 0;\n return {\n async send(message: string) {\n turn += 1;\n await onEvent({\n kind: 'turn-started',\n turn,\n timestamp: new Date().toISOString(),\n });\n const process = Bun.spawn(\n [\n command,\n '--print',\n '--no-session',\n '--no-tools',\n ...(options.args ?? []),\n message,\n ],\n { cwd: context.workspace.root, stdout: 'pipe', stderr: 'pipe' },\n );\n const [stdout, stderr, exitCode] = await Promise.all([\n new Response(process.stdout).text(),\n new Response(process.stderr).text(),\n process.exited,\n ]);\n if (exitCode !== 0)\n throw new Error(`Pi exited with ${exitCode}: ${stderr.trim()}`);\n await onEvent({\n kind: 'message',\n role: 'assistant',\n content: stdout.trim(),\n timestamp: new Date().toISOString(),\n });\n await onEvent({\n kind: 'turn-completed',\n turn,\n timestamp: new Date().toISOString(),\n });\n },\n async close() {\n await onEvent({\n kind: 'completed',\n timestamp: new Date().toISOString(),\n });\n },\n };\n },\n });\n}\n"],"mappings":";;;AAmBA,SAAgB,aACd,eACG;CACH,OAAO;AACT;;;;ACFA,SAAgB,QAAQ,UAAwB,CAAC,GAAe;CAC9D,MAAM,UAAU,QAAQ,WAAW;CACnC,OAAO,YAAY;EACjB,UAAU;GACR,MAAM;GACN,MAAM;GACN,IAAI;EACN;EACA,UAAU,EAAE,OAAO;GAAE,MAAM;GAAW,eAAe,EAAE,QAAQ;EAAE,EAAE;EACnE,MAAM,MAAM,EAAE,SAAS,WAAW;GAChC,MAAM,QAAQ;IAAE,MAAM;IAAW,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAAE,CAAC;GACtE,IAAI,OAAO;GACX,OAAO;IACL,MAAM,KAAK,SAAiB;KAC1B,QAAQ;KACR,MAAM,QAAQ;MACZ,MAAM;MACN;MACA,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;KACpC,CAAC;KACD,MAAM,UAAU,IAAI,MAClB;MACE;MACA;MACA;MACA;MACA,GAAI,QAAQ,QAAQ,CAAC;MACrB;KACF,GACA;MAAE,KAAK,QAAQ,UAAU;MAAM,QAAQ;MAAQ,QAAQ;KAAO,CAChE;KACA,MAAM,CAAC,QAAQ,QAAQ,YAAY,MAAM,QAAQ,IAAI;MACnD,IAAI,SAAS,QAAQ,MAAM,CAAC,CAAC,KAAK;MAClC,IAAI,SAAS,QAAQ,MAAM,CAAC,CAAC,KAAK;MAClC,QAAQ;KACV,CAAC;KACD,IAAI,aAAa,GACf,MAAM,IAAI,MAAM,kBAAkB,SAAS,IAAI,OAAO,KAAK,GAAG;KAChE,MAAM,QAAQ;MACZ,MAAM;MACN,MAAM;MACN,SAAS,OAAO,KAAK;MACrB,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;KACpC,CAAC;KACD,MAAM,QAAQ;MACZ,MAAM;MACN;MACA,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;KACpC,CAAC;IACH;IACA,MAAM,QAAQ;KACZ,MAAM,QAAQ;MACZ,MAAM;MACN,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;KACpC,CAAC;IACH;GACF;EACF;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/config.ts","../../agents/src/index.ts"],"sourcesContent":["import type { EvalDefinition, EvalRegistry } from './index.js';\nimport type { EvalMatrixDefinition } from './matrix.js';\n\nexport type EvalkitConfig = {\n /** Paths are relative to evalkit.config.js/ts, not the invoking shell directory. */\n testDir?: string;\n include?: readonly string[];\n exclude?: readonly string[];\n /** Explicit definitions are an alternative to discovery (e.g. hosted registries). */\n evals?: readonly EvalDefinition[];\n registry?: EvalRegistry;\n /** Applied to every discovered eval. Values are forwarded, never provider-interpreted. */\n matrix?: Omit<EvalMatrixDefinition, 'evals' | 'id'> & { id?: string };\n execution?: { concurrency?: number; trials?: number; maxCells?: number };\n reportDir?: string;\n sandboxDir?: string;\n share?: ShareConfig;\n};\n\n/** HTTP header names and values. */\nexport type ShareHeaders = Record<string, string>;\n\nexport type ShareConfig = {\n /** Where `evalkit share` uploads results. `EVALKIT_SHARE_URL` overrides it. */\n url: string;\n /**\n * Extra headers for every request to the share server, e.g. credentials for\n * an auth proxy in front of it. A function is called once per `evalkit share`\n * (it may run a command to fetch a token). Values are never printed.\n */\n headers?: ShareHeaders | (() => ShareHeaders | Promise<ShareHeaders>);\n};\n\n/** Pure, typed project configuration. Loading/discovery belongs to the CLI. */\nexport function defineConfig<const T extends EvalkitConfig>(\n configuration: T,\n): T {\n return configuration;\n}\n","import { defineAgent, type AutAdapter } from '@evalkit/core';\n\nexport type AgentsSdkAutOptions = {\n endpoint: string;\n agent: string;\n getToken?: () => Promise<string | undefined> | string | undefined;\n instanceName?: (context: { runId: string; trialId: string }) => string;\n};\n\n/** Deferred remote Agents SDK transport. */\nexport function agentsSdk(_options: AgentsSdkAutOptions): AutAdapter {\n throw new Error('Agents SDK transport is not implemented yet');\n}\n\nexport type PiAutOptions = {\n command?: string;\n /** Additional non-secret Pi arguments, such as an explicit model selection. */\n args?: string[];\n};\n\n/** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */\nexport function piAgent(options: PiAutOptions = {}): AutAdapter {\n const command = options.command ?? 'pi';\n return defineAgent({\n identity: {\n name: 'Pi Agent',\n kind: 'process',\n id: 'pi-agent',\n },\n runtimes: { local: { kind: 'process', configuration: { command } } },\n async start({ context, onEvent }) {\n await onEvent({ kind: 'started', timestamp: new Date().toISOString() });\n let turn = 0;\n return {\n async send(message: string) {\n turn += 1;\n await onEvent({\n kind: 'turn-started',\n turn,\n timestamp: new Date().toISOString(),\n });\n const process = Bun.spawn(\n [\n command,\n '--print',\n '--no-session',\n '--no-tools',\n ...(options.args ?? []),\n message,\n ],\n { cwd: context.workspace.root, stdout: 'pipe', stderr: 'pipe' },\n );\n const [stdout, stderr, exitCode] = await Promise.all([\n new Response(process.stdout).text(),\n new Response(process.stderr).text(),\n process.exited,\n ]);\n if (exitCode !== 0)\n throw new Error(`Pi exited with ${exitCode}: ${stderr.trim()}`);\n await onEvent({\n kind: 'message',\n role: 'assistant',\n content: stdout.trim(),\n timestamp: new Date().toISOString(),\n });\n await onEvent({\n kind: 'turn-completed',\n turn,\n timestamp: new Date().toISOString(),\n });\n },\n async close() {\n await onEvent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IACH;IACA,MAAM,QAAQ;KACZ,MAAM,QAAQ;MACZ,MAAM;MACN,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;KACpC,CAAC;IACH;GACF;EACF;CACF,CAAC;AACH"}
package/dist/runner.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { B as ReportStore, F as JsonValue, Gt as EvalMatrixCell, H as RunResult, Kt as MatrixSelection, N as JsonObject, V as RunMetadata, Wt as EvalMatrix, Z as TrajectoryEvent, n as AgentRuntimeName, y as EvalDefinition } from "./index-M5eRlMfd.mjs";
1
+ import { $ as TrajectoryEvent, B as ReportStore, F as JsonValue, H as RunMetadata, N as JsonObject, U as RunResult, V as RunCatalog, W as RunSource, Xt as EvalMatrixCell, Yt as EvalMatrix, Zt as MatrixSelection, n as AgentRuntimeName, y as EvalDefinition } from "./index-lOw0fmak.mjs";
2
2
  import { Effect } from "effect";
3
3
  //#region ../runner/src/errors.d.ts
4
4
  declare const AutExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
@@ -45,7 +45,7 @@ export declare function localReportStore(rootDirectory: string): ReportStore;
45
45
  //#endregion
46
46
  //#region ../runner/src/local-report-reader.d.ts
47
47
  export declare const readRunManifest: (root: string, runId: string) => Promise<{
48
- readonly schemaVersion: 2 | 3;
48
+ readonly schemaVersion: 2 | 3 | 4;
49
49
  readonly runUri: string;
50
50
  readonly evalId: string;
51
51
  readonly suiteId?: string | undefined;
@@ -63,6 +63,20 @@ export declare const readRunManifest: (root: string, runId: string) => Promise<{
63
63
  readonly version?: string | undefined;
64
64
  } | undefined;
65
65
  readonly startedAt: string;
66
+ readonly source?: {
67
+ readonly repo: string;
68
+ readonly project: string;
69
+ readonly commit: string;
70
+ readonly ref?: string | undefined;
71
+ readonly committedAt?: string | undefined;
72
+ readonly dirty: boolean;
73
+ readonly ci?: {
74
+ readonly provider: string;
75
+ readonly pipeline?: string | undefined;
76
+ readonly job?: string | undefined;
77
+ readonly url?: string | undefined;
78
+ } | undefined;
79
+ } | undefined;
66
80
  readonly status?: "cancelled" | "completed" | "failed" | "running" | undefined;
67
81
  }>;
68
82
  export declare const readRunSummary: (root: string, runId: string) => Promise<{
@@ -79,7 +93,7 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
79
93
  } | undefined;
80
94
  }>;
81
95
  export declare const readTrialManifest: (root: string, runId: string, trialId: string) => Promise<{
82
- readonly schemaVersion: 2 | 3;
96
+ readonly schemaVersion: 2 | 3 | 4;
83
97
  readonly runUri: string;
84
98
  readonly trialUri: string;
85
99
  readonly trialIndex: number;
@@ -282,6 +296,10 @@ export type RunEvalOptions = {
282
296
  semaphore?: Effect.Semaphore;
283
297
  /** Base directory for persistent local trial workspaces. Omit for an ephemeral OS temp workspace. */
284
298
  workspaceRoot?: string;
299
+ /** Repository and commit the eval code came from, recorded in the manifest. */
300
+ source?: RunSource;
301
+ /** The project's evals and suites at run time, saved beside the manifest. */
302
+ catalog?: RunCatalog;
285
303
  now?: () => Date;
286
304
  };
287
305
  /** Effect-native aggregate eval execution entry point. */
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.mts","names":["_$_evalkit_core0.JsonValue","_$_evalkit_core0.TrajectoryEvent"],"sources":["../../runner/src/errors.ts","../../runner/src/local-report-store.ts","../../runner/src/local-report-reader.ts","../../runner/src/matrix.ts","../../runner/src/index.ts"],"mappings":";;;;;;qBAEa,0BAA0B;EACrC;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBAGW,oBAAoB;EAC/B;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBASW,iCAAiC;EAG5C;EACA;EACA;EACA;;;;;wBCmGc,iBAAiB,wBAAwB;;;qBC/G5C,kBAAe,cAAgB,kBAAe;;;;;;0BAA9CA;;;;;;;;;;;;;;;qBAEA,iBAAc,cAAgB,kBAAe;;;;;;;;;;;;;qBAE7C,oBAAiB,cAChB,eACC,oBACE;;;;;;;0BAHJA;;;;;;;;;;;;;;;qBASA,mBAAgB,cACf,eACC,oBACE;;;;;;;;;;;0BAHJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBASA,mBAAgB,cACf,eACC,oBACE;;;;;;;wBAHJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBASS,gBACpB,cACA,eACA,kBAAe,QAHKC;;;;wBC3CN,UACd,QAAQ,YACR,SAAS,KACP;EAGA,YAAY;EACZ,YACE,MAAM,gBACN,QAAQ,qBACE;IAEb,OAAO;EAAS;EAAe;EAAgB;;;;YCoBtC;EACV,QAAQ;EACR;EACA;EACA;;EAEA;;EAEA,aAAa;;EAEb,SAAS;;EAET,UAAU;;EAEV;;EAEA,YAAY,OAAO;;EAEnB;EACA,YAAY;;;wBASE,QACd,YAAY,gBACZ,SAAS,iBACR,OAAO,OAAO"}
1
+ {"version":3,"file":"runner.d.mts","names":["_$_evalkit_core0.JsonValue","_$_evalkit_core0.TrajectoryEvent"],"sources":["../../runner/src/errors.ts","../../runner/src/local-report-store.ts","../../runner/src/local-report-reader.ts","../../runner/src/matrix.ts","../../runner/src/index.ts"],"mappings":";;;;;;qBAEa,0BAA0B;EACrC;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBAGW,oBAAoB;EAC/B;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBASW,iCAAiC;EAG5C;EACA;EACA;EACA;;;;;wBCqGc,iBAAiB,wBAAwB;;;qBCjH5C,kBAAe,cAAgB,kBAAe;;;;;;0BAA9CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAEA,iBAAc,cAAgB,kBAAe;;;;;;;;;;;;;qBAE7C,oBAAiB,cAChB,eACC,oBACE;;;;;;;0BAHJA;;;;;;;;;;;;;;;qBASA,mBAAgB,cACf,eACC,oBACE;;;;;;;;;;;0BAHJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBASA,mBAAgB,cACf,eACC,oBACE;;;;;;;wBAHJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBASS,gBACpB,cACA,eACA,kBAAe,QAHKC;;;;wBC3CN,UACd,QAAQ,YACR,SAAS,KACP;EAGA,YAAY;EACZ,YACE,MAAM,gBACN,QAAQ,qBACE;IAEb,OAAO;EAAS;EAAe;EAAgB;;;;YCsBtC;EACV,QAAQ;EACR;EACA;EACA;;EAEA;;EAEA,aAAa;;EAEb,SAAS;;EAET,UAAU;;EAEV;;EAEA,YAAY,OAAO;;EAEnB;;EAEA,SAAS;;EAET,UAAU;EACV,YAAY;;;wBASE,QACd,YAAY,gBACZ,SAAS,iBACR,OAAO,OAAO"}
package/dist/runner.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as readTrialEvents, c as readTrialSummary, d as CheckpointExecutionError, f as FixtureError, i as readRunSummary, l as localReportStore, m as ScoringError, n as runMatrix, o as readTrialManifest, p as ReportError, r as readRunManifest, s as readTrialScoring, t as runEval, u as AutExecutionError } from "./src-DluldGKn.mjs";
1
+ import { a as readTrialEvents, c as readTrialSummary, d as CheckpointExecutionError, f as FixtureError, i as readRunSummary, l as localReportStore, m as ScoringError, n as runMatrix, o as readTrialManifest, p as ReportError, r as readRunManifest, s as readTrialScoring, t as runEval, u as AutExecutionError } from "./src-DoPs9Yug.mjs";
2
2
  export { AutExecutionError, CheckpointExecutionError, FixtureError, ReportError, ScoringError, localReportStore, readRunManifest, readRunSummary, readTrialEvents, readTrialManifest, readTrialScoring, readTrialSummary, runEval, runMatrix };
@@ -0,0 +1,51 @@
1
+ import { h as R2BucketLike, o as SqlValue, r as ShareIndex } from "./index-db-HdZXelOS.mjs";
2
+ //#region ../share/src/index-do.d.ts
3
+ /** The subset of Durable Object state used by the index. */
4
+ type DurableObjectStateLike = {
5
+ storage: {
6
+ sql: {
7
+ exec(query: string, ...params: SqlValue[]): {
8
+ toArray(): unknown[];
9
+ };
10
+ };
11
+ transactionSync<T>(work: () => T): T;
12
+ };
13
+ };
14
+ type DurableObjectNamespaceLike = {
15
+ idFromName(name: string): unknown;
16
+ get(id: unknown): {
17
+ fetch(request: Request): Promise<Response>;
18
+ };
19
+ };
20
+ /**
21
+ * One SQLite-backed Durable Object holds the whole index. It serializes every
22
+ * write, so concurrent uploads for the same commit never race.
23
+ * Bind it with `new_sqlite_classes: ["ShareIndex"]`.
24
+ */
25
+ declare class ShareIndexObject {
26
+ private readonly db;
27
+ constructor(state: DurableObjectStateLike);
28
+ fetch(request: Request): Promise<Response>;
29
+ }
30
+ /** The Worker's view of the index: each call is one request to the object. */
31
+ declare function durableObjectIndex(namespace: DurableObjectNamespaceLike): ShareIndex;
32
+ //#endregion
33
+ //#region ../share/src/worker.d.ts
34
+ /**
35
+ * Bindings for a share server Worker (see `wrangler.jsonc` in this package):
36
+ * RESULTS (R2), INDEX (SQLite Durable Object, class ShareIndex), and ASSETS
37
+ * (static assets: the bundled dashboard, with `run_worker_first: true`).
38
+ */
39
+ type ShareEnv = {
40
+ RESULTS: R2BucketLike;
41
+ INDEX: Parameters<typeof durableObjectIndex>[0];
42
+ ASSETS: {
43
+ fetch(request: Request): Promise<Response>;
44
+ };
45
+ };
46
+ declare const _default: {
47
+ fetch(request: Request, env: ShareEnv): Promise<Response> | Response;
48
+ };
49
+ //#endregion
50
+ export { type ShareEnv, ShareIndexObject as ShareIndex, _default as default };
51
+ //# sourceMappingURL=share-worker.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-worker.d.mts","names":[],"sources":["../../share/src/index-do.ts","../../share/src/worker.ts"],"mappings":";;;KAGK;EACH;IACE;MACE,KAAK,kBAAkB,QAAQ;QAAe;;;IAEhD,gBAAgB,GAAG,YAAY,IAAI;;;KAIlC;EACH,WAAW;EACX,IAAI;IAAgB,MAAM,SAAS,UAAU,QAAQ;;;;;;;;cAmB1C;mBACM;EAEjB,YAAY,OAAO;EAYb,MAAM,SAAS,UAAU,QAAQ;;;iBAezB,mBACd,WAAW,6BACV;;;;;;;;KCtDS;EACV,SAAS;EACT,OAAO,kBAAkB;EACzB;IAAU,MAAM,SAAS,UAAU,QAAQ;;;;EAI3C,MAAK,SAAU,SAAO,KAAO,WAAW,QAAQ,YAAY"}
@@ -0,0 +1,73 @@
1
+ import { r as createShareApp, t as ShareIndexDb } from "./index-db-vbqEGFaU.mjs";
2
+ import { t as r2Files } from "./files-C-U0-PWW.mjs";
3
+ //#region ../share/src/index-do.ts
4
+ const METHODS = [
5
+ "hasRun",
6
+ "recordRun",
7
+ "repos",
8
+ "commits",
9
+ "runs",
10
+ "resolve",
11
+ "latest"
12
+ ];
13
+ /**
14
+ * One SQLite-backed Durable Object holds the whole index. It serializes every
15
+ * write, so concurrent uploads for the same commit never race.
16
+ * Bind it with `new_sqlite_classes: ["ShareIndex"]`.
17
+ */
18
+ var ShareIndexObject = class {
19
+ db;
20
+ constructor(state) {
21
+ const { sql } = state.storage;
22
+ this.db = new ShareIndexDb({
23
+ all: (query, ...params) => sql.exec(query, ...params).toArray(),
24
+ run: (query, ...params) => {
25
+ sql.exec(query, ...params);
26
+ },
27
+ transaction: (work) => state.storage.transactionSync(work)
28
+ });
29
+ }
30
+ async fetch(request) {
31
+ const { method, args } = await request.json();
32
+ if (!METHODS.includes(method)) return new Response(`Unknown index method: ${String(method)}`, { status: 400 });
33
+ const call = this.db[method];
34
+ return Response.json({ result: call.apply(this.db, args) ?? null });
35
+ }
36
+ };
37
+ /** The Worker's view of the index: each call is one request to the object. */
38
+ function durableObjectIndex(namespace) {
39
+ const stub = namespace.get(namespace.idFromName("index"));
40
+ const call = async (method, ...args) => {
41
+ const response = await stub.fetch(new Request("https://share-index/rpc", {
42
+ method: "POST",
43
+ body: JSON.stringify({
44
+ method,
45
+ args
46
+ })
47
+ }));
48
+ if (!response.ok) throw new Error(`Index ${method} failed: ${await response.text()}`);
49
+ const { result } = await response.json();
50
+ return result ?? void 0;
51
+ };
52
+ return Object.fromEntries(METHODS.map((method) => [method, (...args) => call(method, ...args)]));
53
+ }
54
+ //#endregion
55
+ //#region ../share/src/worker.ts
56
+ var worker_default = { fetch(request, env) {
57
+ const asset = (path) => env.ASSETS.fetch(new Request(new URL(path, "https://assets.local")));
58
+ return createShareApp({
59
+ files: r2Files(env.RESULTS),
60
+ index: durableObjectIndex(env.INDEX),
61
+ assets: {
62
+ index: async () => (await asset("/")).text(),
63
+ get: async (path) => {
64
+ const response = await asset(`/assets/${path}`);
65
+ return response.ok ? response : null;
66
+ }
67
+ }
68
+ }).fetch(request);
69
+ } };
70
+ //#endregion
71
+ export { ShareIndexObject as ShareIndex, worker_default as default };
72
+
73
+ //# sourceMappingURL=share-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-worker.mjs","names":[],"sources":["../../share/src/index-do.ts","../../share/src/worker.ts"],"sourcesContent":["import { ShareIndexDb, type ShareIndex, type SqlValue } from './index-db.js';\n\n/** The subset of Durable Object state used by the index. */\ntype DurableObjectStateLike = {\n storage: {\n sql: {\n exec(query: string, ...params: SqlValue[]): { toArray(): unknown[] };\n };\n transactionSync<T>(work: () => T): T;\n };\n};\n\ntype DurableObjectNamespaceLike = {\n idFromName(name: string): unknown;\n get(id: unknown): { fetch(request: Request): Promise<Response> };\n};\n\nconst METHODS = [\n 'hasRun',\n 'recordRun',\n 'repos',\n 'commits',\n 'runs',\n 'resolve',\n 'latest',\n] as const satisfies readonly (keyof ShareIndex)[];\ntype Method = (typeof METHODS)[number];\n\n/**\n * One SQLite-backed Durable Object holds the whole index. It serializes every\n * write, so concurrent uploads for the same commit never race.\n * Bind it with `new_sqlite_classes: [\"ShareIndex\"]`.\n */\nexport class ShareIndexObject {\n private readonly db: ShareIndexDb;\n\n constructor(state: DurableObjectStateLike) {\n const { sql } = state.storage;\n this.db = new ShareIndexDb({\n all: <T>(query: string, ...params: SqlValue[]) =>\n sql.exec(query, ...params).toArray() as T[],\n run: (query, ...params) => {\n sql.exec(query, ...params);\n },\n transaction: (work) => state.storage.transactionSync(work),\n });\n }\n\n async fetch(request: Request): Promise<Response> {\n const { method, args } = (await request.json()) as {\n method: Method;\n args: unknown[];\n };\n if (!METHODS.includes(method))\n return new Response(`Unknown index method: ${String(method)}`, {\n status: 400,\n });\n const call = this.db[method] as (...values: unknown[]) => unknown;\n return Response.json({ result: call.apply(this.db, args) ?? null });\n }\n}\n\n/** The Worker's view of the index: each call is one request to the object. */\nexport function durableObjectIndex(\n namespace: DurableObjectNamespaceLike,\n): ShareIndex {\n const stub = namespace.get(namespace.idFromName('index'));\n const call = async (method: Method, ...args: unknown[]) => {\n const response = await stub.fetch(\n new Request('https://share-index/rpc', {\n method: 'POST',\n body: JSON.stringify({ method, args }),\n }),\n );\n if (!response.ok)\n throw new Error(`Index ${method} failed: ${await response.text()}`);\n const { result } = (await response.json()) as { result: unknown };\n return result ?? undefined;\n };\n return Object.fromEntries(\n METHODS.map((method) => [\n method,\n (...args: unknown[]) => call(method, ...args),\n ]),\n ) as unknown as ShareIndex;\n}\n","import { createShareApp } from './app.js';\nimport { r2Files, type R2BucketLike } from './files.js';\nimport { durableObjectIndex } from './index-do.js';\n\nexport { ShareIndexObject as ShareIndex } from './index-do.js';\n\n/**\n * Bindings for a share server Worker (see `wrangler.jsonc` in this package):\n * RESULTS (R2), INDEX (SQLite Durable Object, class ShareIndex), and ASSETS\n * (static assets: the bundled dashboard, with `run_worker_first: true`).\n */\nexport type ShareEnv = {\n RESULTS: R2BucketLike;\n INDEX: Parameters<typeof durableObjectIndex>[0];\n ASSETS: { fetch(request: Request): Promise<Response> };\n};\n\nexport default {\n fetch(request: Request, env: ShareEnv): Promise<Response> | Response {\n const asset = (path: string) =>\n env.ASSETS.fetch(new Request(new URL(path, 'https://assets.local')));\n const app = createShareApp({\n files: r2Files(env.RESULTS),\n index: durableObjectIndex(env.INDEX),\n assets: {\n // Static assets redirect /index.html to /, so ask for / directly.\n index: async () => (await asset('/')).text(),\n get: async (path) => {\n const response = await asset(`/assets/${path}`);\n return response.ok ? response : null;\n },\n },\n });\n return app.fetch(request);\n },\n};\n"],"mappings":";;;AAiBA,MAAM,UAAU;CACd;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;AAQA,IAAa,mBAAb,MAA8B;CAC5B;CAEA,YAAY,OAA+B;EACzC,MAAM,EAAE,QAAQ,MAAM;EACtB,KAAK,KAAK,IAAI,aAAa;GACzB,MAAS,OAAe,GAAG,WACzB,IAAI,KAAK,OAAO,GAAG,MAAM,CAAC,CAAC,QAAQ;GACrC,MAAM,OAAO,GAAG,WAAW;IACzB,IAAI,KAAK,OAAO,GAAG,MAAM;GAC3B;GACA,cAAc,SAAS,MAAM,QAAQ,gBAAgB,IAAI;EAC3D,CAAC;CACH;CAEA,MAAM,MAAM,SAAqC;EAC/C,MAAM,EAAE,QAAQ,SAAU,MAAM,QAAQ,KAAK;EAI7C,IAAI,CAAC,QAAQ,SAAS,MAAM,GAC1B,OAAO,IAAI,SAAS,yBAAyB,OAAO,MAAM,KAAK,EAC7D,QAAQ,IACV,CAAC;EACH,MAAM,OAAO,KAAK,GAAG;EACrB,OAAO,SAAS,KAAK,EAAE,QAAQ,KAAK,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,CAAC;CACpE;AACF;;AAGA,SAAgB,mBACd,WACY;CACZ,MAAM,OAAO,UAAU,IAAI,UAAU,WAAW,OAAO,CAAC;CACxD,MAAM,OAAO,OAAO,QAAgB,GAAG,SAAoB;EACzD,MAAM,WAAW,MAAM,KAAK,MAC1B,IAAI,QAAQ,2BAA2B;GACrC,QAAQ;GACR,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAK,CAAC;EACvC,CAAC,CACH;EACA,IAAI,CAAC,SAAS,IACZ,MAAM,IAAI,MAAM,SAAS,OAAO,WAAW,MAAM,SAAS,KAAK,GAAG;EACpE,MAAM,EAAE,WAAY,MAAM,SAAS,KAAK;EACxC,OAAO,UAAU,KAAA;CACnB;CACA,OAAO,OAAO,YACZ,QAAQ,KAAK,WAAW,CACtB,SACC,GAAG,SAAoB,KAAK,QAAQ,GAAG,IAAI,CAC9C,CAAC,CACH;AACF;;;ACpEA,IAAA,iBAAe,EACb,MAAM,SAAkB,KAA6C;CACnE,MAAM,SAAS,SACb,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,IAAI,MAAM,sBAAsB,CAAC,CAAC;CAarE,OAZY,eAAe;EACzB,OAAO,QAAQ,IAAI,OAAO;EAC1B,OAAO,mBAAmB,IAAI,KAAK;EACnC,QAAQ;GAEN,OAAO,aAAa,MAAM,MAAM,GAAG,EAAA,CAAG,KAAK;GAC3C,KAAK,OAAO,SAAS;IACnB,MAAM,WAAW,MAAM,MAAM,WAAW,MAAM;IAC9C,OAAO,SAAS,KAAK,WAAW;GAClC;EACF;CACF,CACS,CAAC,CAAC,MAAM,OAAO;AAC1B,EACF"}
@@ -0,0 +1,116 @@
1
+ import { _ as r2Files, a as Sql, c as SharedRun, d as BUNDLE_FORMAT, f as BundleFile, g as ShareFiles, h as R2BucketLike, i as ShareIndexDb, l as SharedRunStatus, m as encodeBundle, n as RepoRow, p as decodeBundle, r as ShareIndex, s as asyncIndex, t as CommitRow, u as parseUpload } from "./index-db-HdZXelOS.mjs";
2
+ import { Hono } from "hono";
3
+ //#region ../share/src/app.d.ts
4
+ /** The bundled dashboard: its index.html template and its JS/CSS files. */
5
+ type DashboardAssets = {
6
+ index(): Promise<string>;
7
+ get(path: string): Promise<Response | null>;
8
+ };
9
+ /** One structured log event. Bounded fields only; never file contents. */
10
+ type ShareEvent = {
11
+ event: 'share.upload';
12
+ outcome: 'created' | 'exists';
13
+ repo: string;
14
+ commit: string;
15
+ runId: string;
16
+ files: number;
17
+ bytes: number;
18
+ } | {
19
+ event: 'share.upload';
20
+ outcome: 'rejected';
21
+ reason: string;
22
+ } | {
23
+ event: 'share.reindex';
24
+ runs: number;
25
+ indexed: number;
26
+ } | {
27
+ event: 'share.error';
28
+ method: string;
29
+ path: string;
30
+ error: string;
31
+ };
32
+ type ShareAppOptions = {
33
+ files: ShareFiles;
34
+ index: ShareIndex;
35
+ assets: DashboardAssets;
36
+ /** Uncompressed bundle limit; the compressed body must also fit a Worker request. */
37
+ maxBundleBytes?: number;
38
+ /** Defaults to one JSON line per event on stdout (Workers Logs indexes these). */
39
+ log?: (event: ShareEvent) => void;
40
+ };
41
+ /**
42
+ * The share server: a small JSON API plus the dashboard app. It stores
43
+ * uploaded run bundles and shows one read-only snapshot per repository commit.
44
+ *
45
+ * POST /api/v1/uploads one run bundle
46
+ * POST /api/v1/reindex rebuild the index from stored run.json files
47
+ * GET /api/v1/repos indexed repositories
48
+ * GET /api/v1/repos/<repo>/-/commits commits, newest first
49
+ * GET /api/v1/repos/<repo>/-/<sha>/data/… snapshot data
50
+ * GET /assets/* dashboard JS/CSS
51
+ * GET /<repo> → latest commit
52
+ * GET /<repo>/-/<ref|prefix>/… → full SHA
53
+ * GET everything else the dashboard app
54
+ *
55
+ * There is no authentication: run it on a private network.
56
+ */
57
+ export declare function createShareApp(options: ShareAppOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
58
+ //#endregion
59
+ //#region ../share/src/fs-files.d.ts
60
+ /** Result files in a directory, for `evalkit share serve` and tests. */
61
+ export declare function directoryFiles(root: string): ShareFiles;
62
+ //#endregion
63
+ //#region ../share/src/html.d.ts
64
+ /**
65
+ * Turn the dashboard's index.html into a read-only page. The app derives its
66
+ * router basename from `<base href>`. A static snapshot reads `data/…` below
67
+ * the base; on the share server, `share` says where the API is.
68
+ */
69
+ type ShareContext = {
70
+ /** All repositories: `/api/v1/repos`. */
71
+ repos: string;
72
+ /** This repository's commits, for the version picker. */
73
+ commits?: string;
74
+ /** This commit's snapshot data (replaces `<base>/data/`). */
75
+ data?: string;
76
+ repo?: string;
77
+ /** A ref or SHA with no shared results. */
78
+ missing?: string;
79
+ };
80
+ export declare function dashboardIndex(html: string, options: {
81
+ base: string;
82
+ assets?: string;
83
+ share?: ShareContext;
84
+ }): string;
85
+ //#endregion
86
+ //#region ../share/src/index-bun.d.ts
87
+ /** The index in a SQLite file, for `evalkit share serve` and tests. */
88
+ export declare function sqliteIndex(path: string): ShareIndex;
89
+ //#endregion
90
+ //#region ../share/src/node.d.ts
91
+ /** Serve the bundled dashboard from a directory (`dist/dashboard`). */
92
+ export declare function directoryAssets(root: string): DashboardAssets;
93
+ /** A share server on Bun: files and `index.sqlite` live in `dir`. */
94
+ export declare function createDirectoryShareApp(options: {
95
+ dir: string;
96
+ dashboardRoot: string;
97
+ }): Promise<import("hono").Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">>;
98
+ //#endregion
99
+ //#region ../share/src/paths.d.ts
100
+ /**
101
+ * The only files a run bundle may contain (the snapshot format from
102
+ * `evalkit build`, for one run). Never evaluator workspaces.
103
+ */
104
+ export declare function allowedRunPath(path: string): boolean;
105
+ /**
106
+ * Repository key: normalized host/path, plus `/~<project>` for an eval
107
+ * project below the repository root. Used in storage keys and URLs.
108
+ */
109
+ export declare function repoKey(source: {
110
+ repo: string;
111
+ project: string;
112
+ }): string;
113
+ export declare function validRepoKey(key: string): boolean;
114
+ //#endregion
115
+ export { BUNDLE_FORMAT, type BundleFile, type CommitRow, type DashboardAssets, type R2BucketLike, type RepoRow, type ShareAppOptions, type ShareEvent, type ShareFiles, type ShareIndex, ShareIndexDb, type SharedRun, type SharedRunStatus, type Sql, asyncIndex, decodeBundle, encodeBundle, parseUpload, r2Files };
116
+ //# sourceMappingURL=share.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share.d.mts","names":[],"sources":["../../share/src/app.ts","../../share/src/fs-files.ts","../../share/src/html.ts","../../share/src/index-bun.ts","../../share/src/node.ts","../../share/src/paths.ts"],"mappings":";;;;KAiBY;EACV,SAAS;EACT,IAAI,eAAe,QAAQ;;;KAIjB;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EAAuB;EAAqB;;EAC5C;EAAwB;EAAc;;EACtC;EAAsB;EAAgB;EAAc;;KAE9C;EACV,OAAO;EACP,OAAO;EACP,QAAQ;;EAER;;EAEA,OAAO,OAAO;;;;;;;;;;;;;;;;;;wBAiCA,eAAe,SAAS,kBAAe,0BAAA,+BAAA;;;;wBCxEvC,eAAe,eAAe;;;;;;;;KCAlC;;EAEV;;EAEA;;EAEA;EACA;;EAEA;;wBAGc,eACd,cACA;EAAW;EAAc;EAAiB,QAAQ;;;;;wBCfpC,YAAY,eAAe;;;;wBCU3B,gBAAgB,eAAe;;wBAsBzB,wBAAwB;EAC5C;EACA;IACD,uBAAA,0BAAA,+BAAA;;;;;;;wBCfe,eAAe;;;;;wBAef,QAAQ;EAAU;EAAc;;wBAIhC,aAAa"}
package/dist/share.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { a as allowedRunPath, c as dashboardIndex, d as encodeBundle, i as parseUpload, l as BUNDLE_FORMAT, n as asyncIndex, o as repoKey, r as createShareApp, s as validRepoKey, t as ShareIndexDb, u as decodeBundle } from "./index-db-vbqEGFaU.mjs";
2
+ import { t as r2Files } from "./files-C-U0-PWW.mjs";
3
+ import { i as directoryFiles, n as directoryAssets, r as sqliteIndex, t as createDirectoryShareApp } from "./src-DzZueFn3.mjs";
4
+ export { BUNDLE_FORMAT, ShareIndexDb, allowedRunPath, asyncIndex, createDirectoryShareApp, createShareApp, dashboardIndex, decodeBundle, directoryAssets, directoryFiles, encodeBundle, parseUpload, r2Files, repoKey, sqliteIndex, validRepoKey };