@hoststack.dev/mcp 0.13.0 → 0.13.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/dist/index.js CHANGED
@@ -2263,7 +2263,7 @@ defineTool({
2263
2263
  "Inputs:",
2264
2264
  ' - project_id: numeric id or publicId ("prj_\u2026") of the target project.',
2265
2265
  ' - name (optional): service name (default "dev-environment").',
2266
- ' - plan (optional): service size (default "micro").',
2266
+ ' - plan (optional): service size (default "standard" \u2014 2 GB, the smallest that fits a coding agent + build).',
2267
2267
  " - disk_gb (optional): /workspace volume size in GB (default 10, 1\u2013100).",
2268
2268
  " - hoststack_api_key (optional): sets HOSTSTACK_API_KEY so the hoststack MCP works inside the container.",
2269
2269
  " - poststack_api_key (optional): sets POSTSTACK_API_KEY so the poststack MCP works inside the container.",
@@ -2276,7 +2276,9 @@ defineTool({
2276
2276
  input: {
2277
2277
  project_id: z13.union([z13.number().int().positive(), z13.string()]).describe("Target project \u2014 numeric id or publicId."),
2278
2278
  name: z13.string().min(1).max(100).optional().describe('Service name (default "dev-environment").'),
2279
- plan: z13.enum(SERVICE_PLANS).optional().describe('Service size (default "micro").'),
2279
+ plan: z13.enum(SERVICE_PLANS).optional().describe(
2280
+ 'Service size (default "standard" \u2014 2 GB; smallest that fits a coding agent).'
2281
+ ),
2280
2282
  disk_gb: z13.number().int().min(1).max(100).optional().describe("/workspace volume size in GB (default 10)."),
2281
2283
  hoststack_api_key: z13.string().optional().describe("Value for HOSTSTACK_API_KEY (enables the hoststack MCP in-container)."),
2282
2284
  poststack_api_key: z13.string().optional().describe("Value for POSTSTACK_API_KEY (enables the poststack MCP in-container)."),
@@ -2424,6 +2426,41 @@ defineTool({
2424
2426
  });
2425
2427
  }
2426
2428
  });
2429
+ defineTool({
2430
+ name: "resize_dev_environment",
2431
+ category: "services",
2432
+ description: [
2433
+ "Resize a dev box (or any service) to a different size tier \u2014 the supported way to give it more memory/CPU/disk headroom (e.g. when ESLint/tsc OOMs).",
2434
+ "",
2435
+ "When to use: a dev box OOM-killed (see exitReason/recommendedSize from list_dev_environments), or you just want more headroom. This changes the SIZE TIER \u2014 unlike per-config memory/CPU overrides, which are clamped to the current tier and so cannot grow a box past it.",
2436
+ "",
2437
+ "How it applies: the new tier's memory + CPU take effect LIVE on the running container (no recreate, no dropped shell sessions); a larger disk takes effect on the next recreate (suspend\u2192resume). Dev boxes are floored to the OOM-safe minimum size server-side.",
2438
+ "",
2439
+ "Inputs:",
2440
+ " - service_id: the box to resize \u2014 numeric id or publicId.",
2441
+ ' - size: target tier (e.g. "standard", "large", "xlarge").',
2442
+ "",
2443
+ "Returns: { service } with the new plan.",
2444
+ "",
2445
+ 'Example: resize_dev_environment({ service_id: "svc_skyskraber_dev", size: "large" }) \u2192 bumps the box to the large tier, applied live.'
2446
+ ].join("\n"),
2447
+ input: {
2448
+ service_id: z13.union([z13.number().int().positive(), z13.string()]).describe("The box to resize \u2014 numeric id or publicId."),
2449
+ size: z13.string().min(1).describe('Target size tier, e.g. "standard", "large", "xlarge".')
2450
+ },
2451
+ handler: async (args, ctx) => {
2452
+ const teamId = await ctx.resolveTeamId();
2453
+ const serviceId = await ctx.hoststack.resolveId(args.service_id, {
2454
+ kind: "service",
2455
+ teamId
2456
+ });
2457
+ const { service } = await ctx.hoststack.services.resize(teamId, serviceId, args.size);
2458
+ return respond({
2459
+ summary: `Resized to ${service.plan} \u2014 memory/CPU applied live; disk grows on next recreate.`,
2460
+ data: { service: shapeService(service) }
2461
+ });
2462
+ }
2463
+ });
2427
2464
  defineTool({
2428
2465
  name: "list_dev_environments",
2429
2466
  category: "services",
@@ -2432,7 +2469,7 @@ defineTool({
2432
2469
  "",
2433
2470
  `When to use: "show my dev environments", before opening/tearing one down, to find a box's id.`,
2434
2471
  "",
2435
- 'Returns: { items: [{ ...service, devUrl, databases }] } where `databases` lists the companion engines wired into the box (e.g. ["postgres","redis"]).',
2472
+ 'Returns: { items: [{ ...service, devUrl, databases, exitReason, recommendedSize }] } where `databases` lists the companion engines wired into the box (e.g. ["postgres","redis"]). `exitReason` is "oom_killed" / "crashed" / null for the box\'s last container exit; when it is "oom_killed", `recommendedSize` is the next tier up to rescale to (use resize_dev_environment).',
2436
2473
  "",
2437
2474
  "Example: list_dev_environments() \u2192 every dev box for the active team."
2438
2475
  ].join("\n"),
@@ -2440,13 +2477,16 @@ defineTool({
2440
2477
  handler: async (_args, ctx) => {
2441
2478
  const teamId = await ctx.resolveTeamId();
2442
2479
  const { environments } = await ctx.hoststack.services.listDevEnvironments(teamId);
2480
+ const oomCount = environments.filter((e) => e.exitReason === "oom_killed").length;
2443
2481
  return respond({
2444
- summary: `${environments.length} dev environment${environments.length === 1 ? "" : "s"}.`,
2482
+ summary: `${environments.length} dev environment${environments.length === 1 ? "" : "s"}.` + (oomCount > 0 ? ` ${oomCount} recently OOM-killed \u2014 consider resize_dev_environment.` : ""),
2445
2483
  data: {
2446
2484
  items: environments.map((env) => ({
2447
2485
  ...shapeService(env),
2448
2486
  devUrl: env.devUrl ?? null,
2449
- databases: env.databases ?? []
2487
+ databases: env.databases ?? [],
2488
+ exitReason: env.exitReason ?? null,
2489
+ recommendedSize: env.recommendedSize ?? null
2450
2490
  }))
2451
2491
  }
2452
2492
  });
@@ -2468,6 +2508,7 @@ defineTool({
2468
2508
  " - branch (optional): branch to clone.",
2469
2509
  ' - databases (optional): companion services to attach \u2014 any of "postgres", "redis", "meilisearch".',
2470
2510
  ' - plan (optional): box size (default "micro").',
2511
+ " - agent_accounts (optional): bind specific saved agent logins by account id per provider. OMIT to auto-inherit the box owner's default logins (claude/codex/opencode), so `claude` is already authenticated on first boot \u2014 no manual login.",
2471
2512
  "",
2472
2513
  "Returns: { service, devUrl, deployId } \u2014 deploying. Once live: open the Terminal tab, run `claude`, start the dev server on $PORT, view at https://<devUrl>. Tear down with delete_dev_environment.",
2473
2514
  "",
@@ -2480,7 +2521,15 @@ defineTool({
2480
2521
  clone_url: z13.string().url().optional().describe('http(s) git clone URL (required when source_kind="url").'),
2481
2522
  branch: z13.string().min(1).max(255).optional().describe("Branch to clone."),
2482
2523
  databases: z13.array(z13.enum(["postgres", "redis", "meilisearch"])).optional().describe("Companion services to attach (fresh + empty)."),
2483
- plan: z13.enum(SERVICE_PLANS).optional().describe('Box size (default "micro").')
2524
+ plan: z13.enum(SERVICE_PLANS).optional().describe('Box size (default "micro").'),
2525
+ agent_accounts: z13.array(
2526
+ z13.object({
2527
+ provider: z13.enum(["claude", "codex", "opencode"]),
2528
+ account_id: z13.number().int().positive()
2529
+ })
2530
+ ).max(3).optional().describe(
2531
+ "Bind saved agent logins by account id per provider. Omit to inherit the box owner's default logins automatically."
2532
+ )
2484
2533
  },
2485
2534
  handler: async (args, ctx) => {
2486
2535
  const teamId = await ctx.resolveTeamId();
@@ -2516,7 +2565,13 @@ defineTool({
2516
2565
  name: args.name,
2517
2566
  source,
2518
2567
  ...args.databases ? { databases: args.databases } : {},
2519
- ...args.plan ? { plan: args.plan } : {}
2568
+ ...args.plan ? { plan: args.plan } : {},
2569
+ ...args.agent_accounts && args.agent_accounts.length > 0 ? {
2570
+ agentAccounts: args.agent_accounts.map((a) => ({
2571
+ provider: a.provider,
2572
+ accountId: a.account_id
2573
+ }))
2574
+ } : {}
2520
2575
  };
2521
2576
  const result = await ctx.hoststack.services.createDevEnvironment(teamId, input);
2522
2577
  return respond({