@aexhq/sdk 0.46.4-canary → 0.50.0

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 (337) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +38 -0
  3. package/README.md +23 -31
  4. package/dist/client/aex.d.ts +33 -0
  5. package/dist/client/aex.js +98 -0
  6. package/dist/client/aex.js.map +1 -0
  7. package/dist/client/credentials.d.ts +25 -0
  8. package/dist/client/credentials.js +97 -0
  9. package/dist/client/credentials.js.map +1 -0
  10. package/dist/client/routing.d.ts +7 -0
  11. package/dist/client/routing.js +29 -0
  12. package/dist/client/routing.js.map +1 -0
  13. package/dist/downloads/download.d.ts +25 -0
  14. package/dist/downloads/download.js +53 -0
  15. package/dist/downloads/download.js.map +1 -0
  16. package/dist/generated/errors.d.ts +12 -0
  17. package/dist/generated/errors.js +81 -0
  18. package/dist/generated/errors.js.map +1 -0
  19. package/dist/generated/resources.d.ts +730 -0
  20. package/dist/generated/resources.js +606 -0
  21. package/dist/generated/resources.js.map +1 -0
  22. package/dist/generated/routes.d.ts +42 -0
  23. package/dist/generated/routes.js +2101 -0
  24. package/dist/generated/routes.js.map +1 -0
  25. package/dist/index.d.ts +20 -50
  26. package/dist/index.js +11 -62
  27. package/dist/index.js.map +1 -1
  28. package/dist/observations/stream.d.ts +1 -0
  29. package/dist/observations/stream.js +18 -0
  30. package/dist/observations/stream.js.map +1 -0
  31. package/dist/transport/errors.d.ts +60 -0
  32. package/dist/transport/errors.js +107 -0
  33. package/dist/transport/errors.js.map +1 -0
  34. package/dist/transport/pagination.d.ts +8 -0
  35. package/dist/transport/pagination.js +34 -0
  36. package/dist/transport/pagination.js.map +1 -0
  37. package/dist/transport/retry.d.ts +21 -0
  38. package/dist/transport/retry.js +37 -0
  39. package/dist/transport/retry.js.map +1 -0
  40. package/dist/transport/transport.d.ts +25 -0
  41. package/dist/transport/transport.js +28 -0
  42. package/dist/transport/transport.js.map +1 -0
  43. package/package.json +63 -30
  44. package/dist/_contracts/account-operations.d.ts +0 -101
  45. package/dist/_contracts/account-operations.js +0 -242
  46. package/dist/_contracts/account-types.d.ts +0 -461
  47. package/dist/_contracts/account-types.js +0 -1
  48. package/dist/_contracts/api-key.d.ts +0 -61
  49. package/dist/_contracts/api-key.js +0 -101
  50. package/dist/_contracts/api-routes.d.ts +0 -20
  51. package/dist/_contracts/api-routes.js +0 -109
  52. package/dist/_contracts/archive-limits.d.ts +0 -3
  53. package/dist/_contracts/archive-limits.js +0 -23
  54. package/dist/_contracts/asset-authoring.d.ts +0 -22
  55. package/dist/_contracts/asset-authoring.js +0 -106
  56. package/dist/_contracts/asset-bundle.d.ts +0 -64
  57. package/dist/_contracts/asset-bundle.js +0 -263
  58. package/dist/_contracts/asset-upload-helper.d.ts +0 -31
  59. package/dist/_contracts/asset-upload-helper.js +0 -84
  60. package/dist/_contracts/billing-admission.d.ts +0 -29
  61. package/dist/_contracts/billing-admission.js +0 -28
  62. package/dist/_contracts/bundle-manifest.d.ts +0 -89
  63. package/dist/_contracts/bundle-manifest.js +0 -158
  64. package/dist/_contracts/canonical-sha256.d.ts +0 -8
  65. package/dist/_contracts/canonical-sha256.js +0 -8
  66. package/dist/_contracts/connection-ticket.d.ts +0 -22
  67. package/dist/_contracts/connection-ticket.js +0 -54
  68. package/dist/_contracts/continuation-event.d.ts +0 -31
  69. package/dist/_contracts/continuation-event.js +0 -6
  70. package/dist/_contracts/contract-parse-error.d.ts +0 -12
  71. package/dist/_contracts/contract-parse-error.js +0 -51
  72. package/dist/_contracts/error-codes.d.ts +0 -26
  73. package/dist/_contracts/error-codes.js +0 -116
  74. package/dist/_contracts/error-factory.d.ts +0 -32
  75. package/dist/_contracts/error-factory.js +0 -174
  76. package/dist/_contracts/event-envelope.d.ts +0 -471
  77. package/dist/_contracts/event-envelope.js +0 -501
  78. package/dist/_contracts/event-stream-client.d.ts +0 -122
  79. package/dist/_contracts/event-stream-client.js +0 -445
  80. package/dist/_contracts/event-view.d.ts +0 -44
  81. package/dist/_contracts/event-view.js +0 -69
  82. package/dist/_contracts/failure-class.d.ts +0 -29
  83. package/dist/_contracts/failure-class.js +0 -73
  84. package/dist/_contracts/http.d.ts +0 -135
  85. package/dist/_contracts/http.js +0 -434
  86. package/dist/_contracts/ids.d.ts +0 -66
  87. package/dist/_contracts/ids.js +0 -119
  88. package/dist/_contracts/index.d.ts +0 -42
  89. package/dist/_contracts/index.js +0 -52
  90. package/dist/_contracts/internal.d.ts +0 -55
  91. package/dist/_contracts/internal.js +0 -113
  92. package/dist/_contracts/models.d.ts +0 -30
  93. package/dist/_contracts/models.js +0 -28
  94. package/dist/_contracts/operation-core.d.ts +0 -36
  95. package/dist/_contracts/operation-core.js +0 -70
  96. package/dist/_contracts/operations.d.ts +0 -218
  97. package/dist/_contracts/operations.js +0 -1496
  98. package/dist/_contracts/otlp-projection.d.ts +0 -78
  99. package/dist/_contracts/otlp-projection.js +0 -171
  100. package/dist/_contracts/post-hook.d.ts +0 -31
  101. package/dist/_contracts/post-hook.js +0 -61
  102. package/dist/_contracts/provider-fault.d.ts +0 -34
  103. package/dist/_contracts/provider-fault.js +0 -68
  104. package/dist/_contracts/retry-core.d.ts +0 -29
  105. package/dist/_contracts/retry-core.js +0 -79
  106. package/dist/_contracts/runner-event.d.ts +0 -117
  107. package/dist/_contracts/runner-event.js +0 -172
  108. package/dist/_contracts/runtime-kind.d.ts +0 -60
  109. package/dist/_contracts/runtime-kind.js +0 -70
  110. package/dist/_contracts/runtime-manifest.d.ts +0 -121
  111. package/dist/_contracts/runtime-manifest.js +0 -83
  112. package/dist/_contracts/runtime-security-profile.d.ts +0 -26
  113. package/dist/_contracts/runtime-security-profile.js +0 -73
  114. package/dist/_contracts/runtime-sizes.d.ts +0 -104
  115. package/dist/_contracts/runtime-sizes.js +0 -111
  116. package/dist/_contracts/runtime-types.d.ts +0 -618
  117. package/dist/_contracts/runtime-types.js +0 -58
  118. package/dist/_contracts/schemas/asset-bundle.d.ts +0 -70
  119. package/dist/_contracts/schemas/asset-bundle.js +0 -107
  120. package/dist/_contracts/schemas/asset-ref.d.ts +0 -61
  121. package/dist/_contracts/schemas/asset-ref.js +0 -118
  122. package/dist/_contracts/schemas/bundle-manifest.d.ts +0 -66
  123. package/dist/_contracts/schemas/bundle-manifest.js +0 -77
  124. package/dist/_contracts/schemas/index.d.ts +0 -32
  125. package/dist/_contracts/schemas/index.js +0 -30
  126. package/dist/_contracts/schemas/mcp-server.d.ts +0 -99
  127. package/dist/_contracts/schemas/mcp-server.js +0 -209
  128. package/dist/_contracts/schemas/models.d.ts +0 -29
  129. package/dist/_contracts/schemas/models.js +0 -51
  130. package/dist/_contracts/schemas/numeric.d.ts +0 -18
  131. package/dist/_contracts/schemas/numeric.js +0 -28
  132. package/dist/_contracts/schemas/post-hook.d.ts +0 -45
  133. package/dist/_contracts/schemas/post-hook.js +0 -68
  134. package/dist/_contracts/schemas/response-assets.d.ts +0 -75
  135. package/dist/_contracts/schemas/response-assets.js +0 -81
  136. package/dist/_contracts/schemas/response-billing.d.ts +0 -208
  137. package/dist/_contracts/schemas/response-billing.js +0 -139
  138. package/dist/_contracts/schemas/response-common.d.ts +0 -132
  139. package/dist/_contracts/schemas/response-common.js +0 -162
  140. package/dist/_contracts/schemas/response-identity.d.ts +0 -648
  141. package/dist/_contracts/schemas/response-identity.js +0 -131
  142. package/dist/_contracts/schemas/response-mcp-servers.d.ts +0 -51
  143. package/dist/_contracts/schemas/response-mcp-servers.js +0 -32
  144. package/dist/_contracts/schemas/response-secrets.d.ts +0 -50
  145. package/dist/_contracts/schemas/response-secrets.js +0 -32
  146. package/dist/_contracts/schemas/response-sessions-internal.d.ts +0 -200
  147. package/dist/_contracts/schemas/response-sessions-internal.js +0 -142
  148. package/dist/_contracts/schemas/response-sessions.d.ts +0 -1598
  149. package/dist/_contracts/schemas/response-sessions.js +0 -377
  150. package/dist/_contracts/schemas/response-webhooks.d.ts +0 -76
  151. package/dist/_contracts/schemas/response-webhooks.js +0 -42
  152. package/dist/_contracts/schemas/response-workspace.d.ts +0 -225
  153. package/dist/_contracts/schemas/response-workspace.js +0 -99
  154. package/dist/_contracts/schemas/runtime-kind.d.ts +0 -31
  155. package/dist/_contracts/schemas/runtime-kind.js +0 -29
  156. package/dist/_contracts/schemas/runtime-security-profile.d.ts +0 -28
  157. package/dist/_contracts/schemas/runtime-security-profile.js +0 -26
  158. package/dist/_contracts/schemas/runtime-sizes.d.ts +0 -70
  159. package/dist/_contracts/schemas/runtime-sizes.js +0 -127
  160. package/dist/_contracts/schemas/session-limits.d.ts +0 -34
  161. package/dist/_contracts/schemas/session-limits.js +0 -39
  162. package/dist/_contracts/schemas/session-machine.d.ts +0 -23
  163. package/dist/_contracts/schemas/session-machine.js +0 -24
  164. package/dist/_contracts/schemas/session-request-config.d.ts +0 -58
  165. package/dist/_contracts/schemas/session-request-config.js +0 -134
  166. package/dist/_contracts/schemas/session-webhook.d.ts +0 -11
  167. package/dist/_contracts/schemas/session-webhook.js +0 -38
  168. package/dist/_contracts/schemas/side-effect-audit.d.ts +0 -98
  169. package/dist/_contracts/schemas/side-effect-audit.js +0 -102
  170. package/dist/_contracts/schemas/submission-assets.d.ts +0 -117
  171. package/dist/_contracts/schemas/submission-assets.js +0 -147
  172. package/dist/_contracts/schemas/submission-body.d.ts +0 -251
  173. package/dist/_contracts/schemas/submission-body.js +0 -378
  174. package/dist/_contracts/schemas/submission-environment.d.ts +0 -79
  175. package/dist/_contracts/schemas/submission-environment.js +0 -179
  176. package/dist/_contracts/schemas/submission-request.d.ts +0 -158
  177. package/dist/_contracts/schemas/submission-request.js +0 -49
  178. package/dist/_contracts/schemas/submission-secrets.d.ts +0 -47
  179. package/dist/_contracts/schemas/submission-secrets.js +0 -108
  180. package/dist/_contracts/schemas/wire.d.ts +0 -118
  181. package/dist/_contracts/schemas/wire.js +0 -171
  182. package/dist/_contracts/schemas/workspace-resources.d.ts +0 -50
  183. package/dist/_contracts/schemas/workspace-resources.js +0 -87
  184. package/dist/_contracts/sdk-errors.d.ts +0 -212
  185. package/dist/_contracts/sdk-errors.js +0 -313
  186. package/dist/_contracts/sdk-secrets.d.ts +0 -67
  187. package/dist/_contracts/sdk-secrets.js +0 -427
  188. package/dist/_contracts/session-archive.d.ts +0 -16
  189. package/dist/_contracts/session-archive.js +0 -92
  190. package/dist/_contracts/session-artifacts.d.ts +0 -189
  191. package/dist/_contracts/session-artifacts.js +0 -264
  192. package/dist/_contracts/session-config.d.ts +0 -373
  193. package/dist/_contracts/session-config.js +0 -562
  194. package/dist/_contracts/session-cost-types.d.ts +0 -211
  195. package/dist/_contracts/session-cost-types.js +0 -69
  196. package/dist/_contracts/session-cost.d.ts +0 -8
  197. package/dist/_contracts/session-cost.js +0 -582
  198. package/dist/_contracts/session-custody.d.ts +0 -165
  199. package/dist/_contracts/session-custody.js +0 -345
  200. package/dist/_contracts/session-file-query.d.ts +0 -14
  201. package/dist/_contracts/session-file-query.js +0 -178
  202. package/dist/_contracts/session-record.d.ts +0 -112
  203. package/dist/_contracts/session-record.js +0 -165
  204. package/dist/_contracts/session-retention.d.ts +0 -201
  205. package/dist/_contracts/session-retention.js +0 -450
  206. package/dist/_contracts/side-effect-audit.d.ts +0 -126
  207. package/dist/_contracts/side-effect-audit.js +0 -520
  208. package/dist/_contracts/sse.d.ts +0 -74
  209. package/dist/_contracts/sse.js +0 -227
  210. package/dist/_contracts/stable.d.ts +0 -45
  211. package/dist/_contracts/stable.js +0 -62
  212. package/dist/_contracts/status.d.ts +0 -25
  213. package/dist/_contracts/status.js +0 -57
  214. package/dist/_contracts/submission-limits.d.ts +0 -61
  215. package/dist/_contracts/submission-limits.js +0 -60
  216. package/dist/_contracts/submission.d.ts +0 -547
  217. package/dist/_contracts/submission.js +0 -812
  218. package/dist/_contracts/suggest.d.ts +0 -15
  219. package/dist/_contracts/suggest.js +0 -53
  220. package/dist/_contracts/testing/response-bindings.d.ts +0 -45
  221. package/dist/_contracts/testing/response-bindings.js +0 -256
  222. package/dist/_contracts/testing/wire-conformance-entry.d.ts +0 -10
  223. package/dist/_contracts/testing/wire-conformance-entry.js +0 -8
  224. package/dist/_contracts/testing/wire-conformance.d.ts +0 -169
  225. package/dist/_contracts/testing/wire-conformance.js +0 -276
  226. package/dist/_contracts/turn-trace.d.ts +0 -28
  227. package/dist/_contracts/turn-trace.js +0 -1
  228. package/dist/_contracts/unknown-field-error.d.ts +0 -13
  229. package/dist/_contracts/unknown-field-error.js +0 -21
  230. package/dist/_contracts/value-guards.d.ts +0 -20
  231. package/dist/_contracts/value-guards.js +0 -34
  232. package/dist/_contracts/webhook-verify.d.ts +0 -34
  233. package/dist/_contracts/webhook-verify.js +0 -93
  234. package/dist/_contracts/wire-observer.d.ts +0 -49
  235. package/dist/_contracts/wire-observer.js +0 -34
  236. package/dist/_contracts/workflow-status.d.ts +0 -7
  237. package/dist/_contracts/workflow-status.js +0 -43
  238. package/dist/_contracts/workspace-resources.d.ts +0 -98
  239. package/dist/_contracts/workspace-resources.js +0 -39
  240. package/dist/archive-limits.d.ts +0 -1
  241. package/dist/archive-limits.js +0 -2
  242. package/dist/archive-limits.js.map +0 -1
  243. package/dist/asset-upload.d.ts +0 -47
  244. package/dist/asset-upload.js +0 -269
  245. package/dist/asset-upload.js.map +0 -1
  246. package/dist/bundle.d.ts +0 -9
  247. package/dist/bundle.js +0 -20
  248. package/dist/bundle.js.map +0 -1
  249. package/dist/canonical-zip.d.ts +0 -68
  250. package/dist/canonical-zip.js +0 -355
  251. package/dist/canonical-zip.js.map +0 -1
  252. package/dist/cli.mjs +0 -12048
  253. package/dist/cli.mjs.sha256 +0 -1
  254. package/dist/client-types.d.ts +0 -192
  255. package/dist/client-types.js +0 -2
  256. package/dist/client-types.js.map +0 -1
  257. package/dist/client.d.ts +0 -464
  258. package/dist/client.js +0 -1207
  259. package/dist/client.js.map +0 -1
  260. package/dist/event-projection.d.ts +0 -22
  261. package/dist/event-projection.js +0 -380
  262. package/dist/event-projection.js.map +0 -1
  263. package/dist/fetch-archive.d.ts +0 -16
  264. package/dist/fetch-archive.js +0 -252
  265. package/dist/fetch-archive.js.map +0 -1
  266. package/dist/file.d.ts +0 -96
  267. package/dist/file.js +0 -272
  268. package/dist/file.js.map +0 -1
  269. package/dist/instructions.d.ts +0 -20
  270. package/dist/instructions.js +0 -40
  271. package/dist/instructions.js.map +0 -1
  272. package/dist/legacy-session-provider-fault.d.ts +0 -7
  273. package/dist/legacy-session-provider-fault.js +0 -38
  274. package/dist/legacy-session-provider-fault.js.map +0 -1
  275. package/dist/mcp-server.d.ts +0 -84
  276. package/dist/mcp-server.js +0 -117
  277. package/dist/mcp-server.js.map +0 -1
  278. package/dist/node-fs.d.ts +0 -29
  279. package/dist/node-fs.js +0 -19
  280. package/dist/node-fs.js.map +0 -1
  281. package/dist/node-walk.d.ts +0 -69
  282. package/dist/node-walk.js +0 -151
  283. package/dist/node-walk.js.map +0 -1
  284. package/dist/path-basename.d.ts +0 -5
  285. package/dist/path-basename.js +0 -9
  286. package/dist/path-basename.js.map +0 -1
  287. package/dist/retry.d.ts +0 -70
  288. package/dist/retry.js +0 -155
  289. package/dist/retry.js.map +0 -1
  290. package/dist/secret.d.ts +0 -65
  291. package/dist/secret.js +0 -110
  292. package/dist/secret.js.map +0 -1
  293. package/dist/session-validate.d.ts +0 -100
  294. package/dist/session-validate.js +0 -303
  295. package/dist/session-validate.js.map +0 -1
  296. package/dist/skill.d.ts +0 -99
  297. package/dist/skill.js +0 -169
  298. package/dist/skill.js.map +0 -1
  299. package/dist/submission-wire.d.ts +0 -13
  300. package/dist/submission-wire.js +0 -69
  301. package/dist/submission-wire.js.map +0 -1
  302. package/dist/tool.d.ts +0 -41
  303. package/dist/tool.js +0 -76
  304. package/dist/tool.js.map +0 -1
  305. package/dist/version.d.ts +0 -9
  306. package/dist/version.js +0 -10
  307. package/dist/version.js.map +0 -1
  308. package/docs/authentication.md +0 -125
  309. package/docs/billing.md +0 -164
  310. package/docs/cleanup.md +0 -27
  311. package/docs/concepts/agent-tools.md +0 -47
  312. package/docs/concepts/composition.md +0 -60
  313. package/docs/concepts/providers-and-runtimes.md +0 -121
  314. package/docs/concepts/sessions.md +0 -51
  315. package/docs/concepts/subagents.md +0 -35
  316. package/docs/credentials.md +0 -116
  317. package/docs/defaults.md +0 -51
  318. package/docs/errors.md +0 -258
  319. package/docs/events.md +0 -143
  320. package/docs/files.md +0 -130
  321. package/docs/limits-and-quotas.md +0 -114
  322. package/docs/limits.md +0 -51
  323. package/docs/mcp.md +0 -47
  324. package/docs/networking.md +0 -114
  325. package/docs/provider-runtime-capabilities.md +0 -32
  326. package/docs/public-surface.json +0 -73
  327. package/docs/quickstart.md +0 -135
  328. package/docs/release.md +0 -44
  329. package/docs/retries.md +0 -108
  330. package/docs/secrets.md +0 -141
  331. package/docs/session-config.md +0 -51
  332. package/docs/session-record.md +0 -58
  333. package/docs/skills.md +0 -65
  334. package/docs/telemetry.md +0 -66
  335. package/docs/testing.md +0 -35
  336. package/docs/vision-skills.md +0 -94
  337. package/docs/webhooks.md +0 -143
@@ -1,73 +0,0 @@
1
- {
2
- "brand": "aex",
3
- "productName": "Agent Executor",
4
- "oneLine": "aex is an agent execution platform for launching autonomous agents from a simple TypeScript SDK and CLI.",
5
- "description": "Open durable agent sessions, send turns, stream events, capture files, and compose agents with skills, files, MCP, secrets, networking controls, and subagents across the managed runtime.",
6
- "alpha": {
7
- "label": "Alpha testing",
8
- "description": "Access is limited to invited testers while we harden the hosted runtime, dashboard, and SDK workflows."
9
- },
10
- "installCommand": "npm i @aexhq/sdk",
11
- "examples": {
12
- "typescriptLines": [
13
- "import { Aex, Sizes } from \"@aexhq/sdk\";",
14
- "",
15
- "const aex = new Aex({ apiKey: process.env.AEX_API_KEY! });",
16
- "",
17
- "const session = await aex.sessions.create({",
18
- " model: \"anthropic/claude-haiku-4-5\",",
19
- " system: \"You are a concise engineering assistant.\",",
20
- " runtime: { size: Sizes.CPU_0_25_1GB },",
21
- " overrides: { idleTtl: \"3m\" }",
22
- "});",
23
- "",
24
- "const result = await session.messages.send(\"Write a short report and save it as a file.\").finished();",
25
- "console.log(result.status, result.text);"
26
- ],
27
- "cliLines": [
28
- "aex start \\",
29
- " --api-key \"$AEX_API_KEY\" \\",
30
- " --model anthropic/claude-haiku-4-5 \\",
31
- " --prompt \"Write a short report and save it as a file.\" \\",
32
- " --follow"
33
- ]
34
- },
35
- "featureAreas": [
36
- {
37
- "slug": "agent-runtime",
38
- "href": "/docs/features/#agent-runtime",
39
- "title": "Agent runtime",
40
- "description": "Managed autonomous sessions with filesystem read/edit, grep/glob/head/tail, open web fetch/search, background commands, code execution, git, and subagents."
41
- },
42
- {
43
- "slug": "durable-infrastructure",
44
- "href": "/docs/features/#durable-infrastructure",
45
- "title": "Durable infrastructure",
46
- "description": "Resumable session lifecycle, explicit run outcomes, committed checkpoints, idempotency, typed events, file capture, downloads, timeouts, and runtime sizes."
47
- },
48
- {
49
- "slug": "agent-composition",
50
- "href": "/docs/features/#agent-composition",
51
- "title": "Agent composition",
52
- "description": "Version-pinned skills, files, custom tools, instructions, remote MCP servers, environment variables, secrets, and networking controls."
53
- },
54
- {
55
- "slug": "subagents",
56
- "href": "/docs/features/#subagents",
57
- "title": "Subagents",
58
- "description": "Typed parent/child lineage for async child sessions, file handoff, and bounded agent delegation."
59
- },
60
- {
61
- "slug": "managed-model-access",
62
- "href": "/docs/features/#managed-model-access",
63
- "title": "Managed model access",
64
- "description": "Name any model by its Vercel AI Gateway `creator/model` slug — the platform's managed key routes it. No provider selection, no provider API keys."
65
- },
66
- {
67
- "slug": "typed-control-surface",
68
- "href": "/docs/features/#typed-control-surface",
69
- "title": "Typed control surface",
70
- "description": "Strongly typed SDK inputs, CLI parity, workspace secrets, assistant text modes, and file capture policy."
71
- }
72
- ]
73
- }
@@ -1,135 +0,0 @@
1
- ---
2
- title: Quickstart
3
- ---
4
-
5
- # Quickstart
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm i @aexhq/sdk
11
- ```
12
-
13
- Set an aex workspace key. Model access needs no provider key — the managed
14
- gateway routes every model:
15
-
16
- ```bash
17
- export AEX_API_KEY="<your-aex-api-key>"
18
- ```
19
-
20
- The workspace key needs `sessions:read`, `sessions:write`, and `files:read` for
21
- this workflow. Add `billing:read` when the application also reads cost and
22
- billing-account resources.
23
-
24
- ## Run a session
25
-
26
- ```ts
27
- import { Aex, Sizes } from "@aexhq/sdk";
28
-
29
- const aex = new Aex(process.env.AEX_API_KEY!);
30
- const session = await aex.sessions.create({
31
- model: "anthropic/claude-haiku-4-5",
32
- system: "You are a concise engineering assistant.",
33
- runtime: Sizes.CPU_0_25_1GB,
34
- });
35
-
36
- const run = session.messages.send("Write a short report and save it as a file.");
37
- for await (const event of run) {
38
- console.log(event.type, event.runId);
39
- }
40
-
41
- const result = await run.finished();
42
- console.log(result.status, result.costUsd, result.text);
43
- ```
44
-
45
- `finished()` resolves only after `RUN_FINISHED` or `RUN_ERROR`. A
46
- `RUN_FINISHED` result is checkpoint-consistent: its session record, cost,
47
- usage, messages, and files all reflect the same committed run. A `RUN_ERROR`
48
- that failed before a checkpoint has `files: []` and no `checkpoint`.
49
-
50
- Held outcomes remain explicit. `suspended` and `awaiting_approval` are not
51
- reported as successful runs, and `result.ok` is true only for `succeeded`.
52
-
53
- ## Reopen and continue
54
-
55
- ```ts
56
- const resumed = await aex.sessions.open(session.id);
57
- if (resumed.record.acceptsMessages) {
58
- await resumed.messages.send("Validate the report and summarize the result.").finished();
59
- }
60
- ```
61
-
62
- `record.currentRun` describes active work and `record.lastRun` describes the
63
- most recently completed or held run.
64
-
65
- ## Publish reusable inputs
66
-
67
- Workspace resources are versioned and immutable when submitted. Publish local
68
- drafts first, then pass the returned pinned refs under `assets`:
69
-
70
- ```ts
71
- import { File } from "@aexhq/sdk";
72
-
73
- const source = await aex.workspace.files.publish(
74
- await File.fromPath("./input.csv", { mountPath: "/workspace/input" })
75
- );
76
-
77
- const withInput = await aex.sessions.create({
78
- model: "anthropic/claude-haiku-4-5",
79
- assets: { files: [source] },
80
- builtinTools: "default",
81
- });
82
- ```
83
-
84
- The same pattern applies to `aex.workspace.skills`, `.tools`, and
85
- `.instructions`. Raw uploaded bytes are assets; workspace resources add typed,
86
- versioned meaning to those bytes.
87
-
88
- ## Read checkpointed files
89
-
90
- ```ts
91
- const completed = await withInput.messages.send("Create output/report.md").finished();
92
- const snapshot = await withInput.files.list({
93
- checkpointId: completed.checkpoint?.checkpointId
94
- });
95
-
96
- console.log(snapshot.revision, snapshot.files);
97
- const report = await withInput.files.findOne({ filename: "report.md" });
98
- if (report) {
99
- console.log((await withInput.files.read(report)).text);
100
- }
101
- ```
102
-
103
- Session file IDs are meaningful only with their checkpoint. File objects carry
104
- `checkpointId`, and ID selectors must include it.
105
-
106
- ## One-shot convenience
107
-
108
- `aex.start()` is the one retained convenience for create, send, and finish:
109
-
110
- ```ts
111
- const result = await aex.start({
112
- model: "anthropic/claude-haiku-4-5",
113
- message: "Summarize this repository.",
114
- });
115
-
116
- console.log(result.sessionId, result.status, result.text);
117
- ```
118
-
119
- The bundled CLI provides the same one-shot workflow:
120
-
121
- ```bash
122
- npx aex start \
123
- --api-key "$AEX_API_KEY" \
124
- --model anthropic/claude-haiku-4-5 \
125
- --prompt "Write a short report and save it as a file." \
126
- --follow
127
- ```
128
-
129
- ## Next
130
-
131
- - [Composition](concepts/composition.md)
132
- - [Events](events.md)
133
- - [Files](files.md)
134
- - [Webhooks](webhooks.md)
135
- - [Provider/runtime capabilities](provider-runtime-capabilities.md)
package/docs/release.md DELETED
@@ -1,44 +0,0 @@
1
- ---
2
- title: Release
3
- ---
4
-
5
- # Release
6
-
7
- The public release path is intentionally small:
8
-
9
- 1. Local pre-push runs lint and type checks only.
10
- 2. A push to `main` runs lint, type checks, and unit tests.
11
- 3. After those checks pass, CI tags the tested source as
12
- `canary/<version>-canary`, records the exact 40-character source SHA, and
13
- publishes `@aexhq/sdk@<version>-canary` to npm's `canary` dist-tag.
14
-
15
- The workflow checks out and verifies `github.sha`, writes that SHA into the
16
- packed package's `aexRelease.sourceSha` metadata, and verifies the same value
17
- against npm after publication. The package version is the base SDK version with
18
- `-canary` appended, for example `0.45.0-canary`. A version is immutable: if it
19
- already exists, fix forward by bumping the base SDK version and pushing again.
20
-
21
- The private platform repository receives the canary version and source SHA as
22
- manual deploy inputs. It owns dev/prd deployment and runs the same SDK-as-a-real-
23
- user suite against both Lambda and container runtimes in each plane.
24
-
25
- ## npm credentials
26
-
27
- The main-push publish job uses npm trusted-publisher OIDC in the `npm-release`
28
- GitHub Environment. It does not use a long-lived npm write token and never
29
- publishes directly to `latest`.
30
-
31
- ## What ships in the tarball
32
-
33
- The SDK tarball is self-contained. It declares zero `@aexhq/*` runtime
34
- dependencies and is installable from a clean Bun project with no workspace
35
- access:
36
-
37
- - `@aexhq/contracts` is copied into the SDK distribution at build time.
38
- - `@aexhq/cli` is bundled into `dist/cli.mjs`, exposed through the `aex` bin.
39
- - The offline user-test package checks these invariants before publication.
40
-
41
- ## Roll-forward
42
-
43
- Published versions are immutable. A bad canary is fixed by correcting the
44
- source, bumping the base version, and publishing a new canary.
package/docs/retries.md DELETED
@@ -1,108 +0,0 @@
1
- ---
2
- title: Retries and throttling
3
- ---
4
-
5
- # Retries and throttling
6
-
7
- The SDK retries transport failures only when repeating the HTTP request is
8
- provably safe:
9
-
10
- - Safe reads (`GET`, `HEAD`, and `OPTIONS`) may retry.
11
- - A mutation may retry only when it carries a stable `Idempotency-Key`.
12
- - A `POST`, `PATCH`, `PUT`, or `DELETE` without that key is attempted once.
13
-
14
- Eligible requests retry network failures and HTTP `429`, `500`, `502`, `503`,
15
- `504`, and `529` with bounded exponential backoff and jitter. `Retry-After` is
16
- honored. Validation, authentication, not-found, and conflict responses fail
17
- immediately.
18
-
19
- ```ts
20
- const aex = new Aex({
21
- apiKey: process.env.AEX_API_KEY!,
22
- retry: {
23
- maxAttempts: 4,
24
- initialDelayMs: 500,
25
- maxDelayMs: 20_000,
26
- maxElapsedMs: 120_000
27
- }
28
- });
29
- ```
30
-
31
- Use `retry: false` or `{ maxAttempts: 1 }` for one general transport attempt.
32
- The client policy applies both to hosted API requests and to direct
33
- object-storage PUTs performed while publishing file, skill, tool, and
34
- instruction assets.
35
-
36
- `session.files.fetch()` is deliberately lower level: it returns the raw
37
- `Response` from a signed file URL and does not retry that transfer. The bounded
38
- `session.files.read()` and `session.files.download()` helpers may repeat a safe
39
- file GET once only when their per-attempt transfer timeout expires. None of
40
- these transfer policies repeat an agent run.
41
-
42
- ## Application runs are not retried
43
-
44
- The SDK never reruns a whole user scenario after a terminal failure. A failed
45
- run is the product result a user would observe. Reliability belongs below that
46
- boundary, in idempotent transport, checkpointing, and the hosted runtime.
47
-
48
- When your application deliberately repeats a create or message mutation, reuse
49
- its idempotency key:
50
-
51
- ```ts
52
- const result = await aex.start({
53
- model,
54
- message: "Write the report.",
55
- idempotencyKey: "report-2026-07-10"
56
- });
57
- ```
58
-
59
- `Aex.start` derives a stable message key from the create key, so repeating the
60
- same call cannot create a second billable run. A changed request under the same
61
- key fails with an idempotency conflict. Explicit keys may contain at most 255
62
- characters. For a create key short enough to append `:message`, the derived key
63
- is readable as `<createKey>:message`; longer valid keys use a deterministic
64
- SHA-256-derived message key that remains within the same limit.
65
-
66
- For an explicit user-driven retry on an existing session, call
67
- `session.messages.replayLast()` after applying your own policy. It reuses the
68
- last message key by default.
69
-
70
- ## Throttling
71
-
72
- After eligible transport attempts are exhausted, the SDK throws
73
- `AexRateLimitError`. Use `isRateLimited(error)` and inspect `status`,
74
- `attempts`, `retryAfterMs`, `source`, and `providerFault`. Error bodies are
75
- scanned for secret shapes CLIENT-SIDE, inside your own process, before an
76
- `AexError` carries them (`redactSecrets`, exported from the SDK). Nothing is sent
77
- anywhere to do it, and it does not apply to your session's content — only to the
78
- error objects this SDK constructs.
79
-
80
- Provider failures are machine-readable on failed detail records as
81
- `session.providerFault` and on terminal events as
82
- `RUN_ERROR.data.providerFault`:
83
-
84
- ```ts
85
- const fault = result.session.providerFault;
86
- if (fault?.kind === "rate_limit" || fault?.kind === "overloaded") {
87
- // Apply an application-level replay policy if appropriate.
88
- }
89
- ```
90
-
91
- The canonical object has exact fields `provider?`, `kind`, `status?`,
92
- `retryAfterMs?`, and `message?`. Known kinds are `rate_limit`, `overloaded`,
93
- `quota_exceeded`, `unavailable`, and `provider_error`. The SDK treats only the
94
- first four as throttle signals. A valid future kind is preserved but is not a
95
- throttle until a later SDK explicitly recognizes it; status codes and prose do
96
- not override the kind.
97
-
98
- For sessions created by older runtimes that do not have the field, the SDK has
99
- a temporary compatibility bridge for the exact historical
100
- `transient-provider` failure class and exact historical terminal templates.
101
- It does not scan arbitrary error prose. With `debug` enabled, each bridge use
102
- emits one local line with code `legacy_provider_fault_fallback`; the line
103
- contains only the mapped kind and `source=session` — nothing else is included, so
104
- there is nothing in it to mask.
105
-
106
- The bridge is eligible for removal only in a separate major release, after at
107
- least two minor releases and 90 days with zero observed fallback use. That
108
- earliest review is 2026-10-20; removal is not part of this contract change.
package/docs/secrets.md DELETED
@@ -1,141 +0,0 @@
1
- ---
2
- title: Secrets
3
- ---
4
-
5
- # Secrets
6
-
7
- aex supports per-session credentials and reusable workspace secrets for your own
8
- code and MCP servers. Model access needs no provider key — the managed gateway
9
- routes every model. Secret values are excluded from the idempotency fingerprint
10
- and do not belong in session config.
11
-
12
- Runnable examples need only `AEX_API_KEY` for aex.
13
-
14
- ## Run A Model In One Session
15
-
16
- ### TypeScript
17
-
18
- ```ts
19
- import { Aex } from "@aexhq/sdk";
20
-
21
- const aex = new Aex({ apiKey: process.env.AEX_API_KEY! });
22
-
23
- await aex.start({
24
- model: "anthropic/claude-haiku-4-5",
25
- message: "Write a short report and save it as a file.",
26
- });
27
- ```
28
-
29
- ### CLI
30
-
31
- ```bash
32
- aex start \
33
- --api-key "$AEX_API_KEY" \
34
- --model anthropic/claude-haiku-4-5 \
35
- --prompt "Write a short report and save it as a file."
36
- ```
37
-
38
- ## Persist An Env Secret
39
-
40
- Create durable secrets through the workspace namespace, then reference the
41
- stored name in later sessions.
42
-
43
- ```ts
44
- import { Aex, Secret } from "@aexhq/sdk";
45
-
46
- const aex = new Aex({ apiKey: process.env.AEX_API_KEY! });
47
-
48
- await aex.workspace.secrets.set({
49
- name: "github-token",
50
- value: process.env.GITHUB_TOKEN!
51
- });
52
- const githubToken = Secret.ref("github-token");
53
-
54
- await aex.start({
55
- model: "anthropic/claude-haiku-4-5",
56
- message: "Inspect the repository issues.",
57
- environment: { secrets: { GITHUB_TOKEN: githubToken } },
58
- });
59
- ```
60
-
61
- ## Set Or Rotate A Workspace Secret
62
-
63
- Use `client.workspace.secrets.set(...)` to create a named secret directly. Use
64
- `client.workspace.secrets.rotate(...)` to replace its value while keeping the same name.
65
-
66
- ```ts
67
- await aex.workspace.secrets.set({
68
- name: "serper-api-key",
69
- value: process.env.SERPER_API_KEY!
70
- });
71
-
72
- await aex.workspace.secrets.rotate({
73
- name: "serper-api-key",
74
- value: process.env.SERPER_API_KEY_NEXT!
75
- });
76
- ```
77
-
78
- ## Retrieve Secret Metadata
79
-
80
- `list` and `get` return metadata only. They never return the secret value.
81
-
82
- ```ts
83
- const secrets = await aex.workspace.secrets.list();
84
- const metadata = await aex.workspace.secrets.get("serper-api-key");
85
- ```
86
-
87
- ## Inject A Workspace Secret Into A Session
88
-
89
- Reference workspace secrets with `Secret.ref(name)`. The value resolves
90
- server-side and is injected as the named environment variable.
91
-
92
- ```ts
93
- import { Secret } from "@aexhq/sdk";
94
-
95
- await aex.start({
96
- model: "anthropic/claude-haiku-4-5",
97
- message: "Use SERPER_API_KEY for web search.",
98
- environment: {
99
- secrets: { SERPER_API_KEY: Secret.ref("serper-api-key") }
100
- },
101
- });
102
- ```
103
-
104
- ## Delete A Workspace Secret
105
-
106
- ```ts
107
- await aex.workspace.secrets.delete("serper-api-key");
108
- ```
109
-
110
- The CLI supports per-session runtime and MCP credentials. Workspace secret
111
- administration is exposed through the SDK.
112
-
113
- ## What Happens To A Secret Value In Your Session
114
-
115
- aex does **not** scan, mask, or drop your session's content. A registered secret value
116
- that the agent prints, writes, or echoes appears **verbatim** in every surface you can
117
- read:
118
-
119
- - the **event stream** (tool output and model-authored text),
120
- - the **session journal** and `session.events` / the event archive,
121
- - **captured session files** (`session.files.download()` / `.read()` / the `aex download`
122
- zip),
123
- - the container's own stdout/stderr archive.
124
-
125
- All four are byte-identical, so nothing you read is a rewritten version of something
126
- else. That is deliberate: your session's data is yours, and a platform that silently
127
- rewrote your bytes would give you an artifact you cannot trust and a value we might have
128
- corrupted (a "secret-shaped" build hash or file path is indistinguishable from a
129
- credential to any scanner).
130
-
131
- What registering a secret via `environment.secrets` **does** give you:
132
-
133
- - the value is stored encrypted and injected into the session env at run time — it is
134
- never part of your submitted request body, and it is not written to your session
135
- config;
136
- - it is scoped to the session, and only the session's own process can fetch it;
137
- - it never reaches a customer-controlled subprocess it was not declared for.
138
-
139
- If a value must not appear in a transcript you keep or share, do not let the agent print
140
- it: prefer a tool that consumes the credential internally over one that echoes it, and
141
- review a session's output before forwarding it.
@@ -1,51 +0,0 @@
1
- ---
2
- title: Session configuration
3
- ---
4
-
5
- # Session configuration
6
-
7
- `aex.sessions.create(...)` accepts the durable session configuration. The
8
- one-shot `aex.start(...)` accepts the same fields plus `message`,
9
- `messageIdempotencyKey`, `deleteAfter`, and stream options.
10
-
11
- Core fields include:
12
-
13
- - `model` — a Vercel AI Gateway `creator/model` slug (no `provider` field)
14
- - `system`
15
- - immutable workspace refs grouped under `assets`
16
- - `builtinTools`
17
- - `mcpServers`
18
- - `environment`
19
- - `fileCapture`
20
- - `runtime`, `metadata`, and `overrides`
21
- - `outputMode`, `responseFormat`, `approvalGate`, and `webhook`
22
- - `idempotencyKey`
23
-
24
- Secrets are never part of a reusable JSON config. Model access needs no provider
25
- key; supply runtime secrets through `environment.secrets` at the call site.
26
-
27
- ```ts
28
- const base = {
29
- model: "anthropic/claude-haiku-4-5",
30
- system: "You are a concise automation agent.",
31
- builtinTools: "default" as const,
32
- overrides: { idleTtl: "3m", timeout: "30m", maxTurns: 20 }
33
- };
34
-
35
- const session = await aex.sessions.create({
36
- ...base,
37
- assets: { files: [input], instructions: [rules] },
38
- });
39
- ```
40
-
41
- `assets` accepts only refs returned by `aex.workspace.files`, `skills`, `tools`,
42
- and `instructions`. Publish local drafts before create; there is no implicit
43
- upload or compatibility field.
44
-
45
- ## CLI
46
-
47
- `aex start` accepts a credential-free JSON config through `--config`, or
48
- explicit flags such as `--model`, `--system`, `--prompt`, `--mcp`,
49
- `--runtime-size`, and `--session-timeout`. Reusable resources are published and
50
- attached with repeatable `--skill`, `--tool`, `--instructions`, and `--file`
51
- flags. The legacy instruction flag is not accepted.
@@ -1,58 +0,0 @@
1
- ---
2
- title: Session archives
3
- ---
4
-
5
- # Session archives
6
-
7
- `Session` is the one live state model returned by `aex.sessions.get(...)`,
8
- `session.refresh()`, and finished run results. A session archive is the
9
- public-safe downloadable bundle of that state, typed events, captured files,
10
- and versioned manifest metadata.
11
-
12
- ## Listing sessions
13
-
14
- `aex.sessions.list(query?)` enumerates the sessions in this workspace, most-recent first, one page at a time. The workspace is derived server-side from the API key, so this only ever returns your own sessions. It is the workspace-wide discovery entry point: open a row with `aex.sessions.open(id)`, then use `session.files.list()` / `.read(...)` (see [Files](files.md)) to reach that session's deliverables.
15
-
16
- ```ts
17
- let cursor: string | undefined;
18
- do {
19
- const page = await aex.sessions.list({ status: "idle", limit: 25, cursor });
20
- for (const session of page.sessions) {
21
- console.log(session.id, session.status, session.createdAt, session.costUsd);
22
- }
23
- cursor = page.nextCursor;
24
- } while (cursor);
25
- ```
26
-
27
- `query` fields are all optional: `status` (single session lifecycle status, e.g. `"idle"`), `since` (ISO-8601 lower bound on `createdAt`), `limit` (an integer from 1 through 100; default 25), and `cursor` (the opaque keyset cursor from a prior page's `nextCursor`, absent on the last page). Invalid values fail before the request. Each page row is a public-safe `SessionSummary` (`id`, `status`, `runtime`, `acceptsMessages`, `createdAt`, `updatedAt`, and `costUsd` once a RUN terminal is committed); it deliberately omits the submission snapshot (model / system / env). Use `aex.sessions.get(id)` or `session.record` for the canonical session read, and the `messages`, `events`, and `files` namespaces for authoritative run data.
28
-
29
- ## Downloading a session archive
30
-
31
- `session.download()` and `aex download <session-id>` return a zip with this layout:
32
-
33
- ```text
34
- manifest.json
35
- metadata/session.json
36
- metadata/submission.json # when a public-safe submission snapshot is returned by the read API
37
- metadata/cost.json # when public cost telemetry is returned by the read API
38
- events/events.jsonl
39
- files/<captured deliverable files>
40
- ```
41
-
42
- `manifest.json` is versioned as `SessionRecordManifestV1`:
43
-
44
- | Field | Meaning |
45
- | --- | --- |
46
- | `schemaVersion` | `aex.session-record.manifest.v1`. |
47
- | `sessionRecordSchemaVersion` | `aex.session-record.v1`. |
48
- | `sessionId` | The session the archive was assembled for. |
49
- | `namespaces[]` | The documented top-level namespaces: `metadata`, `events`, `files`. |
50
- | `files[]` | Inventory of expected and present files with `namespace`, `path`, `role`, and `status`. |
51
- | `sessionFiles[]` | Session file metadata for entries present under the `files/` namespace. |
52
- | `errors[]` | Per-artifact byte fetch failures during archive assembly. |
53
-
54
- Current v1 downloads always include `metadata/session.json` and `events/events.jsonl`. `events/events.jsonl` contains typed event-channel records only; internal diagnostics and full internal streams are not mixed into that file.
55
-
56
- `metadata/submission.json` is present only when the session read shape includes a public-safe submission snapshot. `metadata/cost.json` is present only when the session read shape includes public `costTelemetry`; otherwise cost stays `pending`. `metadata/custody.json` remains `pending` until the custody manifest writer and public read surface land. `events/manifest.json` remains `unavailable` in this client-side slice because there is no public coordinator-manifest download route.
57
-
58
- The record boundary is public-safe. It must not contain credentials, runner bearers, workspace tokens, signed URLs, raw provider response bodies, object-store keys, Vault ids, raw query strings, secret-shaped values, or internal diagnostic files. Session environment and MCP secrets are vaulted separately for the session lifetime.
package/docs/skills.md DELETED
@@ -1,65 +0,0 @@
1
- ---
2
- title: Skills
3
- ---
4
-
5
- # Skills
6
-
7
- A skill is a `SKILL.md` bundle plus optional supporting files. Build a local
8
- draft with a `Skill.from*` factory, publish it to the workspace, and attach the
9
- returned immutable ref under `assets.skills`.
10
-
11
- ```ts
12
- import { Skill } from "@aexhq/sdk";
13
-
14
- const draft = await Skill.fromDir("./skills/report-writer", {
15
- name: "report-writer"
16
- });
17
- const reportWriter = await aex.workspace.skills.publish(draft);
18
-
19
- const result = await aex.start({
20
- model,
21
- message: "Write the report.",
22
- assets: { skills: [reportWriter] }
23
- });
24
- ```
25
-
26
- Available draft factories:
27
-
28
- - `Skill.fromDir(path, { name? })`
29
- - `Skill.fromUrl(url, { name?, sha256?, timeoutMs?, fetch? })`
30
- - `Skill.fromFiles({ name?, files, meta? })`
31
- - `Skill.fromContent(skillMd, { name? })`
32
- - `Skill.fromBytes({ name?, zip })`
33
-
34
- Every bundle needs a root `SKILL.md` with a non-empty `description` in YAML
35
- frontmatter. Names are validated locally, and archives are canonicalized and
36
- content-hashed before publication.
37
-
38
- ## Immutable versions
39
-
40
- Publication returns a `WorkspaceSkillRecord` containing a stable `resourceId`,
41
- an immutable `version`, and the exact `assetId`/`contentHash`. Publishing new
42
- bytes creates another version. Existing session submissions remain pinned to
43
- their recorded version; they cannot silently observe later edits.
44
-
45
- Drafts cannot be submitted or serialized directly. This keeps the only
46
- promotion path visible and auditable:
47
-
48
- ```ts
49
- const published = await aex.workspace.skills.publish(draft);
50
- ```
51
-
52
- ## Workspace administration
53
-
54
- ```ts
55
- const page = await aex.workspace.skills.list({ limit: 100 });
56
- const exact = await aex.workspace.skills.get(published.resourceId, published.version);
57
- await aex.workspace.skills.delete(published.resourceId);
58
- ```
59
-
60
- List calls return `{ resources, nextCursor? }`. `limit` defaults to 100 and
61
- must be an integer from 1 through 100.
62
-
63
- Skills are distinct from custom tools. The runtime exposes skills through its
64
- skill-loading capability; executable custom functions belong in
65
- `assets.tools`.