@b3os/cli 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 (214) hide show
  1. package/README.md +87 -8
  2. package/assets/b3os-run.py +137 -0
  3. package/assets/skill/b3os/SKILL.md +111 -0
  4. package/dist/commands/_agents.d.ts +14 -0
  5. package/dist/commands/_agents.js +33 -0
  6. package/dist/commands/_agents.js.map +1 -0
  7. package/dist/commands/_common.js +6 -2
  8. package/dist/commands/_common.js.map +1 -1
  9. package/dist/commands/_context.d.ts +49 -0
  10. package/dist/commands/_context.js +260 -0
  11. package/dist/commands/_context.js.map +1 -0
  12. package/dist/commands/_next.d.ts +39 -0
  13. package/dist/commands/_next.js +77 -0
  14. package/dist/commands/_next.js.map +1 -0
  15. package/dist/commands/agent.d.ts +42 -0
  16. package/dist/commands/agent.js +218 -0
  17. package/dist/commands/agent.js.map +1 -0
  18. package/dist/commands/app.d.ts +2 -5
  19. package/dist/commands/app.js +229 -69
  20. package/dist/commands/app.js.map +1 -1
  21. package/dist/commands/auth.d.ts +70 -2
  22. package/dist/commands/auth.js +308 -33
  23. package/dist/commands/auth.js.map +1 -1
  24. package/dist/commands/docs.d.ts +54 -0
  25. package/dist/commands/docs.js +202 -0
  26. package/dist/commands/docs.js.map +1 -0
  27. package/dist/commands/doctor.d.ts +23 -0
  28. package/dist/commands/doctor.js +313 -0
  29. package/dist/commands/doctor.js.map +1 -0
  30. package/dist/commands/init.d.ts +38 -1
  31. package/dist/commands/init.js +259 -60
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/commands/listen.d.ts +30 -0
  34. package/dist/commands/listen.js +194 -0
  35. package/dist/commands/listen.js.map +1 -0
  36. package/dist/commands/manifest.d.ts +13 -1
  37. package/dist/commands/manifest.js +59 -7
  38. package/dist/commands/manifest.js.map +1 -1
  39. package/dist/commands/mcp.d.ts +25 -2
  40. package/dist/commands/mcp.js +120 -11
  41. package/dist/commands/mcp.js.map +1 -1
  42. package/dist/commands/sandbox.d.ts +35 -6
  43. package/dist/commands/sandbox.js +208 -9
  44. package/dist/commands/sandbox.js.map +1 -1
  45. package/dist/commands/setup.d.ts +39 -0
  46. package/dist/commands/setup.js +203 -0
  47. package/dist/commands/setup.js.map +1 -0
  48. package/dist/commands/tool.d.ts +109 -1
  49. package/dist/commands/tool.js +635 -47
  50. package/dist/commands/tool.js.map +1 -1
  51. package/dist/config.d.ts +30 -6
  52. package/dist/config.js +39 -8
  53. package/dist/config.js.map +1 -1
  54. package/dist/ctx.d.ts +5 -45
  55. package/dist/ctx.js +25 -160
  56. package/dist/ctx.js.map +1 -1
  57. package/dist/docs/index.json +1 -0
  58. package/dist/docs/pages/actions/call.md +300 -0
  59. package/dist/docs/pages/actions/catalog/airtable.md +737 -0
  60. package/dist/docs/pages/actions/catalog/arxiv.md +166 -0
  61. package/dist/docs/pages/actions/catalog/chainalysis-sanctions.md +125 -0
  62. package/dist/docs/pages/actions/catalog/coingecko.md +1558 -0
  63. package/dist/docs/pages/actions/catalog/deps-dev.md +465 -0
  64. package/dist/docs/pages/actions/catalog/dexscreener.md +568 -0
  65. package/dist/docs/pages/actions/catalog/discord.md +784 -0
  66. package/dist/docs/pages/actions/catalog/finnhub.md +776 -0
  67. package/dist/docs/pages/actions/catalog/frankfurter.md +438 -0
  68. package/dist/docs/pages/actions/catalog/github.md +1853 -0
  69. package/dist/docs/pages/actions/catalog/gmail.md +575 -0
  70. package/dist/docs/pages/actions/catalog/google-calendar.md +654 -0
  71. package/dist/docs/pages/actions/catalog/google-drive.md +502 -0
  72. package/dist/docs/pages/actions/catalog/google-sheets.md +700 -0
  73. package/dist/docs/pages/actions/catalog/hacker-news.md +542 -0
  74. package/dist/docs/pages/actions/catalog/http.md +824 -0
  75. package/dist/docs/pages/actions/catalog/hyperliquid.md +942 -0
  76. package/dist/docs/pages/actions/catalog/jira.md +920 -0
  77. package/dist/docs/pages/actions/catalog/kalshi.md +917 -0
  78. package/dist/docs/pages/actions/catalog/linear.md +1030 -0
  79. package/dist/docs/pages/actions/catalog/markets.md +21 -0
  80. package/dist/docs/pages/actions/catalog/morpho.md +247 -0
  81. package/dist/docs/pages/actions/catalog/notion.md +1077 -0
  82. package/dist/docs/pages/actions/catalog/nws.md +485 -0
  83. package/dist/docs/pages/actions/catalog/open-meteo.md +559 -0
  84. package/dist/docs/pages/actions/catalog/polymarket.md +1523 -0
  85. package/dist/docs/pages/actions/catalog/pushbullet.md +220 -0
  86. package/dist/docs/pages/actions/catalog/resend.md +307 -0
  87. package/dist/docs/pages/actions/catalog/s3.md +513 -0
  88. package/dist/docs/pages/actions/catalog/sec-edgar.md +487 -0
  89. package/dist/docs/pages/actions/catalog/slack.md +2629 -0
  90. package/dist/docs/pages/actions/catalog/stripe.md +1405 -0
  91. package/dist/docs/pages/actions/catalog/wikipedia.md +379 -0
  92. package/dist/docs/pages/actions/catalog.md +46 -0
  93. package/dist/docs/pages/actions/limits.md +50 -0
  94. package/dist/docs/pages/actions/model-tools.md +225 -0
  95. package/dist/docs/pages/actions/packs.md +148 -0
  96. package/dist/docs/pages/actions/settings.md +69 -0
  97. package/dist/docs/pages/actions/tools.md +244 -0
  98. package/dist/docs/pages/actions/triggers.md +149 -0
  99. package/dist/docs/pages/actions.md +88 -0
  100. package/dist/docs/pages/compat/anthropic.md +168 -0
  101. package/dist/docs/pages/compat/e2b.md +194 -0
  102. package/dist/docs/pages/compat/firecrawl.md +138 -0
  103. package/dist/docs/pages/compat/openai.md +168 -0
  104. package/dist/docs/pages/concepts/auth.md +151 -0
  105. package/dist/docs/pages/concepts/beta.md +55 -0
  106. package/dist/docs/pages/concepts/glossary.md +71 -0
  107. package/dist/docs/pages/concepts/ids.md +98 -0
  108. package/dist/docs/pages/concepts/jobs.md +229 -0
  109. package/dist/docs/pages/concepts/latency.md +138 -0
  110. package/dist/docs/pages/concepts/limits.md +191 -0
  111. package/dist/docs/pages/concepts/stack.md +59 -0
  112. package/dist/docs/pages/concepts/timing.md +86 -0
  113. package/dist/docs/pages/concepts/usage.md +110 -0
  114. package/dist/docs/pages/design/b3os-yaml.md +370 -0
  115. package/dist/docs/pages/design/deploy-from-github.md +122 -0
  116. package/dist/docs/pages/design/observability.md +134 -0
  117. package/dist/docs/pages/errors.md +1824 -0
  118. package/dist/docs/pages/infer/chat.md +570 -0
  119. package/dist/docs/pages/infer/limits.md +55 -0
  120. package/dist/docs/pages/infer/messages.md +185 -0
  121. package/dist/docs/pages/infer/responses.md +173 -0
  122. package/dist/docs/pages/infer/settings.md +154 -0
  123. package/dist/docs/pages/infer/speech.md +323 -0
  124. package/dist/docs/pages/infer.md +154 -0
  125. package/dist/docs/pages/introduction.md +162 -0
  126. package/dist/docs/pages/platform/addresses.md +174 -0
  127. package/dist/docs/pages/platform/call-log.md +99 -0
  128. package/dist/docs/pages/platform/custom-domains.md +104 -0
  129. package/dist/docs/pages/platform/keys.md +79 -0
  130. package/dist/docs/pages/platform/limits.md +57 -0
  131. package/dist/docs/pages/platform/members.md +101 -0
  132. package/dist/docs/pages/platform/requests.md +116 -0
  133. package/dist/docs/pages/platform/settings.md +129 -0
  134. package/dist/docs/pages/platform/webhooks.md +68 -0
  135. package/dist/docs/pages/platform.md +67 -0
  136. package/dist/docs/pages/quickstart/mcp.md +94 -0
  137. package/dist/docs/pages/quickstart/sandbox-agent.md +205 -0
  138. package/dist/docs/pages/quickstart/scrape.md +134 -0
  139. package/dist/docs/pages/quickstart.md +45 -0
  140. package/dist/docs/pages/render/inspections.md +162 -0
  141. package/dist/docs/pages/render/limits.md +72 -0
  142. package/dist/docs/pages/render/screenshots.md +179 -0
  143. package/dist/docs/pages/render/settings.md +431 -0
  144. package/dist/docs/pages/render/styles.md +342 -0
  145. package/dist/docs/pages/render/videos.md +272 -0
  146. package/dist/docs/pages/render.md +118 -0
  147. package/dist/docs/pages/routines/callables.md +174 -0
  148. package/dist/docs/pages/routines/definitions.md +361 -0
  149. package/dist/docs/pages/routines/limits.md +117 -0
  150. package/dist/docs/pages/routines/runs.md +328 -0
  151. package/dist/docs/pages/routines/settings.md +104 -0
  152. package/dist/docs/pages/routines/triggers.md +339 -0
  153. package/dist/docs/pages/routines.md +216 -0
  154. package/dist/docs/pages/sandboxes/agents.md +217 -0
  155. package/dist/docs/pages/sandboxes/commands.md +272 -0
  156. package/dist/docs/pages/sandboxes/images.md +166 -0
  157. package/dist/docs/pages/sandboxes/limits.md +143 -0
  158. package/dist/docs/pages/sandboxes/ports.md +260 -0
  159. package/dist/docs/pages/sandboxes/settings.md +358 -0
  160. package/dist/docs/pages/sandboxes/snapshots.md +423 -0
  161. package/dist/docs/pages/sandboxes/swarms.md +146 -0
  162. package/dist/docs/pages/sandboxes/volumes.md +131 -0
  163. package/dist/docs/pages/sandboxes.md +231 -0
  164. package/dist/docs/pages/sdks/cli.md +121 -0
  165. package/dist/docs/pages/sdks/mcp.md +169 -0
  166. package/dist/docs/pages/sdks/python.md +146 -0
  167. package/dist/docs/pages/sdks/typescript.md +202 -0
  168. package/dist/docs/pages/sdks.md +282 -0
  169. package/dist/docs/pages/settings.md +33 -0
  170. package/dist/docs/pages/vault/limits.md +46 -0
  171. package/dist/docs/pages/vault.md +133 -0
  172. package/dist/docs/pages/vision/agent-browser.md +115 -0
  173. package/dist/docs/pages/vision/crawl.md +333 -0
  174. package/dist/docs/pages/vision/extract.md +152 -0
  175. package/dist/docs/pages/vision/fetcher.md +15 -0
  176. package/dist/docs/pages/vision/limits.md +79 -0
  177. package/dist/docs/pages/vision/profiles.md +111 -0
  178. package/dist/docs/pages/vision/proxy.md +131 -0
  179. package/dist/docs/pages/vision/scrape.md +356 -0
  180. package/dist/docs/pages/vision/sessions.md +311 -0
  181. package/dist/docs/pages/vision/settings.md +656 -0
  182. package/dist/docs/pages/vision.md +175 -0
  183. package/dist/errors.d.ts +129 -0
  184. package/dist/errors.js +326 -0
  185. package/dist/errors.js.map +1 -0
  186. package/dist/main.d.ts +1 -1
  187. package/dist/main.js +26 -13
  188. package/dist/main.js.map +1 -1
  189. package/dist/manifest/domains.d.ts +50 -0
  190. package/dist/manifest/domains.js +159 -0
  191. package/dist/manifest/domains.js.map +1 -0
  192. package/dist/manifest/link.d.ts +20 -0
  193. package/dist/manifest/link.js +24 -0
  194. package/dist/manifest/link.js.map +1 -0
  195. package/dist/manifest/record.d.ts +1 -1
  196. package/dist/tool/archive.d.ts +33 -0
  197. package/dist/tool/archive.js +174 -0
  198. package/dist/tool/archive.js.map +1 -0
  199. package/dist/tool/calls.d.ts +46 -0
  200. package/dist/tool/calls.js +274 -0
  201. package/dist/tool/calls.js.map +1 -0
  202. package/dist/tool/checks.d.ts +21 -0
  203. package/dist/tool/checks.js +145 -0
  204. package/dist/tool/checks.js.map +1 -0
  205. package/dist/tool/elf.d.ts +19 -0
  206. package/dist/tool/elf.js +107 -0
  207. package/dist/tool/elf.js.map +1 -0
  208. package/dist/tool/predict.d.ts +8 -0
  209. package/dist/tool/predict.js +38 -0
  210. package/dist/tool/predict.js.map +1 -0
  211. package/dist/tool/ustar.d.ts +5 -0
  212. package/dist/tool/ustar.js +220 -0
  213. package/dist/tool/ustar.js.map +1 -0
  214. package/package.json +6 -5
@@ -0,0 +1,575 @@
1
+ # Gmail
2
+
3
+ > The io.b3os/gmail pack: 6 actions with call snippets, fixture outputs, connection setup and error codes, generated from version 1.0.0.
4
+
5
+ Source: https://docs.beta.b3os.org/actions/catalog/gmail.md
6
+
7
+ <a id="gmail"></a>
8
+
9
+ `io.b3os/gmail` 1.0.0 · `email`, `productivity` · MIT
10
+
11
+ Search and read mail, send plain-text messages, create drafts and change labels (read, starred, archived) in a Gmail mailbox with your own Google OAuth token. Reading gives headers, labels and a snippet; full bodies arrive base64-encoded from Gmail, which declarative actions cannot decode, so they are not included. Needs gmail.readonly, gmail.send, gmail.compose or gmail.modify depending on the actions you use.
12
+
13
+ Every call's result carries `upstream_status` and `timing`: `validate_ms`, `inject_ms`, `render_ms`, `upstream_ms`, `map_ms` and `total_ms`. `upstream` is the service's time; the others are B3OS's own ([call actions](https://docs.beta.b3os.org/actions/call)). The snippets below show no timing values, because a fixture records none.
14
+
15
+ ## Connection
16
+
17
+ `google`, type `oauth2`: Google account (Gmail).
18
+
19
+ An OAuth access token for your Google account from your own Google Cloud OAuth client, with the scopes listed here. Store the refresh_token, client_id and client_secret with it so the vault can refresh the token (access tokens last an hour); B3OS never uses a Google client of its own.
20
+
21
+ How to get one: [developers.google.com](https://developers.google.com/identity/protocols/oauth2/web-server).
22
+
23
+ Scopes the pack's actions use: `https://www.googleapis.com/auth/gmail.readonly`, `https://www.googleapis.com/auth/gmail.send`, `https://www.googleapis.com/auth/gmail.compose`, `https://www.googleapis.com/auth/gmail.modify`. The manifest names them per connection, not per action.
24
+
25
+ The credential is sent only to `gmail.googleapis.com`.
26
+
27
+ Store the credential once as a [vault connection](https://docs.beta.b3os.org/vault) for this pack and key, then name its id in a call's `connections`. Leave the key out and B3OS uses the project's newest connection for the pack and key without a `subject` ([connections](https://docs.beta.b3os.org/actions/call#connections)).
28
+
29
+ Hosts it reaches: `gmail.googleapis.com`.
30
+
31
+ ## Actions
32
+
33
+ | Action | Effect | MCP tool | Title |
34
+ |---|---|---|---|
35
+ | [`list-messages`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-list-messages) | read | `gmail__list-messages` | Search messages |
36
+ | [`get-message`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-get-message) | read | `gmail__get-message` | Get message |
37
+ | [`send-email`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-send-email) | write | `gmail__send-email` | Send email |
38
+ | [`create-draft`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-create-draft) | write | `gmail__create-draft` | Create draft |
39
+ | [`modify-labels`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-modify-labels) | write | `gmail__modify-labels` | Change message labels |
40
+ | [`list-labels`](https://docs.beta.b3os.org/actions/catalog/gmail#gmail-list-labels) | read | `gmail__list-labels` | List labels |
41
+
42
+ <h3 id="gmail-list-messages"><code>list-messages</code></h3>
43
+
44
+ **Search messages.** Message and thread ids matching a Gmail search (the same syntax as the search box: from:alice is:unread newer_than:7d has:attachment label:work), newest first. Read each with get-message. Page with page_token.
45
+
46
+ Ref `io.b3os/gmail/list-messages@1.0.0` · effect `read` · connection `google` · MCP tool `gmail__list-messages`
47
+
48
+ **curl**
49
+
50
+ ```bash
51
+ curl -s https://beta-api.b3os.org/v1/actions/call \
52
+ -H "Authorization: Bearer $B3OS_API_KEY" \
53
+ -H "Content-Type: application/json" \
54
+ -d '{
55
+ "ref": "io.b3os/gmail/list-messages@1",
56
+ "input": {
57
+ "query": "from:releases@example.com newer_than:7d",
58
+ "max_results": 2
59
+ },
60
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
61
+ }'
62
+ ```
63
+ **TypeScript**
64
+
65
+ ```ts
66
+ import { B3OS } from "@b3os/sdk";
67
+
68
+ const b3os = new B3OS();
69
+ const result = await b3os.actions.call({
70
+ ref: "io.b3os/gmail/list-messages@1",
71
+ input: { query: "from:releases@example.com newer_than:7d", max_results: 2 },
72
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
73
+ });
74
+ console.log(result.output);
75
+ ```
76
+ **Python**
77
+
78
+ ```python
79
+ from b3os import B3OS
80
+
81
+ b3os = B3OS()
82
+ result = b3os.actions.call({
83
+ "ref": "io.b3os/gmail/list-messages@1",
84
+ "input": {
85
+ "query": "from:releases@example.com newer_than:7d",
86
+ "max_results": 2,
87
+ },
88
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
89
+ })
90
+ print(result["output"])
91
+ ```
92
+ **MCP**
93
+
94
+ ```json
95
+ {
96
+ "method": "tools/call",
97
+ "params": {
98
+ "name": "gmail__list-messages",
99
+ "arguments": {
100
+ "query": "from:releases@example.com newer_than:7d",
101
+ "max_results": 2
102
+ }
103
+ }
104
+ }
105
+ ```
106
+
107
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__list-messages` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
108
+
109
+ Output, labeled `fixture`: Search messages (documented response shape, example values). From the bundle's `fixtures/list-messages.json`, not a live call.
110
+
111
+ ```json
112
+ {
113
+ "messages": [
114
+ {"id": "18c9a2b3d4e5f6a7", "thread_id": "18c9a2b3d4e5f6a7"},
115
+ {"id": "18c99f0e1d2c3b4a", "thread_id": "18c99f0e1d2c3b4a"}
116
+ ],
117
+ "next_page_token": "09876543210987654321",
118
+ "result_size_estimate": 12
119
+ }
120
+ ```
121
+
122
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
123
+
124
+ | `pack_error.code` | Service status | Retryable | Message |
125
+ |---|---|---|---|
126
+ | `not_found` | 404 | no | built from the service's response |
127
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
128
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
129
+ | `forbidden` | 403 | no | built from the service's response |
130
+ | `invalid_request` | 400 | no | built from the service's response |
131
+ | `conflict` | 409 | no | built from the service's response |
132
+
133
+ <h3 id="gmail-get-message"><code>get-message</code></h3>
134
+
135
+ **Get message.** One message's From, To, Cc, Subject, Date and Message-ID headers, labels, a text snippet, size and receive time. The body is not included (see the pack description).
136
+
137
+ Ref `io.b3os/gmail/get-message@1.0.0` · effect `read` · connection `google` · MCP tool `gmail__get-message`
138
+
139
+ **curl**
140
+
141
+ ```bash
142
+ curl -s https://beta-api.b3os.org/v1/actions/call \
143
+ -H "Authorization: Bearer $B3OS_API_KEY" \
144
+ -H "Content-Type: application/json" \
145
+ -d '{
146
+ "ref": "io.b3os/gmail/get-message@1",
147
+ "input": {"id": "18c9a2b3d4e5f6a7"},
148
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
149
+ }'
150
+ ```
151
+ **TypeScript**
152
+
153
+ ```ts
154
+ import { B3OS } from "@b3os/sdk";
155
+
156
+ const b3os = new B3OS();
157
+ const result = await b3os.actions.call({
158
+ ref: "io.b3os/gmail/get-message@1",
159
+ input: { id: "18c9a2b3d4e5f6a7" },
160
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
161
+ });
162
+ console.log(result.output);
163
+ ```
164
+ **Python**
165
+
166
+ ```python
167
+ from b3os import B3OS
168
+
169
+ b3os = B3OS()
170
+ result = b3os.actions.call({
171
+ "ref": "io.b3os/gmail/get-message@1",
172
+ "input": {"id": "18c9a2b3d4e5f6a7"},
173
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
174
+ })
175
+ print(result["output"])
176
+ ```
177
+ **MCP**
178
+
179
+ ```json
180
+ {
181
+ "method": "tools/call",
182
+ "params": {
183
+ "name": "gmail__get-message",
184
+ "arguments": {"id": "18c9a2b3d4e5f6a7"}
185
+ }
186
+ }
187
+ ```
188
+
189
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__get-message` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
190
+
191
+ Output, labeled `fixture`: Get message (documented response shape, example values). From the bundle's `fixtures/get-message.json`, not a live call.
192
+
193
+ ```json
194
+ {
195
+ "id": "18c9a2b3d4e5f6a7",
196
+ "thread_id": "18c9a2b3d4e5f6a7",
197
+ "labels": ["UNREAD", "IMPORTANT", "CATEGORY_PERSONAL", "INBOX"],
198
+ "snippet": "The release is live; the changelog has the details.",
199
+ "from": "Releases <releases@example.com>",
200
+ "to": "mona@acme.example",
201
+ "cc": null,
202
+ "subject": "Release v2.4.0",
203
+ "date": "Mon, 26 Oct 2026 07:56:40 +0000",
204
+ "message_id": "<CAB3OSexample123@mail.gmail.com>",
205
+ "internal_date_ms": "1792999000000",
206
+ "size_estimate": 5012
207
+ }
208
+ ```
209
+
210
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
211
+
212
+ | `pack_error.code` | Service status | Retryable | Message |
213
+ |---|---|---|---|
214
+ | `not_found` | 404 | no | built from the service's response |
215
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
216
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
217
+ | `forbidden` | 403 | no | built from the service's response |
218
+ | `invalid_request` | 400 | no | built from the service's response |
219
+ | `conflict` | 409 | no | built from the service's response |
220
+
221
+ <h3 id="gmail-send-email"><code>send-email</code></h3>
222
+
223
+ **Send email.** Send a plain-text email from the connected mailbox to one or more recipients, with optional Cc and Bcc. Returns the sent message id and thread id. Not idempotent: two calls send two emails.
224
+
225
+ Ref `io.b3os/gmail/send-email@1.0.0` · effect `write` · connection `google` · MCP tool `gmail__send-email`
226
+
227
+ **curl**
228
+
229
+ ```bash
230
+ curl -s https://beta-api.b3os.org/v1/actions/call \
231
+ -H "Authorization: Bearer $B3OS_API_KEY" \
232
+ -H "Idempotency-Key: 7c1e2f6a-1d43-4a8e-b2a5-3f0c9d5e8b11" \
233
+ -H "Content-Type: application/json" \
234
+ -d '{
235
+ "ref": "io.b3os/gmail/send-email@1",
236
+ "input": {
237
+ "to": "ops@example.com",
238
+ "cc": "mona@acme.example",
239
+ "subject": "Deploy finished",
240
+ "text": "v2.4.0 is live.\r\nRollback plan: redeploy v2.3.9."
241
+ },
242
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
243
+ }'
244
+ ```
245
+ **TypeScript**
246
+
247
+ ```ts
248
+ import { B3OS } from "@b3os/sdk";
249
+
250
+ const b3os = new B3OS();
251
+ const result = await b3os.actions.call({
252
+ ref: "io.b3os/gmail/send-email@1",
253
+ input: {
254
+ to: "ops@example.com",
255
+ cc: "mona@acme.example",
256
+ subject: "Deploy finished",
257
+ text: "v2.4.0 is live.\r\nRollback plan: redeploy v2.3.9.",
258
+ },
259
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
260
+ }, { idempotencyKey: crypto.randomUUID() });
261
+ console.log(result.output);
262
+ ```
263
+ **Python**
264
+
265
+ ```python
266
+ import uuid
267
+ from b3os import B3OS
268
+
269
+ b3os = B3OS()
270
+ result = b3os.actions.call({
271
+ "ref": "io.b3os/gmail/send-email@1",
272
+ "input": {
273
+ "to": "ops@example.com",
274
+ "cc": "mona@acme.example",
275
+ "subject": "Deploy finished",
276
+ "text": "v2.4.0 is live.\r\nRollback plan: redeploy v2.3.9.",
277
+ },
278
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
279
+ }, idempotency_key=str(uuid.uuid4()))
280
+ print(result["output"])
281
+ ```
282
+ **MCP**
283
+
284
+ ```json
285
+ {
286
+ "method": "tools/call",
287
+ "params": {
288
+ "name": "gmail__send-email",
289
+ "arguments": {
290
+ "to": "ops@example.com",
291
+ "cc": "mona@acme.example",
292
+ "subject": "Deploy finished",
293
+ "text": "v2.4.0 is live.\r\nRollback plan: redeploy v2.3.9."
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__send-email` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
300
+
301
+ Output, labeled `fixture`: Send email (documented response shape, example values). From the bundle's `fixtures/send-email.json`, not a live call.
302
+
303
+ ```json
304
+ {
305
+ "id": "18c9b0c1d2e3f4a5",
306
+ "thread_id": "18c9b0c1d2e3f4a5",
307
+ "labels": ["SENT"]
308
+ }
309
+ ```
310
+
311
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
312
+
313
+ | `pack_error.code` | Service status | Retryable | Message |
314
+ |---|---|---|---|
315
+ | `not_found` | 404 | no | built from the service's response |
316
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
317
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
318
+ | `forbidden` | 403 | no | built from the service's response |
319
+ | `invalid_request` | 400 | no | built from the service's response |
320
+ | `conflict` | 409 | no | built from the service's response |
321
+
322
+ <h3 id="gmail-create-draft"><code>create-draft</code></h3>
323
+
324
+ **Create draft.** Save a plain-text email as a draft in the connected mailbox for a person to review and send. Returns the draft id and message id. Not idempotent.
325
+
326
+ Ref `io.b3os/gmail/create-draft@1.0.0` · effect `write` · connection `google` · MCP tool `gmail__create-draft`
327
+
328
+ **curl**
329
+
330
+ ```bash
331
+ curl -s https://beta-api.b3os.org/v1/actions/call \
332
+ -H "Authorization: Bearer $B3OS_API_KEY" \
333
+ -H "Idempotency-Key: 7c1e2f6a-1d43-4a8e-b2a5-3f0c9d5e8b11" \
334
+ -H "Content-Type: application/json" \
335
+ -d '{
336
+ "ref": "io.b3os/gmail/create-draft@1",
337
+ "input": {
338
+ "to": "customer@example.com",
339
+ "subject": "Your refund",
340
+ "text": "Hi, your refund was processed today."
341
+ },
342
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
343
+ }'
344
+ ```
345
+ **TypeScript**
346
+
347
+ ```ts
348
+ import { B3OS } from "@b3os/sdk";
349
+
350
+ const b3os = new B3OS();
351
+ const result = await b3os.actions.call({
352
+ ref: "io.b3os/gmail/create-draft@1",
353
+ input: {
354
+ to: "customer@example.com",
355
+ subject: "Your refund",
356
+ text: "Hi, your refund was processed today.",
357
+ },
358
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
359
+ }, { idempotencyKey: crypto.randomUUID() });
360
+ console.log(result.output);
361
+ ```
362
+ **Python**
363
+
364
+ ```python
365
+ import uuid
366
+ from b3os import B3OS
367
+
368
+ b3os = B3OS()
369
+ result = b3os.actions.call({
370
+ "ref": "io.b3os/gmail/create-draft@1",
371
+ "input": {
372
+ "to": "customer@example.com",
373
+ "subject": "Your refund",
374
+ "text": "Hi, your refund was processed today.",
375
+ },
376
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
377
+ }, idempotency_key=str(uuid.uuid4()))
378
+ print(result["output"])
379
+ ```
380
+ **MCP**
381
+
382
+ ```json
383
+ {
384
+ "method": "tools/call",
385
+ "params": {
386
+ "name": "gmail__create-draft",
387
+ "arguments": {
388
+ "to": "customer@example.com",
389
+ "subject": "Your refund",
390
+ "text": "Hi, your refund was processed today."
391
+ }
392
+ }
393
+ }
394
+ ```
395
+
396
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__create-draft` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
397
+
398
+ Output, labeled `fixture`: Create draft (documented response shape, example values). From the bundle's `fixtures/create-draft.json`, not a live call.
399
+
400
+ ```json
401
+ {
402
+ "draft_id": "r-1234567890123456789",
403
+ "message_id": "18c9b1d2e3f4a5b6",
404
+ "thread_id": "18c9b1d2e3f4a5b6"
405
+ }
406
+ ```
407
+
408
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
409
+
410
+ | `pack_error.code` | Service status | Retryable | Message |
411
+ |---|---|---|---|
412
+ | `not_found` | 404 | no | built from the service's response |
413
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
414
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
415
+ | `forbidden` | 403 | no | built from the service's response |
416
+ | `invalid_request` | 400 | no | built from the service's response |
417
+ | `conflict` | 409 | no | built from the service's response |
418
+
419
+ <h3 id="gmail-modify-labels"><code>modify-labels</code></h3>
420
+
421
+ **Change message labels.** Add and remove labels on a message: remove UNREAD to mark it read, remove INBOX to archive it, add STARRED to star it, or add a user label. Returns the labels after the change.
422
+
423
+ Ref `io.b3os/gmail/modify-labels@1.0.0` · effect `write` · connection `google` · MCP tool `gmail__modify-labels`
424
+
425
+ **curl**
426
+
427
+ ```bash
428
+ curl -s https://beta-api.b3os.org/v1/actions/call \
429
+ -H "Authorization: Bearer $B3OS_API_KEY" \
430
+ -H "Idempotency-Key: 7c1e2f6a-1d43-4a8e-b2a5-3f0c9d5e8b11" \
431
+ -H "Content-Type: application/json" \
432
+ -d '{
433
+ "ref": "io.b3os/gmail/modify-labels@1",
434
+ "input": {"id": "18c9a2b3d4e5f6a7", "remove": ["UNREAD", "INBOX"]},
435
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
436
+ }'
437
+ ```
438
+ **TypeScript**
439
+
440
+ ```ts
441
+ import { B3OS } from "@b3os/sdk";
442
+
443
+ const b3os = new B3OS();
444
+ const result = await b3os.actions.call({
445
+ ref: "io.b3os/gmail/modify-labels@1",
446
+ input: { id: "18c9a2b3d4e5f6a7", remove: ["UNREAD", "INBOX"] },
447
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
448
+ }, { idempotencyKey: crypto.randomUUID() });
449
+ console.log(result.output);
450
+ ```
451
+ **Python**
452
+
453
+ ```python
454
+ import uuid
455
+ from b3os import B3OS
456
+
457
+ b3os = B3OS()
458
+ result = b3os.actions.call({
459
+ "ref": "io.b3os/gmail/modify-labels@1",
460
+ "input": {"id": "18c9a2b3d4e5f6a7", "remove": ["UNREAD", "INBOX"]},
461
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
462
+ }, idempotency_key=str(uuid.uuid4()))
463
+ print(result["output"])
464
+ ```
465
+ **MCP**
466
+
467
+ ```json
468
+ {
469
+ "method": "tools/call",
470
+ "params": {
471
+ "name": "gmail__modify-labels",
472
+ "arguments": {"id": "18c9a2b3d4e5f6a7", "remove": ["UNREAD", "INBOX"]}
473
+ }
474
+ }
475
+ ```
476
+
477
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__modify-labels` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
478
+
479
+ Output, labeled `fixture`: Change message labels (documented response shape, example values). From the bundle's `fixtures/modify-labels.json`, not a live call.
480
+
481
+ ```json
482
+ {
483
+ "id": "18c9a2b3d4e5f6a7",
484
+ "labels": ["IMPORTANT", "CATEGORY_PERSONAL"]
485
+ }
486
+ ```
487
+
488
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
489
+
490
+ | `pack_error.code` | Service status | Retryable | Message |
491
+ |---|---|---|---|
492
+ | `not_found` | 404 | no | built from the service's response |
493
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
494
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
495
+ | `forbidden` | 403 | no | built from the service's response |
496
+ | `invalid_request` | 400 | no | built from the service's response |
497
+ | `conflict` | 409 | no | built from the service's response |
498
+
499
+ <h3 id="gmail-list-labels"><code>list-labels</code></h3>
500
+
501
+ **List labels.** The mailbox's labels: system labels (INBOX, SENT, UNREAD, STARRED, ...) and user labels with their ids, which search and modify-labels use.
502
+
503
+ Ref `io.b3os/gmail/list-labels@1.0.0` · effect `read` · connection `google` · MCP tool `gmail__list-labels`
504
+
505
+ **curl**
506
+
507
+ ```bash
508
+ curl -s https://beta-api.b3os.org/v1/actions/call \
509
+ -H "Authorization: Bearer $B3OS_API_KEY" \
510
+ -H "Content-Type: application/json" \
511
+ -d '{
512
+ "ref": "io.b3os/gmail/list-labels@1",
513
+ "input": {},
514
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"}
515
+ }'
516
+ ```
517
+ **TypeScript**
518
+
519
+ ```ts
520
+ import { B3OS } from "@b3os/sdk";
521
+
522
+ const b3os = new B3OS();
523
+ const result = await b3os.actions.call({
524
+ ref: "io.b3os/gmail/list-labels@1",
525
+ input: {},
526
+ connections: { google: "conn_01m5t6cbgdjs1ketgcqwa2sne8" },
527
+ });
528
+ console.log(result.output);
529
+ ```
530
+ **Python**
531
+
532
+ ```python
533
+ from b3os import B3OS
534
+
535
+ b3os = B3OS()
536
+ result = b3os.actions.call({
537
+ "ref": "io.b3os/gmail/list-labels@1",
538
+ "input": {},
539
+ "connections": {"google": "conn_01m5t6cbgdjs1ketgcqwa2sne8"},
540
+ })
541
+ print(result["output"])
542
+ ```
543
+ **MCP**
544
+
545
+ ```json
546
+ {
547
+ "method": "tools/call",
548
+ "params": {"name": "gmail__list-labels", "arguments": {}}
549
+ }
550
+ ```
551
+
552
+ Expose the pack as tools with `--packs gmail` on the local server or `?packs=gmail` on the remote URL, and the agent calls `gmail__list-labels` with the action's input. The tool uses your newest connection for each key without a `subject`. Without exposing the pack, `actions_call` takes the same input with `ref`.
553
+
554
+ Output, labeled `fixture`: List labels (documented response shape, example values). From the bundle's `fixtures/list-labels.json`, not a live call.
555
+
556
+ ```json
557
+ {
558
+ "labels": [
559
+ {"id": "INBOX", "name": "INBOX", "type": "system"},
560
+ {"id": "UNREAD", "name": "UNREAD", "type": "system"},
561
+ {"id": "Label_12", "name": "Customers", "type": "user"}
562
+ ]
563
+ }
564
+ ```
565
+
566
+ When the service answers with an error, the call fails with [`upstream_error`](https://docs.beta.b3os.org/errors#upstream_error) and `pack_error.code` is one of:
567
+
568
+ | `pack_error.code` | Service status | Retryable | Message |
569
+ |---|---|---|---|
570
+ | `not_found` | 404 | no | built from the service's response |
571
+ | `connection_unauthorized` | 401 | no | Google rejected the access token (expired or revoked); refresh or reconnect it. |
572
+ | `rate_limited` | 429, 403 | yes | built from the service's response |
573
+ | `forbidden` | 403 | no | built from the service's response |
574
+ | `invalid_request` | 400 | no | built from the service's response |
575
+ | `conflict` | 409 | no | built from the service's response |