@volter/world 2.0.42 → 2.0.44
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/src/world.js +6 -3
- package/package.json +3 -3
- package/src/world.ts +5 -3
package/dist/src/world.js
CHANGED
|
@@ -392,6 +392,10 @@ export class World {
|
|
|
392
392
|
}
|
|
393
393
|
/** The remote a verb uses: the named one, else origin from world.json, else the instance's recorded origin. */
|
|
394
394
|
remote(name = 'origin') {
|
|
395
|
+
// an instance under another World's config (a runtime branch) has its own origin on its record, not in that config
|
|
396
|
+
const instance = name === 'origin' ? this.instance() : null;
|
|
397
|
+
if (instance && instance.name !== instance.config)
|
|
398
|
+
return instance.origin ? { url: instance.origin.url, namespace: instance.origin.namespace } : null;
|
|
395
399
|
const target = this.remotes()[name];
|
|
396
400
|
if (target)
|
|
397
401
|
return parseOriginUrl(target);
|
|
@@ -420,9 +424,8 @@ export class World {
|
|
|
420
424
|
return fetchFromOrigin(this.name, { root: this.root, url: origin.url, namespace: origin.namespace, key: opts.adminToken, full: true });
|
|
421
425
|
}
|
|
422
426
|
const key = requireToken(origin.url, opts.token);
|
|
423
|
-
// v2: a clone brings the served world's whole log in from position zero, and names it origin
|
|
424
|
-
//
|
|
425
|
-
this.addRemote('origin', url);
|
|
427
|
+
// v2: a clone brings the served world's whole log in from position zero, and names it origin (fetchFromOrigin
|
|
428
|
+
// records it, in world.json for the World the config is for); a world that has never run is booted first
|
|
426
429
|
if (!this.instance())
|
|
427
430
|
await this.up({ seed: false });
|
|
428
431
|
return fetchFromOrigin(this.name, { root: this.root, url: origin.url, namespace: origin.namespace, key, full: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.44",
|
|
4
4
|
"description": "Run your app against a world of twins. `World` and `Repo` — one method per verb: init, up, run, log, diff, reset, branch, checkout, clone, fetch, changeset, push — and the `volter` command, one client of them.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"volter",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.30.1",
|
|
33
|
-
"@volter/world-core": "2.0.
|
|
34
|
-
"@volter/world-runtime": "2.0.
|
|
33
|
+
"@volter/world-core": "2.0.23",
|
|
34
|
+
"@volter/world-runtime": "2.0.41",
|
|
35
35
|
"zod": "^4.6.5"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
package/src/world.ts
CHANGED
|
@@ -362,6 +362,9 @@ export class World {
|
|
|
362
362
|
}
|
|
363
363
|
/** The remote a verb uses: the named one, else origin from world.json, else the instance's recorded origin. */
|
|
364
364
|
remote(name = 'origin'): { url: string; namespace: string } | null {
|
|
365
|
+
// an instance under another World's config (a runtime branch) has its own origin on its record, not in that config
|
|
366
|
+
const instance = name === 'origin' ? this.instance() : null;
|
|
367
|
+
if (instance && instance.name !== instance.config) return instance.origin ? { url: instance.origin.url, namespace: instance.origin.namespace } : null;
|
|
365
368
|
const target = this.remotes()[name];
|
|
366
369
|
if (target) return parseOriginUrl(target);
|
|
367
370
|
if (name !== 'origin') return null;
|
|
@@ -387,9 +390,8 @@ export class World {
|
|
|
387
390
|
return fetchFromOrigin(this.name, { root: this.root, url: origin.url, namespace: origin.namespace, key: opts.adminToken, full: true });
|
|
388
391
|
}
|
|
389
392
|
const key = requireToken(origin.url, opts.token);
|
|
390
|
-
// v2: a clone brings the served world's whole log in from position zero, and names it origin
|
|
391
|
-
//
|
|
392
|
-
this.addRemote('origin', url);
|
|
393
|
+
// v2: a clone brings the served world's whole log in from position zero, and names it origin (fetchFromOrigin
|
|
394
|
+
// records it, in world.json for the World the config is for); a world that has never run is booted first
|
|
393
395
|
if (!this.instance()) await this.up({ seed: false });
|
|
394
396
|
return fetchFromOrigin(this.name, { root: this.root, url: origin.url, namespace: origin.namespace, key, full: true });
|
|
395
397
|
}
|