@aexhq/sdk 0.29.0 → 0.31.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.
- package/README.md +95 -8
- package/dist/_contracts/connection-ticket.d.ts +1 -1
- package/dist/_contracts/connection-ticket.js +1 -1
- package/dist/_contracts/event-envelope.d.ts +5 -8
- package/dist/_contracts/event-envelope.js +5 -6
- package/dist/_contracts/event-guards.d.ts +67 -0
- package/dist/_contracts/event-guards.js +36 -0
- package/dist/_contracts/event-stream-client.d.ts +1 -1
- package/dist/_contracts/http.js +1 -1
- package/dist/_contracts/index.d.ts +2 -0
- package/dist/_contracts/index.js +6 -0
- package/dist/_contracts/operations.d.ts +2 -47
- package/dist/_contracts/operations.js +7 -112
- package/dist/_contracts/provider-support.d.ts +48 -138
- package/dist/_contracts/provider-support.js +10 -41
- package/dist/_contracts/proxy-protocol.d.ts +7 -7
- package/dist/_contracts/proxy-protocol.js +8 -8
- package/dist/_contracts/run-config.d.ts +7 -20
- package/dist/_contracts/run-config.js +8 -46
- package/dist/_contracts/run-cost.d.ts +1 -5
- package/dist/_contracts/run-cost.js +0 -8
- package/dist/_contracts/run-custody.d.ts +4 -6
- package/dist/_contracts/run-custody.js +0 -8
- package/dist/_contracts/run-trace.d.ts +7 -0
- package/dist/_contracts/run-trace.js +9 -0
- package/dist/_contracts/run-unit.d.ts +1 -1
- package/dist/_contracts/run-unit.js +2 -2
- package/dist/_contracts/runner-event.d.ts +1 -1
- package/dist/_contracts/runner-event.js +1 -1
- package/dist/_contracts/runtime-manifest.d.ts +13 -26
- package/dist/_contracts/runtime-manifest.js +6 -35
- package/dist/_contracts/runtime-types.d.ts +32 -1
- package/dist/_contracts/sdk-secrets.js +4 -4
- package/dist/_contracts/side-effect-audit.d.ts +2 -4
- package/dist/_contracts/side-effect-audit.js +2 -4
- package/dist/_contracts/status.d.ts +1 -1
- package/dist/_contracts/status.js +1 -1
- package/dist/_contracts/submission.d.ts +19 -126
- package/dist/_contracts/submission.js +31 -185
- package/dist/_contracts/webhook-verify.d.ts +1 -1
- package/dist/_contracts/webhook-verify.js +1 -1
- package/dist/agents-md.d.ts +4 -1
- package/dist/agents-md.js +10 -9
- package/dist/agents-md.js.map +1 -1
- package/dist/asset-upload.d.ts +4 -10
- package/dist/asset-upload.js +4 -47
- package/dist/asset-upload.js.map +1 -1
- package/dist/cli.mjs +17647 -3950
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +79 -61
- package/dist/client.js +207 -125
- package/dist/client.js.map +1 -1
- package/dist/data-tools.d.ts +23 -0
- package/dist/data-tools.js +102 -13
- package/dist/data-tools.js.map +1 -1
- package/dist/file.d.ts +4 -1
- package/dist/file.js +10 -9
- package/dist/file.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/skill.d.ts +9 -7
- package/dist/skill.js +15 -15
- package/dist/skill.js.map +1 -1
- package/dist/tool.d.ts +4 -1
- package/dist/tool.js +10 -8
- package/dist/tool.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/cleanup.md +2 -2
- package/docs/concepts/agent-tools.md +9 -5
- package/docs/concepts/composition.md +1 -1
- package/docs/concepts/providers-and-runtimes.md +2 -4
- package/docs/concepts/runs.md +3 -6
- package/docs/credentials.md +2 -5
- package/docs/defaults.md +22 -22
- package/docs/events.md +32 -9
- package/docs/limits-and-quotas.md +40 -40
- package/docs/limits.md +1 -1
- package/docs/networking.md +141 -0
- package/docs/outputs.md +1 -1
- package/docs/provider-runtime-capabilities.md +36 -64
- package/docs/public-surface.json +2 -3
- package/docs/quickstart.md +32 -11
- package/docs/run-config.md +3 -4
- package/docs/secrets.md +7 -5
- package/docs/skills.md +4 -12
- package/docs/vision-skills.md +1 -1
- package/examples/chat-corpus.ts +85 -0
- package/package.json +2 -2
package/dist/asset-upload.d.ts
CHANGED
|
@@ -11,18 +11,13 @@
|
|
|
11
11
|
*
|
|
12
12
|
* 1. POST /assets/presign → { exists } | { uploadUrl, requiredHeaders }
|
|
13
13
|
* - `exists:true` is a dedup hit; we're done.
|
|
14
|
-
* - otherwise the
|
|
14
|
+
* - otherwise the hosted API mints a presigned PUT scoped to the exact
|
|
15
15
|
* content-addressed key and signs `x-amz-checksum-sha256` so the object
|
|
16
16
|
* store enforces integrity server-side.
|
|
17
17
|
* 2. PUT the bytes straight to `uploadUrl` with `requiredHeaders` (the signed
|
|
18
18
|
* checksum). The store rejects a byte mismatch — a 2xx proves bytes == hash.
|
|
19
19
|
* 3. POST /assets/finalize → confirms the object exists (HEAD only).
|
|
20
20
|
*
|
|
21
|
-
* Fallback: when the hosted API has no object-store upload credentials it
|
|
22
|
-
* answers presign with 503 `presign_unconfigured`; we POST the bytes to the
|
|
23
|
-
* buffered `/assets`
|
|
24
|
-
* path (small bundles only). The runner re-verifies the hash on download in
|
|
25
|
-
* every case.
|
|
26
21
|
*/
|
|
27
22
|
/**
|
|
28
23
|
* Subset of `HttpClient` needed by the asset uploader. Defined as a
|
|
@@ -56,11 +51,10 @@ export interface UploadedAsset {
|
|
|
56
51
|
}
|
|
57
52
|
/**
|
|
58
53
|
* Upload `bytes` to the hosted API's content-addressable asset store via the
|
|
59
|
-
* direct-to-storage presign flow
|
|
60
|
-
* when the hosted API has no object-store upload credentials.
|
|
54
|
+
* direct-to-storage presign flow.
|
|
61
55
|
*
|
|
62
56
|
* Verifies the advisory hash matches the bytes BEFORE sending so a mismatch
|
|
63
|
-
* fails fast on the client.
|
|
64
|
-
* runner re-checks on download.
|
|
57
|
+
* fails fast on the client. Object storage re-verifies via the signed checksum,
|
|
58
|
+
* and the runner re-checks on download.
|
|
65
59
|
*/
|
|
66
60
|
export declare function uploadAsset(args: UploadAssetArgs): Promise<UploadedAsset>;
|
package/dist/asset-upload.js
CHANGED
|
@@ -11,27 +11,21 @@
|
|
|
11
11
|
*
|
|
12
12
|
* 1. POST /assets/presign → { exists } | { uploadUrl, requiredHeaders }
|
|
13
13
|
* - `exists:true` is a dedup hit; we're done.
|
|
14
|
-
* - otherwise the
|
|
14
|
+
* - otherwise the hosted API mints a presigned PUT scoped to the exact
|
|
15
15
|
* content-addressed key and signs `x-amz-checksum-sha256` so the object
|
|
16
16
|
* store enforces integrity server-side.
|
|
17
17
|
* 2. PUT the bytes straight to `uploadUrl` with `requiredHeaders` (the signed
|
|
18
18
|
* checksum). The store rejects a byte mismatch — a 2xx proves bytes == hash.
|
|
19
19
|
* 3. POST /assets/finalize → confirms the object exists (HEAD only).
|
|
20
20
|
*
|
|
21
|
-
* Fallback: when the hosted API has no object-store upload credentials it
|
|
22
|
-
* answers presign with 503 `presign_unconfigured`; we POST the bytes to the
|
|
23
|
-
* buffered `/assets`
|
|
24
|
-
* path (small bundles only). The runner re-verifies the hash on download in
|
|
25
|
-
* every case.
|
|
26
21
|
*/
|
|
27
22
|
/**
|
|
28
23
|
* Upload `bytes` to the hosted API's content-addressable asset store via the
|
|
29
|
-
* direct-to-storage presign flow
|
|
30
|
-
* when the hosted API has no object-store upload credentials.
|
|
24
|
+
* direct-to-storage presign flow.
|
|
31
25
|
*
|
|
32
26
|
* Verifies the advisory hash matches the bytes BEFORE sending so a mismatch
|
|
33
|
-
* fails fast on the client.
|
|
34
|
-
* runner re-checks on download.
|
|
27
|
+
* fails fast on the client. Object storage re-verifies via the signed checksum,
|
|
28
|
+
* and the runner re-checks on download.
|
|
35
29
|
*/
|
|
36
30
|
export async function uploadAsset(args) {
|
|
37
31
|
const expected = args.hash.startsWith("sha256:") ? args.hash.slice("sha256:".length) : args.hash;
|
|
@@ -51,10 +45,6 @@ export async function uploadAsset(args) {
|
|
|
51
45
|
});
|
|
52
46
|
}
|
|
53
47
|
catch (err) {
|
|
54
|
-
// 503 presign_unconfigured → fall back to the buffered upload path.
|
|
55
|
-
if (isPresignUnconfigured(err)) {
|
|
56
|
-
return uploadAssetBuffered(args, actual);
|
|
57
|
-
}
|
|
58
48
|
throw err;
|
|
59
49
|
}
|
|
60
50
|
// Dedup hit — identical bytes already vaulted under this workspace.
|
|
@@ -100,39 +90,6 @@ export async function uploadAsset(args) {
|
|
|
100
90
|
exists: false
|
|
101
91
|
};
|
|
102
92
|
}
|
|
103
|
-
/** Detect the 503 `presign_unconfigured` rejection, regardless of error class. */
|
|
104
|
-
function isPresignUnconfigured(err) {
|
|
105
|
-
if (!err || typeof err !== "object")
|
|
106
|
-
return false;
|
|
107
|
-
const e = err;
|
|
108
|
-
if (e.status !== 503)
|
|
109
|
-
return false;
|
|
110
|
-
const detailCode = e.details?.code;
|
|
111
|
-
return e.code === "presign_unconfigured" || detailCode === "presign_unconfigured";
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Fallback: POST the bytes to the buffered `/assets` endpoint. Used only when
|
|
115
|
-
* the hosted API has no object-store upload credentials (presign 503). Subject to the API's
|
|
116
|
-
* payload limit, so suitable for small bundles only.
|
|
117
|
-
*/
|
|
118
|
-
async function uploadAssetBuffered(args, actualHex) {
|
|
119
|
-
const body = await args.http.request("/assets", {
|
|
120
|
-
method: "POST",
|
|
121
|
-
headers: {
|
|
122
|
-
"content-type": args.contentType ?? "application/zip",
|
|
123
|
-
"content-length": String(args.bytes.byteLength),
|
|
124
|
-
"x-asset-hash": `sha256:${actualHex}`
|
|
125
|
-
},
|
|
126
|
-
body: args.bytes
|
|
127
|
-
});
|
|
128
|
-
const contentHash = body.contentHash ?? body.hash ?? `sha256:${actualHex}`;
|
|
129
|
-
return {
|
|
130
|
-
assetId: body.assetId ?? assetIdFromContentHash(contentHash),
|
|
131
|
-
contentHash,
|
|
132
|
-
sizeBytes: body.sizeBytes,
|
|
133
|
-
exists: body.exists
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
93
|
// ---------------------------------------------------------------------------
|
|
137
94
|
// Internal helpers
|
|
138
95
|
// ---------------------------------------------------------------------------
|
package/dist/asset-upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-upload.js","sourceRoot":"","sources":["../src/asset-upload.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"asset-upload.js","sourceRoot":"","sources":["../src/asset-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAoCH;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAqB;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,2DAA2D,MAAM,GAAG;YAClE,uBAAuB,IAAI,CAAC,IAAI,+CAA+C,CAClF,CAAC;IACJ,CAAC;IACD,MAAM,iBAAiB,GAAG,UAAU,MAAM,EAAE,CAAC;IAE7C,4CAA4C;IAC5C,IAAI,OAUS,CAAC;IACd,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8B,iBAAiB,EAAE;YAChF,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;SACpF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,oEAAoE;IACpE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,WAAW,GAAG,OAAO,CAA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