anpord 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.cjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.cjs";
2
2
  //#region src/mock-api/context.d.ts
3
3
  declare const apiContext: {
4
4
  url: (name: string) => Promise<string>;
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.mjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.mjs";
2
2
  //#region src/mock-api/context.d.ts
3
3
  declare const apiContext: {
4
4
  url: (name: string) => Promise<string>;
@@ -58,6 +58,14 @@ declare const ApiCall_base: Schema.Class<ApiCall, {
58
58
  }>>>;
59
59
  }>, never, {
60
60
  readonly api: string;
61
+ } & {
62
+ readonly status: number;
63
+ } & {
64
+ readonly startedAt: number;
65
+ } & {
66
+ readonly path: string;
67
+ } & {
68
+ readonly index: number;
61
69
  } & {
62
70
  readonly output: {
63
71
  readonly text: string;
@@ -72,14 +80,6 @@ declare const ApiCall_base: Schema.Class<ApiCall, {
72
80
  readonly format: "text" | "json";
73
81
  readonly state: "captured" | "disabled" | "unavailable";
74
82
  };
75
- } & {
76
- readonly status: number;
77
- } & {
78
- readonly startedAt: number;
79
- } & {
80
- readonly path: string;
81
- } & {
82
- readonly index: number;
83
83
  } & {
84
84
  readonly error: string | null;
85
85
  } & {
@@ -58,6 +58,14 @@ declare const ApiCall_base: Schema.Class<ApiCall, {
58
58
  }>>>;
59
59
  }>, never, {
60
60
  readonly api: string;
61
+ } & {
62
+ readonly status: number;
63
+ } & {
64
+ readonly startedAt: number;
65
+ } & {
66
+ readonly path: string;
67
+ } & {
68
+ readonly index: number;
61
69
  } & {
62
70
  readonly output: {
63
71
  readonly text: string;
@@ -72,14 +80,6 @@ declare const ApiCall_base: Schema.Class<ApiCall, {
72
80
  readonly format: "text" | "json";
73
81
  readonly state: "captured" | "disabled" | "unavailable";
74
82
  };
75
- } & {
76
- readonly status: number;
77
- } & {
78
- readonly startedAt: number;
79
- } & {
80
- readonly path: string;
81
- } & {
82
- readonly index: number;
83
83
  } & {
84
84
  readonly error: string | null;
85
85
  } & {
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.cjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.cjs";
2
2
  import { t as ApiDefinition } from "./define-NZvmQuIv.cjs";
3
3
  //#region src/mock-api/runtime.d.ts
4
4
  declare const withApi: <A>({ api, run }: {
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.mjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.mjs";
2
2
  import { t as ApiDefinition } from "./define-NZvmQuIv.mjs";
3
3
  //#region src/mock-api/runtime.d.ts
4
4
  declare const withApi: <A>({ api, run }: {
package/dist/api.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.cjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.cjs";
2
2
  import { a as endpoint, i as api, n as ApiHandlerContext, r as EndpointDefinition, t as ApiDefinition } from "./define-NZvmQuIv.cjs";
3
3
  import { withApi } from "./api-runtime.cjs";
4
4
  export { type ApiCall, type ApiDefinition, type ApiHandlerContext, type EndpointDefinition, api, endpoint, withApi };
package/dist/api.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ApiCall } from "./api-mocks-B8a93t2t.mjs";
1
+ import { t as ApiCall } from "./api-mocks-ofqP55P_.mjs";
2
2
  import { a as endpoint, i as api, n as ApiHandlerContext, r as EndpointDefinition, t as ApiDefinition } from "./define-NZvmQuIv.mjs";
3
3
  import { withApi } from "./api-runtime.mjs";
4
4
  export { type ApiCall, type ApiDefinition, type ApiHandlerContext, type EndpointDefinition, api, endpoint, withApi };
package/dist/bin.cjs CHANGED
@@ -19,7 +19,7 @@ let yaml = require("yaml");
19
19
  let node_crypto = require("node:crypto");
20
20
  let node_child_process = require("node:child_process");
21
21
  //#region package.json
22
- var version$1 = "0.1.22";
22
+ var version$1 = "0.1.23";
23
23
  //#endregion
24
24
  //#region ../template/src/extract.ts
25
25
  /** Reads escapes too, so text the renderer leaves literal is never reported as
@@ -4485,7 +4485,7 @@ const SandboxProviderLive = effect.Layer.effect(SandboxProvider, effect.Effect.g
4485
4485
  //#endregion
4486
4486
  //#region ../eval/src/local-layer.ts
4487
4487
  const LocalAdaptersLive = effect.Layer.effect(SandboxAdapters, effect.Effect.map(effect.Effect.cached(makeLocalAdapter), (local) => SandboxAdapters.of({ resolve: (provider) => provider === "local" ? local : effect.Effect.dieMessage(`a local run cannot open a ${provider} sandbox`) })));
4488
- const evalLocalWith = (credentials) => LocalTrialsLive.pipe(effect.Layer.provide(AgentTrialJudgedLive.pipe(effect.Layer.provide(AgentTrialLive.pipe(effect.Layer.provide(ScorerChecksLive.pipe(effect.Layer.provide(ScorerGroundTruthLive))), effect.Layer.provide(SuspenderSleeping), effect.Layer.provide(SimulatedUserLive.pipe(effect.Layer.provide(_effect_platform.FetchHttpClient.layer))))), effect.Layer.provide(JudgeModelLive.pipe(effect.Layer.provide(_effect_platform.FetchHttpClient.layer))), effect.Layer.provide(effect.Layer.mergeAll(HarnessesLive, HarnessVersionsLive)))), effect.Layer.provide(credentials), effect.Layer.provide(SandboxProviderLive.pipe(effect.Layer.provide(LocalAdaptersLive))));
4488
+ const evalLocalWith = (credentials) => LocalTrialsLive.pipe(effect.Layer.provide(AgentTrialJudgedLive.pipe(effect.Layer.provide(AgentTrialLive.pipe(effect.Layer.provide(ScorerChecksLive.pipe(effect.Layer.provide(ScorerGroundTruthLive))), effect.Layer.provide(SuspenderSleeping), effect.Layer.provide(SimulatedUserLive.pipe(effect.Layer.provide(_effect_platform.FetchHttpClient.layer))))), effect.Layer.provide(JudgeModelLive.pipe(effect.Layer.provide(_effect_platform.FetchHttpClient.layer))), effect.Layer.provide(effect.Layer.mergeAll(HarnessesLive, HarnessVersionsLive)))), effect.Layer.provide(credentials), effect.Layer.provide(SandboxProviderLive.pipe(effect.Layer.provide(LocalAdaptersLive))), effect.Layer.provideMerge(HarnessVersionsLive));
4489
4489
  const EvalLocalLive = evalLocalWith(CredentialResolverFromEnv);
4490
4490
  //#endregion
4491
4491
  //#region src/cli/local-env.ts
@@ -4514,19 +4514,21 @@ const localEnv = (directory) => Object.assign({}, ...FILES.map((file) => read(di
4514
4514
  //#region src/cli/eval-local.ts
4515
4515
  const runLocally = (request, options = {}) => effect.Effect.gen(function* () {
4516
4516
  const trials = yield* LocalTrials;
4517
+ const versions = yield* HarnessVersions;
4517
4518
  const forwarded = localEnv(process.cwd());
4518
4519
  const task = request.tasks[0];
4519
4520
  if (task === void 0) return [];
4521
+ const harnessVersion = yield* versions.version(task.harness);
4520
4522
  return yield* effect.Effect.forEach(request.cases, (subject) => trials.run({
4521
4523
  caseName: subject.name,
4522
4524
  forwarded,
4523
4525
  harness: task.harness,
4524
- harnessVersion: "local",
4526
+ harnessVersion,
4525
4527
  model: task.model,
4526
4528
  prepare: subject.prepare ?? null,
4527
4529
  profile: profileOfRequest(task.profile),
4528
4530
  prompt: request.prompt,
4529
- source: { kind: "empty" },
4531
+ source: subject.source ?? { kind: "empty" },
4530
4532
  user: subject.user ?? null,
4531
4533
  validator: subject.validator ?? null,
4532
4534
  verifyCommand: subject.verify
@@ -4822,20 +4824,19 @@ const recordedLocally = (file) => effect.Effect.gen(function* () {
4822
4824
  trigger
4823
4825
  } });
4824
4826
  yield* reportStarted(file, started.id);
4827
+ yield* effect.Effect.addFinalizer(() => api.evals.finishRun({ payload: { id: started.id } }).pipe(effect.Effect.ignore));
4825
4828
  const leased = yield* api.evals.credentials({ payload: {
4826
4829
  harness: payload.tasks[0]?.harness ?? "codex",
4827
4830
  id: started.id
4828
4831
  } }).pipe(effect.Effect.map((lease) => lease.values), effect.Effect.catchAll(() => effect.Effect.succeed(void 0)));
4829
- const cases = yield* runLocally(payload, {
4832
+ return yield* runLocally(payload, {
4830
4833
  credentials: leased,
4831
4834
  onTrial: (trial) => api.evals.reportTrial({ payload: {
4832
4835
  id: started.id,
4833
4836
  trial
4834
4837
  } }).pipe(effect.Effect.ignore)
4835
4838
  });
4836
- yield* api.evals.finishRun({ payload: { id: started.id } }).pipe(effect.Effect.ignore);
4837
- return cases;
4838
- }).pipe(effect.Effect.provide(require_config.ClientLayer));
4839
+ }).pipe(effect.Effect.scoped, effect.Effect.provide(require_config.ClientLayer));
4839
4840
  const runOneEvalLocally = (file) => require_config.apiKeyConfig.pipe(effect.Effect.matchEffect({
4840
4841
  onFailure: () => require_compiler.compileEvalEffect(file).pipe(effect.Effect.flatMap((payload) => runLocally(payload))),
4841
4842
  onSuccess: () => recordedLocally(file)
package/dist/bin.mjs CHANGED
@@ -19,7 +19,7 @@ import { parseDocument } from "yaml";
19
19
  import { createHash } from "node:crypto";
20
20
  import { spawn } from "node:child_process";
21
21
  //#region package.json
22
- var version$1 = "0.1.22";
22
+ var version$1 = "0.1.23";
23
23
  //#endregion
24
24
  //#region ../template/src/extract.ts
25
25
  /** Reads escapes too, so text the renderer leaves literal is never reported as
@@ -4485,7 +4485,7 @@ const SandboxProviderLive = Layer.effect(SandboxProvider, Effect.gen(function* (
4485
4485
  //#endregion
4486
4486
  //#region ../eval/src/local-layer.ts
4487
4487
  const LocalAdaptersLive = Layer.effect(SandboxAdapters, Effect.map(Effect.cached(makeLocalAdapter), (local) => SandboxAdapters.of({ resolve: (provider) => provider === "local" ? local : Effect.dieMessage(`a local run cannot open a ${provider} sandbox`) })));
4488
- const evalLocalWith = (credentials) => LocalTrialsLive.pipe(Layer.provide(AgentTrialJudgedLive.pipe(Layer.provide(AgentTrialLive.pipe(Layer.provide(ScorerChecksLive.pipe(Layer.provide(ScorerGroundTruthLive))), Layer.provide(SuspenderSleeping), Layer.provide(SimulatedUserLive.pipe(Layer.provide(FetchHttpClient.layer))))), Layer.provide(JudgeModelLive.pipe(Layer.provide(FetchHttpClient.layer))), Layer.provide(Layer.mergeAll(HarnessesLive, HarnessVersionsLive)))), Layer.provide(credentials), Layer.provide(SandboxProviderLive.pipe(Layer.provide(LocalAdaptersLive))));
4488
+ const evalLocalWith = (credentials) => LocalTrialsLive.pipe(Layer.provide(AgentTrialJudgedLive.pipe(Layer.provide(AgentTrialLive.pipe(Layer.provide(ScorerChecksLive.pipe(Layer.provide(ScorerGroundTruthLive))), Layer.provide(SuspenderSleeping), Layer.provide(SimulatedUserLive.pipe(Layer.provide(FetchHttpClient.layer))))), Layer.provide(JudgeModelLive.pipe(Layer.provide(FetchHttpClient.layer))), Layer.provide(Layer.mergeAll(HarnessesLive, HarnessVersionsLive)))), Layer.provide(credentials), Layer.provide(SandboxProviderLive.pipe(Layer.provide(LocalAdaptersLive))), Layer.provideMerge(HarnessVersionsLive));
4489
4489
  const EvalLocalLive = evalLocalWith(CredentialResolverFromEnv);
4490
4490
  //#endregion
4491
4491
  //#region src/cli/local-env.ts
@@ -4514,19 +4514,21 @@ const localEnv = (directory) => Object.assign({}, ...FILES.map((file) => read(di
4514
4514
  //#region src/cli/eval-local.ts
4515
4515
  const runLocally = (request, options = {}) => Effect.gen(function* () {
4516
4516
  const trials = yield* LocalTrials;
4517
+ const versions = yield* HarnessVersions;
4517
4518
  const forwarded = localEnv(process.cwd());
4518
4519
  const task = request.tasks[0];
4519
4520
  if (task === void 0) return [];
4521
+ const harnessVersion = yield* versions.version(task.harness);
4520
4522
  return yield* Effect.forEach(request.cases, (subject) => trials.run({
4521
4523
  caseName: subject.name,
4522
4524
  forwarded,
4523
4525
  harness: task.harness,
4524
- harnessVersion: "local",
4526
+ harnessVersion,
4525
4527
  model: task.model,
4526
4528
  prepare: subject.prepare ?? null,
4527
4529
  profile: profileOfRequest(task.profile),
4528
4530
  prompt: request.prompt,
4529
- source: { kind: "empty" },
4531
+ source: subject.source ?? { kind: "empty" },
4530
4532
  user: subject.user ?? null,
4531
4533
  validator: subject.validator ?? null,
4532
4534
  verifyCommand: subject.verify
@@ -4822,20 +4824,19 @@ const recordedLocally = (file) => Effect.gen(function* () {
4822
4824
  trigger
4823
4825
  } });
4824
4826
  yield* reportStarted(file, started.id);
4827
+ yield* Effect.addFinalizer(() => api.evals.finishRun({ payload: { id: started.id } }).pipe(Effect.ignore));
4825
4828
  const leased = yield* api.evals.credentials({ payload: {
4826
4829
  harness: payload.tasks[0]?.harness ?? "codex",
4827
4830
  id: started.id
4828
4831
  } }).pipe(Effect.map((lease) => lease.values), Effect.catchAll(() => Effect.succeed(void 0)));
4829
- const cases = yield* runLocally(payload, {
4832
+ return yield* runLocally(payload, {
4830
4833
  credentials: leased,
4831
4834
  onTrial: (trial) => api.evals.reportTrial({ payload: {
4832
4835
  id: started.id,
4833
4836
  trial
4834
4837
  } }).pipe(Effect.ignore)
4835
4838
  });
4836
- yield* api.evals.finishRun({ payload: { id: started.id } }).pipe(Effect.ignore);
4837
- return cases;
4838
- }).pipe(Effect.provide(ClientLayer));
4839
+ }).pipe(Effect.scoped, Effect.provide(ClientLayer));
4839
4840
  const runOneEvalLocally = (file) => apiKeyConfig.pipe(Effect.matchEffect({
4840
4841
  onFailure: () => compileEvalEffect(file).pipe(Effect.flatMap((payload) => runLocally(payload))),
4841
4842
  onSuccess: () => recordedLocally(file)