@usestatemachines/sdk 0.7.0 → 0.8.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 (78) hide show
  1. package/README.md +86 -33
  2. package/agents/SKILL.md +71 -48
  3. package/agents/index.d.ts +2 -0
  4. package/agents/index.js +9 -7
  5. package/agents/llms.txt +23 -15
  6. package/agents/prompt.md +5 -25
  7. package/esm/extensions/client.d.ts +11 -7
  8. package/esm/extensions/client.js +32 -49
  9. package/esm/extensions/credentials.d.ts +25 -8
  10. package/esm/extensions/credentials.js +75 -40
  11. package/esm/extensions/environment.d.ts +1 -1
  12. package/esm/extensions/errors.js +1 -1
  13. package/esm/extensions/index.d.ts +2 -2
  14. package/esm/extensions/yaml.js +14 -12
  15. package/esm/funcs/environments-creators.d.ts +11 -0
  16. package/esm/funcs/environments-creators.js +90 -0
  17. package/esm/funcs/environments-list.js +2 -0
  18. package/esm/funcs/requests-list.js +5 -1
  19. package/esm/funcs/requests-stats.js +5 -1
  20. package/esm/lib/config.d.ts +2 -2
  21. package/esm/lib/config.js +2 -2
  22. package/esm/models/app-entry.d.ts +8 -0
  23. package/esm/models/app-entry.js +11 -0
  24. package/esm/models/create-environment-app.d.ts +25 -0
  25. package/esm/models/create-environment-app.js +14 -0
  26. package/esm/models/create-environment.d.ts +3 -26
  27. package/esm/models/create-environment.js +2 -19
  28. package/esm/models/credential.d.ts +50 -0
  29. package/esm/models/credential.js +60 -0
  30. package/esm/models/credentials.d.ts +26 -5
  31. package/esm/models/credentials.js +20 -3
  32. package/esm/models/environment-failure.d.ts +3 -2
  33. package/esm/models/environment-failure.js +3 -2
  34. package/esm/models/environment.d.ts +4 -1
  35. package/esm/models/environment.js +2 -1
  36. package/esm/models/error.d.ts +1 -0
  37. package/esm/models/error.js +1 -0
  38. package/esm/models/index.d.ts +6 -1
  39. package/esm/models/index.js +6 -1
  40. package/esm/models/mcp-server.d.ts +11 -0
  41. package/esm/models/mcp-server.js +16 -0
  42. package/esm/models/mcp-tool.d.ts +12 -0
  43. package/esm/models/mcp-tool.js +16 -0
  44. package/esm/models/me.d.ts +2 -0
  45. package/esm/models/me.js +2 -0
  46. package/esm/models/operations/create-credentials.d.ts +2 -0
  47. package/esm/models/operations/create-credentials.js +1 -0
  48. package/esm/models/operations/get-request-stats.d.ts +10 -2
  49. package/esm/models/operations/get-request-stats.js +5 -1
  50. package/esm/models/operations/index.d.ts +1 -0
  51. package/esm/models/operations/index.js +1 -0
  52. package/esm/models/operations/list-environment-creators.d.ts +23 -0
  53. package/esm/models/operations/list-environment-creators.js +20 -0
  54. package/esm/models/operations/list-environments.d.ts +5 -1
  55. package/esm/models/operations/list-environments.js +2 -0
  56. package/esm/models/operations/list-requests.d.ts +10 -2
  57. package/esm/models/operations/list-requests.js +5 -1
  58. package/esm/models/request-detail.d.ts +8 -1
  59. package/esm/models/request-detail.js +5 -1
  60. package/esm/models/request-stats.d.ts +8 -0
  61. package/esm/models/request-stats.js +9 -0
  62. package/esm/models/request.d.ts +8 -1
  63. package/esm/models/request.js +5 -1
  64. package/esm/models/service.d.ts +25 -0
  65. package/esm/models/service.js +28 -0
  66. package/esm/models/snapshot.d.ts +7 -0
  67. package/esm/models/snapshot.js +3 -0
  68. package/esm/models/version.d.ts +2 -2
  69. package/esm/models/version.js +2 -2
  70. package/esm/sdk/environments.d.ts +1 -0
  71. package/esm/sdk/environments.js +4 -0
  72. package/esm/types/discriminated-union.d.ts +24 -0
  73. package/esm/types/discriminated-union.js +60 -0
  74. package/esm/types/smart-union.js +2 -1
  75. package/openapi.json +596 -116
  76. package/package.json +6 -1
  77. package/esm/models/api.d.ts +0 -17
  78. package/esm/models/api.js +0 -21
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { safeParse } from "../lib/schemas.js";
6
+ import { discriminatedUnion } from "../types/discriminated-union.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ import * as types from "../types/primitives.js";
9
+ export const ApiKeyKind = {
10
+ Dashboard: "dashboard",
11
+ CliRun: "cli_run",
12
+ EnvPull: "env_pull",
13
+ };
14
+ /** @internal */
15
+ export const ApiKeyKind$inboundSchema = openEnums.inboundSchema(ApiKeyKind);
16
+ /** @internal */
17
+ export const CredentialAPIKey$inboundSchema = z.object({
18
+ apiKeyKind: ApiKeyKind$inboundSchema,
19
+ expiresAt: types.nullable(types.date()),
20
+ id: types.string(),
21
+ idleExpiresAt: types.nullable(z.any()),
22
+ kind: types.literal("api_key"),
23
+ name: types.string(),
24
+ });
25
+ export function credentialAPIKeyFromJSON(jsonString) {
26
+ return safeParse(jsonString, (x) => CredentialAPIKey$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialAPIKey' from JSON`);
27
+ }
28
+ /** @internal */
29
+ export const CredentialCliToken$inboundSchema = z.object({
30
+ apiKeyKind: types.nullable(z.any()),
31
+ expiresAt: types.date(),
32
+ id: types.string(),
33
+ idleExpiresAt: types.date(),
34
+ kind: types.literal("cli_token"),
35
+ name: types.string(),
36
+ });
37
+ export function credentialCliTokenFromJSON(jsonString) {
38
+ return safeParse(jsonString, (x) => CredentialCliToken$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialCliToken' from JSON`);
39
+ }
40
+ /** @internal */
41
+ export const CredentialSession$inboundSchema = z.object({
42
+ apiKeyKind: types.nullable(z.any()),
43
+ expiresAt: types.date(),
44
+ id: types.string(),
45
+ idleExpiresAt: types.nullable(z.any()),
46
+ kind: types.literal("session"),
47
+ name: types.nullable(z.any()),
48
+ });
49
+ export function credentialSessionFromJSON(jsonString) {
50
+ return safeParse(jsonString, (x) => CredentialSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialSession' from JSON`);
51
+ }
52
+ /** @internal */
53
+ export const Credential$inboundSchema = discriminatedUnion("kind", {
54
+ session: z.lazy(() => CredentialSession$inboundSchema),
55
+ cli_token: z.lazy(() => CredentialCliToken$inboundSchema),
56
+ api_key: z.lazy(() => CredentialAPIKey$inboundSchema),
57
+ });
58
+ export function credentialFromJSON(jsonString) {
59
+ return safeParse(jsonString, (x) => Credential$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Credential' from JSON`);
60
+ }
@@ -11,21 +11,42 @@ export type Login = {
11
11
  };
12
12
  url: string;
13
13
  };
14
+ export type CredentialsMcpServer = {
15
+ name: string;
16
+ /**
17
+ * The MCP server's URL. On an environment created with `tokenInUrl`, a request with no `Authorization` header acts as the actor that this call picks when you send no `actorId`. To act as `actorId`, send the service's headers.
18
+ */
19
+ url: string;
20
+ };
21
+ export type CredentialsService = {
22
+ headers: {
23
+ [k: string]: string;
24
+ };
25
+ id: string;
26
+ servers?: Array<CredentialsMcpServer> | undefined;
27
+ /**
28
+ * The URL where the service's paths start: the app URL followed by the service's path. The `url` of the service at `/` is the app URL itself. On an environment created with `tokenInUrl`, the app URL is in its token form. A client of a service that serves MCP servers calls the URL of one of its MCP servers instead.
29
+ */
30
+ url: string;
31
+ };
14
32
  export type Credentials = {
15
33
  actorId: string;
16
- app: string;
34
+ appName: string;
17
35
  environmentId: string;
18
36
  expiresAt: Date;
19
- headers: {
20
- [k: string]: string;
21
- };
22
37
  login: Login | null;
38
+ services: Array<CredentialsService>;
23
39
  token: string;
24
- url: string;
25
40
  };
26
41
  /** @internal */
27
42
  export declare const Login$inboundSchema: z.ZodMiniType<Login, unknown>;
28
43
  export declare function loginFromJSON(jsonString: string): SafeParseResult<Login, SDKValidationError>;
29
44
  /** @internal */
45
+ export declare const CredentialsMcpServer$inboundSchema: z.ZodMiniType<CredentialsMcpServer, unknown>;
46
+ export declare function credentialsMcpServerFromJSON(jsonString: string): SafeParseResult<CredentialsMcpServer, SDKValidationError>;
47
+ /** @internal */
48
+ export declare const CredentialsService$inboundSchema: z.ZodMiniType<CredentialsService, unknown>;
49
+ export declare function credentialsServiceFromJSON(jsonString: string): SafeParseResult<CredentialsService, SDKValidationError>;
50
+ /** @internal */
30
51
  export declare const Credentials$inboundSchema: z.ZodMiniType<Credentials, unknown>;
31
52
  export declare function credentialsFromJSON(jsonString: string): SafeParseResult<Credentials, SDKValidationError>;
@@ -15,16 +15,33 @@ export function loginFromJSON(jsonString) {
15
15
  return safeParse(jsonString, (x) => Login$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Login' from JSON`);
16
16
  }
17
17
  /** @internal */
18
+ export const CredentialsMcpServer$inboundSchema = z.object({
19
+ name: types.string(),
20
+ url: types.string(),
21
+ });
22
+ export function credentialsMcpServerFromJSON(jsonString) {
23
+ return safeParse(jsonString, (x) => CredentialsMcpServer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialsMcpServer' from JSON`);
24
+ }
25
+ /** @internal */
26
+ export const CredentialsService$inboundSchema = z.object({
27
+ headers: z.record(z.string(), types.string()),
28
+ id: types.string(),
29
+ servers: types.optional(z.array(z.lazy(() => CredentialsMcpServer$inboundSchema))),
30
+ url: types.string(),
31
+ });
32
+ export function credentialsServiceFromJSON(jsonString) {
33
+ return safeParse(jsonString, (x) => CredentialsService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialsService' from JSON`);
34
+ }
35
+ /** @internal */
18
36
  export const Credentials$inboundSchema = z
19
37
  .object({
20
38
  actorId: types.string(),
21
- app: types.string(),
39
+ appName: types.string(),
22
40
  environmentId: types.string(),
23
41
  expiresAt: types.date(),
24
- headers: z.record(z.string(), types.string()),
25
42
  login: types.nullable(z.lazy(() => Login$inboundSchema)),
43
+ services: z.array(z.lazy(() => CredentialsService$inboundSchema)),
26
44
  token: types.string(),
27
- url: types.string(),
28
45
  });
29
46
  export function credentialsFromJSON(jsonString) {
30
47
  return safeParse(jsonString, (x) => Credentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Credentials' from JSON`);
@@ -6,11 +6,12 @@ export declare const EnvironmentFailureCode: {
6
6
  readonly StartFailed: "start_failed";
7
7
  readonly PauseRemoved: "pause_removed";
8
8
  readonly VersionUnavailable: "version_unavailable";
9
- readonly InvalidSettings: "invalid_settings";
9
+ readonly InvalidSetup: "invalid_setup";
10
+ readonly InvalidServices: "invalid_services";
10
11
  };
11
12
  export type EnvironmentFailureCode = OpenEnum<typeof EnvironmentFailureCode>;
12
13
  export type EnvironmentFailure = {
13
- app: string;
14
+ appName: string;
14
15
  code: EnvironmentFailureCode;
15
16
  message: string;
16
17
  };
@@ -9,13 +9,14 @@ export const EnvironmentFailureCode = {
9
9
  StartFailed: "start_failed",
10
10
  PauseRemoved: "pause_removed",
11
11
  VersionUnavailable: "version_unavailable",
12
- InvalidSettings: "invalid_settings",
12
+ InvalidSetup: "invalid_setup",
13
+ InvalidServices: "invalid_services",
13
14
  };
14
15
  /** @internal */
15
16
  export const EnvironmentFailureCode$inboundSchema = openEnums.inboundSchema(EnvironmentFailureCode);
16
17
  /** @internal */
17
18
  export const EnvironmentFailure$inboundSchema = z.object({
18
- app: types.string(),
19
+ appName: types.string(),
19
20
  code: EnvironmentFailureCode$inboundSchema,
20
21
  message: types.string(),
21
22
  });
@@ -8,7 +8,10 @@ import { Principal } from "./principal.js";
8
8
  export type EnvironmentApp = {
9
9
  appId: string;
10
10
  name: string;
11
- settings: {
11
+ services: {
12
+ [k: string]: any;
13
+ };
14
+ setup: {
12
15
  [k: string]: any;
13
16
  };
14
17
  url: string;
@@ -17,7 +17,8 @@ export const Reason = {
17
17
  export const EnvironmentApp$inboundSchema = z.object({
18
18
  appId: types.string(),
19
19
  name: types.string(),
20
- settings: z.record(z.string(), z.any()),
20
+ services: z.record(z.string(), z.any()),
21
+ setup: z.record(z.string(), z.any()),
21
22
  url: types.string(),
22
23
  version: types.string(),
23
24
  versionId: types.string(),
@@ -18,6 +18,7 @@ export declare const ErrorCode: {
18
18
  readonly BodyTooLarge: "body_too_large";
19
19
  readonly VersionUnavailable: "version_unavailable";
20
20
  readonly EnvironmentLimitReached: "environment_limit_reached";
21
+ readonly RateLimited: "rate_limited";
21
22
  readonly InternalError: "internal_error";
22
23
  readonly Unavailable: "unavailable";
23
24
  };
@@ -21,6 +21,7 @@ export const ErrorCode = {
21
21
  BodyTooLarge: "body_too_large",
22
22
  VersionUnavailable: "version_unavailable",
23
23
  EnvironmentLimitReached: "environment_limit_reached",
24
+ RateLimited: "rate_limited",
24
25
  InternalError: "internal_error",
25
26
  Unavailable: "unavailable",
26
27
  };
@@ -1,14 +1,18 @@
1
1
  export * from "./actor.js";
2
- export * from "./api.js";
2
+ export * from "./app-entry.js";
3
3
  export * from "./app.js";
4
4
  export * from "./audit-event.js";
5
5
  export * from "./body-preview.js";
6
+ export * from "./create-environment-app.js";
6
7
  export * from "./create-environment.js";
8
+ export * from "./credential.js";
7
9
  export * from "./credentials.js";
8
10
  export * from "./environment-failure.js";
9
11
  export * from "./environment-status.js";
10
12
  export * from "./environment.js";
11
13
  export * from "./error.js";
14
+ export * from "./mcp-server.js";
15
+ export * from "./mcp-tool.js";
12
16
  export * from "./me.js";
13
17
  export * from "./permission.js";
14
18
  export * from "./principal.js";
@@ -16,6 +20,7 @@ export * from "./request-detail.js";
16
20
  export * from "./request-stats.js";
17
21
  export * from "./request.js";
18
22
  export * from "./security.js";
23
+ export * from "./service.js";
19
24
  export * from "./snapshot-status.js";
20
25
  export * from "./snapshot.js";
21
26
  export * from "./version.js";
@@ -2,16 +2,20 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  export * from "./actor.js";
5
- export * from "./api.js";
5
+ export * from "./app-entry.js";
6
6
  export * from "./app.js";
7
7
  export * from "./audit-event.js";
8
8
  export * from "./body-preview.js";
9
+ export * from "./create-environment-app.js";
9
10
  export * from "./create-environment.js";
11
+ export * from "./credential.js";
10
12
  export * from "./credentials.js";
11
13
  export * from "./environment-failure.js";
12
14
  export * from "./environment-status.js";
13
15
  export * from "./environment.js";
14
16
  export * from "./error.js";
17
+ export * from "./mcp-server.js";
18
+ export * from "./mcp-tool.js";
15
19
  export * from "./me.js";
16
20
  export * from "./permission.js";
17
21
  export * from "./principal.js";
@@ -19,6 +23,7 @@ export * from "./request-detail.js";
19
23
  export * from "./request-stats.js";
20
24
  export * from "./request.js";
21
25
  export * from "./security.js";
26
+ export * from "./service.js";
22
27
  export * from "./snapshot-status.js";
23
28
  export * from "./snapshot.js";
24
29
  export * from "./version.js";
@@ -0,0 +1,11 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
4
+ import { McpTool } from "./mcp-tool.js";
5
+ export type McpServer = {
6
+ name: string;
7
+ tools: Array<McpTool>;
8
+ };
9
+ /** @internal */
10
+ export declare const McpServer$inboundSchema: z.ZodMiniType<McpServer, unknown>;
11
+ export declare function mcpServerFromJSON(jsonString: string): SafeParseResult<McpServer, SDKValidationError>;
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { safeParse } from "../lib/schemas.js";
6
+ import * as types from "../types/primitives.js";
7
+ import { McpTool$inboundSchema } from "./mcp-tool.js";
8
+ /** @internal */
9
+ export const McpServer$inboundSchema = z
10
+ .object({
11
+ name: types.string(),
12
+ tools: z.array(McpTool$inboundSchema),
13
+ });
14
+ export function mcpServerFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => McpServer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServer' from JSON`);
16
+ }
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
4
+ export type McpTool = {
5
+ description: string;
6
+ name: string;
7
+ title?: string | undefined;
8
+ writes: boolean;
9
+ };
10
+ /** @internal */
11
+ export declare const McpTool$inboundSchema: z.ZodMiniType<McpTool, unknown>;
12
+ export declare function mcpToolFromJSON(jsonString: string): SafeParseResult<McpTool, SDKValidationError>;
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { safeParse } from "../lib/schemas.js";
6
+ import * as types from "../types/primitives.js";
7
+ /** @internal */
8
+ export const McpTool$inboundSchema = z.object({
9
+ description: types.string(),
10
+ name: types.string(),
11
+ title: types.optional(types.string()),
12
+ writes: types.boolean(),
13
+ });
14
+ export function mcpToolFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => McpTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpTool' from JSON`);
16
+ }
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/v4-mini";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { Credential } from "./credential.js";
4
5
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
6
  import { Permission } from "./permission.js";
6
7
  import { Principal } from "./principal.js";
@@ -36,6 +37,7 @@ export type User = {
36
37
  name: string | null;
37
38
  };
38
39
  export type Me = {
40
+ credential: Credential;
39
41
  limits: Limits | null;
40
42
  organization: Organization1 | null;
41
43
  organizations: Array<Organization2>;
package/esm/models/me.js CHANGED
@@ -5,6 +5,7 @@ import * as z from "zod/v4-mini";
5
5
  import { safeParse } from "../lib/schemas.js";
6
6
  import * as openEnums from "../types/enums.js";
7
7
  import * as types from "../types/primitives.js";
8
+ import { Credential$inboundSchema } from "./credential.js";
8
9
  import { Permission$inboundSchema } from "./permission.js";
9
10
  import { Principal$inboundSchema } from "./principal.js";
10
11
  export const Role = {
@@ -62,6 +63,7 @@ export function userFromJSON(jsonString) {
62
63
  }
63
64
  /** @internal */
64
65
  export const Me$inboundSchema = z.object({
66
+ credential: Credential$inboundSchema,
65
67
  limits: types.nullable(z.lazy(() => Limits$inboundSchema)),
66
68
  organization: types.nullable(z.lazy(() => Organization1$inboundSchema)),
67
69
  organizations: z.array(z.lazy(() => Organization2$inboundSchema)),
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/v4-mini";
2
2
  export type CreateCredentialsRequestBody = {
3
3
  actorId?: string | undefined;
4
+ services?: Array<string> | undefined;
4
5
  };
5
6
  export type CreateCredentialsRequest = {
6
7
  environmentId: string;
@@ -10,6 +11,7 @@ export type CreateCredentialsRequest = {
10
11
  /** @internal */
11
12
  export type CreateCredentialsRequestBody$Outbound = {
12
13
  actorId?: string | undefined;
14
+ services?: Array<string> | undefined;
13
15
  };
14
16
  /** @internal */
15
17
  export declare const CreateCredentialsRequestBody$outboundSchema: z.ZodMiniType<CreateCredentialsRequestBody$Outbound, CreateCredentialsRequestBody>;
@@ -5,6 +5,7 @@ import * as z from "zod/v4-mini";
5
5
  /** @internal */
6
6
  export const CreateCredentialsRequestBody$outboundSchema = z.object({
7
7
  actorId: z.optional(z.string()),
8
+ services: z.optional(z.array(z.string())),
8
9
  });
9
10
  export function createCredentialsRequestBodyToJSON(createCredentialsRequestBody) {
10
11
  return JSON.stringify(CreateCredentialsRequestBody$outboundSchema.parse(createCredentialsRequestBody));
@@ -21,11 +21,15 @@ export declare const GetRequestStatsStatusClass: {
21
21
  export type GetRequestStatsStatusClass = ClosedEnum<typeof GetRequestStatsStatusClass>;
22
22
  export type GetRequestStatsRequest = {
23
23
  environmentId: string;
24
- app?: string | undefined;
24
+ appName?: string | undefined;
25
25
  method?: GetRequestStatsMethod | undefined;
26
26
  responseStatus?: number | undefined;
27
27
  statusClass?: GetRequestStatsStatusClass | undefined;
28
28
  writesOnly?: boolean | undefined;
29
+ service?: string | undefined;
30
+ mcpServer?: string | undefined;
31
+ tool?: string | undefined;
32
+ operation?: string | undefined;
29
33
  search?: string | undefined;
30
34
  from: Date;
31
35
  to: Date;
@@ -37,11 +41,15 @@ export declare const GetRequestStatsStatusClass$outboundSchema: z.ZodMiniEnum<ty
37
41
  /** @internal */
38
42
  export type GetRequestStatsRequest$Outbound = {
39
43
  environmentId: string;
40
- app?: string | undefined;
44
+ appName?: string | undefined;
41
45
  method?: string | undefined;
42
46
  responseStatus?: number | undefined;
43
47
  statusClass?: string | undefined;
44
48
  writesOnly?: boolean | undefined;
49
+ service?: string | undefined;
50
+ mcpServer?: string | undefined;
51
+ tool?: string | undefined;
52
+ operation?: string | undefined;
45
53
  search?: string | undefined;
46
54
  from: string;
47
55
  to: string;
@@ -26,11 +26,15 @@ export const GetRequestStatsStatusClass$outboundSchema = z.enum(GetRequestStatsS
26
26
  /** @internal */
27
27
  export const GetRequestStatsRequest$outboundSchema = z.object({
28
28
  environmentId: z.string(),
29
- app: z.optional(z.string()),
29
+ appName: z.optional(z.string()),
30
30
  method: z.optional(GetRequestStatsMethod$outboundSchema),
31
31
  responseStatus: z.optional(z.int()),
32
32
  statusClass: z.optional(GetRequestStatsStatusClass$outboundSchema),
33
33
  writesOnly: z.optional(z.boolean()),
34
+ service: z.optional(z.string()),
35
+ mcpServer: z.optional(z.string()),
36
+ tool: z.optional(z.string()),
37
+ operation: z.optional(z.string()),
34
38
  search: z.optional(z.string()),
35
39
  from: z.pipe(z.date(), z.transform(v => v.toISOString())),
36
40
  to: z.pipe(z.date(), z.transform(v => v.toISOString())),
@@ -11,6 +11,7 @@ export * from "./get-snapshot.js";
11
11
  export * from "./get-workspace.js";
12
12
  export * from "./list-apps.js";
13
13
  export * from "./list-audit-events.js";
14
+ export * from "./list-environment-creators.js";
14
15
  export * from "./list-environments.js";
15
16
  export * from "./list-requests.js";
16
17
  export * from "./list-snapshots.js";
@@ -14,6 +14,7 @@ export * from "./get-snapshot.js";
14
14
  export * from "./get-workspace.js";
15
15
  export * from "./list-apps.js";
16
16
  export * from "./list-audit-events.js";
17
+ export * from "./list-environment-creators.js";
17
18
  export * from "./list-environments.js";
18
19
  export * from "./list-requests.js";
19
20
  export * from "./list-snapshots.js";
@@ -0,0 +1,23 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
4
+ import * as models from "../index.js";
5
+ export type ListEnvironmentCreatorsRequest = {
6
+ workspaceId?: string | undefined;
7
+ };
8
+ /**
9
+ * Each principal that created an environment in the workspace, by name
10
+ */
11
+ export type ListEnvironmentCreatorsResponse = {
12
+ data: Array<models.Principal>;
13
+ };
14
+ /** @internal */
15
+ export type ListEnvironmentCreatorsRequest$Outbound = {
16
+ workspaceId?: string | undefined;
17
+ };
18
+ /** @internal */
19
+ export declare const ListEnvironmentCreatorsRequest$outboundSchema: z.ZodMiniType<ListEnvironmentCreatorsRequest$Outbound, ListEnvironmentCreatorsRequest>;
20
+ export declare function listEnvironmentCreatorsRequestToJSON(listEnvironmentCreatorsRequest: ListEnvironmentCreatorsRequest): string;
21
+ /** @internal */
22
+ export declare const ListEnvironmentCreatorsResponse$inboundSchema: z.ZodMiniType<ListEnvironmentCreatorsResponse, unknown>;
23
+ export declare function listEnvironmentCreatorsResponseFromJSON(jsonString: string): SafeParseResult<ListEnvironmentCreatorsResponse, SDKValidationError>;
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { safeParse } from "../../lib/schemas.js";
6
+ import * as models from "../index.js";
7
+ /** @internal */
8
+ export const ListEnvironmentCreatorsRequest$outboundSchema = z.object({
9
+ workspaceId: z.optional(z.string()),
10
+ });
11
+ export function listEnvironmentCreatorsRequestToJSON(listEnvironmentCreatorsRequest) {
12
+ return JSON.stringify(ListEnvironmentCreatorsRequest$outboundSchema.parse(listEnvironmentCreatorsRequest));
13
+ }
14
+ /** @internal */
15
+ export const ListEnvironmentCreatorsResponse$inboundSchema = z.object({
16
+ data: z.array(models.Principal$inboundSchema),
17
+ });
18
+ export function listEnvironmentCreatorsResponseFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => ListEnvironmentCreatorsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListEnvironmentCreatorsResponse' from JSON`);
20
+ }
@@ -7,12 +7,14 @@ export type ListEnvironmentsRequest = {
7
7
  cursor?: string | undefined;
8
8
  workspaceId?: string | undefined;
9
9
  status?: Array<models.EnvironmentStatus> | undefined;
10
+ appId?: Array<string> | undefined;
11
+ createdBy?: Array<string> | undefined;
10
12
  snapshotId?: string | undefined;
11
13
  search?: string | undefined;
12
14
  label?: Array<string> | undefined;
13
15
  };
14
16
  /**
15
- * The workspace's environments, newest first
17
+ * The workspace's environments, newest created first
16
18
  */
17
19
  export type ListEnvironmentsResponse = {
18
20
  data: Array<models.Environment>;
@@ -24,6 +26,8 @@ export type ListEnvironmentsRequest$Outbound = {
24
26
  cursor?: string | undefined;
25
27
  workspaceId?: string | undefined;
26
28
  status?: Array<string> | undefined;
29
+ appId?: Array<string> | undefined;
30
+ createdBy?: Array<string> | undefined;
27
31
  snapshotId?: string | undefined;
28
32
  search?: string | undefined;
29
33
  label?: Array<string> | undefined;
@@ -11,6 +11,8 @@ export const ListEnvironmentsRequest$outboundSchema = z.object({
11
11
  cursor: z.optional(z.string()),
12
12
  workspaceId: z.optional(z.string()),
13
13
  status: z.optional(z.array(models.EnvironmentStatus$outboundSchema)),
14
+ appId: z.optional(z.array(z.string())),
15
+ createdBy: z.optional(z.array(z.string())),
14
16
  snapshotId: z.optional(z.string()),
15
17
  search: z.optional(z.string()),
16
18
  label: z.optional(z.array(z.string())),
@@ -26,11 +26,15 @@ export type ListRequestsRequest = {
26
26
  limit?: number | undefined;
27
27
  cursor?: string | undefined;
28
28
  environmentId: string;
29
- app?: string | undefined;
29
+ appName?: string | undefined;
30
30
  method?: ListRequestsMethod | undefined;
31
31
  responseStatus?: number | undefined;
32
32
  statusClass?: ListRequestsStatusClass | undefined;
33
33
  writesOnly?: boolean | undefined;
34
+ service?: string | undefined;
35
+ mcpServer?: string | undefined;
36
+ tool?: string | undefined;
37
+ operation?: string | undefined;
34
38
  search?: string | undefined;
35
39
  from?: Date | undefined;
36
40
  to?: Date | undefined;
@@ -51,11 +55,15 @@ export type ListRequestsRequest$Outbound = {
51
55
  limit: number;
52
56
  cursor?: string | undefined;
53
57
  environmentId: string;
54
- app?: string | undefined;
58
+ appName?: string | undefined;
55
59
  method?: string | undefined;
56
60
  responseStatus?: number | undefined;
57
61
  statusClass?: string | undefined;
58
62
  writesOnly?: boolean | undefined;
63
+ service?: string | undefined;
64
+ mcpServer?: string | undefined;
65
+ tool?: string | undefined;
66
+ operation?: string | undefined;
59
67
  search?: string | undefined;
60
68
  from?: string | undefined;
61
69
  to?: string | undefined;
@@ -31,11 +31,15 @@ export const ListRequestsRequest$outboundSchema = z.object({
31
31
  limit: z._default(z.int(), 50),
32
32
  cursor: z.optional(z.string()),
33
33
  environmentId: z.string(),
34
- app: z.optional(z.string()),
34
+ appName: z.optional(z.string()),
35
35
  method: z.optional(ListRequestsMethod$outboundSchema),
36
36
  responseStatus: z.optional(z.int()),
37
37
  statusClass: z.optional(ListRequestsStatusClass$outboundSchema),
38
38
  writesOnly: z.optional(z.boolean()),
39
+ service: z.optional(z.string()),
40
+ mcpServer: z.optional(z.string()),
41
+ tool: z.optional(z.string()),
42
+ operation: z.optional(z.string()),
39
43
  search: z.optional(z.string()),
40
44
  from: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
41
45
  to: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
@@ -9,13 +9,18 @@ export declare const RequestDetailRespondedBy: {
9
9
  };
10
10
  export type RequestDetailRespondedBy = OpenEnum<typeof RequestDetailRespondedBy>;
11
11
  export type RequestDetail = {
12
- app: string;
12
+ appName: string;
13
13
  completedAt: Date;
14
14
  durationMs: number;
15
15
  environmentId: string;
16
16
  errorCode: string | null;
17
17
  id: string;
18
+ /**
19
+ * The MCP server that the request called, as the app named it. `null` when the gateway answered, when State Machines refused the request before the app read it, or when the request called no MCP server that the environment serves.
20
+ */
21
+ mcpServer: string | null;
18
22
  method: string;
23
+ operation: string | null;
19
24
  path: string;
20
25
  query: string;
21
26
  receivedAt: Date;
@@ -23,6 +28,8 @@ export type RequestDetail = {
23
28
  respondedBy: RequestDetailRespondedBy;
24
29
  responseBytes: number | null;
25
30
  responseStatus: number;
31
+ service: string | null;
32
+ tool: string | null;
26
33
  requestBody: BodyPreview;
27
34
  requestHeaders: {
28
35
  [k: string]: string;