@volter/world 3.0.99 → 3.0.100

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.
@@ -1,5 +1,5 @@
1
1
  import { rebaseChangeset, worldBootMarker, type Changeset, type LedgerDelta, type TwinAction, type WorldMarker, type ApplyReceipt, applyTwinWrite, type TwinResource } from '@volter/world-core/runtime';
2
- import { approveWorldChangeset, createWorldChangeset, downWorld, fetchFromOrigin, pushWorldChangeset, rebaseWorldChangeset, replayWorldChangeset, resetWorld, seedWorld, statusWorldChangeset, verifyWorldChangeset, type ServedWorld, type ViewConsole, type WorldView, rootCredentialInput, type DeployTwinOutcome, type ChangesetLocation, type InitOptions, type InitResult, type WorldInstance } from '@volter/world-runtime';
2
+ import { approveWorldChangeset, createWorldChangeset, downWorld, fetchFromOrigin, pushWorldChangeset, rebaseWorldChangeset, replayWorldChangeset, resetWorld, seedWorld, statusWorld, statusWorldChangeset, verifyWorldChangeset, type ServedWorld, type ViewConsole, type WorldView, rootCredentialInput, type DeployTwinOutcome, type ChangesetLocation, type InitOptions, type InitResult, type WorldInstance } from '@volter/world-runtime';
3
3
  import { rebaseBranch, type Receipt, type RootConfig } from '@volter/world-core/runtime';
4
4
  export type WorldRef = {
5
5
  name?: string;
@@ -119,10 +119,7 @@ export declare class World {
119
119
  /** A subshell with the world active; resolves to its exit code. */
120
120
  shell(): Promise<number>;
121
121
  /** The kernel's instance record, or null before the first `up`. */
122
- instance(): (WorldInstance & {
123
- running: boolean;
124
- livePids: number[];
125
- }) | null;
122
+ instance(): ReturnType<typeof statusWorld> | null;
126
123
  /** The world, the branch, the origin, what is unpushed, what is running. */
127
124
  status(): WorldStatus;
128
125
  /** One twin log per twin the world runs: its branch entries and what is unpushed. */
package/dist/src/world.js CHANGED
@@ -163,8 +163,10 @@ export class World {
163
163
  const changesets = instance ? this.changesets() : [];
164
164
  const services = {};
165
165
  if (instance)
166
- for (const [id, s] of Object.entries(instance.services))
167
- services[id] = { ...(s.url ? { url: s.url } : {}), running: s.type === 'external' || instance.livePids.includes(s.pid), ...(s.protocol ? { protocol: { major: s.protocol.major, standing: s.protocol.standing } } : {}) };
166
+ for (const [id, s] of Object.entries(instance.services)) {
167
+ const state = instance.serviceStates[id];
168
+ services[id] = { ...(s.url ? { url: s.url } : {}), running: state === 'running' || state === 'lingering' || state === 'external' && instance.running, ...(s.protocol ? { protocol: { major: s.protocol.major, standing: s.protocol.standing } } : {}) };
169
+ }
168
170
  return {
169
171
  world: this.name, root: this.root, branch: this.name,
170
172
  branches: listWorlds(this.root).map((w) => w.name).sort(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world",
3
- "version": "3.0.99",
3
+ "version": "3.0.100",
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,12 +30,12 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@modelcontextprotocol/sdk": "^1.30.1",
33
- "@volter/world-core": "3.0.99",
34
- "@volter/world-runtime": "3.0.99",
33
+ "@volter/world-core": "3.0.100",
34
+ "@volter/world-runtime": "3.0.100",
35
35
  "zod": "^4.6.5"
36
36
  },
37
37
  "peerDependencies": {
38
- "@volter/world-console": "3.0.94"
38
+ "@volter/world-console": "3.0.95"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@volter/world-console": {
@@ -43,7 +43,7 @@
43
43
  }
44
44
  },
45
45
  "devDependencies": {
46
- "@volter/world-console": "3.0.94"
46
+ "@volter/world-console": "3.0.95"
47
47
  },
48
48
  "bin": {
49
49
  "volter": "dist/src/cli.js"
package/src/world.ts CHANGED
@@ -161,7 +161,7 @@ export class World {
161
161
  shell(): Promise<number> { return shellWorld(this.name, this.root); }
162
162
 
163
163
  /** The kernel's instance record, or null before the first `up`. */
164
- instance(): (WorldInstance & { running: boolean; livePids: number[] }) | null {
164
+ instance(): ReturnType<typeof statusWorld> | null {
165
165
  try { return statusWorld(this.name, this.root); } catch { return null; }
166
166
  }
167
167
  /** The world, the branch, the origin, what is unpushed, what is running. */
@@ -169,7 +169,10 @@ export class World {
169
169
  const instance = this.instance();
170
170
  const changesets = instance ? this.changesets() : [];
171
171
  const services: WorldStatus['services'] = {};
172
- if (instance) for (const [id, s] of Object.entries(instance.services)) services[id] = { ...(s.url ? { url: s.url } : {}), running: s.type === 'external' || instance.livePids.includes(s.pid), ...(s.protocol ? { protocol: { major: s.protocol.major, standing: s.protocol.standing } } : {}) };
172
+ if (instance) for (const [id, s] of Object.entries(instance.services)) {
173
+ const state = instance.serviceStates[id];
174
+ services[id] = { ...(s.url ? { url: s.url } : {}), running: state === 'running' || state === 'lingering' || state === 'external' && instance.running, ...(s.protocol ? { protocol: { major: s.protocol.major, standing: s.protocol.standing } } : {}) };
175
+ }
173
176
  return {
174
177
  world: this.name, root: this.root, branch: this.name,
175
178
  branches: listWorlds(this.root).map((w) => w.name).sort(),