@nylorun/agents 0.19.0-beta → 0.20.0-beta

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.
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Acting for a person (`client.as`, or a trusted issuer's token), only the artifacts of their own sessions.
13
13
  */
14
- import type { ArtifactDiff, ArtifactLink, ArtifactTree, ArtifactView, DeleteArtifactResponse, UploadArtifactResponse } from "@nylorun/core/contracts";
14
+ import { type ArtifactKind, type ArtifactPage, type ArtifactDiff, type ArtifactLink, type ArtifactTree, type ArtifactView, type DeleteArtifactResponse, type UploadArtifactResponse } from "@nylorun/core/contracts";
15
15
  import { type Transport } from "./http.js";
16
16
  /** What an upload sends: bytes, a `Blob` or `File`, text, or a stream of bytes. */
17
17
  export type ArtifactBody = Uint8Array | ArrayBuffer | Blob | string | ReadableStream<Uint8Array>;
@@ -25,6 +25,17 @@ export interface UploadArtifactOptions {
25
25
  readonly labels?: Readonly<Record<string, string>>;
26
26
  readonly signal?: AbortSignal;
27
27
  }
28
+ export interface ArtifactPageOptions {
29
+ /** Only this session's artifacts; excludes Tenant-owned artifacts. */
30
+ readonly sessionId?: string;
31
+ readonly kind?: ArtifactKind;
32
+ /** Every label must match exactly. */
33
+ readonly labels?: Readonly<Record<string, string>>;
34
+ /** Default 50, from 1 to 200. */
35
+ readonly limit?: number;
36
+ readonly cursor?: string;
37
+ readonly signal?: AbortSignal;
38
+ }
28
39
  /** A capability link, with the absolute URL to open on this Runtime. */
29
40
  export type ArtifactLinkWithUrl = ArtifactLink & {
30
41
  readonly url: string;
@@ -48,6 +59,8 @@ export declare class ArtifactsClient {
48
59
  sessionId?: string;
49
60
  signal?: AbortSignal;
50
61
  }): Promise<ArtifactView[]>;
62
+ /** Newest first, with metadata only (Host feature `artifact-reads`). */
63
+ page(options?: ArtifactPageOptions): Promise<ArtifactPage>;
51
64
  /** The artifact, with every version. */
52
65
  get(artifactId: string, options?: {
53
66
  signal?: AbortSignal;
package/dist/artifacts.js CHANGED
@@ -1,3 +1,17 @@
1
+ /**
2
+ * Artifacts (protocol 6): `client.artifacts`. A file is uploaded in one streamed request and
3
+ * kept as an artifact with numbered versions; a session's artifacts appear in its history as
4
+ * `artifact.*` events. Download through the Runtime (with Range), or mint a capability link: a
5
+ * short-lived URL that needs no credential, for `<img>` tags and sharing. A message names an
6
+ * artifact in a file part (`session.inputParts`), and the model reads it.
7
+ *
8
+ * Folders (F8.2): at the end of each turn the Runtime exports `/workspace/outputs` of the
9
+ * session's sandbox as a version of its `outputs` folder. Read one as a tree, one file by path,
10
+ * a diff between versions or a zip.
11
+ *
12
+ * Acting for a person (`client.as`, or a trusted issuer's token), only the artifacts of their own sessions.
13
+ */
14
+ import { ArtifactPageSchema, } from "@nylorun/core/contracts";
1
15
  import { segment } from "./http.js";
2
16
  function contentTypeOf(body, declared) {
3
17
  if (declared)
@@ -46,6 +60,20 @@ export class ArtifactsClient {
46
60
  const reply = await this.transport.json(`/v1/artifacts${query}`, "GET", undefined, options.signal);
47
61
  return reply.artifacts;
48
62
  }
63
+ /** Newest first, with metadata only (Host feature `artifact-reads`). */
64
+ async page(options = {}) {
65
+ await this.transport.requireFeature("artifact-reads", options.signal);
66
+ const query = new URLSearchParams({ limit: String(options.limit ?? 50) });
67
+ if (options.cursor !== undefined)
68
+ query.set("cursor", options.cursor);
69
+ if (options.sessionId !== undefined)
70
+ query.set("sessionId", options.sessionId);
71
+ if (options.kind !== undefined)
72
+ query.set("kind", options.kind);
73
+ for (const [key, value] of Object.entries(options.labels ?? {}))
74
+ query.append("label", `${key}=${value}`);
75
+ return ArtifactPageSchema.parse(await this.transport.json(`/v1/artifacts?${query}`, "GET", undefined, options.signal));
76
+ }
49
77
  /** The artifact, with every version. */
50
78
  get(artifactId, options = {}) {
51
79
  return this.transport.json(`/v1/artifacts/${segment(artifactId)}`, "GET", undefined, options.signal);
@@ -0,0 +1,217 @@
1
+ /**
2
+ * Environments (protocol 11, D55, D56): `client.environments`. An Environment is one sandbox
3
+ * (kind `virtual`, `pod` or `none`) with a recipe that can change, and one vault of secrets for
4
+ * its shell, MCP servers and HTTP tools. It has its own id and outlives the sessions that name
5
+ * it; whether it serves one session, one person or a project is the app's choice, made here:
6
+ *
7
+ * - `environments.forSession(...)`: one Environment for one session. It creates the
8
+ * Environment, opens the session on it, and `release()` deletes the Environment (and its
9
+ * vault) when the session is done.
10
+ * - `environments.put(id, recipe)`: one Environment per person or per project, by a
11
+ * deterministic id (`users/alice/web`); get-or-create, or change its recipe, in one call.
12
+ * Write its secrets with `environments.secrets.put(id, name, secret)` and open sessions on it
13
+ * with `createSession({ environment: id })`.
14
+ *
15
+ * Ids may hold `/`; they are sent percent-encoded as one path segment. Secret values are
16
+ * write-only: no call reads one back.
17
+ *
18
+ * Disk versions (Host feature `environment-disk-versions`): `snapshot(id)` keeps a version of
19
+ * the Environment's disk between turns, `restore(id, version)` puts one back, and
20
+ * `put(id, { from: { environment, version } })` creates a new Environment from another's version.
21
+ */
22
+ import { type DeleteEnvironmentResponse, type EnvironmentEvent, type EnvironmentRestore, type EnvironmentSecretView, type EnvironmentSnapshot, type EnvironmentVersions, type EnvironmentView, type PutEnvironmentRequest, type PutEnvironmentSecretRequest } from "@nylorun/core/contracts";
23
+ import { type Transport } from "./http.js";
24
+ import type { CreateSessionOptions, SessionClient } from "./session-client.js";
25
+ /** What an Environment is made of: its kind, recipe, labels and owner guard. */
26
+ export type EnvironmentRecipeInput = Omit<PutEnvironmentRequest, "requestId">;
27
+ /** One secret of an Environment's vault, as written. */
28
+ export type EnvironmentSecretInput = PutEnvironmentSecretRequest;
29
+ /** A session opened on an Environment of its own (`environments.forSession`). */
30
+ export interface SessionEnvironmentHandle {
31
+ readonly session: SessionClient;
32
+ readonly environment: EnvironmentView;
33
+ /** Deletes the Environment, its vault and its files; call it when the session is done. */
34
+ release(options?: {
35
+ signal?: AbortSignal;
36
+ }): Promise<DeleteEnvironmentResponse>;
37
+ }
38
+ export interface ForSessionOptions {
39
+ /** The session to open, as `createSession` takes it, without `environment`. */
40
+ readonly session: Omit<CreateSessionOptions, "environment">;
41
+ /** The Environment's recipe and labels. Default: a virtual one within the Tenant's defaults. */
42
+ readonly recipe?: EnvironmentRecipeInput;
43
+ /** Secrets to write before the session opens, by name. */
44
+ readonly secrets?: Readonly<Record<string, EnvironmentSecretInput>>;
45
+ /** The Environment's id. Default: `sessions/<session id>`. */
46
+ readonly environmentId?: string;
47
+ readonly signal?: AbortSignal;
48
+ }
49
+ /** An Environment's secrets: `client.environments.secrets`. */
50
+ export declare class EnvironmentSecretsClient {
51
+ private readonly transport;
52
+ private readonly path;
53
+ constructor(transport: Transport, path: (environmentId: string) => string);
54
+ /**
55
+ * Creates or replaces secret `name` (`PUT /v1/environments/{id}/secrets/{name}`): for
56
+ * `environment_secret` and `environment_variable` the name is the variable's. A second
57
+ * credential for a host or a URL is a 409 `credential_conflict`.
58
+ */
59
+ put(environmentId: string, name: string, secret: EnvironmentSecretInput, options?: {
60
+ signal?: AbortSignal;
61
+ }): Promise<EnvironmentSecretView>;
62
+ /** The secrets' names, types and bindings; never a value. */
63
+ list(environmentId: string, options?: {
64
+ signal?: AbortSignal;
65
+ }): Promise<EnvironmentSecretView[]>;
66
+ get(environmentId: string, name: string, options?: {
67
+ signal?: AbortSignal;
68
+ }): Promise<EnvironmentSecretView>;
69
+ delete(environmentId: string, name: string, options?: {
70
+ signal?: AbortSignal;
71
+ }): Promise<{
72
+ id: string;
73
+ }>;
74
+ }
75
+ export declare class EnvironmentsClient {
76
+ private readonly transport;
77
+ /** `AgentsClient.createSession`, bound. */
78
+ private readonly createSession;
79
+ constructor(transport: Transport,
80
+ /** `AgentsClient.createSession`, bound. */
81
+ createSession: (options: CreateSessionOptions) => Promise<SessionClient>);
82
+ private path;
83
+ /** The Environment's secrets. */
84
+ get secrets(): EnvironmentSecretsClient;
85
+ /**
86
+ * Creates the Environment and its vault, or finds the one with this id
87
+ * (`PUT /v1/environments/{id}`). On an existing one, `kind` and `storage` are fixed (a
88
+ * different one is a 409), labels replace, and any other change writes the recipe and bumps
89
+ * its `version`: a pod's image and resources apply when it next starts from stopped.
90
+ */
91
+ put(environmentId: string, recipe?: EnvironmentRecipeInput, options?: {
92
+ signal?: AbortSignal;
93
+ }): Promise<EnvironmentView>;
94
+ get(environmentId: string, options?: {
95
+ signal?: AbortSignal;
96
+ }): Promise<EnvironmentView>;
97
+ /** The Environments with every label in `labels` that this client reaches. */
98
+ list(options?: {
99
+ labels?: Readonly<Record<string, string>>;
100
+ signal?: AbortSignal;
101
+ }): Promise<EnvironmentView[]>;
102
+ page(options?: {
103
+ labels?: Readonly<Record<string, string>>;
104
+ limit?: number;
105
+ cursor?: string;
106
+ signal?: AbortSignal;
107
+ }): Promise<{
108
+ environments: {
109
+ id: string;
110
+ kind: "none" | "pod" | "virtual";
111
+ labels: Record<string, string>;
112
+ recipe: {
113
+ image?: string | undefined;
114
+ resources?: {
115
+ cpus: number;
116
+ memory: string;
117
+ } | undefined;
118
+ storage?: string | undefined;
119
+ network?: {
120
+ allowedHosts: string[];
121
+ } | undefined;
122
+ harness: string;
123
+ lifecycle: {
124
+ idle?: string | undefined;
125
+ deleteAfter?: string | undefined;
126
+ };
127
+ setup?: {
128
+ command: string;
129
+ cwd?: string | undefined;
130
+ timeout?: string | undefined;
131
+ }[] | undefined;
132
+ files?: {
133
+ artifactId: string;
134
+ version: number;
135
+ path: string;
136
+ }[] | undefined;
137
+ };
138
+ version: number;
139
+ appliedVersion: number;
140
+ ownerUserId: string | null;
141
+ state: string;
142
+ pod?: {
143
+ desired: "deleted" | "running" | "suspended";
144
+ observed: "creating" | "deleting" | "failed" | "lost" | "running" | "suspended";
145
+ volumeGeneration: number;
146
+ hostEpoch: number;
147
+ reason?: string | undefined;
148
+ } | undefined;
149
+ lastUsedAt: string;
150
+ disk?: {
151
+ latestVersion: number | null;
152
+ operation?: {
153
+ kind: "restore" | "seed" | "snapshot";
154
+ version?: number | undefined;
155
+ startedAt: string;
156
+ } | undefined;
157
+ } | undefined;
158
+ sessions: {
159
+ id: string;
160
+ activeTurnId: string | null;
161
+ }[];
162
+ createdAt: string;
163
+ updatedAt: string;
164
+ }[];
165
+ nextCursor: string | null;
166
+ }>;
167
+ /** Stops a pod Environment: its volume is kept, and the next turn starts it again. */
168
+ stop(environmentId: string, options?: {
169
+ signal?: AbortSignal;
170
+ }): Promise<EnvironmentView>;
171
+ /** Resets a pod Environment: a new pod on a new, empty volume, with its recipe applied. */
172
+ reset(environmentId: string, options?: {
173
+ signal?: AbortSignal;
174
+ }): Promise<EnvironmentView>;
175
+ /**
176
+ * Keeps a version of the Environment's disk (`POST /v1/environments/{id}/snapshot`), between
177
+ * turns; `unchanged` when the disk is as the latest version has it.
178
+ */
179
+ snapshot(environmentId: string, options?: {
180
+ signal?: AbortSignal;
181
+ }): Promise<EnvironmentSnapshot>;
182
+ /**
183
+ * Puts disk version `version` back: at once for a virtual Environment (`done`), on a new volume
184
+ * seeded before the next turn for a pod (`pending`).
185
+ */
186
+ restore(environmentId: string, version: number | "latest", options?: {
187
+ signal?: AbortSignal;
188
+ }): Promise<EnvironmentRestore>;
189
+ /** The Environment's disk versions, newest first. */
190
+ versions(environmentId: string, options?: {
191
+ signal?: AbortSignal;
192
+ }): Promise<EnvironmentVersions>;
193
+ /** Deletes disk version `version`; `deleted` is false when there was none. */
194
+ deleteVersion(environmentId: string, version: number, options?: {
195
+ signal?: AbortSignal;
196
+ }): Promise<{
197
+ environmentId: string;
198
+ version: number;
199
+ deleted: boolean;
200
+ }>;
201
+ /** Deletes the Environment, its vault and its files; `deleted` is false when there was none. */
202
+ delete(environmentId: string, options?: {
203
+ signal?: AbortSignal;
204
+ }): Promise<DeleteEnvironmentResponse>;
205
+ /** The Environment's lifecycle events, from `from` on. */
206
+ events(environmentId: string, options?: {
207
+ from?: number;
208
+ signal?: AbortSignal;
209
+ }): Promise<EnvironmentEvent[]>;
210
+ /**
211
+ * One Environment for one session: creates the Environment (`sessions/<session id>` unless
212
+ * `environmentId` names another), writes `secrets`, opens the session on it, and returns both
213
+ * with `release()`, which deletes the Environment. If the session cannot be opened, the
214
+ * Environment is deleted again.
215
+ */
216
+ forSession(options: ForSessionOptions): Promise<SessionEnvironmentHandle>;
217
+ }
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Environments (protocol 11, D55, D56): `client.environments`. An Environment is one sandbox
3
+ * (kind `virtual`, `pod` or `none`) with a recipe that can change, and one vault of secrets for
4
+ * its shell, MCP servers and HTTP tools. It has its own id and outlives the sessions that name
5
+ * it; whether it serves one session, one person or a project is the app's choice, made here:
6
+ *
7
+ * - `environments.forSession(...)`: one Environment for one session. It creates the
8
+ * Environment, opens the session on it, and `release()` deletes the Environment (and its
9
+ * vault) when the session is done.
10
+ * - `environments.put(id, recipe)`: one Environment per person or per project, by a
11
+ * deterministic id (`users/alice/web`); get-or-create, or change its recipe, in one call.
12
+ * Write its secrets with `environments.secrets.put(id, name, secret)` and open sessions on it
13
+ * with `createSession({ environment: id })`.
14
+ *
15
+ * Ids may hold `/`; they are sent percent-encoded as one path segment. Secret values are
16
+ * write-only: no call reads one back.
17
+ *
18
+ * Disk versions (Host feature `environment-disk-versions`): `snapshot(id)` keeps a version of
19
+ * the Environment's disk between turns, `restore(id, version)` puts one back, and
20
+ * `put(id, { from: { environment, version } })` creates a new Environment from another's version.
21
+ */
22
+ import { EnvironmentPageSchema, isEnvironmentId, } from "@nylorun/core/contracts";
23
+ import { id, segment } from "./http.js";
24
+ /** An Environment's secrets: `client.environments.secrets`. */
25
+ export class EnvironmentSecretsClient {
26
+ transport;
27
+ path;
28
+ constructor(transport, path) {
29
+ this.transport = transport;
30
+ this.path = path;
31
+ }
32
+ /**
33
+ * Creates or replaces secret `name` (`PUT /v1/environments/{id}/secrets/{name}`): for
34
+ * `environment_secret` and `environment_variable` the name is the variable's. A second
35
+ * credential for a host or a URL is a 409 `credential_conflict`.
36
+ */
37
+ async put(environmentId, name, secret, options = {}) {
38
+ return this.transport.json(`${this.path(environmentId)}/secrets/${segment(name)}`, "PUT", { requestId: id(), ...secret }, options.signal);
39
+ }
40
+ /** The secrets' names, types and bindings; never a value. */
41
+ async list(environmentId, options = {}) {
42
+ const reply = await this.transport.json(`${this.path(environmentId)}/secrets`, "GET", undefined, options.signal);
43
+ return reply.secrets;
44
+ }
45
+ async get(environmentId, name, options = {}) {
46
+ return this.transport.json(`${this.path(environmentId)}/secrets/${segment(name)}`, "GET", undefined, options.signal);
47
+ }
48
+ async delete(environmentId, name, options = {}) {
49
+ return this.transport.json(`${this.path(environmentId)}/secrets/${segment(name)}`, "DELETE", undefined, options.signal);
50
+ }
51
+ }
52
+ export class EnvironmentsClient {
53
+ transport;
54
+ createSession;
55
+ constructor(transport,
56
+ /** `AgentsClient.createSession`, bound. */
57
+ createSession) {
58
+ this.transport = transport;
59
+ this.createSession = createSession;
60
+ }
61
+ path(environmentId) {
62
+ if (!isEnvironmentId(environmentId))
63
+ throw new TypeError(`${environmentId} is not an Environment id: up to 200 characters, /-separated segments of letters, digits, '.', '_' and '-'`);
64
+ return `/v1/environments/${segment(environmentId)}`;
65
+ }
66
+ /** The Environment's secrets. */
67
+ get secrets() {
68
+ return new EnvironmentSecretsClient(this.transport, (environmentId) => this.path(environmentId));
69
+ }
70
+ /**
71
+ * Creates the Environment and its vault, or finds the one with this id
72
+ * (`PUT /v1/environments/{id}`). On an existing one, `kind` and `storage` are fixed (a
73
+ * different one is a 409), labels replace, and any other change writes the recipe and bumps
74
+ * its `version`: a pod's image and resources apply when it next starts from stopped.
75
+ */
76
+ async put(environmentId, recipe = {}, options = {}) {
77
+ return this.transport.json(this.path(environmentId), "PUT", { requestId: id(), ...recipe }, options.signal);
78
+ }
79
+ async get(environmentId, options = {}) {
80
+ return this.transport.json(this.path(environmentId), "GET", undefined, options.signal);
81
+ }
82
+ /** The Environments with every label in `labels` that this client reaches. */
83
+ async list(options = {}) {
84
+ const query = new URLSearchParams();
85
+ for (const [key, value] of Object.entries(options.labels ?? {}))
86
+ query.append("label", `${key}=${value}`);
87
+ const search = query.toString();
88
+ const reply = await this.transport.json(`/v1/environments${search ? `?${search}` : ""}`, "GET", undefined, options.signal);
89
+ return reply.environments;
90
+ }
91
+ async page(options = {}) {
92
+ await this.transport.requireFeature("session-reads", options.signal);
93
+ const query = new URLSearchParams({ limit: String(options.limit ?? 50) });
94
+ if (options.cursor !== undefined)
95
+ query.set("cursor", options.cursor);
96
+ for (const [key, value] of Object.entries(options.labels ?? {}))
97
+ query.append("label", `${key}=${value}`);
98
+ return EnvironmentPageSchema.parse(await this.transport.json(`/v1/environments?${query}`, "GET", undefined, options.signal));
99
+ }
100
+ /** Stops a pod Environment: its volume is kept, and the next turn starts it again. */
101
+ async stop(environmentId, options = {}) {
102
+ return this.transport.json(`${this.path(environmentId)}/stop`, "POST", {}, options.signal);
103
+ }
104
+ /** Resets a pod Environment: a new pod on a new, empty volume, with its recipe applied. */
105
+ async reset(environmentId, options = {}) {
106
+ return this.transport.json(`${this.path(environmentId)}/reset`, "POST", {}, options.signal);
107
+ }
108
+ /**
109
+ * Keeps a version of the Environment's disk (`POST /v1/environments/{id}/snapshot`), between
110
+ * turns; `unchanged` when the disk is as the latest version has it.
111
+ */
112
+ async snapshot(environmentId, options = {}) {
113
+ await this.transport.requireFeature("environment-disk-versions", options.signal);
114
+ return this.transport.json(`${this.path(environmentId)}/snapshot`, "POST", {}, options.signal);
115
+ }
116
+ /**
117
+ * Puts disk version `version` back: at once for a virtual Environment (`done`), on a new volume
118
+ * seeded before the next turn for a pod (`pending`).
119
+ */
120
+ async restore(environmentId, version, options = {}) {
121
+ await this.transport.requireFeature("environment-disk-versions", options.signal);
122
+ return this.transport.json(`${this.path(environmentId)}/restore`, "POST", { requestId: id(), version }, options.signal);
123
+ }
124
+ /** The Environment's disk versions, newest first. */
125
+ async versions(environmentId, options = {}) {
126
+ await this.transport.requireFeature("environment-disk-versions", options.signal);
127
+ return this.transport.json(`${this.path(environmentId)}/versions`, "GET", undefined, options.signal);
128
+ }
129
+ /** Deletes disk version `version`; `deleted` is false when there was none. */
130
+ async deleteVersion(environmentId, version, options = {}) {
131
+ return this.transport.json(`${this.path(environmentId)}/versions/${version}`, "DELETE", undefined, options.signal);
132
+ }
133
+ /** Deletes the Environment, its vault and its files; `deleted` is false when there was none. */
134
+ async delete(environmentId, options = {}) {
135
+ return this.transport.json(this.path(environmentId), "DELETE", undefined, options.signal);
136
+ }
137
+ /** The Environment's lifecycle events, from `from` on. */
138
+ async events(environmentId, options = {}) {
139
+ const reply = await this.transport.json(`${this.path(environmentId)}/events${options.from === undefined ? "" : `?from=${options.from}`}`, "GET", undefined, options.signal);
140
+ return reply.events;
141
+ }
142
+ /**
143
+ * One Environment for one session: creates the Environment (`sessions/<session id>` unless
144
+ * `environmentId` names another), writes `secrets`, opens the session on it, and returns both
145
+ * with `release()`, which deletes the Environment. If the session cannot be opened, the
146
+ * Environment is deleted again.
147
+ */
148
+ async forSession(options) {
149
+ const sessionId = options.session.id ?? id();
150
+ const environmentId = options.environmentId ??
151
+ (isEnvironmentId(`sessions/${sessionId}`) ? `sessions/${sessionId}` : `sessions/${id()}`);
152
+ const signal = options.signal ? { signal: options.signal } : {};
153
+ const environment = await this.put(environmentId, options.recipe ?? {}, signal);
154
+ let session;
155
+ try {
156
+ for (const [name, secret] of Object.entries(options.secrets ?? {}))
157
+ await this.secrets.put(environmentId, name, secret, signal);
158
+ session = await this.createSession({
159
+ ...options.session,
160
+ id: sessionId,
161
+ environment: environmentId,
162
+ });
163
+ }
164
+ catch (error) {
165
+ await this.delete(environmentId).catch(() => undefined);
166
+ throw error;
167
+ }
168
+ return {
169
+ session,
170
+ environment,
171
+ release: (release = {}) => this.delete(environmentId, release),
172
+ };
173
+ }
174
+ }
package/dist/index.d.ts CHANGED
@@ -6,14 +6,14 @@ export { Agent, AgentBuilder } from "./builder.js";
6
6
  export { AgentBuildError, AgentLifecycleError, VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, capability, CapabilityBuilder, flow, tool, http, defineSchema, ToolError, } from "@nylorun/core/define";
7
7
  export type { FlowAgentBuilder, Flow, Named, LoopOptions, StageOptions, CapabilityIdentity, HttpTarget, } from "@nylorun/core/define";
8
8
  export type { AgentOptions, AgentManifest, BuiltAgent, BuiltWorkflow, Verdict, WorkflowBinding, WorkflowManifest, ToolDefinition, ToolExecutionContext, ToolOutcome, JsonValue, JsonObject, } from "@nylorun/core/define";
9
- export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, ModelCall, ModelCallsPage, SandboxPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, CredentialInfo, CredentialSelection, VaultInfo, SubjectScope, SandboxView, SandboxEvent, SandboxKind, MessagePart, ArtifactView, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
9
+ export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, ModelCall, ModelCallsPage, EnvironmentPage, ToolCall, ToolCallsPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, SubjectScope, EnvironmentView, EnvironmentEvent, EnvironmentKind, EnvironmentRecipe, EnvironmentSecretView, EnvironmentSnapshot, EnvironmentRestore, EnvironmentVersions, RestoreEnvironmentRequest, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
10
10
  export { SUBJECT_SCOPES } from "@nylorun/core/contracts";
11
11
  export { AgentsClient, SessionClient, createClient } from "./client.js";
12
12
  export { ArtifactsClient } from "./artifacts.js";
13
13
  export { FilesClient, definitionFileHash } from "./files.js";
14
- export type { ArtifactBody, ArtifactLinkWithUrl, UploadArtifactOptions, } from "./artifacts.js";
15
- export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, ForSessionOptions, SandboxSpec, SessionSandboxHandle, } from "./client.js";
16
- export { SandboxesClient } from "./client.js";
14
+ export type { ArtifactBody, ArtifactPageOptions, ArtifactLinkWithUrl, UploadArtifactOptions, } from "./artifacts.js";
15
+ export type { ActAsOptions, AgentSource, SessionView, CommandOptions, CreateSessionOptions, SessionSandbox, ForSessionOptions, EnvironmentRecipeInput, EnvironmentSecretInput, SessionEnvironmentHandle, } from "./client.js";
16
+ export { EnvironmentsClient, EnvironmentSecretsClient } from "./client.js";
17
17
  export { AccessClient } from "./access.js";
18
18
  export { resolveConnection, ConnectionError } from "./connection.js";
19
19
  export type { ResolvedConnection } from "./connection.js";
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ export { SUBJECT_SCOPES } from "@nylorun/core/contracts";
8
8
  export { AgentsClient, SessionClient, createClient } from "./client.js";
9
9
  export { ArtifactsClient } from "./artifacts.js";
10
10
  export { FilesClient, definitionFileHash } from "./files.js";
11
- export { SandboxesClient } from "./client.js";
11
+ export { EnvironmentsClient, EnvironmentSecretsClient } from "./client.js";
12
12
  export { AccessClient } from "./access.js";
13
13
  export { resolveConnection, ConnectionError } from "./connection.js";
14
14
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
package/dist/reads.d.ts CHANGED
@@ -4,7 +4,7 @@ import type { Transport } from "./http.js";
4
4
  export type SessionPageOptions = {
5
5
  agentId?: string;
6
6
  status?: SessionListItem["status"];
7
- sandboxId?: string;
7
+ environmentId?: string;
8
8
  ownerUserId?: string;
9
9
  limit?: number;
10
10
  cursor?: string;