@aexhq/sdk 0.39.0 → 0.40.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 (88) hide show
  1. package/README.md +22 -16
  2. package/dist/_contracts/api-key.d.ts +49 -0
  3. package/dist/_contracts/api-key.js +87 -0
  4. package/dist/_contracts/bundle-manifest.d.ts +86 -0
  5. package/dist/_contracts/bundle-manifest.js +157 -0
  6. package/dist/_contracts/error-codes.d.ts +26 -0
  7. package/dist/_contracts/error-codes.js +79 -0
  8. package/dist/_contracts/error-factory.d.ts +32 -0
  9. package/dist/_contracts/error-factory.js +142 -0
  10. package/dist/_contracts/event-envelope.d.ts +33 -10
  11. package/dist/_contracts/event-envelope.js +46 -10
  12. package/dist/_contracts/event-view.d.ts +123 -0
  13. package/dist/_contracts/event-view.js +120 -0
  14. package/dist/_contracts/http.js +12 -3
  15. package/dist/_contracts/index.d.ts +8 -4
  16. package/dist/_contracts/index.js +11 -7
  17. package/dist/_contracts/models.d.ts +15 -0
  18. package/dist/_contracts/models.js +33 -0
  19. package/dist/_contracts/operations.d.ts +50 -2
  20. package/dist/_contracts/operations.js +100 -7
  21. package/dist/_contracts/run-record.d.ts +3 -2
  22. package/dist/_contracts/runtime-types.d.ts +126 -36
  23. package/dist/_contracts/runtime-types.js +33 -1
  24. package/dist/_contracts/sdk-errors.d.ts +61 -2
  25. package/dist/_contracts/sdk-errors.js +83 -3
  26. package/dist/_contracts/sdk-secrets.js +31 -6
  27. package/dist/_contracts/stable.d.ts +14 -0
  28. package/dist/_contracts/stable.js +14 -0
  29. package/dist/_contracts/status.d.ts +28 -1
  30. package/dist/_contracts/status.js +48 -3
  31. package/dist/_contracts/submission.d.ts +79 -2
  32. package/dist/_contracts/submission.js +148 -5
  33. package/dist/_contracts/suggest.d.ts +15 -0
  34. package/dist/_contracts/suggest.js +54 -0
  35. package/dist/asset-upload.d.ts +26 -0
  36. package/dist/asset-upload.js +218 -3
  37. package/dist/asset-upload.js.map +1 -1
  38. package/dist/bundle.d.ts +14 -3
  39. package/dist/bundle.js +34 -14
  40. package/dist/bundle.js.map +1 -1
  41. package/dist/canonical-zip.d.ts +68 -0
  42. package/dist/canonical-zip.js +307 -0
  43. package/dist/canonical-zip.js.map +1 -0
  44. package/dist/cli.mjs +1900 -340
  45. package/dist/cli.mjs.sha256 +1 -1
  46. package/dist/client.d.ts +217 -58
  47. package/dist/client.js +746 -261
  48. package/dist/client.js.map +1 -1
  49. package/dist/file.d.ts +33 -6
  50. package/dist/file.js +120 -54
  51. package/dist/file.js.map +1 -1
  52. package/dist/index.d.ts +17 -8
  53. package/dist/index.js +26 -9
  54. package/dist/index.js.map +1 -1
  55. package/dist/node-fs.d.ts +26 -9
  56. package/dist/node-fs.js +13 -38
  57. package/dist/node-fs.js.map +1 -1
  58. package/dist/node-walk.d.ts +69 -0
  59. package/dist/node-walk.js +146 -0
  60. package/dist/node-walk.js.map +1 -0
  61. package/dist/retry.d.ts +9 -13
  62. package/dist/retry.js +18 -17
  63. package/dist/retry.js.map +1 -1
  64. package/dist/skill.d.ts +16 -4
  65. package/dist/skill.js +18 -9
  66. package/dist/skill.js.map +1 -1
  67. package/dist/tool.d.ts +14 -2
  68. package/dist/tool.js +33 -7
  69. package/dist/tool.js.map +1 -1
  70. package/dist/version.d.ts +1 -1
  71. package/dist/version.js +1 -1
  72. package/docs/authentication.md +29 -5
  73. package/docs/billing.md +6 -0
  74. package/docs/concepts/agent-tools.md +11 -0
  75. package/docs/defaults.md +1 -0
  76. package/docs/errors.md +64 -4
  77. package/docs/events.md +84 -49
  78. package/docs/limits-and-quotas.md +24 -0
  79. package/docs/networking.md +7 -1
  80. package/docs/outputs.md +36 -7
  81. package/docs/quickstart.md +17 -7
  82. package/docs/run-config.md +3 -3
  83. package/docs/secrets.md +14 -0
  84. package/examples/feature-tour.ts +4 -6
  85. package/examples/spike-settle-latency.ts +125 -0
  86. package/package.json +4 -3
  87. package/dist/_contracts/event-guards.d.ts +0 -67
  88. package/dist/_contracts/event-guards.js +0 -36
@@ -1,67 +0,0 @@
1
- /**
2
- * Type-narrowing guards over the loose {@link RunEvent} `listEvents` shape.
3
- *
4
- * The envelope guards in `event-envelope.ts` operate on the coordinator
5
- * {@link import("./event-envelope.js").AexEvent} and return a plain `boolean`.
6
- * These mirror the same AG-UI discriminants but operate on the {@link RunEvent}
7
- * snapshot shape returned by `listEvents` / `RunResult.events` and NARROW
8
- * `event.data` to the fields that event type carries, so a consumer reads
9
- * `event.data.text` (etc.) without a manual cast.
10
- *
11
- * They are DISCRIMINANT-only at runtime (they test `event.type`), matching the
12
- * envelope guards: the narrowed `data` shape is a typing convenience, not a deep
13
- * runtime validation. Parse/verify the payload fields before trusting them when
14
- * the producer is untrusted.
15
- *
16
- * The parameter is the minimal `{ type }` discriminant both the {@link RunEvent}
17
- * snapshot and the coordinator `AexEvent` envelope satisfy, so the guards accept
18
- * either shape while narrowing to the {@link RunEvent}-typed payloads.
19
- */
20
- import type { RunEvent } from "./runtime-types.js";
21
- /** A `TEXT_MESSAGE_CONTENT` run event with its assistant-text payload narrowed. */
22
- export interface TextMessageRunEvent extends RunEvent {
23
- readonly type: "TEXT_MESSAGE_CONTENT";
24
- readonly data: {
25
- readonly text: string;
26
- readonly messageId?: string;
27
- };
28
- }
29
- /** A `TOOL_CALL_START` run event with the tool-call id/name/args narrowed. */
30
- export interface ToolCallStartRunEvent extends RunEvent {
31
- readonly type: "TOOL_CALL_START";
32
- readonly data: {
33
- readonly id: string;
34
- readonly name: string;
35
- readonly arguments?: Record<string, unknown>;
36
- };
37
- }
38
- /** A `TOOL_CALL_RESULT` run event with the correlating id + result narrowed. */
39
- export interface ToolCallResultRunEvent extends RunEvent {
40
- readonly type: "TOOL_CALL_RESULT";
41
- readonly data: {
42
- readonly id: string;
43
- readonly content?: unknown;
44
- readonly isError?: boolean;
45
- };
46
- }
47
- /** A terminal `RUN_FINISHED` run event. */
48
- export interface RunFinishedRunEvent extends RunEvent {
49
- readonly type: "RUN_FINISHED";
50
- readonly data: Record<string, unknown>;
51
- }
52
- /** True for an assistant text event; narrows `event.data.text` to `string`. */
53
- export declare function isTextMessage(event: {
54
- readonly type: string;
55
- }): event is TextMessageRunEvent;
56
- /** True for a tool-call start event; narrows `event.data` to `{ id, name }`. */
57
- export declare function isToolCallStart(event: {
58
- readonly type: string;
59
- }): event is ToolCallStartRunEvent;
60
- /** True for a tool-call result event; narrows `event.data` to `{ id, content }`. */
61
- export declare function isToolCallResult(event: {
62
- readonly type: string;
63
- }): event is ToolCallResultRunEvent;
64
- /** True for the terminal success event; narrows `event.data` to a record. */
65
- export declare function isRunFinished(event: {
66
- readonly type: string;
67
- }): event is RunFinishedRunEvent;
@@ -1,36 +0,0 @@
1
- /**
2
- * Type-narrowing guards over the loose {@link RunEvent} `listEvents` shape.
3
- *
4
- * The envelope guards in `event-envelope.ts` operate on the coordinator
5
- * {@link import("./event-envelope.js").AexEvent} and return a plain `boolean`.
6
- * These mirror the same AG-UI discriminants but operate on the {@link RunEvent}
7
- * snapshot shape returned by `listEvents` / `RunResult.events` and NARROW
8
- * `event.data` to the fields that event type carries, so a consumer reads
9
- * `event.data.text` (etc.) without a manual cast.
10
- *
11
- * They are DISCRIMINANT-only at runtime (they test `event.type`), matching the
12
- * envelope guards: the narrowed `data` shape is a typing convenience, not a deep
13
- * runtime validation. Parse/verify the payload fields before trusting them when
14
- * the producer is untrusted.
15
- *
16
- * The parameter is the minimal `{ type }` discriminant both the {@link RunEvent}
17
- * snapshot and the coordinator `AexEvent` envelope satisfy, so the guards accept
18
- * either shape while narrowing to the {@link RunEvent}-typed payloads.
19
- */
20
- /** True for an assistant text event; narrows `event.data.text` to `string`. */
21
- export function isTextMessage(event) {
22
- return event.type === "TEXT_MESSAGE_CONTENT";
23
- }
24
- /** True for a tool-call start event; narrows `event.data` to `{ id, name }`. */
25
- export function isToolCallStart(event) {
26
- return event.type === "TOOL_CALL_START";
27
- }
28
- /** True for a tool-call result event; narrows `event.data` to `{ id, content }`. */
29
- export function isToolCallResult(event) {
30
- return event.type === "TOOL_CALL_RESULT";
31
- }
32
- /** True for the terminal success event; narrows `event.data` to a record. */
33
- export function isRunFinished(event) {
34
- return event.type === "RUN_FINISHED";
35
- }
36
- //# sourceMappingURL=event-guards.js.map