@volter/world-runtime 2.0.55 → 3.0.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.
Files changed (121) hide show
  1. package/dist/known-external-services.json +5 -4
  2. package/dist/src/actions-runner-cli.d.ts +2 -0
  3. package/dist/src/actions-runner-cli.js +25 -0
  4. package/dist/src/actions-runner.d.ts +18 -0
  5. package/dist/src/actions-runner.js +281 -0
  6. package/dist/src/ancestry.js +1 -1
  7. package/dist/src/app-url.js +1 -1
  8. package/dist/src/backings.d.ts +29 -0
  9. package/dist/src/backings.js +45 -0
  10. package/dist/src/branch.js +3 -2
  11. package/dist/src/browser-proxy-cli.js +1 -1
  12. package/dist/src/catalog-index.d.ts +38 -0
  13. package/dist/src/catalog-index.js +37 -0
  14. package/dist/src/catalog.d.ts +16 -3
  15. package/dist/src/catalog.js +69 -26
  16. package/dist/src/changeset.d.ts +1 -1
  17. package/dist/src/changeset.js +9 -11
  18. package/dist/src/cli-args.d.ts +4 -0
  19. package/dist/src/cli-args.js +18 -0
  20. package/dist/src/cli-commands.d.ts +1 -0
  21. package/dist/src/cli-commands.js +1216 -0
  22. package/dist/src/cli.js +8 -1300
  23. package/dist/src/configs.js +1 -1
  24. package/dist/src/console-apart.d.ts +2 -2
  25. package/dist/src/console-apart.js +5 -5
  26. package/dist/src/consumers.js +1 -1
  27. package/dist/src/covers.d.ts +1 -1
  28. package/dist/src/covers.js +94 -30
  29. package/dist/src/env-output.d.ts +1 -1
  30. package/dist/src/env-output.js +2 -2
  31. package/dist/src/fixture-env.js +18 -26
  32. package/dist/src/host-cli.js +4 -2
  33. package/dist/src/host-fault-fixture.js +6 -0
  34. package/dist/src/host-ready.d.ts +8 -2
  35. package/dist/src/host-ready.js +16 -4
  36. package/dist/src/host-worker.js +6 -1
  37. package/dist/src/host.d.ts +2 -0
  38. package/dist/src/host.js +9 -1
  39. package/dist/src/index.d.ts +2 -2
  40. package/dist/src/index.js +2 -2
  41. package/dist/src/init.d.ts +33 -23
  42. package/dist/src/init.js +228 -96
  43. package/dist/src/lifecycle-record.js +2 -2
  44. package/dist/src/local-branches.js +1 -1
  45. package/dist/src/origin.d.ts +1 -1
  46. package/dist/src/origin.js +12 -10
  47. package/dist/src/pack-facts.d.ts +30 -6
  48. package/dist/src/pack-facts.js +13 -3
  49. package/dist/src/pglite-backing.js +2 -1
  50. package/dist/src/placeholder.d.ts +1 -1
  51. package/dist/src/placeholder.js +12 -4
  52. package/dist/src/project-inspect.d.ts +1 -1
  53. package/dist/src/project-inspect.js +2 -2
  54. package/dist/src/redirect-proxy.d.ts +5 -0
  55. package/dist/src/redirect-proxy.js +8 -1
  56. package/dist/src/redis-backing.js +4 -2
  57. package/dist/src/reflect.js +1 -1
  58. package/dist/src/root.d.ts +11 -33
  59. package/dist/src/root.js +28 -59
  60. package/dist/src/runtime-test-support.js +1 -1
  61. package/dist/src/runtime.d.ts +7 -1
  62. package/dist/src/runtime.js +317 -53
  63. package/dist/src/schema.d.ts +27 -5
  64. package/dist/src/schema.js +13 -12
  65. package/dist/src/served-world.d.ts +11 -35
  66. package/dist/src/served-world.js +54 -141
  67. package/dist/src/tail.js +1 -1
  68. package/dist/src/up-cli.d.ts +3 -0
  69. package/dist/src/up-cli.js +55 -0
  70. package/dist/src/websocket-relay.d.ts +1 -1
  71. package/dist/src/world-origins.d.ts +1 -1
  72. package/dist/src/world-origins.js +1 -1
  73. package/dist/src/world-view.d.ts +1 -1
  74. package/dist/src/world-view.js +2 -2
  75. package/known-external-services.json +5 -4
  76. package/package.json +11 -11
  77. package/src/actions-runner-cli.ts +24 -0
  78. package/src/actions-runner.ts +244 -0
  79. package/src/ancestry.ts +1 -1
  80. package/src/app-url.ts +1 -1
  81. package/src/backings.ts +55 -0
  82. package/src/branch.ts +3 -2
  83. package/src/browser-proxy-cli.ts +1 -1
  84. package/src/catalog-index.ts +44 -0
  85. package/src/catalog.ts +67 -24
  86. package/src/changeset.ts +10 -13
  87. package/src/cli-args.ts +17 -0
  88. package/src/cli-commands.ts +1070 -0
  89. package/src/cli.ts +9 -1139
  90. package/src/configs.ts +1 -1
  91. package/src/console-apart.ts +5 -5
  92. package/src/consumers.ts +1 -1
  93. package/src/covers.ts +83 -30
  94. package/src/env-output.ts +2 -2
  95. package/src/fixture-env.ts +18 -26
  96. package/src/host-cli.ts +4 -2
  97. package/src/host-ready.ts +13 -4
  98. package/src/host-worker.ts +6 -2
  99. package/src/host.ts +11 -2
  100. package/src/index.ts +2 -2
  101. package/src/init.ts +222 -101
  102. package/src/lifecycle-record.ts +2 -2
  103. package/src/local-branches.ts +1 -1
  104. package/src/origin.ts +12 -10
  105. package/src/pack-facts.ts +22 -6
  106. package/src/pglite-backing.ts +2 -1
  107. package/src/placeholder.ts +13 -4
  108. package/src/project-inspect.ts +2 -2
  109. package/src/redirect-proxy.ts +9 -1
  110. package/src/redis-backing.ts +4 -2
  111. package/src/reflect.ts +1 -1
  112. package/src/root.ts +33 -65
  113. package/src/runtime-test-support.ts +1 -1
  114. package/src/runtime.ts +261 -55
  115. package/src/schema.ts +26 -13
  116. package/src/served-world.ts +50 -130
  117. package/src/tail.ts +1 -1
  118. package/src/up-cli.ts +55 -0
  119. package/src/websocket-relay.ts +1 -1
  120. package/src/world-origins.ts +1 -1
  121. package/src/world-view.ts +3 -3
@@ -8,7 +8,9 @@ export type InitWiring =
8
8
  | 'app-read'
9
9
  /** no injector entry and no endpoint env: the SDK is pointed at the twin by explicit client config */
10
10
  | 'explicit-config'
11
- /** detected vendor with no `packages/twin/<vendor>` pack in the catalog — nothing to emit */
11
+ /** the vendor's own open-source server runs as the World's service (VENDOR_SERVER_BACKINGS) */
12
+ | 'backing'
13
+ /** detected vendor with no vendor pack in the catalog — nothing to emit */
12
14
  | 'no-pack';
13
15
  export type InitVendorPlan = {
14
16
  vendor: string;
@@ -21,17 +23,30 @@ export type InitVendorPlan = {
21
23
  service: WorldServiceConfig | null;
22
24
  /** why this wiring — printed in the report and embedded in the service's `//` note */
23
25
  note: string;
26
+ /** the source init chose the pack from (architecture, "The catalog: where twins come from"): where it comes from, its
27
+ * protocol and its version */
28
+ source?: {
29
+ kind: 'checkout' | 'installed';
30
+ version?: string;
31
+ };
24
32
  };
25
33
  /** What `init` did with one env NAME found in the repo's example env files. */
26
34
  export type EnvDisposition =
27
35
  /** credential-shaped → replaced by a structurally valid fake (never the committed value) */
28
36
  'faked'
37
+ /** a credential the vendor's twin issues at boot → `$issue:<vendor>` (the twin refuses a key it did not make) */
38
+ | 'issued'
29
39
  /** non-credential app config → the example value copied verbatim */
30
40
  | 'kept'
31
41
  /** infra connection string → points at a World-managed infrastructure service */
32
42
  | 'compose'
33
43
  /** infra connection string → a documented placeholder the operator fills in */
34
44
  | 'placeholder'
45
+ /** the application's own origin → `$app-url`, the address its booter records, resolved when it attaches */
46
+ | 'app-origin'
47
+ /** a detected vendor's endpoint pointed at a local stand-in server (a garage or MinIO for S3) → left unset, so the SDK
48
+ * addresses the vendor's own host, which the World routes to its twin */
49
+ | 'stand-in'
35
50
  /** neither credential-shaped nor valued: the operator has to decide */
36
51
  | 'unknown';
37
52
  export type InitEnvRow = {
@@ -114,10 +129,12 @@ export type InitPlan = {
114
129
  }>;
115
130
  /** pack `defaults/` files copied into the world dir (TWIN-PROGRAMMING-MODEL: default
116
131
  * reasonable — visible starter seeds/handlers, ownership transfers on copy). */
132
+ /** `from` is copied byte for byte; `content` (a runner init writes for a protocol-3 pack's seed data) is written as given. */
117
133
  defaultsCopies: Array<{
118
134
  vendor: string;
119
- kind: 'handlers' | 'seed';
120
- from: string;
135
+ kind: 'handlers' | 'seed' | 'seed-data';
136
+ from?: string;
137
+ content?: string;
121
138
  to: string;
122
139
  }>;
123
140
  /** emitted when any pack ships a default seed: the one explicit entry point + story skeleton */
@@ -158,7 +175,7 @@ export type InitResult = {
158
175
  };
159
176
  export type InitOptions = {
160
177
  /** the WORLD root: where the emitted config boots from, and where the catalog is resolved —
161
- * this checkout's `packages/twin` when init runs here, else the `@volter/twin-<vendor>`
178
+ * the sibling pack repository when init runs here, else the `@volter/twin-<vendor>`
162
179
  * packages installed above it (docs/concepts/worlds.md#the-config-and-the-running-world). Defaults to the
163
180
  * application repo. */
164
181
  root?: string;
@@ -173,39 +190,29 @@ export type InitOptions = {
173
190
  bare?: string;
174
191
  };
175
192
  /** The twins available at `root`, sorted — a deterministic input (catalog.ts: this checkout's
176
- * `packages/twin/<vendor>/` dirs, or the `@volter/twin-<vendor>` packages installed above root). */
193
+ * vendor directories in the pack repository, or the `@volter/twin-<vendor>` packages installed above root). */
177
194
  export declare function packCatalog(root: string): string[];
178
195
  /**
179
- * The REAL endpoint env names for packs the injector cannot intercept — the other half of
180
- * `scripts/vendor-hosts.test.ts`'s descriptor hostsNone ruling. That allowlist states WHY each pack
181
- * has no VENDOR_HOSTS entry; this table states WHAT to wire instead, using the env var the vendor's
182
- * own SDK documents. Every entry is grounded in the SDK, not invented:
183
- *
184
- * inngest `INNGEST_BASE_URL` (+ `INNGEST_EVENT_API_BASE_URL` for the event API)
185
- * — inngest@4's own apiBaseUrl/eventBaseUrl getters.
186
- * ai-gateway `AI_GATEWAY_BASE_URL` — `@ai-sdk/gateway`'s baseURL env.
187
- * livekit `LIVEKIT_URL` as a ws:// template — the media plane is a WebSocket
188
- * URL the SDK takes as its first constructor argument.
189
- *
190
- * A pack that is base-URL-configurable but has NO conventional env var (algolia, pinecone,
191
- * replicate, fal, twilio, sendblue, figma, notion) is deliberately ABSENT: it gets a service
192
- * with no endpoint env at all, and the proof reports it UNINTERCEPTABLE. Inventing a
193
- * `<VENDOR>_BASE_URL` for it would make `covers` call the world covered (any app-read env counts)
194
- * while the app, which reads no such var, still talks to the real vendor — the exact class of lie
195
- * the proof exists to catch.
196
+ * The endpoint env for a pack the injector cannot intercept and whose descriptor cannot state it as `endpointEnv`
197
+ * (which receives the twin's URL): a raw protocol, whose client is pointed by host and port. Every name is one a real
198
+ * client documents. A pack with no such env is absent: it gets a service with no endpoint env at all, and the proof
199
+ * reports it UNINTERCEPTABLE. Inventing a `<VENDOR>_BASE_URL` for it would make `covers` call the world covered while
200
+ * the app, which reads no such var, still talks to the real vendor.
196
201
  */
197
202
  export declare const APP_READ_ENDPOINT_ENV: Record<string, {
198
203
  injectEnv?: string;
199
204
  injectEnvTemplates?: Record<string, string>;
200
205
  note: string;
201
206
  }>;
207
+ export { VENDOR_SERVER_BACKINGS } from './backings.js';
202
208
  /** Render the private managed-infrastructure definition — deterministic, with no absolute paths.
203
209
  * Only meaningful when `plan.compose` is non-empty (writeWorldInit skips it otherwise). */
204
210
  export declare function renderComposeFile(plan: InitPlan): string;
205
211
  export type ParsedEnvEntry = {
206
212
  name: string;
207
213
  value: string;
208
- source: string;
214
+ source: string; /** several dirs define it differently: each `source=value` */
215
+ conflict?: string[];
209
216
  };
210
217
  /** Parse one dotenv-ish file into ordered NAME/value pairs. Deliberately conservative: the same
211
218
  * `NAME=` line shape `projectEnvNames` detects, plus quote stripping, so the two views of a repo's
@@ -224,6 +231,9 @@ export declare const STATE_GITIGNORE = "# Volter: the world's running state and
224
231
  export declare function writeWorldInit(plan: InitPlan, options?: {
225
232
  force?: boolean;
226
233
  }): void;
234
+ /** The runner of a protocol-3 pack's default data (its `src/semantics/seed.ts`, copied beside it as `<vendor>.data.ts`):
235
+ * each call, in order, against the twin at its `<VENDOR>_TWIN_URL`, a refusal stopping the seed with the twin's answer. */
236
+ export declare function seedCallsRunner(vendor: string): string;
227
237
  /**
228
238
  * Plan, emit, and PROVE. The coverage proof runs against the just-written config (by path, so it
229
239
  * reads exactly the bytes on disk rather than the in-memory plan) — `ok` is the proof's verdict and