@aexhq/sdk 0.31.0 → 0.33.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 (43) hide show
  1. package/README.md +29 -31
  2. package/dist/_contracts/event-stream-client.d.ts +2 -2
  3. package/dist/_contracts/event-stream-client.js +3 -3
  4. package/dist/_contracts/index.d.ts +0 -1
  5. package/dist/_contracts/index.js +0 -1
  6. package/dist/_contracts/models.d.ts +0 -76
  7. package/dist/_contracts/models.js +0 -20
  8. package/dist/_contracts/operations.d.ts +15 -18
  9. package/dist/_contracts/operations.js +81 -40
  10. package/dist/_contracts/post-hook.d.ts +4 -4
  11. package/dist/_contracts/post-hook.js +1 -1
  12. package/dist/_contracts/run-config.d.ts +0 -4
  13. package/dist/_contracts/run-config.js +0 -7
  14. package/dist/_contracts/run-unit.js +4 -4
  15. package/dist/_contracts/runtime-types.d.ts +86 -2
  16. package/dist/_contracts/status.d.ts +3 -1
  17. package/dist/_contracts/status.js +17 -0
  18. package/dist/_contracts/submission.d.ts +1 -10
  19. package/dist/_contracts/submission.js +0 -4
  20. package/dist/cli.mjs +118 -135
  21. package/dist/cli.mjs.sha256 +1 -1
  22. package/dist/client.d.ts +118 -72
  23. package/dist/client.js +427 -96
  24. package/dist/client.js.map +1 -1
  25. package/dist/index.d.ts +5 -4
  26. package/dist/index.js +3 -2
  27. package/dist/index.js.map +1 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/version.js +1 -1
  30. package/docs/cleanup.md +2 -2
  31. package/docs/credentials.md +3 -3
  32. package/docs/defaults.md +0 -2
  33. package/docs/events.md +32 -13
  34. package/docs/limits.md +4 -3
  35. package/docs/outputs.md +2 -2
  36. package/docs/provider-runtime-capabilities.md +2 -2
  37. package/docs/public-surface.json +15 -10
  38. package/docs/quickstart.md +38 -12
  39. package/docs/run-config.md +3 -8
  40. package/docs/secrets.md +2 -2
  41. package/docs/skills.md +4 -4
  42. package/docs/vision-skills.md +2 -2
  43. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ import type { SessionStatus } from "./status.js";
2
+ import type { PlatformRunSubmissionInput, PlatformSubmission } from "./submission.js";
1
3
  /**
2
4
  * Loose record describing a run as the dashboard BFF returns it. Concrete
3
5
  * dashboard-managed fields appear in the index signature; the SDK and CLI
@@ -38,6 +40,90 @@ export interface Run {
38
40
  readonly runtimeManifest?: import("./runtime-manifest.js").RuntimeManifest;
39
41
  readonly [key: string]: unknown;
40
42
  }
43
+ export type SessionTurnStatus = "none" | "launching" | "running" | "parking" | "idle" | "suspended" | "failed";
44
+ export interface SessionTurn {
45
+ readonly sessionId: string;
46
+ readonly turnSeq: number;
47
+ readonly turnId?: string;
48
+ readonly status?: SessionTurnStatus;
49
+ readonly startedAt?: string;
50
+ readonly endedAt?: string | null;
51
+ readonly eventCursor?: number;
52
+ }
53
+ export interface Session {
54
+ readonly id: string;
55
+ readonly sessionId?: string;
56
+ readonly status: SessionStatus | string;
57
+ readonly turnSeq?: number;
58
+ readonly turnStatus?: SessionTurnStatus;
59
+ /** How long the session may remain idle before it is suspended. */
60
+ readonly idleTtl?: string;
61
+ readonly idleTtlMs?: number;
62
+ readonly createdAt?: string;
63
+ readonly updatedAt?: string;
64
+ readonly idleAt?: string | null;
65
+ readonly suspendedAt?: string | null;
66
+ readonly activeDurationMs?: number;
67
+ readonly lastTurnDurationMs?: number;
68
+ readonly retainedStorageBytes?: number;
69
+ readonly usage?: UsageSummary;
70
+ readonly costUsd?: number;
71
+ readonly errorMessage?: string | null;
72
+ readonly [key: string]: unknown;
73
+ }
74
+ export interface SessionSummary {
75
+ readonly id: string;
76
+ readonly sessionId?: string;
77
+ readonly status: SessionStatus | string;
78
+ readonly turnSeq?: number;
79
+ /** How long the session may remain idle before it is suspended. */
80
+ readonly idleTtl?: string;
81
+ readonly idleTtlMs?: number;
82
+ readonly createdAt: string;
83
+ readonly updatedAt: string;
84
+ readonly idleAt?: string | null;
85
+ readonly suspendedAt?: string | null;
86
+ readonly activeDurationMs?: number;
87
+ readonly retainedStorageBytes?: number;
88
+ readonly costUsd?: number;
89
+ }
90
+ export interface SessionListQuery {
91
+ readonly status?: string;
92
+ readonly since?: string;
93
+ readonly limit?: number;
94
+ readonly cursor?: string;
95
+ }
96
+ export interface SessionListPage {
97
+ readonly sessions: readonly SessionSummary[];
98
+ readonly nextCursor?: string;
99
+ }
100
+ export interface SessionRetentionPolicy {
101
+ /** How long the session may remain idle before it is suspended. */
102
+ readonly idleTtl?: string;
103
+ }
104
+ export type SessionSubmission = Omit<PlatformSubmission, "prompt"> & {
105
+ readonly prompt?: readonly string[];
106
+ };
107
+ export type SessionCreateRequest = Omit<PlatformRunSubmissionInput, "idempotencyKey" | "submission"> & {
108
+ readonly submission: SessionSubmission;
109
+ readonly input?: string | readonly string[];
110
+ readonly retention?: SessionRetentionPolicy;
111
+ };
112
+ export interface SessionMessageRequest {
113
+ readonly input: string | readonly string[];
114
+ readonly metadata?: Readonly<Record<string, unknown>>;
115
+ }
116
+ export interface SessionMessageAccepted {
117
+ readonly session: Session;
118
+ readonly turn: SessionTurn;
119
+ readonly eventCursor?: number;
120
+ }
121
+ export interface SessionStateChangeAccepted {
122
+ readonly session: Session;
123
+ readonly turn?: SessionTurn;
124
+ readonly eventCursor?: number;
125
+ }
126
+ export type SessionEvent = import("./event-envelope.js").AexEvent;
41
127
  export interface UsageSummary {
42
128
  readonly inputTokens?: number;
43
129
  readonly outputTokens?: number;
@@ -260,8 +346,6 @@ export interface OutputLink {
260
346
  readonly output?: Output;
261
347
  readonly [key: string]: unknown;
262
348
  }
263
- /** @deprecated Renamed to {@link OutputLink}. */
264
- export type SignedOutputLink = OutputLink;
265
349
  export interface WhoAmI {
266
350
  readonly principalType: "api_token" | "user";
267
351
  readonly workspaceId?: string;
@@ -1,5 +1,7 @@
1
- export declare const RUN_STATUSES: readonly ["queued", "claiming", "provisioning", "session_created", "dispatched", "provider_running", "provider_idle", "provider_rescheduled", "cancelling", "capturing_outputs", "cleaning_up", "succeeded", "failed", "timed_out", "cancelled", "cleanup_failed"];
1
+ export declare const RUN_STATUSES: readonly ["queued", "claiming", "provisioning", "session_created", "dispatched", "provider_running", "provider_idle", "provider_rescheduled", "idle", "suspending", "suspended", "deleting", "deleted", "expired", "cancelling", "capturing_outputs", "cleaning_up", "succeeded", "failed", "timed_out", "cancelled", "cleanup_failed"];
2
2
  export type RunStatus = typeof RUN_STATUSES[number];
3
+ export declare const SESSION_STATUSES: readonly ["creating", "running", "idle", "suspending", "suspended", "cancelling", "deleting", "deleted", "error"];
4
+ export type SessionStatus = typeof SESSION_STATUSES[number];
3
5
  export type RunStatusKind = "active" | "terminal";
4
6
  export declare const TERMINAL_RUN_STATUSES: readonly ["succeeded", "failed", "timed_out", "cancelled", "cleanup_failed"];
5
7
  export declare function isTerminalRunStatus(status: RunStatus): boolean;
@@ -7,6 +7,12 @@ export const RUN_STATUSES = [
7
7
  "provider_running",
8
8
  "provider_idle",
9
9
  "provider_rescheduled",
10
+ "idle",
11
+ "suspending",
12
+ "suspended",
13
+ "deleting",
14
+ "deleted",
15
+ "expired",
10
16
  "cancelling",
11
17
  "capturing_outputs",
12
18
  "cleaning_up",
@@ -16,6 +22,17 @@ export const RUN_STATUSES = [
16
22
  "cancelled",
17
23
  "cleanup_failed"
18
24
  ];
25
+ export const SESSION_STATUSES = [
26
+ "creating",
27
+ "running",
28
+ "idle",
29
+ "suspending",
30
+ "suspended",
31
+ "cancelling",
32
+ "deleting",
33
+ "deleted",
34
+ "error"
35
+ ];
19
36
  export const TERMINAL_RUN_STATUSES = [
20
37
  "succeeded",
21
38
  "failed",
@@ -2,7 +2,6 @@ import { PROXY_ENDPOINT_DEFAULTS, type ProxyAuthShape, type ProxyMethod, type Pr
2
2
  export { PROXY_ENDPOINT_DEFAULTS };
3
3
  import type { AgentsMdRef, FileRef, McpServerRef, SkillRef, ToolRef } from "./run-config.js";
4
4
  import { type RuntimeSize } from "./runtime-sizes.js";
5
- import { type PlatformPostHook, type PlatformPostHookInput } from "./post-hook.js";
6
5
  import { type RunModel } from "./models.js";
7
6
  import { type RuntimeSecurityProfileName } from "./runtime-security-profile.js";
8
7
  export type JsonPrimitive = string | number | boolean | null;
@@ -395,13 +394,6 @@ export interface PlatformRunSubmissionRequest {
395
394
  * terminal wait window and self-kill deadline.
396
395
  */
397
396
  readonly timeoutMs?: number;
398
- /**
399
- * Optional post-agent-run verifier. Parsed from the public `postHook`
400
- * duration/string shape into fixed runner budgets. The runner executes it
401
- * after a successful agent process and sends failures back through the model
402
- * for repair until this budget is exhausted.
403
- */
404
- readonly postHook?: PlatformPostHook;
405
397
  /**
406
398
  * Lineage parent (agent-session §9). When present the server admits this
407
399
  * run as a CHILD of `parentRunId`: it walks the parent's lineage, enforces
@@ -466,7 +458,7 @@ export interface RunLimits {
466
458
  * {@link DEFAULT_RUN_PROVIDER} (`anthropic`). The parser fills it in
467
459
  * before the value enters the run snapshot.
468
460
  */
469
- export type PlatformRunSubmissionInput = Omit<PlatformRunSubmissionRequest, "workspaceId" | "provider" | "timeoutMs" | "postHook"> & {
461
+ export type PlatformRunSubmissionInput = Omit<PlatformRunSubmissionRequest, "workspaceId" | "provider" | "timeoutMs"> & {
470
462
  readonly workspaceId?: string;
471
463
  readonly provider?: RunProvider;
472
464
  /**
@@ -475,7 +467,6 @@ export type PlatformRunSubmissionInput = Omit<PlatformRunSubmissionRequest, "wor
475
467
  * {@link PlatformRunSubmissionRequest.timeoutMs}. Absent ⇒ 1h default.
476
468
  */
477
469
  readonly timeout?: string;
478
- readonly postHook?: PlatformPostHookInput;
479
470
  };
480
471
  export interface ParseRunSubmissionOptions {
481
472
  }
@@ -6,7 +6,6 @@ import { authShapeHeaderName, PROXY_ALLOWED_METHODS, PROXY_ENDPOINT_DEFAULTS, PR
6
6
  export { PROXY_ENDPOINT_DEFAULTS };
7
7
  import { TOOL_NAME_PATTERN, normaliseSkillBundlePath, parseAssetRefFields, parseMcpServerRef, parseSkillRef } from "./run-config.js";
8
8
  import { parseRunTimeout, parseRuntimeSize } from "./runtime-sizes.js";
9
- import { parsePostHook } from "./post-hook.js";
10
9
  import { assertRunModelMatchesProvider, parseRunModel } from "./models.js";
11
10
  import { parseRuntimeSecurityProfile } from "./runtime-security-profile.js";
12
11
  /**
@@ -994,7 +993,6 @@ export function parseRunSubmissionRequest(input, options = {}) {
994
993
  "submission",
995
994
  "runtimeSize",
996
995
  "timeout",
997
- "postHook",
998
996
  "proxyEndpoints",
999
997
  "parentRunId",
1000
998
  "webhook",
@@ -1027,7 +1025,6 @@ export function parseRunSubmissionRequest(input, options = {}) {
1027
1025
  const parentRunId = optionalString(value.parentRunId, "submission.parentRunId");
1028
1026
  const webhook = parseRunWebhook(value.webhook);
1029
1027
  const limits = parseRunLimits(value.limits);
1030
- const postHook = parsePostHook(value.postHook, "submission.postHook");
1031
1028
  const proxyEndpoints = parseProxyEndpoints(value.proxyEndpoints);
1032
1029
  const secrets = parseInlineSecrets(value.secrets);
1033
1030
  enforceCredentialSecretPolicy(secrets, provider, {
@@ -1062,7 +1059,6 @@ export function parseRunSubmissionRequest(input, options = {}) {
1062
1059
  submission,
1063
1060
  ...(runtimeSize ? { runtimeSize } : {}),
1064
1061
  ...(timeoutMs !== undefined ? { timeoutMs } : {}),
1065
- ...(postHook !== undefined ? { postHook } : {}),
1066
1062
  ...(proxyEndpoints ? { proxyEndpoints } : {}),
1067
1063
  ...(parentRunId !== undefined ? { parentRunId } : {}),
1068
1064
  ...(webhook !== undefined ? { webhook } : {}),
package/dist/cli.mjs CHANGED
@@ -3323,14 +3323,14 @@ var init_files = __esm({
3323
3323
  });
3324
3324
 
3325
3325
  // ../../node_modules/.bun/@anthropic-ai+sdk@0.106.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs
3326
- var Models;
3326
+ var Models2;
3327
3327
  var init_models = __esm({
3328
3328
  "../../node_modules/.bun/@anthropic-ai+sdk@0.106.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs"() {
3329
3329
  init_resource();
3330
3330
  init_pagination();
3331
3331
  init_headers();
3332
3332
  init_path();
3333
- Models = class extends APIResource {
3333
+ Models2 = class extends APIResource {
3334
3334
  /**
3335
3335
  * Get a specific model.
3336
3336
  *
@@ -9961,7 +9961,7 @@ var init_beta = __esm({
9961
9961
  Beta = class extends APIResource {
9962
9962
  constructor() {
9963
9963
  super(...arguments);
9964
- this.models = new Models(this._client);
9964
+ this.models = new Models2(this._client);
9965
9965
  this.messages = new Messages(this._client);
9966
9966
  this.agents = new Agents(this._client);
9967
9967
  this.environments = new Environments(this._client);
@@ -9976,7 +9976,7 @@ var init_beta = __esm({
9976
9976
  this.userProfiles = new UserProfiles(this._client);
9977
9977
  }
9978
9978
  };
9979
- Beta.Models = Models;
9979
+ Beta.Models = Models2;
9980
9980
  Beta.Messages = Messages;
9981
9981
  Beta.Agents = Agents;
9982
9982
  Beta.Environments = Environments;
@@ -10961,14 +10961,14 @@ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resour
10961
10961
  });
10962
10962
 
10963
10963
  // ../../node_modules/.bun/@anthropic-ai+sdk@0.106.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/resources/models.mjs
10964
- var Models2;
10964
+ var Models3;
10965
10965
  var init_models2 = __esm({
10966
10966
  "../../node_modules/.bun/@anthropic-ai+sdk@0.106.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/resources/models.mjs"() {
10967
10967
  init_resource();
10968
10968
  init_pagination();
10969
10969
  init_headers();
10970
10970
  init_path();
10971
- Models2 = class extends APIResource {
10971
+ Models3 = class extends APIResource {
10972
10972
  /**
10973
10973
  * Get a specific model.
10974
10974
  *
@@ -11700,14 +11700,14 @@ var init_client = __esm({
11700
11700
  return { req, url, timeout: options.timeout };
11701
11701
  }
11702
11702
  async buildHeaders({ options, method, bodyHeaders, retryCount }) {
11703
- let idempotencyHeaders = {};
11703
+ let idempotencyHeaders2 = {};
11704
11704
  if (this.idempotencyHeader && method !== "get") {
11705
11705
  if (!options.idempotencyKey)
11706
11706
  options.idempotencyKey = this.defaultIdempotencyKey();
11707
- idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
11707
+ idempotencyHeaders2[this.idempotencyHeader] = options.idempotencyKey;
11708
11708
  }
11709
11709
  const headers = buildHeaders([
11710
- idempotencyHeaders,
11710
+ idempotencyHeaders2,
11711
11711
  {
11712
11712
  Accept: "application/json",
11713
11713
  "User-Agent": this.getUserAgent(),
@@ -11781,13 +11781,13 @@ var init_client = __esm({
11781
11781
  super(...arguments);
11782
11782
  this.completions = new Completions(this);
11783
11783
  this.messages = new Messages2(this);
11784
- this.models = new Models2(this);
11784
+ this.models = new Models3(this);
11785
11785
  this.beta = new Beta(this);
11786
11786
  }
11787
11787
  };
11788
11788
  Anthropic.Completions = Completions;
11789
11789
  Anthropic.Messages = Messages2;
11790
- Anthropic.Models = Models2;
11790
+ Anthropic.Models = Models3;
11791
11791
  Anthropic.Beta = Beta;
11792
11792
  }
11793
11793
  });
@@ -11949,8 +11949,6 @@ var MODEL_PROVIDER_IDS = {
11949
11949
  "claude-sonnet-4-6": { anthropic: "claude-sonnet-4-6" },
11950
11950
  "deepseek-v4-flash": { deepseek: "deepseek-v4-flash" },
11951
11951
  "deepseek-v4-pro": { deepseek: "deepseek-v4-pro" },
11952
- "deepseek-chat": { deepseek: "deepseek-chat" },
11953
- "deepseek-reasoner": { deepseek: "deepseek-reasoner" },
11954
11952
  "gpt-4.1": { openai: "gpt-4.1" },
11955
11953
  "gpt-4o-mini": { openai: "gpt-4o-mini", openrouter: "openai/gpt-4o-mini" },
11956
11954
  "gpt-4o": { openrouter: "openai/gpt-4o" },
@@ -12015,96 +12013,6 @@ var TERMINAL_RUN_STATUSES = [
12015
12013
  ];
12016
12014
  var terminalRunStatuses = new Set(TERMINAL_RUN_STATUSES);
12017
12015
 
12018
- // ../contracts/dist/runtime-sizes.js
12019
- var RUNTIME_SIZE_PRESETS = {
12020
- "shared-0.06x-256mb": { cpus: 0.0625, memoryMb: 256 },
12021
- "shared-0.25x-1gb": { cpus: 0.25, memoryMb: 1024 },
12022
- "shared-0.5x-4gb": { cpus: 0.5, memoryMb: 4096 },
12023
- "shared-1x-6gb": { cpus: 1, memoryMb: 6144 },
12024
- "shared-2x-8gb": { cpus: 2, memoryMb: 8192 },
12025
- "shared-4x-12gb": { cpus: 4, memoryMb: 12288 }
12026
- };
12027
- var RUNTIME_SIZES = Object.keys(RUNTIME_SIZE_PRESETS);
12028
- var DEFAULT_RUNTIME_SIZE = "shared-0.25x-1gb";
12029
- var DEFAULT_RUN_TIMEOUT_MS = 60 * 60 * 1e3;
12030
- var MAX_RUN_TIMEOUT_MS = 6 * 60 * 60 * 1e3;
12031
- var MIN_RUN_TIMEOUT_MS = 60 * 1e3;
12032
- var DURATION_PATTERN = /^(\d+(?:\.\d+)?)(ms|s|m|h)?$/;
12033
- function parseDurationToMs(input) {
12034
- const match = DURATION_PATTERN.exec(input.trim());
12035
- if (!match) {
12036
- throw new Error(`invalid duration ${JSON.stringify(input)} (expected e.g. "1h", "90m", "30s", "500ms", or a bare ms integer)`);
12037
- }
12038
- const value = Number(match[1]);
12039
- if (!Number.isFinite(value) || value < 0) {
12040
- throw new Error(`invalid duration ${JSON.stringify(input)} (must be a non-negative number)`);
12041
- }
12042
- const unit = match[2] ?? "ms";
12043
- const factor = unit === "h" ? 36e5 : unit === "m" ? 6e4 : unit === "s" ? 1e3 : 1;
12044
- return Math.round(value * factor);
12045
- }
12046
- var RUN_PROCESS_KILL_GRACE_MS = 60 * 1e3;
12047
- var RUN_TERMINAL_GRACE_MS = 90 * 1e3;
12048
-
12049
- // ../contracts/dist/post-hook.js
12050
- var DEFAULT_POST_HOOK_TIMEOUT_MS = 5 * 60 * 1e3;
12051
- var DEFAULT_POST_HOOK_MAX_TURNS = 10;
12052
- function parsePostHook(input, path5 = "postHook") {
12053
- if (input === void 0 || input === null) {
12054
- return void 0;
12055
- }
12056
- const value = requirePostHookRecord(input, path5);
12057
- const allowed = /* @__PURE__ */ new Set(["command", "timeout", "maxTurns", "maxChars"]);
12058
- for (const key of Object.keys(value)) {
12059
- if (!allowed.has(key)) {
12060
- throw new Error(`${path5}.${key} is not an allowed field; permitted: command, timeout, maxTurns, maxChars`);
12061
- }
12062
- }
12063
- if (typeof value.command !== "string") {
12064
- throw new Error(`${path5}.command must be a string`);
12065
- }
12066
- if (value.command.trim().length === 0) {
12067
- return void 0;
12068
- }
12069
- const timeoutMs = parsePostHookTimeout(value.timeout, `${path5}.timeout`);
12070
- const maxTurns = parseNonNegativeInteger(value.maxTurns, `${path5}.maxTurns`, DEFAULT_POST_HOOK_MAX_TURNS);
12071
- const maxChars = value.maxChars === null ? null : parseNonNegativeInteger(value.maxChars, `${path5}.maxChars`, null);
12072
- return {
12073
- command: value.command,
12074
- timeoutMs,
12075
- maxTurns,
12076
- maxChars
12077
- };
12078
- }
12079
- function parsePostHookTimeout(input, path5) {
12080
- if (input === void 0) {
12081
- return DEFAULT_POST_HOOK_TIMEOUT_MS;
12082
- }
12083
- if (typeof input !== "string") {
12084
- throw new Error(`${path5} must be a duration string (e.g. "5m", "30s"); got ${JSON.stringify(input)}`);
12085
- }
12086
- const ms = parseDurationToMs(input);
12087
- if (ms <= 0) {
12088
- throw new Error(`${path5} must be greater than 0ms; got ${ms}ms`);
12089
- }
12090
- return ms;
12091
- }
12092
- function parseNonNegativeInteger(input, path5, defaultValue) {
12093
- if (input === void 0) {
12094
- return defaultValue;
12095
- }
12096
- if (typeof input !== "number" || !Number.isSafeInteger(input) || input < 0) {
12097
- throw new Error(`${path5} must be a non-negative integer`);
12098
- }
12099
- return input;
12100
- }
12101
- function requirePostHookRecord(input, path5) {
12102
- if (input === null || typeof input !== "object" || Array.isArray(input)) {
12103
- throw new Error(`${path5} must be an object`);
12104
- }
12105
- return input;
12106
- }
12107
-
12108
12016
  // ../contracts/dist/run-config.js
12109
12017
  var SKILL_BUNDLE_LIMITS = {
12110
12018
  /** Compressed (.zip) ceiling. */
@@ -12416,7 +12324,6 @@ function parseRunRequestConfig(input) {
12416
12324
  "environment",
12417
12325
  "runtimeSize",
12418
12326
  "timeout",
12419
- "postHook",
12420
12327
  "proxyEndpoints",
12421
12328
  "metadata"
12422
12329
  ]);
@@ -12433,7 +12340,6 @@ function parseRunRequestConfig(input) {
12433
12340
  const prompt = parseRunRequestConfigPrompt(record.prompt);
12434
12341
  const skills = parseRunRequestConfigSkills(record.skills);
12435
12342
  const mcpServers = parseRunRequestConfigMcpServers(record.mcpServers);
12436
- const postHook = parsePostHook(record.postHook, "run request config postHook");
12437
12343
  return {
12438
12344
  model,
12439
12345
  ...system !== void 0 ? { system } : {},
@@ -12447,7 +12353,6 @@ function parseRunRequestConfig(input) {
12447
12353
  ...record.environment !== void 0 ? { environment: record.environment } : {},
12448
12354
  ...record.runtimeSize !== void 0 ? { runtimeSize: record.runtimeSize } : {},
12449
12355
  ...record.timeout !== void 0 ? { timeout: record.timeout } : {},
12450
- ...postHook !== void 0 ? { postHook: record.postHook } : {},
12451
12356
  ...record.proxyEndpoints !== void 0 ? { proxyEndpoints: record.proxyEndpoints } : {},
12452
12357
  ...record.metadata !== void 0 ? { metadata: record.metadata } : {}
12453
12358
  };
@@ -12502,6 +12407,23 @@ function parseRunRequestConfigMcpServers(value) {
12502
12407
  });
12503
12408
  }
12504
12409
 
12410
+ // ../contracts/dist/runtime-sizes.js
12411
+ var RUNTIME_SIZE_PRESETS = {
12412
+ "shared-0.06x-256mb": { cpus: 0.0625, memoryMb: 256 },
12413
+ "shared-0.25x-1gb": { cpus: 0.25, memoryMb: 1024 },
12414
+ "shared-0.5x-4gb": { cpus: 0.5, memoryMb: 4096 },
12415
+ "shared-1x-6gb": { cpus: 1, memoryMb: 6144 },
12416
+ "shared-2x-8gb": { cpus: 2, memoryMb: 8192 },
12417
+ "shared-4x-12gb": { cpus: 4, memoryMb: 12288 }
12418
+ };
12419
+ var RUNTIME_SIZES = Object.keys(RUNTIME_SIZE_PRESETS);
12420
+ var DEFAULT_RUNTIME_SIZE = "shared-0.25x-1gb";
12421
+ var DEFAULT_RUN_TIMEOUT_MS = 60 * 60 * 1e3;
12422
+ var MAX_RUN_TIMEOUT_MS = 6 * 60 * 60 * 1e3;
12423
+ var MIN_RUN_TIMEOUT_MS = 60 * 1e3;
12424
+ var RUN_PROCESS_KILL_GRACE_MS = 60 * 1e3;
12425
+ var RUN_TERMINAL_GRACE_MS = 90 * 1e3;
12426
+
12505
12427
  // ../contracts/dist/runtime-security-profile.js
12506
12428
  var RUNTIME_SECURITY_PROFILE_CONFIG = Object.freeze({
12507
12429
  strict: Object.freeze({
@@ -13385,16 +13307,17 @@ __export(operations_exports, {
13385
13307
  READ_OUTPUT_TEXT_DEFAULT_BYTES: () => READ_OUTPUT_TEXT_DEFAULT_BYTES,
13386
13308
  READ_OUTPUT_TEXT_MAX_BYTES: () => READ_OUTPUT_TEXT_MAX_BYTES,
13387
13309
  cancelRun: () => cancelRun,
13310
+ cancelSession: () => cancelSession,
13388
13311
  classifyOutput: () => classifyOutput,
13389
- createAgentsMd: () => createAgentsMd,
13390
- createFile: () => createFile,
13391
13312
  createOutputLink: () => createOutputLink,
13392
13313
  createSecret: () => createSecret,
13314
+ createSession: () => createSession,
13393
13315
  createSkillBundleDirect: () => createSkillBundleDirect,
13394
13316
  deleteAgentsMd: () => deleteAgentsMd,
13395
13317
  deleteFile: () => deleteFile,
13396
13318
  deleteRun: () => deleteRun,
13397
13319
  deleteSecret: () => deleteSecret,
13320
+ deleteSession: () => deleteSession,
13398
13321
  deleteSkill: () => deleteSkill,
13399
13322
  deleteWorkspaceAsset: () => deleteWorkspaceAsset,
13400
13323
  download: () => download,
@@ -13416,6 +13339,8 @@ __export(operations_exports, {
13416
13339
  getRunWebhookDeliveries: () => getRunWebhookDeliveries,
13417
13340
  getSecret: () => getSecret,
13418
13341
  getSecretValue: () => getSecretValue,
13342
+ getSession: () => getSession,
13343
+ getSessionCoordinatorTicket: () => getSessionCoordinatorTicket,
13419
13344
  getSkill: () => getSkill,
13420
13345
  listAgentsMd: () => listAgentsMd,
13421
13346
  listFiles: () => listFiles,
@@ -13423,14 +13348,20 @@ __export(operations_exports, {
13423
13348
  listRunEvents: () => listRunEvents,
13424
13349
  listRuns: () => listRuns,
13425
13350
  listSecrets: () => listSecrets,
13351
+ listSessionEvents: () => listSessionEvents,
13352
+ listSessionOutputs: () => listSessionOutputs,
13353
+ listSessions: () => listSessions,
13426
13354
  listSkills: () => listSkills,
13427
13355
  normalizeOutputLinkExpiresIn: () => normalizeOutputLinkExpiresIn,
13428
13356
  outputLink: () => outputLink,
13429
13357
  readOutputText: () => readOutputText,
13430
13358
  redeliverRunWebhook: () => redeliverRunWebhook,
13431
13359
  resolveOutputFileSelector: () => resolveOutputFileSelector,
13360
+ resumeSession: () => resumeSession,
13432
13361
  rotateSecret: () => rotateSecret,
13362
+ sendSessionMessage: () => sendSessionMessage,
13433
13363
  submitRun: () => submitRun,
13364
+ suspendSession: () => suspendSession,
13434
13365
  uploadWorkspaceAsset: () => uploadWorkspaceAsset,
13435
13366
  whoami: () => whoami
13436
13367
  });
@@ -14171,6 +14102,79 @@ async function listRuns(http, query) {
14171
14102
  params.cursor = query.cursor;
14172
14103
  return http.request("/api/runs", {}, params);
14173
14104
  }
14105
+ function idempotencyHeaders(options) {
14106
+ return options?.idempotencyKey ? { "Idempotency-Key": options.idempotencyKey } : void 0;
14107
+ }
14108
+ async function createSession(http, request, options) {
14109
+ const headers = idempotencyHeaders(options);
14110
+ const result = await http.request("/api/sessions", {
14111
+ method: "POST",
14112
+ ...headers ? { headers } : {},
14113
+ body: JSON.stringify(request)
14114
+ });
14115
+ return unwrapSession(result);
14116
+ }
14117
+ async function getSession(http, sessionId) {
14118
+ const result = await http.request(`/api/sessions/${encodeURIComponent(sessionId)}`);
14119
+ return unwrapSession(result);
14120
+ }
14121
+ async function listSessions(http, query) {
14122
+ const params = {};
14123
+ if (query?.status !== void 0)
14124
+ params.status = query.status;
14125
+ if (query?.since !== void 0)
14126
+ params.since = query.since;
14127
+ if (query?.limit !== void 0)
14128
+ params.limit = String(query.limit);
14129
+ if (query?.cursor !== void 0)
14130
+ params.cursor = query.cursor;
14131
+ return http.request("/api/sessions", {}, params);
14132
+ }
14133
+ async function sendSessionMessage(http, sessionId, request, options) {
14134
+ const headers = idempotencyHeaders(options);
14135
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}/messages`, {
14136
+ method: "POST",
14137
+ ...headers ? { headers } : {},
14138
+ body: JSON.stringify(request)
14139
+ });
14140
+ }
14141
+ async function suspendSession(http, sessionId, options) {
14142
+ const headers = idempotencyHeaders(options);
14143
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}/suspend`, { method: "POST", ...headers ? { headers } : {} });
14144
+ }
14145
+ async function cancelSession(http, sessionId, options) {
14146
+ const headers = idempotencyHeaders(options);
14147
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}/cancel`, { method: "POST", ...headers ? { headers } : {} });
14148
+ }
14149
+ async function resumeSession(http, sessionId, options) {
14150
+ const headers = idempotencyHeaders(options);
14151
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}/resume`, { method: "POST", ...headers ? { headers } : {} });
14152
+ }
14153
+ async function deleteSession(http, sessionId, options) {
14154
+ const headers = idempotencyHeaders(options);
14155
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}`, { method: "DELETE", ...headers ? { headers } : {} });
14156
+ }
14157
+ async function listSessionEvents(http, sessionId) {
14158
+ const path5 = `/api/sessions/${encodeURIComponent(sessionId)}/events`;
14159
+ const all = [];
14160
+ let cursor;
14161
+ for (let page = 0; page < LIST_EVENTS_PAGE_BUDGET; page++) {
14162
+ const query = cursor !== void 0 ? { cursor: String(cursor) } : {};
14163
+ const result = await http.request(path5, {}, query);
14164
+ all.push(...result.events);
14165
+ if (typeof result.nextCursor !== "number")
14166
+ break;
14167
+ cursor = result.nextCursor;
14168
+ }
14169
+ return all;
14170
+ }
14171
+ async function listSessionOutputs(http, sessionId, query) {
14172
+ const result = await http.request(`/api/sessions/${encodeURIComponent(sessionId)}/outputs`);
14173
+ return query === void 0 ? result.outputs : filterOutputs(result.outputs, query);
14174
+ }
14175
+ async function getSessionCoordinatorTicket(http, sessionId) {
14176
+ return http.request(`/api/sessions/${encodeURIComponent(sessionId)}/events/ticket`, { method: "POST" });
14177
+ }
14174
14178
  var LIST_EVENTS_PAGE_BUDGET = 1e3;
14175
14179
  async function listRunEvents(http, runId) {
14176
14180
  const path5 = `/api/runs/${encodeURIComponent(runId)}/events`;
@@ -14693,13 +14697,6 @@ async function findSkillByName(http, name) {
14693
14697
  const skills = await listSkills(http);
14694
14698
  return skills.find((skill) => skill.name === name) ?? null;
14695
14699
  }
14696
- async function createAgentsMd(http, args) {
14697
- const form = new FormData();
14698
- form.append("name", args.name);
14699
- form.append("content", new Blob([args.content], { type: "text/plain" }), "AGENTS.md");
14700
- const result = await http.request("/api/agentsmd", { method: "POST", body: form });
14701
- return unwrapAgentsMd(result);
14702
- }
14703
14700
  async function listAgentsMd(http) {
14704
14701
  const result = await http.request("/api/agentsmd");
14705
14702
  if (Array.isArray(result)) {
@@ -14722,14 +14719,6 @@ function unwrapAgentsMd(result) {
14722
14719
  }
14723
14720
  return result;
14724
14721
  }
14725
- async function createFile(http, args) {
14726
- const form = new FormData();
14727
- form.append("name", args.name);
14728
- const blob = toBlob(args.bytes, "application/zip");
14729
- form.append("bundle", blob, `${args.name}.zip`);
14730
- const result = await http.request("/api/files", { method: "POST", body: form });
14731
- return unwrapFile(result);
14732
- }
14733
14722
  async function listFiles(http) {
14734
14723
  const result = await http.request("/api/files");
14735
14724
  if (Array.isArray(result)) {
@@ -14796,20 +14785,15 @@ function unwrapSkill(result) {
14796
14785
  }
14797
14786
  return result;
14798
14787
  }
14799
- function toBlob(input, contentType) {
14800
- if (input instanceof Blob) {
14801
- return input;
14802
- }
14803
- if (input instanceof Uint8Array) {
14804
- const copy = new Uint8Array(input.byteLength);
14805
- copy.set(input);
14806
- return new Blob([copy.buffer], { type: contentType });
14807
- }
14808
- return new Blob([input], { type: contentType });
14809
- }
14810
14788
  function hasRun(value) {
14811
14789
  return Boolean(value && typeof value === "object" && "run" in value);
14812
14790
  }
14791
+ function unwrapSession(result) {
14792
+ if (result && typeof result === "object" && "session" in result) {
14793
+ return result.session;
14794
+ }
14795
+ return result;
14796
+ }
14813
14797
  async function uploadWorkspaceAsset(http, input) {
14814
14798
  return http.request("/assets", {
14815
14799
  method: "POST",
@@ -15802,7 +15786,6 @@ async function runRunCmd(io2, argv) {
15802
15786
  secrets,
15803
15787
  ...runtimeSizeFlag.value ? { runtimeSize: runtimeSizeFlag.value } : runConfig.runtimeSize ? { runtimeSize: runConfig.runtimeSize } : {},
15804
15788
  ...runTimeoutFlag.value ? { timeout: runTimeoutFlag.value } : runConfig.timeout ? { timeout: runConfig.timeout } : {},
15805
- ...runConfig.postHook ? { postHook: runConfig.postHook } : {},
15806
15789
  ...webhookFlag.value ? { webhook: { url: webhookFlag.value } } : {},
15807
15790
  ...proxyEndpoints.length > 0 ? { proxyEndpoints } : {}
15808
15791
  };
@@ -1 +1 @@
1
- 6fdbb02bcedc98dc959c46f14b44bc0d061c799e01627d2550e58980d954e722 cli.mjs
1
+ ad37c1366dc0104bf96adc80f5b48d9a2b8b7cf73bc6cba0d014a3d458441855 cli.mjs