@aexhq/sdk 0.46.5-canary → 0.51.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/LICENSE +201 -0
- package/NOTICE +38 -0
- package/README.md +54 -29
- package/dist/client/aex.d.ts +33 -0
- package/dist/client/aex.js +108 -0
- package/dist/client/aex.js.map +1 -0
- package/dist/client/credentials.d.ts +25 -0
- package/dist/client/credentials.js +97 -0
- package/dist/client/credentials.js.map +1 -0
- package/dist/client/routing.d.ts +7 -0
- package/dist/client/routing.js +29 -0
- package/dist/client/routing.js.map +1 -0
- package/dist/downloads/download.d.ts +18 -0
- package/dist/downloads/download.js +67 -0
- package/dist/downloads/download.js.map +1 -0
- package/dist/generated/errors.d.ts +12 -0
- package/dist/generated/errors.js +82 -0
- package/dist/generated/errors.js.map +1 -0
- package/dist/generated/models.d.ts +1392 -0
- package/dist/generated/models.js +62 -0
- package/dist/generated/models.js.map +1 -0
- package/dist/generated/resources.d.ts +710 -0
- package/dist/generated/resources.js +582 -0
- package/dist/generated/resources.js.map +1 -0
- package/dist/generated/routes.d.ts +44 -0
- package/dist/generated/routes.js +1905 -0
- package/dist/generated/routes.js.map +1 -0
- package/dist/index.d.ts +21 -50
- package/dist/index.js +14 -62
- package/dist/index.js.map +1 -1
- package/dist/node/session-file-limits.d.ts +4 -0
- package/dist/node/session-file-limits.js +7 -0
- package/dist/node/session-file-limits.js.map +1 -0
- package/dist/node/session-files.d.ts +80 -0
- package/dist/node/session-files.js +254 -0
- package/dist/node/session-files.js.map +1 -0
- package/dist/observations/stream.d.ts +1 -0
- package/dist/observations/stream.js +18 -0
- package/dist/observations/stream.js.map +1 -0
- package/dist/transport/errors.d.ts +60 -0
- package/dist/transport/errors.js +107 -0
- package/dist/transport/errors.js.map +1 -0
- package/dist/transport/pagination.d.ts +8 -0
- package/dist/transport/pagination.js +34 -0
- package/dist/transport/pagination.js.map +1 -0
- package/dist/transport/retry.d.ts +21 -0
- package/dist/transport/retry.js +37 -0
- package/dist/transport/retry.js.map +1 -0
- package/dist/transport/transport.d.ts +25 -0
- package/dist/transport/transport.js +33 -0
- package/dist/transport/transport.js.map +1 -0
- package/package.json +67 -30
- package/dist/_contracts/account-operations.d.ts +0 -101
- package/dist/_contracts/account-operations.js +0 -242
- package/dist/_contracts/account-types.d.ts +0 -461
- package/dist/_contracts/account-types.js +0 -1
- package/dist/_contracts/api-key.d.ts +0 -61
- package/dist/_contracts/api-key.js +0 -101
- package/dist/_contracts/api-routes.d.ts +0 -20
- package/dist/_contracts/api-routes.js +0 -109
- package/dist/_contracts/archive-limits.d.ts +0 -3
- package/dist/_contracts/archive-limits.js +0 -23
- package/dist/_contracts/asset-authoring.d.ts +0 -22
- package/dist/_contracts/asset-authoring.js +0 -106
- package/dist/_contracts/asset-bundle.d.ts +0 -64
- package/dist/_contracts/asset-bundle.js +0 -263
- package/dist/_contracts/asset-upload-helper.d.ts +0 -31
- package/dist/_contracts/asset-upload-helper.js +0 -84
- package/dist/_contracts/billing-admission.d.ts +0 -29
- package/dist/_contracts/billing-admission.js +0 -28
- package/dist/_contracts/bundle-manifest.d.ts +0 -89
- package/dist/_contracts/bundle-manifest.js +0 -158
- package/dist/_contracts/canonical-sha256.d.ts +0 -8
- package/dist/_contracts/canonical-sha256.js +0 -8
- package/dist/_contracts/connection-ticket.d.ts +0 -22
- package/dist/_contracts/connection-ticket.js +0 -54
- package/dist/_contracts/continuation-event.d.ts +0 -31
- package/dist/_contracts/continuation-event.js +0 -6
- package/dist/_contracts/contract-parse-error.d.ts +0 -12
- package/dist/_contracts/contract-parse-error.js +0 -51
- package/dist/_contracts/error-codes.d.ts +0 -26
- package/dist/_contracts/error-codes.js +0 -116
- package/dist/_contracts/error-factory.d.ts +0 -32
- package/dist/_contracts/error-factory.js +0 -174
- package/dist/_contracts/event-envelope.d.ts +0 -471
- package/dist/_contracts/event-envelope.js +0 -501
- package/dist/_contracts/event-stream-client.d.ts +0 -122
- package/dist/_contracts/event-stream-client.js +0 -445
- package/dist/_contracts/event-view.d.ts +0 -44
- package/dist/_contracts/event-view.js +0 -69
- package/dist/_contracts/failure-class.d.ts +0 -29
- package/dist/_contracts/failure-class.js +0 -73
- package/dist/_contracts/http.d.ts +0 -135
- package/dist/_contracts/http.js +0 -434
- package/dist/_contracts/ids.d.ts +0 -66
- package/dist/_contracts/ids.js +0 -119
- package/dist/_contracts/index.d.ts +0 -42
- package/dist/_contracts/index.js +0 -52
- package/dist/_contracts/internal.d.ts +0 -55
- package/dist/_contracts/internal.js +0 -113
- package/dist/_contracts/models.d.ts +0 -30
- package/dist/_contracts/models.js +0 -28
- package/dist/_contracts/operation-core.d.ts +0 -36
- package/dist/_contracts/operation-core.js +0 -70
- package/dist/_contracts/operations.d.ts +0 -218
- package/dist/_contracts/operations.js +0 -1496
- package/dist/_contracts/otlp-projection.d.ts +0 -78
- package/dist/_contracts/otlp-projection.js +0 -171
- package/dist/_contracts/post-hook.d.ts +0 -31
- package/dist/_contracts/post-hook.js +0 -61
- package/dist/_contracts/provider-fault.d.ts +0 -34
- package/dist/_contracts/provider-fault.js +0 -68
- package/dist/_contracts/retry-core.d.ts +0 -29
- package/dist/_contracts/retry-core.js +0 -79
- package/dist/_contracts/runner-event.d.ts +0 -117
- package/dist/_contracts/runner-event.js +0 -172
- package/dist/_contracts/runtime-kind.d.ts +0 -60
- package/dist/_contracts/runtime-kind.js +0 -70
- package/dist/_contracts/runtime-manifest.d.ts +0 -121
- package/dist/_contracts/runtime-manifest.js +0 -83
- package/dist/_contracts/runtime-security-profile.d.ts +0 -26
- package/dist/_contracts/runtime-security-profile.js +0 -73
- package/dist/_contracts/runtime-sizes.d.ts +0 -104
- package/dist/_contracts/runtime-sizes.js +0 -111
- package/dist/_contracts/runtime-types.d.ts +0 -618
- package/dist/_contracts/runtime-types.js +0 -58
- package/dist/_contracts/schemas/asset-bundle.d.ts +0 -70
- package/dist/_contracts/schemas/asset-bundle.js +0 -107
- package/dist/_contracts/schemas/asset-ref.d.ts +0 -61
- package/dist/_contracts/schemas/asset-ref.js +0 -118
- package/dist/_contracts/schemas/bundle-manifest.d.ts +0 -66
- package/dist/_contracts/schemas/bundle-manifest.js +0 -77
- package/dist/_contracts/schemas/index.d.ts +0 -32
- package/dist/_contracts/schemas/index.js +0 -30
- package/dist/_contracts/schemas/mcp-server.d.ts +0 -99
- package/dist/_contracts/schemas/mcp-server.js +0 -209
- package/dist/_contracts/schemas/models.d.ts +0 -29
- package/dist/_contracts/schemas/models.js +0 -51
- package/dist/_contracts/schemas/numeric.d.ts +0 -18
- package/dist/_contracts/schemas/numeric.js +0 -28
- package/dist/_contracts/schemas/post-hook.d.ts +0 -45
- package/dist/_contracts/schemas/post-hook.js +0 -68
- package/dist/_contracts/schemas/response-assets.d.ts +0 -75
- package/dist/_contracts/schemas/response-assets.js +0 -81
- package/dist/_contracts/schemas/response-billing.d.ts +0 -208
- package/dist/_contracts/schemas/response-billing.js +0 -139
- package/dist/_contracts/schemas/response-common.d.ts +0 -132
- package/dist/_contracts/schemas/response-common.js +0 -162
- package/dist/_contracts/schemas/response-identity.d.ts +0 -648
- package/dist/_contracts/schemas/response-identity.js +0 -131
- package/dist/_contracts/schemas/response-mcp-servers.d.ts +0 -51
- package/dist/_contracts/schemas/response-mcp-servers.js +0 -32
- package/dist/_contracts/schemas/response-secrets.d.ts +0 -50
- package/dist/_contracts/schemas/response-secrets.js +0 -32
- package/dist/_contracts/schemas/response-sessions-internal.d.ts +0 -200
- package/dist/_contracts/schemas/response-sessions-internal.js +0 -142
- package/dist/_contracts/schemas/response-sessions.d.ts +0 -1598
- package/dist/_contracts/schemas/response-sessions.js +0 -377
- package/dist/_contracts/schemas/response-webhooks.d.ts +0 -76
- package/dist/_contracts/schemas/response-webhooks.js +0 -42
- package/dist/_contracts/schemas/response-workspace.d.ts +0 -225
- package/dist/_contracts/schemas/response-workspace.js +0 -99
- package/dist/_contracts/schemas/runtime-kind.d.ts +0 -31
- package/dist/_contracts/schemas/runtime-kind.js +0 -29
- package/dist/_contracts/schemas/runtime-security-profile.d.ts +0 -28
- package/dist/_contracts/schemas/runtime-security-profile.js +0 -26
- package/dist/_contracts/schemas/runtime-sizes.d.ts +0 -70
- package/dist/_contracts/schemas/runtime-sizes.js +0 -127
- package/dist/_contracts/schemas/session-limits.d.ts +0 -34
- package/dist/_contracts/schemas/session-limits.js +0 -39
- package/dist/_contracts/schemas/session-machine.d.ts +0 -23
- package/dist/_contracts/schemas/session-machine.js +0 -24
- package/dist/_contracts/schemas/session-request-config.d.ts +0 -58
- package/dist/_contracts/schemas/session-request-config.js +0 -134
- package/dist/_contracts/schemas/session-webhook.d.ts +0 -11
- package/dist/_contracts/schemas/session-webhook.js +0 -38
- package/dist/_contracts/schemas/side-effect-audit.d.ts +0 -98
- package/dist/_contracts/schemas/side-effect-audit.js +0 -102
- package/dist/_contracts/schemas/submission-assets.d.ts +0 -117
- package/dist/_contracts/schemas/submission-assets.js +0 -147
- package/dist/_contracts/schemas/submission-body.d.ts +0 -251
- package/dist/_contracts/schemas/submission-body.js +0 -378
- package/dist/_contracts/schemas/submission-environment.d.ts +0 -79
- package/dist/_contracts/schemas/submission-environment.js +0 -179
- package/dist/_contracts/schemas/submission-request.d.ts +0 -158
- package/dist/_contracts/schemas/submission-request.js +0 -49
- package/dist/_contracts/schemas/submission-secrets.d.ts +0 -47
- package/dist/_contracts/schemas/submission-secrets.js +0 -108
- package/dist/_contracts/schemas/wire.d.ts +0 -118
- package/dist/_contracts/schemas/wire.js +0 -171
- package/dist/_contracts/schemas/workspace-resources.d.ts +0 -50
- package/dist/_contracts/schemas/workspace-resources.js +0 -87
- package/dist/_contracts/sdk-errors.d.ts +0 -212
- package/dist/_contracts/sdk-errors.js +0 -313
- package/dist/_contracts/sdk-secrets.d.ts +0 -67
- package/dist/_contracts/sdk-secrets.js +0 -427
- package/dist/_contracts/session-archive.d.ts +0 -16
- package/dist/_contracts/session-archive.js +0 -92
- package/dist/_contracts/session-artifacts.d.ts +0 -189
- package/dist/_contracts/session-artifacts.js +0 -264
- package/dist/_contracts/session-config.d.ts +0 -373
- package/dist/_contracts/session-config.js +0 -562
- package/dist/_contracts/session-cost-types.d.ts +0 -211
- package/dist/_contracts/session-cost-types.js +0 -69
- package/dist/_contracts/session-cost.d.ts +0 -8
- package/dist/_contracts/session-cost.js +0 -582
- package/dist/_contracts/session-custody.d.ts +0 -165
- package/dist/_contracts/session-custody.js +0 -345
- package/dist/_contracts/session-file-query.d.ts +0 -14
- package/dist/_contracts/session-file-query.js +0 -178
- package/dist/_contracts/session-record.d.ts +0 -112
- package/dist/_contracts/session-record.js +0 -165
- package/dist/_contracts/session-retention.d.ts +0 -201
- package/dist/_contracts/session-retention.js +0 -450
- package/dist/_contracts/side-effect-audit.d.ts +0 -126
- package/dist/_contracts/side-effect-audit.js +0 -520
- package/dist/_contracts/sse.d.ts +0 -74
- package/dist/_contracts/sse.js +0 -227
- package/dist/_contracts/stable.d.ts +0 -45
- package/dist/_contracts/stable.js +0 -62
- package/dist/_contracts/status.d.ts +0 -25
- package/dist/_contracts/status.js +0 -57
- package/dist/_contracts/submission-limits.d.ts +0 -61
- package/dist/_contracts/submission-limits.js +0 -60
- package/dist/_contracts/submission.d.ts +0 -547
- package/dist/_contracts/submission.js +0 -812
- package/dist/_contracts/suggest.d.ts +0 -15
- package/dist/_contracts/suggest.js +0 -53
- package/dist/_contracts/testing/response-bindings.d.ts +0 -45
- package/dist/_contracts/testing/response-bindings.js +0 -256
- package/dist/_contracts/testing/wire-conformance-entry.d.ts +0 -10
- package/dist/_contracts/testing/wire-conformance-entry.js +0 -8
- package/dist/_contracts/testing/wire-conformance.d.ts +0 -169
- package/dist/_contracts/testing/wire-conformance.js +0 -276
- package/dist/_contracts/turn-trace.d.ts +0 -28
- package/dist/_contracts/turn-trace.js +0 -1
- package/dist/_contracts/unknown-field-error.d.ts +0 -13
- package/dist/_contracts/unknown-field-error.js +0 -21
- package/dist/_contracts/value-guards.d.ts +0 -20
- package/dist/_contracts/value-guards.js +0 -34
- package/dist/_contracts/webhook-verify.d.ts +0 -34
- package/dist/_contracts/webhook-verify.js +0 -93
- package/dist/_contracts/wire-observer.d.ts +0 -49
- package/dist/_contracts/wire-observer.js +0 -34
- package/dist/_contracts/workflow-status.d.ts +0 -7
- package/dist/_contracts/workflow-status.js +0 -43
- package/dist/_contracts/workspace-resources.d.ts +0 -98
- package/dist/_contracts/workspace-resources.js +0 -39
- package/dist/archive-limits.d.ts +0 -1
- package/dist/archive-limits.js +0 -2
- package/dist/archive-limits.js.map +0 -1
- package/dist/asset-upload.d.ts +0 -47
- package/dist/asset-upload.js +0 -269
- package/dist/asset-upload.js.map +0 -1
- package/dist/bundle.d.ts +0 -9
- package/dist/bundle.js +0 -20
- package/dist/bundle.js.map +0 -1
- package/dist/canonical-zip.d.ts +0 -68
- package/dist/canonical-zip.js +0 -355
- package/dist/canonical-zip.js.map +0 -1
- package/dist/cli.mjs +0 -12048
- package/dist/cli.mjs.sha256 +0 -1
- package/dist/client-types.d.ts +0 -192
- package/dist/client-types.js +0 -2
- package/dist/client-types.js.map +0 -1
- package/dist/client.d.ts +0 -464
- package/dist/client.js +0 -1207
- package/dist/client.js.map +0 -1
- package/dist/event-projection.d.ts +0 -22
- package/dist/event-projection.js +0 -380
- package/dist/event-projection.js.map +0 -1
- package/dist/fetch-archive.d.ts +0 -16
- package/dist/fetch-archive.js +0 -252
- package/dist/fetch-archive.js.map +0 -1
- package/dist/file.d.ts +0 -96
- package/dist/file.js +0 -272
- package/dist/file.js.map +0 -1
- package/dist/instructions.d.ts +0 -20
- package/dist/instructions.js +0 -40
- package/dist/instructions.js.map +0 -1
- package/dist/legacy-session-provider-fault.d.ts +0 -7
- package/dist/legacy-session-provider-fault.js +0 -38
- package/dist/legacy-session-provider-fault.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -84
- package/dist/mcp-server.js +0 -117
- package/dist/mcp-server.js.map +0 -1
- package/dist/node-fs.d.ts +0 -29
- package/dist/node-fs.js +0 -19
- package/dist/node-fs.js.map +0 -1
- package/dist/node-walk.d.ts +0 -69
- package/dist/node-walk.js +0 -151
- package/dist/node-walk.js.map +0 -1
- package/dist/path-basename.d.ts +0 -5
- package/dist/path-basename.js +0 -9
- package/dist/path-basename.js.map +0 -1
- package/dist/retry.d.ts +0 -70
- package/dist/retry.js +0 -155
- package/dist/retry.js.map +0 -1
- package/dist/secret.d.ts +0 -65
- package/dist/secret.js +0 -110
- package/dist/secret.js.map +0 -1
- package/dist/session-validate.d.ts +0 -100
- package/dist/session-validate.js +0 -303
- package/dist/session-validate.js.map +0 -1
- package/dist/skill.d.ts +0 -99
- package/dist/skill.js +0 -169
- package/dist/skill.js.map +0 -1
- package/dist/submission-wire.d.ts +0 -13
- package/dist/submission-wire.js +0 -69
- package/dist/submission-wire.js.map +0 -1
- package/dist/tool.d.ts +0 -41
- package/dist/tool.js +0 -76
- package/dist/tool.js.map +0 -1
- package/dist/version.d.ts +0 -9
- package/dist/version.js +0 -10
- package/dist/version.js.map +0 -1
- package/docs/authentication.md +0 -125
- package/docs/billing.md +0 -164
- package/docs/cleanup.md +0 -27
- package/docs/concepts/agent-tools.md +0 -47
- package/docs/concepts/composition.md +0 -60
- package/docs/concepts/providers-and-runtimes.md +0 -121
- package/docs/concepts/sessions.md +0 -51
- package/docs/concepts/subagents.md +0 -35
- package/docs/credentials.md +0 -116
- package/docs/defaults.md +0 -51
- package/docs/errors.md +0 -258
- package/docs/events.md +0 -143
- package/docs/files.md +0 -130
- package/docs/limits-and-quotas.md +0 -114
- package/docs/limits.md +0 -51
- package/docs/mcp.md +0 -47
- package/docs/networking.md +0 -114
- package/docs/provider-runtime-capabilities.md +0 -32
- package/docs/public-surface.json +0 -73
- package/docs/quickstart.md +0 -135
- package/docs/release.md +0 -44
- package/docs/retries.md +0 -108
- package/docs/secrets.md +0 -141
- package/docs/session-config.md +0 -51
- package/docs/session-record.md +0 -58
- package/docs/skills.md +0 -65
- package/docs/telemetry.md +0 -66
- package/docs/testing.md +0 -35
- package/docs/vision-skills.md +0 -94
- package/docs/webhooks.md +0 -143
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The unified aex event envelope.
|
|
3
|
-
*
|
|
4
|
-
* One versioned, self-describing record that every subscriber sees, derived
|
|
5
|
-
* from the unified {@link RunnerEvent}. Managed runtime adapters emit
|
|
6
|
-
* byte-identical envelopes for the same logical event by construction. This is
|
|
7
|
-
* the shape the coordinator (Phase 2) appends, broadcasts, and archives.
|
|
8
|
-
*
|
|
9
|
-
* - **CloudEvents-shaped** self-describing envelope: a stable `id`, the
|
|
10
|
-
* coarse `source`, the AG-UI-aligned `type`, the `subject` (session), a
|
|
11
|
-
* `time`, the `sequence` cursor, and the typed `data`.
|
|
12
|
-
* - **AG-UI vocabulary** for `type` where it maps; aex-specific events
|
|
13
|
-
* ride AG-UI's reserved `CUSTOM` carrier under an `aex.*` name, so an
|
|
14
|
-
* off-the-shelf AG-UI client reads an aex start with no glue.
|
|
15
|
-
* - Two aex extensions: a coarse `source` (filter first by origin) and
|
|
16
|
-
* an optional human `message` (log / CLI / dashboard rendering).
|
|
17
|
-
*
|
|
18
|
-
* Unified observability spine:
|
|
19
|
-
* the envelope additionally carries four ordering attributes so BOTH the typed
|
|
20
|
-
* event stream and the high-volume hosted-platform log stream ride one per-session
|
|
21
|
-
* coordinator:
|
|
22
|
-
* - `channel` — "event" (the typed AG-UI stream) or "log" (a verbose log
|
|
23
|
-
* line). The single axis a consumer splits the unified stream
|
|
24
|
-
* on.
|
|
25
|
-
* - `sourceSeq` — a per-SOURCE monotonic counter assigned AT the source. The
|
|
26
|
-
* DO's hard guarantee is that records of the same source are
|
|
27
|
-
* never reordered relative to their `sourceSeq`.
|
|
28
|
-
* - `emittedAt` — source wall-clock ms at emit. Carried, never trusted for
|
|
29
|
-
* cross-source ordering (clocks are independent; the coordinator gives
|
|
30
|
-
* no synchronized clock). A client may re-sort by it for a
|
|
31
|
-
* best-effort time view.
|
|
32
|
-
* The coordinator remains the single serial ordering authority: it assigns the global
|
|
33
|
-
* `sequence` on arrival, which is the canonical stream order. `sourceSeq` /
|
|
34
|
-
* `emittedAt` are CARRIED through broadcast + archive, not used to reorder.
|
|
35
|
-
*
|
|
36
|
-
* This module is a pure projection plus honest guards and a strict AG-UI
|
|
37
|
-
* projection for consumers.
|
|
38
|
-
*/
|
|
39
|
-
import type { JsonValue } from "./submission.js";
|
|
40
|
-
import { type SessionTerminalOutcome } from "./status.js";
|
|
41
|
-
import type { RunnerEvent } from "./runner-event.js";
|
|
42
|
-
import { type AexFailureClass } from "./failure-class.js";
|
|
43
|
-
import { type ProviderFault } from "./provider-fault.js";
|
|
44
|
-
/** CloudEvents `specversion` the envelope conforms to. */
|
|
45
|
-
export declare const AEX_EVENT_SPECVERSION: "1.0";
|
|
46
|
-
/**
|
|
47
|
-
* Mapping version. Bump when the RunnerEvent → envelope projection changes
|
|
48
|
-
* shape (new `source`/`type`, renamed data field). Independent of
|
|
49
|
-
* {@link AEX_EVENT_SPECVERSION} (the CloudEvents version) and of
|
|
50
|
-
* `RUNNER_EVENT_VERSION` (the upstream wire version).
|
|
51
|
-
*/
|
|
52
|
-
export declare const AEX_EVENT_MAP_VERSION: 2;
|
|
53
|
-
/**
|
|
54
|
-
* Coarse origin classifier — the first axis a consumer filters on.
|
|
55
|
-
* - `agent` — the model: text, reasoning, builtin tool calls/results.
|
|
56
|
-
* - `api` — the hosted aex API path.
|
|
57
|
-
* - `runtime` — the execution runtime: lifecycle, diagnostics, non-fatal
|
|
58
|
-
* stream errors.
|
|
59
|
-
* - `mcp` — an MCP server (a tool call/result routed through MCP).
|
|
60
|
-
* - `aex` — the platform: skills, files, and other aex-native events.
|
|
61
|
-
* - `workflow`— the orchestration layer.
|
|
62
|
-
* - `host` — the managed host the runtime executes on; distinct from the
|
|
63
|
-
* runtime process itself.
|
|
64
|
-
*/
|
|
65
|
-
export declare const AEX_EVENT_SOURCES: readonly ["agent", "api", "runtime", "mcp", "aex", "workflow", "host"];
|
|
66
|
-
export type AexEventSource = (typeof AEX_EVENT_SOURCES)[number] | string;
|
|
67
|
-
/**
|
|
68
|
-
* The channel a record rides on the unified per-session stream:
|
|
69
|
-
* - `event` — the typed, low-volume, fully-replayed AG-UI event stream.
|
|
70
|
-
* - `log` — a high-volume verbose log line (level + message + fields). The
|
|
71
|
-
* coordinator prunes flushed log rows after evidence archival
|
|
72
|
-
* (logs are append-only, events are kept). Absent on the wire ⇒
|
|
73
|
-
* `event`.
|
|
74
|
-
*/
|
|
75
|
-
export declare const AEX_EVENT_CHANNELS: readonly ["event", "log"];
|
|
76
|
-
export type AexEventChannel = (typeof AEX_EVENT_CHANNELS)[number];
|
|
77
|
-
/**
|
|
78
|
-
* Log severity carried by a `channel: "log"` record (the `LOG` event type).
|
|
79
|
-
* NOTE: the platform owner's canonical term for the middle level is "warning";
|
|
80
|
-
* we keep "warn" for consistency with the existing in-code vocabulary — the
|
|
81
|
-
* mapping is `warning ≡ warn`.
|
|
82
|
-
*/
|
|
83
|
-
export declare const AEX_LOG_LEVELS: readonly ["info", "warn", "error"];
|
|
84
|
-
export type AexLogLevel = (typeof AEX_LOG_LEVELS)[number];
|
|
85
|
-
/**
|
|
86
|
-
* The AG-UI-aligned `type` vocabulary the envelope emits. A subset of the
|
|
87
|
-
* full AG-UI protocol — the events aex actually produces today — plus
|
|
88
|
-
* `CUSTOM`, AG-UI's reserved carrier for aex-native events.
|
|
89
|
-
*/
|
|
90
|
-
export declare const AEX_EVENT_TYPES: readonly ["RUN_STARTED", "RUN_FINISHED", "RUN_ERROR", "TEXT_MESSAGE_CONTENT", "TOOL_CALL_START", "TOOL_CALL_RESULT", "CUSTOM", "LOG"];
|
|
91
|
-
export type AexEventType = (typeof AEX_EVENT_TYPES)[number] | string;
|
|
92
|
-
/**
|
|
93
|
-
* Opt-in producer identity for at-least-once ingest. This is distinct from the
|
|
94
|
-
* coarse envelope `source`/`sourceSeq`: only producers maintaining a
|
|
95
|
-
* session-scoped monotonic counter set this pair.
|
|
96
|
-
*/
|
|
97
|
-
export interface AexEventDedup {
|
|
98
|
-
/** Free-form producer identity, not the coarse envelope source. */
|
|
99
|
-
readonly source: string;
|
|
100
|
-
/** Producer-monotonic integer scoped to `source` within the session. */
|
|
101
|
-
readonly sourceSeq: number;
|
|
102
|
-
}
|
|
103
|
-
/** Fields shared by durable events and provisional live-only stream frames. */
|
|
104
|
-
export interface AexEventBase {
|
|
105
|
-
/** CloudEvents specversion. Always {@link AEX_EVENT_SPECVERSION}. */
|
|
106
|
-
readonly specversion: typeof AEX_EVENT_SPECVERSION;
|
|
107
|
-
/** Stable, globally unique event id. This is the stream dedupe key. */
|
|
108
|
-
readonly id: string;
|
|
109
|
-
/** Coarse origin classifier. */
|
|
110
|
-
readonly source: AexEventSource;
|
|
111
|
-
/** AG-UI-aligned event type. */
|
|
112
|
-
readonly type: AexEventType;
|
|
113
|
-
/** The session this event belongs to (CloudEvents `subject`). */
|
|
114
|
-
readonly subject: string;
|
|
115
|
-
/** AG-UI thread identity. Equal to {@link subject} for an aex session. */
|
|
116
|
-
readonly threadId: string;
|
|
117
|
-
/** AG-UI run identity. A new id is allocated for every session turn. */
|
|
118
|
-
readonly runId: string;
|
|
119
|
-
/** W3C-compatible 16-byte trace identity, encoded as 32 lowercase hex characters. */
|
|
120
|
-
readonly traceId?: string;
|
|
121
|
-
/** W3C-compatible 8-byte span identity, encoded as 16 lowercase hex characters. */
|
|
122
|
-
readonly spanId?: string;
|
|
123
|
-
/** Parent span identity when this event represents a non-root span. */
|
|
124
|
-
readonly parentSpanId?: string;
|
|
125
|
-
/** ISO-8601 event time (session base + the RunnerEvent's relative `tMs`). */
|
|
126
|
-
readonly time: string;
|
|
127
|
-
/**
|
|
128
|
-
* Which sub-stream this record rides. Absent ⇒ `"event"` (existing typed
|
|
129
|
-
* producers don't set it; the coordinator defaults it on ingest).
|
|
130
|
-
*/
|
|
131
|
-
readonly channel?: AexEventChannel;
|
|
132
|
-
/**
|
|
133
|
-
* Per-SOURCE monotonic counter assigned at the source. The coordinator
|
|
134
|
-
* preserves the order of same-source records by `sourceSeq` and never
|
|
135
|
-
* reorders them; cross-source order is by arrival (`sequence`) only.
|
|
136
|
-
*/
|
|
137
|
-
readonly sourceSeq?: number;
|
|
138
|
-
/** Source wall-clock ms at emit. Carried for a best-effort client time view. */
|
|
139
|
-
readonly emittedAt?: number;
|
|
140
|
-
/**
|
|
141
|
-
* The DO's authoritative receive time (wall-clock ms), stamped at ingest
|
|
142
|
-
* alongside the global {@link sequence}. This is the authoritative wall-clock
|
|
143
|
-
* companion to `sequence` — distinct from `emittedAt` (the SOURCE's clock) and
|
|
144
|
-
* `time` (the LOGICAL time = session base + relative tMs).
|
|
145
|
-
*
|
|
146
|
-
* NOTE: some edge clocks are coarsened/frozen-at-I/O, so `receivedAt` is
|
|
147
|
-
* precisely "the coordinator's last-I/O wall-clock at ingest" — that is fine
|
|
148
|
-
* as the authoritative receive marker. It does NOT need to exceed `emittedAt`:
|
|
149
|
-
* the source runs on a different host with an independent clock, so cross-host
|
|
150
|
-
* drift can leave `receivedAt < emittedAt` and that is expected, not an error.
|
|
151
|
-
*/
|
|
152
|
-
readonly receivedAt?: number;
|
|
153
|
-
/**
|
|
154
|
-
* Log severity, first-class on a `channel: "log"` record (mirrors
|
|
155
|
-
* `data.level`). Optional: only `log`-channel records carry it; typed `event`
|
|
156
|
-
* records omit it. ("warn" ≡ the owner's "warning" — see {@link AEX_LOG_LEVELS}.)
|
|
157
|
-
*/
|
|
158
|
-
readonly level?: AexLogLevel;
|
|
159
|
-
/** Optional human-readable summary for log / CLI / dashboard rendering. */
|
|
160
|
-
readonly message?: string;
|
|
161
|
-
/** Optional producer identity used by the coordinator's idempotent ingest. */
|
|
162
|
-
readonly dedup?: AexEventDedup;
|
|
163
|
-
/** True only for producer-authored broadcast-only frames. */
|
|
164
|
-
readonly ephemeral?: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Typed payload. For `CUSTOM` events this is `{ name, value }` (AG-UI's
|
|
167
|
-
* custom carrier, `name` = `aex.<kind>`); for typed events it is the
|
|
168
|
-
* RunnerEvent's own data, projected to AG-UI fields by {@link toAGUI}.
|
|
169
|
-
*/
|
|
170
|
-
readonly data: Readonly<Record<string, JsonValue>>;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* A durable, replayable event. `sequence` is the session-wide persistence and
|
|
174
|
-
* reconnect cursor used by list/archive APIs and coordinator replay.
|
|
175
|
-
*/
|
|
176
|
-
export interface AexEvent extends AexEventBase {
|
|
177
|
-
readonly replayable?: true;
|
|
178
|
-
readonly liveSequence?: never;
|
|
179
|
-
readonly sequence: number;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* A provisional live-only frame. It is never returned by list/archive APIs and
|
|
183
|
-
* cannot advance a durable reconnect cursor. `liveSequence` orders frames only
|
|
184
|
-
* within this run's live delivery; `id` is the stable duplicate-suppression key.
|
|
185
|
-
*/
|
|
186
|
-
export interface AexLiveEvent extends AexEventBase {
|
|
187
|
-
readonly replayable: false;
|
|
188
|
-
readonly liveSequence: number;
|
|
189
|
-
readonly sequence?: never;
|
|
190
|
-
readonly receivedAt: number;
|
|
191
|
-
readonly ephemeral: true;
|
|
192
|
-
}
|
|
193
|
-
/** Events a live coordinator WebSocket may yield. */
|
|
194
|
-
export type AexStreamEvent = AexEvent | AexLiveEvent;
|
|
195
|
-
/** Payload carried by a valid public `RUN_STARTED` event. */
|
|
196
|
-
export type AexRunStartedData = Readonly<Record<string, JsonValue>> & {
|
|
197
|
-
readonly source?: string;
|
|
198
|
-
readonly turnSeq?: number;
|
|
199
|
-
readonly mode?: string;
|
|
200
|
-
readonly provider?: string;
|
|
201
|
-
readonly model?: string;
|
|
202
|
-
};
|
|
203
|
-
/** Payload carried by a valid public `RUN_FINISHED` event. */
|
|
204
|
-
export type AexRunFinishedData = Readonly<Record<string, JsonValue>> & {
|
|
205
|
-
readonly outcome: SessionTerminalOutcome;
|
|
206
|
-
readonly result?: JsonValue;
|
|
207
|
-
};
|
|
208
|
-
/** Payload carried by a valid public `RUN_ERROR` event. */
|
|
209
|
-
export type AexRunErrorData = Readonly<Record<string, JsonValue>> & {
|
|
210
|
-
readonly outcome: SessionTerminalOutcome;
|
|
211
|
-
/** CLOSED taxonomy ({@link AEX_FAILURE_CLASSES}) — branchable, never an open string. */
|
|
212
|
-
readonly failureClass: AexFailureClass;
|
|
213
|
-
readonly failureMessage: string;
|
|
214
|
-
readonly providerFault?: ProviderFault;
|
|
215
|
-
};
|
|
216
|
-
/** Payload carried by a valid public assistant-text event. */
|
|
217
|
-
export type AexTextMessageData = Readonly<Record<string, JsonValue>> & {
|
|
218
|
-
readonly text: string;
|
|
219
|
-
readonly messageId?: string;
|
|
220
|
-
readonly eventId?: string;
|
|
221
|
-
/** True only on a provisional, non-replayable live delta. */
|
|
222
|
-
readonly delta?: boolean;
|
|
223
|
-
readonly truncated?: boolean;
|
|
224
|
-
};
|
|
225
|
-
/** Payload carried by a valid public tool-call start. */
|
|
226
|
-
export type AexToolCallStartData = Readonly<Record<string, JsonValue>> & {
|
|
227
|
-
readonly id: string;
|
|
228
|
-
readonly name: string;
|
|
229
|
-
readonly arguments?: Readonly<Record<string, JsonValue>>;
|
|
230
|
-
readonly messageId?: string;
|
|
231
|
-
};
|
|
232
|
-
/** Payload carried by a valid public tool-call result. */
|
|
233
|
-
export type AexToolCallResultData = Readonly<Record<string, JsonValue>> & {
|
|
234
|
-
readonly id: string;
|
|
235
|
-
readonly content: JsonValue;
|
|
236
|
-
readonly isError?: boolean;
|
|
237
|
-
readonly messageId?: string;
|
|
238
|
-
/** True when `content` was CLIPPED to fit the event budget — not the whole result. */
|
|
239
|
-
readonly truncated?: boolean;
|
|
240
|
-
};
|
|
241
|
-
/** Payload carried by AG-UI's CUSTOM carrier. */
|
|
242
|
-
export type AexCustomData<Name extends string = string> = Readonly<Record<string, JsonValue>> & {
|
|
243
|
-
readonly name: Name;
|
|
244
|
-
readonly value: JsonValue;
|
|
245
|
-
};
|
|
246
|
-
/** Payload carried by a public log-channel record. */
|
|
247
|
-
export type AexLogData = Readonly<Record<string, JsonValue>> & {
|
|
248
|
-
readonly level: AexLogLevel;
|
|
249
|
-
readonly message: string;
|
|
250
|
-
readonly fields?: Readonly<Record<string, JsonValue>>;
|
|
251
|
-
/** True when a dominant field was CLIPPED to fit the event budget. */
|
|
252
|
-
readonly truncated?: boolean;
|
|
253
|
-
};
|
|
254
|
-
export type AexRunStartedEvent = AexEventBase & {
|
|
255
|
-
readonly type: "RUN_STARTED";
|
|
256
|
-
readonly data: AexRunStartedData;
|
|
257
|
-
};
|
|
258
|
-
export type AexRunFinishedEvent = AexEventBase & {
|
|
259
|
-
readonly type: "RUN_FINISHED";
|
|
260
|
-
readonly data: AexRunFinishedData;
|
|
261
|
-
};
|
|
262
|
-
export type AexRunErrorEvent = AexEventBase & {
|
|
263
|
-
readonly type: "RUN_ERROR";
|
|
264
|
-
readonly data: AexRunErrorData;
|
|
265
|
-
};
|
|
266
|
-
export type AexTextMessageEvent = AexEventBase & {
|
|
267
|
-
readonly type: "TEXT_MESSAGE_CONTENT";
|
|
268
|
-
readonly data: AexTextMessageData;
|
|
269
|
-
};
|
|
270
|
-
export type AexToolCallStartEvent = AexEventBase & {
|
|
271
|
-
readonly type: "TOOL_CALL_START";
|
|
272
|
-
readonly data: AexToolCallStartData;
|
|
273
|
-
};
|
|
274
|
-
export type AexToolCallResultEvent = AexEventBase & {
|
|
275
|
-
readonly type: "TOOL_CALL_RESULT";
|
|
276
|
-
readonly data: AexToolCallResultData;
|
|
277
|
-
};
|
|
278
|
-
export type AexCustomEvent<Name extends string = string> = AexEventBase & {
|
|
279
|
-
readonly type: "CUSTOM";
|
|
280
|
-
readonly data: AexCustomData<Name>;
|
|
281
|
-
};
|
|
282
|
-
export type AexLogEvent = AexEventBase & {
|
|
283
|
-
readonly type: "LOG";
|
|
284
|
-
readonly channel: "log";
|
|
285
|
-
readonly level: AexLogLevel;
|
|
286
|
-
readonly data: AexLogData;
|
|
287
|
-
};
|
|
288
|
-
/** All public event shapes this package currently understands. */
|
|
289
|
-
export type KnownAexEventBase = AexRunStartedEvent | AexRunFinishedEvent | AexRunErrorEvent | AexTextMessageEvent | AexToolCallStartEvent | AexToolCallResultEvent | AexCustomEvent | AexLogEvent;
|
|
290
|
-
/** A validated known durable event. Raw {@link AexEvent} deliberately remains open. */
|
|
291
|
-
export type KnownAexEvent = AexEvent & KnownAexEventBase;
|
|
292
|
-
/** A validated known provisional event. */
|
|
293
|
-
export type KnownAexLiveEvent = AexLiveEvent & KnownAexEventBase;
|
|
294
|
-
/** A validated known durable or provisional stream event. */
|
|
295
|
-
export type KnownAexStreamEvent = AexStreamEvent & KnownAexEventBase;
|
|
296
|
-
/** Stable diagnostic for a recognized type whose payload violates its contract. */
|
|
297
|
-
export interface MalformedAexEventIssue {
|
|
298
|
-
readonly code: "malformed_known_event";
|
|
299
|
-
readonly type: (typeof AEX_EVENT_TYPES)[number];
|
|
300
|
-
readonly path: string;
|
|
301
|
-
readonly expected: string;
|
|
302
|
-
}
|
|
303
|
-
/** Explicit failure thrown when a malformed known event is projected. */
|
|
304
|
-
export declare class MalformedAexEventError extends Error {
|
|
305
|
-
readonly code: "malformed_known_event";
|
|
306
|
-
readonly issue: MalformedAexEventIssue;
|
|
307
|
-
constructor(issue: MalformedAexEventIssue);
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Result of classifying an open event without changing it. Unknown future types
|
|
311
|
-
* remain raw; malformed recognized types are a separate, explicit state.
|
|
312
|
-
*/
|
|
313
|
-
export type AexEventClassification<T extends AexEventBase = AexEventBase> = {
|
|
314
|
-
readonly kind: "known";
|
|
315
|
-
readonly event: T & KnownAexEventBase;
|
|
316
|
-
} | {
|
|
317
|
-
readonly kind: "unknown";
|
|
318
|
-
readonly event: T;
|
|
319
|
-
} | {
|
|
320
|
-
readonly kind: "malformed_known";
|
|
321
|
-
readonly event: T;
|
|
322
|
-
readonly issue: MalformedAexEventIssue;
|
|
323
|
-
};
|
|
324
|
-
/** True only for a provisional frame outside the durable replay sequence. */
|
|
325
|
-
export declare function isAexLiveEvent(event: AexStreamEvent): event is AexLiveEvent;
|
|
326
|
-
/** True only for a durable event carrying a replay cursor. */
|
|
327
|
-
export declare function isReplayableEvent(event: AexStreamEvent): event is AexEvent;
|
|
328
|
-
/** Compatibility spelling used by the hosted platform. */
|
|
329
|
-
export declare const isReplayableAexEvent: typeof isReplayableEvent;
|
|
330
|
-
/** Context the mapper needs to stamp absolute identity/time onto an event. */
|
|
331
|
-
export interface AexEventContext {
|
|
332
|
-
readonly sessionId: string;
|
|
333
|
-
/** The real AG-UI run id for the session turn being projected. */
|
|
334
|
-
readonly runId: string;
|
|
335
|
-
/**
|
|
336
|
-
* Run-start epoch ms. The RunnerEvent's `tMs` is relative to this, so
|
|
337
|
-
* `time = new Date(baseMs + tMs)`. Pass the session's `createdAtMs`.
|
|
338
|
-
*/
|
|
339
|
-
readonly baseMs: number;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Project a {@link RunnerEvent} onto the unified public envelope. Internal
|
|
343
|
-
* runtime completion has no public projection: only the platform-authored
|
|
344
|
-
* RUN_FINISHED/RUN_ERROR event is a completion boundary.
|
|
345
|
-
*/
|
|
346
|
-
export declare function runnerEventToAexEvent(evt: RunnerEvent, ctx: AexEventContext): AexEvent | null;
|
|
347
|
-
/** A log line as a producer hands it to {@link logToInbound} (pre-coordinator). */
|
|
348
|
-
export interface AexLogLine {
|
|
349
|
-
readonly level: AexLogLevel;
|
|
350
|
-
readonly message: string;
|
|
351
|
-
readonly fields?: Readonly<Record<string, JsonValue>>;
|
|
352
|
-
/** Source wall-clock ms at emit. */
|
|
353
|
-
readonly emittedAt: number;
|
|
354
|
-
/** Per-source monotonic counter assigned at the source. */
|
|
355
|
-
readonly sourceSeq: number;
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* The inbound (pre-seq) envelope a producer POSTs for a `channel: "log"` line.
|
|
359
|
-
* The coordinator stamps `specversion`/`id`/`subject`/`sequence` (the ordering
|
|
360
|
-
* authority) AND `receivedAt` (its authoritative receive time) on ingest, so a
|
|
361
|
-
* producer never supplies any of them.
|
|
362
|
-
*/
|
|
363
|
-
export type AexInboundLog = Omit<AexEvent, "specversion" | "id" | "subject" | "threadId" | "runId" | "sequence" | "receivedAt">;
|
|
364
|
-
/**
|
|
365
|
-
* Project a log line onto an inbound coordinator envelope. The coordinator
|
|
366
|
-
* stamps `specversion`/`id`/`subject`/`sequence` on ingest (it is the ordering
|
|
367
|
-
* authority); everything else — `channel`, `source`, `sourceSeq`, `emittedAt`,
|
|
368
|
-
* and the `LOG` payload — is supplied here.
|
|
369
|
-
*/
|
|
370
|
-
export declare function logToInbound(source: AexEventSource, line: AexLogLine): AexInboundLog;
|
|
371
|
-
/** Classify an open event without cloning or rewriting it. */
|
|
372
|
-
export declare function classifyAexEvent<T extends AexEventBase>(event: T): AexEventClassification<T>;
|
|
373
|
-
/** True only for a currently understood event with a valid payload. */
|
|
374
|
-
export declare function isKnownAexEvent<T extends AexEventBase>(e: T): e is T & KnownAexEventBase;
|
|
375
|
-
export declare function isRunStarted<T extends AexEventBase>(e: T): e is T & AexRunStartedEvent;
|
|
376
|
-
export declare function isRunFinished<T extends AexEventBase>(e: T): e is T & AexRunFinishedEvent;
|
|
377
|
-
export declare function isRunError<T extends AexEventBase>(e: T): e is T & AexRunErrorEvent;
|
|
378
|
-
/** A valid terminal event of either flavour (finished or error). */
|
|
379
|
-
export declare function isRunTerminal<T extends AexEventBase>(e: T): e is T & (AexRunFinishedEvent | AexRunErrorEvent);
|
|
380
|
-
export declare function isTextMessage<T extends AexEventBase>(e: T): e is T & AexTextMessageEvent;
|
|
381
|
-
export declare function isToolCallStart<T extends AexEventBase>(e: T): e is T & AexToolCallStartEvent;
|
|
382
|
-
export declare function isToolCallResult<T extends AexEventBase>(e: T): e is T & AexToolCallResultEvent;
|
|
383
|
-
export declare function isCustom<T extends AexEventBase>(e: T): e is T & AexCustomEvent;
|
|
384
|
-
/** The `aex.*` name of a valid CUSTOM event, or null otherwise. */
|
|
385
|
-
export declare function customName(e: AexEventBase): string | null;
|
|
386
|
-
/**
|
|
387
|
-
* The CUSTOM `data.name` of the HITL write-gate park: the session has reached the
|
|
388
|
-
* `awaiting_approval` state before a gated action and is holding for an
|
|
389
|
-
* `approve()`/`deny()`. Structural (independent of model prose).
|
|
390
|
-
*/
|
|
391
|
-
export declare const AEX_SESSION_AWAITING_APPROVAL_NAME = "aex.session.awaiting_approval";
|
|
392
|
-
/** The CUSTOM `data.name` carrying a schema-decoded value (`{ value }`). */
|
|
393
|
-
export declare const AEX_RESULT_DECODED_NAME = "aex.result.decoded";
|
|
394
|
-
/** The CUSTOM `data.name` carrying a typed decode refusal (`{ reason, detail? }`). */
|
|
395
|
-
export declare const AEX_RESULT_REFUSED_NAME = "aex.result.refused";
|
|
396
|
-
/** True for the HITL `awaiting_approval` gate event. */
|
|
397
|
-
export declare function isAwaitingApproval<T extends AexEventBase>(e: T): e is T & AexCustomEvent<typeof AEX_SESSION_AWAITING_APPROVAL_NAME>;
|
|
398
|
-
/** True for a schema-decoded terminal result event. */
|
|
399
|
-
export declare function isResultDecoded<T extends AexEventBase>(e: T): e is T & AexCustomEvent<typeof AEX_RESULT_DECODED_NAME>;
|
|
400
|
-
/** True for a typed decode-refusal terminal result event. */
|
|
401
|
-
export declare function isResultRefused<T extends AexEventBase>(e: T): e is T & AexCustomEvent<typeof AEX_RESULT_REFUSED_NAME>;
|
|
402
|
-
export declare function isFromSource(e: AexEventBase, source: AexEventSource): boolean;
|
|
403
|
-
/** The channel a record rides, defaulting an absent value to `"event"`. */
|
|
404
|
-
export declare function channelOf(e: AexEventBase): AexEventChannel;
|
|
405
|
-
/** True when a record is a valid log line (the `log` channel / `LOG` type). */
|
|
406
|
-
export declare function isLog<T extends AexEventBase>(e: T): e is T & AexLogEvent;
|
|
407
|
-
/** True when a record is a typed AG-UI event (the `event` channel). */
|
|
408
|
-
export declare function isEventChannel(e: AexEventBase): boolean;
|
|
409
|
-
/**
|
|
410
|
-
* The coordinator's embedded store caps a
|
|
411
|
-
* single row at 2 MB. Events whose serialized form exceeds the budget must be
|
|
412
|
-
* split before insert (the coordinator's responsibility); the archive uses the
|
|
413
|
-
* same bound. A conservative margin under the hard 2 MiB leaves room for row
|
|
414
|
-
* overhead and column framing.
|
|
415
|
-
*/
|
|
416
|
-
export declare const EVENT_ROW_MAX_BYTES: 2000000;
|
|
417
|
-
/** Serialized UTF-8 byte length of an event (the size the row must hold). */
|
|
418
|
-
export declare function serializedEventBytes(e: AexEvent): number;
|
|
419
|
-
/** True when an event's serialized form exceeds the row budget and must be split. */
|
|
420
|
-
export declare function exceedsRowBudget(e: AexEvent, max?: number): boolean;
|
|
421
|
-
/**
|
|
422
|
-
* AG-UI events aex projects to. Each carries the AG-UI `type` discriminant
|
|
423
|
-
* and a numeric `timestamp` (ms), plus the type-specific fields an off-the-shelf
|
|
424
|
-
* AG-UI client expects. Aex's envelope extensions (`source`, `message`, the
|
|
425
|
-
* CloudEvents framing) are dropped — `rawEvent` carries the original for clients
|
|
426
|
-
* that want it.
|
|
427
|
-
*/
|
|
428
|
-
export type AguiEvent = {
|
|
429
|
-
type: "RUN_STARTED";
|
|
430
|
-
timestamp: number;
|
|
431
|
-
threadId: string;
|
|
432
|
-
runId: string;
|
|
433
|
-
} | {
|
|
434
|
-
type: "RUN_FINISHED";
|
|
435
|
-
timestamp: number;
|
|
436
|
-
threadId: string;
|
|
437
|
-
runId: string;
|
|
438
|
-
result?: JsonValue;
|
|
439
|
-
} | {
|
|
440
|
-
type: "RUN_ERROR";
|
|
441
|
-
timestamp: number;
|
|
442
|
-
message: string;
|
|
443
|
-
code?: string;
|
|
444
|
-
} | {
|
|
445
|
-
type: "TEXT_MESSAGE_CONTENT";
|
|
446
|
-
timestamp: number;
|
|
447
|
-
messageId: string;
|
|
448
|
-
delta: string;
|
|
449
|
-
} | {
|
|
450
|
-
type: "TOOL_CALL_START";
|
|
451
|
-
timestamp: number;
|
|
452
|
-
toolCallId: string;
|
|
453
|
-
toolCallName: string;
|
|
454
|
-
} | {
|
|
455
|
-
type: "TOOL_CALL_RESULT";
|
|
456
|
-
timestamp: number;
|
|
457
|
-
messageId: string;
|
|
458
|
-
toolCallId: string;
|
|
459
|
-
content: JsonValue;
|
|
460
|
-
} | {
|
|
461
|
-
type: "CUSTOM";
|
|
462
|
-
timestamp: number;
|
|
463
|
-
name: string;
|
|
464
|
-
value: JsonValue;
|
|
465
|
-
};
|
|
466
|
-
/**
|
|
467
|
-
* Project an aex envelope to a strict AG-UI event so an off-the-shelf
|
|
468
|
-
* AG-UI client can consume an aex start with no glue. This is the
|
|
469
|
-
* client-side projection the SDK exposes.
|
|
470
|
-
*/
|
|
471
|
-
export declare function toAGUI(e: AexEventBase): AguiEvent;
|