@continuous-labs/sdk 0.0.7 → 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-simulator-request.d.ts +4 -4
- package/esm/models/build-simulator-request.d.ts.map +1 -1
- package/esm/models/build-simulator-request.js +3 -3
- package/esm/models/build-simulator-request.js.map +1 -1
- 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 +8 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +8 -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 +78 -0
- package/esm/models/simulator-build-progress.d.ts.map +1 -0
- package/esm/models/simulator-build-progress.js +57 -0
- package/esm/models/simulator-build-progress.js.map +1 -0
- package/esm/models/simulator.d.ts +5 -0
- package/esm/models/simulator.d.ts.map +1 -1
- package/esm/models/simulator.js +2 -0
- package/esm/models/simulator.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 +50 -4
- package/esm/models/world-build.d.ts.map +1 -1
- package/esm/models/world-build.js +35 -6
- 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-simulator-request.ts +9 -7
- 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 +8 -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 +140 -0
- package/src/models/simulator.ts +9 -0
- package/src/models/start-world-request.ts +41 -0
- package/src/models/step.ts +52 -4
- package/src/models/world-build.ts +84 -9
- package/src/models/world.ts +18 -0
- package/src/sdk/simulations.ts +54 -0
- package/src/sdk/worlds.ts +36 -0
|
@@ -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
|
);
|
|
@@ -0,0 +1,140 @@
|
|
|
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 * as openEnums from "../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
11
|
+
import * as types from "../types/primitives.js";
|
|
12
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The coding-loop provider.
|
|
16
|
+
*/
|
|
17
|
+
export const SimulatorBuildProgressBuilder = {
|
|
18
|
+
Claude: "claude",
|
|
19
|
+
Openai: "openai",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The coding-loop provider.
|
|
23
|
+
*/
|
|
24
|
+
export type SimulatorBuildProgressBuilder = OpenEnum<
|
|
25
|
+
typeof SimulatorBuildProgressBuilder
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Outcome of the most recent submit attempt, or null.
|
|
30
|
+
*/
|
|
31
|
+
export const SimulatorBuildProgressLastSubmission = {
|
|
32
|
+
Accepted: "accepted",
|
|
33
|
+
Rejected: "rejected",
|
|
34
|
+
} as const;
|
|
35
|
+
/**
|
|
36
|
+
* Outcome of the most recent submit attempt, or null.
|
|
37
|
+
*/
|
|
38
|
+
export type SimulatorBuildProgressLastSubmission = OpenEnum<
|
|
39
|
+
typeof SimulatorBuildProgressLastSubmission
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
44
|
+
*/
|
|
45
|
+
export const SimulatorBuildProgressStage = {
|
|
46
|
+
Derive: "derive",
|
|
47
|
+
Build: "build",
|
|
48
|
+
Assemble: "assemble",
|
|
49
|
+
} as const;
|
|
50
|
+
/**
|
|
51
|
+
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
52
|
+
*/
|
|
53
|
+
export type SimulatorBuildProgressStage = OpenEnum<
|
|
54
|
+
typeof SimulatorBuildProgressStage
|
|
55
|
+
>;
|
|
56
|
+
|
|
57
|
+
export type SimulatorBuildProgress = {
|
|
58
|
+
/**
|
|
59
|
+
* The coding-loop provider.
|
|
60
|
+
*/
|
|
61
|
+
builder: SimulatorBuildProgressBuilder;
|
|
62
|
+
/**
|
|
63
|
+
* Outcome of the most recent submit attempt, or null.
|
|
64
|
+
*/
|
|
65
|
+
lastSubmission: SimulatorBuildProgressLastSubmission | null;
|
|
66
|
+
/**
|
|
67
|
+
* Name of the most recent tool call, or null.
|
|
68
|
+
*/
|
|
69
|
+
lastTool: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
72
|
+
*/
|
|
73
|
+
stage: SimulatorBuildProgressStage;
|
|
74
|
+
/**
|
|
75
|
+
* Submit attempts.
|
|
76
|
+
*/
|
|
77
|
+
submissions: number;
|
|
78
|
+
/**
|
|
79
|
+
* Tool calls the coding loop executed.
|
|
80
|
+
*/
|
|
81
|
+
toolCalls: number;
|
|
82
|
+
/**
|
|
83
|
+
* Time of the last progress report.
|
|
84
|
+
*/
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const SimulatorBuildProgressBuilder$inboundSchema: z.ZodMiniType<
|
|
90
|
+
SimulatorBuildProgressBuilder,
|
|
91
|
+
unknown
|
|
92
|
+
> = openEnums.inboundSchema(SimulatorBuildProgressBuilder);
|
|
93
|
+
|
|
94
|
+
/** @internal */
|
|
95
|
+
export const SimulatorBuildProgressLastSubmission$inboundSchema: z.ZodMiniType<
|
|
96
|
+
SimulatorBuildProgressLastSubmission,
|
|
97
|
+
unknown
|
|
98
|
+
> = openEnums.inboundSchema(SimulatorBuildProgressLastSubmission);
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const SimulatorBuildProgressStage$inboundSchema: z.ZodMiniType<
|
|
102
|
+
SimulatorBuildProgressStage,
|
|
103
|
+
unknown
|
|
104
|
+
> = openEnums.inboundSchema(SimulatorBuildProgressStage);
|
|
105
|
+
|
|
106
|
+
/** @internal */
|
|
107
|
+
export const SimulatorBuildProgress$inboundSchema: z.ZodMiniType<
|
|
108
|
+
SimulatorBuildProgress,
|
|
109
|
+
unknown
|
|
110
|
+
> = z.pipe(
|
|
111
|
+
z.object({
|
|
112
|
+
builder: SimulatorBuildProgressBuilder$inboundSchema,
|
|
113
|
+
last_submission: types.nullable(
|
|
114
|
+
SimulatorBuildProgressLastSubmission$inboundSchema,
|
|
115
|
+
),
|
|
116
|
+
last_tool: types.nullable(types.string()),
|
|
117
|
+
stage: SimulatorBuildProgressStage$inboundSchema,
|
|
118
|
+
submissions: types.number(),
|
|
119
|
+
tool_calls: types.number(),
|
|
120
|
+
updated_at: types.date(),
|
|
121
|
+
}),
|
|
122
|
+
z.transform((v) => {
|
|
123
|
+
return remap$(v, {
|
|
124
|
+
"last_submission": "lastSubmission",
|
|
125
|
+
"last_tool": "lastTool",
|
|
126
|
+
"tool_calls": "toolCalls",
|
|
127
|
+
"updated_at": "updatedAt",
|
|
128
|
+
});
|
|
129
|
+
}),
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
export function simulatorBuildProgressFromJSON(
|
|
133
|
+
jsonString: string,
|
|
134
|
+
): SafeParseResult<SimulatorBuildProgress, SDKValidationError> {
|
|
135
|
+
return safeParse(
|
|
136
|
+
jsonString,
|
|
137
|
+
(x) => SimulatorBuildProgress$inboundSchema.parse(JSON.parse(x)),
|
|
138
|
+
`Failed to parse 'SimulatorBuildProgress' from JSON`,
|
|
139
|
+
);
|
|
140
|
+
}
|
package/src/models/simulator.ts
CHANGED
|
@@ -10,6 +10,10 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
10
10
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
11
11
|
import * as types from "../types/primitives.js";
|
|
12
12
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
13
|
+
import {
|
|
14
|
+
SimulatorBuildProgress,
|
|
15
|
+
SimulatorBuildProgress$inboundSchema,
|
|
16
|
+
} from "./simulator-build-progress.js";
|
|
13
17
|
import {
|
|
14
18
|
SimulatorError,
|
|
15
19
|
SimulatorError$inboundSchema,
|
|
@@ -42,6 +46,10 @@ export const SimulatorStatus = {
|
|
|
42
46
|
export type SimulatorStatus = OpenEnum<typeof SimulatorStatus>;
|
|
43
47
|
|
|
44
48
|
export type Simulator = {
|
|
49
|
+
/**
|
|
50
|
+
* The build's latest progress report, or null before the first report. A terminal Simulator keeps its last report.
|
|
51
|
+
*/
|
|
52
|
+
build: SimulatorBuildProgress | null;
|
|
45
53
|
/**
|
|
46
54
|
* Simulator creation time.
|
|
47
55
|
*/
|
|
@@ -83,6 +91,7 @@ export const SimulatorStatus$inboundSchema: z.ZodMiniType<
|
|
|
83
91
|
export const Simulator$inboundSchema: z.ZodMiniType<Simulator, unknown> = z
|
|
84
92
|
.pipe(
|
|
85
93
|
z.object({
|
|
94
|
+
build: types.nullable(SimulatorBuildProgress$inboundSchema),
|
|
86
95
|
created_at: types.date(),
|
|
87
96
|
error: types.nullable(SimulatorError$inboundSchema),
|
|
88
97
|
id: types.string(),
|
|
@@ -0,0 +1,41 @@
|
|
|
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 StartWorldRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* Initial simulated time for the first Start, in RFC 3339 format. Omission uses 2024-01-01T00:00:00Z. Saved business dates remain unchanged. Later starts preserve the clock.
|
|
11
|
+
*/
|
|
12
|
+
startTime?: Date | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type StartWorldRequest$Outbound = {
|
|
17
|
+
start_time?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const StartWorldRequest$outboundSchema: z.ZodMiniType<
|
|
22
|
+
StartWorldRequest$Outbound,
|
|
23
|
+
StartWorldRequest
|
|
24
|
+
> = z.pipe(
|
|
25
|
+
z.object({
|
|
26
|
+
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
27
|
+
}),
|
|
28
|
+
z.transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
startTime: "start_time",
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export function startWorldRequestToJSON(
|
|
36
|
+
startWorldRequest: StartWorldRequest,
|
|
37
|
+
): string {
|
|
38
|
+
return JSON.stringify(
|
|
39
|
+
StartWorldRequest$outboundSchema.parse(startWorldRequest),
|
|
40
|
+
);
|
|
41
|
+
}
|
package/src/models/step.ts
CHANGED
|
@@ -3,12 +3,35 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../types/enums.js";
|
|
7
10
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
11
|
import * as types from "../types/primitives.js";
|
|
9
12
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
13
|
|
|
14
|
+
/**
|
|
15
|
+
* api for an API write or advance for a clock advance.
|
|
16
|
+
*/
|
|
17
|
+
export const Kind = {
|
|
18
|
+
Api: "api",
|
|
19
|
+
Advance: "advance",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* api for an API write or advance for a clock advance.
|
|
23
|
+
*/
|
|
24
|
+
export type Kind = OpenEnum<typeof Kind>;
|
|
25
|
+
|
|
11
26
|
export type Step = {
|
|
27
|
+
/**
|
|
28
|
+
* Advance that produced this step, if any.
|
|
29
|
+
*/
|
|
30
|
+
advanceId: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* api for an API write or advance for a clock advance.
|
|
33
|
+
*/
|
|
34
|
+
kind: Kind;
|
|
12
35
|
/**
|
|
13
36
|
* HTTP method and path of the request that produced this step, without the query string, for example POST /v1/widgets.
|
|
14
37
|
*/
|
|
@@ -17,13 +40,38 @@ export type Step = {
|
|
|
17
40
|
* Step number. Use it as at_step when you fork.
|
|
18
41
|
*/
|
|
19
42
|
step: number;
|
|
43
|
+
/**
|
|
44
|
+
* Clock after the step.
|
|
45
|
+
*/
|
|
46
|
+
timeAfter: Date | null;
|
|
47
|
+
/**
|
|
48
|
+
* Clock before the step.
|
|
49
|
+
*/
|
|
50
|
+
timeBefore: Date | null;
|
|
20
51
|
};
|
|
21
52
|
|
|
22
53
|
/** @internal */
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
export const Kind$inboundSchema: z.ZodMiniType<Kind, unknown> = openEnums
|
|
55
|
+
.inboundSchema(Kind);
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const Step$inboundSchema: z.ZodMiniType<Step, unknown> = z.pipe(
|
|
59
|
+
z.object({
|
|
60
|
+
advance_id: types.nullable(types.string()),
|
|
61
|
+
kind: Kind$inboundSchema,
|
|
62
|
+
label: types.string(),
|
|
63
|
+
step: types.number(),
|
|
64
|
+
time_after: types.nullable(types.date()),
|
|
65
|
+
time_before: types.nullable(types.date()),
|
|
66
|
+
}),
|
|
67
|
+
z.transform((v) => {
|
|
68
|
+
return remap$(v, {
|
|
69
|
+
"advance_id": "advanceId",
|
|
70
|
+
"time_after": "timeAfter",
|
|
71
|
+
"time_before": "timeBefore",
|
|
72
|
+
});
|
|
73
|
+
}),
|
|
74
|
+
);
|
|
27
75
|
|
|
28
76
|
export function stepFromJSON(
|
|
29
77
|
jsonString: string,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
7
8
|
import * as openEnums from "../types/enums.js";
|
|
8
9
|
import { OpenEnum } from "../types/enums.js";
|
|
@@ -14,10 +15,36 @@ import {
|
|
|
14
15
|
WorldDataSummary$inboundSchema,
|
|
15
16
|
} from "./world-data-summary.js";
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Selected model provider. Absent for builds created before provider selection.
|
|
20
|
+
*/
|
|
21
|
+
export const WorldBuildBuilder = {
|
|
22
|
+
Openai: "openai",
|
|
23
|
+
Claude: "claude",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* Selected model provider. Absent for builds created before provider selection.
|
|
27
|
+
*/
|
|
28
|
+
export type WorldBuildBuilder = OpenEnum<typeof WorldBuildBuilder>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Outcome of the most recent plan submission.
|
|
32
|
+
*/
|
|
33
|
+
export const WorldBuildLastSubmission = {
|
|
34
|
+
Accepted: "accepted",
|
|
35
|
+
Rejected: "rejected",
|
|
36
|
+
} as const;
|
|
37
|
+
/**
|
|
38
|
+
* Outcome of the most recent plan submission.
|
|
39
|
+
*/
|
|
40
|
+
export type WorldBuildLastSubmission = OpenEnum<
|
|
41
|
+
typeof WorldBuildLastSubmission
|
|
42
|
+
>;
|
|
43
|
+
|
|
17
44
|
/**
|
|
18
45
|
* Current phase of starting-data preparation.
|
|
19
46
|
*/
|
|
20
|
-
export const
|
|
47
|
+
export const WorldBuildStage = {
|
|
21
48
|
Planning: "planning",
|
|
22
49
|
Generating: "generating",
|
|
23
50
|
Validating: "validating",
|
|
@@ -26,26 +53,74 @@ export const Stage = {
|
|
|
26
53
|
/**
|
|
27
54
|
* Current phase of starting-data preparation.
|
|
28
55
|
*/
|
|
29
|
-
export type
|
|
56
|
+
export type WorldBuildStage = OpenEnum<typeof WorldBuildStage>;
|
|
30
57
|
|
|
31
58
|
export type WorldBuild = {
|
|
59
|
+
/**
|
|
60
|
+
* Selected model provider. Absent for builds created before provider selection.
|
|
61
|
+
*/
|
|
62
|
+
builder?: WorldBuildBuilder | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Outcome of the most recent plan submission.
|
|
65
|
+
*/
|
|
66
|
+
lastSubmission?: WorldBuildLastSubmission | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Name of the most recent tool. Tool arguments and output are private.
|
|
69
|
+
*/
|
|
70
|
+
lastTool?: string | undefined;
|
|
32
71
|
/**
|
|
33
72
|
* Current phase of starting-data preparation.
|
|
34
73
|
*/
|
|
35
|
-
stage:
|
|
74
|
+
stage: WorldBuildStage;
|
|
75
|
+
/**
|
|
76
|
+
* Number of submitted starting-data plans.
|
|
77
|
+
*/
|
|
78
|
+
submissions?: number | undefined;
|
|
36
79
|
summary?: WorldDataSummary | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Number of agent tool calls.
|
|
82
|
+
*/
|
|
83
|
+
toolCalls?: number | undefined;
|
|
37
84
|
};
|
|
38
85
|
|
|
39
86
|
/** @internal */
|
|
40
|
-
export const
|
|
41
|
-
|
|
87
|
+
export const WorldBuildBuilder$inboundSchema: z.ZodMiniType<
|
|
88
|
+
WorldBuildBuilder,
|
|
89
|
+
unknown
|
|
90
|
+
> = openEnums.inboundSchema(WorldBuildBuilder);
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const WorldBuildLastSubmission$inboundSchema: z.ZodMiniType<
|
|
94
|
+
WorldBuildLastSubmission,
|
|
95
|
+
unknown
|
|
96
|
+
> = openEnums.inboundSchema(WorldBuildLastSubmission);
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export const WorldBuildStage$inboundSchema: z.ZodMiniType<
|
|
100
|
+
WorldBuildStage,
|
|
101
|
+
unknown
|
|
102
|
+
> = openEnums.inboundSchema(WorldBuildStage);
|
|
42
103
|
|
|
43
104
|
/** @internal */
|
|
44
105
|
export const WorldBuild$inboundSchema: z.ZodMiniType<WorldBuild, unknown> = z
|
|
45
|
-
.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
106
|
+
.pipe(
|
|
107
|
+
z.object({
|
|
108
|
+
builder: types.optional(WorldBuildBuilder$inboundSchema),
|
|
109
|
+
last_submission: types.optional(WorldBuildLastSubmission$inboundSchema),
|
|
110
|
+
last_tool: types.optional(types.string()),
|
|
111
|
+
stage: WorldBuildStage$inboundSchema,
|
|
112
|
+
submissions: types.optional(types.number()),
|
|
113
|
+
summary: types.optional(WorldDataSummary$inboundSchema),
|
|
114
|
+
tool_calls: types.optional(types.number()),
|
|
115
|
+
}),
|
|
116
|
+
z.transform((v) => {
|
|
117
|
+
return remap$(v, {
|
|
118
|
+
"last_submission": "lastSubmission",
|
|
119
|
+
"last_tool": "lastTool",
|
|
120
|
+
"tool_calls": "toolCalls",
|
|
121
|
+
});
|
|
122
|
+
}),
|
|
123
|
+
);
|
|
49
124
|
|
|
50
125
|
export function worldBuildFromJSON(
|
|
51
126
|
jsonString: string,
|