@workos/quickstudy 0.0.1 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/quickstudy",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "An open-source, company-agnostic eval harness for measuring whether coding agents can complete real integration tasks, across an agent x feature x framework x surface matrix.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -5,7 +5,11 @@ export const EMBEDDED_BUILD_INFO: {
5
5
  dirty: boolean | null;
6
6
  sourceHash: string | null;
7
7
  } = {
8
- version: "0.1.0",
8
+ // release-please's generic updater bumps this semver on the release PR
9
+ // (the `x-release-please-version` marker anchors the replacement). It is
10
+ // restored as-is after a binary build (scripts/build-binary.ts), so the
11
+ // committed source `--version` stays in lockstep with package.json.
12
+ version: "0.1.0", // x-release-please-version
9
13
  revision: null,
10
14
  dirty: null,
11
15
  sourceHash: null,
@@ -93,6 +93,21 @@ async function mustDocker(args: string[], opts: { timeoutMs?: number; stdin?: st
93
93
  return result;
94
94
  }
95
95
 
96
+ /**
97
+ * `docker rm -f` stderr that still means "the container is gone": it was
98
+ * already removed, or another caller's removal is in flight (a deadline kill
99
+ * racing the attempt's final teardown) and the daemon will finish that one.
100
+ */
101
+ export const CONTAINER_GONE_STDERR = /no such container|already in progress/i;
102
+
103
+ /** `docker rm -f <id>`, idempotent per CONTAINER_GONE_STDERR. */
104
+ async function removeContainer(id: string): Promise<void> {
105
+ const result = await runDocker(["rm", "-f", id]);
106
+ if (result.exitCode !== 0 && !CONTAINER_GONE_STDERR.test(result.stderr)) {
107
+ throw new DockerError(["rm", "-f", id], result.exitCode, result.stderr);
108
+ }
109
+ }
110
+
96
111
  /** Preflight: is a Docker daemon reachable at all? */
97
112
  export async function dockerDaemonReachable(): Promise<boolean> {
98
113
  const result = await runDocker(["version", "--format", "{{.Server.Version}}"], { timeoutMs: 10_000 });
@@ -277,13 +292,7 @@ export async function createAttemptContainer(opts: CreateAttemptContainerOptions
277
292
  await rm(scratch, { recursive: true, force: true });
278
293
  }
279
294
  },
280
- teardown: async () => {
281
- const result = await runDocker(["rm", "-f", id]);
282
- // Idempotent: an already-removed container is success, not an error.
283
- if (result.exitCode !== 0 && !/no such container/i.test(result.stderr)) {
284
- throw new DockerError(["rm", "-f", id], result.exitCode, result.stderr);
285
- }
286
- },
295
+ teardown: () => removeContainer(id),
287
296
  };
288
297
 
289
298
  try {
@@ -510,12 +519,7 @@ export async function startEgressSidecar(opts: StartEgressSidecarOptions): Promi
510
519
  const result = await mustDocker(["logs", id]);
511
520
  return result.stdout;
512
521
  },
513
- async teardown() {
514
- const result = await runDocker(["rm", "-f", id]);
515
- if (result.exitCode !== 0 && !/no such container/i.test(result.stderr)) {
516
- throw new DockerError(["rm", "-f", id], result.exitCode, result.stderr);
517
- }
518
- },
522
+ teardown: () => removeContainer(id),
519
523
  };
520
524
  return sidecar;
521
525
  }
@@ -620,12 +624,7 @@ export async function startMcpSidecar(opts: StartMcpSidecarOptions): Promise<Mcp
620
624
  const state = await runDocker(["inspect", "--format", "{{.State.Running}}", id]);
621
625
  return state.exitCode === 0 && state.stdout.trim() === "true";
622
626
  },
623
- async teardown() {
624
- const result = await runDocker(["rm", "-f", id]);
625
- if (result.exitCode !== 0 && !/no such container/i.test(result.stderr)) {
626
- throw new DockerError(["rm", "-f", id], result.exitCode, result.stderr);
627
- }
628
- },
627
+ teardown: () => removeContainer(id),
629
628
  };
630
629
  }
631
630