@continuous-labs/sdk 0.0.8 → 0.0.10
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/simulators-build-simulator.d.ts +1 -1
- package/esm/funcs/simulators-build-simulator.js +1 -1
- 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-build-world.d.ts +1 -1
- package/esm/funcs/worlds-build-world.js +1 -1
- 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/lib/config.js.map +1 -1
- 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 +9 -4
- package/esm/models/build-simulator-request.d.ts.map +1 -1
- package/esm/models/build-simulator-request.js +5 -3
- package/esm/models/build-simulator-request.js.map +1 -1
- package/esm/models/build-tool-call.d.ts +17 -0
- package/esm/models/build-tool-call.d.ts.map +1 -0
- package/esm/models/build-tool-call.js +15 -0
- package/esm/models/build-tool-call.js.map +1 -0
- package/esm/models/build-world-request.d.ts +34 -0
- package/esm/models/build-world-request.d.ts.map +1 -1
- package/esm/models/build-world-request.js +21 -2
- 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 +9 -1
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +9 -1
- 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/list-simulators.d.ts +1 -0
- package/esm/models/operations/list-simulators.d.ts.map +1 -1
- package/esm/models/operations/list-simulators.js +1 -0
- package/esm/models/operations/list-simulators.js.map +1 -1
- 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 +9 -4
- package/esm/models/simulator-build-progress.d.ts.map +1 -1
- package/esm/models/simulator-build-progress.js +6 -3
- package/esm/models/simulator-build-progress.js.map +1 -1
- package/esm/models/simulator.d.ts +25 -3
- package/esm/models/simulator.d.ts.map +1 -1
- package/esm/models/simulator.js +14 -1
- 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-progress.d.ts +85 -0
- package/esm/models/world-build-progress.d.ts.map +1 -0
- package/esm/models/world-build-progress.js +61 -0
- package/esm/models/world-build-progress.js.map +1 -0
- package/esm/models/world.d.ts +26 -6
- package/esm/models/world.d.ts.map +1 -1
- package/esm/models/world.js +11 -3
- 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/simulators.d.ts +1 -1
- package/esm/sdk/simulators.js +1 -1
- package/esm/sdk/worlds.d.ts +15 -1
- package/esm/sdk/worlds.d.ts.map +1 -1
- package/esm/sdk/worlds.js +21 -1
- 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/simulators-build-simulator.ts +1 -1
- package/src/funcs/worlds-advance-world-time.ts +192 -0
- package/src/funcs/worlds-build-world.ts +1 -1
- 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 +16 -7
- package/src/models/build-tool-call.ts +39 -0
- package/src/models/build-world-request.ts +57 -4
- 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 +9 -1
- 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/list-simulators.ts +1 -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 +21 -7
- package/src/models/simulator.ts +33 -3
- package/src/models/start-world-request.ts +41 -0
- package/src/models/step.ts +52 -4
- package/src/models/world-build-progress.ts +152 -0
- package/src/models/world.ts +37 -7
- package/src/sdk/simulations.ts +54 -0
- package/src/sdk/simulators.ts +1 -1
- package/src/sdk/worlds.ts +37 -1
- package/esm/models/world-build.d.ts +0 -31
- package/esm/models/world-build.d.ts.map +0 -1
- package/esm/models/world-build.js +0 -29
- package/esm/models/world-build.js.map +0 -1
- package/src/models/world-build.ts +0 -60
|
@@ -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
|
);
|
|
@@ -9,6 +9,10 @@ import * as openEnums from "../types/enums.js";
|
|
|
9
9
|
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
|
+
import {
|
|
13
|
+
BuildToolCall,
|
|
14
|
+
BuildToolCall$inboundSchema,
|
|
15
|
+
} from "./build-tool-call.js";
|
|
12
16
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
13
17
|
|
|
14
18
|
/**
|
|
@@ -28,14 +32,16 @@ export type SimulatorBuildProgressBuilder = OpenEnum<
|
|
|
28
32
|
/**
|
|
29
33
|
* Outcome of the most recent submit attempt, or null.
|
|
30
34
|
*/
|
|
31
|
-
export const
|
|
35
|
+
export const SimulatorBuildProgressLastSubmission = {
|
|
32
36
|
Accepted: "accepted",
|
|
33
37
|
Rejected: "rejected",
|
|
34
38
|
} as const;
|
|
35
39
|
/**
|
|
36
40
|
* Outcome of the most recent submit attempt, or null.
|
|
37
41
|
*/
|
|
38
|
-
export type
|
|
42
|
+
export type SimulatorBuildProgressLastSubmission = OpenEnum<
|
|
43
|
+
typeof SimulatorBuildProgressLastSubmission
|
|
44
|
+
>;
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
@@ -60,11 +66,15 @@ export type SimulatorBuildProgress = {
|
|
|
60
66
|
/**
|
|
61
67
|
* Outcome of the most recent submit attempt, or null.
|
|
62
68
|
*/
|
|
63
|
-
lastSubmission:
|
|
69
|
+
lastSubmission: SimulatorBuildProgressLastSubmission | null;
|
|
64
70
|
/**
|
|
65
71
|
* Name of the most recent tool call, or null.
|
|
66
72
|
*/
|
|
67
73
|
lastTool: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* The most recent tool calls, oldest first, at most 20.
|
|
76
|
+
*/
|
|
77
|
+
recentTools: Array<BuildToolCall>;
|
|
68
78
|
/**
|
|
69
79
|
* derive while the effective spec, build skeleton, and sandbox are prepared; build while the coding loop runs; assemble while an accepted artifact publishes.
|
|
70
80
|
*/
|
|
@@ -90,10 +100,10 @@ export const SimulatorBuildProgressBuilder$inboundSchema: z.ZodMiniType<
|
|
|
90
100
|
> = openEnums.inboundSchema(SimulatorBuildProgressBuilder);
|
|
91
101
|
|
|
92
102
|
/** @internal */
|
|
93
|
-
export const
|
|
94
|
-
|
|
103
|
+
export const SimulatorBuildProgressLastSubmission$inboundSchema: z.ZodMiniType<
|
|
104
|
+
SimulatorBuildProgressLastSubmission,
|
|
95
105
|
unknown
|
|
96
|
-
> = openEnums.inboundSchema(
|
|
106
|
+
> = openEnums.inboundSchema(SimulatorBuildProgressLastSubmission);
|
|
97
107
|
|
|
98
108
|
/** @internal */
|
|
99
109
|
export const SimulatorBuildProgressStage$inboundSchema: z.ZodMiniType<
|
|
@@ -108,8 +118,11 @@ export const SimulatorBuildProgress$inboundSchema: z.ZodMiniType<
|
|
|
108
118
|
> = z.pipe(
|
|
109
119
|
z.object({
|
|
110
120
|
builder: SimulatorBuildProgressBuilder$inboundSchema,
|
|
111
|
-
last_submission: types.nullable(
|
|
121
|
+
last_submission: types.nullable(
|
|
122
|
+
SimulatorBuildProgressLastSubmission$inboundSchema,
|
|
123
|
+
),
|
|
112
124
|
last_tool: types.nullable(types.string()),
|
|
125
|
+
recent_tools: z.array(BuildToolCall$inboundSchema),
|
|
113
126
|
stage: SimulatorBuildProgressStage$inboundSchema,
|
|
114
127
|
submissions: types.number(),
|
|
115
128
|
tool_calls: types.number(),
|
|
@@ -119,6 +132,7 @@ export const SimulatorBuildProgress$inboundSchema: z.ZodMiniType<
|
|
|
119
132
|
return remap$(v, {
|
|
120
133
|
"last_submission": "lastSubmission",
|
|
121
134
|
"last_tool": "lastTool",
|
|
135
|
+
"recent_tools": "recentTools",
|
|
122
136
|
"tool_calls": "toolCalls",
|
|
123
137
|
"updated_at": "updatedAt",
|
|
124
138
|
});
|
package/src/models/simulator.ts
CHANGED
|
@@ -32,16 +32,29 @@ export const Source = {
|
|
|
32
32
|
export type Source = OpenEnum<typeof Source>;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* The specification the Simulator was built from, or null until a build has read it.
|
|
36
|
+
*/
|
|
37
|
+
export const SimulatorSpecKind = {
|
|
38
|
+
Openapi: "openapi",
|
|
39
|
+
Wsdl: "wsdl",
|
|
40
|
+
} as const;
|
|
41
|
+
/**
|
|
42
|
+
* The specification the Simulator was built from, or null until a build has read it.
|
|
43
|
+
*/
|
|
44
|
+
export type SimulatorSpecKind = OpenEnum<typeof SimulatorSpecKind>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* pending while waiting for capacity; building while the build runs; ready when Simulations, Worlds, and incremental builds can use it; failed when the build failed; canceled when a cancel request took effect.
|
|
36
48
|
*/
|
|
37
49
|
export const SimulatorStatus = {
|
|
50
|
+
Pending: "pending",
|
|
38
51
|
Building: "building",
|
|
39
52
|
Ready: "ready",
|
|
40
53
|
Failed: "failed",
|
|
41
54
|
Canceled: "canceled",
|
|
42
55
|
} as const;
|
|
43
56
|
/**
|
|
44
|
-
* building while the build runs; ready when Simulations, Worlds, and incremental builds can use it; failed when the build failed; canceled when a cancel request took effect.
|
|
57
|
+
* pending while waiting for capacity; building while the build runs; ready when Simulations, Worlds, and incremental builds can use it; failed when the build failed; canceled when a cancel request took effect.
|
|
45
58
|
*/
|
|
46
59
|
export type SimulatorStatus = OpenEnum<typeof SimulatorStatus>;
|
|
47
60
|
|
|
@@ -59,6 +72,10 @@ export type Simulator = {
|
|
|
59
72
|
* Simulator ID.
|
|
60
73
|
*/
|
|
61
74
|
id: string;
|
|
75
|
+
/**
|
|
76
|
+
* The instructions the build followed, or empty when none were given.
|
|
77
|
+
*/
|
|
78
|
+
instructions: string;
|
|
62
79
|
/**
|
|
63
80
|
* Simulator name. Names cannot start with smr_.
|
|
64
81
|
*/
|
|
@@ -72,7 +89,11 @@ export type Simulator = {
|
|
|
72
89
|
*/
|
|
73
90
|
source: Source;
|
|
74
91
|
/**
|
|
75
|
-
*
|
|
92
|
+
* The specification the Simulator was built from, or null until a build has read it.
|
|
93
|
+
*/
|
|
94
|
+
specKind: SimulatorSpecKind | null;
|
|
95
|
+
/**
|
|
96
|
+
* pending while waiting for capacity; building while the build runs; ready when Simulations, Worlds, and incremental builds can use it; failed when the build failed; canceled when a cancel request took effect.
|
|
76
97
|
*/
|
|
77
98
|
status: SimulatorStatus;
|
|
78
99
|
};
|
|
@@ -81,6 +102,12 @@ export type Simulator = {
|
|
|
81
102
|
export const Source$inboundSchema: z.ZodMiniType<Source, unknown> = openEnums
|
|
82
103
|
.inboundSchema(Source);
|
|
83
104
|
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const SimulatorSpecKind$inboundSchema: z.ZodMiniType<
|
|
107
|
+
SimulatorSpecKind,
|
|
108
|
+
unknown
|
|
109
|
+
> = openEnums.inboundSchema(SimulatorSpecKind);
|
|
110
|
+
|
|
84
111
|
/** @internal */
|
|
85
112
|
export const SimulatorStatus$inboundSchema: z.ZodMiniType<
|
|
86
113
|
SimulatorStatus,
|
|
@@ -95,15 +122,18 @@ export const Simulator$inboundSchema: z.ZodMiniType<Simulator, unknown> = z
|
|
|
95
122
|
created_at: types.date(),
|
|
96
123
|
error: types.nullable(SimulatorError$inboundSchema),
|
|
97
124
|
id: types.string(),
|
|
125
|
+
instructions: types.string(),
|
|
98
126
|
name: types.string(),
|
|
99
127
|
parent_id: types.nullable(types.string()),
|
|
100
128
|
source: Source$inboundSchema,
|
|
129
|
+
spec_kind: types.nullable(SimulatorSpecKind$inboundSchema),
|
|
101
130
|
status: SimulatorStatus$inboundSchema,
|
|
102
131
|
}),
|
|
103
132
|
z.transform((v) => {
|
|
104
133
|
return remap$(v, {
|
|
105
134
|
"created_at": "createdAt",
|
|
106
135
|
"parent_id": "parentId",
|
|
136
|
+
"spec_kind": "specKind",
|
|
107
137
|
});
|
|
108
138
|
}),
|
|
109
139
|
);
|
|
@@ -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
|
+
* Simulated time for the first Start, in RFC 3339 format. Omission keeps the clock chosen at build. 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,
|
|
@@ -0,0 +1,152 @@
|
|
|
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 {
|
|
13
|
+
BuildToolCall,
|
|
14
|
+
BuildToolCall$inboundSchema,
|
|
15
|
+
} from "./build-tool-call.js";
|
|
16
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
17
|
+
import {
|
|
18
|
+
WorldDataSummary,
|
|
19
|
+
WorldDataSummary$inboundSchema,
|
|
20
|
+
} from "./world-data-summary.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Selected model provider, or null for a build created before provider selection.
|
|
24
|
+
*/
|
|
25
|
+
export const WorldBuildProgressBuilder = {
|
|
26
|
+
Openai: "openai",
|
|
27
|
+
Claude: "claude",
|
|
28
|
+
} as const;
|
|
29
|
+
/**
|
|
30
|
+
* Selected model provider, or null for a build created before provider selection.
|
|
31
|
+
*/
|
|
32
|
+
export type WorldBuildProgressBuilder = OpenEnum<
|
|
33
|
+
typeof WorldBuildProgressBuilder
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Outcome of the most recent plan submission, or null.
|
|
38
|
+
*/
|
|
39
|
+
export const WorldBuildProgressLastSubmission = {
|
|
40
|
+
Accepted: "accepted",
|
|
41
|
+
Rejected: "rejected",
|
|
42
|
+
} as const;
|
|
43
|
+
/**
|
|
44
|
+
* Outcome of the most recent plan submission, or null.
|
|
45
|
+
*/
|
|
46
|
+
export type WorldBuildProgressLastSubmission = OpenEnum<
|
|
47
|
+
typeof WorldBuildProgressLastSubmission
|
|
48
|
+
>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Current phase of starting-data preparation.
|
|
52
|
+
*/
|
|
53
|
+
export const WorldBuildProgressStage = {
|
|
54
|
+
Planning: "planning",
|
|
55
|
+
Generating: "generating",
|
|
56
|
+
Validating: "validating",
|
|
57
|
+
Complete: "complete",
|
|
58
|
+
} as const;
|
|
59
|
+
/**
|
|
60
|
+
* Current phase of starting-data preparation.
|
|
61
|
+
*/
|
|
62
|
+
export type WorldBuildProgressStage = OpenEnum<typeof WorldBuildProgressStage>;
|
|
63
|
+
|
|
64
|
+
export type WorldBuildProgress = {
|
|
65
|
+
/**
|
|
66
|
+
* Selected model provider, or null for a build created before provider selection.
|
|
67
|
+
*/
|
|
68
|
+
builder: WorldBuildProgressBuilder | null;
|
|
69
|
+
/**
|
|
70
|
+
* Outcome of the most recent plan submission, or null.
|
|
71
|
+
*/
|
|
72
|
+
lastSubmission: WorldBuildProgressLastSubmission | null;
|
|
73
|
+
/**
|
|
74
|
+
* Name of the most recent tool, or null. Tool arguments and output are private.
|
|
75
|
+
*/
|
|
76
|
+
lastTool: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* The most recent tool calls, oldest first, at most 20.
|
|
79
|
+
*/
|
|
80
|
+
recentTools: Array<BuildToolCall>;
|
|
81
|
+
/**
|
|
82
|
+
* Current phase of starting-data preparation.
|
|
83
|
+
*/
|
|
84
|
+
stage: WorldBuildProgressStage;
|
|
85
|
+
/**
|
|
86
|
+
* Number of submitted starting-data plans.
|
|
87
|
+
*/
|
|
88
|
+
submissions: number;
|
|
89
|
+
/**
|
|
90
|
+
* Verified starting data, or null before a completed build.
|
|
91
|
+
*/
|
|
92
|
+
summary: WorldDataSummary | null;
|
|
93
|
+
/**
|
|
94
|
+
* Number of agent tool calls.
|
|
95
|
+
*/
|
|
96
|
+
toolCalls: number;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const WorldBuildProgressBuilder$inboundSchema: z.ZodMiniType<
|
|
101
|
+
WorldBuildProgressBuilder,
|
|
102
|
+
unknown
|
|
103
|
+
> = openEnums.inboundSchema(WorldBuildProgressBuilder);
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const WorldBuildProgressLastSubmission$inboundSchema: z.ZodMiniType<
|
|
107
|
+
WorldBuildProgressLastSubmission,
|
|
108
|
+
unknown
|
|
109
|
+
> = openEnums.inboundSchema(WorldBuildProgressLastSubmission);
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const WorldBuildProgressStage$inboundSchema: z.ZodMiniType<
|
|
113
|
+
WorldBuildProgressStage,
|
|
114
|
+
unknown
|
|
115
|
+
> = openEnums.inboundSchema(WorldBuildProgressStage);
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export const WorldBuildProgress$inboundSchema: z.ZodMiniType<
|
|
119
|
+
WorldBuildProgress,
|
|
120
|
+
unknown
|
|
121
|
+
> = z.pipe(
|
|
122
|
+
z.object({
|
|
123
|
+
builder: types.nullable(WorldBuildProgressBuilder$inboundSchema),
|
|
124
|
+
last_submission: types.nullable(
|
|
125
|
+
WorldBuildProgressLastSubmission$inboundSchema,
|
|
126
|
+
),
|
|
127
|
+
last_tool: types.nullable(types.string()),
|
|
128
|
+
recent_tools: z.array(BuildToolCall$inboundSchema),
|
|
129
|
+
stage: WorldBuildProgressStage$inboundSchema,
|
|
130
|
+
submissions: types.number(),
|
|
131
|
+
summary: types.nullable(WorldDataSummary$inboundSchema),
|
|
132
|
+
tool_calls: types.number(),
|
|
133
|
+
}),
|
|
134
|
+
z.transform((v) => {
|
|
135
|
+
return remap$(v, {
|
|
136
|
+
"last_submission": "lastSubmission",
|
|
137
|
+
"last_tool": "lastTool",
|
|
138
|
+
"recent_tools": "recentTools",
|
|
139
|
+
"tool_calls": "toolCalls",
|
|
140
|
+
});
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
export function worldBuildProgressFromJSON(
|
|
145
|
+
jsonString: string,
|
|
146
|
+
): SafeParseResult<WorldBuildProgress, SDKValidationError> {
|
|
147
|
+
return safeParse(
|
|
148
|
+
jsonString,
|
|
149
|
+
(x) => WorldBuildProgress$inboundSchema.parse(JSON.parse(x)),
|
|
150
|
+
`Failed to parse 'WorldBuildProgress' from JSON`,
|
|
151
|
+
);
|
|
152
|
+
}
|