@aexhq/sdk 0.33.1 → 0.35.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 (81) hide show
  1. package/README.md +19 -27
  2. package/dist/_contracts/operations.d.ts +2 -54
  3. package/dist/_contracts/operations.js +2 -87
  4. package/dist/_contracts/run-config.d.ts +19 -13
  5. package/dist/_contracts/run-config.js +6 -33
  6. package/dist/_contracts/run-unit.d.ts +1 -33
  7. package/dist/_contracts/run-unit.js +2 -21
  8. package/dist/_contracts/runtime-sizes.d.ts +2 -2
  9. package/dist/_contracts/runtime-sizes.js +2 -2
  10. package/dist/_contracts/status.d.ts +2 -2
  11. package/dist/_contracts/status.js +3 -0
  12. package/dist/_contracts/submission.d.ts +80 -41
  13. package/dist/_contracts/submission.js +114 -52
  14. package/dist/agents-md.d.ts +5 -5
  15. package/dist/agents-md.js +7 -7
  16. package/dist/agents-md.js.map +1 -1
  17. package/dist/asset-upload.d.ts +4 -4
  18. package/dist/asset-upload.js +4 -4
  19. package/dist/bundle.d.ts +2 -2
  20. package/dist/bundle.js +2 -2
  21. package/dist/cli.mjs +369 -12918
  22. package/dist/cli.mjs.sha256 +1 -1
  23. package/dist/client.d.ts +234 -383
  24. package/dist/client.js +436 -648
  25. package/dist/client.js.map +1 -1
  26. package/dist/data-tools.d.ts +25 -22
  27. package/dist/data-tools.js +75 -62
  28. package/dist/data-tools.js.map +1 -1
  29. package/dist/fetch-archive.js +16 -16
  30. package/dist/fetch-archive.js.map +1 -1
  31. package/dist/file.d.ts +5 -5
  32. package/dist/file.js +7 -7
  33. package/dist/file.js.map +1 -1
  34. package/dist/index.d.ts +11 -9
  35. package/dist/index.js +20 -13
  36. package/dist/index.js.map +1 -1
  37. package/dist/mcp-server.d.ts +4 -4
  38. package/dist/mcp-server.js +4 -4
  39. package/dist/proxy-endpoint.d.ts +4 -4
  40. package/dist/proxy-endpoint.js +1 -1
  41. package/dist/retry.d.ts +162 -0
  42. package/dist/retry.js +320 -0
  43. package/dist/retry.js.map +1 -0
  44. package/dist/secret.d.ts +8 -8
  45. package/dist/secret.js +8 -8
  46. package/dist/secret.js.map +1 -1
  47. package/dist/skill-tool.d.ts +102 -0
  48. package/dist/skill-tool.js +190 -0
  49. package/dist/skill-tool.js.map +1 -0
  50. package/dist/tool.d.ts +1 -1
  51. package/dist/tool.js +3 -3
  52. package/dist/tool.js.map +1 -1
  53. package/dist/version.d.ts +1 -1
  54. package/dist/version.js +1 -1
  55. package/docs/cleanup.md +3 -3
  56. package/docs/concepts/agent-tools.md +6 -25
  57. package/docs/concepts/composition.md +15 -12
  58. package/docs/concepts/providers-and-runtimes.md +3 -3
  59. package/docs/concepts/runs.md +27 -22
  60. package/docs/credentials.md +52 -84
  61. package/docs/defaults.md +6 -6
  62. package/docs/events.md +65 -44
  63. package/docs/limits-and-quotas.md +3 -4
  64. package/docs/mcp.md +3 -3
  65. package/docs/networking.md +8 -8
  66. package/docs/outputs.md +44 -40
  67. package/docs/provider-runtime-capabilities.md +1 -1
  68. package/docs/public-surface.json +2 -2
  69. package/docs/quickstart.md +20 -10
  70. package/docs/retries.md +129 -0
  71. package/docs/run-config.md +12 -14
  72. package/docs/run-record.md +8 -8
  73. package/docs/secrets.md +16 -26
  74. package/docs/skills.md +55 -110
  75. package/docs/vision-skills.md +29 -40
  76. package/examples/chat-corpus.ts +8 -9
  77. package/examples/feature-tour.ts +301 -0
  78. package/package.json +1 -1
  79. package/dist/skill.d.ts +0 -149
  80. package/dist/skill.js +0 -198
  81. package/dist/skill.js.map +0 -1
package/dist/skill.d.ts DELETED
@@ -1,149 +0,0 @@
1
- import { type AssetRef, type FetchLike, type SkillRef } from "./_contracts/index.js";
2
- import { type SkillFiles } from "./bundle.js";
3
- /**
4
- * One `Skill` class for skill bytes. `client.submit` materializes the bytes
5
- * as an uploaded asset before the run lands; the wire ref becomes
6
- * `kind:"asset"`.
7
- *
8
- * Build from an inline files map (`Skill.fromFiles`), a local directory
9
- * (`Skill.fromPath`), or a remote zip archive over a signed URL
10
- * (`Skill.fromUrl`). All three converge on the same canonical bundle, so
11
- * identical content dedups across sources.
12
- *
13
- * Asset deduplication makes the same bytes a no-op upload on subsequent runs.
14
- * There is no `Skill.fromId(...)`. A URL is an ingestion source, not a
15
- * persistent reference.
16
- *
17
- * An inline draft is auto-staged to the content-addressable asset store at
18
- * submit time (the bytes upload before `POST /runs`; the wire ref becomes
19
- * `kind:"asset"`). Call `await skill.upload(client)` to pre-stage the bytes
20
- * explicitly — useful when you want to reuse the resulting `kind:"asset"`
21
- * Skill across multiple runs.
22
- */
23
- export declare class Skill {
24
- #private;
25
- /**
26
- * Internal constructor. Use `Skill.fromFiles` or `Skill.fromPath` to create
27
- * instances.
28
- */
29
- private constructor();
30
- /**
31
- * The wire-level reference. Returns the SDK-private draft shape for
32
- * un-materialized skills (kind:"draft", with name + contentHash).
33
- * `client.submit` walks these and uploads them before the run
34
- * lands.
35
- */
36
- get ref(): AssetRef | DraftSkillRef;
37
- /** True for local-bytes Skills that haven't been uploaded yet. */
38
- get isDraft(): boolean;
39
- /** Internal: the asset id resolved on a prior submit, or undefined. */
40
- get _cachedAssetId(): string | undefined;
41
- /** Internal: remember the asset id resolved for this draft's bytes. */
42
- _rememberAsset(assetId: string): void;
43
- /**
44
- * Build a draft Skill from an inline files map. The SDK validates
45
- * basic safety (no path traversal, size caps, has `SKILL.md`),
46
- * deterministically zips the bundle, and computes the
47
- * `sha256:<hex>` content hash. `client.submit` materializes
48
- * these before the run lands.
49
- */
50
- static fromFiles(args: {
51
- readonly name: string;
52
- readonly files: SkillFiles;
53
- }): Promise<Skill>;
54
- /**
55
- * Read a local directory and build a draft Skill. Symlinks and
56
- * non-regular files are skipped. Bun/Node filesystem runtimes only.
57
- */
58
- static fromPath(rootDir: string, args: {
59
- readonly name: string;
60
- }): Promise<Skill>;
61
- /**
62
- * Fetch a zip-archived skill from a URL and build a draft Skill. The archive
63
- * is downloaded in the SDK process, so the URL is caller-controlled — host
64
- * the skill yourself and pass a temporary signed URL (e.g. an S3 presigned
65
- * URL). Its bytes are optionally integrity-checked against `sha256`, unzipped,
66
- * and reduced to the same files map as `Skill.fromFiles` — so a URL-sourced
67
- * skill and the identical local skill produce the same canonical asset and
68
- * dedup against each other.
69
- *
70
- * The archive must contain `SKILL.md` at its root, or inside a single
71
- * top-level folder (which is stripped). The signed URL only needs to be valid
72
- * for this call; `client.submit` snapshots the bytes into the run.
73
- *
74
- * Universal (Bun / Node 18+ / browser): requires a global `fetch`, or pass one.
75
- */
76
- static fromUrl(url: string, args: {
77
- readonly name: string;
78
- readonly sha256?: string;
79
- readonly timeoutMs?: number;
80
- readonly fetch?: FetchLike;
81
- }): Promise<Skill>;
82
- /**
83
- * Reference a skill already uploaded to the workspace catalog
84
- * (`aex skills upload`) in a run.
85
- *
86
- * A catalog skill's bytes are a content-addressed asset, so referencing it
87
- * is just an `{ kind:"asset" }` ref — once a run snapshots the bytes, it is
88
- * the identical normalized flow as an inline or file-sourced skill. Pass the
89
- * `Skill` record returned by `client.skills.list()` / `.get()`:
90
- *
91
- * const [s] = await client.skills.list();
92
- * await client.submit({ ..., skills: [Skill.fromCatalog(s)] });
93
- *
94
- * The record must be `ready` (it has a content hash). Unlike the draft
95
- * builders this performs no upload — the bytes already live in the catalog.
96
- */
97
- static fromCatalog(record: {
98
- readonly name: string;
99
- readonly hash?: string | null;
100
- }): Skill;
101
- /**
102
- * Internal: yield the draft's bytes + metadata so `client.submit` can upload
103
- * the asset. Idempotent (non-consuming): a Skill is reusable across submits —
104
- * the first submit caches the resolved asset id (see `_rememberAsset`) so
105
- * later submits reuse it instead of re-uploading.
106
- *
107
- * Returns undefined for already-materialized Skills.
108
- */
109
- _takeDraftBundle(): {
110
- name: string;
111
- contentHash: string;
112
- bytes: Uint8Array;
113
- } | undefined;
114
- /**
115
- * Pre-upload a draft Skill's bytes to the workspace asset store and return a
116
- * NEW materialized Skill carrying a `kind:"asset"` ref. Blocking: the upload
117
- * completes before this resolves. Submitting the returned Skill sends a plain
118
- * asset ref and the run pulls the bytes from storage.
119
- *
120
- * Consumes this draft (a draft becomes an asset exactly once); call only on a
121
- * draft built via `Skill.fromFiles` / `Skill.fromPath` / `Skill.fromUrl`.
122
- */
123
- upload(client: SkillUploader): Promise<Skill>;
124
- toJSON(): SkillRef;
125
- }
126
- /**
127
- * SDK-internal draft skill marker. Never reaches the wire; the
128
- * materialize step inside `client.submit` converts these to
129
- * `kind:"asset"` refs.
130
- */
131
- export interface DraftSkillRef {
132
- readonly kind: "draft";
133
- readonly name: string;
134
- readonly contentHash: string;
135
- }
136
- /**
137
- * Minimal client surface `Skill.upload` needs. `AgentExecutor` satisfies it via
138
- * its internal `_uploadAsset`; defined structurally here so `skill.ts` does not
139
- * import `client.ts` (which would be circular — `client.ts` imports `Skill`).
140
- */
141
- export interface SkillUploader {
142
- _uploadAsset(args: {
143
- readonly bytes: Uint8Array;
144
- readonly hash: string;
145
- readonly contentType?: string;
146
- }): Promise<{
147
- readonly assetId: string;
148
- }>;
149
- }
package/dist/skill.js DELETED
@@ -1,198 +0,0 @@
1
- import { SKILL_NAME_PATTERN } from "./_contracts/index.js";
2
- import { bundleSkillFiles, hashSkillBundle } from "./bundle.js";
3
- import { fetchSkillArchive } from "./fetch-archive.js";
4
- import { readDirectoryAsFiles } from "./node-fs.js";
5
- /**
6
- * One `Skill` class for skill bytes. `client.submit` materializes the bytes
7
- * as an uploaded asset before the run lands; the wire ref becomes
8
- * `kind:"asset"`.
9
- *
10
- * Build from an inline files map (`Skill.fromFiles`), a local directory
11
- * (`Skill.fromPath`), or a remote zip archive over a signed URL
12
- * (`Skill.fromUrl`). All three converge on the same canonical bundle, so
13
- * identical content dedups across sources.
14
- *
15
- * Asset deduplication makes the same bytes a no-op upload on subsequent runs.
16
- * There is no `Skill.fromId(...)`. A URL is an ingestion source, not a
17
- * persistent reference.
18
- *
19
- * An inline draft is auto-staged to the content-addressable asset store at
20
- * submit time (the bytes upload before `POST /runs`; the wire ref becomes
21
- * `kind:"asset"`). Call `await skill.upload(client)` to pre-stage the bytes
22
- * explicitly — useful when you want to reuse the resulting `kind:"asset"`
23
- * Skill across multiple runs.
24
- */
25
- export class Skill {
26
- #ref;
27
- #inlineBytes;
28
- /** Asset id cached after the first submit, so reuse skips a re-upload. */
29
- #assetId;
30
- /**
31
- * Internal constructor. Use `Skill.fromFiles` or `Skill.fromPath` to create
32
- * instances.
33
- */
34
- constructor(ref, inlineBytes) {
35
- this.#ref = ref;
36
- this.#inlineBytes = inlineBytes;
37
- }
38
- /**
39
- * The wire-level reference. Returns the SDK-private draft shape for
40
- * un-materialized skills (kind:"draft", with name + contentHash).
41
- * `client.submit` walks these and uploads them before the run
42
- * lands.
43
- */
44
- get ref() {
45
- return this.#ref;
46
- }
47
- /** True for local-bytes Skills that haven't been uploaded yet. */
48
- get isDraft() {
49
- return this.#ref.kind === "draft";
50
- }
51
- /** Internal: the asset id resolved on a prior submit, or undefined. */
52
- get _cachedAssetId() {
53
- return this.#assetId;
54
- }
55
- /** Internal: remember the asset id resolved for this draft's bytes. */
56
- _rememberAsset(assetId) {
57
- this.#assetId = assetId;
58
- }
59
- /**
60
- * Build a draft Skill from an inline files map. The SDK validates
61
- * basic safety (no path traversal, size caps, has `SKILL.md`),
62
- * deterministically zips the bundle, and computes the
63
- * `sha256:<hex>` content hash. `client.submit` materializes
64
- * these before the run lands.
65
- */
66
- static async fromFiles(args) {
67
- if (!args || typeof args !== "object") {
68
- throw new Error("Skill.fromFiles: args is required");
69
- }
70
- if (typeof args.name !== "string" || !SKILL_NAME_PATTERN.test(args.name)) {
71
- throw new Error(`Skill.fromFiles: name must match ${SKILL_NAME_PATTERN.source}`);
72
- }
73
- const bundled = bundleSkillFiles(args.files);
74
- const contentHash = await hashSkillBundle(bundled.zip);
75
- const ref = {
76
- kind: "draft",
77
- name: args.name,
78
- contentHash
79
- };
80
- return new Skill(ref, bundled.zip);
81
- }
82
- /**
83
- * Read a local directory and build a draft Skill. Symlinks and
84
- * non-regular files are skipped. Bun/Node filesystem runtimes only.
85
- */
86
- static async fromPath(rootDir, args) {
87
- const files = await readDirectoryAsFiles(rootDir);
88
- return Skill.fromFiles({ name: args.name, files });
89
- }
90
- /**
91
- * Fetch a zip-archived skill from a URL and build a draft Skill. The archive
92
- * is downloaded in the SDK process, so the URL is caller-controlled — host
93
- * the skill yourself and pass a temporary signed URL (e.g. an S3 presigned
94
- * URL). Its bytes are optionally integrity-checked against `sha256`, unzipped,
95
- * and reduced to the same files map as `Skill.fromFiles` — so a URL-sourced
96
- * skill and the identical local skill produce the same canonical asset and
97
- * dedup against each other.
98
- *
99
- * The archive must contain `SKILL.md` at its root, or inside a single
100
- * top-level folder (which is stripped). The signed URL only needs to be valid
101
- * for this call; `client.submit` snapshots the bytes into the run.
102
- *
103
- * Universal (Bun / Node 18+ / browser): requires a global `fetch`, or pass one.
104
- */
105
- static async fromUrl(url, args) {
106
- if (!args || typeof args !== "object") {
107
- throw new Error("Skill.fromUrl: args is required");
108
- }
109
- if (typeof args.name !== "string" || !SKILL_NAME_PATTERN.test(args.name)) {
110
- throw new Error(`Skill.fromUrl: name must match ${SKILL_NAME_PATTERN.source}`);
111
- }
112
- const files = await fetchSkillArchive(url, {
113
- ...(args.sha256 !== undefined ? { sha256: args.sha256 } : {}),
114
- ...(args.timeoutMs !== undefined ? { timeoutMs: args.timeoutMs } : {}),
115
- ...(args.fetch !== undefined ? { fetch: args.fetch } : {})
116
- });
117
- return Skill.fromFiles({ name: args.name, files });
118
- }
119
- /**
120
- * Reference a skill already uploaded to the workspace catalog
121
- * (`aex skills upload`) in a run.
122
- *
123
- * A catalog skill's bytes are a content-addressed asset, so referencing it
124
- * is just an `{ kind:"asset" }` ref — once a run snapshots the bytes, it is
125
- * the identical normalized flow as an inline or file-sourced skill. Pass the
126
- * `Skill` record returned by `client.skills.list()` / `.get()`:
127
- *
128
- * const [s] = await client.skills.list();
129
- * await client.submit({ ..., skills: [Skill.fromCatalog(s)] });
130
- *
131
- * The record must be `ready` (it has a content hash). Unlike the draft
132
- * builders this performs no upload — the bytes already live in the catalog.
133
- */
134
- static fromCatalog(record) {
135
- if (!record || typeof record !== "object") {
136
- throw new Error("Skill.fromCatalog: a catalog skill record is required");
137
- }
138
- if (typeof record.name !== "string" || !SKILL_NAME_PATTERN.test(record.name)) {
139
- throw new Error(`Skill.fromCatalog: record.name must match ${SKILL_NAME_PATTERN.source}`);
140
- }
141
- const rawHash = typeof record.hash === "string" ? record.hash : "";
142
- const hashHex = rawHash.startsWith("sha256:") ? rawHash.slice("sha256:".length) : rawHash;
143
- if (!/^[0-9a-f]{64}$/.test(hashHex)) {
144
- throw new Error("Skill.fromCatalog: record.hash must be a sha256 digest — only `ready` catalog skills are referenceable");
145
- }
146
- const ref = { kind: "asset", assetId: `asset_${hashHex}`, name: record.name };
147
- return new Skill(ref);
148
- }
149
- /**
150
- * Internal: yield the draft's bytes + metadata so `client.submit` can upload
151
- * the asset. Idempotent (non-consuming): a Skill is reusable across submits —
152
- * the first submit caches the resolved asset id (see `_rememberAsset`) so
153
- * later submits reuse it instead of re-uploading.
154
- *
155
- * Returns undefined for already-materialized Skills.
156
- */
157
- _takeDraftBundle() {
158
- if (this.#ref.kind !== "draft" || !this.#inlineBytes) {
159
- return undefined;
160
- }
161
- return {
162
- name: this.#ref.name,
163
- contentHash: this.#ref.contentHash,
164
- bytes: this.#inlineBytes
165
- };
166
- }
167
- /**
168
- * Pre-upload a draft Skill's bytes to the workspace asset store and return a
169
- * NEW materialized Skill carrying a `kind:"asset"` ref. Blocking: the upload
170
- * completes before this resolves. Submitting the returned Skill sends a plain
171
- * asset ref and the run pulls the bytes from storage.
172
- *
173
- * Consumes this draft (a draft becomes an asset exactly once); call only on a
174
- * draft built via `Skill.fromFiles` / `Skill.fromPath` / `Skill.fromUrl`.
175
- */
176
- async upload(client) {
177
- const bundle = this._takeDraftBundle();
178
- if (!bundle) {
179
- throw new Error("Skill.upload: only draft Skills can be uploaded. A Skill from " +
180
- "Skill.fromCatalog(...) is already materialized.");
181
- }
182
- const uploaded = await client._uploadAsset({
183
- bytes: bundle.bytes,
184
- hash: bundle.contentHash,
185
- contentType: "application/zip"
186
- });
187
- const ref = { kind: "asset", assetId: uploaded.assetId, name: bundle.name };
188
- return new Skill(ref);
189
- }
190
- toJSON() {
191
- if (this.#ref.kind === "draft") {
192
- throw new Error("Skill: draft Skills cannot be JSON-serialised — they only become wire refs when " +
193
- "client.submit uploads the bytes as an asset.");
194
- }
195
- return this.#ref;
196
- }
197
- }
198
- //# sourceMappingURL=skill.js.map
package/dist/skill.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAInB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,KAAK;IACP,IAAI,CAA2B;IAC/B,YAAY,CAAyB;IAC9C,0EAA0E;IAC1E,QAAQ,CAAqB;IAE7B;;;OAGG;IACH,YAAoB,GAA6B,EAAE,WAAwB;QACzE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,kEAAkE;IAClE,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;IACpC,CAAC;IAED,uEAAuE;IACvE,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,uEAAuE;IACvE,cAA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