28constexpr std::string_view kPlaySchemaId =
"evengine.play-request";
29constexpr std::string_view kPlayResponseId =
"evengine.play-response";
30constexpr std::string_view kContractSchemaId =
"evengine.game-agent-contract";
31constexpr std::int64_t kSchemaVersion = 1;
32constexpr std::int64_t kMaxFrameSteps = 1024;
34Result<const Value::Object*> asObject(
const Value&
value, std::string
path) {
42Result<void> knownFields(
const Value::Object&
object,
const std::set<std::string>& allowed,
43 std::string_view
path) {
46 if (!allowed.contains(
name))
54 std::string_view
path) {
55 const auto found =
object.find(std::string(
name));
62Result<std::string> stringMember(
const Value::Object&
object, std::string_view
name,
63 std::string_view
path) {
69Result<std::int64_t> intMember(
const Value::Object&
object, std::string_view
name, std::string_view
path) {
77 const auto found =
object.find(std::string(
name));
79 if (!
found->second.isString())
81 std::string(
path) +
"." + std::string(
name)));
86std::vector<std::string> splitPath(std::string_view dotted) {
87 std::vector<std::string>
parts;
89 for (
char ch : dotted) {
102 extra.emplace(
"op",
Value(std::move(op)));
103 extra.emplace(
"schemaId",
Value(std::string(kPlayResponseId)));
104 extra.emplace(
"schemaVersion",
Value(kSchemaVersion));
105 return Value(std::move(extra));
108struct ObservationSpec {
121struct ParsedContract {
134 return Result<std::vector<std::string>>::failure(
136 std::vector<std::string>
out;
138 if (!(*array)[
index].isString())
141 out.push_back((*array)[
index].asString());
143 return Result<std::vector<std::string>>::success(std::move(
out));
146Result<ParsedContract> parseContract(
const Value&
contract) {
150 knownFields(*
root.value(),
151 {
"actions",
"capture",
"clock",
"entry",
"id",
"observations",
"schemaId",
"schemaVersion",
152 "smoke",
"tolerances"},
155 auto schemaId = stringMember(*
root.value(),
"schemaId",
"contract");
157 auto version = intMember(*
root.value(),
"schemaVersion",
"contract");
159 auto id = stringMember(*
root.value(),
"id",
"contract");
161 auto entry = stringMember(*
root.value(),
"entry",
"contract");
163 if (schemaId.value() != kContractSchemaId ||
version.value() != kSchemaVersion)
166 if (
id.
value().empty())
170 ParsedContract parsed;
171 parsed.id =
id.value();
172 parsed.defaultStep =
"frame";
174 const auto clock =
root.value()->find(
"clock");
175 if (clock !=
root.value()->end()) {
176 auto object = asObject(clock->second,
"contract.clock");
178 auto clockKnown = knownFields(*
object.
value(), {
"defaultStep"},
"contract.clock");
180 auto step = stringMember(*
object.
value(),
"defaultStep",
"contract.clock");
182 parsed.defaultStep =
step.value();
183 if (parsed.defaultStep !=
"frame")
185 "P0 play host only supports frame defaultStep",
186 "contract.clock.defaultStep"));
195 const std::string itemPath =
"contract.observations." + std::to_string(
index);
196 auto object = asObject((*array)[
index], itemPath);
198 auto itemKnown = knownFields(*
object.
value(), {
"fields",
"id",
"kind",
"path"}, itemPath);
200 ObservationSpec spec;
201 auto specId = stringMember(*
object.
value(),
"id", itemPath);
203 auto kind = stringMember(*
object.
value(),
"kind", itemPath);
205 auto path = stringMember(*
object.
value(),
"path", itemPath);
207 spec.id = specId.value();
208 spec.kind =
kind.value();
209 spec.path =
path.value();
210 const auto fields =
object.value()->find(
"fields");
214 spec.fields = std::move(parsedFields).takeValue();
216 parsed.observations.push_back(std::move(spec));
219 const auto smoke =
root.value()->find(
"smoke");
220 if (smoke !=
root.value()->end()) {
221 auto object = asObject(smoke->second,
"contract.smoke");
224 knownFields(*
object.
value(), {
"maxHostFrames",
"mustReach",
"scene",
"seed"},
"contract.smoke");
226 auto scene = stringMember(*
object.
value(),
"scene",
"contract.smoke");
228 const auto mustReach =
object.value()->find(
"mustReach");
229 if (mustReach !=
object.
value()->
end()) {
230 auto reached =
stringArray(mustReach->second,
"contract.smoke.mustReach");
235 const auto capture =
root.value()->find(
"capture");
236 if (capture !=
root.value()->end()) {
237 auto object = asObject(capture->second,
"contract.capture");
239 auto captureKnown = knownFields(*
object.
value(), {
"backend",
"requiredFor"},
"contract.capture");
241 auto backend = stringMember(*
object.
value(),
"backend",
"contract.capture");
243 if (
backend.value() !=
"engine-readback")
246 const auto requiredFor =
object.value()->find(
"requiredFor");
247 if (requiredFor !=
object.
value()->
end()) {
248 auto names =
stringArray(requiredFor->second,
"contract.capture.requiredFor");
250 parsed.captureRequiredFor = std::move(names).takeValue();
254 const auto actions =
root.value()->find(
"actions");
256 auto object = asObject(
actions->second,
"contract.actions");
258 auto actionsKnown = knownFields(*
object.
value(), {
"domain",
"map",
"source"},
"contract.actions");
260 auto source = stringMember(*
object.
value(),
"source",
"contract.actions");
262 parsed.actionSource =
source.value();
263 if (parsed.actionSource !=
"script-map" && parsed.actionSource !=
"gameplay-domain")
266 auto domainField = optionalString(*
object.
value(),
"domain",
"contract.actions", &parsed.actionDomain);
268 const auto map =
object.value()->find(
"map");
275 const std::string itemPath =
"contract.actions.map." + std::to_string(
index);
276 auto item = asObject((*array)[
index], itemPath);
278 auto itemKnown = knownFields(*item.value(), {
"action",
"id",
"script"}, itemPath);
281 auto actionId = stringMember(*item.value(),
"id", itemPath);
283 spec.id = actionId.value();
284 auto scriptField = optionalString(*item.value(),
"script", itemPath, &spec.script);
286 auto mappedAction = optionalString(*item.value(),
"action", itemPath, &spec.action);
288 if (parsed.actionSource ==
"script-map" && spec.script.empty())
291 if (parsed.actionSource ==
"gameplay-domain" && spec.action.empty())
294 parsed.actions.push_back(std::move(spec));
299 const auto tolerances =
root.value()->find(
"tolerances");
300 if (tolerances !=
root.value()->end()) {
301 auto object = asObject(tolerances->second,
"contract.tolerances");
303 auto tolKnown = knownFields(*
object.
value(), {
"numericAbs",
"screenshot"},
"contract.tolerances");
310Result<const ObservationSpec*> findObservation(
const ParsedContract&
contract, std::string_view
id) {
318Result<const ActionSpec*>
findAction(
const ParsedContract&
contract, std::string_view
id) {
326Result<Value> requireContract(IPlayHostRuntime& runtime) {
327 auto loaded = runtime.loadContract();
337Value encodeDomains(
const std::vector<std::string>& domains) {
343Result<Value> opStatus(IPlayHostRuntime& runtime) {
345 {
"hostFrame",
Value(
static_cast<std::int64_t
>(runtime.hostFrame()))},
346 {
"domains", encodeDomains(runtime.gameplayDomains())}};
347 GameWorldSnapshotInput worldInput;
348 worldInput.domains = runtime.gameplayDomains();
355 auto loaded = runtime.loadContract();
357 auto parsed = parseContract(
loaded.value());
359 extra.emplace(
"contractId",
Value(parsed.value().id));
360 extra.emplace(
"contractLoaded",
Value(
true));
361 worldInput.contractId = parsed.value().id;
362 worldInput.contractLoaded =
true;
365 extra.emplace(
"gameWorld", std::move(snapshot).takeValue());
367 extra.emplace(
"contractLoaded",
Value(
false));
370 extra.emplace(
"gameWorld", std::move(snapshot).takeValue());
378 auto mode = stringMember(
root,
"mode",
"request");
380 if (mode.value() ==
"pause") runtime.pause();
381 else if (mode.value() ==
"play") runtime.play();
386 playResponse(
"clock", {{
"mode",
Value(mode.value())}, {
"paused",
Value(runtime.paused())}}));
390 std::string clock =
"frame";
391 auto clockField = optionalString(
root,
"clock",
"request", &clock);
393 if (clock !=
"frame")
396 auto count = intMember(
root,
"count",
"request");
398 if (
count.value() < 1 ||
count.value() > kMaxFrameSteps)
401 auto stepped = runtime.stepFrames(
count.value());
404 "step", {{
"clock",
Value(std::move(clock))},
406 {
"hostFrame",
Value(
static_cast<std::int64_t
>(runtime.hostFrame()))},
407 {
"paused",
Value(runtime.paused())}}));
411 auto observation = stringMember(
root,
"observation",
"request");
413 auto contractValue = requireContract(runtime);
415 auto parsed = parseContract(contractValue.value());
417 auto spec = findObservation(parsed.value(), observation.value());
419 if (spec.value()->kind !=
"script-root")
424 std::string observedPath = spec.value()->path;
425 bool deprecated =
false;
426 auto state = runtime.observeScriptRoot(observedPath, spec.value()->fields);
427 if (!state && observedPath ==
"mode") {
428 auto fallback = runtime.observeScriptRoot(
"gameState", spec.value()->fields);
430 state = std::move(fallback);
431 observedPath =
"gameState";
434 }
else if (state && observedPath ==
"mode") {
439 {
"path",
Value(observedPath)},
440 {
"state", std::move(state).takeValue()}};
441 if (deprecated)
payload.emplace(
"deprecated",
Value(
"observation.path=mode; use paths.gameState / gameState"));
446 std::string
path =
"mcp_screenshot.png";
447 auto pathField = optionalString(
root,
"path",
"request", &
path);
449 if (
path.empty())
path =
"mcp_screenshot.png";
450 auto captured = runtime.capturePng(std::move(
path));
452 auto object = asObject(captured.value(),
"capture");
455 extra.emplace(
"backend",
Value(
"engine-readback"));
459Result<Value> opCheckpoint(
const Value::Object&
root, IPlayHostRuntime& runtime) {
460 auto mode = stringMember(
root,
"mode",
"request");
462 if (mode.value() ==
"capture") {
463 auto json = runtime.captureCheckpoint();
466 playResponse(
"checkpoint", {{
"mode",
Value(
"capture")}, {
"json",
Value(std::move(json).takeValue())}}));
468 if (mode.value() ==
"restore") {
469 auto json = stringMember(
root,
"json",
"request");
471 auto restored = runtime.restoreCheckpoint(json.value());
480 auto action = stringMember(
root,
"action",
"request");
482 auto contractValue = requireContract(runtime);
484 auto parsed = parseContract(contractValue.value());
488 if (parsed.value().actionSource ==
"script-map") {
489 auto invoked = runtime.invokeScriptAction(spec.value()->id, spec.value()->script);
492 {
"source",
Value(
"script-map")},
493 {
"receipt", std::move(invoked).takeValue()}}));
495 if (parsed.value().actionSource !=
"gameplay-domain")
498 const auto commandField =
root.find(
"command");
499 if (commandField ==
root.end())
502 auto commandObject = asObject(commandField->second,
"request.command");
505 if (command.find(
"action") == command.end()) command.emplace(
"action",
Value(spec.value()->action));
506 std::string
domain = parsed.value().actionDomain;
507 auto domainField = optionalString(
root,
"domain",
"request", &
domain);
512 const auto sessionField =
root.find(
"session");
513 const auto instanceField =
root.find(
"instance");
514 if (sessionField ==
root.end() || instanceField ==
root.end())
518 {
"schemaVersion",
Value(std::int64_t{1})},
519 {
"op",
Value(
"submit")},
521 {
"instance", instanceField->second},
522 {
"session", sessionField->second},
523 {
"command",
Value(std::move(command))}};
527 {
"source",
Value(
"gameplay-domain")},
528 {
"gameplay", std::move(submitted).takeValue()}}));
531Result<Value> opTrace() {
544bool sessionWantsTrace() {
546 if (!
session.active())
return false;
552void tryRecordEvidence(std::string criterionId, std::string
kind, std::string summary, std::string artifact) {
556 evidence.criterionId = std::move(criterionId);
559 evidence.summary = std::move(summary);
560 evidence.artifact = std::move(artifact);
564bool hasCriterion(
const AgentDevelopmentSession&
session, std::string_view
id) {
565 for (
const auto& criterion :
session.criteria()) {
566 if (criterion.id ==
id)
return true;
574 const auto opField =
request.find(
"op");
575 if (opField ==
request.end() || !opField->second.isString())
return;
576 const std::string& op = opField->second.asString();
577 std::string criterionId;
578 optionalString(
request,
"criterionId",
"request", &criterionId).ignore(
"optional play criterionId");
580 if (op ==
"observe") {
581 std::string observation;
582 optionalString(
request,
"observation",
"request", &observation).ignore(
"optional play observation");
583 if (criterionId.empty() && hasCriterion(
session, observation)) criterionId = observation;
584 tryRecordEvidence(std::move(criterionId),
"runtime-observation",
"play observe " + observation, {});
587 if (op ==
"capture") {
589 if (responseObject) {
590 const auto found = responseObject->find(
"path");
591 if (
found != responseObject->end() &&
found->second.isString())
path =
found->second.asString();
593 if (criterionId.empty() && hasCriterion(
session,
"visual")) criterionId =
"visual";
594 if (criterionId.empty()) {
595 auto loaded = runtime.loadContract();
597 auto parsed = parseContract(
loaded.value());
608 tryRecordEvidence(std::move(criterionId),
"screenshot",
"play capture", std::move(
path));
611 if (op ==
"checkpoint") {
612 if (criterionId.empty() && hasCriterion(
session,
"checkpoint")) criterionId =
"checkpoint";
613 if (criterionId.empty() && hasCriterion(
session,
"recovery")) criterionId =
"recovery";
614 tryRecordEvidence(std::move(criterionId),
"checkpoint",
"play checkpoint", {});
618 if (criterionId.empty() && hasCriterion(
session,
"smoke")) criterionId =
"smoke";
619 tryRecordEvidence(std::move(criterionId),
"play-trace",
"play batch", {});
623void afterPlaySuccess(
const Value&
request,
const Value&
response, IPlayHostRuntime& runtime) {
628 optionalString(*
root,
"trace",
"request", &
trace).ignore(
"trace already validated by dispatch");
629 const auto opField =
root->find(
"op");
630 const std::string op = (opField !=
root->end() && opField->second.isString()) ? opField->second.asString() :
"";
631 const bool skipTrace = op ==
"status" || op ==
"clock" || op ==
"trace" || op ==
"replay" || op ==
"batch";
632 bool append =
trace ==
"append" || (
trace.empty() && sessionWantsTrace());
633 if (
trace ==
"off") append =
false;
634 if (append && !skipTrace) {
636 std::string contractId;
637 std::string contractHash;
638 auto loaded = runtime.loadContract();
640 auto parsed = parseContract(
loaded.value());
641 if (parsed) contractId = parsed.value().id;
643 if (
digest) contractHash = std::move(
digest).takeValue();
652Result<Value> dispatchOne(
const Value&
request, IPlayHostRuntime& runtime,
bool inBatch);
657 const auto* array = requests.value()->getIf<
Value::Array>();
660 auto one = dispatchOne((*array)[
index], runtime,
true);
662 results.push_back(std::move(one).takeValue());
664 const auto count =
static_cast<std::int64_t
>(results.size());
666 playResponse(
"batch", {{
"count",
Value(
count)}, {
"results",
Value(std::move(results))}}));
669Result<Value> dispatchOne(
const Value&
request, IPlayHostRuntime& runtime,
bool inBatch) {
672 static const std::set<std::string> allowed{
673 "action",
"clock",
"command",
"count",
"criterionId",
"domain",
674 "instance",
"json",
"mode",
"observation",
"op",
"path",
675 "recording",
"requests",
"schemaId",
"schemaVersion",
"session",
"trace"};
676 auto known = knownFields(*
root.value(), allowed,
"request");
678 auto schemaId = stringMember(*
root.value(),
"schemaId",
"request");
680 auto version = intMember(*
root.value(),
"schemaVersion",
"request");
682 if (schemaId.value() != kPlaySchemaId ||
version.value() != kSchemaVersion)
686 auto traceField = optionalString(*
root.value(),
"trace",
"request", &
trace);
691 auto op = stringMember(*
root.value(),
"op",
"request");
693 auto executed = [&]() -> Result<Value> {
694 if (op.value() ==
"batch") {
698 return opBatch(*
root.value(), runtime);
700 if (op.value() ==
"status")
return opStatus(runtime);
701 if (op.value() ==
"clock")
return opClock(*
root.value(), runtime);
702 if (op.value() ==
"step")
return opStep(*
root.value(), runtime);
703 if (op.value() ==
"observe")
return opObserve(*
root.value(), runtime);
704 if (op.value() ==
"capture")
return opCapture(*
root.value(), runtime);
705 if (op.value() ==
"checkpoint")
return opCheckpoint(*
root.value(), runtime);
706 if (op.value() ==
"act")
return opAct(*
root.value(), runtime);
707 if (op.value() ==
"trace")
return opTrace();
708 if (op.value() ==
"replay")
return opReplay(*
root.value(), runtime);
712 if (!executed)
return executed;
713 afterPlaySuccess(
request, executed.value(), runtime);
717Result<Value> snapshotRoot(
HSQUIRRELVM vm, std::string_view rootName,
const std::vector<std::string>&
fields) {
720 "play observe requires an attached script VM",
"observation"));
722 if (std::find(roots.begin(), roots.end(), rootName) == roots.end())
728 ~StackGuard() { sq_settop(vm, top); }
729 } guard{
vm, sq_gettop(
vm)};
730 sq_pushroottable(
vm);
731 const std::string
name(rootName);
732 sq_pushstring(
vm,
name.c_str(), -1);
733 if (SQ_FAILED(sq_rawget(
vm, -2)))
736 const SQInteger rootIndex = sq_gettop(
vm);
737 script::SquirrelValueOptions
options;
741 for (
const auto& field :
fields) {
742 sq_settop(
vm, rootIndex);
743 sq_push(
vm, rootIndex);
744 const auto parts = splitPath(field);
745 if (
parts.empty() ||
field.front() ==
'.' ||
field.back() ==
'.' ||
field.find(
"..") != std::string::npos)
748 for (
const auto& part :
parts) {
750 if (sq_gettype(
vm, -1) != OT_TABLE)
753 sq_pushstring(
vm, part.c_str(), -1);
754 if (SQ_FAILED(sq_rawget(
vm, -2)))
761 projected.emplace(field, std::move(
value).takeValue());
766class EnginePlayHostRuntime final :
public IPlayHostRuntime {
769 std::uint64_t hostFrame()
const override {
return hostFrame_; }
773 Result<void> stepFrames(std::int64_t
count)
override {
775 hostFrame_ +=
static_cast<std::uint64_t
>(
count);
779 Result<Value> loadContract()
const override {
783 root = std::filesystem::current_path(ec);
788 const auto path =
root /
"game.agent.json";
790 if (!std::filesystem::is_regular_file(
path, ec))
793 std::ifstream in(
path, std::ios::binary);
797 std::ostringstream contents;
798 contents << in.rdbuf();
802 Result<Value> observeScriptRoot(std::string_view
root,
803 const std::vector<std::string>&
fields)
const override {
807 Result<Value> capturePng(std::string
path)
override {
808 auto* capture = eve::cap::query<IRenderCapture>();
812 auto captured = capture->savePng(
path);
814 const CaptureImageInfo
info = std::move(captured).value();
817 {
"width",
Value(
static_cast<std::int64_t
>(
info.width))}}));
820 Result<std::string> captureCheckpoint()
override {
833 Result<void> restoreCheckpoint(std::string_view json)
override {
845 Result<Value> invokeScriptAction(std::string_view
id, std::string_view
source)
override {
850 const SQInteger
top = sq_gettop(
vm);
851 const std::string snippet(
source);
852 if (SQ_FAILED(sq_compilebuffer(
vm, snippet.c_str(),
static_cast<SQInteger
>(snippet.size()),
853 "<play-action>", SQTrue))) {
859 sq_pushroottable(
vm);
860 if (SQ_FAILED(sq_call(
vm, 1, SQFalse, SQTrue))) {
870 std::vector<std::string> gameplayDomains()
const override {
871 std::vector<std::string> domains;
872 eve::cap::forEach<IGameplayControlProvider>([&](
auto* candidate) {
873 if (candidate) domains.emplace_back(candidate->gameplayDomain());
875 std::sort(domains.begin(), domains.end());
880 std::uint64_t hostFrame_ = 0;
883EnginePlayHostRuntime& liveRuntime() {
884 static EnginePlayHostRuntime runtime;
891 return dispatchOne(
request, runtime,
false);
std::vector< eve::artifact::PartView > parts
struct SQVM * HSQUIRRELVM
std::vector< std::string > fields
EnvironmentMetricContract contract
Runtime game-world Discover snapshot for MCP / Play Host.
Versioned JSON facade shared by scripting, MCP and scenario tooling.
Host-neutral player-equivalent command and observation protocol.
const GltfImportRequest & request
wgpu::PopErrorScopeStatus status
OceanRenderBackend backend
std::vector< ObservationSpec > observations
std::vector< std::string > captureRequiredFor
std::vector< ActionSpec > actions
Versioned Play Host protocol for Agent pause / step / observe / capture.
Versioned Play Trace recording, digest and replay.
std::unordered_set< std::string > loaded
std::weak_ptr< PrimitiveScene > scene
const SquirrelValueOptions & options
The single Squirrel projection for common Result, Status and Value.
std::optional< InteractionSession > session
float(ui::Theme::* member)[4]
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Move-only operation result carrying either a value or Status.
static Result success(T value)
Construct a successful result owning value.
static Result failure(Status status)
Construct a failed result from a structured status.
The canonical owning dynamic value used by data-facing protocols.
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
std::map< std::string, Value > Object
Type
Runtime kind of the owned value.
std::vector< Value > Array
static AgentDevelopmentSession & instance()
Return the process-lifetime session authority.
void stepFrames(int count)
Run count game frames then pause. Each frame is consumed by shouldRunUpdate / notifyFrameDone on the ...
void pause(PauseReason reason=PauseReason::PauseKey)
Frame-level pause without a script site (PauseKey clears pauseLocation). For Exception / Snapshot,...
static Debugger & instance()
Injected runtime used by Play Host. Tests supply a fake; MCP uses the engine adapter....
const std::string & gameRoot() const
static McpServer & instance()
void begin(std::string contractId, std::string contractHash, std::int64_t seed, std::string startCheckpoint)
Begins .
static PlayTraceBuffer & instance()
Instance.
bool isRecording() const
True when recording.
void append(const Value &request, const Value &response, std::uint64_t hostFrame)
Append.
bool isReplaying() const
True while replayPlayTrace is executing.
Value exportTrace() const
Export trace.
static Snapshot & instance()
const Value * field(const Value &value, const char *key)
Borrow an optional object field.
Value stringArray(const std::vector< std::string > &values)
const ClimbingActionDefinition * findAction(const ClimbingProfile &profile, std::string_view id)
Optional action. @borrowed From profile; lifetime ends when the caller-owned profile changes or is de...
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
std::vector< std::string > readConfiguredModules(HSQUIRRELVM vm)
Read config.modules / optionalModules from the attached VM root.
Result< std::string > executePlayJson(std::string_view requestJson)
Parse, execute and serialize one Play JSON request against the live engine.
Result< Value > buildGameWorldSnapshot(const GameWorldSnapshotInput &input)
Assemble runtime world brief plus live system lists.
std::string readConfigTitle(HSQUIRRELVM vm)
Read config.title from the attached VM root.
Result< Value > replayPlayTrace(const Value &recording, IPlayHostRuntime &runtime)
Replay a parsed recording against a host runtime.
std::vector< std::string > readLiveModules(HSQUIRRELVM vm)
List instantiated module slots declared in eve.moduleList.
Result< std::string > playObservationDigest(const Value &state)
Canonical digest of a Play observation state object.
Result< Value > executePlayRequest(const Value &request, IPlayHostRuntime &runtime)
Execute one versioned Play request against an injected runtime.
std::string formatScriptError(const ScriptErrorContext &ctx)
Formats a context into a human-readable multi-line report.
ScriptErrorContext takeLastScriptError(HSQUIRRELVM vm)
Consumes and clears the last recorded error for a VM.
ScriptErrorContext captureCompileError(HSQUIRRELVM vm)
Captures the last compilation error recorded by the VM.
Result< Value > valueFromSquirrel(HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options)
Convert one Squirrel value into the canonical owning Value tree.
Result< Value > executeGameplayControlRequest(const Value &request)
Routes one versioned owning request to the uniquely matching gameplay provider.