@volter/world-runtime 3.0.147 → 3.0.149

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.
@@ -48,7 +48,7 @@ import { loadWorldConfig, worldChangesetRules, writeWorldConfig } from "./config
48
48
  import { adaptersFor, credentialPath, credentialPayloadFrom, deployTwin, deployWorld, loadWorldChecks, twinSigningSecret, materializeRoots, refreshPosture, refreshTwin, rootForControlRoot, rewrapTwinCredentials, sealTwinCredential, sealedCredentialInfo, bindLegacyCredentials, setTwinRoot, spanMs } from "./root.js";
49
49
  import { describeActionFields } from '@volter/world-core/runtime';
50
50
  import { worldLedgers } from "./changeset.js";
51
- import { clockFile, downWorld, isWorldOrigin, listWorlds, readWorldBootRecord, statusWorld, upWorld } from "./runtime.js";
51
+ import { clockFile, downWorld, instanceDir, isWorldOrigin, listWorlds, readWorldBootRecord, statusWorld, upWorld } from "./runtime.js";
52
52
  import { assertChangesetRules } from "./schema.js";
53
53
  export const TOKEN_HEADER = 'x-volter-token';
54
54
  /** The header the injector carries a hosted World's token in (inject.cjs, VOLTER_TWINS_KEY). */
@@ -248,7 +248,7 @@ export async function mountWorld(name, opts = {}) {
248
248
  try {
249
249
  // A view resumes the same app, including the output it owns. Switching to the operator's
250
250
  // default output would strand the app output without an ownership record on the next up.
251
- const retained = listWorlds(worldRoot).some(w => w.name === name) ? readWorldBootRecord(name, worldRoot) : null;
251
+ const retained = getActiveWorldStore().read(join(instanceDir(worldRoot, name), 'instance.json')) !== null ? readWorldBootRecord(name, worldRoot) : null;
252
252
  booted = await upWorld(configRef, { name, root: worldRoot, keepState: true, ...(retained ? { envFile: retained.envFile } : {}) });
253
253
  // a root set in the config while the world was stopped reaches the twins' state now, where the deploy reads it
254
254
  materializeRoots(loadWorldConfig(configRef, worldRoot).config, booted.dirs.data, worldRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-runtime",
3
- "version": "3.0.147",
3
+ "version": "3.0.149",
4
4
  "description": "World configs for twins: boot named local runtimes, allocate ports, generate world.env/instance.json, and run apps against fake-key twin worlds.",
5
5
  "keywords": [
6
6
  "twin",
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "peerDependencies": {
73
73
  "@volter/world-core": "3.0.147",
74
- "@volter/world-console": "3.0.142"
74
+ "@volter/world-console": "3.0.143"
75
75
  },
76
76
  "dependencies": {
77
77
  "@electric-sql/pglite": "0.5.8",
@@ -51,7 +51,7 @@ import { loadWorldConfig, worldChangesetRules, writeWorldConfig } from './config
51
51
  import { adaptersFor, credentialPath, credentialPayloadFrom, deployTwin, deployWorld, loadWorldChecks, twinSigningSecret, materializeRoots, refreshPosture, refreshTwin, rootForControlRoot, rewrapTwinCredentials, sealTwinCredential, sealedCredentialInfo, bindLegacyCredentials, setTwinRoot, spanMs } from './root.ts';
52
52
  import { describeActionFields } from '@volter/world-core/runtime';
53
53
  import { worldLedgers } from './changeset.ts';
54
- import { clockFile, downWorld, isWorldOrigin, listWorlds, readWorldBootRecord, statusWorld, upWorld } from './runtime.ts';
54
+ import { clockFile, downWorld, instanceDir, isWorldOrigin, listWorlds, readWorldBootRecord, statusWorld, upWorld } from './runtime.ts';
55
55
  import { assertChangesetRules, type WorldChangesetRules, type WorldInstance } from './schema.ts';
56
56
 
57
57
  export const TOKEN_HEADER = 'x-volter-token';
@@ -256,7 +256,7 @@ export async function mountWorld(name: string, opts: { /** the platforms whose p
256
256
  try {
257
257
  // A view resumes the same app, including the output it owns. Switching to the operator's
258
258
  // default output would strand the app output without an ownership record on the next up.
259
- const retained = listWorlds(worldRoot).some(w => w.name === name) ? readWorldBootRecord(name, worldRoot) : null;
259
+ const retained = getActiveWorldStore().read(join(instanceDir(worldRoot, name), 'instance.json')) !== null ? readWorldBootRecord(name, worldRoot) : null;
260
260
  booted = await upWorld(configRef, { name, root: worldRoot, keepState: true, ...(retained ? { envFile: retained.envFile } : {}) });
261
261
  // a root set in the config while the world was stopped reaches the twins' state now, where the deploy reads it
262
262
  materializeRoots(loadWorldConfig(configRef, worldRoot).config, booted.dirs.data, worldRoot);