@replayio/app-building 1.19.0 → 1.20.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/README.md CHANGED
@@ -80,7 +80,7 @@ The agent can also run `list-secrets` to see which secrets are available, and `s
80
80
 
81
81
  | Export | Description |
82
82
  |---|---|
83
- | `ContainerConfig` | `infisical` (required `InfisicalConfig`), optional `projectRoot` (local Docker only), `registry`, `flyToken`/`flyApp` (set both for remote Fly.io), `imageRef`, `webhookUrl`/`webhookSecret`, `detached`, `initialPrompt`, `localPort`, `absorbTasks`. |
83
+ | `ContainerConfig` | `infisical` (required `InfisicalConfig`), optional `projectRoot` (local Docker only), `registry`, `flyToken`/`flyApp` (set both for remote Fly.io), `imageRef`, `webhookUrl`/`webhookSecret`, `detached`, `initialPrompt`, `localPort`, `absorbTasks`, `namePrefix` (default: `"app-building"`). |
84
84
  | `RepoOptions` | Per-invocation git settings: `repoUrl`, `cloneBranch`, `pushBranch`. |
85
85
  | `AgentState` | Returned by `startContainer`. Contains `type`, `containerName`, `port`, `baseUrl`, and Fly-specific fields for remote containers. |
86
86
  | `ContainerRegistry` | Interface for container registry storage. Methods: `log`, `markStopped`, `clearStopped`, `getRecent`, `find`, `findAlive`. |
@@ -27,6 +27,8 @@ export interface ContainerConfig {
27
27
  localPort?: number;
28
28
  /** Absorb task files from other containers at startup. Default: false. */
29
29
  absorbTasks?: boolean;
30
+ /** Container name prefix. Default: "app-building". */
31
+ namePrefix?: string;
30
32
  }
31
33
  export interface RepoOptions {
32
34
  repoUrl: string;
package/dist/container.js CHANGED
@@ -121,7 +121,8 @@ function isRemote(config) {
121
121
  async function startLocalContainer(config, repo) {
122
122
  buildImage(config);
123
123
  const uniqueId = Math.random().toString(36).slice(2, 8);
124
- const containerName = `app-building-${uniqueId}`;
124
+ const prefix = config.namePrefix ?? "app-building";
125
+ const containerName = `${prefix}-${uniqueId}`;
125
126
  const containerPort = 3000;
126
127
  const hostPort = config.localPort ?? findFreePort();
127
128
  const extra = buildExtraEnv(config, containerName);
@@ -195,7 +196,8 @@ async function startRemoteContainerImpl(config, repo) {
195
196
  throw new Error("flyApp is required for remote containers");
196
197
  const imageRef = config.imageRef ?? getImageRef();
197
198
  const uniqueId = Math.random().toString(36).slice(2, 8);
198
- const machineName = `app-building-${uniqueId}`;
199
+ const prefix = config.namePrefix ?? "app-building";
200
+ const machineName = `${prefix}-${uniqueId}`;
199
201
  const extra = buildExtraEnv(config, machineName);
200
202
  const containerEnv = buildContainerEnv(repo, config.infisical, extra);
201
203
  const existing = await listMachines(config.flyApp, config.flyToken);
@@ -283,6 +285,15 @@ async function stopRemoteContainerImpl(config, state) {
283
285
  * If flyToken and flyApp are set, starts remotely; otherwise locally.
284
286
  */
285
287
  export async function startContainer(config, repo) {
288
+ const { token, projectId, environment } = config.infisical;
289
+ if (!token || !projectId || !environment) {
290
+ const missing = [
291
+ !token && "token",
292
+ !projectId && "projectId",
293
+ !environment && "environment",
294
+ ].filter(Boolean);
295
+ throw new Error(`Missing Infisical credentials: ${missing.join(", ")}. Containers cannot start without Infisical.`);
296
+ }
286
297
  debugLog("startContainer config:", {
287
298
  projectRoot: config.projectRoot,
288
299
  flyApp: config.flyApp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio/app-building",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Library for managing agentic app-building containers",
5
5
  "type": "module",
6
6
  "exports": {