@cabane/companion 0.6.124 → 0.6.126

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.
@@ -227,10 +227,45 @@ var companionConfigSchema = z2.object({
227
227
  // wraps the runner in an OS sandbox where the host supports one; `'none'`
228
228
  // (the default) runs it as a plain child beside this process, a supported
229
229
  // configuration in its own right rather than a degraded one.
230
+ // CT1684: `policy` is what the OS sandbox lets a turn reach, read and hold
231
+ // (`runner/sandbox-policy.ts`). It is validated there rather than here, so a
232
+ // bad policy refuses the turns it governs, with the field named, instead of
233
+ // keeping the companion from starting at all.
230
234
  runners: z2.object({
231
235
  enabled: z2.boolean().optional(),
232
- provider: z2.literal("local-process").optional(),
233
- sandbox: z2.enum(["os", "none"]).optional()
236
+ provider: z2.enum(["local-process", "docker"]).optional(),
237
+ sandbox: z2.enum(["os", "none"]).optional(),
238
+ // CT1681: the `docker` provider — a container per conversation and agent,
239
+ // from one image, on a network whose only way out is an allow-listed proxy.
240
+ docker: z2.object({
241
+ // The base image a container runs. Default: the one this companion
242
+ // builds from its own Dockerfile on first use. One named here must
243
+ // have that one's layout (the `runner` user, `cabane-companion` on
244
+ // PATH reading `CABANE_COMPANION_ROOT`).
245
+ image: z2.string().min(1).optional(),
246
+ // The companion install mounted into every container. Default, on
247
+ // Linux: this companion's own. Needed for one run from a checkout
248
+ // (a `pnpm --filter @cabane/companion deploy --prod <dir>`).
249
+ companionDir: z2.string().min(1).optional(),
250
+ // Hosts a turn may reach besides the Cabane API, the model providers
251
+ // and the git host. `*.example.com` matches any subdomain.
252
+ egressAllow: z2.array(z2.string().min(1)).optional(),
253
+ // Keep a turn's container between turns and start it again for the
254
+ // next one. Off by default: the container goes after every turn and
255
+ // the runtime's session files are restored into the next.
256
+ keepContainers: z2.boolean().optional(),
257
+ // The Cabane URL as a container reaches it, for a device whose own
258
+ // `baseUrl` is a loopback address the container can't see.
259
+ apiUrl: z2.string().url().refine(isAllowedBaseUrl).optional(),
260
+ // Env set on each turn's runner, `${NAME}` resolved from secrets.json
261
+ // at exec: the runtime's own auth, which the image never carries.
262
+ env: z2.record(z2.string(), z2.string()).optional(),
263
+ // A git credential helper run on this device to answer the
264
+ // container's git for an allowed host, e.g. `!gh auth git-credential`.
265
+ // Absent: git's own configured helpers on this device.
266
+ gitCredentialHelper: z2.string().min(1).optional()
267
+ }).strict().optional(),
268
+ policy: z2.unknown().optional()
234
269
  }).strict().optional()
235
270
  });
236
271
  function loadConfig() {