anpord 0.1.13 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api-context.cjs +18 -0
- package/dist/api-context.d.cts +8 -0
- package/dist/api-context.d.mts +8 -0
- package/dist/api-context.mjs +17 -0
- package/dist/api-mocks-BXZmPUwV.d.cts +101 -0
- package/dist/api-mocks-BXZmPUwV.d.mts +101 -0
- package/dist/api-mocks-CuVw86Qw.cjs +68 -0
- package/dist/api-mocks-wNUnpzJf.mjs +33 -0
- package/dist/api-runtime.cjs +4 -0
- package/dist/api-runtime.d.cts +13 -0
- package/dist/api-runtime.d.mts +13 -0
- package/dist/api-runtime.mjs +2 -0
- package/dist/api.cjs +5 -0
- package/dist/api.d.cts +4 -0
- package/dist/api.d.mts +4 -0
- package/dist/api.mjs +2 -0
- package/dist/bin.cjs +8 -8
- package/dist/bin.mjs +6 -6
- package/dist/cli-runtime.cjs +9 -26
- package/dist/cli-runtime.mjs +5 -22
- package/dist/{client-BirFO3jz.d.cts → client-BVoIRPot.d.cts} +1082 -1082
- package/dist/{client-BfdjFtlV.mjs → client-DE3YNtWc.mjs} +3 -90
- package/dist/{client-C-P2I00z.cjs → client-DziJjMFh.cjs} +4 -91
- package/dist/{client-BgRs8JvW.d.mts → client-_OgJhHpJ.d.mts} +1083 -1083
- package/dist/{compiler-D96wI7UP.mjs → compiler-C62ss3a4.mjs} +161 -61
- package/dist/{compiler-uwb1pkdK.cjs → compiler-CYwJNlT4.cjs} +202 -72
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/define-NZvmQuIv.d.cts +34 -0
- package/dist/define-NZvmQuIv.d.mts +34 -0
- package/dist/{eval-judges-DPPUftbh.d.cts → eval-judges-0FkhUOIB.d.cts} +2 -2
- package/dist/{eval-judges-DPPUftbh.d.mts → eval-judges-0FkhUOIB.d.mts} +2 -2
- package/dist/{eval-judges-BkmiVLLq.cjs → eval-judges-1zF4PVqV.cjs} +1 -1
- package/dist/{eval-judges-CwTvTq7N.mjs → eval-judges-Bee_ABJt.mjs} +1 -1
- package/dist/{eval-validations-_MlnQ_uv.cjs → eval-validations-BdlPhudg.cjs} +8 -2
- package/dist/{eval-validations-BRdoZrTQ.mjs → eval-validations-BvX9dkYh.mjs} +3 -3
- package/dist/eval.cjs +4 -1
- package/dist/eval.d.cts +275 -25
- package/dist/eval.d.mts +275 -25
- package/dist/eval.mjs +2 -2
- package/dist/{evals-B6aT3xgH.d.cts → evals-CFxc4IrF.d.cts} +124 -124
- package/dist/{evals-B6aT3xgH.d.mts → evals-CFxc4IrF.d.mts} +124 -124
- package/dist/{evals-DouMsrsM.cjs → evals-api-CqhPZCr5.cjs} +104 -73
- package/dist/{evals-Dcc_x6jW.mjs → evals-api-CsdU741J.mjs} +96 -5
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +12 -8
- package/dist/index.d.mts +13 -9
- package/dist/index.mjs +7 -7
- package/dist/mcp-runtime.cjs +9 -18
- package/dist/mcp-runtime.mjs +5 -14
- package/dist/mock-journal-Bnaozlx4.cjs +39 -0
- package/dist/mock-journal-rbsXfDRs.mjs +22 -0
- package/dist/runtime-CXcsGvwP.cjs +292 -0
- package/dist/runtime-DDUrsAI-.mjs +269 -0
- package/dist/source.d.cts +1 -1
- package/dist/source.d.mts +1 -1
- package/dist/{types-Codjaq-o.d.mts → types-BjQf9IIi.d.mts} +21 -11
- package/dist/{types-ISsteq95.d.cts → types-C2nRDJ95.d.cts} +20 -10
- package/dist/validator-runtime.cjs +6 -1
- package/dist/validator-runtime.d.cts +1 -1
- package/dist/validator-runtime.d.mts +1 -1
- package/dist/validator-runtime.mjs +6 -1
- package/dist/validators.cjs +1 -1
- package/dist/validators.d.cts +1 -1
- package/dist/validators.d.mts +1 -1
- package/dist/validators.mjs +1 -1
- package/package.json +21 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { g as NotFound, h as Forbidden, m as Conflict, p as BadRequest, r as ApiKeyAuthentication, t as PublicEvalsGroup } from "./evals-api-CsdU741J.mjs";
|
|
2
|
+
import { Effect, Layer, Redacted, Schema } from "effect";
|
|
3
|
+
import { FetchHttpClient, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpClient, HttpClientRequest, OpenApi } from "@effect/platform";
|
|
4
4
|
//#region ../schema/src/domain/prompts.ts
|
|
5
5
|
const ChannelName = Schema.String.pipe(Schema.minLength(1), Schema.maxLength(36), Schema.pattern(/^[a-z0-9][a-z0-9_-]*$/, { message: () => "Channel must be lowercase alphanumeric, optionally with - or _" }), Schema.brand("ChannelName")).annotations({ description: "Addresses a version. `latest` is derived from the highest version rather than stored, so it cannot drift from the version table." });
|
|
6
6
|
ChannelName.make("production");
|
|
@@ -93,93 +93,6 @@ Schema.Struct({
|
|
|
93
93
|
version: Schema.optional(VersionNumber)
|
|
94
94
|
});
|
|
95
95
|
//#endregion
|
|
96
|
-
//#region ../schema/src/domain/errors.ts
|
|
97
|
-
var NotFound = class extends Schema.TaggedError()("NotFound", { message: Schema.String }, HttpApiSchema.annotations({ status: 404 })) {};
|
|
98
|
-
var Conflict = class extends Schema.TaggedError()("Conflict", { message: Schema.String }, HttpApiSchema.annotations({ status: 409 })) {};
|
|
99
|
-
var BadRequest = class extends Schema.TaggedError()("BadRequest", { message: Schema.String }, HttpApiSchema.annotations({ status: 400 })) {};
|
|
100
|
-
var Unauthorized = class extends Schema.TaggedError()("Unauthorized", { message: Schema.String }, HttpApiSchema.annotations({ status: 401 })) {};
|
|
101
|
-
var Forbidden = class extends Schema.TaggedError()("Forbidden", { message: Schema.String }, HttpApiSchema.annotations({ status: 403 })) {};
|
|
102
|
-
Schema.TaggedError()("InternalError", { message: Schema.String }, HttpApiSchema.annotations({ status: 500 }));
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region ../schema/src/internal/authentication.ts
|
|
105
|
-
var CurrentActor = class extends Context.Tag("@anpord/schema/CurrentActor")() {};
|
|
106
|
-
HttpApiMiddleware.Tag()("@anpord/schema/Authentication", {
|
|
107
|
-
failure: Unauthorized,
|
|
108
|
-
provides: CurrentActor,
|
|
109
|
-
security: { session: HttpApiSecurity.apiKey({
|
|
110
|
-
in: "cookie",
|
|
111
|
-
key: "anpord.session_token"
|
|
112
|
-
}) }
|
|
113
|
-
});
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region ../schema/src/public/authentication.ts
|
|
116
|
-
var ApiKeyAuthentication = class extends HttpApiMiddleware.Tag()("@anpord/schema/ApiKeyAuthentication", {
|
|
117
|
-
failure: Unauthorized,
|
|
118
|
-
provides: CurrentActor,
|
|
119
|
-
security: { bearer: HttpApiSecurity.bearer }
|
|
120
|
-
}) {};
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region ../schema/src/public/evals-api.ts
|
|
123
|
-
const EvalRunRequest = Schema.Struct({ id: Schema.String }).annotations({
|
|
124
|
-
description: "Select an eval run by id.",
|
|
125
|
-
identifier: "EvalRunRequest"
|
|
126
|
-
});
|
|
127
|
-
const EvalCellRequest = Schema.Struct({ cellKey: Schema.String }).annotations({
|
|
128
|
-
description: "Select an eval cell by its stable key.",
|
|
129
|
-
identifier: "EvalCellRequest"
|
|
130
|
-
});
|
|
131
|
-
const EvalModelsRequest = Schema.Struct({
|
|
132
|
-
harness: EvalHarness,
|
|
133
|
-
q: Schema.optional(Schema.String)
|
|
134
|
-
}).annotations({
|
|
135
|
-
description: "Select a harness whose available models should be listed.",
|
|
136
|
-
identifier: "EvalModelsRequest"
|
|
137
|
-
});
|
|
138
|
-
const PublicEvalSandbox = EvalSandbox.annotations({
|
|
139
|
-
description: "The hosted sandbox a task runs in.",
|
|
140
|
-
identifier: "PublicEvalSandbox"
|
|
141
|
-
});
|
|
142
|
-
const ListEvalsRequest = Schema.Struct({
|
|
143
|
-
cursor: Schema.optional(Schema.NullOr(EvalPageCursor)),
|
|
144
|
-
limit: Schema.optional(Schema.Int)
|
|
145
|
-
}).annotations({
|
|
146
|
-
description: "Where to read from, and how much.",
|
|
147
|
-
identifier: "ListEvalsRequest"
|
|
148
|
-
});
|
|
149
|
-
const PublicEvalCase = Schema.Struct({
|
|
150
|
-
cache: Schema.optional(CaseCache),
|
|
151
|
-
name: EvalCaseName,
|
|
152
|
-
prepare: Schema.optional(Schema.NullOr(EvalPrepare)),
|
|
153
|
-
source: Schema.optional(EvalSource),
|
|
154
|
-
validator: Schema.optional(Schema.NullOr(EvalValidator)),
|
|
155
|
-
variables: Schema.optional(EvalVariables),
|
|
156
|
-
verify: Schema.NullOr(EvalVerify)
|
|
157
|
-
}).pipe(Schema.filter(({ validator, verify }) => !(validator !== void 0 && validator !== null && verify !== null), { message: () => "Use either validator or verify, not both." })).annotations({
|
|
158
|
-
description: "A task, workspace source, setup command, and verifier.",
|
|
159
|
-
identifier: "StartEvalCase"
|
|
160
|
-
});
|
|
161
|
-
const PublicEvalTask = Schema.Struct({
|
|
162
|
-
harness: EvalHarness,
|
|
163
|
-
model: Schema.String.pipe(Schema.minLength(1)),
|
|
164
|
-
profile: Schema.optional(HarnessProfile),
|
|
165
|
-
sandbox: Schema.optional(PublicEvalSandbox)
|
|
166
|
-
}).pipe(Schema.filter(profileFitsHarness, { message: () => PROFILE_HARNESS_RULE })).annotations({
|
|
167
|
-
description: `A harness and model, with an optional sandbox and an optional profile layered on the harness. Omit the sandbox to use the default. ${PROFILE_HARNESS_RULE}`,
|
|
168
|
-
identifier: "StartEvalTask"
|
|
169
|
-
});
|
|
170
|
-
const PublicStartEvalRequest = Schema.Struct({
|
|
171
|
-
trigger: Schema.optional(EvalTrigger),
|
|
172
|
-
cases: Schema.Array(PublicEvalCase).pipe(Schema.minItems(1), Schema.maxItems(100)),
|
|
173
|
-
name: Schema.optional(EvalName),
|
|
174
|
-
prompt: EvalPrompt,
|
|
175
|
-
tasks: Schema.Array(PublicEvalTask).pipe(Schema.minItems(1), Schema.maxItems(20)),
|
|
176
|
-
trials: Schema.Int.pipe(Schema.between(1, 10))
|
|
177
|
-
}).annotations({
|
|
178
|
-
description: `Start a grid with at most 100 total case, task, and trial combinations.`,
|
|
179
|
-
identifier: "StartEvalRequest"
|
|
180
|
-
});
|
|
181
|
-
var PublicEvalsGroup = class extends HttpApiGroup.make("evals").add(HttpApiEndpoint.post("list", "/evals.list").setPayload(ListEvalsRequest).addSuccess(EvalRunPage).annotate(OpenApi.Summary, "List eval runs").annotate(OpenApi.Description, "Newest first. Pass the `next` cursor from a response to read the page after it; a null `next` means there are no more.")).add(HttpApiEndpoint.post("start", "/evals.start").setPayload(PublicStartEvalRequest).addSuccess(StartedEval).annotate(OpenApi.Summary, "Start an eval run").annotate(OpenApi.Description, `Starts the grid and returns its id while trials continue in the background. ${PROFILE_HARNESS_RULE}`)).add(HttpApiEndpoint.post("get", "/evals.get").setPayload(EvalRunRequest).addSuccess(EvalRun).annotate(OpenApi.Summary, "Get an eval run")).add(HttpApiEndpoint.post("cellHistory", "/evals.cellHistory").setPayload(EvalCellRequest).addSuccess(Schema.Array(EvalCellHistoryEntry)).annotate(OpenApi.Summary, "List a cell's history").annotate(OpenApi.Description, "Returns the 20 most recent results.")).add(HttpApiEndpoint.post("rerunCell", "/evals.rerunCell").setPayload(Schema.extend(EvalRunRequest, Schema.extend(EvalCellRequest, RerunCellRequest))).addSuccess(StartedEval).annotate(OpenApi.Summary, "Rerun one cell")).add(HttpApiEndpoint.post("models", "/evals.models").setPayload(EvalModelsRequest).addSuccess(ModelCatalogue).annotate(OpenApi.Summary, "List models available to the harness").annotate(OpenApi.Description, "The command harness has no catalogue of its own, so its list is empty: the model is whatever the profile's run command reads from ANPORD_MODEL.")).addError(BadRequest).addError(Conflict).addError(Forbidden).addError(NotFound).middleware(ApiKeyAuthentication).annotate(OpenApi.Title, "Evals").annotate(OpenApi.Description, "Run cases across harness, model, and sandbox combinations and compare the results with their baselines.") {};
|
|
182
|
-
//#endregion
|
|
183
96
|
//#region ../schema/src/public/requests.ts
|
|
184
97
|
const GetPromptRequest = Schema.Struct({
|
|
185
98
|
channel: Schema.optional(ChannelName),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
let _effect_platform = require("@effect/platform");
|
|
1
|
+
const require_evals_api = require("./evals-api-CqhPZCr5.cjs");
|
|
3
2
|
let effect = require("effect");
|
|
3
|
+
let _effect_platform = require("@effect/platform");
|
|
4
4
|
//#region ../schema/src/domain/prompts.ts
|
|
5
5
|
const ChannelName = effect.Schema.String.pipe(effect.Schema.minLength(1), effect.Schema.maxLength(36), effect.Schema.pattern(/^[a-z0-9][a-z0-9_-]*$/, { message: () => "Channel must be lowercase alphanumeric, optionally with - or _" }), effect.Schema.brand("ChannelName")).annotations({ description: "Addresses a version. `latest` is derived from the highest version rather than stored, so it cannot drift from the version table." });
|
|
6
6
|
ChannelName.make("production");
|
|
@@ -93,93 +93,6 @@ effect.Schema.Struct({
|
|
|
93
93
|
version: effect.Schema.optional(VersionNumber)
|
|
94
94
|
});
|
|
95
95
|
//#endregion
|
|
96
|
-
//#region ../schema/src/domain/errors.ts
|
|
97
|
-
var NotFound = class extends effect.Schema.TaggedError()("NotFound", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 404 })) {};
|
|
98
|
-
var Conflict = class extends effect.Schema.TaggedError()("Conflict", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 409 })) {};
|
|
99
|
-
var BadRequest = class extends effect.Schema.TaggedError()("BadRequest", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 400 })) {};
|
|
100
|
-
var Unauthorized = class extends effect.Schema.TaggedError()("Unauthorized", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 401 })) {};
|
|
101
|
-
var Forbidden = class extends effect.Schema.TaggedError()("Forbidden", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 403 })) {};
|
|
102
|
-
effect.Schema.TaggedError()("InternalError", { message: effect.Schema.String }, _effect_platform.HttpApiSchema.annotations({ status: 500 }));
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region ../schema/src/internal/authentication.ts
|
|
105
|
-
var CurrentActor = class extends effect.Context.Tag("@anpord/schema/CurrentActor")() {};
|
|
106
|
-
_effect_platform.HttpApiMiddleware.Tag()("@anpord/schema/Authentication", {
|
|
107
|
-
failure: Unauthorized,
|
|
108
|
-
provides: CurrentActor,
|
|
109
|
-
security: { session: _effect_platform.HttpApiSecurity.apiKey({
|
|
110
|
-
in: "cookie",
|
|
111
|
-
key: "anpord.session_token"
|
|
112
|
-
}) }
|
|
113
|
-
});
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region ../schema/src/public/authentication.ts
|
|
116
|
-
var ApiKeyAuthentication = class extends _effect_platform.HttpApiMiddleware.Tag()("@anpord/schema/ApiKeyAuthentication", {
|
|
117
|
-
failure: Unauthorized,
|
|
118
|
-
provides: CurrentActor,
|
|
119
|
-
security: { bearer: _effect_platform.HttpApiSecurity.bearer }
|
|
120
|
-
}) {};
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region ../schema/src/public/evals-api.ts
|
|
123
|
-
const EvalRunRequest = effect.Schema.Struct({ id: effect.Schema.String }).annotations({
|
|
124
|
-
description: "Select an eval run by id.",
|
|
125
|
-
identifier: "EvalRunRequest"
|
|
126
|
-
});
|
|
127
|
-
const EvalCellRequest = effect.Schema.Struct({ cellKey: effect.Schema.String }).annotations({
|
|
128
|
-
description: "Select an eval cell by its stable key.",
|
|
129
|
-
identifier: "EvalCellRequest"
|
|
130
|
-
});
|
|
131
|
-
const EvalModelsRequest = effect.Schema.Struct({
|
|
132
|
-
harness: require_evals.EvalHarness,
|
|
133
|
-
q: effect.Schema.optional(effect.Schema.String)
|
|
134
|
-
}).annotations({
|
|
135
|
-
description: "Select a harness whose available models should be listed.",
|
|
136
|
-
identifier: "EvalModelsRequest"
|
|
137
|
-
});
|
|
138
|
-
const PublicEvalSandbox = require_evals.EvalSandbox.annotations({
|
|
139
|
-
description: "The hosted sandbox a task runs in.",
|
|
140
|
-
identifier: "PublicEvalSandbox"
|
|
141
|
-
});
|
|
142
|
-
const ListEvalsRequest = effect.Schema.Struct({
|
|
143
|
-
cursor: effect.Schema.optional(effect.Schema.NullOr(require_evals.EvalPageCursor)),
|
|
144
|
-
limit: effect.Schema.optional(effect.Schema.Int)
|
|
145
|
-
}).annotations({
|
|
146
|
-
description: "Where to read from, and how much.",
|
|
147
|
-
identifier: "ListEvalsRequest"
|
|
148
|
-
});
|
|
149
|
-
const PublicEvalCase = effect.Schema.Struct({
|
|
150
|
-
cache: effect.Schema.optional(require_evals.CaseCache),
|
|
151
|
-
name: require_evals.EvalCaseName,
|
|
152
|
-
prepare: effect.Schema.optional(effect.Schema.NullOr(require_evals.EvalPrepare)),
|
|
153
|
-
source: effect.Schema.optional(require_evals.EvalSource),
|
|
154
|
-
validator: effect.Schema.optional(effect.Schema.NullOr(require_evals.EvalValidator)),
|
|
155
|
-
variables: effect.Schema.optional(require_evals.EvalVariables),
|
|
156
|
-
verify: effect.Schema.NullOr(require_evals.EvalVerify)
|
|
157
|
-
}).pipe(effect.Schema.filter(({ validator, verify }) => !(validator !== void 0 && validator !== null && verify !== null), { message: () => "Use either validator or verify, not both." })).annotations({
|
|
158
|
-
description: "A task, workspace source, setup command, and verifier.",
|
|
159
|
-
identifier: "StartEvalCase"
|
|
160
|
-
});
|
|
161
|
-
const PublicEvalTask = effect.Schema.Struct({
|
|
162
|
-
harness: require_evals.EvalHarness,
|
|
163
|
-
model: effect.Schema.String.pipe(effect.Schema.minLength(1)),
|
|
164
|
-
profile: effect.Schema.optional(require_evals.HarnessProfile),
|
|
165
|
-
sandbox: effect.Schema.optional(PublicEvalSandbox)
|
|
166
|
-
}).pipe(effect.Schema.filter(require_evals.profileFitsHarness, { message: () => require_evals.PROFILE_HARNESS_RULE })).annotations({
|
|
167
|
-
description: `A harness and model, with an optional sandbox and an optional profile layered on the harness. Omit the sandbox to use the default. ${require_evals.PROFILE_HARNESS_RULE}`,
|
|
168
|
-
identifier: "StartEvalTask"
|
|
169
|
-
});
|
|
170
|
-
const PublicStartEvalRequest = effect.Schema.Struct({
|
|
171
|
-
trigger: effect.Schema.optional(require_evals.EvalTrigger),
|
|
172
|
-
cases: effect.Schema.Array(PublicEvalCase).pipe(effect.Schema.minItems(1), effect.Schema.maxItems(100)),
|
|
173
|
-
name: effect.Schema.optional(require_evals.EvalName),
|
|
174
|
-
prompt: require_evals.EvalPrompt,
|
|
175
|
-
tasks: effect.Schema.Array(PublicEvalTask).pipe(effect.Schema.minItems(1), effect.Schema.maxItems(20)),
|
|
176
|
-
trials: effect.Schema.Int.pipe(effect.Schema.between(1, 10))
|
|
177
|
-
}).annotations({
|
|
178
|
-
description: `Start a grid with at most 100 total case, task, and trial combinations.`,
|
|
179
|
-
identifier: "StartEvalRequest"
|
|
180
|
-
});
|
|
181
|
-
var PublicEvalsGroup = class extends _effect_platform.HttpApiGroup.make("evals").add(_effect_platform.HttpApiEndpoint.post("list", "/evals.list").setPayload(ListEvalsRequest).addSuccess(require_evals.EvalRunPage).annotate(_effect_platform.OpenApi.Summary, "List eval runs").annotate(_effect_platform.OpenApi.Description, "Newest first. Pass the `next` cursor from a response to read the page after it; a null `next` means there are no more.")).add(_effect_platform.HttpApiEndpoint.post("start", "/evals.start").setPayload(PublicStartEvalRequest).addSuccess(require_evals.StartedEval).annotate(_effect_platform.OpenApi.Summary, "Start an eval run").annotate(_effect_platform.OpenApi.Description, `Starts the grid and returns its id while trials continue in the background. ${require_evals.PROFILE_HARNESS_RULE}`)).add(_effect_platform.HttpApiEndpoint.post("get", "/evals.get").setPayload(EvalRunRequest).addSuccess(require_evals.EvalRun).annotate(_effect_platform.OpenApi.Summary, "Get an eval run")).add(_effect_platform.HttpApiEndpoint.post("cellHistory", "/evals.cellHistory").setPayload(EvalCellRequest).addSuccess(effect.Schema.Array(require_evals.EvalCellHistoryEntry)).annotate(_effect_platform.OpenApi.Summary, "List a cell's history").annotate(_effect_platform.OpenApi.Description, "Returns the 20 most recent results.")).add(_effect_platform.HttpApiEndpoint.post("rerunCell", "/evals.rerunCell").setPayload(effect.Schema.extend(EvalRunRequest, effect.Schema.extend(EvalCellRequest, require_evals.RerunCellRequest))).addSuccess(require_evals.StartedEval).annotate(_effect_platform.OpenApi.Summary, "Rerun one cell")).add(_effect_platform.HttpApiEndpoint.post("models", "/evals.models").setPayload(EvalModelsRequest).addSuccess(require_evals.ModelCatalogue).annotate(_effect_platform.OpenApi.Summary, "List models available to the harness").annotate(_effect_platform.OpenApi.Description, "The command harness has no catalogue of its own, so its list is empty: the model is whatever the profile's run command reads from ANPORD_MODEL.")).addError(BadRequest).addError(Conflict).addError(Forbidden).addError(NotFound).middleware(ApiKeyAuthentication).annotate(_effect_platform.OpenApi.Title, "Evals").annotate(_effect_platform.OpenApi.Description, "Run cases across harness, model, and sandbox combinations and compare the results with their baselines.") {};
|
|
182
|
-
//#endregion
|
|
183
96
|
//#region ../schema/src/public/requests.ts
|
|
184
97
|
const GetPromptRequest = effect.Schema.Struct({
|
|
185
98
|
channel: effect.Schema.optional(ChannelName),
|
|
@@ -285,10 +198,10 @@ const PromptList = effect.Schema.Struct({ data: effect.Schema.Array(PublicPrompt
|
|
|
285
198
|
});
|
|
286
199
|
//#endregion
|
|
287
200
|
//#region ../schema/src/public/prompts-api.ts
|
|
288
|
-
var PublicPromptsGroup = class extends _effect_platform.HttpApiGroup.make("prompts").add(_effect_platform.HttpApiEndpoint.post("get", "/prompts.get").setPayload(GetPromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Resolve a prompt").annotate(_effect_platform.OpenApi.Description, "Returns the content a caller should send to a model. With no selector this follows the organization's default channel.")).add(_effect_platform.HttpApiEndpoint.post("list", "/prompts.list").setPayload(ListPromptsRequest).addSuccess(PromptList).annotate(_effect_platform.OpenApi.Summary, "List prompts").annotate(_effect_platform.OpenApi.Description, "Up to 100 prompts in the organization, without content.")).add(_effect_platform.HttpApiEndpoint.post("create", "/prompts.create").setPayload(CreatePromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Create a prompt").annotate(_effect_platform.OpenApi.Description, "Creates the prompt and its first version in one call.")).add(_effect_platform.HttpApiEndpoint.post("update", "/prompts.update").setPayload(UpdatePromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Add a version").annotate(_effect_platform.OpenApi.Description, "Content is versioned, so updating a prompt appends a version rather than overwriting one. Earlier versions stay readable.")).add(_effect_platform.HttpApiEndpoint.post("promote", "/prompts.promote").setPayload(PromotePromptRequest).addSuccess(Ok).annotate(_effect_platform.OpenApi.Summary, "Promote a version to a channel").annotate(_effect_platform.OpenApi.Description, "Points a channel, such as production, at a version. This is how a version goes live without callers changing anything.")).addError(BadRequest).addError(Forbidden).addError(Conflict).addError(NotFound).middleware(ApiKeyAuthentication).annotate(_effect_platform.OpenApi.Title, "Prompts").annotate(_effect_platform.OpenApi.Description, "Read and write prompts. Content is versioned, so writes append rather than overwrite, and channels decide which version callers receive.") {};
|
|
201
|
+
var PublicPromptsGroup = class extends _effect_platform.HttpApiGroup.make("prompts").add(_effect_platform.HttpApiEndpoint.post("get", "/prompts.get").setPayload(GetPromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Resolve a prompt").annotate(_effect_platform.OpenApi.Description, "Returns the content a caller should send to a model. With no selector this follows the organization's default channel.")).add(_effect_platform.HttpApiEndpoint.post("list", "/prompts.list").setPayload(ListPromptsRequest).addSuccess(PromptList).annotate(_effect_platform.OpenApi.Summary, "List prompts").annotate(_effect_platform.OpenApi.Description, "Up to 100 prompts in the organization, without content.")).add(_effect_platform.HttpApiEndpoint.post("create", "/prompts.create").setPayload(CreatePromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Create a prompt").annotate(_effect_platform.OpenApi.Description, "Creates the prompt and its first version in one call.")).add(_effect_platform.HttpApiEndpoint.post("update", "/prompts.update").setPayload(UpdatePromptRequest).addSuccess(PublicPromptWithVersions).annotate(_effect_platform.OpenApi.Summary, "Add a version").annotate(_effect_platform.OpenApi.Description, "Content is versioned, so updating a prompt appends a version rather than overwriting one. Earlier versions stay readable.")).add(_effect_platform.HttpApiEndpoint.post("promote", "/prompts.promote").setPayload(PromotePromptRequest).addSuccess(Ok).annotate(_effect_platform.OpenApi.Summary, "Promote a version to a channel").annotate(_effect_platform.OpenApi.Description, "Points a channel, such as production, at a version. This is how a version goes live without callers changing anything.")).addError(require_evals_api.BadRequest).addError(require_evals_api.Forbidden).addError(require_evals_api.Conflict).addError(require_evals_api.NotFound).middleware(require_evals_api.ApiKeyAuthentication).annotate(_effect_platform.OpenApi.Title, "Prompts").annotate(_effect_platform.OpenApi.Description, "Read and write prompts. Content is versioned, so writes append rather than overwrite, and channels decide which version callers receive.") {};
|
|
289
202
|
//#endregion
|
|
290
203
|
//#region ../schema/src/public/api.ts
|
|
291
|
-
var PublicApi = class extends _effect_platform.HttpApi.make("anpord-public").add(PublicEvalsGroup).add(PublicPromptsGroup).prefix("/v1").annotate(_effect_platform.OpenApi.Title, "Anpord API").annotate(_effect_platform.OpenApi.Version, "1.0.0").annotate(_effect_platform.OpenApi.Description, "Run agent evals and manage prompts. Every endpoint takes a JSON body over POST and authenticates with a bearer API key.").annotate(_effect_platform.OpenApi.Servers, [{
|
|
204
|
+
var PublicApi = class extends _effect_platform.HttpApi.make("anpord-public").add(require_evals_api.PublicEvalsGroup).add(PublicPromptsGroup).prefix("/v1").annotate(_effect_platform.OpenApi.Title, "Anpord API").annotate(_effect_platform.OpenApi.Version, "1.0.0").annotate(_effect_platform.OpenApi.Description, "Run agent evals and manage prompts. Every endpoint takes a JSON body over POST and authenticates with a bearer API key.").annotate(_effect_platform.OpenApi.Servers, [{
|
|
292
205
|
description: "Production",
|
|
293
206
|
url: "https://api.anpord.com"
|
|
294
207
|
}]) {};
|