@replayio/app-building 1.28.0 → 1.29.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,8 @@ 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`, `taskWebhookUrl` (GET endpoint for external task queue), `addTaskWebhookUrl` (POST endpoint for tasks added by `add-task` script), `detached`, `initialPrompt`, `localPort`, `absorbTasks`, `namePrefix` (default: `"app-building"`). |
83
+ | `ContainerConfig` | `infisical` (required `InfisicalConfig`), optional `projectRoot` (local Docker only), `registry`, `flyToken`/`flyApp` (set both for remote Fly.io), `flyGuest` (override Fly Machine guest sizing; default: 16 performance CPUs / 32 GiB), `flyVolumeSizeGb` (override Fly Volume size in GiB; default: 50), `imageRef`, `webhookUrl`/`webhookSecret`, `taskWebhookUrl` (GET endpoint for external task queue), `addTaskWebhookUrl` (POST endpoint for tasks added by `add-task` script), `detached`, `initialPrompt`, `localPort`, `absorbTasks`, `namePrefix` (default: `"app-building"`). |
84
+ | `FlyGuest` | Fly Machine guest spec: `cpu_kind` (`"shared"` \| `"performance"`), `cpus`, `memory_mb`. |
84
85
  | `RepoOptions` | Per-invocation git settings: `repoUrl`, `cloneBranch`, `pushBranch`. |
85
86
  | `AgentState` | Returned by `startContainer`. Contains `type`, `containerName`, `port`, `baseUrl`, and Fly-specific fields for remote containers. |
86
87
  | `ContainerRegistry` | Interface for container registry storage. Methods: `log`, `markStopped`, `clearStopped`, `getRecent`, `find`, `findAlive`. |
package/dist/index.d.ts CHANGED
@@ -74,6 +74,12 @@ declare function createBranchSecret(config: InfisicalConfig, branch: string, nam
74
74
  */
75
75
  declare function getInfisicalConfig(envVars: Record<string, string>): Promise<InfisicalConfig>;
76
76
 
77
+ interface FlyGuest {
78
+ cpu_kind: "shared" | "performance";
79
+ cpus: number;
80
+ memory_mb: number;
81
+ }
82
+
77
83
  interface AgentState {
78
84
  type: "local" | "remote";
79
85
  containerName: string;
@@ -109,6 +115,10 @@ interface ContainerConfig {
109
115
  namePrefix?: string;
110
116
  /** Agent command override (e.g. "codex", "gemini"). Default: "claude". */
111
117
  agentCommand?: string;
118
+ /** Override the Fly Machine guest sizing. Default: 16 performance CPUs, 32 GiB memory. */
119
+ flyGuest?: FlyGuest;
120
+ /** Override the Fly Volume size in GiB. Default: 50. */
121
+ flyVolumeSizeGb?: number;
112
122
  }
113
123
  interface RepoOptions {
114
124
  repoUrl: string;
@@ -186,4 +196,4 @@ interface Task {
186
196
  */
187
197
  declare function findReadyTask(pendingTasks: Task[], completedTasks: Pick<Task, "id" | "parentTaskId">[]): Task | null;
188
198
 
189
- export { type AgentState, type ContainerConfig, type ContainerRegistry, FileContainerRegistry, type HttpOptions, type InfisicalConfig, type RegistryEntry, type RepoOptions, type Task, buildImage, createBranchSecret, fetchBranchSecrets, fetchGlobalSecrets, fetchInfisicalSecrets, findReadyTask, getImageRef, getInfisicalConfig, httpGet, httpOptsFor, httpPost, infisicalLogin, loadDotEnv, probeAlive, spawnTestContainer, startContainer, stopContainer };
199
+ export { type AgentState, type ContainerConfig, type ContainerRegistry, FileContainerRegistry, type FlyGuest, type HttpOptions, type InfisicalConfig, type RegistryEntry, type RepoOptions, type Task, buildImage, createBranchSecret, fetchBranchSecrets, fetchGlobalSecrets, fetchInfisicalSecrets, findReadyTask, getImageRef, getInfisicalConfig, httpGet, httpOptsFor, httpPost, infisicalLogin, loadDotEnv, probeAlive, spawnTestContainer, startContainer, stopContainer };
package/dist/index.js CHANGED
@@ -39,13 +39,21 @@ async function deleteVolume(app, token, volumeId) {
39
39
  method: "DELETE"
40
40
  });
41
41
  }
42
- async function createMachine(app, token, image, env, name) {
42
+ var DEFAULT_GUEST = {
43
+ cpu_kind: "performance",
44
+ cpus: 16,
45
+ memory_mb: 32768
46
+ };
47
+ var DEFAULT_VOLUME_SIZE_GB = 50;
48
+ async function createMachine(app, token, image, env, name, options = {}) {
49
+ const guest = options.guest ?? DEFAULT_GUEST;
50
+ const volumeSizeGb = options.volumeSizeGb ?? DEFAULT_VOLUME_SIZE_GB;
43
51
  const volumeName = `repo_${name.replace(/-/g, "_")}`.slice(0, 30);
44
52
  const regions = ["dfw", "iad", "ord", "sjc"];
45
53
  let cleanupDone;
46
54
  for (const region of regions) {
47
55
  console.log(`Creating machine in region ${region}...`);
48
- const volumeId = await createVolume(app, token, volumeName, region, 50);
56
+ const volumeId = await createVolume(app, token, volumeName, region, volumeSizeGb);
49
57
  if (!cleanupDone) {
50
58
  cleanupDone = listVolumes(app, token).then((vols) => Promise.all(
51
59
  vols.map(async ({ id, attached_machine_id }) => {
@@ -67,11 +75,7 @@ async function createMachine(app, token, image, env, name) {
67
75
  env,
68
76
  auto_destroy: true,
69
77
  restart: { policy: "on-failure", max_retries: 3 },
70
- guest: {
71
- cpu_kind: "performance",
72
- cpus: 16,
73
- memory_mb: 32768
74
- },
78
+ guest,
75
79
  mounts: [{ volume: volumeId, path: "/repo" }],
76
80
  services: [
77
81
  {
@@ -348,7 +352,10 @@ async function startRemoteContainerImpl(config, repo) {
348
352
  let volumeId = "";
349
353
  for (let attempt = 0; attempt < 5; attempt++) {
350
354
  try {
351
- const result = await createMachine(config.flyApp, config.flyToken, imageRef, containerEnv, machineName);
355
+ const result = await createMachine(config.flyApp, config.flyToken, imageRef, containerEnv, machineName, {
356
+ guest: config.flyGuest,
357
+ volumeSizeGb: config.flyVolumeSizeGb
358
+ });
352
359
  machineId = result.machineId;
353
360
  volumeId = result.volumeId;
354
361
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio/app-building",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "Library for managing agentic app-building containers",
5
5
  "type": "module",
6
6
  "exports": {