@volter/world-runtime 3.0.38 → 3.0.40

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.
Files changed (168) hide show
  1. package/dist/known-external-services.json +3 -10
  2. package/dist/src/actions-runner-cli.js +3 -3
  3. package/dist/src/actions-runner.js +2 -1
  4. package/dist/src/app-url.js +2 -1
  5. package/dist/src/backings.d.ts +10 -1
  6. package/dist/src/backings.js +66 -7
  7. package/dist/src/branch.js +85 -52
  8. package/dist/src/browser-routes.cjs +59 -0
  9. package/dist/src/ca-trust.js +4 -3
  10. package/dist/src/changeset.js +4 -3
  11. package/dist/src/cli-commands.js +25 -9
  12. package/dist/src/cli.js +2 -1
  13. package/dist/src/command-lifetime.d.mts +12 -0
  14. package/dist/src/command-lifetime.d.ts +1 -15
  15. package/dist/src/command-lifetime.js +1 -98
  16. package/dist/src/command-lifetime.mjs +90 -0
  17. package/dist/src/configs.js +1 -1
  18. package/dist/src/console-apart.js +3 -2
  19. package/dist/src/covers.d.ts +3 -2
  20. package/dist/src/covers.js +95 -18
  21. package/dist/src/error-message.d.mts +1 -0
  22. package/dist/src/error-message.d.ts +1 -0
  23. package/dist/src/error-message.js +2 -0
  24. package/dist/src/error-message.mjs +10 -0
  25. package/dist/src/guest-command.d.mts +4 -0
  26. package/dist/src/guest-command.mjs +26 -0
  27. package/dist/src/guest-control.d.mts +1 -0
  28. package/dist/src/guest-control.mjs +17 -0
  29. package/dist/src/guest-entry.mjs +146 -0
  30. package/dist/src/guest-processes.d.mts +9 -0
  31. package/dist/src/guest-processes.mjs +47 -0
  32. package/dist/src/guest-runner.d.ts +6 -0
  33. package/dist/src/guest-runner.js +567 -0
  34. package/dist/src/host.js +5 -4
  35. package/dist/src/index.d.ts +1 -0
  36. package/dist/src/index.js +1 -0
  37. package/dist/src/infra-cli.js +4 -0
  38. package/dist/src/infra.js +133 -23
  39. package/dist/src/init.js +60 -23
  40. package/dist/src/lifecycle-record.d.ts +3 -1
  41. package/dist/src/lifecycle-record.js +29 -6
  42. package/dist/src/livekit-backing.mjs +37 -0
  43. package/dist/src/local-branches.js +11 -3
  44. package/dist/src/mongodb-backing.d.ts +7 -0
  45. package/dist/src/mongodb-backing.js +58 -0
  46. package/dist/src/native-postgres-backing.d.ts +4 -0
  47. package/dist/src/native-postgres-backing.js +404 -0
  48. package/dist/src/origin.js +2 -1
  49. package/dist/src/owned-path.d.ts +4 -0
  50. package/dist/src/owned-path.js +37 -0
  51. package/dist/src/pack-facts.d.ts +1 -0
  52. package/dist/src/pglite-backing.d.ts +4 -13
  53. package/dist/src/pglite-backing.js +198 -106
  54. package/dist/src/pglite-host.mjs +47 -17
  55. package/dist/src/placeholder.d.ts +3 -2
  56. package/dist/src/placeholder.js +9 -4
  57. package/dist/src/process-groups.d.mts +2 -0
  58. package/dist/src/process-groups.d.ts +1 -4
  59. package/dist/src/process-groups.js +1 -49
  60. package/dist/src/process-groups.mjs +59 -0
  61. package/dist/src/process-receipt.d.mts +6 -0
  62. package/dist/src/process-receipt.d.ts +11 -0
  63. package/dist/src/process-receipt.js +3 -0
  64. package/dist/src/process-receipt.mjs +45 -0
  65. package/dist/src/process-signal.d.mts +9 -0
  66. package/dist/src/process-signal.mjs +92 -0
  67. package/dist/src/project-inspect.d.ts +1 -1
  68. package/dist/src/project-inspect.js +4 -2
  69. package/dist/src/proxy-daemon.js +2 -1
  70. package/dist/src/redirect-proxy.js +186 -19
  71. package/dist/src/redis-backing.js +99 -35
  72. package/dist/src/reflect.js +2 -1
  73. package/dist/src/root.js +7 -6
  74. package/dist/src/run-task-worker.js +2 -1
  75. package/dist/src/runtime.d.ts +24 -7
  76. package/dist/src/runtime.js +703 -286
  77. package/dist/src/schema.d.ts +12 -1
  78. package/dist/src/schema.js +20 -5
  79. package/dist/src/served-world.d.ts +1 -0
  80. package/dist/src/served-world.js +26 -14
  81. package/dist/src/service-recorder.js +8 -3
  82. package/dist/src/signals.d.mts +1 -0
  83. package/dist/src/signals.d.ts +1 -1
  84. package/dist/src/signals.js +1 -11
  85. package/dist/src/signals.mjs +10 -0
  86. package/dist/src/tail.d.ts +2 -0
  87. package/dist/src/tail.js +9 -2
  88. package/dist/src/tcp-port.js +27 -13
  89. package/dist/src/temporal-backing.mjs +28 -0
  90. package/dist/src/up-cli.js +8 -3
  91. package/dist/src/up-task-worker.js +2 -1
  92. package/dist/src/websocket-relay.d.ts +1 -1
  93. package/dist/src/websocket-relay.js +23 -10
  94. package/dist/src/world-view.js +2 -2
  95. package/known-external-services.json +3 -10
  96. package/package.json +12 -7
  97. package/src/actions-runner-cli.ts +3 -3
  98. package/src/actions-runner.ts +2 -1
  99. package/src/app-url.ts +2 -1
  100. package/src/backings.ts +65 -7
  101. package/src/branch.ts +73 -34
  102. package/src/browser-routes.cjs +59 -0
  103. package/src/ca-trust.ts +4 -3
  104. package/src/changeset.ts +4 -3
  105. package/src/cli-commands.ts +21 -9
  106. package/src/cli.ts +2 -1
  107. package/src/command-lifetime.d.mts +12 -0
  108. package/src/command-lifetime.mjs +90 -0
  109. package/src/command-lifetime.ts +1 -79
  110. package/src/configs.ts +1 -1
  111. package/src/console-apart.ts +2 -1
  112. package/src/covers.ts +97 -19
  113. package/src/error-message.d.mts +1 -0
  114. package/src/error-message.mjs +10 -0
  115. package/src/error-message.ts +2 -0
  116. package/src/guest-command.d.mts +4 -0
  117. package/src/guest-command.mjs +26 -0
  118. package/src/guest-control.d.mts +1 -0
  119. package/src/guest-control.mjs +17 -0
  120. package/src/guest-entry.mjs +146 -0
  121. package/src/guest-processes.d.mts +9 -0
  122. package/src/guest-processes.mjs +47 -0
  123. package/src/guest-runner.ts +414 -0
  124. package/src/host.ts +5 -4
  125. package/src/index.ts +1 -0
  126. package/src/infra-cli.ts +4 -0
  127. package/src/infra.ts +103 -22
  128. package/src/init.ts +55 -22
  129. package/src/lifecycle-record.ts +21 -6
  130. package/src/livekit-backing.mjs +37 -0
  131. package/src/local-branches.ts +6 -3
  132. package/src/mongodb-backing.ts +55 -0
  133. package/src/native-postgres-backing.ts +329 -0
  134. package/src/origin.ts +2 -1
  135. package/src/owned-path.ts +32 -0
  136. package/src/pack-facts.ts +1 -0
  137. package/src/pglite-backing.ts +155 -79
  138. package/src/pglite-host.mjs +47 -17
  139. package/src/placeholder.ts +10 -5
  140. package/src/process-groups.d.mts +2 -0
  141. package/src/process-groups.mjs +59 -0
  142. package/src/process-groups.ts +1 -33
  143. package/src/process-receipt.d.mts +6 -0
  144. package/src/process-receipt.mjs +45 -0
  145. package/src/process-receipt.ts +5 -0
  146. package/src/process-signal.d.mts +9 -0
  147. package/src/process-signal.mjs +92 -0
  148. package/src/project-inspect.ts +4 -2
  149. package/src/proxy-daemon.ts +2 -1
  150. package/src/redirect-proxy.ts +153 -18
  151. package/src/redis-backing.ts +74 -25
  152. package/src/reflect.ts +2 -1
  153. package/src/root.ts +7 -6
  154. package/src/run-task-worker.ts +2 -1
  155. package/src/runtime.ts +596 -265
  156. package/src/schema.ts +30 -6
  157. package/src/served-world.ts +21 -15
  158. package/src/service-recorder.ts +4 -2
  159. package/src/signals.d.mts +1 -0
  160. package/src/signals.mjs +10 -0
  161. package/src/signals.ts +1 -10
  162. package/src/tail.ts +10 -3
  163. package/src/tcp-port.ts +24 -13
  164. package/src/temporal-backing.mjs +28 -0
  165. package/src/up-cli.ts +6 -3
  166. package/src/up-task-worker.ts +2 -1
  167. package/src/websocket-relay.ts +18 -11
  168. package/src/world-view.ts +2 -2
@@ -1,5 +1,7 @@
1
+ import type { SpawnIdentity } from './process-receipt.js';
2
+ import { type WorldNetwork } from '@volter/world-core/network-policy';
1
3
  import { type CaTrustInputs } from './ca-trust.js';
2
- import type { WorldInstance, WorldIsolation, WorldMode, WorldRunOutcome } from './schema.js';
4
+ import type { WorldInstance, WorldIsolation, WorldMode, WorldRunOutcome, WorldServiceConfig } from './schema.js';
3
5
  /** The World's events file: every service's start and end, and the World's own stops, one JSON line each. */
4
6
  export declare function worldEventsPath(logs: string): string;
5
7
  export type UpWorldOptions = {
@@ -19,6 +21,8 @@ export type UpWorldOptions = {
19
21
  * episodes survive the boot; logs and the pid file start clean. Never the default: `up` starts
20
22
  * clean, and the world dir is the reproducible story. */
21
23
  keepState?: boolean;
24
+ /** A branch's base permission: intersects both the config and the launching process. */
25
+ networkCeiling?: WorldNetwork;
22
26
  };
23
27
  export type ShareWorldOptions = {
24
28
  root?: string;
@@ -45,6 +49,8 @@ export type WorldDoctorReport = {
45
49
  checks: WorldDoctorCheck[];
46
50
  };
47
51
  export type RunWorldOptions = UpWorldOptions & {
52
+ /** the command's working directory: the caller's, as `attach` runs its command (default: the World's root) */
53
+ cwd?: string;
48
54
  keep?: boolean;
49
55
  verbose?: boolean;
50
56
  };
@@ -78,11 +84,20 @@ export declare function sharingClaimAlive(claim: SharingClaim): boolean;
78
84
  * run code that is not Volter's (a World's apps, a command attached to a World, a tunnel, a dependency install) are
79
85
  * given an environment without it. */
80
86
  export declare function withoutVaultSignIn<T extends Record<string, string | undefined>>(env: T): T;
87
+ /** The boot permission, never a fallback to a mutable config. */
88
+ export declare function recordedWorldNetwork(instance: WorldInstance): WorldNetwork | undefined;
89
+ /** A stopped receipt checks byte consistency before fields are read; it is not authentication. */
90
+ export declare function readWorldBootRecord(name: string, root: string): WorldInstance;
81
91
  export declare function admittedEnv(strip: string[] | undefined, env?: NodeJS.ProcessEnv): Record<string, string>;
82
92
  /** The names a twin of this World was to issue and did not (its door failed): kept out of every command's env, so a
83
93
  * caller's own value (a real key in their shell) never stands in for the credential the World meant to issue. */
84
94
  export declare const UNISSUED_ENV = "VOLTER_WORLD_UNISSUED";
85
95
  export declare function saveWorldInstance(instance: WorldInstance): void;
96
+ /** The environment an external service and its replacement infrastructure hosts run in. Shared with branching,
97
+ * so both use the boot's admission, service overrides, lifecycle context and control-plane egress rules. */
98
+ export declare function externalServiceEnv(service: WorldServiceConfig, paths: {
99
+ logs: string;
100
+ }, worldEnv: Record<string, string>, stripEnv?: string[]): NodeJS.ProcessEnv;
86
101
  /**
87
102
  * THE MANAGED-DATABASE BINDING (architecture.md, managed infrastructure: the data plane's declared exception): for a
88
103
  * twin whose pack declares `managedDatabase`, the URL of the World's own managed postgres — the service its
@@ -96,16 +111,20 @@ export declare function managedDatabaseFor(vendor: string, configPath: string |
96
111
  url: string;
97
112
  } | undefined;
98
113
  export declare function upWorld(configId: string, options?: UpWorldOptions, abort?: AbortSignal): Promise<WorldInstance>;
114
+ /** The same bounded, identity-checked retirement used by World down, for provider-owned groups.
115
+ * No caller may release a durable receipt when inspection or signal delivery is uncertain. */
116
+ export declare function retireOwnedProcessGroups(records: SpawnIdentity[], graceMs?: number): Promise<void>;
99
117
  export declare function downWorld(name: string, root?: string, options?: {
100
118
  graceMs?: number;
101
119
  purge?: boolean;
102
- expectedCreatedAt?: string;
120
+ expectedInstance?: string;
103
121
  }): Promise<{
104
122
  name: string;
105
123
  stopped: number[];
106
124
  escalated: number[];
107
125
  externalStopped: string[];
108
126
  externalErrors: string[];
127
+ externalAbandoned?: string[];
109
128
  notSignalled?: string[];
110
129
  purged?: string;
111
130
  }>;
@@ -149,17 +168,15 @@ export declare function shareWorldServices(name: string, options?: ShareWorldSer
149
168
  * services — SIGTERM, confirm dead (escalating to SIGKILL past the grace), and only THEN erase the
150
169
  * tunnel facts/pids. A best-effort SIGTERM with no confirmation can leave a `cloudflared` that
151
170
  * ignores SIGTERM serving the public URL forever while instance.json (and the pids file) say
152
- * nothing is shared — the exact "half-shared" state docs/concepts/worlds.md promises cannot exist. Stays
153
- * synchronous (via `killSurvivorsAfterGraceSync`) to match the existing signature/call sites
154
- * (the CLI does not await it). Returns the instance plus the tunnel pids that needed escalating,
171
+ * nothing is shared — the exact "half-shared" state docs/concepts/worlds.md promises cannot exist. Retirement awaits asynchronous birth verification. Returns the instance plus the tunnel pids that needed escalating,
155
172
  * for callers that want to report it. */
156
173
  export declare function unshareWorld(name: string, options?: {
157
174
  root?: string;
158
175
  service?: string;
159
176
  graceMs?: number;
160
- }): WorldInstance & {
177
+ }): Promise<WorldInstance & {
161
178
  escalated: number[];
162
- };
179
+ }>;
163
180
  export declare function doctorWorld(name: string, options?: {
164
181
  root?: string;
165
182
  verifyPublic?: boolean;