@b3os/mcp 0.2.0 → 0.2.2

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.
Files changed (48) hide show
  1. package/README.md +26 -4
  2. package/dist/handlers/_common.d.ts +14 -0
  3. package/dist/handlers/_common.js +27 -0
  4. package/dist/handlers/_common.js.map +1 -1
  5. package/dist/handlers/actions.d.ts +12 -1
  6. package/dist/handlers/actions.js +51 -2
  7. package/dist/handlers/actions.js.map +1 -1
  8. package/dist/handlers/agents.d.ts +2 -0
  9. package/dist/handlers/agents.js +41 -0
  10. package/dist/handlers/agents.js.map +1 -0
  11. package/dist/handlers/platform.d.ts +32 -0
  12. package/dist/handlers/platform.js +663 -0
  13. package/dist/handlers/platform.js.map +1 -0
  14. package/dist/handlers/render.d.ts +13 -0
  15. package/dist/handlers/render.js +145 -18
  16. package/dist/handlers/render.js.map +1 -1
  17. package/dist/handlers/routines.d.ts +8 -2
  18. package/dist/handlers/routines.js +154 -15
  19. package/dist/handlers/routines.js.map +1 -1
  20. package/dist/server.js +1 -1
  21. package/dist/table.gen.js +3312 -42
  22. package/dist/table.gen.js.map +1 -1
  23. package/dist/table.js +4 -0
  24. package/dist/table.js.map +1 -1
  25. package/dist/tools.js +3 -0
  26. package/dist/tools.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/handlers/_common.ts +37 -0
  29. package/src/handlers/actions.ts +50 -2
  30. package/src/handlers/agents.ts +50 -0
  31. package/src/handlers/platform.ts +711 -0
  32. package/src/handlers/render.ts +147 -16
  33. package/src/handlers/routines.ts +164 -14
  34. package/src/server.ts +1 -1
  35. package/src/table.gen.ts +3367 -36
  36. package/src/table.ts +4 -0
  37. package/src/tools.ts +3 -0
  38. package/table/core.mjs +13 -2
  39. package/table/node-toolsets.json +668 -0
  40. package/table/requests.json +771 -0
  41. package/table/table.json +3315 -45
  42. package/table/tools/agents.mjs +230 -0
  43. package/table/tools/listeners.mjs +124 -0
  44. package/table/tools/platform.mjs +136 -3
  45. package/table/tools/render.mjs +157 -3
  46. package/table/tools/routines.mjs +37 -0
  47. package/table/tools/sandboxes.mjs +69 -0
  48. package/table/tools.mjs +3 -1
package/dist/table.gen.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Generated by packages/mcp/scripts/gen-table.mjs from packages/mcp/table/tools.mjs and packages/spec/dist.
2
2
  // Do not edit; run `node packages/mcp/scripts/gen-table.mjs`.
3
3
  /** The server-level instruction both MCP servers send. */
4
- export const MCP_INSTRUCTIONS = "B3OS tools run on a B3OS node, next to a served model: web pages, browsers, sandboxes, screenshots, routines and marketplace actions. Prefer vision_scrape over a built-in web fetch whenever you read a web page: it returns the page's main content as Markdown, uses a real browser when the page needs JavaScript, can answer from a recent cached copy. Use vision_map to list a site's URLs, vision_crawl to read many pages of one site, and vision_act to click, type or sign in on a page. Run code, shell commands, package installs and file processing in a sandbox rather than on the user's machine: sandbox_create starts an isolated microVM that stops by itself after timeout_s; then use sandbox_exec, sandbox_write_file and sandbox_read_file on its id, and sandbox_delete when you are done. render_screenshot captures a page as an image. To use a third-party service (GitHub, Slack, Linear, Notion and others) call actions_search, then actions_describe for the input schema, then actions_call; credentials come from the user's stored connections, never from tool arguments. Tools that start long jobs (vision_crawl, render_video, routine_run) wait up to wait_s seconds, then return the job id: call the same tool with job_id to keep waiting. Calls count against the API key's organization limits.";
4
+ export const MCP_INSTRUCTIONS = "B3OS tools run on a B3OS node, next to a served model: web pages, browsers, sandboxes, screenshots, routines and marketplace actions. Prefer vision_scrape over a built-in web fetch whenever you read a web page: it returns the page's main content as Markdown, uses a real browser when the page needs JavaScript, can answer from a recent cached copy. Use vision_map to list a site's URLs, vision_crawl to read many pages of one site, and vision_act to click, type or sign in on a page. Run code, shell commands, package installs and file processing in a sandbox rather than on the user's machine: sandbox_create starts an isolated microVM that stops by itself after timeout_s; then use sandbox_exec, sandbox_write_file and sandbox_read_file on its id, and sandbox_delete when you are done. render_screenshot captures a page as an image; render_video takes a goal instead of beats; the render toolset restyles, shares and lists presets. To use a third-party service (GitHub, Slack, Linear, Notion and others) call actions_search, then actions_describe for the input schema, then actions_call; credentials come from the user's stored connections, never from tool arguments. Tools that start long jobs (vision_crawl, render_video, routine_run) wait up to wait_s seconds, then return the job id: call the same tool with job_id to keep waiting. Calls count against the API key's organization limits.";
5
5
  /** Every tool, core first, in a fixed order (a deterministic tools/list keeps prompt caches warm). */
6
6
  export const MCP_TOOLS = [
7
7
  {
@@ -519,7 +519,7 @@ export const MCP_TOOLS = [
519
519
  name: "render_video",
520
520
  group: "core",
521
521
  title: "Render a product video",
522
- description: "Record a scripted product demo (beats of browser steps, optional narration and captions) as MP4, GIF and a poster image. Waits up to wait_s seconds and returns the poster; if the video is still rendering, call again with job_id.",
522
+ description: "Record a product demo as MP4, GIF and a poster: beats of browser steps, or a goal the node plans them from, with optional narration. Waits up to wait_s seconds and returns the poster; if still rendering, call again with job_id.",
523
523
  annotations: {
524
524
  title: "Render a product video",
525
525
  readOnlyHint: false,
@@ -544,8 +544,18 @@ export const MCP_TOOLS = [
544
544
  },
545
545
  additionalProperties: false,
546
546
  },
547
+ goal: {
548
+ type: "string",
549
+ description: "What the video should show, in a sentence, in place of beats: the node reads the start page, plans the beats with its model and checks them in a browser (needs vision:run and infer:run). The planned beats come back in goal.beats; send them as beats to record the same steps again.",
550
+ },
551
+ alias: {
552
+ type: "string",
553
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
554
+ description: "Name this recording (a-z, 0-9, hyphens): the alias points at the newest video made with it and keeps it past the 7-day retention, and render_share {alias} shares whichever video that is.",
555
+ },
547
556
  beats: {
548
557
  type: "array",
558
+ description: "Beats in order, each {title?, say?, do: [steps], hold_ms?}: the narration line and the browser steps performed while it is said, for example {say: 'Open billing.', do: [{kind: 'click', target: {role: 'link', name: 'Billing'}}]}. Step kinds and their required fields: navigate {url}, click {target}, hover {target}, type {text}, key {key}, scroll, select {target, value}, wait; a target is {selector}, {text} or {role, name}.",
549
559
  items: {
550
560
  type: "object",
551
561
  description: "One line of narration and the steps performed while it is said.",
@@ -576,7 +586,6 @@ export const MCP_TOOLS = [
576
586
  },
577
587
  },
578
588
  },
579
- description: "Beats in order, each {title?, say?, do: [steps], hold_ms?}: the narration line and the browser steps performed while it is said, for example {say: 'Open billing.', do: [{kind: 'click', target: {role: 'link', name: 'Billing'}}]}. Step kinds and their required fields: navigate {url}, click {target}, hover {target}, type {text}, key {key}, scroll, select {target, value}, wait; a target is {selector}, {text} or {role, name}.",
580
589
  },
581
590
  voice: {
582
591
  type: "object",
@@ -717,7 +726,7 @@ export const MCP_TOOLS = [
717
726
  },
718
727
  ],
719
728
  body: "json",
720
- bodyFields: ["source", "beats", "voice", "captions", "style", "viewport", "formats"],
729
+ bodyFields: ["source", "goal", "alias", "beats", "voice", "captions", "style", "viewport", "formats"],
721
730
  rawFields: [],
722
731
  toolArgs: ["job_id", "wait_s", "include_poster"],
723
732
  bodyDefaults: {},
@@ -747,7 +756,7 @@ export const MCP_TOOLS = [
747
756
  template: {
748
757
  type: "string",
749
758
  default: "base",
750
- description: "Template name or `tpl_` ID. Ignored when `snapshot` is set.",
759
+ description: "Template name or `tpl_` ID: a node template (`GET /v1/sandboxes/templates`) or one of your project's image templates (an image's `template`).",
751
760
  },
752
761
  snapshot: {
753
762
  type: "string",
@@ -1434,7 +1443,7 @@ export const MCP_TOOLS = [
1434
1443
  status: {
1435
1444
  type: "string",
1436
1445
  description: "Only sandboxes with this status.",
1437
- enum: ["running", "paused", "stopped", "failed"],
1446
+ enum: ["running", "paused", "stopped", "failed", "hibernated"],
1438
1447
  },
1439
1448
  limit: {
1440
1449
  type: "integer",
@@ -1557,6 +1566,135 @@ export const MCP_TOOLS = [
1557
1566
  bodyDefaults: {},
1558
1567
  queryDefaults: {},
1559
1568
  },
1569
+ {
1570
+ name: "sandbox_swarm",
1571
+ group: "sandboxes",
1572
+ title: "Run a swarm",
1573
+ description: "Fork one checkpoint (a forkable sandbox, running or paused, or a snapshot) into up to 32 children, run a command in each (one per child in children, or count copies of defaults; B3OS_SWARM_INDEX tells them apart) and return every child's exit code, output and timing. Waits up to wait_s seconds; if it is still running, call again with job_id.",
1574
+ annotations: {
1575
+ title: "Run a swarm",
1576
+ readOnlyHint: false,
1577
+ destructiveHint: false,
1578
+ openWorldHint: true,
1579
+ },
1580
+ inputSchema: {
1581
+ type: "object",
1582
+ properties: {
1583
+ from: {
1584
+ type: "object",
1585
+ description: "The checkpoint: {sandbox: sbx_…} (created with forkable: true) or {snapshot: snap_…}.",
1586
+ },
1587
+ children: {
1588
+ type: "array",
1589
+ description: "One object per child: {cmd, env, cwd, stdin, timeout_ms}; cmd is a shell line or an argv.",
1590
+ items: {
1591
+ type: "object",
1592
+ },
1593
+ },
1594
+ count: {
1595
+ type: "integer",
1596
+ minimum: 1,
1597
+ maximum: 32,
1598
+ description: "This many children, each running `defaults`.",
1599
+ },
1600
+ defaults: {
1601
+ type: "object",
1602
+ description: "The child spec every child starts from ({cmd, env, cwd, timeout_ms}).",
1603
+ },
1604
+ stop_when: {
1605
+ type: "string",
1606
+ enum: ["all", "first_success"],
1607
+ default: "all",
1608
+ description: "`first_success`: once a child exits 0, kill the other children's commands and end the swarm.",
1609
+ },
1610
+ keep: {
1611
+ type: "string",
1612
+ enum: ["none", "succeeded", "all"],
1613
+ default: "none",
1614
+ description: "Which children stay running after their command ends; the rest are deleted.",
1615
+ },
1616
+ job_id: {
1617
+ type: "string",
1618
+ description: "A swm_… id from an earlier call: keep waiting or read the results.",
1619
+ },
1620
+ wait_s: {
1621
+ type: "integer",
1622
+ minimum: 0,
1623
+ maximum: 60,
1624
+ default: 50,
1625
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
1626
+ },
1627
+ },
1628
+ additionalProperties: false,
1629
+ },
1630
+ operationId: "sandboxesCreateSwarm",
1631
+ method: "POST",
1632
+ path: "/v1/sandboxes/swarms",
1633
+ scope: "sandboxes:write",
1634
+ servedBy: "node",
1635
+ stage: "preview",
1636
+ flag: "sandboxes.swarms",
1637
+ pathParams: [],
1638
+ queryParams: [
1639
+ {
1640
+ name: "wait",
1641
+ from: "wait_s",
1642
+ },
1643
+ ],
1644
+ body: "json",
1645
+ bodyFields: ["from", "children", "count", "defaults", "stop_when", "keep"],
1646
+ rawFields: [],
1647
+ toolArgs: ["job_id", "wait_s"],
1648
+ bodyDefaults: {},
1649
+ queryDefaults: {},
1650
+ continueWith: {
1651
+ arg: "job_id",
1652
+ operationId: "sandboxesGetSwarm",
1653
+ method: "GET",
1654
+ path: "/v1/sandboxes/swarms/{swarm_id}",
1655
+ pathParam: "swarm_id",
1656
+ },
1657
+ },
1658
+ {
1659
+ name: "sandbox_cancel_swarm",
1660
+ group: "sandboxes",
1661
+ title: "Cancel a swarm",
1662
+ description: "Stop a running swarm: its children's commands are killed and the children deleted unless its keep keeps them.",
1663
+ annotations: {
1664
+ title: "Cancel a swarm",
1665
+ readOnlyHint: false,
1666
+ destructiveHint: true,
1667
+ idempotentHint: true,
1668
+ openWorldHint: false,
1669
+ },
1670
+ inputSchema: {
1671
+ type: "object",
1672
+ properties: {
1673
+ swarm_id: {
1674
+ type: "string",
1675
+ pattern: "^swm_[0-9a-hjkmnp-tv-z]{26}$",
1676
+ description: "The swarm ID (`swm_…`).",
1677
+ },
1678
+ },
1679
+ required: ["swarm_id"],
1680
+ additionalProperties: false,
1681
+ },
1682
+ operationId: "sandboxesCancelSwarm",
1683
+ method: "POST",
1684
+ path: "/v1/sandboxes/swarms/{swarm_id}/cancel",
1685
+ scope: "sandboxes:write",
1686
+ servedBy: "node",
1687
+ stage: "preview",
1688
+ flag: "sandboxes.swarms",
1689
+ pathParams: ["swarm_id"],
1690
+ queryParams: [],
1691
+ body: "none",
1692
+ bodyFields: [],
1693
+ rawFields: [],
1694
+ toolArgs: [],
1695
+ bodyDefaults: {},
1696
+ queryDefaults: {},
1697
+ },
1560
1698
  {
1561
1699
  name: "sandbox_snapshot",
1562
1700
  group: "sandboxes",
@@ -1880,6 +2018,81 @@ export const MCP_TOOLS = [
1880
2018
  bodyDefaults: {},
1881
2019
  queryDefaults: {},
1882
2020
  },
2021
+ {
2022
+ name: "sandbox_port_host",
2023
+ group: "sandboxes",
2024
+ title: "Give a port its own host",
2025
+ description: "Give a port inside the sandbox its own host, https://<port>-sbx-<id>.b3os.io, where the app runs at / and keeps its cookies, so sign-in works. Returns the host and a link that opens it (shared by link only; the link is a secret). Prefer it to sandbox_port_url for web apps; rotate: true ends every earlier link.",
2026
+ annotations: {
2027
+ title: "Give a port its own host",
2028
+ readOnlyHint: false,
2029
+ destructiveHint: false,
2030
+ openWorldHint: false,
2031
+ },
2032
+ inputSchema: {
2033
+ type: "object",
2034
+ properties: {
2035
+ sandbox_id: {
2036
+ type: "string",
2037
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2038
+ description: "The sandbox ID (`sbx_…`).",
2039
+ },
2040
+ port: {
2041
+ type: "integer",
2042
+ minimum: 1,
2043
+ maximum: 65535,
2044
+ description: "A port declared in the sandbox's `ports` (not 49983, which is kept for E2B's envd).",
2045
+ },
2046
+ ttl_s: {
2047
+ type: "integer",
2048
+ minimum: 60,
2049
+ maximum: 86400,
2050
+ default: 600,
2051
+ description: "How long the link works, in seconds.",
2052
+ },
2053
+ rotate: {
2054
+ type: "boolean",
2055
+ default: false,
2056
+ description: "Replace the host's secret first: every earlier link and cookie of this host stops working within 6 seconds (streams already open can run up to an hour).",
2057
+ },
2058
+ cookies: {
2059
+ type: "object",
2060
+ required: ["mode", "script"],
2061
+ properties: {
2062
+ mode: {
2063
+ type: "string",
2064
+ enum: ["isolated", "shared"],
2065
+ description: "`isolated`: the app's server gets only the cookies its own address set, plus...",
2066
+ },
2067
+ script: {
2068
+ type: "array",
2069
+ description: "Cookies a page script writes and the app's server reads, by name.",
2070
+ items: {
2071
+ type: "string",
2072
+ pattern: "^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,64}$",
2073
+ },
2074
+ },
2075
+ },
2076
+ additionalProperties: false,
2077
+ },
2078
+ },
2079
+ required: ["sandbox_id", "port"],
2080
+ additionalProperties: false,
2081
+ },
2082
+ operationId: "platformCreatePortHost",
2083
+ method: "POST",
2084
+ path: "/v1/sandboxes/{sandbox_id}/ports/{port}/host",
2085
+ scope: "sandboxes:run",
2086
+ servedBy: "edge",
2087
+ pathParams: ["sandbox_id", "port"],
2088
+ queryParams: [],
2089
+ body: "json",
2090
+ bodyFields: ["ttl_s", "rotate", "cookies"],
2091
+ rawFields: [],
2092
+ toolArgs: [],
2093
+ bodyDefaults: {},
2094
+ queryDefaults: {},
2095
+ },
1883
2096
  {
1884
2097
  name: "sandbox_logs",
1885
2098
  group: "sandboxes",
@@ -2685,6 +2898,69 @@ export const MCP_TOOLS = [
2685
2898
  bodyDefaults: {},
2686
2899
  queryDefaults: {},
2687
2900
  },
2901
+ {
2902
+ name: "routine_list_runs",
2903
+ group: "routines",
2904
+ title: "List a routine's runs",
2905
+ description: "List a routine's recent runs (by name or rtn_ id), newest first, one line each with its status, trigger, version, duration and outcome, and for a failed run the step it failed at with the error.",
2906
+ annotations: {
2907
+ title: "List a routine's runs",
2908
+ readOnlyHint: true,
2909
+ openWorldHint: false,
2910
+ },
2911
+ inputSchema: {
2912
+ type: "object",
2913
+ properties: {
2914
+ routine: {
2915
+ type: "string",
2916
+ description: "A routine ID (`rtn_…`) or name. Names are unique per project; `runs`, `hooks`, `validate` and `import` are reserved and cannot be routine names.",
2917
+ },
2918
+ status: {
2919
+ type: "string",
2920
+ description: "Only runs with this status.",
2921
+ enum: ["queued", "running", "succeeded", "failed", "canceled"],
2922
+ },
2923
+ limit: {
2924
+ type: "integer",
2925
+ minimum: 1,
2926
+ maximum: 100,
2927
+ default: 10,
2928
+ description: "Page size, from 1 to 100.",
2929
+ },
2930
+ cursor: {
2931
+ type: "string",
2932
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
2933
+ },
2934
+ },
2935
+ required: ["routine"],
2936
+ additionalProperties: false,
2937
+ },
2938
+ operationId: "routinesListRuns",
2939
+ method: "GET",
2940
+ path: "/v1/routines/{routine}/runs",
2941
+ scope: "routines:read",
2942
+ servedBy: "node",
2943
+ pathParams: ["routine"],
2944
+ queryParams: [
2945
+ {
2946
+ name: "status",
2947
+ },
2948
+ {
2949
+ name: "limit",
2950
+ },
2951
+ {
2952
+ name: "cursor",
2953
+ },
2954
+ ],
2955
+ body: "none",
2956
+ bodyFields: [],
2957
+ rawFields: [],
2958
+ toolArgs: [],
2959
+ bodyDefaults: {},
2960
+ queryDefaults: {
2961
+ limit: 10,
2962
+ },
2963
+ },
2688
2964
  {
2689
2965
  name: "routine_get_run",
2690
2966
  group: "routines",
@@ -2721,6 +2997,49 @@ export const MCP_TOOLS = [
2721
2997
  bodyDefaults: {},
2722
2998
  queryDefaults: {},
2723
2999
  },
3000
+ {
3001
+ name: "routine_run_events",
3002
+ group: "routines",
3003
+ title: "Read a run's events",
3004
+ description: "Read a finished run's event log: when each step started, retried, waited and ended, with errors, and the run.log lines of its core/log steps. A run still in progress answers with its steps so far.",
3005
+ annotations: {
3006
+ title: "Read a run's events",
3007
+ readOnlyHint: true,
3008
+ openWorldHint: false,
3009
+ },
3010
+ inputSchema: {
3011
+ type: "object",
3012
+ properties: {
3013
+ run_id: {
3014
+ type: "string",
3015
+ pattern: "^run_[0-9a-hjkmnp-tv-z]{26}$",
3016
+ description: "The run ID (`run_…`).",
3017
+ },
3018
+ max_events: {
3019
+ type: "integer",
3020
+ minimum: 1,
3021
+ maximum: 500,
3022
+ default: 40,
3023
+ description: "The last events to show; the answer counts the earlier ones.",
3024
+ },
3025
+ },
3026
+ required: ["run_id"],
3027
+ additionalProperties: false,
3028
+ },
3029
+ operationId: "routinesRunEvents",
3030
+ method: "GET",
3031
+ path: "/v1/routines/runs/{run_id}/events",
3032
+ scope: "routines:read",
3033
+ servedBy: "node",
3034
+ pathParams: ["run_id"],
3035
+ queryParams: [],
3036
+ body: "none",
3037
+ bodyFields: [],
3038
+ rawFields: [],
3039
+ toolArgs: ["max_events"],
3040
+ bodyDefaults: {},
3041
+ queryDefaults: {},
3042
+ },
2724
3043
  {
2725
3044
  name: "routine_validate",
2726
3045
  group: "routines",
@@ -3015,7 +3334,7 @@ export const MCP_TOOLS = [
3015
3334
  name: "requests_list",
3016
3335
  group: "platform",
3017
3336
  title: "List API requests",
3018
- description: "List the API requests the node served for this project in the last 7 days, newest first; filter by product, operation, status, key, connection kind, sandbox or time.",
3337
+ description: "List the API requests the node served for this project in the last 7 days, newest first, one line each with its status, duration and error; filter by product, operation, status, key, source, connection kind, sandbox, trace or time.",
3019
3338
  annotations: {
3020
3339
  title: "List API requests",
3021
3340
  readOnlyHint: true,
@@ -3039,6 +3358,10 @@ export const MCP_TOOLS = [
3039
3358
  type: "string",
3040
3359
  pattern: "^key_[0-9a-hjkmnp-tv-z]{26}$",
3041
3360
  },
3361
+ source: {
3362
+ type: "string",
3363
+ description: "Only requests from this source, or from any of a comma-separated list of them (`api_key,cli_token`), each a `RequestSource` value at most once.",
3364
+ },
3042
3365
  connection: {
3043
3366
  type: "string",
3044
3367
  description: "Only requests that arrived this way.",
@@ -3049,6 +3372,11 @@ export const MCP_TOOLS = [
3049
3372
  pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3050
3373
  description: "Only requests made from inside this sandbox.",
3051
3374
  },
3375
+ trace_id: {
3376
+ type: "string",
3377
+ pattern: "^[0-9a-f]{32}$",
3378
+ description: "Only requests of this W3C trace (the trace id of their `traceparent`): one chain of calls, such as a scrape, then a render, then a sandbox exec, made with on...",
3379
+ },
3052
3380
  since: {
3053
3381
  type: "string",
3054
3382
  format: "date-time",
@@ -3086,12 +3414,18 @@ export const MCP_TOOLS = [
3086
3414
  {
3087
3415
  name: "key_id",
3088
3416
  },
3417
+ {
3418
+ name: "source",
3419
+ },
3089
3420
  {
3090
3421
  name: "connection",
3091
3422
  },
3092
3423
  {
3093
3424
  name: "sandbox_id",
3094
3425
  },
3426
+ {
3427
+ name: "trace_id",
3428
+ },
3095
3429
  {
3096
3430
  name: "since",
3097
3431
  },
@@ -3113,7 +3447,7 @@ export const MCP_TOOLS = [
3113
3447
  name: "requests_get",
3114
3448
  group: "platform",
3115
3449
  title: "Get an API request",
3116
- description: "Get one request by its ID (a response's x-request-id) with its full timing phase breakdown, node and edge.",
3450
+ description: "Get one request by its ID (a response's x-request-id): its timing phase breakdown (node and edge), its error if it failed, and the usage it was charged.",
3117
3451
  annotations: {
3118
3452
  title: "Get an API request",
3119
3453
  readOnlyHint: true,
@@ -3146,36 +3480,2606 @@ export const MCP_TOOLS = [
3146
3480
  queryDefaults: {},
3147
3481
  },
3148
3482
  {
3149
- name: "webhooks_list_deliveries",
3483
+ name: "traces_list",
3150
3484
  group: "platform",
3151
- title: "List webhook deliveries",
3152
- description: "List webhook deliveries with their attempts and answers; filter by url, job or status.",
3485
+ title: "List traces",
3486
+ description: "List recent traces from the request log, newest first: each is the calls that shared one trace id (one turn of an agent), with its start, duration, calls by kind and its first error.",
3153
3487
  annotations: {
3154
- title: "List webhook deliveries",
3488
+ title: "List traces",
3155
3489
  readOnlyHint: true,
3156
3490
  openWorldHint: false,
3157
3491
  },
3158
3492
  inputSchema: {
3159
3493
  type: "object",
3160
3494
  properties: {
3161
- url: {
3495
+ since: {
3162
3496
  type: "string",
3163
- format: "uri",
3164
- description: "Only deliveries to this endpoint.",
3497
+ format: "date-time",
3498
+ description: "Only requests from this time on (RFC 3339); the log keeps 7 days.",
3165
3499
  },
3166
- job_id: {
3500
+ sandbox_id: {
3167
3501
  type: "string",
3168
- description: "Only deliveries for this job.",
3502
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3503
+ description: "Only requests made from inside this sandbox.",
3504
+ },
3505
+ source: {
3506
+ type: "string",
3507
+ description: "Only requests from this source, or from any of a comma-separated list of them (`api_key,cli_token`), each a `RequestSource` value at most once.",
3508
+ },
3509
+ status: {
3510
+ type: "string",
3511
+ enum: ["ok", "error"],
3512
+ description: "Only traces where no call failed (ok), or where at least one did (error).",
3513
+ },
3514
+ app: {
3515
+ type: "string",
3516
+ pattern: "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
3517
+ description: "Only traces of this application's services (its b3os.yaml name); also needs sandboxes:read.",
3518
+ },
3519
+ single_calls: {
3520
+ type: "boolean",
3521
+ default: false,
3522
+ description: "Also list traces of one call and its retries (a call made outside a turn has its own).",
3523
+ },
3524
+ limit: {
3525
+ type: "integer",
3526
+ minimum: 1,
3527
+ maximum: 50,
3528
+ default: 10,
3529
+ description: "Traces to list.",
3530
+ },
3531
+ },
3532
+ additionalProperties: false,
3533
+ },
3534
+ operationId: "platformListRequests",
3535
+ method: "GET",
3536
+ path: "/v1/requests",
3537
+ scope: "platform:read",
3538
+ servedBy: "node",
3539
+ pathParams: [],
3540
+ queryParams: [
3541
+ {
3542
+ name: "since",
3543
+ },
3544
+ {
3545
+ name: "sandbox_id",
3546
+ },
3547
+ {
3548
+ name: "source",
3549
+ },
3550
+ ],
3551
+ body: "none",
3552
+ bodyFields: [],
3553
+ rawFields: [],
3554
+ toolArgs: ["status", "app", "single_calls", "limit"],
3555
+ bodyDefaults: {},
3556
+ queryDefaults: {},
3557
+ },
3558
+ {
3559
+ name: "traces_get",
3560
+ group: "platform",
3561
+ title: "Get a trace",
3562
+ description: "Read one trace as a waterfall: its calls in start order, each with its kind, start offset, duration, status, the operation or model it called, its tokens and usage, and the error of a failed call.",
3563
+ annotations: {
3564
+ title: "Get a trace",
3565
+ readOnlyHint: true,
3566
+ openWorldHint: false,
3567
+ },
3568
+ inputSchema: {
3569
+ type: "object",
3570
+ properties: {
3571
+ trace_id: {
3572
+ type: "string",
3573
+ pattern: "^[0-9a-f]{32}$",
3574
+ description: "The trace's 32-hex id: a request's trace_id, or one traces_list gave.",
3575
+ },
3576
+ max_spans: {
3577
+ type: "integer",
3578
+ minimum: 1,
3579
+ maximum: 300,
3580
+ default: 25,
3581
+ description: "Spans to show; the answer counts the rest and says how to read them.",
3582
+ },
3583
+ from_span: {
3584
+ type: "integer",
3585
+ minimum: 1,
3586
+ maximum: 300,
3587
+ default: 1,
3588
+ description: "The first span to show, by its number in an earlier answer.",
3589
+ },
3590
+ },
3591
+ required: ["trace_id"],
3592
+ additionalProperties: false,
3593
+ },
3594
+ operationId: "platformGetTrace",
3595
+ method: "GET",
3596
+ path: "/v1/traces/{trace_id}",
3597
+ scope: "platform:read",
3598
+ servedBy: "edge",
3599
+ pathParams: ["trace_id"],
3600
+ queryParams: [],
3601
+ body: "none",
3602
+ bodyFields: [],
3603
+ rawFields: [],
3604
+ toolArgs: ["max_spans", "from_span"],
3605
+ bodyDefaults: {},
3606
+ queryDefaults: {},
3607
+ },
3608
+ {
3609
+ name: "llm_calls_list",
3610
+ group: "platform",
3611
+ title: "List kept model calls",
3612
+ description: "List the model calls prompt logging kept in the last 7 days, newest first: model, tokens, timing, finish reason and the tools the model chose, never the prompt; filter by trace, model, sandbox or time.",
3613
+ annotations: {
3614
+ title: "List kept model calls",
3615
+ readOnlyHint: true,
3616
+ openWorldHint: false,
3617
+ },
3618
+ inputSchema: {
3619
+ type: "object",
3620
+ properties: {
3621
+ trace_id: {
3622
+ type: "string",
3623
+ pattern: "^[0-9a-f]{32}$",
3624
+ description: "Only calls of this W3C trace (the trace id of their `traceparent`).",
3625
+ },
3626
+ model: {
3627
+ type: "string",
3628
+ },
3629
+ sandbox_id: {
3630
+ type: "string",
3631
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3632
+ description: "Only calls made from inside this sandbox.",
3633
+ },
3634
+ since: {
3635
+ type: "string",
3636
+ format: "date-time",
3637
+ },
3638
+ limit: {
3639
+ type: "integer",
3640
+ minimum: 1,
3641
+ maximum: 100,
3642
+ default: 10,
3643
+ description: "Page size, from 1 to 100.",
3644
+ },
3645
+ cursor: {
3646
+ type: "string",
3647
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3648
+ },
3649
+ },
3650
+ additionalProperties: false,
3651
+ },
3652
+ operationId: "platformListLlmCalls",
3653
+ method: "GET",
3654
+ path: "/v1/llm-calls",
3655
+ scope: "platform:read",
3656
+ servedBy: "node",
3657
+ pathParams: [],
3658
+ queryParams: [
3659
+ {
3660
+ name: "trace_id",
3661
+ },
3662
+ {
3663
+ name: "model",
3664
+ },
3665
+ {
3666
+ name: "sandbox_id",
3667
+ },
3668
+ {
3669
+ name: "since",
3670
+ },
3671
+ {
3672
+ name: "limit",
3673
+ },
3674
+ {
3675
+ name: "cursor",
3676
+ },
3677
+ ],
3678
+ body: "none",
3679
+ bodyFields: [],
3680
+ rawFields: [],
3681
+ toolArgs: [],
3682
+ bodyDefaults: {},
3683
+ queryDefaults: {
3684
+ limit: 10,
3685
+ },
3686
+ },
3687
+ {
3688
+ name: "llm_calls_get",
3689
+ group: "platform",
3690
+ title: "Get a kept model call",
3691
+ description: "Get one kept model call's metadata by its request ID: model, sampling settings, tools offered and chosen, tokens, timing and what of its content was kept; never the prompt or the answer.",
3692
+ annotations: {
3693
+ title: "Get a kept model call",
3694
+ readOnlyHint: true,
3695
+ openWorldHint: false,
3696
+ },
3697
+ inputSchema: {
3698
+ type: "object",
3699
+ properties: {
3700
+ request_id: {
3701
+ type: "string",
3702
+ pattern: "^req_[0-9a-hjkmnp-tv-z]{26}$",
3703
+ description: "The request ID of the model call (its `x-request-id`).",
3704
+ },
3705
+ },
3706
+ required: ["request_id"],
3707
+ additionalProperties: false,
3708
+ },
3709
+ operationId: "platformGetLlmCall",
3710
+ method: "GET",
3711
+ path: "/v1/llm-calls/{request_id}",
3712
+ scope: "platform:read",
3713
+ servedBy: "node",
3714
+ pathParams: ["request_id"],
3715
+ queryParams: [],
3716
+ body: "none",
3717
+ bodyFields: [],
3718
+ rawFields: [],
3719
+ toolArgs: [],
3720
+ bodyDefaults: {},
3721
+ queryDefaults: {},
3722
+ },
3723
+ {
3724
+ name: "llm_calls_get_prompt_and_answer",
3725
+ group: "platform",
3726
+ title: "Read a model call's prompt and answer",
3727
+ description: "Read a kept model call's prompt and answer: the messages and tools as the caller sent them, and the text, reasoning and tool calls the model gave. Sensitive: needs platform:content:read, which no wildcard grants; known key shapes read [redacted:<kind>]. Long strings are cut in the middle and the answer stops at max_chars; it says how to read more.",
3728
+ annotations: {
3729
+ title: "Read a model call's prompt and answer",
3730
+ readOnlyHint: true,
3731
+ openWorldHint: false,
3732
+ },
3733
+ inputSchema: {
3734
+ type: "object",
3735
+ properties: {
3736
+ request_id: {
3737
+ type: "string",
3738
+ pattern: "^req_[0-9a-hjkmnp-tv-z]{26}$",
3739
+ description: "The request ID of the model call (its `x-request-id`).",
3740
+ },
3741
+ max_chars: {
3742
+ type: "integer",
3743
+ minimum: 1000,
3744
+ maximum: 100000,
3745
+ default: 12000,
3746
+ description: "Characters of text to return at most.",
3747
+ },
3748
+ max_field_chars: {
3749
+ type: "integer",
3750
+ minimum: 200,
3751
+ maximum: 100000,
3752
+ default: 2000,
3753
+ description: "A message, the answer or a tool call's arguments longer than this is cut in the middle.",
3754
+ },
3755
+ },
3756
+ required: ["request_id"],
3757
+ additionalProperties: false,
3758
+ },
3759
+ operationId: "platformGetLlmCallContent",
3760
+ method: "GET",
3761
+ path: "/v1/llm-calls/{request_id}/content",
3762
+ scope: "platform:content:read",
3763
+ servedBy: "node",
3764
+ pathParams: ["request_id"],
3765
+ queryParams: [],
3766
+ body: "none",
3767
+ bodyFields: [],
3768
+ rawFields: [],
3769
+ toolArgs: ["max_chars", "max_field_chars"],
3770
+ bodyDefaults: {},
3771
+ queryDefaults: {},
3772
+ },
3773
+ {
3774
+ name: "webhooks_list_deliveries",
3775
+ group: "platform",
3776
+ title: "List webhook deliveries",
3777
+ description: "List webhook deliveries with their attempts and answers; filter by url, job or status.",
3778
+ annotations: {
3779
+ title: "List webhook deliveries",
3780
+ readOnlyHint: true,
3781
+ openWorldHint: false,
3782
+ },
3783
+ inputSchema: {
3784
+ type: "object",
3785
+ properties: {
3786
+ url: {
3787
+ type: "string",
3788
+ format: "uri",
3789
+ description: "Only deliveries to this endpoint.",
3790
+ },
3791
+ job_id: {
3792
+ type: "string",
3793
+ description: "Only deliveries for this job.",
3794
+ },
3795
+ status: {
3796
+ type: "string",
3797
+ enum: ["pending", "retrying", "succeeded", "failed"],
3798
+ },
3799
+ limit: {
3800
+ type: "integer",
3801
+ minimum: 1,
3802
+ maximum: 100,
3803
+ default: 20,
3804
+ description: "Page size, from 1 to 100.",
3805
+ },
3806
+ cursor: {
3807
+ type: "string",
3808
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3809
+ },
3810
+ },
3811
+ additionalProperties: false,
3812
+ },
3813
+ operationId: "webhooksListDeliveries",
3814
+ method: "GET",
3815
+ path: "/v1/webhooks/deliveries",
3816
+ scope: "platform:read",
3817
+ servedBy: "node",
3818
+ pathParams: [],
3819
+ queryParams: [
3820
+ {
3821
+ name: "url",
3822
+ },
3823
+ {
3824
+ name: "job_id",
3825
+ },
3826
+ {
3827
+ name: "status",
3828
+ },
3829
+ {
3830
+ name: "limit",
3831
+ },
3832
+ {
3833
+ name: "cursor",
3834
+ },
3835
+ ],
3836
+ body: "none",
3837
+ bodyFields: [],
3838
+ rawFields: [],
3839
+ toolArgs: [],
3840
+ bodyDefaults: {},
3841
+ queryDefaults: {},
3842
+ },
3843
+ {
3844
+ name: "webhooks_send_test",
3845
+ group: "platform",
3846
+ title: "Send a test webhook",
3847
+ description: "Send one signed webhook.test event to a URL now and return the delivery with its outcome (not retried).",
3848
+ annotations: {
3849
+ title: "Send a test webhook",
3850
+ readOnlyHint: false,
3851
+ destructiveHint: false,
3852
+ openWorldHint: true,
3853
+ },
3854
+ inputSchema: {
3855
+ type: "object",
3856
+ properties: {
3857
+ url: {
3858
+ type: "string",
3859
+ format: "uri",
3860
+ },
3861
+ },
3862
+ required: ["url"],
3863
+ additionalProperties: false,
3864
+ },
3865
+ operationId: "webhooksSendTest",
3866
+ method: "POST",
3867
+ path: "/v1/webhooks/test",
3868
+ scope: "platform:write",
3869
+ servedBy: "node",
3870
+ pathParams: [],
3871
+ queryParams: [],
3872
+ body: "json",
3873
+ bodyFields: ["url"],
3874
+ rawFields: [],
3875
+ toolArgs: [],
3876
+ bodyDefaults: {},
3877
+ queryDefaults: {},
3878
+ },
3879
+ {
3880
+ name: "render_inspect",
3881
+ group: "render",
3882
+ title: "Inspect a page frame by frame",
3883
+ description: "Load a page, run optional browser steps, and record every frame of a short window (or read the same window from a finished video with video_id). Returns what changed between frames as plain lines (layout shifts in px, flashes, cuts, changed regions, watched elements' boxes) and one contact-sheet image of timestamped frames with before/after crops. Use it to check that a load or a click does not jump, flash or leave a skeleton. Give url or video_id. Bills one render.inspection_s per second of window.",
3884
+ annotations: {
3885
+ title: "Inspect a page frame by frame",
3886
+ readOnlyHint: true,
3887
+ openWorldHint: true,
3888
+ },
3889
+ inputSchema: {
3890
+ type: "object",
3891
+ properties: {
3892
+ url: {
3893
+ type: "string",
3894
+ format: "uri",
3895
+ description: "Page to load (`http` or `https`), checked by the egress guard.",
3896
+ },
3897
+ video_id: {
3898
+ type: "string",
3899
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
3900
+ description: "A succeeded video of this project to read the window from.",
3901
+ },
3902
+ steps: {
3903
+ type: "array",
3904
+ description: "Browser steps in order (url only): step 0 starts at 300 ms, each next one when the one before ends. Step kinds and their required fields: navigate {url}, click {target}, hover {target}, type {text}, key {key}, scroll, select {target, value}, wait; a target is {selector}, {text} or {role, name}.",
3905
+ items: {
3906
+ description: "One browser step of a beat; `kind` selects it.",
3907
+ oneOf: [
3908
+ {
3909
+ type: "object",
3910
+ required: ["kind", "url"],
3911
+ properties: {
3912
+ kind: {
3913
+ type: "string",
3914
+ const: "navigate",
3915
+ },
3916
+ url: {
3917
+ type: "string",
3918
+ format: "uri",
3919
+ },
3920
+ wait_until: {
3921
+ type: "string",
3922
+ enum: ["load", "domcontentloaded", "networkidle"],
3923
+ default: "load",
3924
+ },
3925
+ timeout_ms: {
3926
+ type: "integer",
3927
+ minimum: 100,
3928
+ maximum: 120000,
3929
+ default: 10000,
3930
+ },
3931
+ },
3932
+ },
3933
+ {
3934
+ type: "object",
3935
+ required: ["kind", "target"],
3936
+ properties: {
3937
+ kind: {
3938
+ type: "string",
3939
+ const: "click",
3940
+ },
3941
+ target: {
3942
+ type: "object",
3943
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
3944
+ },
3945
+ button: {
3946
+ type: "string",
3947
+ enum: ["left", "right", "middle"],
3948
+ default: "left",
3949
+ },
3950
+ count: {
3951
+ type: "integer",
3952
+ minimum: 1,
3953
+ maximum: 3,
3954
+ default: 1,
3955
+ },
3956
+ modifiers: {
3957
+ type: "array",
3958
+ description: "Modifier keys held during the action.",
3959
+ },
3960
+ },
3961
+ },
3962
+ {
3963
+ type: "object",
3964
+ required: ["kind", "target"],
3965
+ properties: {
3966
+ kind: {
3967
+ type: "string",
3968
+ const: "hover",
3969
+ },
3970
+ target: {
3971
+ type: "object",
3972
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
3973
+ },
3974
+ },
3975
+ },
3976
+ {
3977
+ type: "object",
3978
+ required: ["kind", "text"],
3979
+ properties: {
3980
+ kind: {
3981
+ type: "string",
3982
+ const: "type",
3983
+ },
3984
+ target: {
3985
+ type: "object",
3986
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
3987
+ },
3988
+ text: {
3989
+ type: "string",
3990
+ },
3991
+ interval_ms: {
3992
+ type: "integer",
3993
+ minimum: 0,
3994
+ maximum: 1000,
3995
+ default: 35,
3996
+ description: "Delay between characters on the video's clock.",
3997
+ },
3998
+ },
3999
+ },
4000
+ {
4001
+ type: "object",
4002
+ required: ["kind", "key"],
4003
+ properties: {
4004
+ kind: {
4005
+ type: "string",
4006
+ const: "key",
4007
+ },
4008
+ key: {
4009
+ type: "string",
4010
+ },
4011
+ modifiers: {
4012
+ type: "array",
4013
+ description: "Modifier keys held during the action.",
4014
+ },
4015
+ },
4016
+ },
4017
+ {
4018
+ type: "object",
4019
+ required: ["kind"],
4020
+ description: "Scroll to an offset (`to`), by a delta (`by`), or until `target` is in view.",
4021
+ properties: {
4022
+ kind: {
4023
+ type: "string",
4024
+ const: "scroll",
4025
+ },
4026
+ target: {
4027
+ type: "object",
4028
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4029
+ },
4030
+ to: {
4031
+ type: "object",
4032
+ description: "A position in CSS pixels.",
4033
+ },
4034
+ by: {
4035
+ type: "object",
4036
+ description: "A position in CSS pixels.",
4037
+ },
4038
+ duration_ms: {
4039
+ type: "integer",
4040
+ minimum: 0,
4041
+ maximum: 10000,
4042
+ default: 600,
4043
+ },
4044
+ },
4045
+ },
4046
+ {
4047
+ type: "object",
4048
+ required: ["kind", "target", "value"],
4049
+ properties: {
4050
+ kind: {
4051
+ type: "string",
4052
+ const: "select",
4053
+ },
4054
+ target: {
4055
+ type: "object",
4056
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4057
+ },
4058
+ value: {
4059
+ type: "string",
4060
+ },
4061
+ },
4062
+ },
4063
+ {
4064
+ type: "object",
4065
+ required: ["kind"],
4066
+ description: "Pause the story (`ms`) or hold the clock until a condition holds (`for`).",
4067
+ properties: {
4068
+ kind: {
4069
+ type: "string",
4070
+ const: "wait",
4071
+ },
4072
+ ms: {
4073
+ type: "integer",
4074
+ minimum: 1,
4075
+ maximum: 30000,
4076
+ },
4077
+ for: {
4078
+ type: "object",
4079
+ description: "Exactly one condition to wait for (the same as a timeline `wait` action's `fo...",
4080
+ },
4081
+ timeout_ms: {
4082
+ type: "integer",
4083
+ minimum: 100,
4084
+ maximum: 120000,
4085
+ default: 10000,
4086
+ },
4087
+ },
4088
+ },
4089
+ ],
4090
+ discriminator: {
4091
+ propertyName: "kind",
4092
+ mapping: {
4093
+ navigate: "#/components/schemas/StepNavigate",
4094
+ click: "#/components/schemas/StepClick",
4095
+ hover: "#/components/schemas/StepHover",
4096
+ type: "#/components/schemas/StepType",
4097
+ key: "#/components/schemas/StepKey",
4098
+ scroll: "#/components/schemas/StepScroll",
4099
+ select: "#/components/schemas/StepSelect",
4100
+ wait: "#/components/schemas/StepWait",
4101
+ },
4102
+ },
4103
+ },
4104
+ },
4105
+ watch: {
4106
+ type: "array",
4107
+ description: "Elements whose box is read on every frame (url only; the answer's trace): each {selector} (CSS) or {text, exact?, nth?}, at most 8; role and name are not accepted here.",
4108
+ items: {
4109
+ type: "object",
4110
+ description: "An element to follow frame by frame: `selector` (CSS), or visible `text` (cas...",
4111
+ properties: {
4112
+ selector: {
4113
+ type: "string",
4114
+ },
4115
+ text: {
4116
+ type: "string",
4117
+ },
4118
+ exact: {
4119
+ type: "boolean",
4120
+ default: false,
4121
+ },
4122
+ nth: {
4123
+ type: "integer",
4124
+ minimum: 0,
4125
+ maximum: 1000,
4126
+ },
4127
+ },
4128
+ oneOf: [
4129
+ {
4130
+ required: ["selector"],
4131
+ },
4132
+ {
4133
+ required: ["text"],
4134
+ },
4135
+ ],
4136
+ },
4137
+ },
4138
+ duration_ms: {
4139
+ type: "integer",
4140
+ minimum: 500,
4141
+ maximum: 10000,
4142
+ description: "Length of the window. Default 3000; with `video_id`, the rest of the video from `from_ms`, at most 10000 ms and 300 frames (a default cut to 300 frames carri...",
4143
+ },
4144
+ from_ms: {
4145
+ type: "integer",
4146
+ minimum: 0,
4147
+ description: "With `video_id` only (refused with `url`): where the window starts in the video, 0 when left out.",
4148
+ },
4149
+ fps: {
4150
+ type: "integer",
4151
+ enum: [10, 15, 30, 60],
4152
+ description: "Frames a second. Default 30; with `video_id`, the video's own rate. `duration_ms` times `fps` is at most 300 frames.",
4153
+ },
4154
+ viewport: {
4155
+ type: "object",
4156
+ description: "Browser viewport in CSS pixels. Default 1280x800.",
4157
+ required: ["width", "height"],
4158
+ properties: {
4159
+ width: {
4160
+ type: "integer",
4161
+ minimum: 320,
4162
+ maximum: 1920,
4163
+ },
4164
+ height: {
4165
+ type: "integer",
4166
+ minimum: 320,
4167
+ maximum: 1200,
4168
+ },
4169
+ },
4170
+ additionalProperties: false,
4171
+ },
4172
+ theme: {
4173
+ type: "string",
4174
+ enum: ["light", "dark", "auto"],
4175
+ default: "auto",
4176
+ description: "Emulated `prefers-color-scheme`; `auto` leaves the page default.",
4177
+ },
4178
+ interval_ms: {
4179
+ type: "integer",
4180
+ minimum: 33,
4181
+ maximum: 10000,
4182
+ description: "Put the sheet's tiles at a fixed interval from the window's start instead of where pixels change. The window may hold at most 12 tiles at this interval.",
4183
+ },
4184
+ include_image: {
4185
+ type: "boolean",
4186
+ default: true,
4187
+ description: "Return the contact sheet itself as well as its URL.",
4188
+ },
4189
+ },
4190
+ additionalProperties: false,
4191
+ },
4192
+ operationId: "renderCreateInspection",
4193
+ method: "POST",
4194
+ path: "/v1/render/inspections",
4195
+ scope: "render:run",
4196
+ servedBy: "node",
4197
+ pathParams: [],
4198
+ queryParams: [],
4199
+ body: "json",
4200
+ bodyFields: [
4201
+ "url",
4202
+ "video_id",
4203
+ "steps",
4204
+ "watch",
4205
+ "duration_ms",
4206
+ "from_ms",
4207
+ "fps",
4208
+ "viewport",
4209
+ "theme",
4210
+ "interval_ms",
4211
+ ],
4212
+ rawFields: [],
4213
+ toolArgs: ["include_image"],
4214
+ bodyDefaults: {},
4215
+ queryDefaults: {},
4216
+ },
4217
+ {
4218
+ name: "render_get",
4219
+ group: "render",
4220
+ title: "Get a video",
4221
+ description: "A video's status and files: its artifacts with signed URLs, the alias it was made with and the one that keeps it, its share's URL, and the goal it was planned from. Returns the poster as an image once it succeeded. Never waits.",
4222
+ annotations: {
4223
+ title: "Get a video",
4224
+ readOnlyHint: true,
4225
+ idempotentHint: true,
4226
+ openWorldHint: false,
4227
+ },
4228
+ inputSchema: {
4229
+ type: "object",
4230
+ properties: {
4231
+ video_id: {
4232
+ type: "string",
4233
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4234
+ description: "The video ID (`vid_…`).",
4235
+ },
4236
+ include_poster: {
4237
+ type: "boolean",
4238
+ default: true,
4239
+ description: "Return the poster frame as an image once the video has succeeded.",
4240
+ },
4241
+ },
4242
+ required: ["video_id"],
4243
+ additionalProperties: false,
4244
+ },
4245
+ operationId: "renderGetVideo",
4246
+ method: "GET",
4247
+ path: "/v1/render/videos/{video_id}",
4248
+ scope: "authenticated",
4249
+ servedBy: "node",
4250
+ pathParams: ["video_id"],
4251
+ queryParams: [],
4252
+ body: "none",
4253
+ bodyFields: [],
4254
+ rawFields: [],
4255
+ toolArgs: ["include_poster"],
4256
+ bodyDefaults: {},
4257
+ queryDefaults: {},
4258
+ },
4259
+ {
4260
+ name: "render_restyle",
4261
+ group: "render",
4262
+ title: "Restyle a video",
4263
+ description: "Render a finished video again in another look (background, frame, cursor, captions, output size) from its recording, without a browser: seconds, not a re-record. alias adds the new video to an alias (a restyle never inherits its source's). Waits up to wait_s seconds; call again with job_id to keep waiting.",
4264
+ annotations: {
4265
+ title: "Restyle a video",
4266
+ readOnlyHint: false,
4267
+ openWorldHint: false,
4268
+ },
4269
+ inputSchema: {
4270
+ type: "object",
4271
+ properties: {
4272
+ video_id: {
4273
+ type: "string",
4274
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4275
+ description: "The vid_… video to restyle (omit with job_id).",
4276
+ },
4277
+ style: {
4278
+ type: "object",
4279
+ description: "Preset IDs from render_presets.",
4280
+ properties: {
4281
+ background: {
4282
+ type: "string",
4283
+ },
4284
+ frame: {
4285
+ type: "string",
4286
+ },
4287
+ cursor: {
4288
+ type: "string",
4289
+ },
4290
+ captions: {
4291
+ type: "string",
4292
+ },
4293
+ click_effect: {
4294
+ type: "string",
4295
+ },
4296
+ },
4297
+ },
4298
+ captions: {
4299
+ type: "object",
4300
+ properties: {
4301
+ burn_in: {
4302
+ type: "string",
4303
+ enum: ["none", "static", "karaoke"],
4304
+ description: "`none`: sidecar files only. `static`: draw each cue as a small pill in the ma...",
4305
+ },
4306
+ sidecars: {
4307
+ type: "array",
4308
+ items: {
4309
+ type: "string",
4310
+ enum: ["vtt", "srt"],
4311
+ },
4312
+ default: ["vtt"],
4313
+ },
4314
+ max_chars_per_line: {
4315
+ type: "integer",
4316
+ minimum: 10,
4317
+ maximum: 80,
4318
+ default: 42,
4319
+ },
4320
+ max_lines: {
4321
+ type: "integer",
4322
+ minimum: 1,
4323
+ maximum: 3,
4324
+ default: 2,
4325
+ },
4326
+ max_chars_per_second: {
4327
+ type: "number",
4328
+ minimum: 5,
4329
+ maximum: 40,
4330
+ default: 20,
4331
+ },
4332
+ },
4333
+ additionalProperties: false,
4334
+ },
4335
+ output: {
4336
+ type: "object",
4337
+ required: ["width", "height", "fps"],
4338
+ properties: {
4339
+ width: {
4340
+ type: "integer",
4341
+ minimum: 16,
4342
+ maximum: 3840,
4343
+ multipleOf: 2,
4344
+ },
4345
+ height: {
4346
+ type: "integer",
4347
+ minimum: 16,
4348
+ maximum: 2160,
4349
+ multipleOf: 2,
4350
+ },
4351
+ fps: {
4352
+ type: "integer",
4353
+ enum: [24, 25, 30, 50, 60],
4354
+ description: "Frames per second of the video.",
4355
+ },
4356
+ },
4357
+ additionalProperties: false,
4358
+ },
4359
+ formats: {
4360
+ type: "array",
4361
+ items: {
4362
+ type: "string",
4363
+ enum: ["mp4", "gif", "poster"],
4364
+ },
4365
+ },
4366
+ alias: {
4367
+ type: "string",
4368
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
4369
+ description: "Add the restyled video to this alias; when it succeeds the alias (and its share) plays it.",
4370
+ },
4371
+ job_id: {
4372
+ type: "string",
4373
+ description: "A vid_… id from an earlier call.",
4374
+ },
4375
+ wait_s: {
4376
+ type: "integer",
4377
+ minimum: 0,
4378
+ maximum: 60,
4379
+ default: 50,
4380
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
4381
+ },
4382
+ include_poster: {
4383
+ type: "boolean",
4384
+ default: true,
4385
+ description: "Return the poster frame as an image once the video has succeeded.",
4386
+ },
4387
+ },
4388
+ additionalProperties: false,
4389
+ },
4390
+ operationId: "renderRestyleVideo",
4391
+ method: "POST",
4392
+ path: "/v1/render/videos/{video_id}/restyle",
4393
+ scope: "render:run",
4394
+ servedBy: "node",
4395
+ pathParams: ["video_id"],
4396
+ queryParams: [
4397
+ {
4398
+ name: "wait",
4399
+ from: "wait_s",
4400
+ },
4401
+ ],
4402
+ body: "json",
4403
+ bodyFields: ["style", "captions", "output", "formats", "alias"],
4404
+ rawFields: [],
4405
+ toolArgs: ["job_id", "wait_s", "include_poster"],
4406
+ bodyDefaults: {},
4407
+ queryDefaults: {},
4408
+ continueWith: {
4409
+ arg: "job_id",
4410
+ operationId: "renderGetVideo",
4411
+ method: "GET",
4412
+ path: "/v1/render/videos/{video_id}",
4413
+ pathParam: "video_id",
4414
+ },
4415
+ },
4416
+ {
4417
+ name: "render_presets",
4418
+ group: "render",
4419
+ title: "List render presets",
4420
+ description: "The style presets render takes (backgrounds, frames, cursors, captions, click effects), one line each as id (kind): name, for the style of render_screenshot, render_video and render_restyle.",
4421
+ annotations: {
4422
+ title: "List render presets",
4423
+ readOnlyHint: true,
4424
+ idempotentHint: true,
4425
+ openWorldHint: false,
4426
+ },
4427
+ inputSchema: {
4428
+ type: "object",
4429
+ properties: {
4430
+ kind: {
4431
+ type: "string",
4432
+ enum: ["background", "frame", "cursor", "captions", "click_effect"],
4433
+ description: "Only presets of this kind.",
4434
+ },
4435
+ },
4436
+ additionalProperties: false,
4437
+ },
4438
+ operationId: "renderListPresets",
4439
+ method: "GET",
4440
+ path: "/v1/render/presets",
4441
+ scope: "public",
4442
+ servedBy: "node",
4443
+ pathParams: [],
4444
+ queryParams: [
4445
+ {
4446
+ name: "kind",
4447
+ },
4448
+ ],
4449
+ body: "none",
4450
+ bodyFields: [],
4451
+ rawFields: [],
4452
+ toolArgs: [],
4453
+ bodyDefaults: {},
4454
+ queryDefaults: {},
4455
+ },
4456
+ {
4457
+ name: "render_share",
4458
+ group: "render",
4459
+ title: "Share a video",
4460
+ description: "Publish a video, or an alias's newest video, at a public page on usercontent.b3os.org (Open Graph, oEmbed, its own iframe): returns the page URL, the embed HTML, the oEmbed URL and stable GIF and poster links. An alias share keeps playing the newest re-record with no change to the embed. stop: true stops the share; the page, its files and its oEmbed answer 404 within 60 seconds.",
4461
+ annotations: {
4462
+ title: "Share a video",
4463
+ readOnlyHint: false,
4464
+ destructiveHint: true,
4465
+ idempotentHint: true,
4466
+ openWorldHint: false,
4467
+ },
4468
+ inputSchema: {
4469
+ type: "object",
4470
+ properties: {
4471
+ video_id: {
4472
+ type: "string",
4473
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4474
+ description: "The vid_… video to share (or give alias).",
4475
+ },
4476
+ title: {
4477
+ type: "string",
4478
+ description: 'The page title and preview title. Default the first beat\'s `title`, else "Video".',
4479
+ },
4480
+ alias: {
4481
+ type: "string",
4482
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
4483
+ description: "Share this alias of the project instead of one video.",
4484
+ },
4485
+ stop: {
4486
+ type: "boolean",
4487
+ default: false,
4488
+ description: "Stop the share instead of making it.",
4489
+ },
4490
+ },
4491
+ additionalProperties: false,
4492
+ },
4493
+ operationId: "renderShareVideo",
4494
+ method: "POST",
4495
+ path: "/v1/render/videos/{video_id}/share",
4496
+ scope: "render:write",
4497
+ servedBy: "node",
4498
+ pathParams: ["video_id"],
4499
+ queryParams: [],
4500
+ body: "json",
4501
+ bodyFields: ["title"],
4502
+ rawFields: [],
4503
+ toolArgs: ["alias", "stop"],
4504
+ bodyDefaults: {},
4505
+ queryDefaults: {},
4506
+ },
4507
+ {
4508
+ name: "listener_create",
4509
+ group: "listeners",
4510
+ title: "Create a listener",
4511
+ description: "Hold a source open for this project and hand each kept event to a sink: a source (http_poll, sse, websocket, webhook, pack or push), a CEL and optional model filter, and a routine or webhook sink, with a ttl and a daily budget. Nothing of yours runs between events. A webhook source's answer names its hook_url.",
4512
+ annotations: {
4513
+ title: "Create a listener",
4514
+ readOnlyHint: false,
4515
+ openWorldHint: true,
4516
+ },
4517
+ inputSchema: {
4518
+ type: "object",
4519
+ properties: {
4520
+ name: {
4521
+ type: ["string", "null"],
4522
+ description: "A label; not unique.",
4523
+ },
4524
+ source: {
4525
+ description: "{type: http_poll|sse|websocket|webhook|pack|push, ...} (see the docs).",
4526
+ },
4527
+ dedupe: {
4528
+ type: "object",
4529
+ description: "{key: CEL over event, window_s}; default the source's own event id.",
4530
+ },
4531
+ filter: {
4532
+ type: "object",
4533
+ description: "{cel: 'event.payload.total > 10', model: {prompt, on_error}}.",
4534
+ },
4535
+ sink: {
4536
+ description: "{type: routine, routine} or {type: webhook, url}; optional batch.",
4537
+ },
4538
+ redact: {
4539
+ type: "array",
4540
+ description: 'JSON pointers into the payload (`/customer/email`). Their values are replaced by `"[redacted]"` before the event is written anywhere: the log, the history an...',
4541
+ items: {
4542
+ type: "string",
4543
+ pattern: "^(/[^/]*)+$",
4544
+ },
4545
+ },
4546
+ ttl_s: {
4547
+ type: "integer",
4548
+ minimum: 60,
4549
+ description: "Seconds from now until the listener ends `expired`. Not with `expires_at`.",
4550
+ },
4551
+ budget: {
4552
+ type: "object",
4553
+ description: "{events_per_day, model_tokens_per_day}.",
4554
+ },
4555
+ },
4556
+ required: ["source", "sink"],
4557
+ additionalProperties: false,
4558
+ },
4559
+ operationId: "listenersCreateListener",
4560
+ method: "POST",
4561
+ path: "/v1/listeners",
4562
+ scope: "listeners:write",
4563
+ servedBy: "node",
4564
+ stage: "preview",
4565
+ flag: "listeners.api",
4566
+ pathParams: [],
4567
+ queryParams: [],
4568
+ body: "json",
4569
+ bodyFields: ["name", "source", "dedupe", "filter", "sink", "redact", "ttl_s", "budget"],
4570
+ rawFields: [],
4571
+ toolArgs: [],
4572
+ bodyDefaults: {},
4573
+ queryDefaults: {},
4574
+ },
4575
+ {
4576
+ name: "listener_list",
4577
+ group: "listeners",
4578
+ title: "List listeners",
4579
+ description: "List this project's listeners, newest first, with each one's status and what it kept.",
4580
+ annotations: {
4581
+ title: "List listeners",
4582
+ readOnlyHint: true,
4583
+ openWorldHint: false,
4584
+ },
4585
+ inputSchema: {
4586
+ type: "object",
4587
+ properties: {
4588
+ status: {
4589
+ type: "string",
4590
+ enum: ["starting", "active", "reconnecting", "paused", "failed", "expired", "revoked"],
4591
+ description: "Only listeners in this status.",
4592
+ },
4593
+ limit: {
4594
+ type: "integer",
4595
+ minimum: 1,
4596
+ maximum: 100,
4597
+ default: 20,
4598
+ description: "Page size, from 1 to 100.",
4599
+ },
4600
+ cursor: {
4601
+ type: "string",
4602
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
4603
+ },
4604
+ },
4605
+ additionalProperties: false,
4606
+ },
4607
+ operationId: "listenersListListeners",
4608
+ method: "GET",
4609
+ path: "/v1/listeners",
4610
+ scope: "listeners:read",
4611
+ servedBy: "node",
4612
+ stage: "preview",
4613
+ flag: "listeners.api",
4614
+ pathParams: [],
4615
+ queryParams: [
4616
+ {
4617
+ name: "status",
4618
+ },
4619
+ {
4620
+ name: "limit",
4621
+ },
4622
+ {
4623
+ name: "cursor",
4624
+ },
4625
+ ],
4626
+ body: "none",
4627
+ bodyFields: [],
4628
+ rawFields: [],
4629
+ toolArgs: [],
4630
+ bodyDefaults: {},
4631
+ queryDefaults: {},
4632
+ },
4633
+ {
4634
+ name: "listener_get",
4635
+ group: "listeners",
4636
+ title: "Get a listener",
4637
+ description: "One listener: its definition, status (and why it failed, when it did), its source's cursor, the budget it has used today and its stats.",
4638
+ annotations: {
4639
+ title: "Get a listener",
4640
+ readOnlyHint: true,
4641
+ openWorldHint: false,
4642
+ },
4643
+ inputSchema: {
4644
+ type: "object",
4645
+ properties: {
4646
+ listener_id: {
4647
+ type: "string",
4648
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4649
+ description: "The listener ID (`lsn_…`).",
4650
+ },
4651
+ },
4652
+ required: ["listener_id"],
4653
+ additionalProperties: false,
4654
+ },
4655
+ operationId: "listenersGetListener",
4656
+ method: "GET",
4657
+ path: "/v1/listeners/{listener_id}",
4658
+ scope: "listeners:read",
4659
+ servedBy: "node",
4660
+ stage: "preview",
4661
+ flag: "listeners.api",
4662
+ pathParams: ["listener_id"],
4663
+ queryParams: [],
4664
+ body: "none",
4665
+ bodyFields: [],
4666
+ rawFields: [],
4667
+ toolArgs: [],
4668
+ bodyDefaults: {},
4669
+ queryDefaults: {},
4670
+ },
4671
+ {
4672
+ name: "listener_update",
4673
+ group: "listeners",
4674
+ title: "Update a listener",
4675
+ description: "Pause or resume a listener, or change its filter, sink, budget, lifetime or redact list. The source is fixed.",
4676
+ annotations: {
4677
+ title: "Update a listener",
4678
+ readOnlyHint: false,
4679
+ idempotentHint: true,
4680
+ openWorldHint: false,
4681
+ },
4682
+ inputSchema: {
4683
+ type: "object",
4684
+ properties: {
4685
+ listener_id: {
4686
+ type: "string",
4687
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4688
+ description: "The listener ID (`lsn_…`).",
4689
+ },
4690
+ paused: {
4691
+ type: "boolean",
4692
+ },
4693
+ ttl_s: {
4694
+ type: "integer",
4695
+ minimum: 60,
4696
+ description: "Seconds from now until the listener ends `expired`. Not with `expires_at`.",
4697
+ },
4698
+ filter: {
4699
+ type: "object",
4700
+ description: "{cel, model}.",
4701
+ },
4702
+ budget: {
4703
+ type: "object",
4704
+ description: "{events_per_day, model_tokens_per_day}.",
4705
+ },
4706
+ },
4707
+ required: ["listener_id"],
4708
+ additionalProperties: false,
4709
+ },
4710
+ operationId: "listenersUpdateListener",
4711
+ method: "PATCH",
4712
+ path: "/v1/listeners/{listener_id}",
4713
+ scope: "listeners:write",
4714
+ servedBy: "node",
4715
+ stage: "preview",
4716
+ flag: "listeners.api",
4717
+ pathParams: ["listener_id"],
4718
+ queryParams: [],
4719
+ body: "json",
4720
+ bodyFields: ["paused", "ttl_s", "filter", "budget"],
4721
+ rawFields: [],
4722
+ toolArgs: [],
4723
+ bodyDefaults: {},
4724
+ queryDefaults: {},
4725
+ },
4726
+ {
4727
+ name: "listener_delete",
4728
+ group: "listeners",
4729
+ title: "Delete a listener",
4730
+ description: "Delete a listener: its source closes and its hooks go; its history stays until its retention ends.",
4731
+ annotations: {
4732
+ title: "Delete a listener",
4733
+ readOnlyHint: false,
4734
+ destructiveHint: true,
4735
+ idempotentHint: true,
4736
+ openWorldHint: false,
4737
+ },
4738
+ inputSchema: {
4739
+ type: "object",
4740
+ properties: {
4741
+ listener_id: {
4742
+ type: "string",
4743
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4744
+ description: "The listener ID (`lsn_…`).",
4745
+ },
4746
+ },
4747
+ required: ["listener_id"],
4748
+ additionalProperties: false,
4749
+ },
4750
+ operationId: "listenersDeleteListener",
4751
+ method: "DELETE",
4752
+ path: "/v1/listeners/{listener_id}",
4753
+ scope: "listeners:write",
4754
+ servedBy: "node",
4755
+ stage: "preview",
4756
+ flag: "listeners.api",
4757
+ pathParams: ["listener_id"],
4758
+ queryParams: [],
4759
+ body: "none",
4760
+ bodyFields: [],
4761
+ rawFields: [],
4762
+ toolArgs: [],
4763
+ bodyDefaults: {},
4764
+ queryDefaults: {},
4765
+ },
4766
+ {
4767
+ name: "listener_events",
4768
+ group: "listeners",
4769
+ title: "List a listener's events",
4770
+ description: "A listener's history, newest first: each event's payload, why the filter kept or dropped it, and its delivery (delivered, filtered, failed, pending, skipped), with gap records where the source could not resume.",
4771
+ annotations: {
4772
+ title: "List a listener's events",
4773
+ readOnlyHint: true,
4774
+ openWorldHint: false,
4775
+ },
4776
+ inputSchema: {
4777
+ type: "object",
4778
+ properties: {
4779
+ listener_id: {
4780
+ type: "string",
4781
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4782
+ description: "The listener ID (`lsn_…`).",
4783
+ },
4784
+ status: {
4785
+ type: "string",
4786
+ enum: ["pending", "delivered", "filtered", "failed", "skipped"],
4787
+ description: "Only events in this status.",
4788
+ },
4789
+ limit: {
4790
+ type: "integer",
4791
+ minimum: 1,
4792
+ maximum: 100,
4793
+ default: 20,
4794
+ description: "Page size, from 1 to 100.",
4795
+ },
4796
+ cursor: {
4797
+ type: "string",
4798
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
4799
+ },
4800
+ },
4801
+ required: ["listener_id"],
4802
+ additionalProperties: false,
4803
+ },
4804
+ operationId: "listenersListEvents",
4805
+ method: "GET",
4806
+ path: "/v1/listeners/{listener_id}/events",
4807
+ scope: "listeners:read",
4808
+ servedBy: "node",
4809
+ stage: "preview",
4810
+ flag: "listeners.api",
4811
+ pathParams: ["listener_id"],
4812
+ queryParams: [
4813
+ {
4814
+ name: "status",
4815
+ },
4816
+ {
4817
+ name: "limit",
4818
+ },
4819
+ {
4820
+ name: "cursor",
4821
+ },
4822
+ ],
4823
+ body: "none",
4824
+ bodyFields: [],
4825
+ rawFields: [],
4826
+ toolArgs: [],
4827
+ bodyDefaults: {},
4828
+ queryDefaults: {},
4829
+ },
4830
+ {
4831
+ name: "listener_push",
4832
+ group: "listeners",
4833
+ title: "Send events to a listener",
4834
+ description: "Send up to 100 events to a push listener; each goes through its dedupe, filter and sink. Answers once they are in the listener's log.",
4835
+ annotations: {
4836
+ title: "Send events to a listener",
4837
+ readOnlyHint: false,
4838
+ openWorldHint: false,
4839
+ },
4840
+ inputSchema: {
4841
+ type: "object",
4842
+ properties: {
4843
+ listener_id: {
4844
+ type: "string",
4845
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4846
+ description: "The listener ID (`lsn_…`).",
4847
+ },
4848
+ events: {
4849
+ type: "array",
4850
+ items: {
4851
+ type: "object",
4852
+ required: ["payload"],
4853
+ properties: {
4854
+ payload: {
4855
+ description: "Any JSON value, at most `listeners.event_bytes_max` when serialized.",
4856
+ },
4857
+ dedupe_key: {
4858
+ type: "string",
4859
+ },
4860
+ },
4861
+ },
4862
+ },
4863
+ },
4864
+ required: ["listener_id", "events"],
4865
+ additionalProperties: false,
4866
+ },
4867
+ operationId: "listenersIngestEvents",
4868
+ method: "POST",
4869
+ path: "/v1/listeners/{listener_id}/events",
4870
+ scope: "listeners:write",
4871
+ servedBy: "node",
4872
+ stage: "preview",
4873
+ flag: "listeners.api",
4874
+ pathParams: ["listener_id"],
4875
+ queryParams: [],
4876
+ body: "json",
4877
+ bodyFields: ["events"],
4878
+ rawFields: [],
4879
+ toolArgs: [],
4880
+ bodyDefaults: {},
4881
+ queryDefaults: {},
4882
+ },
4883
+ {
4884
+ name: "listener_test",
4885
+ group: "listeners",
4886
+ title: "Test a listener",
4887
+ description: "Run a sample event through a listener's dedupe and filter and say whether it would be kept; deliver: true also keeps it and hands it to the sink.",
4888
+ annotations: {
4889
+ title: "Test a listener",
4890
+ readOnlyHint: false,
4891
+ openWorldHint: false,
4892
+ },
4893
+ inputSchema: {
4894
+ type: "object",
4895
+ properties: {
4896
+ listener_id: {
4897
+ type: "string",
4898
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4899
+ description: "The listener ID (`lsn_…`).",
4900
+ },
4901
+ payload: {
4902
+ description: "A sample event payload.",
4903
+ },
4904
+ deliver: {
4905
+ type: "boolean",
4906
+ default: false,
4907
+ },
4908
+ },
4909
+ required: ["listener_id", "payload"],
4910
+ additionalProperties: false,
4911
+ },
4912
+ operationId: "listenersTestListener",
4913
+ method: "POST",
4914
+ path: "/v1/listeners/{listener_id}/test",
4915
+ scope: "listeners:write",
4916
+ servedBy: "node",
4917
+ stage: "preview",
4918
+ flag: "listeners.api",
4919
+ pathParams: ["listener_id"],
4920
+ queryParams: [],
4921
+ body: "json",
4922
+ bodyFields: ["payload", "deliver"],
4923
+ rawFields: [],
4924
+ toolArgs: [],
4925
+ bodyDefaults: {},
4926
+ queryDefaults: {},
4927
+ },
4928
+ {
4929
+ name: "agent_send",
4930
+ group: "agents",
4931
+ title: "Send a message to an agent instance",
4932
+ description: "Send one message to the agent's instance for key and wait up to wait_s seconds for the turn. The instance is made on its first message and woken from any sleep tier (woke_from says which); it runs one turn at a time and queues the rest. payload holds your own fields; the harness gets them as message. If the turn is still running, call again with job_id.",
4933
+ annotations: {
4934
+ title: "Send a message to an agent instance",
4935
+ readOnlyHint: false,
4936
+ destructiveHint: false,
4937
+ openWorldHint: true,
4938
+ },
4939
+ inputSchema: {
4940
+ type: "object",
4941
+ properties: {
4942
+ agent: {
4943
+ type: "string",
4944
+ description: "The agent's name, or its agt_ id.",
4945
+ },
4946
+ key: {
4947
+ type: "string",
4948
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
4949
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
4950
+ },
4951
+ type: {
4952
+ type: "string",
4953
+ pattern: "^[a-z][a-z0-9_.-]{0,63}$",
4954
+ default: "message",
4955
+ description: "What kind of message this is (a listener's actor sink sends `listener.event`).",
4956
+ },
4957
+ conversation: {
4958
+ type: "string",
4959
+ description: "Your conversation or thread ID. Default, the `b3os.conversation` baggage.",
4960
+ },
4961
+ subject: {
4962
+ type: "string",
4963
+ description: "The end user the turn is for, an opaque ID, never an email. Default, the `b3os.subject` baggage.",
4964
+ },
4965
+ metadata: {
4966
+ type: "object",
4967
+ description: "Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of `A-Z a-z 0-9 _ . : -`.",
4968
+ },
4969
+ create: {
4970
+ type: "boolean",
4971
+ default: true,
4972
+ description: "Make the instance if it does not exist. `false` answers `404 instance_not_found` instead.",
4973
+ },
4974
+ payload: {
4975
+ type: "object",
4976
+ description: "The message's own fields (any JSON object), sent beside type, conversation and subject.",
4977
+ },
4978
+ job_id: {
4979
+ type: "string",
4980
+ description: "A ses_ id from an earlier call: keep waiting for that turn.",
4981
+ },
4982
+ wait_s: {
4983
+ type: "integer",
4984
+ minimum: 0,
4985
+ maximum: 60,
4986
+ default: 50,
4987
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
4988
+ },
4989
+ },
4990
+ additionalProperties: false,
4991
+ },
4992
+ operationId: "agentsSendMessage",
4993
+ method: "POST",
4994
+ path: "/v1/agents/{agent}/instances/{key}/messages",
4995
+ scope: "agents:run",
4996
+ servedBy: "node",
4997
+ stage: "preview",
4998
+ flag: "agents.actors",
4999
+ pathParams: ["agent", "key"],
5000
+ queryParams: [
5001
+ {
5002
+ name: "wait",
5003
+ from: "wait_s",
5004
+ },
5005
+ ],
5006
+ body: "json",
5007
+ bodyFields: ["type", "conversation", "subject", "metadata", "create"],
5008
+ rawFields: [],
5009
+ toolArgs: ["payload", "job_id", "wait_s"],
5010
+ bodyDefaults: {},
5011
+ queryDefaults: {},
5012
+ continueWith: {
5013
+ arg: "job_id",
5014
+ operationId: "agentsGetSession",
5015
+ method: "GET",
5016
+ path: "/v1/agents/sessions/{session_id}",
5017
+ pathParam: "session_id",
5018
+ },
5019
+ },
5020
+ {
5021
+ name: "agent_create",
5022
+ group: "agents",
5023
+ title: "Create an agent",
5024
+ description: "Create an agent: the definition each of its instances starts from (a template and size, the harness command and the port it answers messages on, env, vault secrets, its API grant, egress, sleep and turn settings). Nothing starts until the first message to a key.",
5025
+ annotations: {
5026
+ title: "Create an agent",
5027
+ readOnlyHint: false,
5028
+ destructiveHint: false,
5029
+ openWorldHint: false,
5030
+ },
5031
+ inputSchema: {
5032
+ type: "object",
5033
+ properties: {
5034
+ name: {
5035
+ type: "string",
5036
+ pattern: "^[a-z][a-z0-9-]{0,62}$",
5037
+ description: "Lowercase letters, digits and `-`, starting with a letter. `sessions` is reserved.",
5038
+ },
5039
+ source: {
5040
+ type: "object",
5041
+ description: "What each instance starts from: a template (node templates, or one of your project's image templates) at a size, or one of your project's snapshots.",
5042
+ properties: {
5043
+ template: {
5044
+ type: "string",
5045
+ default: "agent",
5046
+ },
5047
+ snapshot: {
5048
+ type: "string",
5049
+ pattern: "^snap_[0-9a-hjkmnp-tv-z]{26}$",
5050
+ description: "Restore this snapshot instead of starting from a template.",
5051
+ },
5052
+ vcpu: {
5053
+ type: "integer",
5054
+ minimum: 1,
5055
+ },
5056
+ memory_mib: {
5057
+ type: "integer",
5058
+ minimum: 128,
5059
+ },
5060
+ disk_gib: {
5061
+ type: "integer",
5062
+ minimum: 1,
5063
+ },
5064
+ },
5065
+ additionalProperties: false,
5066
+ },
5067
+ entry: {
5068
+ type: "object",
5069
+ required: ["command", "port"],
5070
+ description: "The harness. `command` runs in each instance when it is made, and again after a cold boot from its disk.",
5071
+ properties: {
5072
+ command: {
5073
+ type: "array",
5074
+ items: {
5075
+ type: "string",
5076
+ },
5077
+ },
5078
+ port: {
5079
+ type: "integer",
5080
+ minimum: 1,
5081
+ maximum: 65535,
5082
+ description: "Not 53, 1080, 3128, 7700 or 15001, which the guest agent listens on.",
5083
+ },
5084
+ path: {
5085
+ type: "string",
5086
+ pattern: "^/",
5087
+ default: "/",
5088
+ },
5089
+ readiness: {
5090
+ type: "object",
5091
+ description: "When the sandbox counts as ready: a TCP port inside it accepting connections...",
5092
+ properties: {
5093
+ port: {
5094
+ type: "integer",
5095
+ minimum: 1,
5096
+ maximum: 65535,
5097
+ },
5098
+ cmd: {
5099
+ description: "A shell command line (run with `/bin/sh -c`) or an argv array.",
5100
+ oneOf: [
5101
+ {
5102
+ type: "string",
5103
+ },
5104
+ {
5105
+ type: "array",
5106
+ },
5107
+ ],
5108
+ },
5109
+ interval_ms: {
5110
+ type: "integer",
5111
+ minimum: 5,
5112
+ maximum: 5000,
5113
+ default: 10,
5114
+ },
5115
+ timeout_s: {
5116
+ type: "integer",
5117
+ minimum: 1,
5118
+ maximum: 600,
5119
+ default: 60,
5120
+ },
5121
+ },
5122
+ },
5123
+ max_restarts: {
5124
+ type: "integer",
5125
+ minimum: 0,
5126
+ maximum: 20,
5127
+ default: 5,
5128
+ },
5129
+ },
5130
+ additionalProperties: false,
5131
+ },
5132
+ env: {
5133
+ type: "object",
5134
+ additionalProperties: {
5135
+ type: "string",
5136
+ },
5137
+ description: "Environment variables of the harness. Returned as given; put credentials in `secrets`.",
5138
+ },
5139
+ secrets: {
5140
+ type: "object",
5141
+ additionalProperties: {
5142
+ description: "A value placed in the environment but never returned or logged.",
5143
+ oneOf: [
5144
+ {
5145
+ type: "string",
5146
+ },
5147
+ {
5148
+ type: "object",
5149
+ required: ["connection"],
5150
+ properties: {
5151
+ connection: {
5152
+ type: "string",
5153
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5154
+ },
5155
+ field: {
5156
+ type: "string",
5157
+ description: "Which secret field of the connection (vault.yaml names).",
5158
+ },
5159
+ },
5160
+ },
5161
+ ],
5162
+ },
5163
+ description: "Environment variables never returned or logged, as a sandbox's `secrets`: code in the instance can read them.",
5164
+ },
5165
+ api: {
5166
+ type: "object",
5167
+ description: "What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.",
5168
+ properties: {
5169
+ scopes: {
5170
+ type: "array",
5171
+ items: {
5172
+ type: "string",
5173
+ description: "A scope from the catalog (`vision:run`.",
5174
+ enum: [
5175
+ "vision:read",
5176
+ "vision:write",
5177
+ "vision:run",
5178
+ "vision:profiles:use",
5179
+ "vision:profiles:export",
5180
+ "render:read",
5181
+ "render:write",
5182
+ "render:run",
5183
+ "sandboxes:read",
5184
+ "sandboxes:write",
5185
+ "sandboxes:run",
5186
+ "agents:read",
5187
+ "agents:write",
5188
+ "agents:run",
5189
+ "routines:read",
5190
+ "routines:write",
5191
+ "routines:run",
5192
+ "listeners:read",
5193
+ "listeners:write",
5194
+ "actions:read",
5195
+ "actions:write",
5196
+ "actions:run",
5197
+ "actions:tools:publish",
5198
+ "infer:read",
5199
+ "infer:write",
5200
+ "infer:run",
5201
+ "vault:read",
5202
+ "vault:write",
5203
+ "vault:run",
5204
+ "vault:connections:reveal",
5205
+ "platform:read",
5206
+ "platform:write",
5207
+ "platform:content:read",
5208
+ "settings:write",
5209
+ "vision:*",
5210
+ "render:*",
5211
+ "sandboxes:*",
5212
+ "agents:*",
5213
+ "routines:*",
5214
+ "listeners:*",
5215
+ "actions:*",
5216
+ "infer:*",
5217
+ "vault:*",
5218
+ "platform:*",
5219
+ "settings:*",
5220
+ "*",
5221
+ ],
5222
+ },
5223
+ description: "A subset of your own scopes.",
5224
+ },
5225
+ spend_cap_usd: {
5226
+ type: ["number", "null"],
5227
+ minimum: 0,
5228
+ description: "Stop the sandbox's own API calls at this spend.",
5229
+ },
5230
+ connections: {
5231
+ type: "array",
5232
+ items: {
5233
+ type: "string",
5234
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5235
+ },
5236
+ description: "Vault connections the sandbox's action calls may use.",
5237
+ },
5238
+ actions: {
5239
+ type: ["object", "null"],
5240
+ description: "Which pack actions code in the sandbox may call (`POST /v1/actions/call`) and...",
5241
+ required: ["allow"],
5242
+ properties: {
5243
+ allow: {
5244
+ type: "array",
5245
+ items: {
5246
+ type: "string",
5247
+ },
5248
+ description: "`<namespace>/<name>/<action>[@<version>]`: `<action>` an action key or `*` (e...",
5249
+ },
5250
+ },
5251
+ },
5252
+ },
5253
+ additionalProperties: false,
5254
+ },
5255
+ egress: {
5256
+ type: "object",
5257
+ description: "Where sandbox traffic may go, enforced by the node's egress guard. `public` (default): any public internet address.",
5258
+ },
5259
+ sleep: {
5260
+ type: "object",
5261
+ description: "When an idle instance moves to each sleep tier. Quiet means no turn, no queued message, no open connection through its ports, no exec, file or terminal call...",
5262
+ properties: {
5263
+ ram_after_s: {
5264
+ type: "integer",
5265
+ minimum: 5,
5266
+ maximum: 3600,
5267
+ default: 30,
5268
+ description: "Quiet this long, it pauses in memory.",
5269
+ },
5270
+ snapshot_after_s: {
5271
+ type: "integer",
5272
+ minimum: 60,
5273
+ maximum: 86400,
5274
+ default: 600,
5275
+ description: "Paused this long, its memory goes to a snapshot on the node's disk and its me...",
5276
+ },
5277
+ snapshot_keep_s: {
5278
+ type: "integer",
5279
+ minimum: 3600,
5280
+ maximum: 604800,
5281
+ default: 604800,
5282
+ description: "How long a memory snapshot is kept.",
5283
+ },
5284
+ },
5285
+ additionalProperties: false,
5286
+ },
5287
+ turns: {
5288
+ type: "object",
5289
+ description: "How messages become turns. One turn runs at a time per instance.",
5290
+ properties: {
5291
+ queue_max: {
5292
+ type: "integer",
5293
+ minimum: 1,
5294
+ maximum: 16,
5295
+ default: 16,
5296
+ description: "Messages that may wait for the current turn, at most `agents.queue_max`.",
5297
+ },
5298
+ timeout_s: {
5299
+ type: "integer",
5300
+ minimum: 1,
5301
+ maximum: 3600,
5302
+ default: 300,
5303
+ description: "How long a turn may take from its message's acceptance, queue time included.",
5304
+ },
5305
+ redeliver: {
5306
+ type: "boolean",
5307
+ default: false,
5308
+ description: "Deliver a message again after the node restarted while the harness had it.",
5309
+ },
5310
+ },
5311
+ additionalProperties: false,
5312
+ },
5313
+ metadata: {
5314
+ type: "object",
5315
+ description: "Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of `A-Z a-z 0-9 _ . : -`.",
5316
+ },
5317
+ },
5318
+ required: ["name", "entry"],
5319
+ additionalProperties: false,
5320
+ },
5321
+ operationId: "agentsCreateAgent",
5322
+ method: "POST",
5323
+ path: "/v1/agents",
5324
+ scope: "agents:write",
5325
+ servedBy: "node",
5326
+ stage: "preview",
5327
+ flag: "agents.actors",
5328
+ pathParams: [],
5329
+ queryParams: [],
5330
+ body: "json",
5331
+ bodyFields: ["name", "source", "entry", "env", "secrets", "api", "egress", "sleep", "turns", "metadata"],
5332
+ rawFields: [],
5333
+ toolArgs: [],
5334
+ bodyDefaults: {},
5335
+ queryDefaults: {},
5336
+ },
5337
+ {
5338
+ name: "agent_list",
5339
+ group: "agents",
5340
+ title: "List agents",
5341
+ description: "List the project's agents, newest first, with each one's revision and instance count.",
5342
+ annotations: {
5343
+ title: "List agents",
5344
+ readOnlyHint: true,
5345
+ openWorldHint: false,
5346
+ },
5347
+ inputSchema: {
5348
+ type: "object",
5349
+ properties: {
5350
+ limit: {
5351
+ type: "integer",
5352
+ minimum: 1,
5353
+ maximum: 100,
5354
+ default: 20,
5355
+ description: "Page size, from 1 to 100.",
5356
+ },
5357
+ cursor: {
5358
+ type: "string",
5359
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
5360
+ },
5361
+ },
5362
+ additionalProperties: false,
5363
+ },
5364
+ operationId: "agentsListAgents",
5365
+ method: "GET",
5366
+ path: "/v1/agents",
5367
+ scope: "agents:read",
5368
+ servedBy: "node",
5369
+ stage: "preview",
5370
+ flag: "agents.actors",
5371
+ pathParams: [],
5372
+ queryParams: [
5373
+ {
5374
+ name: "limit",
5375
+ },
5376
+ {
5377
+ name: "cursor",
5378
+ },
5379
+ ],
5380
+ body: "none",
5381
+ bodyFields: [],
5382
+ rawFields: [],
5383
+ toolArgs: [],
5384
+ bodyDefaults: {},
5385
+ queryDefaults: {
5386
+ limit: 20,
5387
+ },
5388
+ },
5389
+ {
5390
+ name: "agent_get",
5391
+ group: "agents",
5392
+ title: "Get an agent",
5393
+ description: "Read an agent's definition by name or agt_ id: its source, entry, sleep and turn settings, revision.",
5394
+ annotations: {
5395
+ title: "Get an agent",
5396
+ readOnlyHint: true,
5397
+ openWorldHint: false,
5398
+ },
5399
+ inputSchema: {
5400
+ type: "object",
5401
+ properties: {
5402
+ agent: {
5403
+ type: "string",
5404
+ description: "The agent's name, or its agt_ id.",
5405
+ },
5406
+ },
5407
+ required: ["agent"],
5408
+ additionalProperties: false,
5409
+ },
5410
+ operationId: "agentsGetAgent",
5411
+ method: "GET",
5412
+ path: "/v1/agents/{agent}",
5413
+ scope: "agents:read",
5414
+ servedBy: "node",
5415
+ stage: "preview",
5416
+ flag: "agents.actors",
5417
+ pathParams: ["agent"],
5418
+ queryParams: [],
5419
+ body: "none",
5420
+ bodyFields: [],
5421
+ rawFields: [],
5422
+ toolArgs: [],
5423
+ bodyDefaults: {},
5424
+ queryDefaults: {},
5425
+ },
5426
+ {
5427
+ name: "agent_update",
5428
+ group: "agents",
5429
+ title: "Update an agent",
5430
+ description: "Change an agent's definition (a new revision). upgrade says when instances take it: new_instances (the default) or on_wake.",
5431
+ annotations: {
5432
+ title: "Update an agent",
5433
+ readOnlyHint: false,
5434
+ destructiveHint: false,
5435
+ openWorldHint: false,
5436
+ },
5437
+ inputSchema: {
5438
+ type: "object",
5439
+ properties: {
5440
+ agent: {
5441
+ type: "string",
5442
+ description: "The agent's name, or its agt_ id.",
5443
+ },
5444
+ source: {
5445
+ type: "object",
5446
+ description: "What each instance starts from: a template (node templates, or one of your project's image templates) at a size, or one of your project's snapshots.",
5447
+ properties: {
5448
+ template: {
5449
+ type: "string",
5450
+ default: "agent",
5451
+ },
5452
+ snapshot: {
5453
+ type: "string",
5454
+ pattern: "^snap_[0-9a-hjkmnp-tv-z]{26}$",
5455
+ description: "Restore this snapshot instead of starting from a template.",
5456
+ },
5457
+ vcpu: {
5458
+ type: "integer",
5459
+ minimum: 1,
5460
+ },
5461
+ memory_mib: {
5462
+ type: "integer",
5463
+ minimum: 128,
5464
+ },
5465
+ disk_gib: {
5466
+ type: "integer",
5467
+ minimum: 1,
5468
+ },
5469
+ },
5470
+ additionalProperties: false,
5471
+ },
5472
+ entry: {
5473
+ type: "object",
5474
+ required: ["command", "port"],
5475
+ description: "The harness. `command` runs in each instance when it is made, and again after a cold boot from its disk.",
5476
+ properties: {
5477
+ command: {
5478
+ type: "array",
5479
+ items: {
5480
+ type: "string",
5481
+ },
5482
+ },
5483
+ port: {
5484
+ type: "integer",
5485
+ minimum: 1,
5486
+ maximum: 65535,
5487
+ description: "Not 53, 1080, 3128, 7700 or 15001, which the guest agent listens on.",
5488
+ },
5489
+ path: {
5490
+ type: "string",
5491
+ pattern: "^/",
5492
+ default: "/",
5493
+ },
5494
+ readiness: {
5495
+ type: "object",
5496
+ description: "When the sandbox counts as ready: a TCP port inside it accepting connections...",
5497
+ properties: {
5498
+ port: {
5499
+ type: "integer",
5500
+ minimum: 1,
5501
+ maximum: 65535,
5502
+ },
5503
+ cmd: {
5504
+ description: "A shell command line (run with `/bin/sh -c`) or an argv array.",
5505
+ oneOf: [
5506
+ {
5507
+ type: "string",
5508
+ },
5509
+ {
5510
+ type: "array",
5511
+ },
5512
+ ],
5513
+ },
5514
+ interval_ms: {
5515
+ type: "integer",
5516
+ minimum: 5,
5517
+ maximum: 5000,
5518
+ default: 10,
5519
+ },
5520
+ timeout_s: {
5521
+ type: "integer",
5522
+ minimum: 1,
5523
+ maximum: 600,
5524
+ default: 60,
5525
+ },
5526
+ },
5527
+ },
5528
+ max_restarts: {
5529
+ type: "integer",
5530
+ minimum: 0,
5531
+ maximum: 20,
5532
+ default: 5,
5533
+ },
5534
+ },
5535
+ additionalProperties: false,
5536
+ },
5537
+ env: {
5538
+ type: "object",
5539
+ additionalProperties: {
5540
+ type: "string",
5541
+ },
5542
+ },
5543
+ secrets: {
5544
+ type: "object",
5545
+ additionalProperties: {
5546
+ description: "A value placed in the environment but never returned or logged.",
5547
+ oneOf: [
5548
+ {
5549
+ type: "string",
5550
+ },
5551
+ {
5552
+ type: "object",
5553
+ required: ["connection"],
5554
+ properties: {
5555
+ connection: {
5556
+ type: "string",
5557
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5558
+ },
5559
+ field: {
5560
+ type: "string",
5561
+ description: "Which secret field of the connection (vault.yaml names).",
5562
+ },
5563
+ },
5564
+ },
5565
+ ],
5566
+ },
5567
+ },
5568
+ api: {
5569
+ type: "object",
5570
+ description: "What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.",
5571
+ properties: {
5572
+ scopes: {
5573
+ type: "array",
5574
+ items: {
5575
+ type: "string",
5576
+ description: "A scope from the catalog (`vision:run`.",
5577
+ enum: [
5578
+ "vision:read",
5579
+ "vision:write",
5580
+ "vision:run",
5581
+ "vision:profiles:use",
5582
+ "vision:profiles:export",
5583
+ "render:read",
5584
+ "render:write",
5585
+ "render:run",
5586
+ "sandboxes:read",
5587
+ "sandboxes:write",
5588
+ "sandboxes:run",
5589
+ "agents:read",
5590
+ "agents:write",
5591
+ "agents:run",
5592
+ "routines:read",
5593
+ "routines:write",
5594
+ "routines:run",
5595
+ "listeners:read",
5596
+ "listeners:write",
5597
+ "actions:read",
5598
+ "actions:write",
5599
+ "actions:run",
5600
+ "actions:tools:publish",
5601
+ "infer:read",
5602
+ "infer:write",
5603
+ "infer:run",
5604
+ "vault:read",
5605
+ "vault:write",
5606
+ "vault:run",
5607
+ "vault:connections:reveal",
5608
+ "platform:read",
5609
+ "platform:write",
5610
+ "platform:content:read",
5611
+ "settings:write",
5612
+ "vision:*",
5613
+ "render:*",
5614
+ "sandboxes:*",
5615
+ "agents:*",
5616
+ "routines:*",
5617
+ "listeners:*",
5618
+ "actions:*",
5619
+ "infer:*",
5620
+ "vault:*",
5621
+ "platform:*",
5622
+ "settings:*",
5623
+ "*",
5624
+ ],
5625
+ },
5626
+ description: "A subset of your own scopes.",
5627
+ },
5628
+ spend_cap_usd: {
5629
+ type: ["number", "null"],
5630
+ minimum: 0,
5631
+ description: "Stop the sandbox's own API calls at this spend.",
5632
+ },
5633
+ connections: {
5634
+ type: "array",
5635
+ items: {
5636
+ type: "string",
5637
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5638
+ },
5639
+ description: "Vault connections the sandbox's action calls may use.",
5640
+ },
5641
+ actions: {
5642
+ type: ["object", "null"],
5643
+ description: "Which pack actions code in the sandbox may call (`POST /v1/actions/call`) and...",
5644
+ required: ["allow"],
5645
+ properties: {
5646
+ allow: {
5647
+ type: "array",
5648
+ items: {
5649
+ type: "string",
5650
+ },
5651
+ description: "`<namespace>/<name>/<action>[@<version>]`: `<action>` an action key or `*` (e...",
5652
+ },
5653
+ },
5654
+ },
5655
+ },
5656
+ additionalProperties: false,
5657
+ },
5658
+ egress: {
5659
+ type: "object",
5660
+ description: "Where sandbox traffic may go, enforced by the node's egress guard. `public` (default): any public internet address.",
5661
+ },
5662
+ sleep: {
5663
+ type: "object",
5664
+ description: "When an idle instance moves to each sleep tier. Quiet means no turn, no queued message, no open connection through its ports, no exec, file or terminal call...",
5665
+ properties: {
5666
+ ram_after_s: {
5667
+ type: "integer",
5668
+ minimum: 5,
5669
+ maximum: 3600,
5670
+ default: 30,
5671
+ description: "Quiet this long, it pauses in memory.",
5672
+ },
5673
+ snapshot_after_s: {
5674
+ type: "integer",
5675
+ minimum: 60,
5676
+ maximum: 86400,
5677
+ default: 600,
5678
+ description: "Paused this long, its memory goes to a snapshot on the node's disk and its me...",
5679
+ },
5680
+ snapshot_keep_s: {
5681
+ type: "integer",
5682
+ minimum: 3600,
5683
+ maximum: 604800,
5684
+ default: 604800,
5685
+ description: "How long a memory snapshot is kept.",
5686
+ },
5687
+ },
5688
+ additionalProperties: false,
5689
+ },
5690
+ turns: {
5691
+ type: "object",
5692
+ description: "How messages become turns. One turn runs at a time per instance.",
5693
+ properties: {
5694
+ queue_max: {
5695
+ type: "integer",
5696
+ minimum: 1,
5697
+ maximum: 16,
5698
+ default: 16,
5699
+ description: "Messages that may wait for the current turn, at most `agents.queue_max`.",
5700
+ },
5701
+ timeout_s: {
5702
+ type: "integer",
5703
+ minimum: 1,
5704
+ maximum: 3600,
5705
+ default: 300,
5706
+ description: "How long a turn may take from its message's acceptance, queue time included.",
5707
+ },
5708
+ redeliver: {
5709
+ type: "boolean",
5710
+ default: false,
5711
+ description: "Deliver a message again after the node restarted while the harness had it.",
5712
+ },
5713
+ },
5714
+ additionalProperties: false,
5715
+ },
5716
+ upgrade: {
5717
+ type: "string",
5718
+ enum: ["new_instances", "on_wake"],
5719
+ default: "new_instances",
5720
+ description: "What happens to instances of earlier revisions: `new_instances` leaves them as they are.",
5721
+ },
5722
+ metadata: {
5723
+ type: "object",
5724
+ description: "Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of `A-Z a-z 0-9 _ . : -`.",
5725
+ },
5726
+ },
5727
+ required: ["agent"],
5728
+ additionalProperties: false,
5729
+ },
5730
+ operationId: "agentsUpdateAgent",
5731
+ method: "PATCH",
5732
+ path: "/v1/agents/{agent}",
5733
+ scope: "agents:write",
5734
+ servedBy: "node",
5735
+ stage: "preview",
5736
+ flag: "agents.actors",
5737
+ pathParams: ["agent"],
5738
+ queryParams: [],
5739
+ body: "json",
5740
+ bodyFields: ["source", "entry", "env", "secrets", "api", "egress", "sleep", "turns", "upgrade", "metadata"],
5741
+ rawFields: [],
5742
+ toolArgs: [],
5743
+ bodyDefaults: {},
5744
+ queryDefaults: {},
5745
+ },
5746
+ {
5747
+ name: "agent_delete",
5748
+ group: "agents",
5749
+ title: "Delete an agent",
5750
+ description: "Delete an agent and every instance of it, with their microVMs, snapshots and disks.",
5751
+ annotations: {
5752
+ title: "Delete an agent",
5753
+ readOnlyHint: false,
5754
+ destructiveHint: true,
5755
+ idempotentHint: true,
5756
+ openWorldHint: false,
5757
+ },
5758
+ inputSchema: {
5759
+ type: "object",
5760
+ properties: {
5761
+ agent: {
5762
+ type: "string",
5763
+ description: "The agent's name, or its agt_ id.",
5764
+ },
5765
+ },
5766
+ required: ["agent"],
5767
+ additionalProperties: false,
5768
+ },
5769
+ operationId: "agentsDeleteAgent",
5770
+ method: "DELETE",
5771
+ path: "/v1/agents/{agent}",
5772
+ scope: "agents:write",
5773
+ servedBy: "node",
5774
+ stage: "preview",
5775
+ flag: "agents.actors",
5776
+ pathParams: ["agent"],
5777
+ queryParams: [],
5778
+ body: "none",
5779
+ bodyFields: [],
5780
+ rawFields: [],
5781
+ toolArgs: [],
5782
+ bodyDefaults: {},
5783
+ queryDefaults: {},
5784
+ },
5785
+ {
5786
+ name: "agent_list_instances",
5787
+ group: "agents",
5788
+ title: "List an agent's instances",
5789
+ description: "List an agent's instances: each key with its status (running, paused, hibernated, dormant, failed), its resident memory and the bytes it holds on the node's disk.",
5790
+ annotations: {
5791
+ title: "List an agent's instances",
5792
+ readOnlyHint: true,
5793
+ openWorldHint: false,
5794
+ },
5795
+ inputSchema: {
5796
+ type: "object",
5797
+ properties: {
5798
+ agent: {
5799
+ type: "string",
5800
+ description: "The agent's name, or its agt_ id.",
5801
+ },
5802
+ status: {
5803
+ type: "string",
5804
+ description: "Only instances with this status.",
5805
+ enum: ["creating", "running", "paused", "hibernated", "dormant", "waking", "failed"],
5806
+ },
5807
+ limit: {
5808
+ type: "integer",
5809
+ minimum: 1,
5810
+ maximum: 100,
5811
+ default: 20,
5812
+ description: "Page size, from 1 to 100.",
5813
+ },
5814
+ cursor: {
5815
+ type: "string",
5816
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
5817
+ },
5818
+ },
5819
+ required: ["agent"],
5820
+ additionalProperties: false,
5821
+ },
5822
+ operationId: "agentsListInstances",
5823
+ method: "GET",
5824
+ path: "/v1/agents/{agent}/instances",
5825
+ scope: "agents:read",
5826
+ servedBy: "node",
5827
+ stage: "preview",
5828
+ flag: "agents.actors",
5829
+ pathParams: ["agent"],
5830
+ queryParams: [
5831
+ {
5832
+ name: "status",
5833
+ },
5834
+ {
5835
+ name: "limit",
5836
+ },
5837
+ {
5838
+ name: "cursor",
5839
+ },
5840
+ ],
5841
+ body: "none",
5842
+ bodyFields: [],
5843
+ rawFields: [],
5844
+ toolArgs: [],
5845
+ bodyDefaults: {},
5846
+ queryDefaults: {
5847
+ limit: 20,
5848
+ },
5849
+ },
5850
+ {
5851
+ name: "agent_get_instance",
5852
+ group: "agents",
5853
+ title: "Get an agent instance",
5854
+ description: "Read one instance by its key: status, sandbox id, resident memory, storage, last message, snapshot time.",
5855
+ annotations: {
5856
+ title: "Get an agent instance",
5857
+ readOnlyHint: true,
5858
+ openWorldHint: false,
5859
+ },
5860
+ inputSchema: {
5861
+ type: "object",
5862
+ properties: {
5863
+ agent: {
5864
+ type: "string",
5865
+ description: "The agent's name, or its agt_ id.",
5866
+ },
5867
+ key: {
5868
+ type: "string",
5869
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
5870
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
5871
+ },
5872
+ },
5873
+ required: ["agent", "key"],
5874
+ additionalProperties: false,
5875
+ },
5876
+ operationId: "agentsGetInstance",
5877
+ method: "GET",
5878
+ path: "/v1/agents/{agent}/instances/{key}",
5879
+ scope: "agents:read",
5880
+ servedBy: "node",
5881
+ stage: "preview",
5882
+ flag: "agents.actors",
5883
+ pathParams: ["agent", "key"],
5884
+ queryParams: [],
5885
+ body: "none",
5886
+ bodyFields: [],
5887
+ rawFields: [],
5888
+ toolArgs: [],
5889
+ bodyDefaults: {},
5890
+ queryDefaults: {},
5891
+ },
5892
+ {
5893
+ name: "agent_instance_events",
5894
+ group: "agents",
5895
+ title: "Read an instance's lifecycle events",
5896
+ description: "An instance's lifecycle events, newest first: created, paused, hibernated, dormant, woke (and from which tier), recovered, failed, with their reasons.",
5897
+ annotations: {
5898
+ title: "Read an instance's lifecycle events",
5899
+ readOnlyHint: true,
5900
+ openWorldHint: false,
5901
+ },
5902
+ inputSchema: {
5903
+ type: "object",
5904
+ properties: {
5905
+ agent: {
5906
+ type: "string",
5907
+ description: "The agent's name, or its agt_ id.",
5908
+ },
5909
+ key: {
5910
+ type: "string",
5911
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
5912
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
5913
+ },
5914
+ limit: {
5915
+ type: "integer",
5916
+ minimum: 1,
5917
+ maximum: 100,
5918
+ default: 20,
5919
+ description: "Page size, from 1 to 100.",
5920
+ },
5921
+ cursor: {
5922
+ type: "string",
5923
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
5924
+ },
5925
+ },
5926
+ required: ["agent", "key"],
5927
+ additionalProperties: false,
5928
+ },
5929
+ operationId: "agentsListInstanceEvents",
5930
+ method: "GET",
5931
+ path: "/v1/agents/{agent}/instances/{key}/events",
5932
+ scope: "agents:read",
5933
+ servedBy: "node",
5934
+ stage: "preview",
5935
+ flag: "agents.actors",
5936
+ pathParams: ["agent", "key"],
5937
+ queryParams: [
5938
+ {
5939
+ name: "limit",
5940
+ },
5941
+ {
5942
+ name: "cursor",
5943
+ },
5944
+ ],
5945
+ body: "none",
5946
+ bodyFields: [],
5947
+ rawFields: [],
5948
+ toolArgs: [],
5949
+ bodyDefaults: {},
5950
+ queryDefaults: {
5951
+ limit: 20,
5952
+ },
5953
+ },
5954
+ {
5955
+ name: "agent_sleep",
5956
+ group: "agents",
5957
+ title: "Put an agent instance to sleep",
5958
+ description: "Send an instance to a sleep tier now instead of waiting for its timers: ram pauses it in memory, snapshot writes its memory to the node's disk and frees it. A turn in progress finishes first.",
5959
+ annotations: {
5960
+ title: "Put an agent instance to sleep",
5961
+ readOnlyHint: false,
5962
+ destructiveHint: false,
5963
+ idempotentHint: true,
5964
+ openWorldHint: false,
5965
+ },
5966
+ inputSchema: {
5967
+ type: "object",
5968
+ properties: {
5969
+ agent: {
5970
+ type: "string",
5971
+ description: "The agent's name, or its agt_ id.",
5972
+ },
5973
+ key: {
5974
+ type: "string",
5975
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
5976
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
5977
+ },
5978
+ tier: {
5979
+ type: "string",
5980
+ enum: ["ram", "snapshot"],
5981
+ default: "ram",
5982
+ },
5983
+ },
5984
+ required: ["agent", "key"],
5985
+ additionalProperties: false,
5986
+ },
5987
+ operationId: "agentsSleepInstance",
5988
+ method: "POST",
5989
+ path: "/v1/agents/{agent}/instances/{key}/sleep",
5990
+ scope: "agents:run",
5991
+ servedBy: "node",
5992
+ stage: "preview",
5993
+ flag: "agents.actors",
5994
+ pathParams: ["agent", "key"],
5995
+ queryParams: [],
5996
+ body: "json",
5997
+ bodyFields: ["tier"],
5998
+ rawFields: [],
5999
+ toolArgs: [],
6000
+ bodyDefaults: {},
6001
+ queryDefaults: {},
6002
+ },
6003
+ {
6004
+ name: "agent_delete_instance",
6005
+ group: "agents",
6006
+ title: "Delete an agent instance",
6007
+ description: "Delete one instance: its microVM, its memory snapshot and its disk. Its key starts fresh next time.",
6008
+ annotations: {
6009
+ title: "Delete an agent instance",
6010
+ readOnlyHint: false,
6011
+ destructiveHint: true,
6012
+ idempotentHint: true,
6013
+ openWorldHint: false,
6014
+ },
6015
+ inputSchema: {
6016
+ type: "object",
6017
+ properties: {
6018
+ agent: {
6019
+ type: "string",
6020
+ description: "The agent's name, or its agt_ id.",
6021
+ },
6022
+ key: {
6023
+ type: "string",
6024
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6025
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
6026
+ },
6027
+ },
6028
+ required: ["agent", "key"],
6029
+ additionalProperties: false,
6030
+ },
6031
+ operationId: "agentsDeleteInstance",
6032
+ method: "DELETE",
6033
+ path: "/v1/agents/{agent}/instances/{key}",
6034
+ scope: "agents:write",
6035
+ servedBy: "node",
6036
+ stage: "preview",
6037
+ flag: "agents.actors",
6038
+ pathParams: ["agent", "key"],
6039
+ queryParams: [],
6040
+ body: "none",
6041
+ bodyFields: [],
6042
+ rawFields: [],
6043
+ toolArgs: [],
6044
+ bodyDefaults: {},
6045
+ queryDefaults: {},
6046
+ },
6047
+ {
6048
+ name: "agent_list_sessions",
6049
+ group: "agents",
6050
+ title: "List an agent's sessions",
6051
+ description: "List an agent's sessions (one per turn), newest first, optionally for one key, conversation or status: each with its status, woke_from and timing.",
6052
+ annotations: {
6053
+ title: "List an agent's sessions",
6054
+ readOnlyHint: true,
6055
+ openWorldHint: false,
6056
+ },
6057
+ inputSchema: {
6058
+ type: "object",
6059
+ properties: {
6060
+ agent: {
6061
+ type: "string",
6062
+ description: "The agent's name, or its agt_ id.",
6063
+ },
6064
+ key: {
6065
+ type: "string",
6066
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6067
+ description: "Only sessions of this instance.",
6068
+ },
6069
+ conversation: {
6070
+ type: "string",
6071
+ description: "Only sessions of this conversation.",
3169
6072
  },
3170
6073
  status: {
3171
6074
  type: "string",
3172
- enum: ["pending", "retrying", "succeeded", "failed"],
6075
+ description: "Only sessions with this status.",
6076
+ enum: ["queued", "running", "succeeded", "failed", "canceled"],
3173
6077
  },
3174
6078
  limit: {
3175
6079
  type: "integer",
3176
6080
  minimum: 1,
3177
6081
  maximum: 100,
3178
- default: 20,
6082
+ default: 10,
3179
6083
  description: "Page size, from 1 to 100.",
3180
6084
  },
3181
6085
  cursor: {
@@ -3183,20 +6087,23 @@ export const MCP_TOOLS = [
3183
6087
  description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3184
6088
  },
3185
6089
  },
6090
+ required: ["agent"],
3186
6091
  additionalProperties: false,
3187
6092
  },
3188
- operationId: "webhooksListDeliveries",
6093
+ operationId: "agentsListSessions",
3189
6094
  method: "GET",
3190
- path: "/v1/webhooks/deliveries",
3191
- scope: "platform:read",
6095
+ path: "/v1/agents/{agent}/sessions",
6096
+ scope: "agents:read",
3192
6097
  servedBy: "node",
3193
- pathParams: [],
6098
+ stage: "preview",
6099
+ flag: "agents.actors",
6100
+ pathParams: ["agent"],
3194
6101
  queryParams: [
3195
6102
  {
3196
- name: "url",
6103
+ name: "key",
3197
6104
  },
3198
6105
  {
3199
- name: "job_id",
6106
+ name: "conversation",
3200
6107
  },
3201
6108
  {
3202
6109
  name: "status",
@@ -3213,39 +6120,82 @@ export const MCP_TOOLS = [
3213
6120
  rawFields: [],
3214
6121
  toolArgs: [],
3215
6122
  bodyDefaults: {},
6123
+ queryDefaults: {
6124
+ limit: 10,
6125
+ },
6126
+ },
6127
+ {
6128
+ name: "agent_get_session",
6129
+ group: "agents",
6130
+ title: "Get an agent session",
6131
+ description: "Read a session (one turn) by its ses_ id: status, phase, woke_from, the harness's result or the error, and the timing of its queue, wake, delivery and harness.",
6132
+ annotations: {
6133
+ title: "Get an agent session",
6134
+ readOnlyHint: true,
6135
+ openWorldHint: false,
6136
+ },
6137
+ inputSchema: {
6138
+ type: "object",
6139
+ properties: {
6140
+ session_id: {
6141
+ type: "string",
6142
+ pattern: "^ses_[0-9a-hjkmnp-tv-z]{26}$",
6143
+ description: "The session's `ses_` ID.",
6144
+ },
6145
+ },
6146
+ required: ["session_id"],
6147
+ additionalProperties: false,
6148
+ },
6149
+ operationId: "agentsGetSession",
6150
+ method: "GET",
6151
+ path: "/v1/agents/sessions/{session_id}",
6152
+ scope: "agents:read",
6153
+ servedBy: "node",
6154
+ stage: "preview",
6155
+ flag: "agents.actors",
6156
+ pathParams: ["session_id"],
6157
+ queryParams: [],
6158
+ body: "none",
6159
+ bodyFields: [],
6160
+ rawFields: [],
6161
+ toolArgs: [],
6162
+ bodyDefaults: {},
3216
6163
  queryDefaults: {},
3217
6164
  },
3218
6165
  {
3219
- name: "webhooks_send_test",
3220
- group: "platform",
3221
- title: "Send a test webhook",
3222
- description: "Send one signed webhook.test event to a URL now and return the delivery with its outcome (not retried).",
6166
+ name: "agent_cancel_session",
6167
+ group: "agents",
6168
+ title: "Cancel an agent session",
6169
+ description: "Cancel a queued or running turn. A queued message is never delivered; a delivered one has its request into the harness closed.",
3223
6170
  annotations: {
3224
- title: "Send a test webhook",
6171
+ title: "Cancel an agent session",
3225
6172
  readOnlyHint: false,
3226
- destructiveHint: false,
3227
- openWorldHint: true,
6173
+ destructiveHint: true,
6174
+ openWorldHint: false,
3228
6175
  },
3229
6176
  inputSchema: {
3230
6177
  type: "object",
3231
6178
  properties: {
3232
- url: {
6179
+ session_id: {
3233
6180
  type: "string",
3234
- format: "uri",
6181
+ pattern: "^ses_[0-9a-hjkmnp-tv-z]{26}$",
6182
+ description: "The session's `ses_` ID.",
3235
6183
  },
3236
6184
  },
3237
- required: ["url"],
6185
+ required: ["session_id"],
3238
6186
  additionalProperties: false,
3239
6187
  },
3240
- operationId: "webhooksSendTest",
6188
+ operationId: "agentsCancelSession",
3241
6189
  method: "POST",
3242
- path: "/v1/webhooks/test",
3243
- scope: "platform:write",
6190
+ path: "/v1/agents/sessions/{session_id}/cancel",
6191
+ scope: "agents:run",
3244
6192
  servedBy: "node",
3245
- pathParams: [],
6193
+ stage: "preview",
6194
+ flag: "agents.actors",
6195
+ pathParams: ["session_id"],
3246
6196
  queryParams: [],
3247
- body: "json",
3248
- bodyFields: ["url"],
6197
+ body: "none",
6198
+ bodyFields: [],
3249
6199
  rawFields: [],
3250
6200
  toolArgs: [],
3251
6201
  bodyDefaults: {},
@@ -3278,6 +6228,118 @@ export const MCP_OPERATIONS = {
3278
6228
  servedBy: "node",
3279
6229
  idempotent: false,
3280
6230
  },
6231
+ agentsCancelSession: {
6232
+ method: "POST",
6233
+ path: "/v1/agents/sessions/{session_id}/cancel",
6234
+ pathParams: ["session_id"],
6235
+ scope: "agents:run",
6236
+ servedBy: "node",
6237
+ idempotent: false,
6238
+ },
6239
+ agentsCreateAgent: {
6240
+ method: "POST",
6241
+ path: "/v1/agents",
6242
+ pathParams: [],
6243
+ scope: "agents:write",
6244
+ servedBy: "node",
6245
+ idempotent: true,
6246
+ },
6247
+ agentsDeleteAgent: {
6248
+ method: "DELETE",
6249
+ path: "/v1/agents/{agent}",
6250
+ pathParams: ["agent"],
6251
+ scope: "agents:write",
6252
+ servedBy: "node",
6253
+ idempotent: false,
6254
+ },
6255
+ agentsDeleteInstance: {
6256
+ method: "DELETE",
6257
+ path: "/v1/agents/{agent}/instances/{key}",
6258
+ pathParams: ["agent", "key"],
6259
+ scope: "agents:write",
6260
+ servedBy: "node",
6261
+ idempotent: false,
6262
+ },
6263
+ agentsGetAgent: {
6264
+ method: "GET",
6265
+ path: "/v1/agents/{agent}",
6266
+ pathParams: ["agent"],
6267
+ scope: "agents:read",
6268
+ servedBy: "node",
6269
+ idempotent: false,
6270
+ },
6271
+ agentsGetInstance: {
6272
+ method: "GET",
6273
+ path: "/v1/agents/{agent}/instances/{key}",
6274
+ pathParams: ["agent", "key"],
6275
+ scope: "agents:read",
6276
+ servedBy: "node",
6277
+ idempotent: false,
6278
+ },
6279
+ agentsGetSession: {
6280
+ method: "GET",
6281
+ path: "/v1/agents/sessions/{session_id}",
6282
+ pathParams: ["session_id"],
6283
+ scope: "agents:read",
6284
+ servedBy: "node",
6285
+ idempotent: false,
6286
+ },
6287
+ agentsListAgents: {
6288
+ method: "GET",
6289
+ path: "/v1/agents",
6290
+ pathParams: [],
6291
+ scope: "agents:read",
6292
+ servedBy: "node",
6293
+ idempotent: false,
6294
+ },
6295
+ agentsListInstanceEvents: {
6296
+ method: "GET",
6297
+ path: "/v1/agents/{agent}/instances/{key}/events",
6298
+ pathParams: ["agent", "key"],
6299
+ scope: "agents:read",
6300
+ servedBy: "node",
6301
+ idempotent: false,
6302
+ },
6303
+ agentsListInstances: {
6304
+ method: "GET",
6305
+ path: "/v1/agents/{agent}/instances",
6306
+ pathParams: ["agent"],
6307
+ scope: "agents:read",
6308
+ servedBy: "node",
6309
+ idempotent: false,
6310
+ },
6311
+ agentsListSessions: {
6312
+ method: "GET",
6313
+ path: "/v1/agents/{agent}/sessions",
6314
+ pathParams: ["agent"],
6315
+ scope: "agents:read",
6316
+ servedBy: "node",
6317
+ idempotent: false,
6318
+ },
6319
+ agentsSendMessage: {
6320
+ method: "POST",
6321
+ path: "/v1/agents/{agent}/instances/{key}/messages",
6322
+ pathParams: ["agent", "key"],
6323
+ scope: "agents:run",
6324
+ servedBy: "node",
6325
+ idempotent: true,
6326
+ },
6327
+ agentsSleepInstance: {
6328
+ method: "POST",
6329
+ path: "/v1/agents/{agent}/instances/{key}/sleep",
6330
+ pathParams: ["agent", "key"],
6331
+ scope: "agents:run",
6332
+ servedBy: "node",
6333
+ idempotent: false,
6334
+ },
6335
+ agentsUpdateAgent: {
6336
+ method: "PATCH",
6337
+ path: "/v1/agents/{agent}",
6338
+ pathParams: ["agent"],
6339
+ scope: "agents:write",
6340
+ servedBy: "node",
6341
+ idempotent: false,
6342
+ },
3281
6343
  inferCreateChatCompletion: {
3282
6344
  method: "POST",
3283
6345
  path: "/v1/infer/chat/completions",
@@ -3302,6 +6364,78 @@ export const MCP_OPERATIONS = {
3302
6364
  servedBy: "node",
3303
6365
  idempotent: false,
3304
6366
  },
6367
+ listenersCreateListener: {
6368
+ method: "POST",
6369
+ path: "/v1/listeners",
6370
+ pathParams: [],
6371
+ scope: "listeners:write",
6372
+ servedBy: "node",
6373
+ idempotent: true,
6374
+ },
6375
+ listenersDeleteListener: {
6376
+ method: "DELETE",
6377
+ path: "/v1/listeners/{listener_id}",
6378
+ pathParams: ["listener_id"],
6379
+ scope: "listeners:write",
6380
+ servedBy: "node",
6381
+ idempotent: false,
6382
+ },
6383
+ listenersGetListener: {
6384
+ method: "GET",
6385
+ path: "/v1/listeners/{listener_id}",
6386
+ pathParams: ["listener_id"],
6387
+ scope: "listeners:read",
6388
+ servedBy: "node",
6389
+ idempotent: false,
6390
+ },
6391
+ listenersIngestEvents: {
6392
+ method: "POST",
6393
+ path: "/v1/listeners/{listener_id}/events",
6394
+ pathParams: ["listener_id"],
6395
+ scope: "listeners:write",
6396
+ servedBy: "node",
6397
+ idempotent: false,
6398
+ },
6399
+ listenersListEvents: {
6400
+ method: "GET",
6401
+ path: "/v1/listeners/{listener_id}/events",
6402
+ pathParams: ["listener_id"],
6403
+ scope: "listeners:read",
6404
+ servedBy: "node",
6405
+ idempotent: false,
6406
+ },
6407
+ listenersListListeners: {
6408
+ method: "GET",
6409
+ path: "/v1/listeners",
6410
+ pathParams: [],
6411
+ scope: "listeners:read",
6412
+ servedBy: "node",
6413
+ idempotent: false,
6414
+ },
6415
+ listenersTestListener: {
6416
+ method: "POST",
6417
+ path: "/v1/listeners/{listener_id}/test",
6418
+ pathParams: ["listener_id"],
6419
+ scope: "listeners:write",
6420
+ servedBy: "node",
6421
+ idempotent: false,
6422
+ },
6423
+ listenersUpdateListener: {
6424
+ method: "PATCH",
6425
+ path: "/v1/listeners/{listener_id}",
6426
+ pathParams: ["listener_id"],
6427
+ scope: "listeners:write",
6428
+ servedBy: "node",
6429
+ idempotent: false,
6430
+ },
6431
+ platformCreatePortHost: {
6432
+ method: "POST",
6433
+ path: "/v1/sandboxes/{sandbox_id}/ports/{port}/host",
6434
+ pathParams: ["sandbox_id", "port"],
6435
+ scope: "sandboxes:run",
6436
+ servedBy: "edge",
6437
+ idempotent: false,
6438
+ },
3305
6439
  platformGetLimits: {
3306
6440
  method: "GET",
3307
6441
  path: "/v1/limits",
@@ -3310,6 +6444,22 @@ export const MCP_OPERATIONS = {
3310
6444
  servedBy: "edge",
3311
6445
  idempotent: false,
3312
6446
  },
6447
+ platformGetLlmCall: {
6448
+ method: "GET",
6449
+ path: "/v1/llm-calls/{request_id}",
6450
+ pathParams: ["request_id"],
6451
+ scope: "platform:read",
6452
+ servedBy: "node",
6453
+ idempotent: false,
6454
+ },
6455
+ platformGetLlmCallContent: {
6456
+ method: "GET",
6457
+ path: "/v1/llm-calls/{request_id}/content",
6458
+ pathParams: ["request_id"],
6459
+ scope: "platform:content:read",
6460
+ servedBy: "node",
6461
+ idempotent: false,
6462
+ },
3313
6463
  platformGetRequest: {
3314
6464
  method: "GET",
3315
6465
  path: "/v1/requests/{request_id}",
@@ -3318,6 +6468,14 @@ export const MCP_OPERATIONS = {
3318
6468
  servedBy: "node",
3319
6469
  idempotent: false,
3320
6470
  },
6471
+ platformGetTrace: {
6472
+ method: "GET",
6473
+ path: "/v1/traces/{trace_id}",
6474
+ pathParams: ["trace_id"],
6475
+ scope: "platform:read",
6476
+ servedBy: "edge",
6477
+ idempotent: false,
6478
+ },
3321
6479
  platformGetUsage: {
3322
6480
  method: "GET",
3323
6481
  path: "/v1/usage",
@@ -3326,6 +6484,14 @@ export const MCP_OPERATIONS = {
3326
6484
  servedBy: "edge",
3327
6485
  idempotent: false,
3328
6486
  },
6487
+ platformListLlmCalls: {
6488
+ method: "GET",
6489
+ path: "/v1/llm-calls",
6490
+ pathParams: [],
6491
+ scope: "platform:read",
6492
+ servedBy: "node",
6493
+ idempotent: false,
6494
+ },
3329
6495
  platformListRequests: {
3330
6496
  method: "GET",
3331
6497
  path: "/v1/requests",
@@ -3334,6 +6500,22 @@ export const MCP_OPERATIONS = {
3334
6500
  servedBy: "node",
3335
6501
  idempotent: false,
3336
6502
  },
6503
+ platformListUsageRecords: {
6504
+ method: "GET",
6505
+ path: "/v1/usage/records",
6506
+ pathParams: [],
6507
+ scope: "platform:read",
6508
+ servedBy: "edge",
6509
+ idempotent: false,
6510
+ },
6511
+ renderCreateInspection: {
6512
+ method: "POST",
6513
+ path: "/v1/render/inspections",
6514
+ pathParams: [],
6515
+ scope: "render:run",
6516
+ servedBy: "node",
6517
+ idempotent: true,
6518
+ },
3337
6519
  renderCreateScreenshot: {
3338
6520
  method: "POST",
3339
6521
  path: "/v1/render/screenshots",
@@ -3354,7 +6536,55 @@ export const MCP_OPERATIONS = {
3354
6536
  method: "GET",
3355
6537
  path: "/v1/render/videos/{video_id}",
3356
6538
  pathParams: ["video_id"],
3357
- scope: "render:read",
6539
+ scope: "authenticated",
6540
+ servedBy: "node",
6541
+ idempotent: false,
6542
+ },
6543
+ renderListPresets: {
6544
+ method: "GET",
6545
+ path: "/v1/render/presets",
6546
+ pathParams: [],
6547
+ scope: "public",
6548
+ servedBy: "node",
6549
+ idempotent: false,
6550
+ },
6551
+ renderRestyleVideo: {
6552
+ method: "POST",
6553
+ path: "/v1/render/videos/{video_id}/restyle",
6554
+ pathParams: ["video_id"],
6555
+ scope: "render:run",
6556
+ servedBy: "node",
6557
+ idempotent: true,
6558
+ },
6559
+ renderShareAlias: {
6560
+ method: "POST",
6561
+ path: "/v1/render/aliases/{alias}/share",
6562
+ pathParams: ["alias"],
6563
+ scope: "render:write",
6564
+ servedBy: "node",
6565
+ idempotent: false,
6566
+ },
6567
+ renderShareVideo: {
6568
+ method: "POST",
6569
+ path: "/v1/render/videos/{video_id}/share",
6570
+ pathParams: ["video_id"],
6571
+ scope: "render:write",
6572
+ servedBy: "node",
6573
+ idempotent: false,
6574
+ },
6575
+ renderUnshareAlias: {
6576
+ method: "DELETE",
6577
+ path: "/v1/render/aliases/{alias}/share",
6578
+ pathParams: ["alias"],
6579
+ scope: "render:write",
6580
+ servedBy: "node",
6581
+ idempotent: false,
6582
+ },
6583
+ renderUnshareVideo: {
6584
+ method: "DELETE",
6585
+ path: "/v1/render/videos/{video_id}/share",
6586
+ pathParams: ["video_id"],
6587
+ scope: "render:write",
3358
6588
  servedBy: "node",
3359
6589
  idempotent: false,
3360
6590
  },
@@ -3374,6 +6604,22 @@ export const MCP_OPERATIONS = {
3374
6604
  servedBy: "node",
3375
6605
  idempotent: false,
3376
6606
  },
6607
+ routinesListRuns: {
6608
+ method: "GET",
6609
+ path: "/v1/routines/{routine}/runs",
6610
+ pathParams: ["routine"],
6611
+ scope: "routines:read",
6612
+ servedBy: "node",
6613
+ idempotent: false,
6614
+ },
6615
+ routinesRunEvents: {
6616
+ method: "GET",
6617
+ path: "/v1/routines/runs/{run_id}/events",
6618
+ pathParams: ["run_id"],
6619
+ scope: "routines:read",
6620
+ servedBy: "node",
6621
+ idempotent: false,
6622
+ },
3377
6623
  routinesSignalRun: {
3378
6624
  method: "POST",
3379
6625
  path: "/v1/routines/runs/{run_id}/signal",
@@ -3390,6 +6636,14 @@ export const MCP_OPERATIONS = {
3390
6636
  servedBy: "node",
3391
6637
  idempotent: false,
3392
6638
  },
6639
+ sandboxesCancelSwarm: {
6640
+ method: "POST",
6641
+ path: "/v1/sandboxes/swarms/{swarm_id}/cancel",
6642
+ pathParams: ["swarm_id"],
6643
+ scope: "sandboxes:write",
6644
+ servedBy: "node",
6645
+ idempotent: false,
6646
+ },
3393
6647
  sandboxesCreatePortUrl: {
3394
6648
  method: "POST",
3395
6649
  path: "/v1/sandboxes/{sandbox_id}/ports/{port}/url",
@@ -3414,6 +6668,14 @@ export const MCP_OPERATIONS = {
3414
6668
  servedBy: "node",
3415
6669
  idempotent: true,
3416
6670
  },
6671
+ sandboxesCreateSwarm: {
6672
+ method: "POST",
6673
+ path: "/v1/sandboxes/swarms",
6674
+ pathParams: [],
6675
+ scope: "sandboxes:write",
6676
+ servedBy: "node",
6677
+ idempotent: true,
6678
+ },
3417
6679
  sandboxesDeleteSandbox: {
3418
6680
  method: "DELETE",
3419
6681
  path: "/v1/sandboxes/{sandbox_id}",
@@ -3462,6 +6724,14 @@ export const MCP_OPERATIONS = {
3462
6724
  servedBy: "node",
3463
6725
  idempotent: false,
3464
6726
  },
6727
+ sandboxesGetSwarm: {
6728
+ method: "GET",
6729
+ path: "/v1/sandboxes/swarms/{swarm_id}",
6730
+ pathParams: ["swarm_id"],
6731
+ scope: "sandboxes:read",
6732
+ servedBy: "node",
6733
+ idempotent: false,
6734
+ },
3465
6735
  sandboxesGetTemplate: {
3466
6736
  method: "GET",
3467
6737
  path: "/v1/sandboxes/templates/{template}",