@leostera/evalkit 0.2.0 → 0.4.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.
- package/CHANGELOG.md +81 -0
- package/README.md +8 -7
- package/dist/cli.mjs +909 -149
- package/dist/cli.mjs.map +1 -1
- package/dist/dashboard/assets/index-D9NtA46z.css +2 -0
- package/dist/dashboard/assets/index-DrBwLKJD.js +30 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/files-C-U0-PWW.mjs +26 -0
- package/dist/files-C-U0-PWW.mjs.map +1 -0
- package/dist/{index-M5eRlMfd.d.mts → index-U6TUTBf7.d.mts} +87 -9
- package/dist/index-U6TUTBf7.d.mts.map +1 -0
- package/dist/index-db-HdZXelOS.d.mts +142 -0
- package/dist/index-db-HdZXelOS.d.mts.map +1 -0
- package/dist/index-db-vbqEGFaU.mjs +548 -0
- package/dist/index-db-vbqEGFaU.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/runner.d.mts +21 -3
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +1 -1
- package/dist/share-worker.d.mts +51 -0
- package/dist/share-worker.d.mts.map +1 -0
- package/dist/share-worker.mjs +73 -0
- package/dist/share-worker.mjs.map +1 -0
- package/dist/share.d.mts +116 -0
- package/dist/share.d.mts.map +1 -0
- package/dist/share.mjs +4 -0
- package/dist/{src-DrwwgaPn.mjs → src-ButXPY8P.mjs} +20 -5
- package/dist/src-ButXPY8P.mjs.map +1 -0
- package/dist/{src-DluldGKn.mjs → src-DoPs9Yug.mjs} +11 -7
- package/dist/src-DoPs9Yug.mjs.map +1 -0
- package/dist/src-DzZueFn3.mjs +98 -0
- package/dist/src-DzZueFn3.mjs.map +1 -0
- package/package.json +10 -1
- package/dist/dashboard/assets/index-Z6raM-uW.js +0 -30
- package/dist/dashboard/assets/index-fUDsY6z-.css +0 -2
- package/dist/index-M5eRlMfd.d.mts.map +0 -1
- package/dist/src-DluldGKn.mjs.map +0 -1
- package/dist/src-DrwwgaPn.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TrajectoryEvent, $t as ResourceKindSchema, 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 EvalMatrixCell, K as RunSummary, Kt as defineConfig, 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 ResourceKind, 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 defineEvalMatrix, Y as ScoreResult, Yt as MatrixSelection, Z as ScoringContext, Zt as canonicalParameters, _ as EvalCatalogEntry, _t as expectToolCall, a as AggregateScoring, an as parseResourceUri, at as TrialWriter, b as EvalPolicy, bt as judge, c as AutAdapter, cn as resourceUuid, ct as UserStep, d as AutIdentity, dt as authoringId, en as ResourceUri, 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 authorId, it as TrialSummary, j as FixtureVisibility, jt as JudgeRunInfoSchema, k as Fixture, kt as CheckpointResultSchema, l as AutContext, lt as WorkspaceView, m as CheckpointResult, mt as defineSuite, n as AgentRuntimeName, nn as Uuid, nt as TrialResult, o as ArtifactEntry, on as resourceUri, ot as TurnView, p as CandidateWorkspace, pt as defineEval, q as RunWriter, qt as EvalMatrix, r as AgentRuntimes, rn as UuidSchema, rt as TrialScoring, s as ArtifactView, sn as resourceUriSchema, st as Usage, t as AgentRuntime, tn as ResourceUriSchema, tt as TrialMetadata, u as AutEvent, 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-U6TUTBf7.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, 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
|
|
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
|
package/dist/index.mjs.map
CHANGED
|
@@ -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":";;;
|
|
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 /** Where `evalkit share` uploads results. `EVALKIT_SHARE_URL` overrides it. */\n share?: { url: 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":";;;AAqBA,SAAgB,aACd,eACG;CACH,OAAO;AACT;;;;ACJA,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"}
|
package/dist/runner.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as ReportStore, F as JsonValue,
|
|
1
|
+
import { $ as TrajectoryEvent, B as ReportStore, F as JsonValue, H as RunMetadata, Jt as EvalMatrixCell, N as JsonObject, U as RunResult, V as RunCatalog, W as RunSource, Yt as MatrixSelection, n as AgentRuntimeName, qt as EvalMatrix, y as EvalDefinition } from "./index-U6TUTBf7.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. */
|
package/dist/runner.d.mts.map
CHANGED
|
@@ -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;;;;;
|
|
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-
|
|
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"}
|
package/dist/share.d.mts
ADDED
|
@@ -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 };
|
|
@@ -202,18 +202,33 @@ const MatrixCellSchema = Schema.Struct({
|
|
|
202
202
|
id: Schema.String,
|
|
203
203
|
cellKey: Schema.String
|
|
204
204
|
});
|
|
205
|
+
const RunSourceSchema = Schema.Struct({
|
|
206
|
+
repo: Schema.String,
|
|
207
|
+
project: Schema.String,
|
|
208
|
+
commit: Schema.String,
|
|
209
|
+
ref: Schema.optional(Schema.String),
|
|
210
|
+
committedAt: Schema.optional(Schema.String),
|
|
211
|
+
dirty: Schema.Boolean,
|
|
212
|
+
ci: Schema.optional(Schema.Struct({
|
|
213
|
+
provider: Schema.String,
|
|
214
|
+
pipeline: Schema.optional(Schema.String),
|
|
215
|
+
job: Schema.optional(Schema.String),
|
|
216
|
+
url: Schema.optional(Schema.String)
|
|
217
|
+
}))
|
|
218
|
+
});
|
|
205
219
|
const RunMetadataSchema = Schema.Struct({
|
|
206
|
-
schemaVersion: Schema.Literal(2, 3),
|
|
220
|
+
schemaVersion: Schema.Literal(2, 3, 4),
|
|
207
221
|
runUri: resourceUriSchema("run"),
|
|
208
222
|
evalId: Schema.String,
|
|
209
223
|
suiteId: Schema.optional(Schema.String),
|
|
210
224
|
parameters: Schema.optional(ParametersSchema),
|
|
211
225
|
matrix: Schema.optional(MatrixCellSchema),
|
|
212
226
|
aut: Schema.optional(AutIdentitySchema),
|
|
213
|
-
startedAt: Schema.String
|
|
227
|
+
startedAt: Schema.String,
|
|
228
|
+
source: Schema.optional(RunSourceSchema)
|
|
214
229
|
});
|
|
215
230
|
const TrialMetadataSchema = Schema.Struct({
|
|
216
|
-
schemaVersion: Schema.Literal(2, 3),
|
|
231
|
+
schemaVersion: Schema.Literal(2, 3, 4),
|
|
217
232
|
runUri: resourceUriSchema("run"),
|
|
218
233
|
trialUri: resourceUriSchema("trial"),
|
|
219
234
|
trialIndex: Schema.Number,
|
|
@@ -671,6 +686,6 @@ function recordError(error) {
|
|
|
671
686
|
};
|
|
672
687
|
}
|
|
673
688
|
//#endregion
|
|
674
|
-
export {
|
|
689
|
+
export { TrajectoryEventSchema as A, UuidSchema as B, RecordedErrorSchema as C, RunStatusSchema as D, RunSourceSchema as E, UsageSchema as F, resourceUuid as G, parseResourceUri as H, defineEvalMatrix as I, canonicalParameters as L, TrialMetadataSchema as M, TrialScoringSchema as N, RunSummarySchema as O, TrialSummarySchema as P, ResourceKindSchema as R, JudgeRunInfoSchema as S, RunMetadataSchema as T, resourceUri as U, authorId as V, resourceUriSchema as W, ApiErrorSchema as _, defineSuite as a, CheckpointResultSchema as b, expectToolCall as c, judge as d, predicate as f, parseTrajectoryJsonl as g, user as h, defineEval as i, TrialManifestSchema as j, ScoreResultSchema as k, file as l, registerEvals as m, authoringId as n, directory as o, recordError as p, defineAgent as r, dynamic as s, agent as t, inlineFile as u, ArtifactEntrySchema as v, RunManifestSchema as w, JsonValueSchema as x, AutIdentitySchema as y, ResourceUriSchema as z };
|
|
675
690
|
|
|
676
|
-
//# sourceMappingURL=src-
|
|
691
|
+
//# sourceMappingURL=src-ButXPY8P.mjs.map
|