@aexhq/sdk 0.46.5-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,69 +0,0 @@
1
- import { McpServer } from "./mcp-server.js";
2
- import { configError } from "./session-validate.js";
3
- export function fileCaptureForWire(fileCapture) {
4
- if (fileCapture === undefined) {
5
- return undefined;
6
- }
7
- const allowedDirs = fileCapture.allowedDirs?.filter((dir) => dir.length > 0);
8
- const deniedDirs = fileCapture.deniedDirs?.filter((dir) => dir.length > 0);
9
- const hasNumericOverride = fileCapture.captureTimeoutMs !== undefined ||
10
- fileCapture.maxFileBytes !== undefined ||
11
- fileCapture.maxTotalBytes !== undefined ||
12
- fileCapture.maxFiles !== undefined;
13
- if ((allowedDirs?.length ?? 0) === 0 && (deniedDirs?.length ?? 0) === 0 && !hasNumericOverride) {
14
- return undefined;
15
- }
16
- return {
17
- ...(allowedDirs && allowedDirs.length > 0 ? { allowedDirs } : {}),
18
- ...(deniedDirs && deniedDirs.length > 0 ? { deniedDirs } : {}),
19
- ...(fileCapture.captureTimeoutMs !== undefined ? { captureTimeoutMs: fileCapture.captureTimeoutMs } : {}),
20
- ...(fileCapture.maxFileBytes !== undefined ? { maxFileBytes: fileCapture.maxFileBytes } : {}),
21
- ...(fileCapture.maxTotalBytes !== undefined ? { maxTotalBytes: fileCapture.maxTotalBytes } : {}),
22
- ...(fileCapture.maxFiles !== undefined ? { maxFiles: fileCapture.maxFiles } : {})
23
- };
24
- }
25
- const DEFAULT_SESSION_IDLE_TTL = "3m";
26
- export function sessionRetentionForWire(options) {
27
- return {
28
- idleTtl: options.overrides?.idleTtl ?? DEFAULT_SESSION_IDLE_TTL
29
- };
30
- }
31
- export function sessionEnvironmentForWire(environment) {
32
- if (environment === undefined) {
33
- return undefined;
34
- }
35
- const { variables, secrets: _secrets, ...rest } = environment;
36
- void _secrets;
37
- const out = {
38
- ...rest,
39
- ...(variables !== undefined ? { envVars: variables } : {})
40
- };
41
- return Object.keys(out).length === 0 ? undefined : out;
42
- }
43
- export function mergeMcpServers(inputs, explicitSecrets) {
44
- const submissionMcpServers = [];
45
- const secretByName = new Map();
46
- for (const secret of explicitSecrets) {
47
- secretByName.set(secret.name, secret);
48
- }
49
- for (let i = 0; i < inputs.length; i++) {
50
- const entry = inputs[i];
51
- if (!(entry instanceof McpServer)) {
52
- throw configError("aex", `mcpServers[${i}]`, `mcpServers[${i}] must be an McpServer instance`);
53
- }
54
- submissionMcpServers.push(entry.toSubmissionEntry());
55
- const secret = entry.toSecretEntry();
56
- if (secret) {
57
- const existing = secretByName.get(secret.name);
58
- if (existing && existing.url !== secret.url) {
59
- throw configError("aex", `mcpServers[${i}].url`, `mcpServers[${i}].url conflicts with another MCP declaration`);
60
- }
61
- secretByName.set(secret.name, secret);
62
- }
63
- }
64
- return {
65
- submissionMcpServers,
66
- mergedMcpSecrets: Array.from(secretByName.values())
67
- };
68
- }
69
- //# sourceMappingURL=submission-wire.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"submission-wire.js","sourceRoot":"","sources":["../src/submission-wire.ts"],"names":[],"mappings":"A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,0 @@
1
- import { type ToolInputSchema, type ToolRef } from "./_contracts/index.js";
2
- import { type BundleMeta, type SkillFiles } from "./bundle.js";
3
- import type { IgnoreOptions } from "./node-walk.js";
4
- export interface ToolManifestInput {
5
- readonly name: string;
6
- readonly description: string;
7
- readonly inputSchema?: ToolInputSchema;
8
- readonly input_schema?: ToolInputSchema;
9
- readonly entry: string;
10
- }
11
- export declare class Tool {
12
- #private;
13
- private constructor();
14
- get ref(): DraftToolRef;
15
- get isDraft(): boolean;
16
- static fromFiles(args: ToolManifestInput & {
17
- readonly files: SkillFiles;
18
- readonly meta?: BundleMeta;
19
- }): Promise<Tool>;
20
- /**
21
- * Read a local tool bundle directory (`tool.json` at its root + support files).
22
- * The directory is walked with FIDELITY (the same walk `File.fromPath` uses):
23
- * `.aexignore` + the always-on defaults (`.git/`, `node_modules/`, …) prune the
24
- * upload, and executable bits + symlinks are captured into a `.aexmeta.json`
25
- * sidecar (emitted only when such metadata exists, so a pure-content tool dir
26
- * stays byte-identical → dedup continuity). Bun/Node filesystem runtimes only.
27
- */
28
- static fromPath(rootDir: string, args?: {
29
- readonly ignore?: IgnoreOptions;
30
- }): Promise<Tool>;
31
- _takeDraftBundle(): {
32
- ref: ToolRef;
33
- contentHash: string;
34
- bytes: Uint8Array;
35
- };
36
- toJSON(): never;
37
- }
38
- export interface DraftToolRef extends Omit<ToolRef, "kind"> {
39
- readonly kind: "draft";
40
- readonly contentHash: string;
41
- }
package/dist/tool.js DELETED
@@ -1,76 +0,0 @@
1
- import { normalizeToolManifest } from "./_contracts/internal.js";
2
- import { bundleToolFiles, hashSkillBundle } from "./bundle.js";
3
- import { readDirectoryWithFidelity } from "./node-fs.js";
4
- export class Tool {
5
- #ref;
6
- #inlineBytes;
7
- constructor(ref, inlineBytes) {
8
- this.#ref = ref;
9
- this.#inlineBytes = inlineBytes;
10
- }
11
- get ref() {
12
- return this.#ref;
13
- }
14
- get isDraft() {
15
- return true;
16
- }
17
- static async fromFiles(args) {
18
- if (!args || typeof args !== "object") {
19
- throw new Error("Tool.fromFiles: args is required");
20
- }
21
- const manifest = normalizeToolManifest("Tool.fromFiles", args, args.files);
22
- const bundled = bundleToolFiles(args.files, manifest, args.meta);
23
- const contentHash = await hashSkillBundle(bundled.zip);
24
- const ref = {
25
- kind: "draft",
26
- assetId: `asset_${contentHash.slice("sha256:".length)}`,
27
- contentHash,
28
- ...manifest
29
- };
30
- return new Tool(ref, bundled.zip);
31
- }
32
- /**
33
- * Read a local tool bundle directory (`tool.json` at its root + support files).
34
- * The directory is walked with FIDELITY (the same walk `File.fromPath` uses):
35
- * `.aexignore` + the always-on defaults (`.git/`, `node_modules/`, …) prune the
36
- * upload, and executable bits + symlinks are captured into a `.aexmeta.json`
37
- * sidecar (emitted only when such metadata exists, so a pure-content tool dir
38
- * stays byte-identical → dedup continuity). Bun/Node filesystem runtimes only.
39
- */
40
- static async fromPath(rootDir, args) {
41
- const { files, meta } = await readDirectoryWithFidelity(rootDir, args?.ignore);
42
- const rawManifest = files["tool.json"];
43
- if (rawManifest === undefined) {
44
- throw new Error('Tool.fromPath: tool.json is required at the tool bundle root');
45
- }
46
- const text = typeof rawManifest === "string" ? rawManifest : new TextDecoder().decode(rawManifest);
47
- let parsed;
48
- try {
49
- parsed = JSON.parse(text);
50
- }
51
- catch (err) {
52
- throw new Error(`Tool.fromPath: tool.json is not valid JSON: ${err.message}`);
53
- }
54
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
55
- throw new Error("Tool.fromPath: tool.json must be an object");
56
- }
57
- const { ["tool.json"]: _manifest, ...bundleFiles } = files;
58
- return Tool.fromFiles({
59
- ...parsed,
60
- files: bundleFiles,
61
- meta
62
- });
63
- }
64
- _takeDraftBundle() {
65
- const { kind: _kind, contentHash, ...ref } = this.#ref;
66
- return {
67
- ref: { kind: "asset", ...ref },
68
- contentHash,
69
- bytes: this.#inlineBytes
70
- };
71
- }
72
- toJSON() {
73
- throw new Error("Tool drafts cannot be submitted directly; publish with aex.workspace.tools.publish(...)");
74
- }
75
- }
76
- //# sourceMappingURL=tool.js.map
package/dist/tool.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACL,eAAe,EACf,eAAe,EAIhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAWzD,MAAM,OAAO,IAAI;IACN,IAAI,CAAe;IACnB,YAAY,CAAa;IAElC,YAAoB,GAAiB,EAAE,WAAuB;QAC5D,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,CACpB,IAAoF;QAEpF,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvD,MAAM,GAAG,GAAiB;YACxB,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,SAAS,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACvD,WAAW;YACX,GAAG,QAAQ;SACZ,CAA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AE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QACvD,OAAO;YACL,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,GAAG,EAAE;YAC9B,WAAW;YACX,KAAK,EAAE,IAAI,CAAC,YAAY;SACzB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAC;IAC7G,CAAC;CACF"}
package/dist/version.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Single source of truth for the SDK version exposed at runtime.
3
- *
4
- * Must match `packages/sdk/package.json`'s `version` field — a unit
5
- * test asserts this. Bump both on every release.
6
- *
7
- * Used by the (future) User-Agent header on outbound SDK requests.
8
- */
9
- export declare const SDK_VERSION = "0.46.5-canary";
package/dist/version.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Single source of truth for the SDK version exposed at runtime.
3
- *
4
- * Must match `packages/sdk/package.json`'s `version` field — a unit
5
- * test asserts this. Bump both on every release.
6
- *
7
- * Used by the (future) User-Agent header on outbound SDK requests.
8
- */
9
- export const SDK_VERSION = "0.46.5-canary";
10
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC"}
@@ -1,125 +0,0 @@
1
- ---
2
- title: Authentication
3
- ---
4
-
5
- # Authentication
6
-
7
- Every SDK and CLI call authenticates with an **aex API key**: a bearer
8
- credential that is **workspace-scoped** — the workspace is derived server-side
9
- from the token, so there is no workspace parameter anywhere in the API. A
10
- request either carries a valid token for a workspace or it is rejected with
11
- `401 unauthorized` (see [Errors](errors.md)).
12
-
13
- ## Getting a token (invite-only beta)
14
-
15
- aex is currently in **invite-only beta**. Workspaces and their initial API
16
- tokens are provisioned by the aex team — contact <support@aex.dev> for beta
17
- access. Once your workspace exists, you can create and delete additional tokens
18
- in the dashboard at <https://aex.dev>.
19
-
20
- ## Using a token
21
-
22
- Pass the token to the SDK constructor, the CLI's `--api-key` flag, or persist
23
- it once with `aex login`:
24
-
25
- ```ts
26
- import { Aex } from "@aexhq/sdk";
27
-
28
- const aex = new Aex(process.env.AEX_API_KEY!);
29
- ```
30
-
31
- ```bash
32
- npx aex whoami --api-key "$AEX_API_KEY"
33
-
34
- # or persist it once, then omit --api-key on later commands:
35
- npx aex login --api-key "$AEX_API_KEY"
36
- npx aex whoami
37
- ```
38
-
39
- (`new Aex(apiKey)` is the canonical constructor; the equivalent options form is
40
- documented once in [Credentials](credentials.md).)
41
-
42
- The token travels as a standard `Authorization: Bearer` header. Treat it like
43
- any other secret: keep it in environment variables or a secret manager, never
44
- in session config, prompts, or committed files.
45
-
46
- ## Plane routing and the `baseUrl` guard
47
-
48
- An aex API key is **self-describing**: it embeds the plane (`dev` / `prd`) and
49
- region it was minted for. The constructor parses the key and routes accordingly,
50
- with **zero network**:
51
-
52
- - **Omit `baseUrl`** and the key routes to its canonical hosted API plane:
53
- `prd` keys route to `https://api.aex.dev`, and `dev` keys route to
54
- `https://dev-api.aex.dev`.
55
- - **Supply a `baseUrl` whose plane disagrees with the key** (e.g. a `dev` key
56
- pointed at `https://api.aex.dev`) and the constructor throws
57
- `CredentialValidationError` **before any request** — you no longer discover the
58
- mismatch as a late `401 token_invalid` after a full round-trip.
59
-
60
- ```ts
61
- // prd key → routes to https://api.aex.dev automatically:
62
- const prd = new Aex(process.env.AEX_PRD_KEY!);
63
-
64
- // dev key → routes to https://dev-api.aex.dev automatically:
65
- const dev = new Aex(process.env.AEX_DEV_KEY!);
66
- ```
67
-
68
- ## Scopes
69
-
70
- A token carries a set of **scopes**; every API route requires one, and a token
71
- that lacks the route's scope fails with `403 insufficient_scope` naming the
72
- missing scope. The customer-grantable scopes:
73
-
74
- | Scope | Grants |
75
- | --- | --- |
76
- | `sessions:read` | Read sessions, their events and event archives, and webhook delivery ledgers. |
77
- | `sessions:write` | Create sessions, send messages, suspend/resume, redeliver webhooks, reveal the webhook signing secret. |
78
- | `sessions:cancel` | Cancel a session/run. |
79
- | `sessions:delete` | Delete a session and its record. |
80
- | `files:read` | Read captured session files and reusable workspace-file metadata. |
81
- | `files:write` / `files:delete` | Publish and delete reusable workspace-file resources. |
82
- | `assets:write` | Upload content-addressed bytes before publishing a typed workspace resource. |
83
- | `assets:delete` | Delete unreferenced content-addressed bytes. |
84
- | `skills:read` / `skills:write` / `skills:delete` | Administer workspace skills. |
85
- | `tools:read` / `tools:write` / `tools:delete` | Administer workspace custom tools. |
86
- | `instructions:read` / `instructions:write` / `instructions:delete` | Administer workspace instructions. |
87
- | `secrets:read` | List workspace secrets and read their metadata (never values). |
88
- | `secrets:write` | Create, rotate, and delete workspace secrets. |
89
- | `mcp:read` | List and read workspace MCP server configurations. |
90
- | `mcp:write` | Create workspace MCP server configurations. |
91
- | `mcp:delete` | Delete workspace MCP server configurations. |
92
- | `billing:read` | Read billing state and create hosted billing sessions. |
93
- | `workspaces:delete` | Owner self-service workspace hard-erase. |
94
-
95
- A typical automation token carries `sessions:read`, `sessions:write`, and
96
- `files:read`, plus the resource scopes it publishes. Grant the rest only where the workload needs them — a read-only
97
- reporting token, for example, needs no `sessions:write`.
98
-
99
- ## Introspection: `whoami`
100
-
101
- `aex.whoami()` (CLI: `aex whoami`) validates the token and returns the
102
- workspace id, the token's scopes, and — on current platform deployments — a
103
- `limits` object with the workspace's effective admission caps
104
- (`maxConcurrentSessions`, `submitRatePerMinute`, `spendCapUsd`, `monthSpendUsd`,
105
- `balanceUsd`, `balanceGraceFloorUsd`, `paymentMethodStatus`), resolved by the
106
- same code the submit gates enforce. Use it as a cheap credential check and to
107
- anticipate `429`/`402` rejections before submitting — see
108
- [Limits & quotas](limits-and-quotas.md) and [Errors](errors.md).
109
-
110
- ## Rotation and revocation
111
-
112
- - **Rotate** by creating a new token in the dashboard, switching your
113
- deployment to it, then deleting the old one. Tokens are independent — both
114
- stay valid during the switch, so rotation needs no downtime.
115
- - **Revoke** by deleting the token in the dashboard; deletion takes effect
116
- immediately (allow up to a minute for in-flight caches to expire).
117
- - Token create/delete are rate-limited per workspace (see
118
- [Limits & quotas](limits-and-quotas.md)).
119
- - If you cannot reach the dashboard (or suspect workspace-level compromise),
120
- contact <support@aex.dev>.
121
-
122
- Model access needs no provider key of your own — the platform's managed gateway
123
- key serves every run. Runtime secrets your code and MCP servers need are a
124
- separate, per-call surface — see [Credentials](credentials.md) and
125
- [Secrets](secrets.md).
package/docs/billing.md DELETED
@@ -1,164 +0,0 @@
1
- ---
2
- title: Billing & webhook signing secret
3
- ---
4
-
5
- # Billing & webhook signing secret
6
-
7
- Workspace-level billing and webhook verification calls are token-scoped like
8
- every other client call — the workspace is derived server-side from the API key.
9
-
10
- The billing reads — `aex.billing()`, `aex.billingLedger()`, and the CLI
11
- `aex billing` (and its `ledger` sub-verb) — require the **`billing:read`**
12
- scope; a token without it fails with `403 insufficient_scope` (see
13
- [Errors](errors.md)). This is why the [Quickstart](quickstart.md) mints
14
- `billing:read` alongside `sessions:read` / `sessions:write` / `files:read`.
15
-
16
- ## How you are charged
17
-
18
- There are no plans. Every workspace gets a **free monthly allowance in each
19
- metered dimension**, which resets at the start of each UTC month; usage past an
20
- allowance is paid for out of **prepaid credit**. A card is optional — without
21
- one, work stops when the model-usage allowance runs out.
22
-
23
- ## Read the billing summary
24
-
25
- `aex.billing()` returns the prepaid balance, current-month spend, the spend cap
26
- enforced on new sessions, this period's allowances, the auto-recharge settings
27
- and the saved card:
28
-
29
- ```ts
30
- import { Aex } from "@aexhq/sdk";
31
-
32
- const aex = new Aex(process.env.AEX_API_KEY!);
33
- const billing = await aex.billing();
34
-
35
- console.log(billing.balanceUsd, billing.monthSpendUsd, billing.spendCapUsd);
36
- for (const allowance of billing.allowances) {
37
- console.log(`${allowance.label}: ${allowance.remaining} of ${allowance.quota} ${allowance.unit} left`);
38
- }
39
- ```
40
-
41
- `billing.admissionState` is `"free"` (no card), `"carded_manual"` or
42
- `"carded_auto"` — card presence is the only lever. The returned
43
- `BillingSummary` is additive-tolerant: fields a newer deployment reports that
44
- this SDK version does not know yet pass through on the object instead of being
45
- rejected.
46
-
47
- CLI equivalent:
48
-
49
- ```bash
50
- aex billing # balance / month spend / spend cap / allowances
51
- aex billing --json # the raw wire body for scripting
52
- ```
53
-
54
- ## Buy prepaid credit
55
-
56
- `aex.billingTopup({ amountUsd })` creates a hosted checkout session. Open the
57
- returned URL in a browser; the same flow saves the card on first use, and the
58
- balance moves once the charge settles.
59
-
60
- ```ts
61
- const { url } = await aex.billingTopup({
62
- amountUsd: 25
63
- }, {
64
- idempotencyKey: crypto.randomUUID()
65
- });
66
- console.log(url);
67
- ```
68
-
69
- Amounts below the published minimum are refused — read it from
70
- `billing.autoTopup.minimumAmountUsd` rather than hard-coding a figure.
71
-
72
- The optional second argument identifies the mutation and is sent only as the
73
- `Idempotency-Key` header. When omitted, the SDK generates one before transport
74
- retries begin and reuses it for every attempt.
75
-
76
- ## Auto-recharge
77
-
78
- `aex.billingAutoTopup(...)` turns automatic top-ups on and sets the trigger and
79
- the amount. It is **off by default** and stays off until you ask for it: a saved
80
- card is not consent to a standing charge. Enabling it requires a saved card, and
81
- `thresholdUsd` must stay strictly below `amountUsd`.
82
-
83
- ```ts
84
- const { autoTopup } = await aex.billingAutoTopup({
85
- enabled: true,
86
- thresholdUsd: 5,
87
- amountUsd: 20
88
- });
89
- console.log(autoTopup.enabled, autoTopup.maxPerDay);
90
- ```
91
-
92
- Omitted fields keep their stored value. `autoTopup.maxPerDay` is the cap on
93
- successful automatic recharges in a rolling 24 hours — a runaway workload trips
94
- it rather than draining the card.
95
-
96
- `aex.billingPortal()` creates a hosted billing portal session for the workspace:
97
-
98
- ```ts
99
- const { url } = await aex.billingPortal(
100
- { returnUrl: "https://aex.dev/billing" },
101
- { idempotencyKey: crypto.randomUUID() }
102
- );
103
- console.log(url);
104
- ```
105
-
106
- CLI equivalents:
107
-
108
- ```bash
109
- aex billing topup 25 --idempotency-key "$KEY"
110
- aex billing autotopup --enable --threshold 5 --amount 20
111
- aex billing portal --idempotency-key "$KEY"
112
- ```
113
-
114
- ## Read the credit ledger
115
-
116
- `aex.billingLedger({ limit })` returns recent credit-ledger rows, newest first —
117
- top-ups, adjustments, and run charges with signed `amountUsd` (credits positive,
118
- charges negative). The ledger holds cash only: free allowances are quantities and
119
- never appear as ledger rows. `limit` is clamped server-side to [1, 100] (default
120
- 25); the read is not cursor-paged.
121
-
122
- ```ts
123
- const { entries } = await aex.billingLedger({ limit: 50 });
124
- for (const entry of entries) {
125
- console.log(entry.createdAt, entry.entryType, entry.amountUsd);
126
- }
127
- ```
128
-
129
- CLI equivalent:
130
-
131
- ```bash
132
- aex billing ledger --limit 50 # JSON rows, newest first
133
- ```
134
-
135
- ## Reveal the webhook signing secret
136
-
137
- Session webhooks are signed Standard-Webhooks style with a per-workspace secret.
138
- `aex.webhookSigningSecret()` reveals it (creating one on first use) as the
139
- `whsec_<base64>` string that `verifyAexWebhook` takes as `secret`:
140
-
141
- ```ts
142
- import { Aex, verifyAexWebhook } from "@aexhq/sdk";
143
-
144
- const aex = new Aex(process.env.AEX_API_KEY!);
145
- const { whsec } = await aex.webhookSigningSecret();
146
-
147
- // In your webhook receiver:
148
- const verified = await verifyAexWebhook({
149
- rawBody, // the exact request body bytes as a string
150
- headers, // the inbound request headers
151
- secret: whsec
152
- });
153
- ```
154
-
155
- Repeat calls return the SAME value — the hosted API does not rotate the
156
- signing secret. Treat the reveal as sensitive: store it in your secret manager
157
- and never log it.
158
-
159
- CLI equivalent (prints the bare `whsec_...` string, pipeable into a secret
160
- store; the reveal never goes to stderr or debug traces):
161
-
162
- ```bash
163
- aex webhooks secret
164
- ```
package/docs/cleanup.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: Cleanup
3
- ---
4
-
5
- # Cleanup
6
-
7
- aex owns runtime cleanup after a run ends. This internal work is not a public
8
- session lifecycle state and is not represented by a synthetic `cleanupStatus`
9
- field. A terminal RUN event means the run's checkpoint, files, billing, and
10
- public read model are consistent; explicit session deletion remains a separate
11
- operation.
12
-
13
- The hosted product uses managed runtimes for all supported providers. Reusable
14
- provider-session retention is not a supported session option, and the removed
15
- retention field is rejected if supplied.
16
-
17
- ```ts
18
- import { } from "@aexhq/sdk";
19
-
20
- await aex.start({
21
- model: "anthropic/claude-haiku-4-5",
22
- message: "...",
23
- });
24
- ```
25
-
26
- Session sequencing is exposed only through `currentRun` and `lastRun`. Use
27
- `session.delete()` when the session itself should be deleted.
@@ -1,47 +0,0 @@
1
- ---
2
- title: Agent tools
3
- description: Select builtin capabilities and attach published custom tools.
4
- icon: TerminalSquare
5
- ---
6
-
7
- `builtinTools` controls platform-provided capabilities:
8
-
9
- - `"default"` enables the standard set and is the default.
10
- - `"none"` disables all builtin tools.
11
- - An array such as `[BuiltinTools.bash, BuiltinTools.read_file]` selects an
12
- explicit subset.
13
-
14
- Custom tools are workspace resources. Build and publish them, then attach the
15
- returned ref under `assets.tools`.
16
-
17
- ```ts
18
- import { BuiltinTools, Tool } from "@aexhq/sdk";
19
-
20
- const draft = await Tool.fromFiles({
21
- name: "lookup_metric",
22
- description: "Looks up one metric.",
23
- inputSchema: {
24
- type: "object",
25
- properties: { name: { type: "string" } },
26
- required: ["name"]
27
- },
28
- entry: "index.js",
29
- files: {
30
- "index.js": "export default async ({ input }) => ({ content: [{ type: 'text', text: input.name }] });"
31
- }
32
- });
33
- const lookup = await aex.workspace.tools.publish(draft);
34
-
35
- await aex.start({
36
- model,
37
- message: "Look up revenue and save the result.",
38
- builtinTools: [BuiltinTools.write_file],
39
- assets: { tools: [lookup] }
40
- });
41
- ```
42
-
43
- Tool entries must be `.js`, `.mjs`, or `.cjs` modules present in the bundle.
44
- The SDK validates the manifest before any network request.
45
-
46
- Use `mcpServers` for remote MCP tools. The final runtime tool set consists of
47
- the selected builtins, pinned custom tools, and declared MCP tools.
@@ -1,60 +0,0 @@
1
- ---
2
- title: Composition
3
- description: Publish reusable workspace resources and pin them to sessions.
4
- icon: Blocks
5
- ---
6
-
7
- Files, skills, custom tools, and instructions follow one lifecycle:
8
-
9
- 1. Build a local draft with `File`, `Skill`, `Tool`, or `Instructions`.
10
- 2. Publish it through `aex.workspace.<kind>.publish(...)`.
11
- 3. Pass the returned immutable, version-pinned ref under `assets`.
12
-
13
- ```ts
14
- import { Aex, File, Instructions, Skill } from "@aexhq/sdk";
15
-
16
- const aex = new Aex({ apiKey: process.env.AEX_API_KEY! });
17
- const [input, rules, reportWriter] = await Promise.all([
18
- File.fromPath("./input").then((draft) => aex.workspace.files.publish(draft)),
19
- Instructions.fromContent("Follow the repository conventions.", { name: "repo-rules" })
20
- .then((draft) => aex.workspace.instructions.publish(draft)),
21
- Skill.fromDir("./skills/report-writer", { name: "report-writer" })
22
- .then((draft) => aex.workspace.skills.publish(draft))
23
- ]);
24
-
25
- await aex.start({
26
- model: "anthropic/claude-haiku-4-5",
27
- message: "Use the attached material to produce a report.",
28
- assets: {
29
- files: [input],
30
- instructions: [rules],
31
- skills: [reportWriter]
32
- },
33
- });
34
- ```
35
-
36
- Published refs contain `resourceId`, `version`, `assetId`, and `contentHash`.
37
- Changing a logical resource creates a new version; an existing session remains
38
- pinned to the exact bytes it received.
39
-
40
- An `Instructions` name is the persisted workspace resource name supplied by
41
- the caller. It is preserved exactly—never trimmed, lowercased, or otherwise
42
- normalized—and must be 1–128 ASCII characters: an alphanumeric first character,
43
- then alphanumeric characters, `.`, `_`, or `-`. The `__` sequence is reserved.
44
- This direct-name contract is deliberately different from `File`, which accepts
45
- a filename-shaped input and derives a shorter lowercase storage slug while
46
- preserving the real mounted filename.
47
-
48
- Builtin capabilities stay in `builtinTools`, and remote MCP servers stay in
49
- `mcpServers`. Neither is mixed into `assets.tools`.
50
-
51
- Workspace lists are cursor paged:
52
-
53
- ```ts
54
- const page = await aex.workspace.files.list({ limit: 100 });
55
- const next = page.nextCursor
56
- ? await aex.workspace.files.list({ cursor: page.nextCursor, limit: 100 })
57
- : undefined;
58
- ```
59
-
60
- The default and maximum page size are both 100.