@b3os/mcp 0.2.1 → 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/src/table.gen.ts CHANGED
@@ -5,7 +5,7 @@ import type { McpTableOperation, McpTableTool } from "./table-types.ts";
5
5
 
6
6
  /** The server-level instruction both MCP servers send. */
7
7
  export const MCP_INSTRUCTIONS: string =
8
- "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.";
8
+ "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.";
9
9
 
10
10
  /** Every tool, core first, in a fixed order (a deterministic tools/list keeps prompt caches warm). */
11
11
  export const MCP_TOOLS: readonly McpTableTool[] = [
@@ -537,7 +537,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
537
537
  group: "core",
538
538
  title: "Render a product video",
539
539
  description:
540
- "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.",
540
+ "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.",
541
541
  annotations: {
542
542
  title: "Render a product video",
543
543
  readOnlyHint: false,
@@ -562,8 +562,21 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
562
562
  },
563
563
  additionalProperties: false,
564
564
  },
565
+ goal: {
566
+ type: "string",
567
+ description:
568
+ "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.",
569
+ },
570
+ alias: {
571
+ type: "string",
572
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
573
+ description:
574
+ "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.",
575
+ },
565
576
  beats: {
566
577
  type: "array",
578
+ description:
579
+ "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}.",
567
580
  items: {
568
581
  type: "object",
569
582
  description: "One line of narration and the steps performed while it is said.",
@@ -594,8 +607,6 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
594
607
  },
595
608
  },
596
609
  },
597
- description:
598
- "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}.",
599
610
  },
600
611
  voice: {
601
612
  type: "object",
@@ -739,7 +750,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
739
750
  },
740
751
  ],
741
752
  body: "json",
742
- bodyFields: ["source", "beats", "voice", "captions", "style", "viewport", "formats"],
753
+ bodyFields: ["source", "goal", "alias", "beats", "voice", "captions", "style", "viewport", "formats"],
743
754
  rawFields: [],
744
755
  toolArgs: ["job_id", "wait_s", "include_poster"],
745
756
  bodyDefaults: {},
@@ -770,7 +781,8 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
770
781
  template: {
771
782
  type: "string",
772
783
  default: "base",
773
- description: "Template name or `tpl_` ID. Ignored when `snapshot` is set.",
784
+ description:
785
+ "Template name or `tpl_` ID: a node template (`GET /v1/sandboxes/templates`) or one of your project's image templates (an image's `template`).",
774
786
  },
775
787
  snapshot: {
776
788
  type: "string",
@@ -1467,7 +1479,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
1467
1479
  status: {
1468
1480
  type: "string",
1469
1481
  description: "Only sandboxes with this status.",
1470
- enum: ["running", "paused", "stopped", "failed"],
1482
+ enum: ["running", "paused", "stopped", "failed", "hibernated"],
1471
1483
  },
1472
1484
  limit: {
1473
1485
  type: "integer",
@@ -1591,6 +1603,137 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
1591
1603
  bodyDefaults: {},
1592
1604
  queryDefaults: {},
1593
1605
  },
1606
+ {
1607
+ name: "sandbox_swarm",
1608
+ group: "sandboxes",
1609
+ title: "Run a swarm",
1610
+ description:
1611
+ "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.",
1612
+ annotations: {
1613
+ title: "Run a swarm",
1614
+ readOnlyHint: false,
1615
+ destructiveHint: false,
1616
+ openWorldHint: true,
1617
+ },
1618
+ inputSchema: {
1619
+ type: "object",
1620
+ properties: {
1621
+ from: {
1622
+ type: "object",
1623
+ description: "The checkpoint: {sandbox: sbx_…} (created with forkable: true) or {snapshot: snap_…}.",
1624
+ },
1625
+ children: {
1626
+ type: "array",
1627
+ description: "One object per child: {cmd, env, cwd, stdin, timeout_ms}; cmd is a shell line or an argv.",
1628
+ items: {
1629
+ type: "object",
1630
+ },
1631
+ },
1632
+ count: {
1633
+ type: "integer",
1634
+ minimum: 1,
1635
+ maximum: 32,
1636
+ description: "This many children, each running `defaults`.",
1637
+ },
1638
+ defaults: {
1639
+ type: "object",
1640
+ description: "The child spec every child starts from ({cmd, env, cwd, timeout_ms}).",
1641
+ },
1642
+ stop_when: {
1643
+ type: "string",
1644
+ enum: ["all", "first_success"],
1645
+ default: "all",
1646
+ description: "`first_success`: once a child exits 0, kill the other children's commands and end the swarm.",
1647
+ },
1648
+ keep: {
1649
+ type: "string",
1650
+ enum: ["none", "succeeded", "all"],
1651
+ default: "none",
1652
+ description: "Which children stay running after their command ends; the rest are deleted.",
1653
+ },
1654
+ job_id: {
1655
+ type: "string",
1656
+ description: "A swm_… id from an earlier call: keep waiting or read the results.",
1657
+ },
1658
+ wait_s: {
1659
+ type: "integer",
1660
+ minimum: 0,
1661
+ maximum: 60,
1662
+ default: 50,
1663
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
1664
+ },
1665
+ },
1666
+ additionalProperties: false,
1667
+ },
1668
+ operationId: "sandboxesCreateSwarm",
1669
+ method: "POST",
1670
+ path: "/v1/sandboxes/swarms",
1671
+ scope: "sandboxes:write",
1672
+ servedBy: "node",
1673
+ stage: "preview",
1674
+ flag: "sandboxes.swarms",
1675
+ pathParams: [],
1676
+ queryParams: [
1677
+ {
1678
+ name: "wait",
1679
+ from: "wait_s",
1680
+ },
1681
+ ],
1682
+ body: "json",
1683
+ bodyFields: ["from", "children", "count", "defaults", "stop_when", "keep"],
1684
+ rawFields: [],
1685
+ toolArgs: ["job_id", "wait_s"],
1686
+ bodyDefaults: {},
1687
+ queryDefaults: {},
1688
+ continueWith: {
1689
+ arg: "job_id",
1690
+ operationId: "sandboxesGetSwarm",
1691
+ method: "GET",
1692
+ path: "/v1/sandboxes/swarms/{swarm_id}",
1693
+ pathParam: "swarm_id",
1694
+ },
1695
+ },
1696
+ {
1697
+ name: "sandbox_cancel_swarm",
1698
+ group: "sandboxes",
1699
+ title: "Cancel a swarm",
1700
+ description:
1701
+ "Stop a running swarm: its children's commands are killed and the children deleted unless its keep keeps them.",
1702
+ annotations: {
1703
+ title: "Cancel a swarm",
1704
+ readOnlyHint: false,
1705
+ destructiveHint: true,
1706
+ idempotentHint: true,
1707
+ openWorldHint: false,
1708
+ },
1709
+ inputSchema: {
1710
+ type: "object",
1711
+ properties: {
1712
+ swarm_id: {
1713
+ type: "string",
1714
+ pattern: "^swm_[0-9a-hjkmnp-tv-z]{26}$",
1715
+ description: "The swarm ID (`swm_…`).",
1716
+ },
1717
+ },
1718
+ required: ["swarm_id"],
1719
+ additionalProperties: false,
1720
+ },
1721
+ operationId: "sandboxesCancelSwarm",
1722
+ method: "POST",
1723
+ path: "/v1/sandboxes/swarms/{swarm_id}/cancel",
1724
+ scope: "sandboxes:write",
1725
+ servedBy: "node",
1726
+ stage: "preview",
1727
+ flag: "sandboxes.swarms",
1728
+ pathParams: ["swarm_id"],
1729
+ queryParams: [],
1730
+ body: "none",
1731
+ bodyFields: [],
1732
+ rawFields: [],
1733
+ toolArgs: [],
1734
+ bodyDefaults: {},
1735
+ queryDefaults: {},
1736
+ },
1594
1737
  {
1595
1738
  name: "sandbox_snapshot",
1596
1739
  group: "sandboxes",
@@ -1916,6 +2059,83 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
1916
2059
  bodyDefaults: {},
1917
2060
  queryDefaults: {},
1918
2061
  },
2062
+ {
2063
+ name: "sandbox_port_host",
2064
+ group: "sandboxes",
2065
+ title: "Give a port its own host",
2066
+ description:
2067
+ "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.",
2068
+ annotations: {
2069
+ title: "Give a port its own host",
2070
+ readOnlyHint: false,
2071
+ destructiveHint: false,
2072
+ openWorldHint: false,
2073
+ },
2074
+ inputSchema: {
2075
+ type: "object",
2076
+ properties: {
2077
+ sandbox_id: {
2078
+ type: "string",
2079
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
2080
+ description: "The sandbox ID (`sbx_…`).",
2081
+ },
2082
+ port: {
2083
+ type: "integer",
2084
+ minimum: 1,
2085
+ maximum: 65535,
2086
+ description: "A port declared in the sandbox's `ports` (not 49983, which is kept for E2B's envd).",
2087
+ },
2088
+ ttl_s: {
2089
+ type: "integer",
2090
+ minimum: 60,
2091
+ maximum: 86400,
2092
+ default: 600,
2093
+ description: "How long the link works, in seconds.",
2094
+ },
2095
+ rotate: {
2096
+ type: "boolean",
2097
+ default: false,
2098
+ description:
2099
+ "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).",
2100
+ },
2101
+ cookies: {
2102
+ type: "object",
2103
+ required: ["mode", "script"],
2104
+ properties: {
2105
+ mode: {
2106
+ type: "string",
2107
+ enum: ["isolated", "shared"],
2108
+ description: "`isolated`: the app's server gets only the cookies its own address set, plus...",
2109
+ },
2110
+ script: {
2111
+ type: "array",
2112
+ description: "Cookies a page script writes and the app's server reads, by name.",
2113
+ items: {
2114
+ type: "string",
2115
+ pattern: "^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,64}$",
2116
+ },
2117
+ },
2118
+ },
2119
+ additionalProperties: false,
2120
+ },
2121
+ },
2122
+ required: ["sandbox_id", "port"],
2123
+ additionalProperties: false,
2124
+ },
2125
+ operationId: "platformCreatePortHost",
2126
+ method: "POST",
2127
+ path: "/v1/sandboxes/{sandbox_id}/ports/{port}/host",
2128
+ scope: "sandboxes:run",
2129
+ servedBy: "edge",
2130
+ pathParams: ["sandbox_id", "port"],
2131
+ queryParams: [],
2132
+ body: "json",
2133
+ bodyFields: ["ttl_s", "rotate", "cookies"],
2134
+ rawFields: [],
2135
+ toolArgs: [],
2136
+ bodyDefaults: {},
2137
+ queryDefaults: {},
2138
+ },
1919
2139
  {
1920
2140
  name: "sandbox_logs",
1921
2141
  group: "sandboxes",
@@ -2734,6 +2954,71 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
2734
2954
  bodyDefaults: {},
2735
2955
  queryDefaults: {},
2736
2956
  },
2957
+ {
2958
+ name: "routine_list_runs",
2959
+ group: "routines",
2960
+ title: "List a routine's runs",
2961
+ description:
2962
+ "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.",
2963
+ annotations: {
2964
+ title: "List a routine's runs",
2965
+ readOnlyHint: true,
2966
+ openWorldHint: false,
2967
+ },
2968
+ inputSchema: {
2969
+ type: "object",
2970
+ properties: {
2971
+ routine: {
2972
+ type: "string",
2973
+ description:
2974
+ "A routine ID (`rtn_…`) or name. Names are unique per project; `runs`, `hooks`, `validate` and `import` are reserved and cannot be routine names.",
2975
+ },
2976
+ status: {
2977
+ type: "string",
2978
+ description: "Only runs with this status.",
2979
+ enum: ["queued", "running", "succeeded", "failed", "canceled"],
2980
+ },
2981
+ limit: {
2982
+ type: "integer",
2983
+ minimum: 1,
2984
+ maximum: 100,
2985
+ default: 10,
2986
+ description: "Page size, from 1 to 100.",
2987
+ },
2988
+ cursor: {
2989
+ type: "string",
2990
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
2991
+ },
2992
+ },
2993
+ required: ["routine"],
2994
+ additionalProperties: false,
2995
+ },
2996
+ operationId: "routinesListRuns",
2997
+ method: "GET",
2998
+ path: "/v1/routines/{routine}/runs",
2999
+ scope: "routines:read",
3000
+ servedBy: "node",
3001
+ pathParams: ["routine"],
3002
+ queryParams: [
3003
+ {
3004
+ name: "status",
3005
+ },
3006
+ {
3007
+ name: "limit",
3008
+ },
3009
+ {
3010
+ name: "cursor",
3011
+ },
3012
+ ],
3013
+ body: "none",
3014
+ bodyFields: [],
3015
+ rawFields: [],
3016
+ toolArgs: [],
3017
+ bodyDefaults: {},
3018
+ queryDefaults: {
3019
+ limit: 10,
3020
+ },
3021
+ },
2737
3022
  {
2738
3023
  name: "routine_get_run",
2739
3024
  group: "routines",
@@ -2771,6 +3056,50 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
2771
3056
  bodyDefaults: {},
2772
3057
  queryDefaults: {},
2773
3058
  },
3059
+ {
3060
+ name: "routine_run_events",
3061
+ group: "routines",
3062
+ title: "Read a run's events",
3063
+ description:
3064
+ "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.",
3065
+ annotations: {
3066
+ title: "Read a run's events",
3067
+ readOnlyHint: true,
3068
+ openWorldHint: false,
3069
+ },
3070
+ inputSchema: {
3071
+ type: "object",
3072
+ properties: {
3073
+ run_id: {
3074
+ type: "string",
3075
+ pattern: "^run_[0-9a-hjkmnp-tv-z]{26}$",
3076
+ description: "The run ID (`run_…`).",
3077
+ },
3078
+ max_events: {
3079
+ type: "integer",
3080
+ minimum: 1,
3081
+ maximum: 500,
3082
+ default: 40,
3083
+ description: "The last events to show; the answer counts the earlier ones.",
3084
+ },
3085
+ },
3086
+ required: ["run_id"],
3087
+ additionalProperties: false,
3088
+ },
3089
+ operationId: "routinesRunEvents",
3090
+ method: "GET",
3091
+ path: "/v1/routines/runs/{run_id}/events",
3092
+ scope: "routines:read",
3093
+ servedBy: "node",
3094
+ pathParams: ["run_id"],
3095
+ queryParams: [],
3096
+ body: "none",
3097
+ bodyFields: [],
3098
+ rawFields: [],
3099
+ toolArgs: ["max_events"],
3100
+ bodyDefaults: {},
3101
+ queryDefaults: {},
3102
+ },
2774
3103
  {
2775
3104
  name: "routine_validate",
2776
3105
  group: "routines",
@@ -3071,7 +3400,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3071
3400
  group: "platform",
3072
3401
  title: "List API requests",
3073
3402
  description:
3074
- "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.",
3403
+ "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.",
3075
3404
  annotations: {
3076
3405
  title: "List API requests",
3077
3406
  readOnlyHint: true,
@@ -3095,6 +3424,11 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3095
3424
  type: "string",
3096
3425
  pattern: "^key_[0-9a-hjkmnp-tv-z]{26}$",
3097
3426
  },
3427
+ source: {
3428
+ type: "string",
3429
+ description:
3430
+ "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.",
3431
+ },
3098
3432
  connection: {
3099
3433
  type: "string",
3100
3434
  description: "Only requests that arrived this way.",
@@ -3105,6 +3439,12 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3105
3439
  pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3106
3440
  description: "Only requests made from inside this sandbox.",
3107
3441
  },
3442
+ trace_id: {
3443
+ type: "string",
3444
+ pattern: "^[0-9a-f]{32}$",
3445
+ description:
3446
+ "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...",
3447
+ },
3108
3448
  since: {
3109
3449
  type: "string",
3110
3450
  format: "date-time",
@@ -3142,12 +3482,18 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3142
3482
  {
3143
3483
  name: "key_id",
3144
3484
  },
3485
+ {
3486
+ name: "source",
3487
+ },
3145
3488
  {
3146
3489
  name: "connection",
3147
3490
  },
3148
3491
  {
3149
3492
  name: "sandbox_id",
3150
3493
  },
3494
+ {
3495
+ name: "trace_id",
3496
+ },
3151
3497
  {
3152
3498
  name: "since",
3153
3499
  },
@@ -3170,7 +3516,7 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3170
3516
  group: "platform",
3171
3517
  title: "Get an API request",
3172
3518
  description:
3173
- "Get one request by its ID (a response's x-request-id) with its full timing phase breakdown, node and edge.",
3519
+ "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.",
3174
3520
  annotations: {
3175
3521
  title: "Get an API request",
3176
3522
  readOnlyHint: true,
@@ -3202,6 +3548,303 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3202
3548
  bodyDefaults: {},
3203
3549
  queryDefaults: {},
3204
3550
  },
3551
+ {
3552
+ name: "traces_list",
3553
+ group: "platform",
3554
+ title: "List traces",
3555
+ description:
3556
+ "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.",
3557
+ annotations: {
3558
+ title: "List traces",
3559
+ readOnlyHint: true,
3560
+ openWorldHint: false,
3561
+ },
3562
+ inputSchema: {
3563
+ type: "object",
3564
+ properties: {
3565
+ since: {
3566
+ type: "string",
3567
+ format: "date-time",
3568
+ description: "Only requests from this time on (RFC 3339); the log keeps 7 days.",
3569
+ },
3570
+ sandbox_id: {
3571
+ type: "string",
3572
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3573
+ description: "Only requests made from inside this sandbox.",
3574
+ },
3575
+ source: {
3576
+ type: "string",
3577
+ description:
3578
+ "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.",
3579
+ },
3580
+ status: {
3581
+ type: "string",
3582
+ enum: ["ok", "error"],
3583
+ description: "Only traces where no call failed (ok), or where at least one did (error).",
3584
+ },
3585
+ app: {
3586
+ type: "string",
3587
+ pattern: "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
3588
+ description: "Only traces of this application's services (its b3os.yaml name); also needs sandboxes:read.",
3589
+ },
3590
+ single_calls: {
3591
+ type: "boolean",
3592
+ default: false,
3593
+ description: "Also list traces of one call and its retries (a call made outside a turn has its own).",
3594
+ },
3595
+ limit: {
3596
+ type: "integer",
3597
+ minimum: 1,
3598
+ maximum: 50,
3599
+ default: 10,
3600
+ description: "Traces to list.",
3601
+ },
3602
+ },
3603
+ additionalProperties: false,
3604
+ },
3605
+ operationId: "platformListRequests",
3606
+ method: "GET",
3607
+ path: "/v1/requests",
3608
+ scope: "platform:read",
3609
+ servedBy: "node",
3610
+ pathParams: [],
3611
+ queryParams: [
3612
+ {
3613
+ name: "since",
3614
+ },
3615
+ {
3616
+ name: "sandbox_id",
3617
+ },
3618
+ {
3619
+ name: "source",
3620
+ },
3621
+ ],
3622
+ body: "none",
3623
+ bodyFields: [],
3624
+ rawFields: [],
3625
+ toolArgs: ["status", "app", "single_calls", "limit"],
3626
+ bodyDefaults: {},
3627
+ queryDefaults: {},
3628
+ },
3629
+ {
3630
+ name: "traces_get",
3631
+ group: "platform",
3632
+ title: "Get a trace",
3633
+ description:
3634
+ "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.",
3635
+ annotations: {
3636
+ title: "Get a trace",
3637
+ readOnlyHint: true,
3638
+ openWorldHint: false,
3639
+ },
3640
+ inputSchema: {
3641
+ type: "object",
3642
+ properties: {
3643
+ trace_id: {
3644
+ type: "string",
3645
+ pattern: "^[0-9a-f]{32}$",
3646
+ description: "The trace's 32-hex id: a request's trace_id, or one traces_list gave.",
3647
+ },
3648
+ max_spans: {
3649
+ type: "integer",
3650
+ minimum: 1,
3651
+ maximum: 300,
3652
+ default: 25,
3653
+ description: "Spans to show; the answer counts the rest and says how to read them.",
3654
+ },
3655
+ from_span: {
3656
+ type: "integer",
3657
+ minimum: 1,
3658
+ maximum: 300,
3659
+ default: 1,
3660
+ description: "The first span to show, by its number in an earlier answer.",
3661
+ },
3662
+ },
3663
+ required: ["trace_id"],
3664
+ additionalProperties: false,
3665
+ },
3666
+ operationId: "platformGetTrace",
3667
+ method: "GET",
3668
+ path: "/v1/traces/{trace_id}",
3669
+ scope: "platform:read",
3670
+ servedBy: "edge",
3671
+ pathParams: ["trace_id"],
3672
+ queryParams: [],
3673
+ body: "none",
3674
+ bodyFields: [],
3675
+ rawFields: [],
3676
+ toolArgs: ["max_spans", "from_span"],
3677
+ bodyDefaults: {},
3678
+ queryDefaults: {},
3679
+ },
3680
+ {
3681
+ name: "llm_calls_list",
3682
+ group: "platform",
3683
+ title: "List kept model calls",
3684
+ description:
3685
+ "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.",
3686
+ annotations: {
3687
+ title: "List kept model calls",
3688
+ readOnlyHint: true,
3689
+ openWorldHint: false,
3690
+ },
3691
+ inputSchema: {
3692
+ type: "object",
3693
+ properties: {
3694
+ trace_id: {
3695
+ type: "string",
3696
+ pattern: "^[0-9a-f]{32}$",
3697
+ description: "Only calls of this W3C trace (the trace id of their `traceparent`).",
3698
+ },
3699
+ model: {
3700
+ type: "string",
3701
+ },
3702
+ sandbox_id: {
3703
+ type: "string",
3704
+ pattern: "^sbx_[0-9a-hjkmnp-tv-z]{26}$",
3705
+ description: "Only calls made from inside this sandbox.",
3706
+ },
3707
+ since: {
3708
+ type: "string",
3709
+ format: "date-time",
3710
+ },
3711
+ limit: {
3712
+ type: "integer",
3713
+ minimum: 1,
3714
+ maximum: 100,
3715
+ default: 10,
3716
+ description: "Page size, from 1 to 100.",
3717
+ },
3718
+ cursor: {
3719
+ type: "string",
3720
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3721
+ },
3722
+ },
3723
+ additionalProperties: false,
3724
+ },
3725
+ operationId: "platformListLlmCalls",
3726
+ method: "GET",
3727
+ path: "/v1/llm-calls",
3728
+ scope: "platform:read",
3729
+ servedBy: "node",
3730
+ pathParams: [],
3731
+ queryParams: [
3732
+ {
3733
+ name: "trace_id",
3734
+ },
3735
+ {
3736
+ name: "model",
3737
+ },
3738
+ {
3739
+ name: "sandbox_id",
3740
+ },
3741
+ {
3742
+ name: "since",
3743
+ },
3744
+ {
3745
+ name: "limit",
3746
+ },
3747
+ {
3748
+ name: "cursor",
3749
+ },
3750
+ ],
3751
+ body: "none",
3752
+ bodyFields: [],
3753
+ rawFields: [],
3754
+ toolArgs: [],
3755
+ bodyDefaults: {},
3756
+ queryDefaults: {
3757
+ limit: 10,
3758
+ },
3759
+ },
3760
+ {
3761
+ name: "llm_calls_get",
3762
+ group: "platform",
3763
+ title: "Get a kept model call",
3764
+ description:
3765
+ "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.",
3766
+ annotations: {
3767
+ title: "Get a kept model call",
3768
+ readOnlyHint: true,
3769
+ openWorldHint: false,
3770
+ },
3771
+ inputSchema: {
3772
+ type: "object",
3773
+ properties: {
3774
+ request_id: {
3775
+ type: "string",
3776
+ pattern: "^req_[0-9a-hjkmnp-tv-z]{26}$",
3777
+ description: "The request ID of the model call (its `x-request-id`).",
3778
+ },
3779
+ },
3780
+ required: ["request_id"],
3781
+ additionalProperties: false,
3782
+ },
3783
+ operationId: "platformGetLlmCall",
3784
+ method: "GET",
3785
+ path: "/v1/llm-calls/{request_id}",
3786
+ scope: "platform:read",
3787
+ servedBy: "node",
3788
+ pathParams: ["request_id"],
3789
+ queryParams: [],
3790
+ body: "none",
3791
+ bodyFields: [],
3792
+ rawFields: [],
3793
+ toolArgs: [],
3794
+ bodyDefaults: {},
3795
+ queryDefaults: {},
3796
+ },
3797
+ {
3798
+ name: "llm_calls_get_prompt_and_answer",
3799
+ group: "platform",
3800
+ title: "Read a model call's prompt and answer",
3801
+ description:
3802
+ "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.",
3803
+ annotations: {
3804
+ title: "Read a model call's prompt and answer",
3805
+ readOnlyHint: true,
3806
+ openWorldHint: false,
3807
+ },
3808
+ inputSchema: {
3809
+ type: "object",
3810
+ properties: {
3811
+ request_id: {
3812
+ type: "string",
3813
+ pattern: "^req_[0-9a-hjkmnp-tv-z]{26}$",
3814
+ description: "The request ID of the model call (its `x-request-id`).",
3815
+ },
3816
+ max_chars: {
3817
+ type: "integer",
3818
+ minimum: 1000,
3819
+ maximum: 100000,
3820
+ default: 12000,
3821
+ description: "Characters of text to return at most.",
3822
+ },
3823
+ max_field_chars: {
3824
+ type: "integer",
3825
+ minimum: 200,
3826
+ maximum: 100000,
3827
+ default: 2000,
3828
+ description: "A message, the answer or a tool call's arguments longer than this is cut in the middle.",
3829
+ },
3830
+ },
3831
+ required: ["request_id"],
3832
+ additionalProperties: false,
3833
+ },
3834
+ operationId: "platformGetLlmCallContent",
3835
+ method: "GET",
3836
+ path: "/v1/llm-calls/{request_id}/content",
3837
+ scope: "platform:content:read",
3838
+ servedBy: "node",
3839
+ pathParams: ["request_id"],
3840
+ queryParams: [],
3841
+ body: "none",
3842
+ bodyFields: [],
3843
+ rawFields: [],
3844
+ toolArgs: ["max_chars", "max_field_chars"],
3845
+ bodyDefaults: {},
3846
+ queryDefaults: {},
3847
+ },
3205
3848
  {
3206
3849
  name: "webhooks_list_deliveries",
3207
3850
  group: "platform",
@@ -3220,19 +3863,2340 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3220
3863
  format: "uri",
3221
3864
  description: "Only deliveries to this endpoint.",
3222
3865
  },
3223
- job_id: {
3866
+ job_id: {
3867
+ type: "string",
3868
+ description: "Only deliveries for this job.",
3869
+ },
3870
+ status: {
3871
+ type: "string",
3872
+ enum: ["pending", "retrying", "succeeded", "failed"],
3873
+ },
3874
+ limit: {
3875
+ type: "integer",
3876
+ minimum: 1,
3877
+ maximum: 100,
3878
+ default: 20,
3879
+ description: "Page size, from 1 to 100.",
3880
+ },
3881
+ cursor: {
3882
+ type: "string",
3883
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3884
+ },
3885
+ },
3886
+ additionalProperties: false,
3887
+ },
3888
+ operationId: "webhooksListDeliveries",
3889
+ method: "GET",
3890
+ path: "/v1/webhooks/deliveries",
3891
+ scope: "platform:read",
3892
+ servedBy: "node",
3893
+ pathParams: [],
3894
+ queryParams: [
3895
+ {
3896
+ name: "url",
3897
+ },
3898
+ {
3899
+ name: "job_id",
3900
+ },
3901
+ {
3902
+ name: "status",
3903
+ },
3904
+ {
3905
+ name: "limit",
3906
+ },
3907
+ {
3908
+ name: "cursor",
3909
+ },
3910
+ ],
3911
+ body: "none",
3912
+ bodyFields: [],
3913
+ rawFields: [],
3914
+ toolArgs: [],
3915
+ bodyDefaults: {},
3916
+ queryDefaults: {},
3917
+ },
3918
+ {
3919
+ name: "webhooks_send_test",
3920
+ group: "platform",
3921
+ title: "Send a test webhook",
3922
+ description:
3923
+ "Send one signed webhook.test event to a URL now and return the delivery with its outcome (not retried).",
3924
+ annotations: {
3925
+ title: "Send a test webhook",
3926
+ readOnlyHint: false,
3927
+ destructiveHint: false,
3928
+ openWorldHint: true,
3929
+ },
3930
+ inputSchema: {
3931
+ type: "object",
3932
+ properties: {
3933
+ url: {
3934
+ type: "string",
3935
+ format: "uri",
3936
+ },
3937
+ },
3938
+ required: ["url"],
3939
+ additionalProperties: false,
3940
+ },
3941
+ operationId: "webhooksSendTest",
3942
+ method: "POST",
3943
+ path: "/v1/webhooks/test",
3944
+ scope: "platform:write",
3945
+ servedBy: "node",
3946
+ pathParams: [],
3947
+ queryParams: [],
3948
+ body: "json",
3949
+ bodyFields: ["url"],
3950
+ rawFields: [],
3951
+ toolArgs: [],
3952
+ bodyDefaults: {},
3953
+ queryDefaults: {},
3954
+ },
3955
+ {
3956
+ name: "render_inspect",
3957
+ group: "render",
3958
+ title: "Inspect a page frame by frame",
3959
+ description:
3960
+ "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.",
3961
+ annotations: {
3962
+ title: "Inspect a page frame by frame",
3963
+ readOnlyHint: true,
3964
+ openWorldHint: true,
3965
+ },
3966
+ inputSchema: {
3967
+ type: "object",
3968
+ properties: {
3969
+ url: {
3970
+ type: "string",
3971
+ format: "uri",
3972
+ description: "Page to load (`http` or `https`), checked by the egress guard.",
3973
+ },
3974
+ video_id: {
3975
+ type: "string",
3976
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
3977
+ description: "A succeeded video of this project to read the window from.",
3978
+ },
3979
+ steps: {
3980
+ type: "array",
3981
+ description:
3982
+ "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}.",
3983
+ items: {
3984
+ description: "One browser step of a beat; `kind` selects it.",
3985
+ oneOf: [
3986
+ {
3987
+ type: "object",
3988
+ required: ["kind", "url"],
3989
+ properties: {
3990
+ kind: {
3991
+ type: "string",
3992
+ const: "navigate",
3993
+ },
3994
+ url: {
3995
+ type: "string",
3996
+ format: "uri",
3997
+ },
3998
+ wait_until: {
3999
+ type: "string",
4000
+ enum: ["load", "domcontentloaded", "networkidle"],
4001
+ default: "load",
4002
+ },
4003
+ timeout_ms: {
4004
+ type: "integer",
4005
+ minimum: 100,
4006
+ maximum: 120000,
4007
+ default: 10000,
4008
+ },
4009
+ },
4010
+ },
4011
+ {
4012
+ type: "object",
4013
+ required: ["kind", "target"],
4014
+ properties: {
4015
+ kind: {
4016
+ type: "string",
4017
+ const: "click",
4018
+ },
4019
+ target: {
4020
+ type: "object",
4021
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4022
+ },
4023
+ button: {
4024
+ type: "string",
4025
+ enum: ["left", "right", "middle"],
4026
+ default: "left",
4027
+ },
4028
+ count: {
4029
+ type: "integer",
4030
+ minimum: 1,
4031
+ maximum: 3,
4032
+ default: 1,
4033
+ },
4034
+ modifiers: {
4035
+ type: "array",
4036
+ description: "Modifier keys held during the action.",
4037
+ },
4038
+ },
4039
+ },
4040
+ {
4041
+ type: "object",
4042
+ required: ["kind", "target"],
4043
+ properties: {
4044
+ kind: {
4045
+ type: "string",
4046
+ const: "hover",
4047
+ },
4048
+ target: {
4049
+ type: "object",
4050
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4051
+ },
4052
+ },
4053
+ },
4054
+ {
4055
+ type: "object",
4056
+ required: ["kind", "text"],
4057
+ properties: {
4058
+ kind: {
4059
+ type: "string",
4060
+ const: "type",
4061
+ },
4062
+ target: {
4063
+ type: "object",
4064
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4065
+ },
4066
+ text: {
4067
+ type: "string",
4068
+ },
4069
+ interval_ms: {
4070
+ type: "integer",
4071
+ minimum: 0,
4072
+ maximum: 1000,
4073
+ default: 35,
4074
+ description: "Delay between characters on the video's clock.",
4075
+ },
4076
+ },
4077
+ },
4078
+ {
4079
+ type: "object",
4080
+ required: ["kind", "key"],
4081
+ properties: {
4082
+ kind: {
4083
+ type: "string",
4084
+ const: "key",
4085
+ },
4086
+ key: {
4087
+ type: "string",
4088
+ },
4089
+ modifiers: {
4090
+ type: "array",
4091
+ description: "Modifier keys held during the action.",
4092
+ },
4093
+ },
4094
+ },
4095
+ {
4096
+ type: "object",
4097
+ required: ["kind"],
4098
+ description: "Scroll to an offset (`to`), by a delta (`by`), or until `target` is in view.",
4099
+ properties: {
4100
+ kind: {
4101
+ type: "string",
4102
+ const: "scroll",
4103
+ },
4104
+ target: {
4105
+ type: "object",
4106
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4107
+ },
4108
+ to: {
4109
+ type: "object",
4110
+ description: "A position in CSS pixels.",
4111
+ },
4112
+ by: {
4113
+ type: "object",
4114
+ description: "A position in CSS pixels.",
4115
+ },
4116
+ duration_ms: {
4117
+ type: "integer",
4118
+ minimum: 0,
4119
+ maximum: 10000,
4120
+ default: 600,
4121
+ },
4122
+ },
4123
+ },
4124
+ {
4125
+ type: "object",
4126
+ required: ["kind", "target", "value"],
4127
+ properties: {
4128
+ kind: {
4129
+ type: "string",
4130
+ const: "select",
4131
+ },
4132
+ target: {
4133
+ type: "object",
4134
+ description: "How an action finds its element (the same rules as render timelines, `timelin...",
4135
+ },
4136
+ value: {
4137
+ type: "string",
4138
+ },
4139
+ },
4140
+ },
4141
+ {
4142
+ type: "object",
4143
+ required: ["kind"],
4144
+ description: "Pause the story (`ms`) or hold the clock until a condition holds (`for`).",
4145
+ properties: {
4146
+ kind: {
4147
+ type: "string",
4148
+ const: "wait",
4149
+ },
4150
+ ms: {
4151
+ type: "integer",
4152
+ minimum: 1,
4153
+ maximum: 30000,
4154
+ },
4155
+ for: {
4156
+ type: "object",
4157
+ description: "Exactly one condition to wait for (the same as a timeline `wait` action's `fo...",
4158
+ },
4159
+ timeout_ms: {
4160
+ type: "integer",
4161
+ minimum: 100,
4162
+ maximum: 120000,
4163
+ default: 10000,
4164
+ },
4165
+ },
4166
+ },
4167
+ ],
4168
+ discriminator: {
4169
+ propertyName: "kind",
4170
+ mapping: {
4171
+ navigate: "#/components/schemas/StepNavigate",
4172
+ click: "#/components/schemas/StepClick",
4173
+ hover: "#/components/schemas/StepHover",
4174
+ type: "#/components/schemas/StepType",
4175
+ key: "#/components/schemas/StepKey",
4176
+ scroll: "#/components/schemas/StepScroll",
4177
+ select: "#/components/schemas/StepSelect",
4178
+ wait: "#/components/schemas/StepWait",
4179
+ },
4180
+ },
4181
+ },
4182
+ },
4183
+ watch: {
4184
+ type: "array",
4185
+ description:
4186
+ "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.",
4187
+ items: {
4188
+ type: "object",
4189
+ description: "An element to follow frame by frame: `selector` (CSS), or visible `text` (cas...",
4190
+ properties: {
4191
+ selector: {
4192
+ type: "string",
4193
+ },
4194
+ text: {
4195
+ type: "string",
4196
+ },
4197
+ exact: {
4198
+ type: "boolean",
4199
+ default: false,
4200
+ },
4201
+ nth: {
4202
+ type: "integer",
4203
+ minimum: 0,
4204
+ maximum: 1000,
4205
+ },
4206
+ },
4207
+ oneOf: [
4208
+ {
4209
+ required: ["selector"],
4210
+ },
4211
+ {
4212
+ required: ["text"],
4213
+ },
4214
+ ],
4215
+ },
4216
+ },
4217
+ duration_ms: {
4218
+ type: "integer",
4219
+ minimum: 500,
4220
+ maximum: 10000,
4221
+ description:
4222
+ "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...",
4223
+ },
4224
+ from_ms: {
4225
+ type: "integer",
4226
+ minimum: 0,
4227
+ description:
4228
+ "With `video_id` only (refused with `url`): where the window starts in the video, 0 when left out.",
4229
+ },
4230
+ fps: {
4231
+ type: "integer",
4232
+ enum: [10, 15, 30, 60],
4233
+ description:
4234
+ "Frames a second. Default 30; with `video_id`, the video's own rate. `duration_ms` times `fps` is at most 300 frames.",
4235
+ },
4236
+ viewport: {
4237
+ type: "object",
4238
+ description: "Browser viewport in CSS pixels. Default 1280x800.",
4239
+ required: ["width", "height"],
4240
+ properties: {
4241
+ width: {
4242
+ type: "integer",
4243
+ minimum: 320,
4244
+ maximum: 1920,
4245
+ },
4246
+ height: {
4247
+ type: "integer",
4248
+ minimum: 320,
4249
+ maximum: 1200,
4250
+ },
4251
+ },
4252
+ additionalProperties: false,
4253
+ },
4254
+ theme: {
4255
+ type: "string",
4256
+ enum: ["light", "dark", "auto"],
4257
+ default: "auto",
4258
+ description: "Emulated `prefers-color-scheme`; `auto` leaves the page default.",
4259
+ },
4260
+ interval_ms: {
4261
+ type: "integer",
4262
+ minimum: 33,
4263
+ maximum: 10000,
4264
+ description:
4265
+ "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.",
4266
+ },
4267
+ include_image: {
4268
+ type: "boolean",
4269
+ default: true,
4270
+ description: "Return the contact sheet itself as well as its URL.",
4271
+ },
4272
+ },
4273
+ additionalProperties: false,
4274
+ },
4275
+ operationId: "renderCreateInspection",
4276
+ method: "POST",
4277
+ path: "/v1/render/inspections",
4278
+ scope: "render:run",
4279
+ servedBy: "node",
4280
+ pathParams: [],
4281
+ queryParams: [],
4282
+ body: "json",
4283
+ bodyFields: [
4284
+ "url",
4285
+ "video_id",
4286
+ "steps",
4287
+ "watch",
4288
+ "duration_ms",
4289
+ "from_ms",
4290
+ "fps",
4291
+ "viewport",
4292
+ "theme",
4293
+ "interval_ms",
4294
+ ],
4295
+ rawFields: [],
4296
+ toolArgs: ["include_image"],
4297
+ bodyDefaults: {},
4298
+ queryDefaults: {},
4299
+ },
4300
+ {
4301
+ name: "render_get",
4302
+ group: "render",
4303
+ title: "Get a video",
4304
+ description:
4305
+ "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.",
4306
+ annotations: {
4307
+ title: "Get a video",
4308
+ readOnlyHint: true,
4309
+ idempotentHint: true,
4310
+ openWorldHint: false,
4311
+ },
4312
+ inputSchema: {
4313
+ type: "object",
4314
+ properties: {
4315
+ video_id: {
4316
+ type: "string",
4317
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4318
+ description: "The video ID (`vid_…`).",
4319
+ },
4320
+ include_poster: {
4321
+ type: "boolean",
4322
+ default: true,
4323
+ description: "Return the poster frame as an image once the video has succeeded.",
4324
+ },
4325
+ },
4326
+ required: ["video_id"],
4327
+ additionalProperties: false,
4328
+ },
4329
+ operationId: "renderGetVideo",
4330
+ method: "GET",
4331
+ path: "/v1/render/videos/{video_id}",
4332
+ scope: "authenticated",
4333
+ servedBy: "node",
4334
+ pathParams: ["video_id"],
4335
+ queryParams: [],
4336
+ body: "none",
4337
+ bodyFields: [],
4338
+ rawFields: [],
4339
+ toolArgs: ["include_poster"],
4340
+ bodyDefaults: {},
4341
+ queryDefaults: {},
4342
+ },
4343
+ {
4344
+ name: "render_restyle",
4345
+ group: "render",
4346
+ title: "Restyle a video",
4347
+ description:
4348
+ "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.",
4349
+ annotations: {
4350
+ title: "Restyle a video",
4351
+ readOnlyHint: false,
4352
+ openWorldHint: false,
4353
+ },
4354
+ inputSchema: {
4355
+ type: "object",
4356
+ properties: {
4357
+ video_id: {
4358
+ type: "string",
4359
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4360
+ description: "The vid_… video to restyle (omit with job_id).",
4361
+ },
4362
+ style: {
4363
+ type: "object",
4364
+ description: "Preset IDs from render_presets.",
4365
+ properties: {
4366
+ background: {
4367
+ type: "string",
4368
+ },
4369
+ frame: {
4370
+ type: "string",
4371
+ },
4372
+ cursor: {
4373
+ type: "string",
4374
+ },
4375
+ captions: {
4376
+ type: "string",
4377
+ },
4378
+ click_effect: {
4379
+ type: "string",
4380
+ },
4381
+ },
4382
+ },
4383
+ captions: {
4384
+ type: "object",
4385
+ properties: {
4386
+ burn_in: {
4387
+ type: "string",
4388
+ enum: ["none", "static", "karaoke"],
4389
+ description: "`none`: sidecar files only. `static`: draw each cue as a small pill in the ma...",
4390
+ },
4391
+ sidecars: {
4392
+ type: "array",
4393
+ items: {
4394
+ type: "string",
4395
+ enum: ["vtt", "srt"],
4396
+ },
4397
+ default: ["vtt"],
4398
+ },
4399
+ max_chars_per_line: {
4400
+ type: "integer",
4401
+ minimum: 10,
4402
+ maximum: 80,
4403
+ default: 42,
4404
+ },
4405
+ max_lines: {
4406
+ type: "integer",
4407
+ minimum: 1,
4408
+ maximum: 3,
4409
+ default: 2,
4410
+ },
4411
+ max_chars_per_second: {
4412
+ type: "number",
4413
+ minimum: 5,
4414
+ maximum: 40,
4415
+ default: 20,
4416
+ },
4417
+ },
4418
+ additionalProperties: false,
4419
+ },
4420
+ output: {
4421
+ type: "object",
4422
+ required: ["width", "height", "fps"],
4423
+ properties: {
4424
+ width: {
4425
+ type: "integer",
4426
+ minimum: 16,
4427
+ maximum: 3840,
4428
+ multipleOf: 2,
4429
+ },
4430
+ height: {
4431
+ type: "integer",
4432
+ minimum: 16,
4433
+ maximum: 2160,
4434
+ multipleOf: 2,
4435
+ },
4436
+ fps: {
4437
+ type: "integer",
4438
+ enum: [24, 25, 30, 50, 60],
4439
+ description: "Frames per second of the video.",
4440
+ },
4441
+ },
4442
+ additionalProperties: false,
4443
+ },
4444
+ formats: {
4445
+ type: "array",
4446
+ items: {
4447
+ type: "string",
4448
+ enum: ["mp4", "gif", "poster"],
4449
+ },
4450
+ },
4451
+ alias: {
4452
+ type: "string",
4453
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
4454
+ description: "Add the restyled video to this alias; when it succeeds the alias (and its share) plays it.",
4455
+ },
4456
+ job_id: {
4457
+ type: "string",
4458
+ description: "A vid_… id from an earlier call.",
4459
+ },
4460
+ wait_s: {
4461
+ type: "integer",
4462
+ minimum: 0,
4463
+ maximum: 60,
4464
+ default: 50,
4465
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
4466
+ },
4467
+ include_poster: {
4468
+ type: "boolean",
4469
+ default: true,
4470
+ description: "Return the poster frame as an image once the video has succeeded.",
4471
+ },
4472
+ },
4473
+ additionalProperties: false,
4474
+ },
4475
+ operationId: "renderRestyleVideo",
4476
+ method: "POST",
4477
+ path: "/v1/render/videos/{video_id}/restyle",
4478
+ scope: "render:run",
4479
+ servedBy: "node",
4480
+ pathParams: ["video_id"],
4481
+ queryParams: [
4482
+ {
4483
+ name: "wait",
4484
+ from: "wait_s",
4485
+ },
4486
+ ],
4487
+ body: "json",
4488
+ bodyFields: ["style", "captions", "output", "formats", "alias"],
4489
+ rawFields: [],
4490
+ toolArgs: ["job_id", "wait_s", "include_poster"],
4491
+ bodyDefaults: {},
4492
+ queryDefaults: {},
4493
+ continueWith: {
4494
+ arg: "job_id",
4495
+ operationId: "renderGetVideo",
4496
+ method: "GET",
4497
+ path: "/v1/render/videos/{video_id}",
4498
+ pathParam: "video_id",
4499
+ },
4500
+ },
4501
+ {
4502
+ name: "render_presets",
4503
+ group: "render",
4504
+ title: "List render presets",
4505
+ description:
4506
+ "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.",
4507
+ annotations: {
4508
+ title: "List render presets",
4509
+ readOnlyHint: true,
4510
+ idempotentHint: true,
4511
+ openWorldHint: false,
4512
+ },
4513
+ inputSchema: {
4514
+ type: "object",
4515
+ properties: {
4516
+ kind: {
4517
+ type: "string",
4518
+ enum: ["background", "frame", "cursor", "captions", "click_effect"],
4519
+ description: "Only presets of this kind.",
4520
+ },
4521
+ },
4522
+ additionalProperties: false,
4523
+ },
4524
+ operationId: "renderListPresets",
4525
+ method: "GET",
4526
+ path: "/v1/render/presets",
4527
+ scope: "public",
4528
+ servedBy: "node",
4529
+ pathParams: [],
4530
+ queryParams: [
4531
+ {
4532
+ name: "kind",
4533
+ },
4534
+ ],
4535
+ body: "none",
4536
+ bodyFields: [],
4537
+ rawFields: [],
4538
+ toolArgs: [],
4539
+ bodyDefaults: {},
4540
+ queryDefaults: {},
4541
+ },
4542
+ {
4543
+ name: "render_share",
4544
+ group: "render",
4545
+ title: "Share a video",
4546
+ description:
4547
+ "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.",
4548
+ annotations: {
4549
+ title: "Share a video",
4550
+ readOnlyHint: false,
4551
+ destructiveHint: true,
4552
+ idempotentHint: true,
4553
+ openWorldHint: false,
4554
+ },
4555
+ inputSchema: {
4556
+ type: "object",
4557
+ properties: {
4558
+ video_id: {
4559
+ type: "string",
4560
+ pattern: "^vid_[0-9a-hjkmnp-tv-z]{26}$",
4561
+ description: "The vid_… video to share (or give alias).",
4562
+ },
4563
+ title: {
4564
+ type: "string",
4565
+ description: 'The page title and preview title. Default the first beat\'s `title`, else "Video".',
4566
+ },
4567
+ alias: {
4568
+ type: "string",
4569
+ pattern: "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
4570
+ description: "Share this alias of the project instead of one video.",
4571
+ },
4572
+ stop: {
4573
+ type: "boolean",
4574
+ default: false,
4575
+ description: "Stop the share instead of making it.",
4576
+ },
4577
+ },
4578
+ additionalProperties: false,
4579
+ },
4580
+ operationId: "renderShareVideo",
4581
+ method: "POST",
4582
+ path: "/v1/render/videos/{video_id}/share",
4583
+ scope: "render:write",
4584
+ servedBy: "node",
4585
+ pathParams: ["video_id"],
4586
+ queryParams: [],
4587
+ body: "json",
4588
+ bodyFields: ["title"],
4589
+ rawFields: [],
4590
+ toolArgs: ["alias", "stop"],
4591
+ bodyDefaults: {},
4592
+ queryDefaults: {},
4593
+ },
4594
+ {
4595
+ name: "listener_create",
4596
+ group: "listeners",
4597
+ title: "Create a listener",
4598
+ description:
4599
+ "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.",
4600
+ annotations: {
4601
+ title: "Create a listener",
4602
+ readOnlyHint: false,
4603
+ openWorldHint: true,
4604
+ },
4605
+ inputSchema: {
4606
+ type: "object",
4607
+ properties: {
4608
+ name: {
4609
+ type: ["string", "null"],
4610
+ description: "A label; not unique.",
4611
+ },
4612
+ source: {
4613
+ description: "{type: http_poll|sse|websocket|webhook|pack|push, ...} (see the docs).",
4614
+ },
4615
+ dedupe: {
4616
+ type: "object",
4617
+ description: "{key: CEL over event, window_s}; default the source's own event id.",
4618
+ },
4619
+ filter: {
4620
+ type: "object",
4621
+ description: "{cel: 'event.payload.total > 10', model: {prompt, on_error}}.",
4622
+ },
4623
+ sink: {
4624
+ description: "{type: routine, routine} or {type: webhook, url}; optional batch.",
4625
+ },
4626
+ redact: {
4627
+ type: "array",
4628
+ description:
4629
+ 'JSON pointers into the payload (`/customer/email`). Their values are replaced by `"[redacted]"` before the event is written anywhere: the log, the history an...',
4630
+ items: {
4631
+ type: "string",
4632
+ pattern: "^(/[^/]*)+$",
4633
+ },
4634
+ },
4635
+ ttl_s: {
4636
+ type: "integer",
4637
+ minimum: 60,
4638
+ description: "Seconds from now until the listener ends `expired`. Not with `expires_at`.",
4639
+ },
4640
+ budget: {
4641
+ type: "object",
4642
+ description: "{events_per_day, model_tokens_per_day}.",
4643
+ },
4644
+ },
4645
+ required: ["source", "sink"],
4646
+ additionalProperties: false,
4647
+ },
4648
+ operationId: "listenersCreateListener",
4649
+ method: "POST",
4650
+ path: "/v1/listeners",
4651
+ scope: "listeners:write",
4652
+ servedBy: "node",
4653
+ stage: "preview",
4654
+ flag: "listeners.api",
4655
+ pathParams: [],
4656
+ queryParams: [],
4657
+ body: "json",
4658
+ bodyFields: ["name", "source", "dedupe", "filter", "sink", "redact", "ttl_s", "budget"],
4659
+ rawFields: [],
4660
+ toolArgs: [],
4661
+ bodyDefaults: {},
4662
+ queryDefaults: {},
4663
+ },
4664
+ {
4665
+ name: "listener_list",
4666
+ group: "listeners",
4667
+ title: "List listeners",
4668
+ description: "List this project's listeners, newest first, with each one's status and what it kept.",
4669
+ annotations: {
4670
+ title: "List listeners",
4671
+ readOnlyHint: true,
4672
+ openWorldHint: false,
4673
+ },
4674
+ inputSchema: {
4675
+ type: "object",
4676
+ properties: {
4677
+ status: {
4678
+ type: "string",
4679
+ enum: ["starting", "active", "reconnecting", "paused", "failed", "expired", "revoked"],
4680
+ description: "Only listeners in this status.",
4681
+ },
4682
+ limit: {
4683
+ type: "integer",
4684
+ minimum: 1,
4685
+ maximum: 100,
4686
+ default: 20,
4687
+ description: "Page size, from 1 to 100.",
4688
+ },
4689
+ cursor: {
4690
+ type: "string",
4691
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
4692
+ },
4693
+ },
4694
+ additionalProperties: false,
4695
+ },
4696
+ operationId: "listenersListListeners",
4697
+ method: "GET",
4698
+ path: "/v1/listeners",
4699
+ scope: "listeners:read",
4700
+ servedBy: "node",
4701
+ stage: "preview",
4702
+ flag: "listeners.api",
4703
+ pathParams: [],
4704
+ queryParams: [
4705
+ {
4706
+ name: "status",
4707
+ },
4708
+ {
4709
+ name: "limit",
4710
+ },
4711
+ {
4712
+ name: "cursor",
4713
+ },
4714
+ ],
4715
+ body: "none",
4716
+ bodyFields: [],
4717
+ rawFields: [],
4718
+ toolArgs: [],
4719
+ bodyDefaults: {},
4720
+ queryDefaults: {},
4721
+ },
4722
+ {
4723
+ name: "listener_get",
4724
+ group: "listeners",
4725
+ title: "Get a listener",
4726
+ description:
4727
+ "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.",
4728
+ annotations: {
4729
+ title: "Get a listener",
4730
+ readOnlyHint: true,
4731
+ openWorldHint: false,
4732
+ },
4733
+ inputSchema: {
4734
+ type: "object",
4735
+ properties: {
4736
+ listener_id: {
4737
+ type: "string",
4738
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4739
+ description: "The listener ID (`lsn_…`).",
4740
+ },
4741
+ },
4742
+ required: ["listener_id"],
4743
+ additionalProperties: false,
4744
+ },
4745
+ operationId: "listenersGetListener",
4746
+ method: "GET",
4747
+ path: "/v1/listeners/{listener_id}",
4748
+ scope: "listeners:read",
4749
+ servedBy: "node",
4750
+ stage: "preview",
4751
+ flag: "listeners.api",
4752
+ pathParams: ["listener_id"],
4753
+ queryParams: [],
4754
+ body: "none",
4755
+ bodyFields: [],
4756
+ rawFields: [],
4757
+ toolArgs: [],
4758
+ bodyDefaults: {},
4759
+ queryDefaults: {},
4760
+ },
4761
+ {
4762
+ name: "listener_update",
4763
+ group: "listeners",
4764
+ title: "Update a listener",
4765
+ description:
4766
+ "Pause or resume a listener, or change its filter, sink, budget, lifetime or redact list. The source is fixed.",
4767
+ annotations: {
4768
+ title: "Update a listener",
4769
+ readOnlyHint: false,
4770
+ idempotentHint: true,
4771
+ openWorldHint: false,
4772
+ },
4773
+ inputSchema: {
4774
+ type: "object",
4775
+ properties: {
4776
+ listener_id: {
4777
+ type: "string",
4778
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4779
+ description: "The listener ID (`lsn_…`).",
4780
+ },
4781
+ paused: {
4782
+ type: "boolean",
4783
+ },
4784
+ ttl_s: {
4785
+ type: "integer",
4786
+ minimum: 60,
4787
+ description: "Seconds from now until the listener ends `expired`. Not with `expires_at`.",
4788
+ },
4789
+ filter: {
4790
+ type: "object",
4791
+ description: "{cel, model}.",
4792
+ },
4793
+ budget: {
4794
+ type: "object",
4795
+ description: "{events_per_day, model_tokens_per_day}.",
4796
+ },
4797
+ },
4798
+ required: ["listener_id"],
4799
+ additionalProperties: false,
4800
+ },
4801
+ operationId: "listenersUpdateListener",
4802
+ method: "PATCH",
4803
+ path: "/v1/listeners/{listener_id}",
4804
+ scope: "listeners:write",
4805
+ servedBy: "node",
4806
+ stage: "preview",
4807
+ flag: "listeners.api",
4808
+ pathParams: ["listener_id"],
4809
+ queryParams: [],
4810
+ body: "json",
4811
+ bodyFields: ["paused", "ttl_s", "filter", "budget"],
4812
+ rawFields: [],
4813
+ toolArgs: [],
4814
+ bodyDefaults: {},
4815
+ queryDefaults: {},
4816
+ },
4817
+ {
4818
+ name: "listener_delete",
4819
+ group: "listeners",
4820
+ title: "Delete a listener",
4821
+ description: "Delete a listener: its source closes and its hooks go; its history stays until its retention ends.",
4822
+ annotations: {
4823
+ title: "Delete a listener",
4824
+ readOnlyHint: false,
4825
+ destructiveHint: true,
4826
+ idempotentHint: true,
4827
+ openWorldHint: false,
4828
+ },
4829
+ inputSchema: {
4830
+ type: "object",
4831
+ properties: {
4832
+ listener_id: {
4833
+ type: "string",
4834
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4835
+ description: "The listener ID (`lsn_…`).",
4836
+ },
4837
+ },
4838
+ required: ["listener_id"],
4839
+ additionalProperties: false,
4840
+ },
4841
+ operationId: "listenersDeleteListener",
4842
+ method: "DELETE",
4843
+ path: "/v1/listeners/{listener_id}",
4844
+ scope: "listeners:write",
4845
+ servedBy: "node",
4846
+ stage: "preview",
4847
+ flag: "listeners.api",
4848
+ pathParams: ["listener_id"],
4849
+ queryParams: [],
4850
+ body: "none",
4851
+ bodyFields: [],
4852
+ rawFields: [],
4853
+ toolArgs: [],
4854
+ bodyDefaults: {},
4855
+ queryDefaults: {},
4856
+ },
4857
+ {
4858
+ name: "listener_events",
4859
+ group: "listeners",
4860
+ title: "List a listener's events",
4861
+ description:
4862
+ "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.",
4863
+ annotations: {
4864
+ title: "List a listener's events",
4865
+ readOnlyHint: true,
4866
+ openWorldHint: false,
4867
+ },
4868
+ inputSchema: {
4869
+ type: "object",
4870
+ properties: {
4871
+ listener_id: {
4872
+ type: "string",
4873
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4874
+ description: "The listener ID (`lsn_…`).",
4875
+ },
4876
+ status: {
4877
+ type: "string",
4878
+ enum: ["pending", "delivered", "filtered", "failed", "skipped"],
4879
+ description: "Only events in this status.",
4880
+ },
4881
+ limit: {
4882
+ type: "integer",
4883
+ minimum: 1,
4884
+ maximum: 100,
4885
+ default: 20,
4886
+ description: "Page size, from 1 to 100.",
4887
+ },
4888
+ cursor: {
4889
+ type: "string",
4890
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
4891
+ },
4892
+ },
4893
+ required: ["listener_id"],
4894
+ additionalProperties: false,
4895
+ },
4896
+ operationId: "listenersListEvents",
4897
+ method: "GET",
4898
+ path: "/v1/listeners/{listener_id}/events",
4899
+ scope: "listeners:read",
4900
+ servedBy: "node",
4901
+ stage: "preview",
4902
+ flag: "listeners.api",
4903
+ pathParams: ["listener_id"],
4904
+ queryParams: [
4905
+ {
4906
+ name: "status",
4907
+ },
4908
+ {
4909
+ name: "limit",
4910
+ },
4911
+ {
4912
+ name: "cursor",
4913
+ },
4914
+ ],
4915
+ body: "none",
4916
+ bodyFields: [],
4917
+ rawFields: [],
4918
+ toolArgs: [],
4919
+ bodyDefaults: {},
4920
+ queryDefaults: {},
4921
+ },
4922
+ {
4923
+ name: "listener_push",
4924
+ group: "listeners",
4925
+ title: "Send events to a listener",
4926
+ description:
4927
+ "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.",
4928
+ annotations: {
4929
+ title: "Send events to a listener",
4930
+ readOnlyHint: false,
4931
+ openWorldHint: false,
4932
+ },
4933
+ inputSchema: {
4934
+ type: "object",
4935
+ properties: {
4936
+ listener_id: {
4937
+ type: "string",
4938
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4939
+ description: "The listener ID (`lsn_…`).",
4940
+ },
4941
+ events: {
4942
+ type: "array",
4943
+ items: {
4944
+ type: "object",
4945
+ required: ["payload"],
4946
+ properties: {
4947
+ payload: {
4948
+ description: "Any JSON value, at most `listeners.event_bytes_max` when serialized.",
4949
+ },
4950
+ dedupe_key: {
4951
+ type: "string",
4952
+ },
4953
+ },
4954
+ },
4955
+ },
4956
+ },
4957
+ required: ["listener_id", "events"],
4958
+ additionalProperties: false,
4959
+ },
4960
+ operationId: "listenersIngestEvents",
4961
+ method: "POST",
4962
+ path: "/v1/listeners/{listener_id}/events",
4963
+ scope: "listeners:write",
4964
+ servedBy: "node",
4965
+ stage: "preview",
4966
+ flag: "listeners.api",
4967
+ pathParams: ["listener_id"],
4968
+ queryParams: [],
4969
+ body: "json",
4970
+ bodyFields: ["events"],
4971
+ rawFields: [],
4972
+ toolArgs: [],
4973
+ bodyDefaults: {},
4974
+ queryDefaults: {},
4975
+ },
4976
+ {
4977
+ name: "listener_test",
4978
+ group: "listeners",
4979
+ title: "Test a listener",
4980
+ description:
4981
+ "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.",
4982
+ annotations: {
4983
+ title: "Test a listener",
4984
+ readOnlyHint: false,
4985
+ openWorldHint: false,
4986
+ },
4987
+ inputSchema: {
4988
+ type: "object",
4989
+ properties: {
4990
+ listener_id: {
4991
+ type: "string",
4992
+ pattern: "^lsn_[0-9a-hjkmnp-tv-z]{26}$",
4993
+ description: "The listener ID (`lsn_…`).",
4994
+ },
4995
+ payload: {
4996
+ description: "A sample event payload.",
4997
+ },
4998
+ deliver: {
4999
+ type: "boolean",
5000
+ default: false,
5001
+ },
5002
+ },
5003
+ required: ["listener_id", "payload"],
5004
+ additionalProperties: false,
5005
+ },
5006
+ operationId: "listenersTestListener",
5007
+ method: "POST",
5008
+ path: "/v1/listeners/{listener_id}/test",
5009
+ scope: "listeners:write",
5010
+ servedBy: "node",
5011
+ stage: "preview",
5012
+ flag: "listeners.api",
5013
+ pathParams: ["listener_id"],
5014
+ queryParams: [],
5015
+ body: "json",
5016
+ bodyFields: ["payload", "deliver"],
5017
+ rawFields: [],
5018
+ toolArgs: [],
5019
+ bodyDefaults: {},
5020
+ queryDefaults: {},
5021
+ },
5022
+ {
5023
+ name: "agent_send",
5024
+ group: "agents",
5025
+ title: "Send a message to an agent instance",
5026
+ description:
5027
+ "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.",
5028
+ annotations: {
5029
+ title: "Send a message to an agent instance",
5030
+ readOnlyHint: false,
5031
+ destructiveHint: false,
5032
+ openWorldHint: true,
5033
+ },
5034
+ inputSchema: {
5035
+ type: "object",
5036
+ properties: {
5037
+ agent: {
5038
+ type: "string",
5039
+ description: "The agent's name, or its agt_ id.",
5040
+ },
5041
+ key: {
5042
+ type: "string",
5043
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
5044
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
5045
+ },
5046
+ type: {
5047
+ type: "string",
5048
+ pattern: "^[a-z][a-z0-9_.-]{0,63}$",
5049
+ default: "message",
5050
+ description: "What kind of message this is (a listener's actor sink sends `listener.event`).",
5051
+ },
5052
+ conversation: {
5053
+ type: "string",
5054
+ description: "Your conversation or thread ID. Default, the `b3os.conversation` baggage.",
5055
+ },
5056
+ subject: {
5057
+ type: "string",
5058
+ description:
5059
+ "The end user the turn is for, an opaque ID, never an email. Default, the `b3os.subject` baggage.",
5060
+ },
5061
+ metadata: {
5062
+ type: "object",
5063
+ description:
5064
+ "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 _ . : -`.",
5065
+ },
5066
+ create: {
5067
+ type: "boolean",
5068
+ default: true,
5069
+ description: "Make the instance if it does not exist. `false` answers `404 instance_not_found` instead.",
5070
+ },
5071
+ payload: {
5072
+ type: "object",
5073
+ description: "The message's own fields (any JSON object), sent beside type, conversation and subject.",
5074
+ },
5075
+ job_id: {
5076
+ type: "string",
5077
+ description: "A ses_ id from an earlier call: keep waiting for that turn.",
5078
+ },
5079
+ wait_s: {
5080
+ type: "integer",
5081
+ minimum: 0,
5082
+ maximum: 60,
5083
+ default: 50,
5084
+ description: "Seconds to wait for the job before returning its id and status (then call again with job_id).",
5085
+ },
5086
+ },
5087
+ additionalProperties: false,
5088
+ },
5089
+ operationId: "agentsSendMessage",
5090
+ method: "POST",
5091
+ path: "/v1/agents/{agent}/instances/{key}/messages",
5092
+ scope: "agents:run",
5093
+ servedBy: "node",
5094
+ stage: "preview",
5095
+ flag: "agents.actors",
5096
+ pathParams: ["agent", "key"],
5097
+ queryParams: [
5098
+ {
5099
+ name: "wait",
5100
+ from: "wait_s",
5101
+ },
5102
+ ],
5103
+ body: "json",
5104
+ bodyFields: ["type", "conversation", "subject", "metadata", "create"],
5105
+ rawFields: [],
5106
+ toolArgs: ["payload", "job_id", "wait_s"],
5107
+ bodyDefaults: {},
5108
+ queryDefaults: {},
5109
+ continueWith: {
5110
+ arg: "job_id",
5111
+ operationId: "agentsGetSession",
5112
+ method: "GET",
5113
+ path: "/v1/agents/sessions/{session_id}",
5114
+ pathParam: "session_id",
5115
+ },
5116
+ },
5117
+ {
5118
+ name: "agent_create",
5119
+ group: "agents",
5120
+ title: "Create an agent",
5121
+ description:
5122
+ "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.",
5123
+ annotations: {
5124
+ title: "Create an agent",
5125
+ readOnlyHint: false,
5126
+ destructiveHint: false,
5127
+ openWorldHint: false,
5128
+ },
5129
+ inputSchema: {
5130
+ type: "object",
5131
+ properties: {
5132
+ name: {
5133
+ type: "string",
5134
+ pattern: "^[a-z][a-z0-9-]{0,62}$",
5135
+ description: "Lowercase letters, digits and `-`, starting with a letter. `sessions` is reserved.",
5136
+ },
5137
+ source: {
5138
+ type: "object",
5139
+ description:
5140
+ "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.",
5141
+ properties: {
5142
+ template: {
5143
+ type: "string",
5144
+ default: "agent",
5145
+ },
5146
+ snapshot: {
5147
+ type: "string",
5148
+ pattern: "^snap_[0-9a-hjkmnp-tv-z]{26}$",
5149
+ description: "Restore this snapshot instead of starting from a template.",
5150
+ },
5151
+ vcpu: {
5152
+ type: "integer",
5153
+ minimum: 1,
5154
+ },
5155
+ memory_mib: {
5156
+ type: "integer",
5157
+ minimum: 128,
5158
+ },
5159
+ disk_gib: {
5160
+ type: "integer",
5161
+ minimum: 1,
5162
+ },
5163
+ },
5164
+ additionalProperties: false,
5165
+ },
5166
+ entry: {
5167
+ type: "object",
5168
+ required: ["command", "port"],
5169
+ description:
5170
+ "The harness. `command` runs in each instance when it is made, and again after a cold boot from its disk.",
5171
+ properties: {
5172
+ command: {
5173
+ type: "array",
5174
+ items: {
5175
+ type: "string",
5176
+ },
5177
+ },
5178
+ port: {
5179
+ type: "integer",
5180
+ minimum: 1,
5181
+ maximum: 65535,
5182
+ description: "Not 53, 1080, 3128, 7700 or 15001, which the guest agent listens on.",
5183
+ },
5184
+ path: {
5185
+ type: "string",
5186
+ pattern: "^/",
5187
+ default: "/",
5188
+ },
5189
+ readiness: {
5190
+ type: "object",
5191
+ description: "When the sandbox counts as ready: a TCP port inside it accepting connections...",
5192
+ properties: {
5193
+ port: {
5194
+ type: "integer",
5195
+ minimum: 1,
5196
+ maximum: 65535,
5197
+ },
5198
+ cmd: {
5199
+ description: "A shell command line (run with `/bin/sh -c`) or an argv array.",
5200
+ oneOf: [
5201
+ {
5202
+ type: "string",
5203
+ },
5204
+ {
5205
+ type: "array",
5206
+ },
5207
+ ],
5208
+ },
5209
+ interval_ms: {
5210
+ type: "integer",
5211
+ minimum: 5,
5212
+ maximum: 5000,
5213
+ default: 10,
5214
+ },
5215
+ timeout_s: {
5216
+ type: "integer",
5217
+ minimum: 1,
5218
+ maximum: 600,
5219
+ default: 60,
5220
+ },
5221
+ },
5222
+ },
5223
+ max_restarts: {
5224
+ type: "integer",
5225
+ minimum: 0,
5226
+ maximum: 20,
5227
+ default: 5,
5228
+ },
5229
+ },
5230
+ additionalProperties: false,
5231
+ },
5232
+ env: {
5233
+ type: "object",
5234
+ additionalProperties: {
5235
+ type: "string",
5236
+ },
5237
+ description: "Environment variables of the harness. Returned as given; put credentials in `secrets`.",
5238
+ },
5239
+ secrets: {
5240
+ type: "object",
5241
+ additionalProperties: {
5242
+ description: "A value placed in the environment but never returned or logged.",
5243
+ oneOf: [
5244
+ {
5245
+ type: "string",
5246
+ },
5247
+ {
5248
+ type: "object",
5249
+ required: ["connection"],
5250
+ properties: {
5251
+ connection: {
5252
+ type: "string",
5253
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5254
+ },
5255
+ field: {
5256
+ type: "string",
5257
+ description: "Which secret field of the connection (vault.yaml names).",
5258
+ },
5259
+ },
5260
+ },
5261
+ ],
5262
+ },
5263
+ description:
5264
+ "Environment variables never returned or logged, as a sandbox's `secrets`: code in the instance can read them.",
5265
+ },
5266
+ api: {
5267
+ type: "object",
5268
+ description:
5269
+ "What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.",
5270
+ properties: {
5271
+ scopes: {
5272
+ type: "array",
5273
+ items: {
5274
+ type: "string",
5275
+ description: "A scope from the catalog (`vision:run`.",
5276
+ enum: [
5277
+ "vision:read",
5278
+ "vision:write",
5279
+ "vision:run",
5280
+ "vision:profiles:use",
5281
+ "vision:profiles:export",
5282
+ "render:read",
5283
+ "render:write",
5284
+ "render:run",
5285
+ "sandboxes:read",
5286
+ "sandboxes:write",
5287
+ "sandboxes:run",
5288
+ "agents:read",
5289
+ "agents:write",
5290
+ "agents:run",
5291
+ "routines:read",
5292
+ "routines:write",
5293
+ "routines:run",
5294
+ "listeners:read",
5295
+ "listeners:write",
5296
+ "actions:read",
5297
+ "actions:write",
5298
+ "actions:run",
5299
+ "actions:tools:publish",
5300
+ "infer:read",
5301
+ "infer:write",
5302
+ "infer:run",
5303
+ "vault:read",
5304
+ "vault:write",
5305
+ "vault:run",
5306
+ "vault:connections:reveal",
5307
+ "platform:read",
5308
+ "platform:write",
5309
+ "platform:content:read",
5310
+ "settings:write",
5311
+ "vision:*",
5312
+ "render:*",
5313
+ "sandboxes:*",
5314
+ "agents:*",
5315
+ "routines:*",
5316
+ "listeners:*",
5317
+ "actions:*",
5318
+ "infer:*",
5319
+ "vault:*",
5320
+ "platform:*",
5321
+ "settings:*",
5322
+ "*",
5323
+ ],
5324
+ },
5325
+ description: "A subset of your own scopes.",
5326
+ },
5327
+ spend_cap_usd: {
5328
+ type: ["number", "null"],
5329
+ minimum: 0,
5330
+ description: "Stop the sandbox's own API calls at this spend.",
5331
+ },
5332
+ connections: {
5333
+ type: "array",
5334
+ items: {
5335
+ type: "string",
5336
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5337
+ },
5338
+ description: "Vault connections the sandbox's action calls may use.",
5339
+ },
5340
+ actions: {
5341
+ type: ["object", "null"],
5342
+ description: "Which pack actions code in the sandbox may call (`POST /v1/actions/call`) and...",
5343
+ required: ["allow"],
5344
+ properties: {
5345
+ allow: {
5346
+ type: "array",
5347
+ items: {
5348
+ type: "string",
5349
+ },
5350
+ description: "`<namespace>/<name>/<action>[@<version>]`: `<action>` an action key or `*` (e...",
5351
+ },
5352
+ },
5353
+ },
5354
+ },
5355
+ additionalProperties: false,
5356
+ },
5357
+ egress: {
5358
+ type: "object",
5359
+ description:
5360
+ "Where sandbox traffic may go, enforced by the node's egress guard. `public` (default): any public internet address.",
5361
+ },
5362
+ sleep: {
5363
+ type: "object",
5364
+ description:
5365
+ "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...",
5366
+ properties: {
5367
+ ram_after_s: {
5368
+ type: "integer",
5369
+ minimum: 5,
5370
+ maximum: 3600,
5371
+ default: 30,
5372
+ description: "Quiet this long, it pauses in memory.",
5373
+ },
5374
+ snapshot_after_s: {
5375
+ type: "integer",
5376
+ minimum: 60,
5377
+ maximum: 86400,
5378
+ default: 600,
5379
+ description: "Paused this long, its memory goes to a snapshot on the node's disk and its me...",
5380
+ },
5381
+ snapshot_keep_s: {
5382
+ type: "integer",
5383
+ minimum: 3600,
5384
+ maximum: 604800,
5385
+ default: 604800,
5386
+ description: "How long a memory snapshot is kept.",
5387
+ },
5388
+ },
5389
+ additionalProperties: false,
5390
+ },
5391
+ turns: {
5392
+ type: "object",
5393
+ description: "How messages become turns. One turn runs at a time per instance.",
5394
+ properties: {
5395
+ queue_max: {
5396
+ type: "integer",
5397
+ minimum: 1,
5398
+ maximum: 16,
5399
+ default: 16,
5400
+ description: "Messages that may wait for the current turn, at most `agents.queue_max`.",
5401
+ },
5402
+ timeout_s: {
5403
+ type: "integer",
5404
+ minimum: 1,
5405
+ maximum: 3600,
5406
+ default: 300,
5407
+ description: "How long a turn may take from its message's acceptance, queue time included.",
5408
+ },
5409
+ redeliver: {
5410
+ type: "boolean",
5411
+ default: false,
5412
+ description: "Deliver a message again after the node restarted while the harness had it.",
5413
+ },
5414
+ },
5415
+ additionalProperties: false,
5416
+ },
5417
+ metadata: {
5418
+ type: "object",
5419
+ description:
5420
+ "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 _ . : -`.",
5421
+ },
5422
+ },
5423
+ required: ["name", "entry"],
5424
+ additionalProperties: false,
5425
+ },
5426
+ operationId: "agentsCreateAgent",
5427
+ method: "POST",
5428
+ path: "/v1/agents",
5429
+ scope: "agents:write",
5430
+ servedBy: "node",
5431
+ stage: "preview",
5432
+ flag: "agents.actors",
5433
+ pathParams: [],
5434
+ queryParams: [],
5435
+ body: "json",
5436
+ bodyFields: ["name", "source", "entry", "env", "secrets", "api", "egress", "sleep", "turns", "metadata"],
5437
+ rawFields: [],
5438
+ toolArgs: [],
5439
+ bodyDefaults: {},
5440
+ queryDefaults: {},
5441
+ },
5442
+ {
5443
+ name: "agent_list",
5444
+ group: "agents",
5445
+ title: "List agents",
5446
+ description: "List the project's agents, newest first, with each one's revision and instance count.",
5447
+ annotations: {
5448
+ title: "List agents",
5449
+ readOnlyHint: true,
5450
+ openWorldHint: false,
5451
+ },
5452
+ inputSchema: {
5453
+ type: "object",
5454
+ properties: {
5455
+ limit: {
5456
+ type: "integer",
5457
+ minimum: 1,
5458
+ maximum: 100,
5459
+ default: 20,
5460
+ description: "Page size, from 1 to 100.",
5461
+ },
5462
+ cursor: {
5463
+ type: "string",
5464
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
5465
+ },
5466
+ },
5467
+ additionalProperties: false,
5468
+ },
5469
+ operationId: "agentsListAgents",
5470
+ method: "GET",
5471
+ path: "/v1/agents",
5472
+ scope: "agents:read",
5473
+ servedBy: "node",
5474
+ stage: "preview",
5475
+ flag: "agents.actors",
5476
+ pathParams: [],
5477
+ queryParams: [
5478
+ {
5479
+ name: "limit",
5480
+ },
5481
+ {
5482
+ name: "cursor",
5483
+ },
5484
+ ],
5485
+ body: "none",
5486
+ bodyFields: [],
5487
+ rawFields: [],
5488
+ toolArgs: [],
5489
+ bodyDefaults: {},
5490
+ queryDefaults: {
5491
+ limit: 20,
5492
+ },
5493
+ },
5494
+ {
5495
+ name: "agent_get",
5496
+ group: "agents",
5497
+ title: "Get an agent",
5498
+ description: "Read an agent's definition by name or agt_ id: its source, entry, sleep and turn settings, revision.",
5499
+ annotations: {
5500
+ title: "Get an agent",
5501
+ readOnlyHint: true,
5502
+ openWorldHint: false,
5503
+ },
5504
+ inputSchema: {
5505
+ type: "object",
5506
+ properties: {
5507
+ agent: {
5508
+ type: "string",
5509
+ description: "The agent's name, or its agt_ id.",
5510
+ },
5511
+ },
5512
+ required: ["agent"],
5513
+ additionalProperties: false,
5514
+ },
5515
+ operationId: "agentsGetAgent",
5516
+ method: "GET",
5517
+ path: "/v1/agents/{agent}",
5518
+ scope: "agents:read",
5519
+ servedBy: "node",
5520
+ stage: "preview",
5521
+ flag: "agents.actors",
5522
+ pathParams: ["agent"],
5523
+ queryParams: [],
5524
+ body: "none",
5525
+ bodyFields: [],
5526
+ rawFields: [],
5527
+ toolArgs: [],
5528
+ bodyDefaults: {},
5529
+ queryDefaults: {},
5530
+ },
5531
+ {
5532
+ name: "agent_update",
5533
+ group: "agents",
5534
+ title: "Update an agent",
5535
+ description:
5536
+ "Change an agent's definition (a new revision). upgrade says when instances take it: new_instances (the default) or on_wake.",
5537
+ annotations: {
5538
+ title: "Update an agent",
5539
+ readOnlyHint: false,
5540
+ destructiveHint: false,
5541
+ openWorldHint: false,
5542
+ },
5543
+ inputSchema: {
5544
+ type: "object",
5545
+ properties: {
5546
+ agent: {
5547
+ type: "string",
5548
+ description: "The agent's name, or its agt_ id.",
5549
+ },
5550
+ source: {
5551
+ type: "object",
5552
+ description:
5553
+ "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.",
5554
+ properties: {
5555
+ template: {
5556
+ type: "string",
5557
+ default: "agent",
5558
+ },
5559
+ snapshot: {
5560
+ type: "string",
5561
+ pattern: "^snap_[0-9a-hjkmnp-tv-z]{26}$",
5562
+ description: "Restore this snapshot instead of starting from a template.",
5563
+ },
5564
+ vcpu: {
5565
+ type: "integer",
5566
+ minimum: 1,
5567
+ },
5568
+ memory_mib: {
5569
+ type: "integer",
5570
+ minimum: 128,
5571
+ },
5572
+ disk_gib: {
5573
+ type: "integer",
5574
+ minimum: 1,
5575
+ },
5576
+ },
5577
+ additionalProperties: false,
5578
+ },
5579
+ entry: {
5580
+ type: "object",
5581
+ required: ["command", "port"],
5582
+ description:
5583
+ "The harness. `command` runs in each instance when it is made, and again after a cold boot from its disk.",
5584
+ properties: {
5585
+ command: {
5586
+ type: "array",
5587
+ items: {
5588
+ type: "string",
5589
+ },
5590
+ },
5591
+ port: {
5592
+ type: "integer",
5593
+ minimum: 1,
5594
+ maximum: 65535,
5595
+ description: "Not 53, 1080, 3128, 7700 or 15001, which the guest agent listens on.",
5596
+ },
5597
+ path: {
5598
+ type: "string",
5599
+ pattern: "^/",
5600
+ default: "/",
5601
+ },
5602
+ readiness: {
5603
+ type: "object",
5604
+ description: "When the sandbox counts as ready: a TCP port inside it accepting connections...",
5605
+ properties: {
5606
+ port: {
5607
+ type: "integer",
5608
+ minimum: 1,
5609
+ maximum: 65535,
5610
+ },
5611
+ cmd: {
5612
+ description: "A shell command line (run with `/bin/sh -c`) or an argv array.",
5613
+ oneOf: [
5614
+ {
5615
+ type: "string",
5616
+ },
5617
+ {
5618
+ type: "array",
5619
+ },
5620
+ ],
5621
+ },
5622
+ interval_ms: {
5623
+ type: "integer",
5624
+ minimum: 5,
5625
+ maximum: 5000,
5626
+ default: 10,
5627
+ },
5628
+ timeout_s: {
5629
+ type: "integer",
5630
+ minimum: 1,
5631
+ maximum: 600,
5632
+ default: 60,
5633
+ },
5634
+ },
5635
+ },
5636
+ max_restarts: {
5637
+ type: "integer",
5638
+ minimum: 0,
5639
+ maximum: 20,
5640
+ default: 5,
5641
+ },
5642
+ },
5643
+ additionalProperties: false,
5644
+ },
5645
+ env: {
5646
+ type: "object",
5647
+ additionalProperties: {
5648
+ type: "string",
5649
+ },
5650
+ },
5651
+ secrets: {
5652
+ type: "object",
5653
+ additionalProperties: {
5654
+ description: "A value placed in the environment but never returned or logged.",
5655
+ oneOf: [
5656
+ {
5657
+ type: "string",
5658
+ },
5659
+ {
5660
+ type: "object",
5661
+ required: ["connection"],
5662
+ properties: {
5663
+ connection: {
5664
+ type: "string",
5665
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5666
+ },
5667
+ field: {
5668
+ type: "string",
5669
+ description: "Which secret field of the connection (vault.yaml names).",
5670
+ },
5671
+ },
5672
+ },
5673
+ ],
5674
+ },
5675
+ },
5676
+ api: {
5677
+ type: "object",
5678
+ description:
5679
+ "What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.",
5680
+ properties: {
5681
+ scopes: {
5682
+ type: "array",
5683
+ items: {
5684
+ type: "string",
5685
+ description: "A scope from the catalog (`vision:run`.",
5686
+ enum: [
5687
+ "vision:read",
5688
+ "vision:write",
5689
+ "vision:run",
5690
+ "vision:profiles:use",
5691
+ "vision:profiles:export",
5692
+ "render:read",
5693
+ "render:write",
5694
+ "render:run",
5695
+ "sandboxes:read",
5696
+ "sandboxes:write",
5697
+ "sandboxes:run",
5698
+ "agents:read",
5699
+ "agents:write",
5700
+ "agents:run",
5701
+ "routines:read",
5702
+ "routines:write",
5703
+ "routines:run",
5704
+ "listeners:read",
5705
+ "listeners:write",
5706
+ "actions:read",
5707
+ "actions:write",
5708
+ "actions:run",
5709
+ "actions:tools:publish",
5710
+ "infer:read",
5711
+ "infer:write",
5712
+ "infer:run",
5713
+ "vault:read",
5714
+ "vault:write",
5715
+ "vault:run",
5716
+ "vault:connections:reveal",
5717
+ "platform:read",
5718
+ "platform:write",
5719
+ "platform:content:read",
5720
+ "settings:write",
5721
+ "vision:*",
5722
+ "render:*",
5723
+ "sandboxes:*",
5724
+ "agents:*",
5725
+ "routines:*",
5726
+ "listeners:*",
5727
+ "actions:*",
5728
+ "infer:*",
5729
+ "vault:*",
5730
+ "platform:*",
5731
+ "settings:*",
5732
+ "*",
5733
+ ],
5734
+ },
5735
+ description: "A subset of your own scopes.",
5736
+ },
5737
+ spend_cap_usd: {
5738
+ type: ["number", "null"],
5739
+ minimum: 0,
5740
+ description: "Stop the sandbox's own API calls at this spend.",
5741
+ },
5742
+ connections: {
5743
+ type: "array",
5744
+ items: {
5745
+ type: "string",
5746
+ pattern: "^conn_[0-9a-hjkmnp-tv-z]{26}$",
5747
+ },
5748
+ description: "Vault connections the sandbox's action calls may use.",
5749
+ },
5750
+ actions: {
5751
+ type: ["object", "null"],
5752
+ description: "Which pack actions code in the sandbox may call (`POST /v1/actions/call`) and...",
5753
+ required: ["allow"],
5754
+ properties: {
5755
+ allow: {
5756
+ type: "array",
5757
+ items: {
5758
+ type: "string",
5759
+ },
5760
+ description: "`<namespace>/<name>/<action>[@<version>]`: `<action>` an action key or `*` (e...",
5761
+ },
5762
+ },
5763
+ },
5764
+ },
5765
+ additionalProperties: false,
5766
+ },
5767
+ egress: {
5768
+ type: "object",
5769
+ description:
5770
+ "Where sandbox traffic may go, enforced by the node's egress guard. `public` (default): any public internet address.",
5771
+ },
5772
+ sleep: {
5773
+ type: "object",
5774
+ description:
5775
+ "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...",
5776
+ properties: {
5777
+ ram_after_s: {
5778
+ type: "integer",
5779
+ minimum: 5,
5780
+ maximum: 3600,
5781
+ default: 30,
5782
+ description: "Quiet this long, it pauses in memory.",
5783
+ },
5784
+ snapshot_after_s: {
5785
+ type: "integer",
5786
+ minimum: 60,
5787
+ maximum: 86400,
5788
+ default: 600,
5789
+ description: "Paused this long, its memory goes to a snapshot on the node's disk and its me...",
5790
+ },
5791
+ snapshot_keep_s: {
5792
+ type: "integer",
5793
+ minimum: 3600,
5794
+ maximum: 604800,
5795
+ default: 604800,
5796
+ description: "How long a memory snapshot is kept.",
5797
+ },
5798
+ },
5799
+ additionalProperties: false,
5800
+ },
5801
+ turns: {
5802
+ type: "object",
5803
+ description: "How messages become turns. One turn runs at a time per instance.",
5804
+ properties: {
5805
+ queue_max: {
5806
+ type: "integer",
5807
+ minimum: 1,
5808
+ maximum: 16,
5809
+ default: 16,
5810
+ description: "Messages that may wait for the current turn, at most `agents.queue_max`.",
5811
+ },
5812
+ timeout_s: {
5813
+ type: "integer",
5814
+ minimum: 1,
5815
+ maximum: 3600,
5816
+ default: 300,
5817
+ description: "How long a turn may take from its message's acceptance, queue time included.",
5818
+ },
5819
+ redeliver: {
5820
+ type: "boolean",
5821
+ default: false,
5822
+ description: "Deliver a message again after the node restarted while the harness had it.",
5823
+ },
5824
+ },
5825
+ additionalProperties: false,
5826
+ },
5827
+ upgrade: {
5828
+ type: "string",
5829
+ enum: ["new_instances", "on_wake"],
5830
+ default: "new_instances",
5831
+ description: "What happens to instances of earlier revisions: `new_instances` leaves them as they are.",
5832
+ },
5833
+ metadata: {
5834
+ type: "object",
5835
+ description:
5836
+ "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 _ . : -`.",
5837
+ },
5838
+ },
5839
+ required: ["agent"],
5840
+ additionalProperties: false,
5841
+ },
5842
+ operationId: "agentsUpdateAgent",
5843
+ method: "PATCH",
5844
+ path: "/v1/agents/{agent}",
5845
+ scope: "agents:write",
5846
+ servedBy: "node",
5847
+ stage: "preview",
5848
+ flag: "agents.actors",
5849
+ pathParams: ["agent"],
5850
+ queryParams: [],
5851
+ body: "json",
5852
+ bodyFields: ["source", "entry", "env", "secrets", "api", "egress", "sleep", "turns", "upgrade", "metadata"],
5853
+ rawFields: [],
5854
+ toolArgs: [],
5855
+ bodyDefaults: {},
5856
+ queryDefaults: {},
5857
+ },
5858
+ {
5859
+ name: "agent_delete",
5860
+ group: "agents",
5861
+ title: "Delete an agent",
5862
+ description: "Delete an agent and every instance of it, with their microVMs, snapshots and disks.",
5863
+ annotations: {
5864
+ title: "Delete an agent",
5865
+ readOnlyHint: false,
5866
+ destructiveHint: true,
5867
+ idempotentHint: true,
5868
+ openWorldHint: false,
5869
+ },
5870
+ inputSchema: {
5871
+ type: "object",
5872
+ properties: {
5873
+ agent: {
5874
+ type: "string",
5875
+ description: "The agent's name, or its agt_ id.",
5876
+ },
5877
+ },
5878
+ required: ["agent"],
5879
+ additionalProperties: false,
5880
+ },
5881
+ operationId: "agentsDeleteAgent",
5882
+ method: "DELETE",
5883
+ path: "/v1/agents/{agent}",
5884
+ scope: "agents:write",
5885
+ servedBy: "node",
5886
+ stage: "preview",
5887
+ flag: "agents.actors",
5888
+ pathParams: ["agent"],
5889
+ queryParams: [],
5890
+ body: "none",
5891
+ bodyFields: [],
5892
+ rawFields: [],
5893
+ toolArgs: [],
5894
+ bodyDefaults: {},
5895
+ queryDefaults: {},
5896
+ },
5897
+ {
5898
+ name: "agent_list_instances",
5899
+ group: "agents",
5900
+ title: "List an agent's instances",
5901
+ description:
5902
+ "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.",
5903
+ annotations: {
5904
+ title: "List an agent's instances",
5905
+ readOnlyHint: true,
5906
+ openWorldHint: false,
5907
+ },
5908
+ inputSchema: {
5909
+ type: "object",
5910
+ properties: {
5911
+ agent: {
5912
+ type: "string",
5913
+ description: "The agent's name, or its agt_ id.",
5914
+ },
5915
+ status: {
5916
+ type: "string",
5917
+ description: "Only instances with this status.",
5918
+ enum: ["creating", "running", "paused", "hibernated", "dormant", "waking", "failed"],
5919
+ },
5920
+ limit: {
5921
+ type: "integer",
5922
+ minimum: 1,
5923
+ maximum: 100,
5924
+ default: 20,
5925
+ description: "Page size, from 1 to 100.",
5926
+ },
5927
+ cursor: {
5928
+ type: "string",
5929
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
5930
+ },
5931
+ },
5932
+ required: ["agent"],
5933
+ additionalProperties: false,
5934
+ },
5935
+ operationId: "agentsListInstances",
5936
+ method: "GET",
5937
+ path: "/v1/agents/{agent}/instances",
5938
+ scope: "agents:read",
5939
+ servedBy: "node",
5940
+ stage: "preview",
5941
+ flag: "agents.actors",
5942
+ pathParams: ["agent"],
5943
+ queryParams: [
5944
+ {
5945
+ name: "status",
5946
+ },
5947
+ {
5948
+ name: "limit",
5949
+ },
5950
+ {
5951
+ name: "cursor",
5952
+ },
5953
+ ],
5954
+ body: "none",
5955
+ bodyFields: [],
5956
+ rawFields: [],
5957
+ toolArgs: [],
5958
+ bodyDefaults: {},
5959
+ queryDefaults: {
5960
+ limit: 20,
5961
+ },
5962
+ },
5963
+ {
5964
+ name: "agent_get_instance",
5965
+ group: "agents",
5966
+ title: "Get an agent instance",
5967
+ description:
5968
+ "Read one instance by its key: status, sandbox id, resident memory, storage, last message, snapshot time.",
5969
+ annotations: {
5970
+ title: "Get an agent instance",
5971
+ readOnlyHint: true,
5972
+ openWorldHint: false,
5973
+ },
5974
+ inputSchema: {
5975
+ type: "object",
5976
+ properties: {
5977
+ agent: {
5978
+ type: "string",
5979
+ description: "The agent's name, or its agt_ id.",
5980
+ },
5981
+ key: {
5982
+ type: "string",
5983
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
5984
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
5985
+ },
5986
+ },
5987
+ required: ["agent", "key"],
5988
+ additionalProperties: false,
5989
+ },
5990
+ operationId: "agentsGetInstance",
5991
+ method: "GET",
5992
+ path: "/v1/agents/{agent}/instances/{key}",
5993
+ scope: "agents:read",
5994
+ servedBy: "node",
5995
+ stage: "preview",
5996
+ flag: "agents.actors",
5997
+ pathParams: ["agent", "key"],
5998
+ queryParams: [],
5999
+ body: "none",
6000
+ bodyFields: [],
6001
+ rawFields: [],
6002
+ toolArgs: [],
6003
+ bodyDefaults: {},
6004
+ queryDefaults: {},
6005
+ },
6006
+ {
6007
+ name: "agent_instance_events",
6008
+ group: "agents",
6009
+ title: "Read an instance's lifecycle events",
6010
+ description:
6011
+ "An instance's lifecycle events, newest first: created, paused, hibernated, dormant, woke (and from which tier), recovered, failed, with their reasons.",
6012
+ annotations: {
6013
+ title: "Read an instance's lifecycle events",
6014
+ readOnlyHint: true,
6015
+ openWorldHint: false,
6016
+ },
6017
+ inputSchema: {
6018
+ type: "object",
6019
+ properties: {
6020
+ agent: {
6021
+ type: "string",
6022
+ description: "The agent's name, or its agt_ id.",
6023
+ },
6024
+ key: {
6025
+ type: "string",
6026
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6027
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
6028
+ },
6029
+ limit: {
6030
+ type: "integer",
6031
+ minimum: 1,
6032
+ maximum: 100,
6033
+ default: 20,
6034
+ description: "Page size, from 1 to 100.",
6035
+ },
6036
+ cursor: {
6037
+ type: "string",
6038
+ description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
6039
+ },
6040
+ },
6041
+ required: ["agent", "key"],
6042
+ additionalProperties: false,
6043
+ },
6044
+ operationId: "agentsListInstanceEvents",
6045
+ method: "GET",
6046
+ path: "/v1/agents/{agent}/instances/{key}/events",
6047
+ scope: "agents:read",
6048
+ servedBy: "node",
6049
+ stage: "preview",
6050
+ flag: "agents.actors",
6051
+ pathParams: ["agent", "key"],
6052
+ queryParams: [
6053
+ {
6054
+ name: "limit",
6055
+ },
6056
+ {
6057
+ name: "cursor",
6058
+ },
6059
+ ],
6060
+ body: "none",
6061
+ bodyFields: [],
6062
+ rawFields: [],
6063
+ toolArgs: [],
6064
+ bodyDefaults: {},
6065
+ queryDefaults: {
6066
+ limit: 20,
6067
+ },
6068
+ },
6069
+ {
6070
+ name: "agent_sleep",
6071
+ group: "agents",
6072
+ title: "Put an agent instance to sleep",
6073
+ description:
6074
+ "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.",
6075
+ annotations: {
6076
+ title: "Put an agent instance to sleep",
6077
+ readOnlyHint: false,
6078
+ destructiveHint: false,
6079
+ idempotentHint: true,
6080
+ openWorldHint: false,
6081
+ },
6082
+ inputSchema: {
6083
+ type: "object",
6084
+ properties: {
6085
+ agent: {
6086
+ type: "string",
6087
+ description: "The agent's name, or its agt_ id.",
6088
+ },
6089
+ key: {
6090
+ type: "string",
6091
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6092
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
6093
+ },
6094
+ tier: {
6095
+ type: "string",
6096
+ enum: ["ram", "snapshot"],
6097
+ default: "ram",
6098
+ },
6099
+ },
6100
+ required: ["agent", "key"],
6101
+ additionalProperties: false,
6102
+ },
6103
+ operationId: "agentsSleepInstance",
6104
+ method: "POST",
6105
+ path: "/v1/agents/{agent}/instances/{key}/sleep",
6106
+ scope: "agents:run",
6107
+ servedBy: "node",
6108
+ stage: "preview",
6109
+ flag: "agents.actors",
6110
+ pathParams: ["agent", "key"],
6111
+ queryParams: [],
6112
+ body: "json",
6113
+ bodyFields: ["tier"],
6114
+ rawFields: [],
6115
+ toolArgs: [],
6116
+ bodyDefaults: {},
6117
+ queryDefaults: {},
6118
+ },
6119
+ {
6120
+ name: "agent_delete_instance",
6121
+ group: "agents",
6122
+ title: "Delete an agent instance",
6123
+ description: "Delete one instance: its microVM, its memory snapshot and its disk. Its key starts fresh next time.",
6124
+ annotations: {
6125
+ title: "Delete an agent instance",
6126
+ readOnlyHint: false,
6127
+ destructiveHint: true,
6128
+ idempotentHint: true,
6129
+ openWorldHint: false,
6130
+ },
6131
+ inputSchema: {
6132
+ type: "object",
6133
+ properties: {
6134
+ agent: {
6135
+ type: "string",
6136
+ description: "The agent's name, or its agt_ id.",
6137
+ },
6138
+ key: {
6139
+ type: "string",
6140
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6141
+ description: "The instance key: 1 to 128 of A-Z a-z 0-9 . _ : - (a user, a thread, a repository).",
6142
+ },
6143
+ },
6144
+ required: ["agent", "key"],
6145
+ additionalProperties: false,
6146
+ },
6147
+ operationId: "agentsDeleteInstance",
6148
+ method: "DELETE",
6149
+ path: "/v1/agents/{agent}/instances/{key}",
6150
+ scope: "agents:write",
6151
+ servedBy: "node",
6152
+ stage: "preview",
6153
+ flag: "agents.actors",
6154
+ pathParams: ["agent", "key"],
6155
+ queryParams: [],
6156
+ body: "none",
6157
+ bodyFields: [],
6158
+ rawFields: [],
6159
+ toolArgs: [],
6160
+ bodyDefaults: {},
6161
+ queryDefaults: {},
6162
+ },
6163
+ {
6164
+ name: "agent_list_sessions",
6165
+ group: "agents",
6166
+ title: "List an agent's sessions",
6167
+ description:
6168
+ "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.",
6169
+ annotations: {
6170
+ title: "List an agent's sessions",
6171
+ readOnlyHint: true,
6172
+ openWorldHint: false,
6173
+ },
6174
+ inputSchema: {
6175
+ type: "object",
6176
+ properties: {
6177
+ agent: {
6178
+ type: "string",
6179
+ description: "The agent's name, or its agt_ id.",
6180
+ },
6181
+ key: {
6182
+ type: "string",
6183
+ pattern: "^[A-Za-z0-9._:-]{1,128}$",
6184
+ description: "Only sessions of this instance.",
6185
+ },
6186
+ conversation: {
3224
6187
  type: "string",
3225
- description: "Only deliveries for this job.",
6188
+ description: "Only sessions of this conversation.",
3226
6189
  },
3227
6190
  status: {
3228
6191
  type: "string",
3229
- enum: ["pending", "retrying", "succeeded", "failed"],
6192
+ description: "Only sessions with this status.",
6193
+ enum: ["queued", "running", "succeeded", "failed", "canceled"],
3230
6194
  },
3231
6195
  limit: {
3232
6196
  type: "integer",
3233
6197
  minimum: 1,
3234
6198
  maximum: 100,
3235
- default: 20,
6199
+ default: 10,
3236
6200
  description: "Page size, from 1 to 100.",
3237
6201
  },
3238
6202
  cursor: {
@@ -3240,20 +6204,23 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3240
6204
  description: "Opaque cursor from the previous page's `next_cursor`. Omit it for the first page.",
3241
6205
  },
3242
6206
  },
6207
+ required: ["agent"],
3243
6208
  additionalProperties: false,
3244
6209
  },
3245
- operationId: "webhooksListDeliveries",
6210
+ operationId: "agentsListSessions",
3246
6211
  method: "GET",
3247
- path: "/v1/webhooks/deliveries",
3248
- scope: "platform:read",
6212
+ path: "/v1/agents/{agent}/sessions",
6213
+ scope: "agents:read",
3249
6214
  servedBy: "node",
3250
- pathParams: [],
6215
+ stage: "preview",
6216
+ flag: "agents.actors",
6217
+ pathParams: ["agent"],
3251
6218
  queryParams: [
3252
6219
  {
3253
- name: "url",
6220
+ name: "key",
3254
6221
  },
3255
6222
  {
3256
- name: "job_id",
6223
+ name: "conversation",
3257
6224
  },
3258
6225
  {
3259
6226
  name: "status",
@@ -3270,40 +6237,84 @@ export const MCP_TOOLS: readonly McpTableTool[] = [
3270
6237
  rawFields: [],
3271
6238
  toolArgs: [],
3272
6239
  bodyDefaults: {},
6240
+ queryDefaults: {
6241
+ limit: 10,
6242
+ },
6243
+ },
6244
+ {
6245
+ name: "agent_get_session",
6246
+ group: "agents",
6247
+ title: "Get an agent session",
6248
+ description:
6249
+ "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.",
6250
+ annotations: {
6251
+ title: "Get an agent session",
6252
+ readOnlyHint: true,
6253
+ openWorldHint: false,
6254
+ },
6255
+ inputSchema: {
6256
+ type: "object",
6257
+ properties: {
6258
+ session_id: {
6259
+ type: "string",
6260
+ pattern: "^ses_[0-9a-hjkmnp-tv-z]{26}$",
6261
+ description: "The session's `ses_` ID.",
6262
+ },
6263
+ },
6264
+ required: ["session_id"],
6265
+ additionalProperties: false,
6266
+ },
6267
+ operationId: "agentsGetSession",
6268
+ method: "GET",
6269
+ path: "/v1/agents/sessions/{session_id}",
6270
+ scope: "agents:read",
6271
+ servedBy: "node",
6272
+ stage: "preview",
6273
+ flag: "agents.actors",
6274
+ pathParams: ["session_id"],
6275
+ queryParams: [],
6276
+ body: "none",
6277
+ bodyFields: [],
6278
+ rawFields: [],
6279
+ toolArgs: [],
6280
+ bodyDefaults: {},
3273
6281
  queryDefaults: {},
3274
6282
  },
3275
6283
  {
3276
- name: "webhooks_send_test",
3277
- group: "platform",
3278
- title: "Send a test webhook",
6284
+ name: "agent_cancel_session",
6285
+ group: "agents",
6286
+ title: "Cancel an agent session",
3279
6287
  description:
3280
- "Send one signed webhook.test event to a URL now and return the delivery with its outcome (not retried).",
6288
+ "Cancel a queued or running turn. A queued message is never delivered; a delivered one has its request into the harness closed.",
3281
6289
  annotations: {
3282
- title: "Send a test webhook",
6290
+ title: "Cancel an agent session",
3283
6291
  readOnlyHint: false,
3284
- destructiveHint: false,
3285
- openWorldHint: true,
6292
+ destructiveHint: true,
6293
+ openWorldHint: false,
3286
6294
  },
3287
6295
  inputSchema: {
3288
6296
  type: "object",
3289
6297
  properties: {
3290
- url: {
6298
+ session_id: {
3291
6299
  type: "string",
3292
- format: "uri",
6300
+ pattern: "^ses_[0-9a-hjkmnp-tv-z]{26}$",
6301
+ description: "The session's `ses_` ID.",
3293
6302
  },
3294
6303
  },
3295
- required: ["url"],
6304
+ required: ["session_id"],
3296
6305
  additionalProperties: false,
3297
6306
  },
3298
- operationId: "webhooksSendTest",
6307
+ operationId: "agentsCancelSession",
3299
6308
  method: "POST",
3300
- path: "/v1/webhooks/test",
3301
- scope: "platform:write",
6309
+ path: "/v1/agents/sessions/{session_id}/cancel",
6310
+ scope: "agents:run",
3302
6311
  servedBy: "node",
3303
- pathParams: [],
6312
+ stage: "preview",
6313
+ flag: "agents.actors",
6314
+ pathParams: ["session_id"],
3304
6315
  queryParams: [],
3305
- body: "json",
3306
- bodyFields: ["url"],
6316
+ body: "none",
6317
+ bodyFields: [],
3307
6318
  rawFields: [],
3308
6319
  toolArgs: [],
3309
6320
  bodyDefaults: {},
@@ -3337,6 +6348,118 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3337
6348
  servedBy: "node",
3338
6349
  idempotent: false,
3339
6350
  },
6351
+ agentsCancelSession: {
6352
+ method: "POST",
6353
+ path: "/v1/agents/sessions/{session_id}/cancel",
6354
+ pathParams: ["session_id"],
6355
+ scope: "agents:run",
6356
+ servedBy: "node",
6357
+ idempotent: false,
6358
+ },
6359
+ agentsCreateAgent: {
6360
+ method: "POST",
6361
+ path: "/v1/agents",
6362
+ pathParams: [],
6363
+ scope: "agents:write",
6364
+ servedBy: "node",
6365
+ idempotent: true,
6366
+ },
6367
+ agentsDeleteAgent: {
6368
+ method: "DELETE",
6369
+ path: "/v1/agents/{agent}",
6370
+ pathParams: ["agent"],
6371
+ scope: "agents:write",
6372
+ servedBy: "node",
6373
+ idempotent: false,
6374
+ },
6375
+ agentsDeleteInstance: {
6376
+ method: "DELETE",
6377
+ path: "/v1/agents/{agent}/instances/{key}",
6378
+ pathParams: ["agent", "key"],
6379
+ scope: "agents:write",
6380
+ servedBy: "node",
6381
+ idempotent: false,
6382
+ },
6383
+ agentsGetAgent: {
6384
+ method: "GET",
6385
+ path: "/v1/agents/{agent}",
6386
+ pathParams: ["agent"],
6387
+ scope: "agents:read",
6388
+ servedBy: "node",
6389
+ idempotent: false,
6390
+ },
6391
+ agentsGetInstance: {
6392
+ method: "GET",
6393
+ path: "/v1/agents/{agent}/instances/{key}",
6394
+ pathParams: ["agent", "key"],
6395
+ scope: "agents:read",
6396
+ servedBy: "node",
6397
+ idempotent: false,
6398
+ },
6399
+ agentsGetSession: {
6400
+ method: "GET",
6401
+ path: "/v1/agents/sessions/{session_id}",
6402
+ pathParams: ["session_id"],
6403
+ scope: "agents:read",
6404
+ servedBy: "node",
6405
+ idempotent: false,
6406
+ },
6407
+ agentsListAgents: {
6408
+ method: "GET",
6409
+ path: "/v1/agents",
6410
+ pathParams: [],
6411
+ scope: "agents:read",
6412
+ servedBy: "node",
6413
+ idempotent: false,
6414
+ },
6415
+ agentsListInstanceEvents: {
6416
+ method: "GET",
6417
+ path: "/v1/agents/{agent}/instances/{key}/events",
6418
+ pathParams: ["agent", "key"],
6419
+ scope: "agents:read",
6420
+ servedBy: "node",
6421
+ idempotent: false,
6422
+ },
6423
+ agentsListInstances: {
6424
+ method: "GET",
6425
+ path: "/v1/agents/{agent}/instances",
6426
+ pathParams: ["agent"],
6427
+ scope: "agents:read",
6428
+ servedBy: "node",
6429
+ idempotent: false,
6430
+ },
6431
+ agentsListSessions: {
6432
+ method: "GET",
6433
+ path: "/v1/agents/{agent}/sessions",
6434
+ pathParams: ["agent"],
6435
+ scope: "agents:read",
6436
+ servedBy: "node",
6437
+ idempotent: false,
6438
+ },
6439
+ agentsSendMessage: {
6440
+ method: "POST",
6441
+ path: "/v1/agents/{agent}/instances/{key}/messages",
6442
+ pathParams: ["agent", "key"],
6443
+ scope: "agents:run",
6444
+ servedBy: "node",
6445
+ idempotent: true,
6446
+ },
6447
+ agentsSleepInstance: {
6448
+ method: "POST",
6449
+ path: "/v1/agents/{agent}/instances/{key}/sleep",
6450
+ pathParams: ["agent", "key"],
6451
+ scope: "agents:run",
6452
+ servedBy: "node",
6453
+ idempotent: false,
6454
+ },
6455
+ agentsUpdateAgent: {
6456
+ method: "PATCH",
6457
+ path: "/v1/agents/{agent}",
6458
+ pathParams: ["agent"],
6459
+ scope: "agents:write",
6460
+ servedBy: "node",
6461
+ idempotent: false,
6462
+ },
3340
6463
  inferCreateChatCompletion: {
3341
6464
  method: "POST",
3342
6465
  path: "/v1/infer/chat/completions",
@@ -3361,6 +6484,78 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3361
6484
  servedBy: "node",
3362
6485
  idempotent: false,
3363
6486
  },
6487
+ listenersCreateListener: {
6488
+ method: "POST",
6489
+ path: "/v1/listeners",
6490
+ pathParams: [],
6491
+ scope: "listeners:write",
6492
+ servedBy: "node",
6493
+ idempotent: true,
6494
+ },
6495
+ listenersDeleteListener: {
6496
+ method: "DELETE",
6497
+ path: "/v1/listeners/{listener_id}",
6498
+ pathParams: ["listener_id"],
6499
+ scope: "listeners:write",
6500
+ servedBy: "node",
6501
+ idempotent: false,
6502
+ },
6503
+ listenersGetListener: {
6504
+ method: "GET",
6505
+ path: "/v1/listeners/{listener_id}",
6506
+ pathParams: ["listener_id"],
6507
+ scope: "listeners:read",
6508
+ servedBy: "node",
6509
+ idempotent: false,
6510
+ },
6511
+ listenersIngestEvents: {
6512
+ method: "POST",
6513
+ path: "/v1/listeners/{listener_id}/events",
6514
+ pathParams: ["listener_id"],
6515
+ scope: "listeners:write",
6516
+ servedBy: "node",
6517
+ idempotent: false,
6518
+ },
6519
+ listenersListEvents: {
6520
+ method: "GET",
6521
+ path: "/v1/listeners/{listener_id}/events",
6522
+ pathParams: ["listener_id"],
6523
+ scope: "listeners:read",
6524
+ servedBy: "node",
6525
+ idempotent: false,
6526
+ },
6527
+ listenersListListeners: {
6528
+ method: "GET",
6529
+ path: "/v1/listeners",
6530
+ pathParams: [],
6531
+ scope: "listeners:read",
6532
+ servedBy: "node",
6533
+ idempotent: false,
6534
+ },
6535
+ listenersTestListener: {
6536
+ method: "POST",
6537
+ path: "/v1/listeners/{listener_id}/test",
6538
+ pathParams: ["listener_id"],
6539
+ scope: "listeners:write",
6540
+ servedBy: "node",
6541
+ idempotent: false,
6542
+ },
6543
+ listenersUpdateListener: {
6544
+ method: "PATCH",
6545
+ path: "/v1/listeners/{listener_id}",
6546
+ pathParams: ["listener_id"],
6547
+ scope: "listeners:write",
6548
+ servedBy: "node",
6549
+ idempotent: false,
6550
+ },
6551
+ platformCreatePortHost: {
6552
+ method: "POST",
6553
+ path: "/v1/sandboxes/{sandbox_id}/ports/{port}/host",
6554
+ pathParams: ["sandbox_id", "port"],
6555
+ scope: "sandboxes:run",
6556
+ servedBy: "edge",
6557
+ idempotent: false,
6558
+ },
3364
6559
  platformGetLimits: {
3365
6560
  method: "GET",
3366
6561
  path: "/v1/limits",
@@ -3369,6 +6564,22 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3369
6564
  servedBy: "edge",
3370
6565
  idempotent: false,
3371
6566
  },
6567
+ platformGetLlmCall: {
6568
+ method: "GET",
6569
+ path: "/v1/llm-calls/{request_id}",
6570
+ pathParams: ["request_id"],
6571
+ scope: "platform:read",
6572
+ servedBy: "node",
6573
+ idempotent: false,
6574
+ },
6575
+ platformGetLlmCallContent: {
6576
+ method: "GET",
6577
+ path: "/v1/llm-calls/{request_id}/content",
6578
+ pathParams: ["request_id"],
6579
+ scope: "platform:content:read",
6580
+ servedBy: "node",
6581
+ idempotent: false,
6582
+ },
3372
6583
  platformGetRequest: {
3373
6584
  method: "GET",
3374
6585
  path: "/v1/requests/{request_id}",
@@ -3377,6 +6588,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3377
6588
  servedBy: "node",
3378
6589
  idempotent: false,
3379
6590
  },
6591
+ platformGetTrace: {
6592
+ method: "GET",
6593
+ path: "/v1/traces/{trace_id}",
6594
+ pathParams: ["trace_id"],
6595
+ scope: "platform:read",
6596
+ servedBy: "edge",
6597
+ idempotent: false,
6598
+ },
3380
6599
  platformGetUsage: {
3381
6600
  method: "GET",
3382
6601
  path: "/v1/usage",
@@ -3385,6 +6604,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3385
6604
  servedBy: "edge",
3386
6605
  idempotent: false,
3387
6606
  },
6607
+ platformListLlmCalls: {
6608
+ method: "GET",
6609
+ path: "/v1/llm-calls",
6610
+ pathParams: [],
6611
+ scope: "platform:read",
6612
+ servedBy: "node",
6613
+ idempotent: false,
6614
+ },
3388
6615
  platformListRequests: {
3389
6616
  method: "GET",
3390
6617
  path: "/v1/requests",
@@ -3393,6 +6620,22 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3393
6620
  servedBy: "node",
3394
6621
  idempotent: false,
3395
6622
  },
6623
+ platformListUsageRecords: {
6624
+ method: "GET",
6625
+ path: "/v1/usage/records",
6626
+ pathParams: [],
6627
+ scope: "platform:read",
6628
+ servedBy: "edge",
6629
+ idempotent: false,
6630
+ },
6631
+ renderCreateInspection: {
6632
+ method: "POST",
6633
+ path: "/v1/render/inspections",
6634
+ pathParams: [],
6635
+ scope: "render:run",
6636
+ servedBy: "node",
6637
+ idempotent: true,
6638
+ },
3396
6639
  renderCreateScreenshot: {
3397
6640
  method: "POST",
3398
6641
  path: "/v1/render/screenshots",
@@ -3413,7 +6656,55 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3413
6656
  method: "GET",
3414
6657
  path: "/v1/render/videos/{video_id}",
3415
6658
  pathParams: ["video_id"],
3416
- scope: "render:read",
6659
+ scope: "authenticated",
6660
+ servedBy: "node",
6661
+ idempotent: false,
6662
+ },
6663
+ renderListPresets: {
6664
+ method: "GET",
6665
+ path: "/v1/render/presets",
6666
+ pathParams: [],
6667
+ scope: "public",
6668
+ servedBy: "node",
6669
+ idempotent: false,
6670
+ },
6671
+ renderRestyleVideo: {
6672
+ method: "POST",
6673
+ path: "/v1/render/videos/{video_id}/restyle",
6674
+ pathParams: ["video_id"],
6675
+ scope: "render:run",
6676
+ servedBy: "node",
6677
+ idempotent: true,
6678
+ },
6679
+ renderShareAlias: {
6680
+ method: "POST",
6681
+ path: "/v1/render/aliases/{alias}/share",
6682
+ pathParams: ["alias"],
6683
+ scope: "render:write",
6684
+ servedBy: "node",
6685
+ idempotent: false,
6686
+ },
6687
+ renderShareVideo: {
6688
+ method: "POST",
6689
+ path: "/v1/render/videos/{video_id}/share",
6690
+ pathParams: ["video_id"],
6691
+ scope: "render:write",
6692
+ servedBy: "node",
6693
+ idempotent: false,
6694
+ },
6695
+ renderUnshareAlias: {
6696
+ method: "DELETE",
6697
+ path: "/v1/render/aliases/{alias}/share",
6698
+ pathParams: ["alias"],
6699
+ scope: "render:write",
6700
+ servedBy: "node",
6701
+ idempotent: false,
6702
+ },
6703
+ renderUnshareVideo: {
6704
+ method: "DELETE",
6705
+ path: "/v1/render/videos/{video_id}/share",
6706
+ pathParams: ["video_id"],
6707
+ scope: "render:write",
3417
6708
  servedBy: "node",
3418
6709
  idempotent: false,
3419
6710
  },
@@ -3433,6 +6724,22 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3433
6724
  servedBy: "node",
3434
6725
  idempotent: false,
3435
6726
  },
6727
+ routinesListRuns: {
6728
+ method: "GET",
6729
+ path: "/v1/routines/{routine}/runs",
6730
+ pathParams: ["routine"],
6731
+ scope: "routines:read",
6732
+ servedBy: "node",
6733
+ idempotent: false,
6734
+ },
6735
+ routinesRunEvents: {
6736
+ method: "GET",
6737
+ path: "/v1/routines/runs/{run_id}/events",
6738
+ pathParams: ["run_id"],
6739
+ scope: "routines:read",
6740
+ servedBy: "node",
6741
+ idempotent: false,
6742
+ },
3436
6743
  routinesSignalRun: {
3437
6744
  method: "POST",
3438
6745
  path: "/v1/routines/runs/{run_id}/signal",
@@ -3449,6 +6756,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3449
6756
  servedBy: "node",
3450
6757
  idempotent: false,
3451
6758
  },
6759
+ sandboxesCancelSwarm: {
6760
+ method: "POST",
6761
+ path: "/v1/sandboxes/swarms/{swarm_id}/cancel",
6762
+ pathParams: ["swarm_id"],
6763
+ scope: "sandboxes:write",
6764
+ servedBy: "node",
6765
+ idempotent: false,
6766
+ },
3452
6767
  sandboxesCreatePortUrl: {
3453
6768
  method: "POST",
3454
6769
  path: "/v1/sandboxes/{sandbox_id}/ports/{port}/url",
@@ -3473,6 +6788,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3473
6788
  servedBy: "node",
3474
6789
  idempotent: true,
3475
6790
  },
6791
+ sandboxesCreateSwarm: {
6792
+ method: "POST",
6793
+ path: "/v1/sandboxes/swarms",
6794
+ pathParams: [],
6795
+ scope: "sandboxes:write",
6796
+ servedBy: "node",
6797
+ idempotent: true,
6798
+ },
3476
6799
  sandboxesDeleteSandbox: {
3477
6800
  method: "DELETE",
3478
6801
  path: "/v1/sandboxes/{sandbox_id}",
@@ -3521,6 +6844,14 @@ export const MCP_OPERATIONS: Readonly<Record<string, McpTableOperation>> = {
3521
6844
  servedBy: "node",
3522
6845
  idempotent: false,
3523
6846
  },
6847
+ sandboxesGetSwarm: {
6848
+ method: "GET",
6849
+ path: "/v1/sandboxes/swarms/{swarm_id}",
6850
+ pathParams: ["swarm_id"],
6851
+ scope: "sandboxes:read",
6852
+ servedBy: "node",
6853
+ idempotent: false,
6854
+ },
3524
6855
  sandboxesGetTemplate: {
3525
6856
  method: "GET",
3526
6857
  path: "/v1/sandboxes/templates/{template}",