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

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
@@ -9,7 +9,7 @@ Reusable AWS CDK constructs for running an [Evident](https://evident.run) agent
9
9
  `desiredCount 0`, and an HMAC-authenticated waker Lambda scales it back up on the next
10
10
  message. You pay for the time the agent is actually working.
11
11
  - **`EvidentMicrovmConstruct`** — a per-session AWS Lambda MicroVM that boots on demand
12
- and suspends between messages. Installing the `@dev` tag of this package is all you
12
+ and suspends between messages. Installing this package is all you
13
13
  need: the image build context ships inside it (see [The MicroVM image](#the-microvm-image)
14
14
  below), so there is no checkout of the source repository involved. See
15
15
  [the AWS runner doc](https://evident.run/docs/aws-runner) for the full picture of both
@@ -76,8 +76,8 @@ agent.selfStopRoleArn;
76
76
  agent.replicaPrefix;
77
77
  ```
78
78
 
79
- For a complete working example, see [`GETTING-STARTED.md`](./GETTING-STARTED.md) in this
80
- package — it is the construct's own dogfooding consumer.
79
+ For a complete working example, see `GETTING-STARTED.md` (not published to npm); it is the
80
+ construct's own dogfooding consumer.
81
81
 
82
82
  ## Props
83
83
 
@@ -97,7 +97,7 @@ package — it is the construct's own dogfooding consumer.
97
97
  | `cluster`, `securityGroup`, `taskRole`, `logGroup`, `replicaBucket` | interfaces | Shared infra you create and pass in. |
98
98
  | `image` | `ecs.ContainerImage` | Your runner image. |
99
99
  | `agentSecret`, `wakerSecret` | `secretsmanager.ISecret` | Any Secrets Manager secret. |
100
- | `availableSecretKeys` | `Set<string>` | Keys present in the agent secret. Every listed key is injected; `EVIDENT_AGENT_KEY` and `GH_TOKEN` are also injected for compatibility with adopters that do not enumerate their secret. |
100
+ | `availableSecretKeys` | `Set<string>` | Keys present in the agent secret. Every listed key is injected; `EVIDENT_RUNNER_KEY` and `EVIDENT_AGENT_KEY` are injected from the `EVIDENT_AGENT_KEY` field, and `GH_TOKEN` is also injected for adopters that do not enumerate their secret. |
101
101
 
102
102
  ### Two deliberate "no default" choices
103
103
 
@@ -183,9 +183,9 @@ all of them, so never put a secret in this prop.
183
183
 
184
184
  ## Status / limitations
185
185
 
186
- - **Published to npm** as `@evident-ai/runner-cdk` (MIT). Install the `@dev` tag —
187
- `npm install @evident-ai/runner-cdk@dev` (or `pnpm add`/`yarn add`); no checkout of
188
- this repo is required. It builds to a self-contained `dist/` (`pnpm --filter
186
+ - **Published to npm** as `@evident-ai/runner-cdk` (MIT). `npm install
187
+ @evident-ai/runner-cdk` (or `pnpm add`/`yarn add`); no checkout of this repo is
188
+ required. It builds to a self-contained `dist/` (`pnpm --filter
189
189
  @evident-ai/runner-cdk build`) with no `workspace:`/`@evident/*` runtime dependency.
190
190
  Evident's own consumer still consumes it as a `workspace:*` dependency for dogfooding.
191
191
  - **AWS/ECS-specific.** Non-AWS clouds are an open question on the epic, not a supported
@@ -61,10 +61,12 @@ export type EvidentScaleToZeroConstructProps = {
61
61
  replicaBucket: s3.IBucket;
62
62
  image: ecs.ContainerImage;
63
63
  /**
64
- * Container secrets. `availableSecretKeys` are injected by name; EVIDENT_AGENT_KEY
65
- * and GH_TOKEN remain available to external adopters that do not enumerate keys.
64
+ * Container secrets. `availableSecretKeys` are injected by name; both identity
65
+ * environment names and GH_TOKEN remain available to external adopters that do not
66
+ * enumerate keys.
66
67
  *
67
- * `agentSecret` always supplies EVIDENT_AGENT_KEY. When `capabilitySecret` is
68
+ * `agentSecret` always supplies EVIDENT_RUNNER_KEY and EVIDENT_AGENT_KEY from its
69
+ * `EVIDENT_AGENT_KEY` field. When `capabilitySecret` is
68
70
  * ALSO given (#1868 WI-2), every capability key (GH_TOKEN included) is injected
69
71
  * from THAT secret instead, and `availableSecretKeys` is ignored — the two
70
72
  * deploy targets (this one and the MicroVM stack) then read the same
@@ -98,7 +98,8 @@ class EvidentScaleToZeroConstruct extends constructs_1.Construct {
98
98
  OPENCODE_PORT: '4096',
99
99
  HOME: '/home/runner',
100
100
  // Selects the Evident environment (passed to `evident run` as
101
- // --endpoint / --tunnel). The agent is resolved from EVIDENT_AGENT_KEY.
101
+ // --endpoint / --tunnel). The runner is resolved from EVIDENT_RUNNER_KEY,
102
+ // falling back to EVIDENT_AGENT_KEY.
102
103
  EVIDENT_API_URL: evidentApiUrl,
103
104
  EVIDENT_TUNNEL_URL: evidentTunnelUrl,
104
105
  // Litestream replica target (read by runner/synchroniser, which
@@ -126,12 +127,7 @@ class EvidentScaleToZeroConstruct extends constructs_1.Construct {
126
127
  // LAST so an adopter can override any key above if they ever need to.
127
128
  ...extraEnvironment,
128
129
  };
129
- const secrets = {
130
- // Identifies the runner to Evident. Always agentSecret — capabilitySecret
131
- // never carries this key (#1868 WI-2: the two are a deliberate split, not
132
- // a duplication of the same data).
133
- EVIDENT_AGENT_KEY: ecs.Secret.fromSecretsManager(agentSecret, 'EVIDENT_AGENT_KEY'),
134
- };
130
+ const secrets = {};
135
131
  if (capabilitySecret !== undefined) {
136
132
  for (const key of capabilityKeys ?? new Set()) {
137
133
  secrets[key] = ecs.Secret.fromSecretsManager(capabilitySecret, key);
@@ -146,6 +142,10 @@ class EvidentScaleToZeroConstruct extends constructs_1.Construct {
146
142
  secrets[key] = ecs.Secret.fromSecretsManager(agentSecret, key);
147
143
  }
148
144
  }
145
+ // Both environment names identify the runner and resolve from the identity
146
+ // field in agentSecret, never from capabilitySecret.
147
+ secrets.EVIDENT_AGENT_KEY = ecs.Secret.fromSecretsManager(agentSecret, 'EVIDENT_AGENT_KEY');
148
+ secrets.EVIDENT_RUNNER_KEY = ecs.Secret.fromSecretsManager(agentSecret, 'EVIDENT_AGENT_KEY');
149
149
  // Container name pinned to "Runner": operator `execute-command --container
150
150
  // Runner` examples rely on it.
151
151
  taskDefinition.addContainer('Runner', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evident-ai/runner-cdk",
3
- "version": "3.5.1-dev.bbaa769",
3
+ "version": "3.5.1",
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",