@evident-ai/runner-cdk 3.4.1-dev.fb92ede → 3.5.1-dev.bbaa769

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 CHANGED
@@ -161,12 +161,12 @@ new EvidentMicrovmConstruct(this, 'Runner', {
161
161
 
162
162
  Pass `overlayDir` to add deployment-specific build steps to the staged image. The
163
163
  directory provides `setup-root` for root-owned installs and `setup-workspace` for
164
- workspace build warm-up after dependency installation. See the [MicroVM image
164
+ dependency installation and workspace build warm-up. See the [MicroVM image
165
165
  README](../../runner/docker-images/microvm/README.md) for the full overlay contract.
166
166
 
167
- Your repo does not have to be a pnpm workspace. If it commits a `pnpm-lock.yaml` the image
168
- pre-installs dependencies at build time (a faster first boot); if not, that step is skipped
169
- and the agent installs on first use.
167
+ The image bakes your repository checked out but not installed and makes no assumptions about
168
+ its package manager. To speed up first boot, install dependencies from your overlay's
169
+ `setup-workspace`; otherwise, the agent installs them on first use.
170
170
 
171
171
  | MicroVM prop | Omitted behavior |
172
172
  | --- | --- |
@@ -66,8 +66,8 @@ function isShallowRepository(repositoryPath) {
66
66
  }
67
67
  }
68
68
  /**
69
- * Clones the caller's repository into the build context, so the Dockerfile can
70
- * ship the workspace already installed.
69
+ * Clones the caller's repository into the build context for the Dockerfile to
70
+ * bake as a checked-out but uninstalled workspace.
71
71
  *
72
72
  * `file://` rather than a plain path: a path triggers git's local-clone
73
73
  * optimisation, which copies the whole object store — every branch and worktree
@@ -102,9 +102,6 @@ function stageRepository(repositoryPath, destination, originUrl) {
102
102
  (0, node_fs_1.rmSync)(path.join(destination, '.git', 'index'), { force: true });
103
103
  (0, node_fs_1.rmSync)(path.join(destination, '.git', 'logs'), { recursive: true, force: true });
104
104
  console.log(`[stage] repo ${git(['rev-parse', 'HEAD'], destination)}`);
105
- if (!(0, node_fs_1.existsSync)(path.join(destination, 'pnpm-lock.yaml'))) {
106
- console.log(`[stage] ${repositoryPath} has no pnpm-lock.yaml — the image build will skip dependency installation`);
107
- }
108
105
  }
109
106
  function stageScriptDirectory(source, destination) {
110
107
  (0, node_fs_1.mkdirSync)(destination);
@@ -1,9 +1,9 @@
1
1
  # Generic MicroVM runner image
2
2
  #
3
3
  # Built for linux/arm64 (Lambda MicroVMs run on Graviton only) and with ONE
4
- # process: the hook server. `overlay/setup-root` and
5
- # `overlay/setup-workspace` are the extension point for deployment-specific
6
- # packages and build warm-up.
4
+ # process: the hook server. `overlay/setup-root` and `overlay/setup-workspace`
5
+ # are the extension point for deployment-specific packages, dependency
6
+ # installation and build warm-up.
7
7
  #
8
8
  # THE BOOT SPLIT — the rule that governs everything below. AWS snapshots this
9
9
  # image ONCE at build and every MicroVM resumes from that same snapshot, so
@@ -130,8 +130,8 @@ COPY hook-server.js /usr/local/lib/evident/hook-server.js
130
130
  COPY hooks /etc/evident/hooks
131
131
 
132
132
  # Workspace: the repository the agent works on, baked in. A resumed VM must be
133
- # useful in milliseconds, and a clone + install costs minutes — so both happen
134
- # here, and the image is deliberately large in exchange.
133
+ # useful in milliseconds, while a clone costs minutes — so the checkout happens
134
+ # here; dependency installation and build warm-up belong to the deployment overlay.
135
135
  #
136
136
  # This does not weaken the boot split: source, git history and node_modules are
137
137
  # neither secret nor per-VM-unique, so sharing them across every VM from this
@@ -171,30 +171,11 @@ USER runner
171
171
  # `runner` (not root) so the rebuilt index is runner-owned and writable later.
172
172
  RUN git reset --quiet
173
173
 
174
- # Dependencies for the baked workspace. Install as the runner user so
175
- # node_modules is writable by the agent's own later installs.
174
+ # Deployment-specific dependency installation and build work belongs here. This runs
175
+ # as `runner` in `${WORKSPACE}`, so everything it writes is agent-writable.
176
176
  #
177
- # ONE layer on purpose: pnpm hard-links node_modules into its content-addressed
178
- # store (which it puts at ${WORKSPACE}/.pnpm-store, gitignored), and hard links
179
- # only survive within a single layer — split in two and the image carries both
180
- # copies. `--frozen-lockfile` because the committed lockfile is the whole reason
181
- # this is bakeable at all: installing against anything else would bake a
182
- # dependency set nobody committed.
183
- #
184
- # Guarded on a committed `pnpm-lock.yaml` so `microvm:repositoryPath` can point
185
- # at a repository that is not a pnpm workspace at all: it is baked uninstalled
186
- # instead of failing the build, and the agent installs on first use.
187
- #
188
- # Anything beyond dependency installation is deployment-specific and belongs in
189
- # `overlay/setup-workspace`.
190
- RUN if [ -f pnpm-lock.yaml ]; then \
191
- pnpm install --frozen-lockfile; \
192
- else \
193
- echo "[workspace-prep] no pnpm-lock.yaml in the baked repository — skipping the dependency install; the agent installs on first use."; \
194
- fi
195
-
196
- # Runs as `runner` in `${WORKSPACE}`, after the install, so a project's build
197
- # output is writable by the agent.
177
+ # Keep the overlay's install and build in one layer: pnpm hard-links `node_modules`
178
+ # into its content-addressed store, and hard links only survive within a single layer.
198
179
  RUN /etc/evident/overlay/setup-workspace
199
180
 
200
181
  # Port AWS calls the MicroVM hooks on.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evident-ai/runner-cdk",
3
- "version": "3.4.1-dev.fb92ede",
3
+ "version": "3.5.1-dev.bbaa769",
4
4
  "description": "Reusable CDK constructs for an Evident agent runner: a single scale-to-zero Fargate runner (task + service + per-agent self-stop role + waker Lambda), or a per-session AWS Lambda MicroVM that boots on demand and suspends between messages. Instantiate once per agent from your own stack.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "scripts": {
17
- "build": "pnpm run build-bundled-deps && ts-node scripts/build.ts",
17
+ "build": "pnpm run build-bundled-deps && ts-node scripts/build.ts && node -e 'const m=require(\"./package.json\").main; if (!require(\"node:fs\").existsSync(m)) { console.error(`build produced no ${m}`); process.exit(1); }'",
18
18
  "//build-bundled-deps": "scripts/build.ts esbuild-bundles runner/docker-images/microvm/hook-server.ts, which imports @evident-ai/lambda-microvm-runtime by its built `main`. @evident-ai/lambda-microvm-cdk is a workspace:* devDependency whose types resolve through its own dist/, so tsc --project tsconfig.build.json cannot compile src/microvm/{shapes,construct}.ts without it. Chained into `build` rather than left to turbo's `^build` because callers outside turbo invoke `pnpm --filter @evident-ai/runner-cdk build` directly, which bypasses turbo entirely.",
19
19
  "build-bundled-deps": "pnpm --filter @evident-ai/lambda-microvm-cdk build && pnpm --filter @evident-ai/lambda-microvm-runtime build",
20
20
  "typecheck": "tsc --noEmit",