@godot-mcp/protocol 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +105 -2
- package/dist/canonicalJson.d.ts +4 -0
- package/dist/canonicalJson.d.ts.map +1 -0
- package/dist/canonicalJson.js +68 -0
- package/dist/canonicalJson.js.map +1 -0
- package/dist/editor.d.ts +130 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +179 -0
- package/dist/editor.js.map +1 -0
- package/dist/editorAuthoring.d.ts +246 -0
- package/dist/editorAuthoring.d.ts.map +1 -0
- package/dist/editorAuthoring.js +132 -0
- package/dist/editorAuthoring.js.map +1 -0
- package/dist/editorMutation.d.ts +1239 -0
- package/dist/editorMutation.d.ts.map +1 -0
- package/dist/editorMutation.js +178 -0
- package/dist/editorMutation.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +1414 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +237 -0
- package/dist/input.js.map +1 -0
- package/dist/projectOperations.d.ts +151 -0
- package/dist/projectOperations.d.ts.map +1 -0
- package/dist/projectOperations.js +138 -0
- package/dist/projectOperations.js.map +1 -0
- package/dist/runtime.d.ts +349 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +164 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtimeDebug.d.ts +115 -0
- package/dist/runtimeDebug.d.ts.map +1 -0
- package/dist/runtimeDebug.js +123 -0
- package/dist/runtimeDebug.js.map +1 -0
- package/dist/runtimePerformance.d.ts +262 -0
- package/dist/runtimePerformance.d.ts.map +1 -0
- package/dist/runtimePerformance.js +165 -0
- package/dist/runtimePerformance.js.map +1 -0
- package/dist/runtimeShared.d.ts +19 -0
- package/dist/runtimeShared.d.ts.map +1 -0
- package/dist/runtimeShared.js +18 -0
- package/dist/runtimeShared.js.map +1 -0
- package/dist/schemas.d.ts +118 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +95 -0
- package/dist/schemas.js.map +1 -0
- package/dist/unsafeFixture.d.ts +51 -0
- package/dist/unsafeFixture.d.ts.map +1 -0
- package/dist/unsafeFixture.js +25 -0
- package/dist/unsafeFixture.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/visual.d.ts +812 -0
- package/dist/visual.d.ts.map +1 -0
- package/dist/visual.js +177 -0
- package/dist/visual.js.map +1 -0
- package/package.json +25 -6
- package/product.json +4 -0
- package/index.js +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RuntimeHandleSchema } from "./runtimeShared.js";
|
|
3
|
+
const opaqueToken = (prefix) => z.string().regex(new RegExp(`^${prefix}_[A-Za-z0-9_-]{43}$`));
|
|
4
|
+
export const DebugFrameTokenSchema = opaqueToken("dft");
|
|
5
|
+
export const DebugVariableTokenSchema = opaqueToken("dvt");
|
|
6
|
+
export const DebugStopResultSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
sequence: z.number().int().min(1),
|
|
9
|
+
reason: z.enum(["breakpoint", "exception", "step", "pause", "unknown"]),
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
const DebugSourcePathSchema = z
|
|
13
|
+
.string()
|
|
14
|
+
.min(9)
|
|
15
|
+
.max(512)
|
|
16
|
+
.startsWith("res://")
|
|
17
|
+
.endsWith(".gd")
|
|
18
|
+
.refine((value) => {
|
|
19
|
+
if (value.includes("\0") || value.includes("\\"))
|
|
20
|
+
return false;
|
|
21
|
+
const segments = value.slice(6).split("/");
|
|
22
|
+
if (segments.some((segment) => segment.length === 0 || segment === "." || segment === ".."))
|
|
23
|
+
return false;
|
|
24
|
+
return !value.toLowerCase().startsWith("res://addons/godot_mcp/");
|
|
25
|
+
}, { message: "Debugger source must be a canonical project-local GDScript outside the Godot MCP addon" });
|
|
26
|
+
const RuntimeBreakpointSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
sourcePath: DebugSourcePathSchema,
|
|
29
|
+
line: z.number().int().min(1).max(1_000_000),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
const BreakpointsSetSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
operation: z.literal("debug_breakpoints_set"),
|
|
35
|
+
handle: RuntimeHandleSchema,
|
|
36
|
+
breakpoints: z.array(RuntimeBreakpointSchema).max(64),
|
|
37
|
+
})
|
|
38
|
+
.strict()
|
|
39
|
+
.refine((input) => new Set(input.breakpoints.map((entry) => entry.sourcePath)).size <= 16, {
|
|
40
|
+
message: "Debugger requests may target at most 16 source files",
|
|
41
|
+
})
|
|
42
|
+
.refine((input) => {
|
|
43
|
+
const identities = input.breakpoints.map((entry) => `${entry.sourcePath}:${entry.line}`);
|
|
44
|
+
return new Set(identities).size === identities.length;
|
|
45
|
+
}, { message: "Debugger breakpoints must be unique" });
|
|
46
|
+
const DebugHandleOperationSchema = (operation) => z.object({ operation: z.literal(operation), handle: RuntimeHandleSchema }).strict();
|
|
47
|
+
const PageSchema = {
|
|
48
|
+
offset: z.number().int().min(0).max(2_048).default(0),
|
|
49
|
+
limit: z.number().int().min(1).max(256).default(100),
|
|
50
|
+
};
|
|
51
|
+
const DebugWatchSegmentSchema = z.union([
|
|
52
|
+
z.string().min(1).max(128).refine((value) => !value.includes("\0")),
|
|
53
|
+
z.number().int().min(0).max(1_000_000),
|
|
54
|
+
]);
|
|
55
|
+
const DebugWatchSelectorSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
scope: z.enum(["locals", "members", "globals"]),
|
|
58
|
+
path: z.array(DebugWatchSegmentSchema).min(1).max(8),
|
|
59
|
+
})
|
|
60
|
+
.strict();
|
|
61
|
+
export const RuntimeDebugOperationInputSchema = z.discriminatedUnion("operation", [
|
|
62
|
+
BreakpointsSetSchema,
|
|
63
|
+
DebugHandleOperationSchema("debug_status"),
|
|
64
|
+
z
|
|
65
|
+
.object({
|
|
66
|
+
operation: z.literal("debug_wait"),
|
|
67
|
+
handle: RuntimeHandleSchema,
|
|
68
|
+
afterSequence: z.number().int().min(0).default(0),
|
|
69
|
+
timeoutMs: z.number().int().min(1).max(30_000).default(10_000),
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
DebugHandleOperationSchema("debug_pause"),
|
|
73
|
+
DebugHandleOperationSchema("debug_continue"),
|
|
74
|
+
DebugHandleOperationSchema("debug_step_over"),
|
|
75
|
+
DebugHandleOperationSchema("debug_step_into"),
|
|
76
|
+
z
|
|
77
|
+
.object({
|
|
78
|
+
operation: z.literal("debug_stack"),
|
|
79
|
+
handle: RuntimeHandleSchema,
|
|
80
|
+
offset: z.number().int().min(0).max(64).default(0),
|
|
81
|
+
limit: z.number().int().min(1).max(64).default(64),
|
|
82
|
+
})
|
|
83
|
+
.strict(),
|
|
84
|
+
z
|
|
85
|
+
.object({
|
|
86
|
+
operation: z.literal("debug_variables"),
|
|
87
|
+
handle: RuntimeHandleSchema,
|
|
88
|
+
["frameToken"]: DebugFrameTokenSchema,
|
|
89
|
+
scope: z.enum(["locals", "members", "globals"]),
|
|
90
|
+
...PageSchema,
|
|
91
|
+
})
|
|
92
|
+
.strict(),
|
|
93
|
+
z
|
|
94
|
+
.object({
|
|
95
|
+
operation: z.literal("debug_children"),
|
|
96
|
+
handle: RuntimeHandleSchema,
|
|
97
|
+
["variableToken"]: DebugVariableTokenSchema,
|
|
98
|
+
...PageSchema,
|
|
99
|
+
})
|
|
100
|
+
.strict(),
|
|
101
|
+
z
|
|
102
|
+
.object({
|
|
103
|
+
operation: z.literal("debug_watch"),
|
|
104
|
+
handle: RuntimeHandleSchema,
|
|
105
|
+
["frameToken"]: DebugFrameTokenSchema,
|
|
106
|
+
selectors: z.array(DebugWatchSelectorSchema).min(1).max(32),
|
|
107
|
+
})
|
|
108
|
+
.strict(),
|
|
109
|
+
]);
|
|
110
|
+
export const RUNTIME_DEBUG_OPERATIONS = [
|
|
111
|
+
"debug_breakpoints_set",
|
|
112
|
+
"debug_status",
|
|
113
|
+
"debug_wait",
|
|
114
|
+
"debug_pause",
|
|
115
|
+
"debug_continue",
|
|
116
|
+
"debug_step_over",
|
|
117
|
+
"debug_step_into",
|
|
118
|
+
"debug_stack",
|
|
119
|
+
"debug_variables",
|
|
120
|
+
"debug_children",
|
|
121
|
+
"debug_watch",
|
|
122
|
+
];
|
|
123
|
+
//# sourceMappingURL=runtimeDebug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeDebug.js","sourceRoot":"","sources":["../src/runtimeDebug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,GAAG,CAAC,MAAqB,EAAE,EAAE,CAC5C,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,qBAAqB,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;CACxE,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,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vB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;CACL,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ProfileJobTokenSchema: z.ZodString;
|
|
3
|
+
export declare const MonitorGroupSchema: z.ZodEnum<{
|
|
4
|
+
custom: "custom";
|
|
5
|
+
frame: "frame";
|
|
6
|
+
memory: "memory";
|
|
7
|
+
objects: "objects";
|
|
8
|
+
rendering: "rendering";
|
|
9
|
+
physics: "physics";
|
|
10
|
+
audio: "audio";
|
|
11
|
+
navigation: "navigation";
|
|
12
|
+
pipeline: "pipeline";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const RuntimePerformanceOperationInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
operation: z.ZodLiteral<"monitor_snapshot">;
|
|
16
|
+
handle: z.ZodObject<{
|
|
17
|
+
runId: z.ZodUUID;
|
|
18
|
+
generation: z.ZodNumber;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
groups: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
21
|
+
custom: "custom";
|
|
22
|
+
frame: "frame";
|
|
23
|
+
memory: "memory";
|
|
24
|
+
objects: "objects";
|
|
25
|
+
rendering: "rendering";
|
|
26
|
+
physics: "physics";
|
|
27
|
+
audio: "audio";
|
|
28
|
+
navigation: "navigation";
|
|
29
|
+
pipeline: "pipeline";
|
|
30
|
+
}>>>;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
operation: z.ZodLiteral<"profile_start">;
|
|
33
|
+
handle: z.ZodObject<{
|
|
34
|
+
runId: z.ZodUUID;
|
|
35
|
+
generation: z.ZodNumber;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
durationMs: z.ZodNumber;
|
|
38
|
+
intervalFrames: z.ZodNumber;
|
|
39
|
+
groups: z.ZodArray<z.ZodEnum<{
|
|
40
|
+
custom: "custom";
|
|
41
|
+
frame: "frame";
|
|
42
|
+
memory: "memory";
|
|
43
|
+
objects: "objects";
|
|
44
|
+
rendering: "rendering";
|
|
45
|
+
physics: "physics";
|
|
46
|
+
audio: "audio";
|
|
47
|
+
navigation: "navigation";
|
|
48
|
+
pipeline: "pipeline";
|
|
49
|
+
}>>;
|
|
50
|
+
retainRaw: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
operation: z.ZodLiteral<"profile_status">;
|
|
53
|
+
handle: z.ZodObject<{
|
|
54
|
+
runId: z.ZodUUID;
|
|
55
|
+
generation: z.ZodNumber;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
jobToken: z.ZodString;
|
|
58
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
59
|
+
operation: z.ZodLiteral<"profile_cancel">;
|
|
60
|
+
handle: z.ZodObject<{
|
|
61
|
+
runId: z.ZodUUID;
|
|
62
|
+
generation: z.ZodNumber;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
jobToken: z.ZodString;
|
|
65
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
66
|
+
operation: z.ZodLiteral<"profile_result">;
|
|
67
|
+
handle: z.ZodObject<{
|
|
68
|
+
runId: z.ZodUUID;
|
|
69
|
+
generation: z.ZodNumber;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
jobToken: z.ZodString;
|
|
72
|
+
}, z.core.$strict>], "operation">;
|
|
73
|
+
export declare const MonitorSnapshotSchema: z.ZodObject<{
|
|
74
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
75
|
+
frame: z.ZodNumber;
|
|
76
|
+
monotonicUsec: z.ZodNumber;
|
|
77
|
+
engine: z.ZodObject<{
|
|
78
|
+
version: z.ZodString;
|
|
79
|
+
renderer: z.ZodString;
|
|
80
|
+
renderingMethod: z.ZodString;
|
|
81
|
+
graphicsApi: z.ZodString;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
groups: z.ZodRecord<z.ZodEnum<{
|
|
84
|
+
custom: "custom";
|
|
85
|
+
frame: "frame";
|
|
86
|
+
memory: "memory";
|
|
87
|
+
objects: "objects";
|
|
88
|
+
rendering: "rendering";
|
|
89
|
+
physics: "physics";
|
|
90
|
+
audio: "audio";
|
|
91
|
+
navigation: "navigation";
|
|
92
|
+
pipeline: "pipeline";
|
|
93
|
+
}> & z.core.$partial, z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
94
|
+
unavailable: z.ZodArray<z.ZodString>;
|
|
95
|
+
gpuTimestamps: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
96
|
+
supported: z.ZodLiteral<false>;
|
|
97
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
supported: z.ZodLiteral<true>;
|
|
100
|
+
deltasUsec: z.ZodArray<z.ZodNumber>;
|
|
101
|
+
}, z.core.$strict>], "supported">;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
export declare const ProfileEvidenceSchema: z.ZodObject<{
|
|
104
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
105
|
+
jobToken: z.ZodString;
|
|
106
|
+
state: z.ZodEnum<{
|
|
107
|
+
completed: "completed";
|
|
108
|
+
failed: "failed";
|
|
109
|
+
cancelled: "cancelled";
|
|
110
|
+
}>;
|
|
111
|
+
complete: z.ZodBoolean;
|
|
112
|
+
startedMonotonicUsec: z.ZodNumber;
|
|
113
|
+
finishedMonotonicUsec: z.ZodNumber;
|
|
114
|
+
startFrame: z.ZodNumber;
|
|
115
|
+
endFrame: z.ZodNumber;
|
|
116
|
+
requestedDurationMs: z.ZodNumber;
|
|
117
|
+
intervalFrames: z.ZodNumber;
|
|
118
|
+
observedSamples: z.ZodNumber;
|
|
119
|
+
retainedSamples: z.ZodNumber;
|
|
120
|
+
invalidSamples: z.ZodNumber;
|
|
121
|
+
droppedSamples: z.ZodNumber;
|
|
122
|
+
metricTruncation: z.ZodObject<{
|
|
123
|
+
truncated: z.ZodBoolean;
|
|
124
|
+
affectedSamples: z.ZodNumber;
|
|
125
|
+
maxDroppedMetricsPerSample: z.ZodNumber;
|
|
126
|
+
droppedGroups: z.ZodArray<z.ZodEnum<{
|
|
127
|
+
custom: "custom";
|
|
128
|
+
frame: "frame";
|
|
129
|
+
memory: "memory";
|
|
130
|
+
objects: "objects";
|
|
131
|
+
rendering: "rendering";
|
|
132
|
+
physics: "physics";
|
|
133
|
+
audio: "audio";
|
|
134
|
+
navigation: "navigation";
|
|
135
|
+
pipeline: "pipeline";
|
|
136
|
+
profiler: "profiler";
|
|
137
|
+
}>>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
aggregates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
140
|
+
min: z.ZodNumber;
|
|
141
|
+
max: z.ZodNumber;
|
|
142
|
+
mean: z.ZodNumber;
|
|
143
|
+
p50: z.ZodNumber;
|
|
144
|
+
p95: z.ZodNumber;
|
|
145
|
+
p99: z.ZodNumber;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
rawSamples: z.ZodArray<z.ZodObject<{
|
|
148
|
+
frame: z.ZodNumber;
|
|
149
|
+
monotonicUsec: z.ZodNumber;
|
|
150
|
+
values: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
engine: z.ZodObject<{
|
|
153
|
+
version: z.ZodString;
|
|
154
|
+
renderer: z.ZodString;
|
|
155
|
+
renderingMethod: z.ZodString;
|
|
156
|
+
graphicsApi: z.ZodString;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
gpuTimestamps: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
159
|
+
supported: z.ZodLiteral<false>;
|
|
160
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
supported: z.ZodLiteral<true>;
|
|
163
|
+
deltasUsec: z.ZodArray<z.ZodNumber>;
|
|
164
|
+
}, z.core.$strict>], "supported">;
|
|
165
|
+
terminalReason: z.ZodOptional<z.ZodString>;
|
|
166
|
+
sha256: z.ZodString;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
export declare const ProfileJobReceiptSchema: z.ZodObject<{
|
|
169
|
+
jobToken: z.ZodString;
|
|
170
|
+
state: z.ZodEnum<{
|
|
171
|
+
running: "running";
|
|
172
|
+
completed: "completed";
|
|
173
|
+
failed: "failed";
|
|
174
|
+
cancelled: "cancelled";
|
|
175
|
+
}>;
|
|
176
|
+
progress: z.ZodNumber;
|
|
177
|
+
observedSamples: z.ZodNumber;
|
|
178
|
+
retainedSamples: z.ZodNumber;
|
|
179
|
+
terminalReason: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export declare const ProfileResultSchema: z.ZodObject<{
|
|
182
|
+
state: z.ZodEnum<{
|
|
183
|
+
completed: "completed";
|
|
184
|
+
failed: "failed";
|
|
185
|
+
cancelled: "cancelled";
|
|
186
|
+
}>;
|
|
187
|
+
evidence: z.ZodObject<{
|
|
188
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
189
|
+
jobToken: z.ZodString;
|
|
190
|
+
state: z.ZodEnum<{
|
|
191
|
+
completed: "completed";
|
|
192
|
+
failed: "failed";
|
|
193
|
+
cancelled: "cancelled";
|
|
194
|
+
}>;
|
|
195
|
+
complete: z.ZodBoolean;
|
|
196
|
+
startedMonotonicUsec: z.ZodNumber;
|
|
197
|
+
finishedMonotonicUsec: z.ZodNumber;
|
|
198
|
+
startFrame: z.ZodNumber;
|
|
199
|
+
endFrame: z.ZodNumber;
|
|
200
|
+
requestedDurationMs: z.ZodNumber;
|
|
201
|
+
intervalFrames: z.ZodNumber;
|
|
202
|
+
observedSamples: z.ZodNumber;
|
|
203
|
+
retainedSamples: z.ZodNumber;
|
|
204
|
+
invalidSamples: z.ZodNumber;
|
|
205
|
+
droppedSamples: z.ZodNumber;
|
|
206
|
+
metricTruncation: z.ZodObject<{
|
|
207
|
+
truncated: z.ZodBoolean;
|
|
208
|
+
affectedSamples: z.ZodNumber;
|
|
209
|
+
maxDroppedMetricsPerSample: z.ZodNumber;
|
|
210
|
+
droppedGroups: z.ZodArray<z.ZodEnum<{
|
|
211
|
+
custom: "custom";
|
|
212
|
+
frame: "frame";
|
|
213
|
+
memory: "memory";
|
|
214
|
+
objects: "objects";
|
|
215
|
+
rendering: "rendering";
|
|
216
|
+
physics: "physics";
|
|
217
|
+
audio: "audio";
|
|
218
|
+
navigation: "navigation";
|
|
219
|
+
pipeline: "pipeline";
|
|
220
|
+
profiler: "profiler";
|
|
221
|
+
}>>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
aggregates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
224
|
+
min: z.ZodNumber;
|
|
225
|
+
max: z.ZodNumber;
|
|
226
|
+
mean: z.ZodNumber;
|
|
227
|
+
p50: z.ZodNumber;
|
|
228
|
+
p95: z.ZodNumber;
|
|
229
|
+
p99: z.ZodNumber;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
rawSamples: z.ZodArray<z.ZodObject<{
|
|
232
|
+
frame: z.ZodNumber;
|
|
233
|
+
monotonicUsec: z.ZodNumber;
|
|
234
|
+
values: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
235
|
+
}, z.core.$strict>>;
|
|
236
|
+
engine: z.ZodObject<{
|
|
237
|
+
version: z.ZodString;
|
|
238
|
+
renderer: z.ZodString;
|
|
239
|
+
renderingMethod: z.ZodString;
|
|
240
|
+
graphicsApi: z.ZodString;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
gpuTimestamps: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
243
|
+
supported: z.ZodLiteral<false>;
|
|
244
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
246
|
+
supported: z.ZodLiteral<true>;
|
|
247
|
+
deltasUsec: z.ZodArray<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strict>], "supported">;
|
|
249
|
+
terminalReason: z.ZodOptional<z.ZodString>;
|
|
250
|
+
sha256: z.ZodString;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
}, z.core.$strict>;
|
|
253
|
+
export declare const RUNTIME_PERFORMANCE_OPERATIONS: readonly ["monitor_snapshot", "profile_start", "profile_status", "profile_cancel", "profile_result"];
|
|
254
|
+
export type MonitorGroup = z.infer<typeof MonitorGroupSchema>;
|
|
255
|
+
export type MonitorSnapshot = z.infer<typeof MonitorSnapshotSchema>;
|
|
256
|
+
export type ProfileEvidence = z.infer<typeof ProfileEvidenceSchema>;
|
|
257
|
+
export type ProfileJobReceipt = z.infer<typeof ProfileJobReceiptSchema>;
|
|
258
|
+
export type ProfileResult = z.infer<typeof ProfileResultSchema>;
|
|
259
|
+
type OpaqueProfileJob = z.infer<typeof ProfileJobTokenSchema>;
|
|
260
|
+
export { type OpaqueProfileJob as ProfileJobToken };
|
|
261
|
+
export type RuntimePerformanceOperationInput = z.infer<typeof RuntimePerformanceOperationInputSchema>;
|
|
262
|
+
//# sourceMappingURL=runtimePerformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimePerformance.d.ts","sourceRoot":"","sources":["../src/runtimePerformance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB,aAA8C,CAAC;AAEjF,eAAO,MAAM,kBAAkB;;;;;;;;;;EAU7B,CAAC;AAiBH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqBjD,CAAC;AAoBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUvB,CAAC;AA0CZ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiC9B,CAAC;AAEL,eAAO,MAAM,uBAAuB;;;;;;;;;;;;kBASzB,CAAC;AAEZ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAM0F,CAAC;AAE3H,eAAO,MAAM,8BAA8B,sGAMjC,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC9D,OAAO,EAAE,KAAK,gBAAgB,IAAI,eAAe,EAAE,CAAC;AACpD,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RuntimeHandleSchema } from "./runtimeShared.js";
|
|
3
|
+
export const ProfileJobTokenSchema = z.string().regex(/^pjt_[A-Za-z0-9_-]{43}$/);
|
|
4
|
+
export const MonitorGroupSchema = z.enum([
|
|
5
|
+
"frame",
|
|
6
|
+
"memory",
|
|
7
|
+
"objects",
|
|
8
|
+
"rendering",
|
|
9
|
+
"physics",
|
|
10
|
+
"audio",
|
|
11
|
+
"navigation",
|
|
12
|
+
"pipeline",
|
|
13
|
+
"custom",
|
|
14
|
+
]);
|
|
15
|
+
const ALL_MONITOR_GROUPS = MonitorGroupSchema.options;
|
|
16
|
+
const MonitorGroupsSchema = z
|
|
17
|
+
.array(MonitorGroupSchema)
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(9)
|
|
20
|
+
.refine((groups) => new Set(groups).size === groups.length, { message: "Monitor groups must be unique" });
|
|
21
|
+
const ProfileGroupsSchema = z
|
|
22
|
+
.array(MonitorGroupSchema)
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(8)
|
|
25
|
+
.refine((groups) => new Set(groups).size === groups.length, { message: "Monitor groups must be unique" });
|
|
26
|
+
const ProfileJobOperationSchema = (operation) => z.object({ operation: z.literal(operation), handle: RuntimeHandleSchema, ["jobToken"]: ProfileJobTokenSchema }).strict();
|
|
27
|
+
export const RuntimePerformanceOperationInputSchema = z.discriminatedUnion("operation", [
|
|
28
|
+
z
|
|
29
|
+
.object({
|
|
30
|
+
operation: z.literal("monitor_snapshot"),
|
|
31
|
+
handle: RuntimeHandleSchema,
|
|
32
|
+
groups: MonitorGroupsSchema.default(ALL_MONITOR_GROUPS),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
z
|
|
36
|
+
.object({
|
|
37
|
+
operation: z.literal("profile_start"),
|
|
38
|
+
handle: RuntimeHandleSchema,
|
|
39
|
+
durationMs: z.number().int().min(100).max(30_000),
|
|
40
|
+
intervalFrames: z.number().int().min(1).max(120),
|
|
41
|
+
groups: ProfileGroupsSchema,
|
|
42
|
+
retainRaw: z.boolean().default(false),
|
|
43
|
+
})
|
|
44
|
+
.strict(),
|
|
45
|
+
ProfileJobOperationSchema("profile_status"),
|
|
46
|
+
ProfileJobOperationSchema("profile_cancel"),
|
|
47
|
+
ProfileJobOperationSchema("profile_result"),
|
|
48
|
+
]);
|
|
49
|
+
const EngineMetadataSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
version: z.string().min(1).max(128),
|
|
52
|
+
renderer: z.string().min(1).max(128),
|
|
53
|
+
renderingMethod: z.string().min(1).max(128),
|
|
54
|
+
graphicsApi: z.string().min(1).max(128),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
const GpuTimestampsSchema = z.discriminatedUnion("supported", [
|
|
58
|
+
z.object({ supported: z.literal(false), reason: z.string().min(1).max(256).optional() }).strict(),
|
|
59
|
+
z.object({ supported: z.literal(true), deltasUsec: z.array(z.number().finite().min(0)).max(2_048) }).strict(),
|
|
60
|
+
]);
|
|
61
|
+
const MonitorValuesSchema = z
|
|
62
|
+
.record(z.string().min(1).max(128), z.number().finite())
|
|
63
|
+
.refine((values) => Object.keys(values).length <= 128, { message: "A monitor group may contain at most 128 values" });
|
|
64
|
+
export const MonitorSnapshotSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
schemaVersion: z.literal(1),
|
|
67
|
+
frame: z.number().int().min(0),
|
|
68
|
+
monotonicUsec: z.number().int().min(0),
|
|
69
|
+
engine: EngineMetadataSchema,
|
|
70
|
+
groups: z.partialRecord(MonitorGroupSchema, MonitorValuesSchema),
|
|
71
|
+
unavailable: z.array(z.string().min(1).max(256)).max(128),
|
|
72
|
+
gpuTimestamps: GpuTimestampsSchema,
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
const ProfileAggregateSchema = z
|
|
76
|
+
.object({
|
|
77
|
+
min: z.number().finite(),
|
|
78
|
+
max: z.number().finite(),
|
|
79
|
+
mean: z.number().finite(),
|
|
80
|
+
p50: z.number().finite(),
|
|
81
|
+
p95: z.number().finite(),
|
|
82
|
+
p99: z.number().finite(),
|
|
83
|
+
})
|
|
84
|
+
.strict();
|
|
85
|
+
const FlattenedMetricNameSchema = z.string().min(1).max(139);
|
|
86
|
+
const ProfileSampleSchema = z
|
|
87
|
+
.object({
|
|
88
|
+
frame: z.number().int().min(0),
|
|
89
|
+
monotonicUsec: z.number().int().min(0),
|
|
90
|
+
values: z.record(FlattenedMetricNameSchema, z.number().finite()),
|
|
91
|
+
})
|
|
92
|
+
.strict();
|
|
93
|
+
const ProfileMetricTruncationSchema = z
|
|
94
|
+
.object({
|
|
95
|
+
truncated: z.boolean(),
|
|
96
|
+
affectedSamples: z.number().int().min(0),
|
|
97
|
+
maxDroppedMetricsPerSample: z.number().int().min(0),
|
|
98
|
+
droppedGroups: z
|
|
99
|
+
.array(z.enum([...MonitorGroupSchema.options, "profiler"]))
|
|
100
|
+
.max(10)
|
|
101
|
+
.refine((groups) => new Set(groups).size === groups.length, { message: "Dropped metric groups must be unique" }),
|
|
102
|
+
})
|
|
103
|
+
.strict()
|
|
104
|
+
.refine((value) => value.truncated
|
|
105
|
+
? value.affectedSamples > 0 && value.maxDroppedMetricsPerSample > 0 && value.droppedGroups.length > 0
|
|
106
|
+
: value.affectedSamples === 0 && value.maxDroppedMetricsPerSample === 0 && value.droppedGroups.length === 0, { message: "Metric truncation metadata must match its truncation state" });
|
|
107
|
+
export const ProfileEvidenceSchema = z
|
|
108
|
+
.object({
|
|
109
|
+
schemaVersion: z.literal(1),
|
|
110
|
+
["jobToken"]: ProfileJobTokenSchema,
|
|
111
|
+
state: z.enum(["completed", "cancelled", "failed"]),
|
|
112
|
+
complete: z.boolean(),
|
|
113
|
+
startedMonotonicUsec: z.number().int().min(0),
|
|
114
|
+
finishedMonotonicUsec: z.number().int().min(0),
|
|
115
|
+
startFrame: z.number().int().min(0),
|
|
116
|
+
endFrame: z.number().int().min(0),
|
|
117
|
+
requestedDurationMs: z.number().int().min(100).max(30_000),
|
|
118
|
+
intervalFrames: z.number().int().min(1).max(120),
|
|
119
|
+
observedSamples: z.number().int().min(0),
|
|
120
|
+
retainedSamples: z.number().int().min(0).max(2_048),
|
|
121
|
+
invalidSamples: z.number().int().min(0),
|
|
122
|
+
droppedSamples: z.number().int().min(0),
|
|
123
|
+
metricTruncation: ProfileMetricTruncationSchema,
|
|
124
|
+
aggregates: z.record(FlattenedMetricNameSchema, ProfileAggregateSchema),
|
|
125
|
+
rawSamples: z.array(ProfileSampleSchema).max(2_048),
|
|
126
|
+
engine: EngineMetadataSchema,
|
|
127
|
+
gpuTimestamps: GpuTimestampsSchema,
|
|
128
|
+
terminalReason: z.string().min(1).max(256).optional(),
|
|
129
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
130
|
+
})
|
|
131
|
+
.strict()
|
|
132
|
+
.refine((evidence) => evidence.finishedMonotonicUsec >= evidence.startedMonotonicUsec && evidence.endFrame >= evidence.startFrame, {
|
|
133
|
+
message: "Profile evidence must have monotonic time and frame bounds",
|
|
134
|
+
})
|
|
135
|
+
.refine((evidence) => evidence.retainedSamples === evidence.rawSamples.length || evidence.rawSamples.length === 0, {
|
|
136
|
+
message: "Retained sample metadata must match included raw samples",
|
|
137
|
+
})
|
|
138
|
+
.refine((evidence) => evidence.metricTruncation.affectedSamples <= evidence.observedSamples, {
|
|
139
|
+
message: "Metric truncation cannot affect more samples than were observed",
|
|
140
|
+
});
|
|
141
|
+
export const ProfileJobReceiptSchema = z
|
|
142
|
+
.object({
|
|
143
|
+
["jobToken"]: ProfileJobTokenSchema,
|
|
144
|
+
state: z.enum(["running", "completed", "cancelled", "failed"]),
|
|
145
|
+
progress: z.number().finite().min(0).max(1),
|
|
146
|
+
observedSamples: z.number().int().min(0),
|
|
147
|
+
retainedSamples: z.number().int().min(0).max(2_048),
|
|
148
|
+
terminalReason: z.string().min(1).max(256).optional(),
|
|
149
|
+
})
|
|
150
|
+
.strict();
|
|
151
|
+
export const ProfileResultSchema = z
|
|
152
|
+
.object({
|
|
153
|
+
state: z.enum(["completed", "cancelled", "failed"]),
|
|
154
|
+
evidence: ProfileEvidenceSchema,
|
|
155
|
+
})
|
|
156
|
+
.strict()
|
|
157
|
+
.refine((result) => result.state === result.evidence.state, { message: "Profile result state must match its evidence" });
|
|
158
|
+
export const RUNTIME_PERFORMANCE_OPERATIONS = [
|
|
159
|
+
"monitor_snapshot",
|
|
160
|
+
"profile_start",
|
|
161
|
+
"profile_status",
|
|
162
|
+
"profile_cancel",
|
|
163
|
+
"profile_result",
|
|
164
|
+
];
|
|
165
|
+
//# sourceMappingURL=runtimePerformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimePerformance.js","sourceRoot":"","sources":["../src/runtimePerformance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,OAAO;IACP,QAAQ;IACR,SAAS;IACT,WAAW;IACX,SAAS;IACT,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;CACT,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,OAAO,CAAC;AACtD,MAAM,mBAAmB,GAAG,CAAC;KAC1B,KAAK,CAAC,kBAAkB,CAAC;KACzB,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,CAAC,CAAC;KACN,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAC;AAC5G,MAAM,mBAAmB,GAAG,CAAC;KAC1B,KAAK,CAAC,kBAAkB,CAAC;KACzB,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,CAAC,CAAC;KACN,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC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AAG;IAC5C,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;CACR,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RuntimeHandleSchema: z.ZodObject<{
|
|
3
|
+
runId: z.ZodUUID;
|
|
4
|
+
generation: z.ZodNumber;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const RuntimeLaunchPinsSchema: z.ZodObject<{
|
|
7
|
+
width: z.ZodNumber;
|
|
8
|
+
height: z.ZodNumber;
|
|
9
|
+
renderer: z.ZodEnum<{
|
|
10
|
+
gl_compatibility: "gl_compatibility";
|
|
11
|
+
mobile: "mobile";
|
|
12
|
+
}>;
|
|
13
|
+
locale: z.ZodString;
|
|
14
|
+
seed: z.ZodNumber;
|
|
15
|
+
fixedFps: z.ZodUnion<readonly [z.ZodLiteral<30>, z.ZodLiteral<60>, z.ZodLiteral<120>]>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type RuntimeHandle = z.infer<typeof RuntimeHandleSchema>;
|
|
18
|
+
export type RuntimeLaunchPins = z.infer<typeof RuntimeLaunchPinsSchema>;
|
|
19
|
+
//# sourceMappingURL=runtimeShared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeShared.d.ts","sourceRoot":"","sources":["../src/runtimeShared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;kBAKrB,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;;;;;kBASzB,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const RuntimeHandleSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
runId: z.uuid(),
|
|
5
|
+
generation: z.number().int().min(1),
|
|
6
|
+
})
|
|
7
|
+
.strict();
|
|
8
|
+
export const RuntimeLaunchPinsSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
width: z.number().int().min(1).max(2048),
|
|
11
|
+
height: z.number().int().min(1).max(2048),
|
|
12
|
+
renderer: z.enum(["gl_compatibility", "mobile"]),
|
|
13
|
+
locale: z.string().regex(/^[A-Za-z]{2,3}(?:_[A-Za-z]{2})?$/),
|
|
14
|
+
seed: z.number().int().min(-2_147_483_648).max(2_147_483_647),
|
|
15
|
+
fixedFps: z.union([z.literal(30), z.literal(60), z.literal(120)]),
|
|
16
|
+
})
|
|
17
|
+
.strict();
|
|
18
|
+
//# sourceMappingURL=runtimeShared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeShared.js","sourceRoot":"","sources":["../src/runtimeShared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAA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