@continuous-labs/sdk 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/esm/funcs/simulations-advance-simulation-time.d.ts +19 -0
- package/esm/funcs/simulations-advance-simulation-time.d.ts.map +1 -0
- package/esm/funcs/simulations-advance-simulation-time.js +94 -0
- package/esm/funcs/simulations-advance-simulation-time.js.map +1 -0
- package/esm/funcs/simulations-get-simulation-advance.d.ts +19 -0
- package/esm/funcs/simulations-get-simulation-advance.d.ts.map +1 -0
- package/esm/funcs/simulations-get-simulation-advance.js +98 -0
- package/esm/funcs/simulations-get-simulation-advance.js.map +1 -0
- package/esm/funcs/simulations-list-simulation-advance-events.d.ts +19 -0
- package/esm/funcs/simulations-list-simulation-advance-events.d.ts.map +1 -0
- package/esm/funcs/simulations-list-simulation-advance-events.js +103 -0
- package/esm/funcs/simulations-list-simulation-advance-events.js.map +1 -0
- package/esm/funcs/worlds-advance-world-time.d.ts +19 -0
- package/esm/funcs/worlds-advance-world-time.d.ts.map +1 -0
- package/esm/funcs/worlds-advance-world-time.js +94 -0
- package/esm/funcs/worlds-advance-world-time.js.map +1 -0
- package/esm/funcs/worlds-get-world-advance.d.ts +19 -0
- package/esm/funcs/worlds-get-world-advance.d.ts.map +1 -0
- package/esm/funcs/worlds-get-world-advance.js +98 -0
- package/esm/funcs/worlds-get-world-advance.js.map +1 -0
- package/esm/funcs/worlds-start-world.js +4 -5
- package/esm/funcs/worlds-start-world.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/advance-time-input-body.d.ts +15 -0
- package/esm/models/advance-time-input-body.d.ts.map +1 -0
- package/esm/models/advance-time-input-body.js +12 -0
- package/esm/models/advance-time-input-body.js.map +1 -0
- package/esm/models/build-world-request.d.ts +19 -0
- package/esm/models/build-world-request.d.ts.map +1 -1
- package/esm/models/build-world-request.js +10 -0
- package/esm/models/build-world-request.js.map +1 -1
- package/esm/models/clock-advance-member.d.ts +42 -0
- package/esm/models/clock-advance-member.d.ts.map +1 -0
- package/esm/models/clock-advance-member.js +36 -0
- package/esm/models/clock-advance-member.js.map +1 -0
- package/esm/models/clock-advance.d.ts +56 -0
- package/esm/models/clock-advance.d.ts.map +1 -0
- package/esm/models/clock-advance.js +40 -0
- package/esm/models/clock-advance.js.map +1 -0
- package/esm/models/clock-event.d.ts +25 -0
- package/esm/models/clock-event.d.ts.map +1 -0
- package/esm/models/clock-event.js +23 -0
- package/esm/models/clock-event.js.map +1 -0
- package/esm/models/create-simulation-request.d.ts +5 -0
- package/esm/models/create-simulation-request.d.ts.map +1 -1
- package/esm/models/create-simulation-request.js +2 -0
- package/esm/models/create-simulation-request.js.map +1 -1
- package/esm/models/created-simulation.d.ts +12 -0
- package/esm/models/created-simulation.d.ts.map +1 -1
- package/esm/models/created-simulation.js +6 -0
- package/esm/models/created-simulation.js.map +1 -1
- package/esm/models/index.d.ts +7 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +7 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/list-advance-events-output-body.d.ts +18 -0
- package/esm/models/list-advance-events-output-body.d.ts.map +1 -0
- package/esm/models/list-advance-events-output-body.js +21 -0
- package/esm/models/list-advance-events-output-body.js.map +1 -0
- package/esm/models/operations/advance-simulation-time.d.ts +23 -0
- package/esm/models/operations/advance-simulation-time.d.ts.map +1 -0
- package/esm/models/operations/advance-simulation-time.js +20 -0
- package/esm/models/operations/advance-simulation-time.js.map +1 -0
- package/esm/models/operations/advance-world-time.d.ts +23 -0
- package/esm/models/operations/advance-world-time.d.ts.map +1 -0
- package/esm/models/operations/advance-world-time.js +20 -0
- package/esm/models/operations/advance-world-time.js.map +1 -0
- package/esm/models/operations/get-simulation-advance.d.ts +20 -0
- package/esm/models/operations/get-simulation-advance.d.ts.map +1 -0
- package/esm/models/operations/get-simulation-advance.js +18 -0
- package/esm/models/operations/get-simulation-advance.js.map +1 -0
- package/esm/models/operations/get-world-advance.d.ts +20 -0
- package/esm/models/operations/get-world-advance.d.ts.map +1 -0
- package/esm/models/operations/get-world-advance.js +18 -0
- package/esm/models/operations/get-world-advance.js.map +1 -0
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-simulation-advance-events.d.ts +30 -0
- package/esm/models/operations/list-simulation-advance-events.d.ts.map +1 -0
- package/esm/models/operations/list-simulation-advance-events.js +20 -0
- package/esm/models/operations/list-simulation-advance-events.js.map +1 -0
- package/esm/models/operations/start-world.d.ts +3 -0
- package/esm/models/operations/start-world.d.ts.map +1 -1
- package/esm/models/operations/start-world.js +2 -0
- package/esm/models/operations/start-world.js.map +1 -1
- package/esm/models/resource-error.d.ts +17 -0
- package/esm/models/resource-error.d.ts.map +1 -0
- package/esm/models/resource-error.js +15 -0
- package/esm/models/resource-error.js.map +1 -0
- package/esm/models/simulation.d.ts +12 -0
- package/esm/models/simulation.d.ts.map +1 -1
- package/esm/models/simulation.js +6 -0
- package/esm/models/simulation.js.map +1 -1
- package/esm/models/simulator-build-progress.d.ts +4 -4
- package/esm/models/simulator-build-progress.d.ts.map +1 -1
- package/esm/models/simulator-build-progress.js +3 -3
- package/esm/models/simulator-build-progress.js.map +1 -1
- package/esm/models/start-world-request.d.ts +15 -0
- package/esm/models/start-world-request.d.ts.map +1 -0
- package/esm/models/start-world-request.js +17 -0
- package/esm/models/start-world-request.js.map +1 -0
- package/esm/models/step.d.ts +30 -0
- package/esm/models/step.d.ts.map +1 -1
- package/esm/models/step.js +24 -2
- package/esm/models/step.js.map +1 -1
- package/esm/models/world-build.d.ts +46 -0
- package/esm/models/world-build.d.ts.map +1 -1
- package/esm/models/world-build.js +32 -2
- package/esm/models/world-build.js.map +1 -1
- package/esm/models/world.d.ts +12 -0
- package/esm/models/world.d.ts.map +1 -1
- package/esm/models/world.js +6 -0
- package/esm/models/world.js.map +1 -1
- package/esm/sdk/simulations.d.ts +21 -0
- package/esm/sdk/simulations.d.ts.map +1 -1
- package/esm/sdk/simulations.js +30 -0
- package/esm/sdk/simulations.js.map +1 -1
- package/esm/sdk/worlds.d.ts +14 -0
- package/esm/sdk/worlds.d.ts.map +1 -1
- package/esm/sdk/worlds.js +20 -0
- package/esm/sdk/worlds.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/simulations-advance-simulation-time.ts +192 -0
- package/src/funcs/simulations-get-simulation-advance.ts +190 -0
- package/src/funcs/simulations-list-simulation-advance-events.ts +199 -0
- package/src/funcs/worlds-advance-world-time.ts +192 -0
- package/src/funcs/worlds-get-world-advance.ts +187 -0
- package/src/funcs/worlds-start-world.ts +8 -5
- package/src/lib/config.ts +2 -2
- package/src/models/advance-time-input-body.ts +33 -0
- package/src/models/build-world-request.ts +26 -0
- package/src/models/clock-advance-member.ts +87 -0
- package/src/models/clock-advance.ts +102 -0
- package/src/models/clock-event.ts +55 -0
- package/src/models/create-simulation-request.ts +7 -0
- package/src/models/created-simulation.ts +18 -0
- package/src/models/index.ts +7 -0
- package/src/models/list-advance-events-output-body.ts +48 -0
- package/src/models/operations/advance-simulation-time.ts +53 -0
- package/src/models/operations/advance-world-time.ts +51 -0
- package/src/models/operations/get-simulation-advance.ts +49 -0
- package/src/models/operations/get-world-advance.ts +47 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/list-simulation-advance-events.ts +61 -0
- package/src/models/operations/start-world.ts +4 -0
- package/src/models/resource-error.ts +39 -0
- package/src/models/simulation.ts +18 -0
- package/src/models/simulator-build-progress.ts +11 -7
- package/src/models/start-world-request.ts +41 -0
- package/src/models/step.ts +52 -4
- package/src/models/world-build.ts +77 -4
- package/src/models/world.ts +18 -0
- package/src/sdk/simulations.ts +54 -0
- package/src/sdk/worlds.ts +36 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import * as types from "../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
11
|
+
|
|
12
|
+
export type ClockEvent = {
|
|
13
|
+
/**
|
|
14
|
+
* Simulated time observed by this event handler.
|
|
15
|
+
*/
|
|
16
|
+
at: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Scheduled event ID.
|
|
19
|
+
*/
|
|
20
|
+
eventId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Persisted insertion order for events due at the same time.
|
|
23
|
+
*/
|
|
24
|
+
sequence: number;
|
|
25
|
+
/**
|
|
26
|
+
* Declared event type.
|
|
27
|
+
*/
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const ClockEvent$inboundSchema: z.ZodMiniType<ClockEvent, unknown> = z
|
|
33
|
+
.pipe(
|
|
34
|
+
z.object({
|
|
35
|
+
at: types.date(),
|
|
36
|
+
event_id: types.string(),
|
|
37
|
+
sequence: types.number(),
|
|
38
|
+
type: types.string(),
|
|
39
|
+
}),
|
|
40
|
+
z.transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"event_id": "eventId",
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export function clockEventFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<ClockEvent, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => ClockEvent$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'ClockEvent' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -14,12 +14,17 @@ export type CreateSimulationRequest = {
|
|
|
14
14
|
* ID of the ready Simulator.
|
|
15
15
|
*/
|
|
16
16
|
simulatorId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Initial simulated time in RFC 3339 format. Omission uses 2024-01-01T00:00:00Z. Precision is milliseconds.
|
|
19
|
+
*/
|
|
20
|
+
startTime?: Date | undefined;
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
/** @internal */
|
|
20
24
|
export type CreateSimulationRequest$Outbound = {
|
|
21
25
|
name?: string | undefined;
|
|
22
26
|
simulator_id: string;
|
|
27
|
+
start_time?: string | undefined;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
/** @internal */
|
|
@@ -30,10 +35,12 @@ export const CreateSimulationRequest$outboundSchema: z.ZodMiniType<
|
|
|
30
35
|
z.object({
|
|
31
36
|
name: z.optional(z.string()),
|
|
32
37
|
simulatorId: z.string(),
|
|
38
|
+
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
33
39
|
}),
|
|
34
40
|
z.transform((v) => {
|
|
35
41
|
return remap$(v, {
|
|
36
42
|
simulatorId: "simulator_id",
|
|
43
|
+
startTime: "start_time",
|
|
37
44
|
});
|
|
38
45
|
}),
|
|
39
46
|
);
|
|
@@ -25,10 +25,18 @@ export const CreatedSimulationStatus = {
|
|
|
25
25
|
export type CreatedSimulationStatus = OpenEnum<typeof CreatedSimulationStatus>;
|
|
26
26
|
|
|
27
27
|
export type CreatedSimulation = {
|
|
28
|
+
/**
|
|
29
|
+
* Current clock advance operation ID, or null.
|
|
30
|
+
*/
|
|
31
|
+
activeAdvanceId: string | null;
|
|
28
32
|
/**
|
|
29
33
|
* Simulation creation time.
|
|
30
34
|
*/
|
|
31
35
|
createdAt: Date;
|
|
36
|
+
/**
|
|
37
|
+
* Current simulated time.
|
|
38
|
+
*/
|
|
39
|
+
currentTime: Date;
|
|
32
40
|
/**
|
|
33
41
|
* Base URL for requests to the Simulation.
|
|
34
42
|
*/
|
|
@@ -53,6 +61,10 @@ export type CreatedSimulation = {
|
|
|
53
61
|
* ID of the Simulator.
|
|
54
62
|
*/
|
|
55
63
|
simulatorId: string;
|
|
64
|
+
/**
|
|
65
|
+
* Initial simulated time.
|
|
66
|
+
*/
|
|
67
|
+
startTime: Date;
|
|
56
68
|
/**
|
|
57
69
|
* Current status. running serves requests. paused means the Simulation was idle and the platform paused it; the next request wakes it. stopped means its state is saved and requests return 409 until you start it.
|
|
58
70
|
*/
|
|
@@ -75,22 +87,28 @@ export const CreatedSimulation$inboundSchema: z.ZodMiniType<
|
|
|
75
87
|
unknown
|
|
76
88
|
> = z.pipe(
|
|
77
89
|
z.object({
|
|
90
|
+
active_advance_id: types.nullable(types.string()),
|
|
78
91
|
created_at: types.date(),
|
|
92
|
+
current_time: types.date(),
|
|
79
93
|
endpoint: types.string(),
|
|
80
94
|
expires_at: types.date(),
|
|
81
95
|
id: types.string(),
|
|
82
96
|
name: types.string(),
|
|
83
97
|
parent_id: types.nullable(types.string()),
|
|
84
98
|
simulator_id: types.string(),
|
|
99
|
+
start_time: types.date(),
|
|
85
100
|
status: CreatedSimulationStatus$inboundSchema,
|
|
86
101
|
token: types.string(),
|
|
87
102
|
}),
|
|
88
103
|
z.transform((v) => {
|
|
89
104
|
return remap$(v, {
|
|
105
|
+
"active_advance_id": "activeAdvanceId",
|
|
90
106
|
"created_at": "createdAt",
|
|
107
|
+
"current_time": "currentTime",
|
|
91
108
|
"expires_at": "expiresAt",
|
|
92
109
|
"parent_id": "parentId",
|
|
93
110
|
"simulator_id": "simulatorId",
|
|
111
|
+
"start_time": "startTime",
|
|
94
112
|
});
|
|
95
113
|
}),
|
|
96
114
|
);
|
package/src/models/index.ts
CHANGED
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export * from "./advance-time-input-body.js";
|
|
5
6
|
export * from "./build-simulator-request.js";
|
|
6
7
|
export * from "./build-world-request.js";
|
|
8
|
+
export * from "./clock-advance-member.js";
|
|
9
|
+
export * from "./clock-advance.js";
|
|
10
|
+
export * from "./clock-event.js";
|
|
7
11
|
export * from "./create-simulation-request.js";
|
|
8
12
|
export * from "./created-simulation.js";
|
|
9
13
|
export * from "./fork-simulation-request.js";
|
|
14
|
+
export * from "./list-advance-events-output-body.js";
|
|
10
15
|
export * from "./list-simulation-steps-response.js";
|
|
11
16
|
export * from "./list-simulations-response.js";
|
|
12
17
|
export * from "./list-simulators-response.js";
|
|
13
18
|
export * from "./list-worlds-response.js";
|
|
14
19
|
export * from "./mint-simulation-token-request.js";
|
|
20
|
+
export * from "./resource-error.js";
|
|
15
21
|
export * from "./security.js";
|
|
16
22
|
export * from "./simulation-token.js";
|
|
17
23
|
export * from "./simulation.js";
|
|
18
24
|
export * from "./simulator-build-progress.js";
|
|
19
25
|
export * from "./simulator-error.js";
|
|
20
26
|
export * from "./simulator.js";
|
|
27
|
+
export * from "./start-world-request.js";
|
|
21
28
|
export * from "./step.js";
|
|
22
29
|
export * from "./world-build.js";
|
|
23
30
|
export * from "./world-data-summary.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import * as types from "../types/primitives.js";
|
|
10
|
+
import { ClockEvent, ClockEvent$inboundSchema } from "./clock-event.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
12
|
+
|
|
13
|
+
export type ListAdvanceEventsOutputBody = {
|
|
14
|
+
/**
|
|
15
|
+
* Committed events in execution order.
|
|
16
|
+
*/
|
|
17
|
+
events: Array<ClockEvent>;
|
|
18
|
+
/**
|
|
19
|
+
* Cursor for the next page, or null.
|
|
20
|
+
*/
|
|
21
|
+
nextCursor: string | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ListAdvanceEventsOutputBody$inboundSchema: z.ZodMiniType<
|
|
26
|
+
ListAdvanceEventsOutputBody,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.pipe(
|
|
29
|
+
z.object({
|
|
30
|
+
events: z.array(ClockEvent$inboundSchema),
|
|
31
|
+
next_cursor: types.nullable(types.string()),
|
|
32
|
+
}),
|
|
33
|
+
z.transform((v) => {
|
|
34
|
+
return remap$(v, {
|
|
35
|
+
"next_cursor": "nextCursor",
|
|
36
|
+
});
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export function listAdvanceEventsOutputBodyFromJSON(
|
|
41
|
+
jsonString: string,
|
|
42
|
+
): SafeParseResult<ListAdvanceEventsOutputBody, SDKValidationError> {
|
|
43
|
+
return safeParse(
|
|
44
|
+
jsonString,
|
|
45
|
+
(x) => ListAdvanceEventsOutputBody$inboundSchema.parse(JSON.parse(x)),
|
|
46
|
+
`Failed to parse 'ListAdvanceEventsOutputBody' from JSON`,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
|
|
9
|
+
export type AdvanceSimulationTimeRequest = {
|
|
10
|
+
/**
|
|
11
|
+
* Simulation or World ID.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Stable key for this request. Reuse with the same target returns the same operation.
|
|
16
|
+
*/
|
|
17
|
+
idempotencyKey: string;
|
|
18
|
+
body: models.AdvanceTimeInputBody;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type AdvanceSimulationTimeRequest$Outbound = {
|
|
23
|
+
id: string;
|
|
24
|
+
"Idempotency-Key": string;
|
|
25
|
+
body: models.AdvanceTimeInputBody$Outbound;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const AdvanceSimulationTimeRequest$outboundSchema: z.ZodMiniType<
|
|
30
|
+
AdvanceSimulationTimeRequest$Outbound,
|
|
31
|
+
AdvanceSimulationTimeRequest
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
idempotencyKey: z.string(),
|
|
36
|
+
body: models.AdvanceTimeInputBody$outboundSchema,
|
|
37
|
+
}),
|
|
38
|
+
z.transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
idempotencyKey: "Idempotency-Key",
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export function advanceSimulationTimeRequestToJSON(
|
|
46
|
+
advanceSimulationTimeRequest: AdvanceSimulationTimeRequest,
|
|
47
|
+
): string {
|
|
48
|
+
return JSON.stringify(
|
|
49
|
+
AdvanceSimulationTimeRequest$outboundSchema.parse(
|
|
50
|
+
advanceSimulationTimeRequest,
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
|
|
9
|
+
export type AdvanceWorldTimeRequest = {
|
|
10
|
+
/**
|
|
11
|
+
* Simulation or World ID.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Stable key for this request. Reuse with the same target returns the same operation.
|
|
16
|
+
*/
|
|
17
|
+
idempotencyKey: string;
|
|
18
|
+
body: models.AdvanceTimeInputBody;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type AdvanceWorldTimeRequest$Outbound = {
|
|
23
|
+
id: string;
|
|
24
|
+
"Idempotency-Key": string;
|
|
25
|
+
body: models.AdvanceTimeInputBody$Outbound;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const AdvanceWorldTimeRequest$outboundSchema: z.ZodMiniType<
|
|
30
|
+
AdvanceWorldTimeRequest$Outbound,
|
|
31
|
+
AdvanceWorldTimeRequest
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
idempotencyKey: z.string(),
|
|
36
|
+
body: models.AdvanceTimeInputBody$outboundSchema,
|
|
37
|
+
}),
|
|
38
|
+
z.transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
idempotencyKey: "Idempotency-Key",
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export function advanceWorldTimeRequestToJSON(
|
|
46
|
+
advanceWorldTimeRequest: AdvanceWorldTimeRequest,
|
|
47
|
+
): string {
|
|
48
|
+
return JSON.stringify(
|
|
49
|
+
AdvanceWorldTimeRequest$outboundSchema.parse(advanceWorldTimeRequest),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type GetSimulationAdvanceRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* Simulation or World ID.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Clock advance operation ID.
|
|
15
|
+
*/
|
|
16
|
+
advanceId: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type GetSimulationAdvanceRequest$Outbound = {
|
|
21
|
+
id: string;
|
|
22
|
+
advance_id: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const GetSimulationAdvanceRequest$outboundSchema: z.ZodMiniType<
|
|
27
|
+
GetSimulationAdvanceRequest$Outbound,
|
|
28
|
+
GetSimulationAdvanceRequest
|
|
29
|
+
> = z.pipe(
|
|
30
|
+
z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
advanceId: z.string(),
|
|
33
|
+
}),
|
|
34
|
+
z.transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
advanceId: "advance_id",
|
|
37
|
+
});
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export function getSimulationAdvanceRequestToJSON(
|
|
42
|
+
getSimulationAdvanceRequest: GetSimulationAdvanceRequest,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
GetSimulationAdvanceRequest$outboundSchema.parse(
|
|
46
|
+
getSimulationAdvanceRequest,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type GetWorldAdvanceRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* Simulation or World ID.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Clock advance operation ID.
|
|
15
|
+
*/
|
|
16
|
+
advanceId: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type GetWorldAdvanceRequest$Outbound = {
|
|
21
|
+
id: string;
|
|
22
|
+
advance_id: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const GetWorldAdvanceRequest$outboundSchema: z.ZodMiniType<
|
|
27
|
+
GetWorldAdvanceRequest$Outbound,
|
|
28
|
+
GetWorldAdvanceRequest
|
|
29
|
+
> = z.pipe(
|
|
30
|
+
z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
advanceId: z.string(),
|
|
33
|
+
}),
|
|
34
|
+
z.transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
advanceId: "advance_id",
|
|
37
|
+
});
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export function getWorldAdvanceRequestToJSON(
|
|
42
|
+
getWorldAdvanceRequest: GetWorldAdvanceRequest,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
GetWorldAdvanceRequest$outboundSchema.parse(getWorldAdvanceRequest),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export * from "./advance-simulation-time.js";
|
|
6
|
+
export * from "./advance-world-time.js";
|
|
5
7
|
export * from "./build-simulator.js";
|
|
6
8
|
export * from "./cancel-simulator-build.js";
|
|
7
9
|
export * from "./cancel-world-build.js";
|
|
@@ -9,9 +11,12 @@ export * from "./delete-simulation.js";
|
|
|
9
11
|
export * from "./delete-simulator.js";
|
|
10
12
|
export * from "./delete-world.js";
|
|
11
13
|
export * from "./fork-simulation.js";
|
|
14
|
+
export * from "./get-simulation-advance.js";
|
|
12
15
|
export * from "./get-simulation.js";
|
|
13
16
|
export * from "./get-simulator.js";
|
|
17
|
+
export * from "./get-world-advance.js";
|
|
14
18
|
export * from "./get-world.js";
|
|
19
|
+
export * from "./list-simulation-advance-events.js";
|
|
15
20
|
export * from "./list-simulation-steps.js";
|
|
16
21
|
export * from "./list-simulations.js";
|
|
17
22
|
export * from "./list-simulators.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type ListSimulationAdvanceEventsRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* Simulation ID.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Advance ID. A historical fork can read inherited runtime receipts.
|
|
15
|
+
*/
|
|
16
|
+
advanceId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Cursor from the previous page.
|
|
19
|
+
*/
|
|
20
|
+
cursor?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Page size, up to 200.
|
|
23
|
+
*/
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type ListSimulationAdvanceEventsRequest$Outbound = {
|
|
29
|
+
id: string;
|
|
30
|
+
advance_id: string;
|
|
31
|
+
cursor?: string | undefined;
|
|
32
|
+
limit: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ListSimulationAdvanceEventsRequest$outboundSchema: z.ZodMiniType<
|
|
37
|
+
ListSimulationAdvanceEventsRequest$Outbound,
|
|
38
|
+
ListSimulationAdvanceEventsRequest
|
|
39
|
+
> = z.pipe(
|
|
40
|
+
z.object({
|
|
41
|
+
id: z.string(),
|
|
42
|
+
advanceId: z.string(),
|
|
43
|
+
cursor: z.optional(z.string()),
|
|
44
|
+
limit: z._default(z.int(), 50),
|
|
45
|
+
}),
|
|
46
|
+
z.transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
advanceId: "advance_id",
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export function listSimulationAdvanceEventsRequestToJSON(
|
|
54
|
+
listSimulationAdvanceEventsRequest: ListSimulationAdvanceEventsRequest,
|
|
55
|
+
): string {
|
|
56
|
+
return JSON.stringify(
|
|
57
|
+
ListSimulationAdvanceEventsRequest$outboundSchema.parse(
|
|
58
|
+
listSimulationAdvanceEventsRequest,
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as models from "../index.js";
|
|
6
7
|
|
|
7
8
|
export type StartWorldRequest = {
|
|
8
9
|
/**
|
|
9
10
|
* World ID.
|
|
10
11
|
*/
|
|
11
12
|
id: string;
|
|
13
|
+
body?: models.StartWorldRequest | undefined;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
/** @internal */
|
|
15
17
|
export type StartWorldRequest$Outbound = {
|
|
16
18
|
id: string;
|
|
19
|
+
body?: models.StartWorldRequest$Outbound | undefined;
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
/** @internal */
|
|
@@ -22,6 +25,7 @@ export const StartWorldRequest$outboundSchema: z.ZodMiniType<
|
|
|
22
25
|
StartWorldRequest
|
|
23
26
|
> = z.object({
|
|
24
27
|
id: z.string(),
|
|
28
|
+
body: z.optional(models.StartWorldRequest$outboundSchema),
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
export function startWorldRequestToJSON(
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type ResourceError = {
|
|
12
|
+
/**
|
|
13
|
+
* Stable machine-readable error code.
|
|
14
|
+
*/
|
|
15
|
+
code: string;
|
|
16
|
+
/**
|
|
17
|
+
* Safe human-readable error detail.
|
|
18
|
+
*/
|
|
19
|
+
detail: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ResourceError$inboundSchema: z.ZodMiniType<
|
|
24
|
+
ResourceError,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
code: types.string(),
|
|
28
|
+
detail: types.string(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function resourceErrorFromJSON(
|
|
32
|
+
jsonString: string,
|
|
33
|
+
): SafeParseResult<ResourceError, SDKValidationError> {
|
|
34
|
+
return safeParse(
|
|
35
|
+
jsonString,
|
|
36
|
+
(x) => ResourceError$inboundSchema.parse(JSON.parse(x)),
|
|
37
|
+
`Failed to parse 'ResourceError' from JSON`,
|
|
38
|
+
);
|
|
39
|
+
}
|
package/src/models/simulation.ts
CHANGED
|
@@ -25,10 +25,18 @@ export const SimulationStatus = {
|
|
|
25
25
|
export type SimulationStatus = OpenEnum<typeof SimulationStatus>;
|
|
26
26
|
|
|
27
27
|
export type Simulation = {
|
|
28
|
+
/**
|
|
29
|
+
* Current clock advance operation ID, or null.
|
|
30
|
+
*/
|
|
31
|
+
activeAdvanceId: string | null;
|
|
28
32
|
/**
|
|
29
33
|
* Simulation creation time.
|
|
30
34
|
*/
|
|
31
35
|
createdAt: Date;
|
|
36
|
+
/**
|
|
37
|
+
* Current simulated time.
|
|
38
|
+
*/
|
|
39
|
+
currentTime: Date;
|
|
32
40
|
/**
|
|
33
41
|
* Base URL for requests to the Simulation.
|
|
34
42
|
*/
|
|
@@ -49,6 +57,10 @@ export type Simulation = {
|
|
|
49
57
|
* ID of the Simulator.
|
|
50
58
|
*/
|
|
51
59
|
simulatorId: string;
|
|
60
|
+
/**
|
|
61
|
+
* Initial simulated time.
|
|
62
|
+
*/
|
|
63
|
+
startTime: Date;
|
|
52
64
|
/**
|
|
53
65
|
* Current status. running serves requests. paused means the Simulation was idle and the platform paused it; the next request wakes it. stopped means its state is saved and requests return 409 until you start it.
|
|
54
66
|
*/
|
|
@@ -65,19 +77,25 @@ export const SimulationStatus$inboundSchema: z.ZodMiniType<
|
|
|
65
77
|
export const Simulation$inboundSchema: z.ZodMiniType<Simulation, unknown> = z
|
|
66
78
|
.pipe(
|
|
67
79
|
z.object({
|
|
80
|
+
active_advance_id: types.nullable(types.string()),
|
|
68
81
|
created_at: types.date(),
|
|
82
|
+
current_time: types.date(),
|
|
69
83
|
endpoint: types.string(),
|
|
70
84
|
id: types.string(),
|
|
71
85
|
name: types.string(),
|
|
72
86
|
parent_id: types.nullable(types.string()),
|
|
73
87
|
simulator_id: types.string(),
|
|
88
|
+
start_time: types.date(),
|
|
74
89
|
status: SimulationStatus$inboundSchema,
|
|
75
90
|
}),
|
|
76
91
|
z.transform((v) => {
|
|
77
92
|
return remap$(v, {
|
|
93
|
+
"active_advance_id": "activeAdvanceId",
|
|
78
94
|
"created_at": "createdAt",
|
|
95
|
+
"current_time": "currentTime",
|
|
79
96
|
"parent_id": "parentId",
|
|
80
97
|
"simulator_id": "simulatorId",
|
|
98
|
+
"start_time": "startTime",
|
|
81
99
|
});
|
|
82
100
|
}),
|
|
83
101
|
);
|
|
@@ -28,14 +28,16 @@ export type SimulatorBuildProgressBuilder = OpenEnum<
|
|
|
28
28
|
/**
|
|
29
29
|
* Outcome of the most recent submit attempt, or null.
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const SimulatorBuildProgressLastSubmission = {
|
|
32
32
|
Accepted: "accepted",
|
|
33
33
|
Rejected: "rejected",
|
|
34
34
|
} as const;
|
|
35
35
|
/**
|
|
36
36
|
* Outcome of the most recent submit attempt, or null.
|
|
37
37
|
*/
|
|
38
|
-
export type
|
|
38
|
+
export type SimulatorBuildProgressLastSubmission = OpenEnum<
|
|
39
|
+
typeof SimulatorBuildProgressLastSubmission
|
|
40
|
+
>;
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
@@ -60,7 +62,7 @@ export type SimulatorBuildProgress = {
|
|
|
60
62
|
/**
|
|
61
63
|
* Outcome of the most recent submit attempt, or null.
|
|
62
64
|
*/
|
|
63
|
-
lastSubmission:
|
|
65
|
+
lastSubmission: SimulatorBuildProgressLastSubmission | null;
|
|
64
66
|
/**
|
|
65
67
|
* Name of the most recent tool call, or null.
|
|
66
68
|
*/
|
|
@@ -90,10 +92,10 @@ export const SimulatorBuildProgressBuilder$inboundSchema: z.ZodMiniType<
|
|
|
90
92
|
> = openEnums.inboundSchema(SimulatorBuildProgressBuilder);
|
|
91
93
|
|
|
92
94
|
/** @internal */
|
|
93
|
-
export const
|
|
94
|
-
|
|
95
|
+
export const SimulatorBuildProgressLastSubmission$inboundSchema: z.ZodMiniType<
|
|
96
|
+
SimulatorBuildProgressLastSubmission,
|
|
95
97
|
unknown
|
|
96
|
-
> = openEnums.inboundSchema(
|
|
98
|
+
> = openEnums.inboundSchema(SimulatorBuildProgressLastSubmission);
|
|
97
99
|
|
|
98
100
|
/** @internal */
|
|
99
101
|
export const SimulatorBuildProgressStage$inboundSchema: z.ZodMiniType<
|
|
@@ -108,7 +110,9 @@ export const SimulatorBuildProgress$inboundSchema: z.ZodMiniType<
|
|
|
108
110
|
> = z.pipe(
|
|
109
111
|
z.object({
|
|
110
112
|
builder: SimulatorBuildProgressBuilder$inboundSchema,
|
|
111
|
-
last_submission: types.nullable(
|
|
113
|
+
last_submission: types.nullable(
|
|
114
|
+
SimulatorBuildProgressLastSubmission$inboundSchema,
|
|
115
|
+
),
|
|
112
116
|
last_tool: types.nullable(types.string()),
|
|
113
117
|
stage: SimulatorBuildProgressStage$inboundSchema,
|
|
114
118
|
submissions: types.number(),
|