@b3os/mcp 0.2.2 → 0.2.3

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/src/table.gen.ts CHANGED
@@ -782,7 +782,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
782
782
  type: "string",
783
783
  default: "base",
784
784
  description:
785
- "Template name or `tpl_` ID: a node template (`GET /v1/sandboxes/templates`) or one of your project's image templates (an image's `template`).",
785
+ "Template name or `tpl_` ID: a node template (`GET /v1/sandboxes/templates`) or one of your project's image templates (an image's `template`, or its `name`.",
786
786
  },
787
787
  snapshot: {
788
788
  type: "string",
@@ -2274,6 +2274,707 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
2274
2274
  bodyDefaults: {},
2275
2275
  queryDefaults: {},
2276
2276
  },
2277
+ {
2278
+ name: "desktop_create",
2279
+ group: "desktop",
2280
+ title: "Create a desktop",
2281
+ description:
2282
+ "Start a desktop: a sandbox of the desktop template, a Linux desktop with Chrome on a 1280x800 screen, for computer use. Returns its id. Look at it with desktop_screenshot, drive its mouse and keyboard with desktop_act, and run shell commands in it with desktop_run. It stops after timeout_s seconds, or pauses with on_idle: pause. Running and paused desktops count against your limits, so call desktop_delete on each desktop you created once the task is done; desktop_room says how many more fit. Logins, captchas and payments are for a person: stop and ask the user.",
2283
+ annotations: {
2284
+ title: "Create a desktop",
2285
+ readOnlyHint: false,
2286
+ destructiveHint: false,
2287
+ openWorldHint: false,
2288
+ },
2289
+ inputSchema: {
2290
+ type: "object",
2291
+ properties: {
2292
+ vcpu: {
2293
+ type: "integer",
2294
+ minimum: 1,
2295
+ description:
2296
+ "Virtual CPUs; defaults to the template's (`defaults.vcpu`), at most your plan's `sandboxes.vcpu_max`.",
2297
+ },
2298
+ memory_mib: {
2299
+ type: "integer",
2300
+ minimum: 128,
2301
+ description:
2302
+ "Memory; defaults to the template's (`defaults.memory_mib`), at most your plan's `sandboxes.memory_max`.",
2303
+ },
2304
+ timeout_s: {
2305
+ type: "integer",
2306
+ minimum: 10,
2307
+ maximum: 86400,
2308
+ default: 300,
2309
+ description: "Lifetime in seconds from creation (or from the last `POST …/timeout`), capped by your plan.",
2310
+ },
2311
+ on_idle: {
2312
+ type: "string",
2313
+ enum: ["stop", "pause"],
2314
+ default: "stop",
2315
+ description:
2316
+ "What happens at `expires_at`. `stop` destroys the sandbox; `pause` pauses it so a later resume (after extending the timeout) continues it.",
2317
+ },
2318
+ metadata: {
2319
+ type: "object",
2320
+ description: "Up to 16 string key-value pairs for your own use.",
2321
+ },
2322
+ },
2323
+ additionalProperties: false,
2324
+ },
2325
+ operationId: "sandboxesCreateSandbox",
2326
+ method: "POST",
2327
+ path: "/v1/sandboxes",
2328
+ scope: "sandboxes:write",
2329
+ servedBy: "node",
2330
+ stage: "preview",
2331
+ flag: "sandboxes.desktop",
2332
+ pathParams: [],
2333
+ queryParams: [],
2334
+ body: "json",
2335
+ bodyFields: ["vcpu", "memory_mib", "timeout_s", "on_idle", "metadata"],
2336
+ rawFields: [],
2337
+ toolArgs: [],
2338
+ bodyDefaults: {
2339
+ template: "desktop",
2340
+ },
2341
+ queryDefaults: {},
2342
+ },
2343
+ {
2344
+ name: "desktop_list",
2345
+ group: "desktop",
2346
+ title: "List desktops",
2347
+ description:
2348
+ "List this project's desktops (sandboxes of the desktop template), newest first: each one's id, status, size and expiry. status filters them (running, paused, ...).",
2349
+ annotations: {
2350
+ title: "List desktops",
2351
+ readOnlyHint: true,
2352
+ openWorldHint: false,
2353
+ },
2354
+ inputSchema: {
2355
+ type: "object",
2356
+ properties: {
2357
+ status: {
2358
+ type: "string",
2359
+ description: "Only sandboxes with this status.",
2360
+ enum: ["running", "paused", "stopped", "failed", "hibernated"],
2361
+ },
2362
+ },
2363
+ additionalProperties: false,
2364
+ },
2365
+ operationId: "sandboxesListSandboxes",
2366
+ method: "GET",
2367
+ path: "/v1/sandboxes",
2368
+ scope: "sandboxes:read",
2369
+ servedBy: "node",
2370
+ stage: "preview",
2371
+ flag: "sandboxes.desktop",
2372
+ pathParams: [],
2373
+ queryParams: [
2374
+ {
2375
+ name: "status",
2376
+ },
2377
+ ],
2378
+ body: "none",
2379
+ bodyFields: [],
2380
+ rawFields: [],
2381
+ toolArgs: [],
2382
+ bodyDefaults: {},
2383
+ queryDefaults: {},
2384
+ },
2385
+ {
2386
+ name: "desktop_delete",
2387
+ group: "desktop",
2388
+ title: "Delete a desktop",
2389
+ description:
2390
+ "Stop a desktop and destroy its memory and disk. Delete each desktop you created once the task is done: paused desktops still count against your limits.",
2391
+ annotations: {
2392
+ title: "Delete a desktop",
2393
+ readOnlyHint: false,
2394
+ destructiveHint: true,
2395
+ idempotentHint: true,
2396
+ openWorldHint: false,
2397
+ },
2398
+ inputSchema: {
2399
+ type: "object",
2400
+ properties: {
2401
+ sandbox_id: {
2402
+ type: "string",
2403
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2404
+ description: "The desktop's sbx_… id, from desktop_create or desktop_list.",
2405
+ },
2406
+ },
2407
+ required: ["sandbox_id"],
2408
+ additionalProperties: false,
2409
+ },
2410
+ operationId: "sandboxesDeleteSandbox",
2411
+ method: "DELETE",
2412
+ path: "/v1/sandboxes/{sandbox_id}",
2413
+ scope: "sandboxes:write",
2414
+ servedBy: "node",
2415
+ stage: "preview",
2416
+ flag: "sandboxes.desktop",
2417
+ pathParams: ["sandbox_id"],
2418
+ queryParams: [],
2419
+ body: "none",
2420
+ bodyFields: [],
2421
+ rawFields: [],
2422
+ toolArgs: [],
2423
+ bodyDefaults: {},
2424
+ queryDefaults: {},
2425
+ },
2426
+ {
2427
+ name: "desktop_room",
2428
+ group: "desktop",
2429
+ title: "Check room for desktops",
2430
+ description:
2431
+ "Say how many more desktops can be created now and which limit stops the next one (your organization's sandboxes, its desktops, or the node's memory), so you can plan a wave of desktop_create calls instead of meeting 429 or 503 answers. Paused desktops count. It is a reading, not a reservation.",
2432
+ annotations: {
2433
+ title: "Check room for desktops",
2434
+ readOnlyHint: true,
2435
+ openWorldHint: false,
2436
+ },
2437
+ inputSchema: {
2438
+ type: "object",
2439
+ properties: {
2440
+ vcpu: {
2441
+ type: "integer",
2442
+ minimum: 1,
2443
+ description: "vCPUs of each sandbox; the template's default when left out.",
2444
+ },
2445
+ memory_mib: {
2446
+ type: "integer",
2447
+ minimum: 128,
2448
+ description: "Memory of each sandbox, MiB; the template's default when left out.",
2449
+ },
2450
+ },
2451
+ additionalProperties: false,
2452
+ },
2453
+ operationId: "sandboxesGetCapacity",
2454
+ method: "GET",
2455
+ path: "/v1/sandboxes/capacity",
2456
+ scope: "sandboxes:read",
2457
+ servedBy: "node",
2458
+ stage: "preview",
2459
+ flag: "sandboxes.desktop",
2460
+ pathParams: [],
2461
+ queryParams: [
2462
+ {
2463
+ name: "vcpu",
2464
+ },
2465
+ {
2466
+ name: "memory_mib",
2467
+ },
2468
+ ],
2469
+ body: "none",
2470
+ bodyFields: [],
2471
+ rawFields: [],
2472
+ toolArgs: [],
2473
+ bodyDefaults: {},
2474
+ queryDefaults: {
2475
+ template: "desktop",
2476
+ },
2477
+ },
2478
+ {
2479
+ name: "desktop_screenshot",
2480
+ group: "desktop",
2481
+ title: "Take a desktop screenshot",
2482
+ description:
2483
+ "Take a screenshot of a desktop's whole 1280x800 screen and return it as an image (JPEG at quality 80 unless format or quality says otherwise). The x and y of desktop_act are pixels of this image from its top left. desktop_act already returns a screenshot after its actions; use this to look without acting.",
2484
+ annotations: {
2485
+ title: "Take a desktop screenshot",
2486
+ readOnlyHint: true,
2487
+ openWorldHint: false,
2488
+ },
2489
+ inputSchema: {
2490
+ type: "object",
2491
+ properties: {
2492
+ sandbox_id: {
2493
+ type: "string",
2494
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2495
+ description: "The sandbox ID (`sbx_…`).",
2496
+ },
2497
+ format: {
2498
+ type: "string",
2499
+ enum: ["png", "jpeg"],
2500
+ description: "`png` or `jpeg`. Without it: the image type `Accept` names, else `jpeg`.",
2501
+ },
2502
+ quality: {
2503
+ type: "integer",
2504
+ minimum: 1,
2505
+ maximum: 100,
2506
+ default: 80,
2507
+ description: "JPEG quality, 1 to 100.",
2508
+ },
2509
+ },
2510
+ required: ["sandbox_id"],
2511
+ additionalProperties: false,
2512
+ },
2513
+ operationId: "sandboxesComputerScreenshot",
2514
+ method: "GET",
2515
+ path: "/v1/sandboxes/{sandbox_id}/computer/screenshot",
2516
+ scope: "sandboxes:read",
2517
+ servedBy: "node",
2518
+ stage: "preview",
2519
+ flag: "sandboxes.desktop",
2520
+ pathParams: ["sandbox_id"],
2521
+ queryParams: [
2522
+ {
2523
+ name: "format",
2524
+ },
2525
+ {
2526
+ name: "quality",
2527
+ },
2528
+ ],
2529
+ body: "none",
2530
+ bodyFields: [],
2531
+ rawFields: [],
2532
+ toolArgs: [],
2533
+ bodyDefaults: {},
2534
+ queryDefaults: {},
2535
+ },
2536
+ {
2537
+ name: "desktop_act",
2538
+ group: "desktop",
2539
+ title: "Use a desktop's mouse and keyboard",
2540
+ description:
2541
+ 'Send mouse and keyboard input to a desktop and see the result: runs 1 to 32 actions in order, waits for the screen to settle, and returns one line per action and a screenshot (JPEG 80; screenshot: false for none). The screen is 1280x800 and x, y are pixels from its top left. Each action is {action, ...}: click {x?, y?, button?, count? (2 double, 3 triple)}, move {x, y}, drag {path: [[x, y], ...]}, scroll {x?, y?, direction: up|down|left|right, amount?}, type {text}, key {keys: "ctrl+l", "Return"}, mouse_down and mouse_up {x?, y?, button?}, key_down and key_up {key}, wait {ms}, cursor_position. An action without x and y acts at the pointer. A failed action stops the batch: the ones after it did not run. Look at the screenshot before you send an action again: a click, text or key that landed has run once already. Logins, captchas and payments are for a person: stop and ask the user to handle them; never try to solve or get around one.',
2542
+ annotations: {
2543
+ title: "Use a desktop's mouse and keyboard",
2544
+ readOnlyHint: false,
2545
+ destructiveHint: true,
2546
+ openWorldHint: true,
2547
+ },
2548
+ inputSchema: {
2549
+ type: "object",
2550
+ properties: {
2551
+ sandbox_id: {
2552
+ type: "string",
2553
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2554
+ description: "The sandbox ID (`sbx_…`).",
2555
+ },
2556
+ actions: {
2557
+ type: "array",
2558
+ items: {
2559
+ description: "One mouse or keyboard action; `action` selects it.",
2560
+ oneOf: [
2561
+ {
2562
+ type: "object",
2563
+ required: ["action"],
2564
+ description: "Click at `x`, `y` (both or neither; neither clicks at the pointer).",
2565
+ properties: {
2566
+ action: {
2567
+ type: "string",
2568
+ const: "click",
2569
+ },
2570
+ x: {
2571
+ type: "integer",
2572
+ minimum: 0,
2573
+ maximum: 32767,
2574
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2575
+ },
2576
+ y: {
2577
+ type: "integer",
2578
+ minimum: 0,
2579
+ maximum: 32767,
2580
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2581
+ },
2582
+ button: {
2583
+ type: "string",
2584
+ enum: ["left", "right", "middle"],
2585
+ default: "left",
2586
+ },
2587
+ count: {
2588
+ type: "integer",
2589
+ minimum: 1,
2590
+ maximum: 3,
2591
+ default: 1,
2592
+ },
2593
+ },
2594
+ },
2595
+ {
2596
+ type: "object",
2597
+ required: ["action", "x", "y"],
2598
+ description: "Move the pointer.",
2599
+ properties: {
2600
+ action: {
2601
+ type: "string",
2602
+ const: "move",
2603
+ },
2604
+ x: {
2605
+ type: "integer",
2606
+ minimum: 0,
2607
+ maximum: 32767,
2608
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2609
+ },
2610
+ y: {
2611
+ type: "integer",
2612
+ minimum: 0,
2613
+ maximum: 32767,
2614
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2615
+ },
2616
+ },
2617
+ },
2618
+ {
2619
+ type: "object",
2620
+ required: ["action"],
2621
+ description: "Press a button, at `x`, `y` or at the pointer, and hold it.",
2622
+ properties: {
2623
+ action: {
2624
+ type: "string",
2625
+ const: "mouse_down",
2626
+ },
2627
+ x: {
2628
+ type: "integer",
2629
+ minimum: 0,
2630
+ maximum: 32767,
2631
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2632
+ },
2633
+ y: {
2634
+ type: "integer",
2635
+ minimum: 0,
2636
+ maximum: 32767,
2637
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2638
+ },
2639
+ button: {
2640
+ type: "string",
2641
+ enum: ["left", "right", "middle"],
2642
+ default: "left",
2643
+ },
2644
+ },
2645
+ },
2646
+ {
2647
+ type: "object",
2648
+ required: ["action"],
2649
+ description: "Release a button, at `x`, `y` or at the pointer.",
2650
+ properties: {
2651
+ action: {
2652
+ type: "string",
2653
+ const: "mouse_up",
2654
+ },
2655
+ x: {
2656
+ type: "integer",
2657
+ minimum: 0,
2658
+ maximum: 32767,
2659
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2660
+ },
2661
+ y: {
2662
+ type: "integer",
2663
+ minimum: 0,
2664
+ maximum: 32767,
2665
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2666
+ },
2667
+ button: {
2668
+ type: "string",
2669
+ enum: ["left", "right", "middle"],
2670
+ default: "left",
2671
+ },
2672
+ },
2673
+ },
2674
+ {
2675
+ type: "object",
2676
+ required: ["action", "path"],
2677
+ description: "Press the button at the first point, move through the others and release at t...",
2678
+ properties: {
2679
+ action: {
2680
+ type: "string",
2681
+ const: "drag",
2682
+ },
2683
+ path: {
2684
+ type: "array",
2685
+ description: "`[[x, y], ...]`, 2 to 64 points.",
2686
+ },
2687
+ button: {
2688
+ type: "string",
2689
+ enum: ["left", "right", "middle"],
2690
+ default: "left",
2691
+ },
2692
+ },
2693
+ },
2694
+ {
2695
+ type: "object",
2696
+ required: ["action", "direction"],
2697
+ description: "Turn the wheel `amount` clicks, at `x`, `y` or at the pointer.",
2698
+ properties: {
2699
+ action: {
2700
+ type: "string",
2701
+ const: "scroll",
2702
+ },
2703
+ x: {
2704
+ type: "integer",
2705
+ minimum: 0,
2706
+ maximum: 32767,
2707
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2708
+ },
2709
+ y: {
2710
+ type: "integer",
2711
+ minimum: 0,
2712
+ maximum: 32767,
2713
+ description: "Pixels from the left (`x`) or the top (`y`); within the screen.",
2714
+ },
2715
+ direction: {
2716
+ type: "string",
2717
+ enum: ["up", "down", "left", "right"],
2718
+ },
2719
+ amount: {
2720
+ type: "integer",
2721
+ minimum: 1,
2722
+ maximum: 50,
2723
+ default: 1,
2724
+ },
2725
+ },
2726
+ },
2727
+ {
2728
+ type: "object",
2729
+ required: ["action", "text"],
2730
+ description: "Type the text, as a keyboard would (newline and tab included).",
2731
+ properties: {
2732
+ action: {
2733
+ type: "string",
2734
+ const: "type",
2735
+ },
2736
+ text: {
2737
+ type: "string",
2738
+ description: "At most 8,192 bytes of UTF-8.",
2739
+ },
2740
+ },
2741
+ },
2742
+ {
2743
+ type: "object",
2744
+ required: ["action", "keys"],
2745
+ description: "Press and release a key or a chord of xdotool key names joined by `+`.",
2746
+ properties: {
2747
+ action: {
2748
+ type: "string",
2749
+ const: "key",
2750
+ },
2751
+ keys: {
2752
+ type: "string",
2753
+ },
2754
+ },
2755
+ },
2756
+ {
2757
+ type: "object",
2758
+ required: ["action", "key"],
2759
+ description: "Press one key and hold it until `key_up` (or the end of a batch that fails).",
2760
+ properties: {
2761
+ action: {
2762
+ type: "string",
2763
+ const: "key_down",
2764
+ },
2765
+ key: {
2766
+ type: "string",
2767
+ },
2768
+ },
2769
+ },
2770
+ {
2771
+ type: "object",
2772
+ required: ["action", "key"],
2773
+ description: "Release a held key.",
2774
+ properties: {
2775
+ action: {
2776
+ type: "string",
2777
+ const: "key_up",
2778
+ },
2779
+ key: {
2780
+ type: "string",
2781
+ },
2782
+ },
2783
+ },
2784
+ {
2785
+ type: "object",
2786
+ required: ["action", "ms"],
2787
+ properties: {
2788
+ action: {
2789
+ type: "string",
2790
+ const: "wait",
2791
+ },
2792
+ ms: {
2793
+ type: "integer",
2794
+ minimum: 1,
2795
+ maximum: 10000,
2796
+ },
2797
+ },
2798
+ },
2799
+ {
2800
+ type: "object",
2801
+ required: ["action"],
2802
+ description: "Sends no input; the answer's `cursor` is the pointer's position.",
2803
+ properties: {
2804
+ action: {
2805
+ type: "string",
2806
+ const: "cursor_position",
2807
+ },
2808
+ },
2809
+ },
2810
+ ],
2811
+ discriminator: {
2812
+ propertyName: "action",
2813
+ mapping: {
2814
+ click: "#/components/schemas/ComputerClick",
2815
+ move: "#/components/schemas/ComputerMove",
2816
+ mouse_down: "#/components/schemas/ComputerMouseDown",
2817
+ mouse_up: "#/components/schemas/ComputerMouseUp",
2818
+ drag: "#/components/schemas/ComputerDrag",
2819
+ scroll: "#/components/schemas/ComputerScroll",
2820
+ type: "#/components/schemas/ComputerType",
2821
+ key: "#/components/schemas/ComputerKey",
2822
+ key_down: "#/components/schemas/ComputerKeyDown",
2823
+ key_up: "#/components/schemas/ComputerKeyUp",
2824
+ wait: "#/components/schemas/ComputerWait",
2825
+ cursor_position: "#/components/schemas/ComputerCursorPosition",
2826
+ },
2827
+ },
2828
+ },
2829
+ description:
2830
+ "Run in order, 1 to 32; each is {action, ...}: click, move, drag, scroll, type, key, mouse_down, mouse_up, key_down, key_up, wait or cursor_position. Their waits add up to at most 30,000 ms.",
2831
+ },
2832
+ screenshot: {
2833
+ type: ["object", "boolean"],
2834
+ properties: {
2835
+ format: {
2836
+ type: "string",
2837
+ enum: ["png", "jpeg"],
2838
+ },
2839
+ quality: {
2840
+ type: "integer",
2841
+ minimum: 1,
2842
+ maximum: 100,
2843
+ },
2844
+ },
2845
+ default: {
2846
+ format: "jpeg",
2847
+ quality: 80,
2848
+ },
2849
+ description: "The screenshot after the actions, {format, quality} (JPEG 80 when left out); false for none.",
2850
+ },
2851
+ settle: {
2852
+ type: ["object", "boolean"],
2853
+ properties: {
2854
+ quiet_ms: {
2855
+ type: "integer",
2856
+ minimum: 0,
2857
+ maximum: 1000,
2858
+ },
2859
+ max_ms: {
2860
+ type: "integer",
2861
+ minimum: 0,
2862
+ maximum: 5000,
2863
+ },
2864
+ },
2865
+ default: {
2866
+ quiet_ms: 80,
2867
+ max_ms: 1000,
2868
+ },
2869
+ description:
2870
+ "Before the screenshot, wait until the screen has not changed for quiet_ms, at most max_ms (80 and 1000 when left out); false for no wait.",
2871
+ },
2872
+ },
2873
+ required: ["sandbox_id", "actions"],
2874
+ additionalProperties: false,
2875
+ },
2876
+ operationId: "sandboxesComputerAct",
2877
+ method: "POST",
2878
+ path: "/v1/sandboxes/{sandbox_id}/computer/actions",
2879
+ scope: "sandboxes:run",
2880
+ servedBy: "node",
2881
+ stage: "preview",
2882
+ flag: "sandboxes.desktop",
2883
+ pathParams: ["sandbox_id"],
2884
+ queryParams: [],
2885
+ body: "json",
2886
+ bodyFields: ["actions", "screenshot", "settle"],
2887
+ rawFields: [],
2888
+ toolArgs: [],
2889
+ bodyDefaults: {},
2890
+ queryDefaults: {},
2891
+ },
2892
+ {
2893
+ name: "desktop_run",
2894
+ group: "desktop",
2895
+ title: "Run a command on a desktop",
2896
+ description:
2897
+ "Run a shell command (a string, run with /bin/sh -c) or an argv array in a desktop and return its exit code, stdout and stderr. DISPLAY is set, so a command reaches the screen (xdotool, a script that opens a window). A paused desktop is resumed first. background: true returns at once with the process.",
2898
+ annotations: {
2899
+ title: "Run a command on a desktop",
2900
+ readOnlyHint: false,
2901
+ destructiveHint: true,
2902
+ openWorldHint: false,
2903
+ },
2904
+ inputSchema: {
2905
+ type: "object",
2906
+ properties: {
2907
+ sandbox_id: {
2908
+ type: "string",
2909
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2910
+ description: "The sandbox ID (`sbx_…`).",
2911
+ },
2912
+ cmd: {
2913
+ description: "A shell command line (run with `/bin/sh -c`) or an argv array.",
2914
+ oneOf: [
2915
+ {
2916
+ type: "string",
2917
+ },
2918
+ {
2919
+ type: "array",
2920
+ items: {
2921
+ type: "string",
2922
+ },
2923
+ },
2924
+ ],
2925
+ },
2926
+ cwd: {
2927
+ type: "string",
2928
+ default: "/workspace",
2929
+ },
2930
+ env: {
2931
+ type: "object",
2932
+ additionalProperties: {
2933
+ type: "string",
2934
+ },
2935
+ description: "Extra environment variables for this command.",
2936
+ },
2937
+ stdin: {
2938
+ type: "string",
2939
+ description: "Written to the command's standard input, which is then closed.",
2940
+ },
2941
+ timeout_ms: {
2942
+ type: "integer",
2943
+ minimum: 1,
2944
+ maximum: 3600000,
2945
+ description:
2946
+ "Kill the command after this long. Default 30000, or none in the background. At most 60000 unless the output is streamed or the command runs in the background.",
2947
+ },
2948
+ background: {
2949
+ type: "boolean",
2950
+ default: false,
2951
+ description: "Return at once; read output from the logs stream.",
2952
+ },
2953
+ user: {
2954
+ type: "string",
2955
+ enum: ["user", "root"],
2956
+ default: "user",
2957
+ },
2958
+ },
2959
+ required: ["sandbox_id", "cmd"],
2960
+ additionalProperties: false,
2961
+ },
2962
+ operationId: "sandboxesExec",
2963
+ method: "POST",
2964
+ path: "/v1/sandboxes/{sandbox_id}/exec",
2965
+ scope: "sandboxes:run",
2966
+ servedBy: "node",
2967
+ stage: "preview",
2968
+ flag: "sandboxes.desktop",
2969
+ pathParams: ["sandbox_id"],
2970
+ queryParams: [],
2971
+ body: "json",
2972
+ bodyFields: ["cmd", "cwd", "env", "stdin", "timeout_ms", "background", "user"],
2973
+ rawFields: [],
2974
+ toolArgs: [],
2975
+ bodyDefaults: {},
2976
+ queryDefaults: {},
2977
+ },
2277
2978
  {
2278
2979
  name: "vision_search",
2279
2980
  group: "vision",
@@ -3100,6 +3801,47 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3100
3801
  bodyDefaults: {},
3101
3802
  queryDefaults: {},
3102
3803
  },
3804
+ {
3805
+ name: "routine_publish",
3806
+ group: "routines",
3807
+ title: "Publish a routine",
3808
+ description:
3809
+ "Publish a routine definition by its name: the first publish creates it, each later one adds a version. Check it with routine_validate first. Returns the routine's id and version; run it with routine_run.",
3810
+ annotations: {
3811
+ title: "Publish a routine",
3812
+ readOnlyHint: false,
3813
+ destructiveHint: false,
3814
+ idempotentHint: false,
3815
+ openWorldHint: false,
3816
+ },
3817
+ inputSchema: {
3818
+ type: "object",
3819
+ properties: {
3820
+ routine: {
3821
+ type: "string",
3822
+ description: "The routine's name (default: definition.name).",
3823
+ },
3824
+ definition: {
3825
+ type: "object",
3826
+ description: "The definition as JSON: name and steps, optionally inputs, triggers, vars, output, defaults.",
3827
+ },
3828
+ },
3829
+ additionalProperties: false,
3830
+ },
3831
+ operationId: "routinesPublishRoutine",
3832
+ method: "PUT",
3833
+ path: "/v1/routines/{routine}",
3834
+ scope: "routines:write",
3835
+ servedBy: "node",
3836
+ pathParams: ["routine"],
3837
+ queryParams: [],
3838
+ body: "none",
3839
+ bodyFields: [],
3840
+ rawFields: [],
3841
+ toolArgs: ["definition"],
3842
+ bodyDefaults: {},
3843
+ queryDefaults: {},
3844
+ },
3103
3845
  {
3104
3846
  name: "routine_validate",
3105
3847
  group: "routines",
@@ -4591,6 +5333,131 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
4591
5333
  bodyDefaults: {},
4592
5334
  queryDefaults: {},
4593
5335
  },
5336
+ {
5337
+ name: "render_screenshot_file",
5338
+ group: "render",
5339
+ title: "Save a screenshot to a file",
5340
+ description:
5341
+ "Take a screenshot as render_screenshot does, and save the image to a file on this machine (the local server only, inside its working folder). Answers with the path, the image's size and its signed URL, never the image itself.",
5342
+ annotations: {
5343
+ title: "Save a screenshot to a file",
5344
+ readOnlyHint: false,
5345
+ destructiveHint: false,
5346
+ idempotentHint: false,
5347
+ openWorldHint: true,
5348
+ },
5349
+ inputSchema: {
5350
+ type: "object",
5351
+ properties: {
5352
+ url: {
5353
+ type: "string",
5354
+ format: "uri",
5355
+ description: "Page to load (`http` or `https`).",
5356
+ },
5357
+ html: {
5358
+ type: "string",
5359
+ description: "HTML to render instead of loading a URL. Rendered with no network access.",
5360
+ },
5361
+ viewport: {
5362
+ type: "object",
5363
+ description: "Browser viewport in CSS pixels.",
5364
+ required: ["width", "height"],
5365
+ properties: {
5366
+ width: {
5367
+ type: "integer",
5368
+ minimum: 320,
5369
+ maximum: 3840,
5370
+ },
5371
+ height: {
5372
+ type: "integer",
5373
+ minimum: 240,
5374
+ maximum: 2160,
5375
+ },
5376
+ },
5377
+ additionalProperties: false,
5378
+ },
5379
+ full_page: {
5380
+ type: "boolean",
5381
+ default: false,
5382
+ },
5383
+ target: {
5384
+ type: "object",
5385
+ description: "Capture only this element: {selector} (CSS), {text} (visible text) or {role, name}.",
5386
+ properties: {
5387
+ selector: {
5388
+ type: "string",
5389
+ },
5390
+ text: {
5391
+ type: "string",
5392
+ },
5393
+ role: {
5394
+ type: "string",
5395
+ },
5396
+ name: {
5397
+ type: "string",
5398
+ },
5399
+ },
5400
+ },
5401
+ wait_for_ms: {
5402
+ type: "integer",
5403
+ minimum: 0,
5404
+ maximum: 10000,
5405
+ default: 0,
5406
+ description: "Extra settle time after the page is ready.",
5407
+ },
5408
+ theme: {
5409
+ type: "string",
5410
+ enum: ["light", "dark", "auto"],
5411
+ default: "auto",
5412
+ description: "Emulated `prefers-color-scheme`; `auto` leaves the page default.",
5413
+ },
5414
+ hide: {
5415
+ type: "array",
5416
+ items: {
5417
+ type: "string",
5418
+ },
5419
+ description:
5420
+ "CSS selectors to hide before capture, for anything `overlays` does not find on its own (a site's own sticky promotion, a notice you do not want in the image).",
5421
+ },
5422
+ style: {
5423
+ type: "object",
5424
+ description:
5425
+ "Leave style out for a plain capture. Any style object, even {}, adds the B3OS frame. Preset IDs from GET /v1/render/presets.",
5426
+ properties: {
5427
+ background: {
5428
+ type: "string",
5429
+ },
5430
+ frame: {
5431
+ type: "string",
5432
+ },
5433
+ },
5434
+ },
5435
+ format: {
5436
+ type: "string",
5437
+ enum: ["webp", "png", "jpeg"],
5438
+ default: "webp",
5439
+ },
5440
+ path: {
5441
+ type: "string",
5442
+ description: "The file to save the image to, inside the server's working folder (shot.png).",
5443
+ },
5444
+ },
5445
+ additionalProperties: false,
5446
+ },
5447
+ operationId: "renderCreateScreenshot",
5448
+ method: "POST",
5449
+ path: "/v1/render/screenshots",
5450
+ scope: "render:run",
5451
+ servedBy: "node",
5452
+ pathParams: [],
5453
+ queryParams: [],
5454
+ body: "json",
5455
+ bodyFields: ["url", "html", "viewport", "full_page", "target", "wait_for_ms", "theme", "hide", "style", "format"],
5456
+ rawFields: [],
5457
+ toolArgs: ["path"],
5458
+ bodyDefaults: {},
5459
+ queryDefaults: {},
5460
+ },
4594
5461
  {
4595
5462
  name: "listener_create",
4596
5463
  group: "listeners",
@@ -5132,7 +5999,10 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
5132
5999
  name: {
5133
6000
  type: "string",
5134
6001
  pattern: "^[a-z][a-z0-9-]{0,62}$",
5135
- description: "Lowercase letters, digits and `-`, starting with a letter. `sessions` is reserved.",
6002
+ not: {
6003
+ enum: ["sessions", "harnesses", "grants", "self", "recipes"],
6004
+ },
6005
+ description: "Lowercase letters, digits and `-`, starting with a letter.",
5136
6006
  },
5137
6007
  source: {
5138
6008
  type: "object",
@@ -5293,6 +6163,11 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
5293
6163
  "routines:run",
5294
6164
  "listeners:read",
5295
6165
  "listeners:write",
6166
+ "workspaces:read",
6167
+ "workspaces:write",
6168
+ "workspaces:run",
6169
+ "workspaces:rules:write",
6170
+ "workspaces:subjects:assert",
5296
6171
  "actions:read",
5297
6172
  "actions:write",
5298
6173
  "actions:run",
@@ -5314,6 +6189,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
5314
6189
  "agents:*",
5315
6190
  "routines:*",
5316
6191
  "listeners:*",
6192
+ "workspaces:*",
5317
6193
  "actions:*",
5318
6194
  "infer:*",
5319
6195
  "vault:*",
@@ -5703,6 +6579,11 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
5703
6579
  "routines:run",
5704
6580
  "listeners:read",
5705
6581
  "listeners:write",
6582
+ "workspaces:read",
6583
+ "workspaces:write",
6584
+ "workspaces:run",
6585
+ "workspaces:rules:write",
6586
+ "workspaces:subjects:assert",
5706
6587
  "actions:read",
5707
6588
  "actions:write",
5708
6589
  "actions:run",
@@ -5724,6 +6605,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
5724
6605
  "agents:*",
5725
6606
  "routines:*",
5726
6607
  "listeners:*",
6608
+ "workspaces:*",
5727
6609
  "actions:*",
5728
6610
  "infer:*",
5729
6611
  "vault:*",
@@ -6732,6 +7614,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
6732
7614
  servedBy: "node",
6733
7615
  idempotent: false,
6734
7616
  },
7617
+ routinesPublishRoutine: {
7618
+ method: "PUT",
7619
+ path: "/v1/routines/{routine}",
7620
+ pathParams: ["routine"],
7621
+ scope: "routines:write",
7622
+ servedBy: "node",
7623
+ idempotent: true,
7624
+ },
6735
7625
  routinesRunEvents: {
6736
7626
  method: "GET",
6737
7627
  path: "/v1/routines/runs/{run_id}/events",
@@ -6764,6 +7654,22 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
6764
7654
  servedBy: "node",
6765
7655
  idempotent: false,
6766
7656
  },
7657
+ sandboxesComputerAct: {
7658
+ method: "POST",
7659
+ path: "/v1/sandboxes/{sandbox_id}/computer/actions",
7660
+ pathParams: ["sandbox_id"],
7661
+ scope: "sandboxes:run",
7662
+ servedBy: "node",
7663
+ idempotent: false,
7664
+ },
7665
+ sandboxesComputerScreenshot: {
7666
+ method: "GET",
7667
+ path: "/v1/sandboxes/{sandbox_id}/computer/screenshot",
7668
+ pathParams: ["sandbox_id"],
7669
+ scope: "sandboxes:read",
7670
+ servedBy: "node",
7671
+ idempotent: false,
7672
+ },
6767
7673
  sandboxesCreatePortUrl: {
6768
7674
  method: "POST",
6769
7675
  path: "/v1/sandboxes/{sandbox_id}/ports/{port}/url",
@@ -6828,6 +7734,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
6828
7734
  servedBy: "node",
6829
7735
  idempotent: true,
6830
7736
  },
7737
+ sandboxesGetCapacity: {
7738
+ method: "GET",
7739
+ path: "/v1/sandboxes/capacity",
7740
+ pathParams: [],
7741
+ scope: "sandboxes:read",
7742
+ servedBy: "node",
7743
+ idempotent: false,
7744
+ },
6831
7745
  sandboxesGetSandbox: {
6832
7746
  method: "GET",
6833
7747
  path: "/v1/sandboxes/{sandbox_id}",