@momoyu-ink/kit 0.7.0 → 0.7.1

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/dist/lib.cjs CHANGED
@@ -1214,6 +1214,11 @@ async function settleActiveWarp(error) {
1214
1214
  activeWarp = null;
1215
1215
  }, error);
1216
1216
  }
1217
+ async function clearLocalDebugSessionRuntimeState() {
1218
+ await settleActiveFastForward(new Error("Debug session runtime state cleared"));
1219
+ await settleActiveWarp(new Error("Debug session runtime state cleared"));
1220
+ clearLocalRuntimeState();
1221
+ }
1217
1222
  async function clearRemoteCheckpoints() {
1218
1223
  await executeScenarioCommand({ subCommand: "clearCheckpoints" });
1219
1224
  }
@@ -1543,22 +1548,6 @@ async function stopDebugSession() {
1543
1548
  debugState.active = false;
1544
1549
  clearLocalRuntimeState();
1545
1550
  }
1546
- function clearDebugSessionRuntimeState() {
1547
- clearLocalRuntimeState();
1548
- void settleActiveFastForward(new Error("Debug session runtime state cleared"));
1549
- void settleActiveWarp(new Error("Debug session runtime state cleared"));
1550
- if (!debugState.active) {
1551
- return;
1552
- }
1553
- void enqueueDebugOperation(async () => {
1554
- try {
1555
- await clearRemoteCheckpoints();
1556
- } catch (error) {
1557
- debugState.lastError = toErrorMessage(error);
1558
- await currentConfig.onError(error);
1559
- }
1560
- });
1561
- }
1562
1551
  function useDebugSession() {
1563
1552
  const snapshot = (0, import_valtio2.useSnapshot)(debugState);
1564
1553
  return {
@@ -1995,13 +1984,13 @@ async function terminateCurrentScenario() {
1995
1984
  await executePluginCommand("scenario", {
1996
1985
  subCommand: "terminateStory"
1997
1986
  });
1998
- clearDebugSessionRuntimeState();
1987
+ await clearLocalDebugSessionRuntimeState();
1999
1988
  } catch (error) {
2000
1989
  console.error("Failed to terminate scenario:", error);
2001
1990
  }
2002
1991
  }
2003
1992
  async function startScenarioSession(session, config) {
2004
- clearDebugSessionRuntimeState();
1993
+ await clearLocalDebugSessionRuntimeState();
2005
1994
  for (const story of config.stories) {
2006
1995
  if (!isCurrentScenarioSession(session)) return;
2007
1996
  try {
package/dist/lib.mjs CHANGED
@@ -1202,6 +1202,11 @@ async function settleActiveWarp(error) {
1202
1202
  activeWarp = null;
1203
1203
  }, error);
1204
1204
  }
1205
+ async function clearLocalDebugSessionRuntimeState() {
1206
+ await settleActiveFastForward(new Error("Debug session runtime state cleared"));
1207
+ await settleActiveWarp(new Error("Debug session runtime state cleared"));
1208
+ clearLocalRuntimeState();
1209
+ }
1205
1210
  async function clearRemoteCheckpoints() {
1206
1211
  await executeScenarioCommand({ subCommand: "clearCheckpoints" });
1207
1212
  }
@@ -1531,22 +1536,6 @@ async function stopDebugSession() {
1531
1536
  debugState.active = false;
1532
1537
  clearLocalRuntimeState();
1533
1538
  }
1534
- function clearDebugSessionRuntimeState() {
1535
- clearLocalRuntimeState();
1536
- void settleActiveFastForward(new Error("Debug session runtime state cleared"));
1537
- void settleActiveWarp(new Error("Debug session runtime state cleared"));
1538
- if (!debugState.active) {
1539
- return;
1540
- }
1541
- void enqueueDebugOperation(async () => {
1542
- try {
1543
- await clearRemoteCheckpoints();
1544
- } catch (error) {
1545
- debugState.lastError = toErrorMessage(error);
1546
- await currentConfig.onError(error);
1547
- }
1548
- });
1549
- }
1550
1539
  function useDebugSession() {
1551
1540
  const snapshot = useSnapshot2(debugState);
1552
1541
  return {
@@ -1983,13 +1972,13 @@ async function terminateCurrentScenario() {
1983
1972
  await executePluginCommand("scenario", {
1984
1973
  subCommand: "terminateStory"
1985
1974
  });
1986
- clearDebugSessionRuntimeState();
1975
+ await clearLocalDebugSessionRuntimeState();
1987
1976
  } catch (error) {
1988
1977
  console.error("Failed to terminate scenario:", error);
1989
1978
  }
1990
1979
  }
1991
1980
  async function startScenarioSession(session, config) {
1992
- clearDebugSessionRuntimeState();
1981
+ await clearLocalDebugSessionRuntimeState();
1993
1982
  for (const story of config.stories) {
1994
1983
  if (!isCurrentScenarioSession(session)) return;
1995
1984
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momoyu-ink/kit",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Software Development Kit of Moyu Visual Novel Engine",
5
5
  "main": "dist/lib.cjs",
6
6
  "module": "dist/lib.mjs",