@b3os/sdk 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/core/util.d.ts +1 -1
  3. package/dist/cjs/core/util.js +1 -1
  4. package/dist/cjs/generated/client.d.ts +18 -0
  5. package/dist/cjs/generated/client.js +34 -0
  6. package/dist/cjs/generated/client.js.map +1 -1
  7. package/dist/cjs/generated/errors.d.ts +1 -1
  8. package/dist/cjs/generated/errors.js +120 -0
  9. package/dist/cjs/generated/errors.js.map +1 -1
  10. package/dist/cjs/generated/ids.d.ts +89 -0
  11. package/dist/cjs/generated/ids.js +22 -0
  12. package/dist/cjs/generated/ids.js.map +1 -1
  13. package/dist/cjs/generated/jobs.js +4 -0
  14. package/dist/cjs/generated/jobs.js.map +1 -1
  15. package/dist/cjs/generated/ns/actions.d.ts +267 -33
  16. package/dist/cjs/generated/ns/actions.js +375 -33
  17. package/dist/cjs/generated/ns/actions.js.map +1 -1
  18. package/dist/cjs/generated/ns/agents.d.ts +656 -0
  19. package/dist/cjs/generated/ns/agents.js +989 -0
  20. package/dist/cjs/generated/ns/agents.js.map +1 -0
  21. package/dist/cjs/generated/ns/images.d.ts +162 -0
  22. package/dist/cjs/generated/ns/images.js +246 -0
  23. package/dist/cjs/generated/ns/images.js.map +1 -0
  24. package/dist/cjs/generated/ns/infer.d.ts +71 -3
  25. package/dist/cjs/generated/ns/infer.js +98 -3
  26. package/dist/cjs/generated/ns/infer.js.map +1 -1
  27. package/dist/cjs/generated/ns/keys.d.ts +3 -1
  28. package/dist/cjs/generated/ns/keys.js +3 -1
  29. package/dist/cjs/generated/ns/keys.js.map +1 -1
  30. package/dist/cjs/generated/ns/listeners.d.ts +163 -0
  31. package/dist/cjs/generated/ns/listeners.js +268 -0
  32. package/dist/cjs/generated/ns/listeners.js.map +1 -0
  33. package/dist/cjs/generated/ns/orgs.d.ts +10 -0
  34. package/dist/cjs/generated/ns/orgs.js +26 -1
  35. package/dist/cjs/generated/ns/orgs.js.map +1 -1
  36. package/dist/cjs/generated/ns/projects.d.ts +32 -0
  37. package/dist/cjs/generated/ns/projects.js +66 -0
  38. package/dist/cjs/generated/ns/projects.js.map +1 -1
  39. package/dist/cjs/generated/ns/render.d.ts +192 -21
  40. package/dist/cjs/generated/ns/render.js +267 -24
  41. package/dist/cjs/generated/ns/render.js.map +1 -1
  42. package/dist/cjs/generated/ns/requests.d.ts +3 -1
  43. package/dist/cjs/generated/ns/requests.js +3 -1
  44. package/dist/cjs/generated/ns/requests.js.map +1 -1
  45. package/dist/cjs/generated/ns/routines.d.ts +22 -4
  46. package/dist/cjs/generated/ns/routines.js +22 -4
  47. package/dist/cjs/generated/ns/routines.js.map +1 -1
  48. package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
  49. package/dist/cjs/generated/ns/sandboxes.js +633 -6
  50. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  51. package/dist/cjs/generated/ns/usage.d.ts +1 -1
  52. package/dist/cjs/generated/ns/usage.js +1 -1
  53. package/dist/cjs/generated/ns/vision.d.ts +113 -17
  54. package/dist/cjs/generated/ns/vision.js +152 -21
  55. package/dist/cjs/generated/ns/vision.js.map +1 -1
  56. package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
  57. package/dist/cjs/generated/ns/workspaces.js +410 -0
  58. package/dist/cjs/generated/ns/workspaces.js.map +1 -0
  59. package/dist/cjs/generated/types.d.ts +5259 -605
  60. package/dist/cjs/helpers/sandboxes.d.ts +20 -1
  61. package/dist/cjs/helpers/sandboxes.js +13 -1
  62. package/dist/cjs/helpers/sandboxes.js.map +1 -1
  63. package/dist/esm/core/util.d.ts +1 -1
  64. package/dist/esm/core/util.js +1 -1
  65. package/dist/esm/generated/client.d.ts +18 -0
  66. package/dist/esm/generated/client.js +34 -0
  67. package/dist/esm/generated/client.js.map +1 -1
  68. package/dist/esm/generated/errors.d.ts +1 -1
  69. package/dist/esm/generated/errors.js +120 -0
  70. package/dist/esm/generated/errors.js.map +1 -1
  71. package/dist/esm/generated/ids.d.ts +89 -0
  72. package/dist/esm/generated/ids.js +22 -0
  73. package/dist/esm/generated/ids.js.map +1 -1
  74. package/dist/esm/generated/jobs.js +4 -0
  75. package/dist/esm/generated/jobs.js.map +1 -1
  76. package/dist/esm/generated/ns/actions.d.ts +267 -33
  77. package/dist/esm/generated/ns/actions.js +375 -33
  78. package/dist/esm/generated/ns/actions.js.map +1 -1
  79. package/dist/esm/generated/ns/agents.d.ts +656 -0
  80. package/dist/esm/generated/ns/agents.js +985 -0
  81. package/dist/esm/generated/ns/agents.js.map +1 -0
  82. package/dist/esm/generated/ns/images.d.ts +162 -0
  83. package/dist/esm/generated/ns/images.js +242 -0
  84. package/dist/esm/generated/ns/images.js.map +1 -0
  85. package/dist/esm/generated/ns/infer.d.ts +71 -3
  86. package/dist/esm/generated/ns/infer.js +98 -3
  87. package/dist/esm/generated/ns/infer.js.map +1 -1
  88. package/dist/esm/generated/ns/keys.d.ts +3 -1
  89. package/dist/esm/generated/ns/keys.js +3 -1
  90. package/dist/esm/generated/ns/keys.js.map +1 -1
  91. package/dist/esm/generated/ns/listeners.d.ts +163 -0
  92. package/dist/esm/generated/ns/listeners.js +264 -0
  93. package/dist/esm/generated/ns/listeners.js.map +1 -0
  94. package/dist/esm/generated/ns/orgs.d.ts +10 -0
  95. package/dist/esm/generated/ns/orgs.js +26 -1
  96. package/dist/esm/generated/ns/orgs.js.map +1 -1
  97. package/dist/esm/generated/ns/projects.d.ts +32 -0
  98. package/dist/esm/generated/ns/projects.js +66 -0
  99. package/dist/esm/generated/ns/projects.js.map +1 -1
  100. package/dist/esm/generated/ns/render.d.ts +192 -21
  101. package/dist/esm/generated/ns/render.js +267 -24
  102. package/dist/esm/generated/ns/render.js.map +1 -1
  103. package/dist/esm/generated/ns/requests.d.ts +3 -1
  104. package/dist/esm/generated/ns/requests.js +3 -1
  105. package/dist/esm/generated/ns/requests.js.map +1 -1
  106. package/dist/esm/generated/ns/routines.d.ts +22 -4
  107. package/dist/esm/generated/ns/routines.js +22 -4
  108. package/dist/esm/generated/ns/routines.js.map +1 -1
  109. package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
  110. package/dist/esm/generated/ns/sandboxes.js +633 -6
  111. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  112. package/dist/esm/generated/ns/usage.d.ts +1 -1
  113. package/dist/esm/generated/ns/usage.js +1 -1
  114. package/dist/esm/generated/ns/vision.d.ts +113 -17
  115. package/dist/esm/generated/ns/vision.js +152 -21
  116. package/dist/esm/generated/ns/vision.js.map +1 -1
  117. package/dist/esm/generated/ns/workspaces.d.ts +225 -0
  118. package/dist/esm/generated/ns/workspaces.js +406 -0
  119. package/dist/esm/generated/ns/workspaces.js.map +1 -0
  120. package/dist/esm/generated/types.d.ts +5259 -605
  121. package/dist/esm/helpers/sandboxes.d.ts +20 -1
  122. package/dist/esm/helpers/sandboxes.js +13 -1
  123. package/dist/esm/helpers/sandboxes.js.map +1 -1
  124. package/package.json +1 -1
  125. package/src/core/util.ts +1 -1
  126. package/src/generated/client.ts +38 -0
  127. package/src/generated/errors.ts +240 -0
  128. package/src/generated/ids.ts +22 -0
  129. package/src/generated/jobs.ts +4 -0
  130. package/src/generated/ns/actions.ts +403 -33
  131. package/src/generated/ns/agents.ts +1102 -0
  132. package/src/generated/ns/images.ts +256 -0
  133. package/src/generated/ns/infer.ts +100 -3
  134. package/src/generated/ns/keys.ts +3 -1
  135. package/src/generated/ns/listeners.ts +300 -0
  136. package/src/generated/ns/orgs.ts +27 -1
  137. package/src/generated/ns/projects.ts +74 -0
  138. package/src/generated/ns/render.ts +277 -24
  139. package/src/generated/ns/requests.ts +3 -1
  140. package/src/generated/ns/routines.ts +22 -4
  141. package/src/generated/ns/sandboxes.ts +694 -7
  142. package/src/generated/ns/usage.ts +1 -1
  143. package/src/generated/ns/vision.ts +159 -21
  144. package/src/generated/ns/workspaces.ts +448 -0
  145. package/src/generated/types.ts +5684 -601
  146. package/src/helpers/sandboxes.ts +31 -2
@@ -7,6 +7,10 @@ import type * as T from "../types.ts";
7
7
  export declare const actionsOps: {
8
8
  readonly call: Op;
9
9
  readonly describe: Op;
10
+ readonly uploadFile: Op;
11
+ readonly deleteFile: Op;
12
+ readonly getFile: Op;
13
+ readonly mcp: Op;
10
14
  readonly listPacks: Op;
11
15
  readonly getPack: Op;
12
16
  readonly getPackTools: Op;
@@ -14,10 +18,16 @@ export declare const actionsOps: {
14
18
  readonly getRegistryBlob: Op;
15
19
  readonly headRegistryBlob: Op;
16
20
  readonly putRegistryBlob: Op;
21
+ readonly listToolBlocks: Op;
22
+ readonly createToolBlock: Op;
23
+ readonly liftToolBlock: Op;
17
24
  readonly listRegistryPacks: Op;
18
25
  readonly publishPack: Op;
26
+ readonly deleteRegistryPack: Op;
19
27
  readonly getRegistryPack: Op;
28
+ readonly deleteRegistryPackVersion: Op;
20
29
  readonly getRegistryPackVersion: Op;
30
+ readonly yankRegistryPackVersion: Op;
21
31
  readonly downloadPack: Op;
22
32
  readonly search: Op;
23
33
  readonly listSubscriptions: Op;
@@ -58,24 +68,51 @@ export declare class ActionsAPI extends Namespace {
58
68
  * (response mapping and output schema) for declarative HTTP actions; `sidecar` for JavaScript actions.
59
69
  * Bills one `actions.call` once the action ran.
60
70
  *
61
- * **Hosted tools** (a preview, on for every organization in the beta; without `actions.tools` a `vm` call is
71
+ * From inside a sandbox whose grant has an actions rule (`api.actions.allow`; a deployed service's is the packs
72
+ * its b3os.yaml declares in `uses`), only the pack actions the rule names run, at a version it allows: a call
73
+ * that names a range (`@1`) runs the newest allowed version the range admits, so a service pinned to 1.0.1 keeps
74
+ * running 1.0.1 after 1.0.2 is published. Anything else is refused with `403 action_not_allowed` before the
75
+ * input is read, a connection is resolved or anything is billed. The same calls are the sandbox's tools over
76
+ * MCP (`POST /v1/actions/mcp`).
77
+ *
78
+ * **Hosted tools** (a preview; without `actions.tools` for your organization a `vm` call is
62
79
  * `404 feature_not_enabled` and nothing runs). A `vm` action runs its publisher's command in a fresh microVM
63
80
  * with no network, made for this call only and deleted before the call answers. A file field of the input
64
- * schema (`x-b3os-file`) takes a file value inline, `{"$bytes": "<base64>", "name": "<name>"}` with `name`
65
- * matching `^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$` (`ToolFileInput`); an output file comes back as
66
- * `{"$bytes", "name", "bytes", "contentType"}` (`ToolFileOutput`), 262144 bytes of files in all. The budget is
67
- * the least of `timeout_ms`, the action's own timeout and 60 seconds; a priced action refuses a `timeout_ms`
68
- * below its own (`400 invalid_request`) here, and runs to its own timeout when a routine step calls it. Every
69
- * call is a fresh VM, and a call that finished is charged even if the client had stopped waiting: send
70
- * `Idempotency-Key` with a priced call, so a retry with the same key gets the stored answer and is not charged
71
- * again (a routine step's retry with its key gets the answer of the call it started). Per organization: 120 tool calls started a minute, 4 at once, and
72
- * 20 USD of publisher prices a month, counted on each node (`429`); per node, a limit of tool VMs at once (`503 tool_unavailable`,
73
- * `reason: node_busy`). The answer has `tier: vm`, `cost` in micro-USD, and the `timing` phases `validate`,
74
- * `start`, `copy`, `unpack`, `run`, `collect`, `delete` and `cost`. A tool call bills `actions.tool_call` (the
75
- * floor, once the command ran) instead of `actions.call`, the VM's `actions.vcpu_ms` and `actions.gib_ms`,
76
- * and, once the tool answered, its output matched its schema and its output files were read, the publisher's
77
- * price as `actions.publisher_microusd`. A failure
78
- * before the command ran bills nothing; a failure of the tool bills compute and the floor and no price.
81
+ * schema (`x-b3os-file`) takes one of three file values (`ToolFileInput`): `{"$bytes": "<base64>", "name"}`
82
+ * inline, `{"$url": "https://...", "name"}` fetched by the node, or `{"$file": "tfile_..."}`, a file of your
83
+ * project uploaded with `POST /v1/actions/files` or returned by an earlier call. A `$url` is fetched before
84
+ * any VM is claimed, through the node's egress guard: `https` on port 443 only, a public address resolved once
85
+ * and pinned, at most 3 redirects, no `Authorization` or `Cookie` sent, and at most the action's
86
+ * `execution.maxInputMb` (`422 action_input_invalid` with a `url_*` `reason` otherwise); the bytes it reads
87
+ * bill `egress.bytes` to you, and the tool never sees the URL. Nothing is fetched for a call the spend quota,
88
+ * the concurrency limit or the node's slots refuse. A `$file` of another project is
89
+ * `404 resource_not_found`, and an output file of a tool B3OS has removed is `451 tool_blocked`. An output file comes back as a link (`ToolFileOutput`): `$link` is a signed
90
+ * `usercontent.b3os.org` URL served as a download, valid 1 hour, and `file` its `tfile_` ID, which a later
91
+ * call takes as `$file`. Per call, the action's `execution.maxInputMb` of input files, and `maxOutputMb` and
92
+ * `maxOutputFiles` of output files (`502 tool_failed`, `reason: output_too_large`); per organization,
93
+ * `actions.files_bytes` of files kept on the node (`429 quota_exceeded`; an output file it refuses after the
94
+ * command ran is billed compute and the floor); a node whose file store is full answers
95
+ * `503 tool_unavailable`, `reason: file_store`, and bills nothing. The budget is the least of
96
+ * `timeout_ms`, the action's own timeout and 60 seconds; a priced action refuses a `timeout_ms` below its own
97
+ * (`400 invalid_request`) here, and runs to its own timeout when a routine step calls it. Every call is a
98
+ * fresh VM, and a call that finished is charged even if the client had stopped waiting: send
99
+ * `Idempotency-Key` with a priced call, so a retry with the same key gets the stored answer and is not
100
+ * charged again (a routine step's retry with its key gets the answer of the call it started). Per
101
+ * organization: 120 tool calls started a minute, 4 at once, and 20 USD of publisher prices a month, counted
102
+ * on each node (`429`); per node, a limit of tool VMs at once (`503 tool_unavailable`, `reason: node_busy`).
103
+ * The answer has `tier: vm`, `cost` in micro-USD, and the `timing` phases `validate`, `fetch` (when a `$url`
104
+ * was given), `start`, `copy`, `unpack`, `run`, `collect`, `delete` and `cost`. A tool call bills
105
+ * `actions.tool_call` (the floor, once the command ran) instead of `actions.call`, the VM's
106
+ * `actions.vcpu_ms` and `actions.gib_ms`, and, once the tool answered, its output matched its schema and its
107
+ * output files were stored, the publisher's price as `actions.publisher_microusd`: `per_call` once,
108
+ * `per_second` for the `run` phase only, `per_input_mb` for the input file bytes plus the stdin JSON, each
109
+ * after the pack's free calls for your organization this month. A failure before the command ran bills
110
+ * nothing; a failure of the tool bills compute and the floor and no price, and for an org-private tool (your
111
+ * own organization's, `org.<org>/...`) it carries the first 4096 bytes of the command's `stderr`.
112
+ *
113
+ * A tool B3OS has removed answers `451 tool_blocked` with the block's ID, before anything is claimed or
114
+ * billed, here, as an MCP tool and as a routine step. A node that has never received the list of blocks from
115
+ * the edge runs no tool outside `io.b3os` (`503 tool_unavailable`, `reason: blocks_unknown`).
79
116
  *
80
117
  * `POST /v1/actions/call` · scope `actions:run` · served by the node
81
118
  */
@@ -85,11 +122,93 @@ export declare class ActionsAPI extends Namespace {
85
122
  *
86
123
  * Returns everything needed to call one action: input and output JSON Schemas, effect class, MCP annotations
87
124
  * and tool definition, and the connections it needs. A reference with `@<major>` resolves to the newest
88
- * matching release; the response shows the exact version.
125
+ * matching release that is not yanked (an exact version resolves even when yanked); the response shows the
126
+ * exact version. A hosted tool's action carries `tool`: its price, file limits, declared error codes, the
127
+ * node's start estimate for its archive and, after its first call on this node, `all_in`, what one call
128
+ * costs all in. An org-private tool (`org.<org>/...`) is described only to its own organization; to anyone
129
+ * else it is `404 pack_not_found`.
89
130
  *
90
131
  * `GET /v1/actions/describe` · scope `actions:read` · served by the node
91
132
  */
92
133
  describe(params: T.ActionsDescribeParams, options?: RequestOptions): APIPromise<T.ActionDescription>;
134
+ /**
135
+ * Upload a file for a hosted tool
136
+ *
137
+ * Stores the request body as a file a hosted tool's call can take as `{"$file": "tfile_..."}`. The body is the
138
+ * file's bytes, with `Content-Length`, at most 64 MiB. The node checks your organization's
139
+ * `actions.files_bytes` and its own file store before it writes the first byte, so a refused upload leaves
140
+ * nothing behind (`429 quota_exceeded`; `503 tool_unavailable`, `reason: file_store`). The file is kept
141
+ * 1 hour, readable only from your project, and then deleted. Uploading bills nothing.
142
+ *
143
+ * `POST /v1/actions/files` · scope `actions:run` · served by the node
144
+ */
145
+ uploadFile(params: T.ActionsUploadFileParams, data: BinaryInput, options?: RequestOptions): APIPromise<T.ToolFile>;
146
+ /**
147
+ * Delete a hosted tool file
148
+ *
149
+ * Deletes a file of your project now, before its hour is up. Its links stop working (`404`).
150
+ *
151
+ * `DELETE /v1/actions/files/{file_id}` · scope `actions:run` · served by the node
152
+ */
153
+ deleteFile(fileId: string, options?: RequestOptions): APIPromise<void>;
154
+ /**
155
+ * Get a hosted tool file
156
+ *
157
+ * Returns a file of your project (an upload, a fetched `$url` or an output file) with a fresh signed link,
158
+ * which expires at the earlier of the file's `expires_at` and 1 hour from now. An expired file, a deleted one
159
+ * and another project's are `404`.
160
+ *
161
+ * `GET /v1/actions/files/{file_id}` · scope `actions:run` · served by the node
162
+ */
163
+ getFile(fileId: string, options?: RequestOptions): APIPromise<T.ToolFile>;
164
+ /**
165
+ * A sandbox's tools over MCP
166
+ *
167
+ * The MCP server of one sandbox, for code inside it: an MCP client in the sandbox (an agent framework, a model
168
+ * harness) mounts `http://127.0.0.1:7700/v1/actions/mcp`, which the node puts in the sandbox's environment as
169
+ * `B3OS_MCP_URL` whenever its grant names packs or holds a product toolset's scopes. `tools/list` lists exactly
170
+ * the actions of the packs the sandbox's actions rule allows (`api.actions.allow`, at the versions it names,
171
+ * with `actions:read`; a deployed service's rule is the packs its b3os.yaml declares in `uses`), with each
172
+ * pack's own names, descriptions and input schemas (`io.b3os/wikipedia` serves `wikipedia__search`,
173
+ * `wikipedia__get-summary` and two more), then the product tools its scopes allow (node release 1119): the
174
+ * `browser_*` tools with `vision:run` and `vision:write` (`uses: browser`), `vision_scrape` and
175
+ * `vision_screenshot` with `vision:run` (`uses: vision`; `vision_extract` also needs `infer:run`), and the
176
+ * `render_*` tools with `render:run` (`uses: render`). A sandbox with neither lists nothing, and the server's
177
+ * instructions say why.
178
+ *
179
+ * A product tool call is that product's own request (`POST /v1/vision/scrape`, `POST
180
+ * /v1/vision/sessions/{session_id}/act`, `POST /v1/render/screenshots`, ...) sent on the sandbox's own
181
+ * connection: the route's scope check, admission (credits, the key's and the grant's spend caps, the
182
+ * operation's limits), meters and request log record are exactly a direct call's, and this request's record
183
+ * carries `action` with the toolset as `pack` and `<product>/<operationId>` as `ref`. The actions product's own
184
+ * rate does not apply to it. A product tool the grant lacks a scope for answers as a tool result with
185
+ * `isError: true` and `403 forbidden` naming the scope and the `uses` entry that grants it.
186
+ *
187
+ * Each pack `tools/call` runs under the sandbox's grant (its scopes, connections and spend cap) exactly as the same
188
+ * `POST /v1/actions/call` would: the same checks (`actions:run`, the organization's actions rate, credits and
189
+ * spend caps), the same meters (`actions.call` and `egress.bytes`, or a hosted tool's units) and the same
190
+ * request log line, with `action` naming the pack, action and tool. A refused or failed call answers as a tool
191
+ * result with `isError: true` and the problem (`action_not_allowed`, `spend_cap_exceeded`,
192
+ * `connection_required`, ...), so the model reads why; `structuredContent.error` carries the code and status.
193
+ * A successful call's text is the output as compact JSON, cut at 16,000 characters with a line saying how much
194
+ * was left out; `structuredContent` is the output when it is an object that was not cut. `initialize`,
195
+ * `tools/list` and `ping` bill nothing.
196
+ *
197
+ * Transport: Streamable HTTP without sessions, JSON answers only (no event stream: `GET` and `DELETE` answer
198
+ * `405`), protocol revisions 2026-07-28 (stateless, with the mirrored `MCP-Protocol-Version`, `Mcp-Method` and
199
+ * `Mcp-Name` headers) and 2024-11-05 through 2025-11-25 (a request after `initialize` names its revision in
200
+ * `MCP-Protocol-Version`), as the edge's `/mcp`. Every JSON-RPC answer is `200`, its errors (an unknown method
201
+ * or tool, bad params) included. What the transport cannot take is an HTTP error with a problem whose detail
202
+ * names the JSON-RPC code: `400 invalid_request` for a body that is not JSON (`-32700`), a batch (one JSON-RPC
203
+ * message per request, `-32600`), an unsupported revision (`-32022`) or headers that disagree with the body on
204
+ * 2026-07-28 (`-32020`); `415 unsupported_media_type` for a body that is not `application/json`; and
205
+ * `403 forbidden` (`reason: origin`) for a request with an `Origin` header, so no page a browser in the sandbox
206
+ * opens can call the tools. Only code inside a sandbox may call it: an API key gets `403 forbidden` with
207
+ * `reason: sandbox_only`; use `https://beta-api.b3os.org/mcp?packs=<pack>` with a key instead.
208
+ *
209
+ * `POST /v1/actions/mcp` · scope `authenticated` · served by the node
210
+ */
211
+ mcp(body: T.McpMessage, options?: RequestOptions): APIPromise<T.McpMessage | void>;
93
212
  /**
94
213
  * List packs
95
214
  *
@@ -101,7 +220,10 @@ export declare class ActionsAPI extends Namespace {
101
220
  /**
102
221
  * Get a pack
103
222
  *
104
- * Returns a pack version (the latest unless `version` is given) with its actions, triggers, connections and egress hosts.
223
+ * Returns a pack version (the latest that is not yanked unless `version` is given; an exact `version` is
224
+ * returned even when yanked) with its actions, triggers, connections and egress hosts. Each action of a hosted
225
+ * tool carries `tool` (`ActionTool`), with `start_estimate_ms` and `all_in`. An org-private tool is returned
226
+ * only to its own organization; to anyone else it is `404 pack_not_found`.
105
227
  *
106
228
  * `GET /v1/actions/packs/{namespace}/{name}` · scope `actions:read` · served by the node
107
229
  */
@@ -131,8 +253,9 @@ export declare class ActionsAPI extends Namespace {
131
253
  *
132
254
  * Redirects to a short-lived signed URL for the archive (`application/octet-stream`). Served to a node's
133
255
  * registry sync (a node-signed read), to the organization the publisher list names for a namespace that
134
- * published a pack naming this archive, and to B3's organizations; to anyone else it is `404`, as if it did
135
- * not exist. Verify the sha256 before use.
256
+ * published a pack naming this archive, to the organization whose org-private versions name it, to an
257
+ * organization that uploaded these bytes, and to B3's organizations; to anyone else it is `404`, as if it
258
+ * did not exist. Verify the sha256 before use.
136
259
  *
137
260
  * `GET /v1/actions/registry/blobs/{digest}` · scope `actions:read` · served by beta-api.b3os.org
138
261
  */
@@ -140,9 +263,10 @@ export declare class ActionsAPI extends Namespace {
140
263
  /**
141
264
  * Check for a hosted tool's archive
142
265
  *
143
- * Answers `200` with the archive's `Content-Length` when the blob store holds `digest`, else `404` (a HEAD
144
- * answer carries no body). `b3os tool
145
- * publish` asks before it uploads. Needs the `actions.tools` flag and the scope `actions:tools:publish`.
266
+ * Answers `200` with the archive's `Content-Length` when the blob store holds `digest` and the caller holds
267
+ * it (B3's organizations hold every archive; see the upload), else `404` (a HEAD answer carries no body), so
268
+ * the client uploads it. `b3os tool publish` asks before it uploads. Needs the `actions.tools` and
269
+ * `actions.tools_publish` flags and the scope `actions:tools:publish`.
146
270
  *
147
271
  * `HEAD /v1/actions/registry/blobs/{digest}` · scope `actions:tools:publish` · served by beta-api.b3os.org
148
272
  */
@@ -154,17 +278,67 @@ export declare class ActionsAPI extends Namespace {
154
278
  * (`platformPublishPack`). The body is the archive's bytes; `Content-Length` is required and at most
155
279
  * 67108864 (64 MiB), and is checked before the body is read. The edge hashes the body as it streams it to
156
280
  * storage: a body whose sha256 is not `digest`, or whose length is not `Content-Length`, is deleted and
157
- * refused with `422 pack_invalid`. No `Content-Length` is `400 invalid_request`. A digest already stored answers `200` and stores nothing, so a retry is
158
- * safe. Needs the `actions.tools` flag and the scope `actions:tools:publish`, which `*` and `actions:*` never
159
- * grant; in the beta only B3's organizations may upload.
281
+ * refused with `422 pack_invalid`. No `Content-Length` is `400 invalid_request`. A digest already stored
282
+ * answers `200` and stores nothing, so a retry is safe; for an organization that is not one of B3's and does
283
+ * not hold it yet, only after the body hashed to `digest` (else `422 pack_invalid`), which makes it a holder
284
+ * of the archive. An organization holds an archive it uploaded and one a version of a namespace it owns
285
+ * names. Needs the `actions.tools` and `actions.tools_publish`
286
+ * flags and the scope `actions:tools:publish`, which `*` and `actions:*` never grant. An organization that is
287
+ * not one of B3's may upload only while its live org-private archives plus this one stay within
288
+ * `actions.tools.archive_bytes` (1 GiB), checked from `Content-Length` before the body is read
289
+ * (`422 limit_exceeded`).
160
290
  *
161
291
  * `PUT /v1/actions/registry/blobs/{digest}` · scope `actions:tools:publish` · served by beta-api.b3os.org
162
292
  */
163
293
  putRegistryBlob(digest: string, data: BinaryInput, options?: RequestOptions): APIPromise<T.RegistryBlob>;
294
+ /**
295
+ * List hosted tool blocks
296
+ *
297
+ * Every block, lifted ones included, newest first. B3's organizations only, with the scope `actions:tools:publish`.
298
+ *
299
+ * `GET /v1/actions/registry/blocks` · scope `actions:tools:publish` · served by beta-api.b3os.org
300
+ */
301
+ listToolBlocks(params?: T.PlatformListToolBlocksParams, options?: RequestOptions): ListPromise<T.ToolBlockList, T.ToolBlock>;
302
+ /**
303
+ * Block a hosted tool
304
+ *
305
+ * Removes a hosted tool from service on every node: its publisher (every pack of the namespace), a pack, one
306
+ * version, or one action (of every version, or of one). Nodes read every block on their budgets poll, every
307
+ * 5 seconds, and from then answer `451 tool_blocked` before anything is claimed or billed, on every surface;
308
+ * a node keeps the blocks it has seen on disk, so a restart without the edge still refuses. A call already
309
+ * running is not stopped (a call lasts at most 60 seconds). Only B3's organizations may block, with the scope
310
+ * `actions:tools:publish`; one key or session is enough. A block of `io.b3os` is refused in this version
311
+ * (`400 invalid_request`: it needs a second person), and so is a `pack` outside `publisher`. `reason` and `requested_by` stay at the edge: nodes and
312
+ * publishers never see them. Only a lift signed with an `io.b3os` release key ends a block.
313
+ *
314
+ * `POST /v1/actions/registry/blocks` · scope `actions:tools:publish` · served by beta-api.b3os.org
315
+ */
316
+ createToolBlock(body: T.ToolBlockCreateRequest, options?: RequestOptions): APIPromise<T.ToolBlock>;
317
+ /**
318
+ * Lift a hosted tool block
319
+ *
320
+ * Ends a block, with a signature by an `io.b3os` release key (the production release key; a `#dev-` key off
321
+ * production), made with `packages/packs`' release request and attach. `sig` is the base64url (no padding)
322
+ * Ed25519 signature over the UTF-8 bytes of
323
+ *
324
+ * ```
325
+ * "b3os-tool-lift-v1\n" + id + "\n" + scope + "\n" + publisher + "\n" + (pack or "-") + "\n" + (version or "-") + "\n" + (action or "-") + "\n" + lifted_at
326
+ * ```
327
+ *
328
+ * with `lifted_at` exactly as the body sends it. The edge checks it, and every node checks it again from the
329
+ * budgets feed against its own `io.b3os` keys: a lift that does not verify there is ignored and the block
330
+ * stays in force. A missing or wrong signature, or a key that is not an `io.b3os` release key, is
331
+ * `422 pack_signature_invalid`; a block already lifted is `409 conflict`. B3's organizations only, with the
332
+ * scope `actions:tools:publish`.
333
+ *
334
+ * `POST /v1/actions/registry/blocks/{block_id}/lift` · scope `actions:tools:publish` · served by beta-api.b3os.org
335
+ */
336
+ liftToolBlock(blockId: string, body: T.ToolBlockLift, options?: RequestOptions): APIPromise<T.ToolBlock>;
164
337
  /**
165
338
  * List registry packs
166
339
  *
167
- * Lists packs in the registry with their latest version. Nodes use it to keep their local index current.
340
+ * Lists packs in the registry with their latest version. Nodes use it to keep their local index current. An
341
+ * org-private pack is listed only to its own organization (and to nodes).
168
342
  *
169
343
  * `GET /v1/actions/registry/packs` · scope `actions:read` · served by beta-api.b3os.org
170
344
  */
@@ -179,16 +353,52 @@ export declare class ActionsAPI extends Namespace {
179
353
  * immutable. In the beta only B3's organizations may publish, into `io.b3os` or a namespace the registry's
180
354
  * publisher list names for the caller's organization.
181
355
  *
182
- * A pack with a `tool` block (a hosted tool) also needs: the `actions.tools` flag for the caller's
183
- * organization (`404 feature_not_enabled`), the scope `actions:tools:publish`, which `*` and `actions:*` never
184
- * grant (`403 forbidden` with `required_scope`), its archive already uploaded with the sha256 and size the
185
- * manifest names (`PUT /v1/actions/registry/blobs/{digest}`; else `422 pack_invalid` with the pointer
186
- * `/tool/bundle/archive`), and the hosted-tool and price rules of the b3pack publish checks (13 to 20). The
187
- * version records who published it (`published_by`).
356
+ * A pack with a `tool` block (a hosted tool) also needs: the `actions.tools` and `actions.tools_publish` flags
357
+ * for the caller's organization (`404 feature_not_enabled`, even while `actions.tools` is on for every
358
+ * organization), the scope `actions:tools:publish`, which `*` and `actions:*` never grant (`403 forbidden`
359
+ * with `required_scope`), its archive already uploaded with the sha256 and size the manifest names
360
+ * (`PUT /v1/actions/registry/blobs/{digest}`; else `422 pack_invalid` with the pointer
361
+ * `/tool/bundle/archive`), and the hosted-tool, price, schema-cap and escalation rules of the b3pack publish
362
+ * checks (13 to 23; a change of base, size, network, egress or price inside one major is `422 pack_invalid`).
363
+ * The version records who published it (`published_by`). A namespace the publisher list names for an
364
+ * organization that is not one of B3's publishes only while that organization holds `actions.tools_publish`;
365
+ * its versions are signed by the namespace's own key, as before.
366
+ *
367
+ * **Org-private tools.** Any organization holding both flags publishes a tool pack into its own namespace,
368
+ * `org.<its org id in host-safe form>` (`org.org-01m5t68q1b590rj801nbzsqzkk/pandoc`). Another organization's namespace is
369
+ * `403 publisher_not_allowed`, and so is an `org.` pack without a tool block. The manifest is unsigned (one
370
+ * with a `signature` is `422 pack_signature_invalid`): after every check the edge signs
371
+ * `b3pack-sig-v1\n<pack>\n<version>\n<contentHash>` with the organization's key, an Ed25519 key whose seed is
372
+ * HKDF-SHA256 of the edge's secret with salt `b3os-pack-org-key/v1` and info `<org id>#g<generation>`, and
373
+ * the record carries `signature.kid` (`org.<org>#g<generation>`) and `signature.public_key`. No private
374
+ * key is stored. Only the organization itself can see the pack: to every other caller it is
375
+ * `404 pack_not_found` on describe, call, MCP, the registry list and the archive download. Per organization,
376
+ * at most 10 org-private tools, 50 versions per tool and 1 GiB of archives that live versions name
377
+ * (`422 limit_exceeded` with `limit`). A dev version, `<x.y.z>-dev.<unix seconds>`, does not make its pack
378
+ * count toward the tools and is not counted toward the versions, but its archive counts toward the archive
379
+ * bytes, and packs with nothing but a dev version are held to the tools number on their own (`this
380
+ * organization has <n> org-private tools with only a dev version, the most it may keep; delete one first`).
381
+ * Publishing one deletes the pack's earlier dev versions (`dev: true`). An organization that is not one of
382
+ * B3's publishes only hosted tools (any other pack is `403 publisher_not_allowed`, "only hosted tools are
383
+ * published from outside B3 in the beta"), and names only an archive it holds: one whose bytes it uploaded,
384
+ * or one a version of a namespace it owns already names. Any other archive is `422 pack_invalid` as one never
385
+ * uploaded, so the sha256 and size a listed tool's manifest shows are not enough to name it.
188
386
  *
189
387
  * `POST /v1/actions/registry/packs` · scope `actions:write` · served by beta-api.b3os.org
190
388
  */
191
389
  publishPack(data: BinaryInput, options?: RequestOptions): APIPromise<T.RegistryPackVersion>;
390
+ /**
391
+ * Delete an org-private tool
392
+ *
393
+ * Deletes every version of an org-private tool of your own organization (`org.<your org>/<name>`): their
394
+ * records and bundles, and each archive that no live version names any more, from the blob store. Nodes
395
+ * unload the versions at their next registry pass. A listed pack is never deleted (`403
396
+ * publisher_not_allowed`, "only org-private tools are deleted; a listed version is yanked"); another
397
+ * organization's pack is `404 pack_not_found`. Needs the scope `actions:tools:publish`.
398
+ *
399
+ * `DELETE /v1/actions/registry/packs/{namespace}/{name}` · scope `actions:tools:publish` · served by beta-api.b3os.org
400
+ */
401
+ deleteRegistryPack(namespace: string, name: string, options?: RequestOptions): APIPromise<void>;
192
402
  /**
193
403
  * Get a registry pack
194
404
  *
@@ -197,6 +407,17 @@ export declare class ActionsAPI extends Namespace {
197
407
  * `GET /v1/actions/registry/packs/{namespace}/{name}` · scope `actions:read` · served by beta-api.b3os.org
198
408
  */
199
409
  getRegistryPack(namespace: string, name: string, options?: RequestOptions): APIPromise<T.RegistryPack>;
410
+ /**
411
+ * Delete a version of an org-private tool
412
+ *
413
+ * Deletes one version of an org-private tool of your own organization: its record and bundle, and its archive
414
+ * when no other live version names it. Nodes unload it at their next registry pass. A listed version is
415
+ * never deleted (`403 publisher_not_allowed`, "only org-private tools are deleted; a listed version is
416
+ * yanked"). Needs the scope `actions:tools:publish`.
417
+ *
418
+ * `DELETE /v1/actions/registry/packs/{namespace}/{name}/versions/{version}` · scope `actions:tools:publish` · served by beta-api.b3os.org
419
+ */
420
+ deleteRegistryPackVersion(namespace: string, name: string, version: string, options?: RequestOptions): APIPromise<void>;
200
421
  /**
201
422
  * Get a registry pack version
202
423
  *
@@ -205,6 +426,19 @@ export declare class ActionsAPI extends Namespace {
205
426
  * `GET /v1/actions/registry/packs/{namespace}/{name}/versions/{version}` · scope `actions:read` · served by beta-api.b3os.org
206
427
  */
207
428
  getRegistryPackVersion(namespace: string, name: string, version: string, options?: RequestOptions): APIPromise<T.RegistryPackVersion>;
429
+ /**
430
+ * Yank or restore a pack version
431
+ *
432
+ * Sets whether a version is yanked. A yanked version stays published and resolves only when pinned exactly
433
+ * (`@1.0.0`); a range or major (`@1`) skips it, so new callers move to another version and pinned ones keep
434
+ * working. It moves the pack's `updated_at`, which nodes read on their budgets poll, so each node rereads the
435
+ * pack's records within seconds. Allowed for the namespace's owner (your own `org.` namespace, or the
436
+ * organization the publisher list names for it) and for B3's organizations, with the scope
437
+ * `actions:tools:publish` for a hosted tool's pack and `actions:write` for any other.
438
+ *
439
+ * `PATCH /v1/actions/registry/packs/{namespace}/{name}/versions/{version}` · scope `actions:write` · served by beta-api.b3os.org
440
+ */
441
+ yankRegistryPackVersion(namespace: string, name: string, version: string, body: T.RegistryYankRequest, options?: RequestOptions): APIPromise<T.RegistryPackVersion>;
208
442
  /**
209
443
  * Download a pack version
210
444
  *