@volter/world-core 3.0.155 → 3.0.157

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 (150) hide show
  1. package/attach.cjs +2 -0
  2. package/capability-decision.cjs +6 -4
  3. package/dist/attach.cjs +2 -0
  4. package/dist/capability-decision.cjs +6 -4
  5. package/dist/generated/pack-facts.json +204 -4
  6. package/dist/inject.cjs +150 -86
  7. package/dist/network-policy.cjs +11 -1
  8. package/dist/network-policy.d.cts +1 -0
  9. package/dist/pack-facts.d.cts +3 -0
  10. package/dist/required-credential-transport.cjs +29 -0
  11. package/dist/required-credential-transport.d.cts +3 -0
  12. package/dist/src/actions.d.ts +15 -0
  13. package/dist/src/actions.js +82 -21
  14. package/dist/src/ancestry.d.ts +5 -4
  15. package/dist/src/ancestry.js +53 -28
  16. package/dist/src/blob-store.d.ts +16 -0
  17. package/dist/src/blob-store.js +76 -1
  18. package/dist/src/changeset.js +1 -1
  19. package/dist/src/clickhouse/compression.d.ts +28 -0
  20. package/dist/src/clickhouse/compression.js +281 -0
  21. package/dist/src/clickhouse/index.d.ts +1 -0
  22. package/dist/src/clickhouse/index.js +1 -0
  23. package/dist/src/derived-core.d.ts +84 -7
  24. package/dist/src/derived-core.js +336 -61
  25. package/dist/src/derived-real.js +97 -15
  26. package/dist/src/derived.d.ts +5 -0
  27. package/dist/src/derived.js +3 -0
  28. package/dist/src/executor.d.ts +7 -0
  29. package/dist/src/executor.js +15 -1
  30. package/dist/src/fork.js +1 -1
  31. package/dist/src/git/lfs.d.ts +13 -3
  32. package/dist/src/git/lfs.js +41 -9
  33. package/dist/src/grpc-wire.js +2 -1
  34. package/dist/src/h2.js +63 -10
  35. package/dist/src/head.d.ts +5 -0
  36. package/dist/src/head.js +15 -0
  37. package/dist/src/history.d.ts +1 -1
  38. package/dist/src/history.js +7 -7
  39. package/dist/src/index.d.ts +5 -1
  40. package/dist/src/index.js +6 -1
  41. package/dist/src/live/ingest.js +9 -13
  42. package/dist/src/live/rtmp.js +7 -5
  43. package/dist/src/live/segmenter.js +7 -1
  44. package/dist/src/log.d.ts +23 -3
  45. package/dist/src/log.js +160 -37
  46. package/dist/src/machines.js +5 -1
  47. package/dist/src/managed-go-programs.d.ts +55 -0
  48. package/dist/src/managed-go-programs.js +133 -0
  49. package/dist/src/managed-original-inputs.d.ts +101 -0
  50. package/dist/src/managed-original-inputs.js +125 -0
  51. package/dist/src/mongodb/client.d.ts +8 -0
  52. package/dist/src/mongodb/client.js +27 -0
  53. package/dist/src/mongodb/index.d.ts +2 -0
  54. package/dist/src/mongodb/index.js +5 -0
  55. package/dist/src/mongodb/stream.d.ts +97 -0
  56. package/dist/src/mongodb/stream.js +206 -0
  57. package/dist/src/observe.js +1 -1
  58. package/dist/src/pack-fetch.d.ts +6 -1
  59. package/dist/src/pack-fetch.js +69 -14
  60. package/dist/src/pack-paths.d.ts +2 -1
  61. package/dist/src/pack-paths.js +6 -1
  62. package/dist/src/packRegistry.d.ts +10 -14
  63. package/dist/src/packRegistry.js +2 -13
  64. package/dist/src/protocol.d.ts +13 -0
  65. package/dist/src/protocol.js +13 -0
  66. package/dist/src/redis/engine.d.ts +10 -4
  67. package/dist/src/redis/engine.js +103 -32
  68. package/dist/src/redis/member-storage.js +20 -8
  69. package/dist/src/redis/service-times.d.ts +25 -0
  70. package/dist/src/redis/service-times.js +87 -0
  71. package/dist/src/redis/stream.d.ts +2 -1
  72. package/dist/src/redis/stream.js +109 -20
  73. package/dist/src/resource-blob.d.ts +4 -0
  74. package/dist/src/resource-blob.js +8 -1
  75. package/dist/src/runtime-state.d.ts +11 -0
  76. package/dist/src/runtime-state.js +13 -0
  77. package/dist/src/runtime.d.ts +7 -5
  78. package/dist/src/runtime.js +7 -4
  79. package/dist/src/serve-http.d.ts +2 -0
  80. package/dist/src/serve-http.js +73 -6
  81. package/dist/src/serve.d.ts +10 -0
  82. package/dist/src/serve.js +43 -3
  83. package/dist/src/sockets.d.ts +4 -1
  84. package/dist/src/sockets.js +59 -6
  85. package/dist/src/storage.d.ts +2 -1
  86. package/dist/src/storage.js +6 -3
  87. package/dist/src/vendor-call.js +58 -0
  88. package/dist/src/world-boot.d.ts +1 -0
  89. package/dist/src/world-boot.js +6 -0
  90. package/dist/src/world-clock.js +6 -2
  91. package/dist/src/world-store.d.ts +122 -7
  92. package/dist/src/world-store.js +959 -103
  93. package/dist/src/xml.d.ts +30 -0
  94. package/dist/src/xml.js +74 -0
  95. package/generated/pack-facts.json +204 -4
  96. package/inject.cjs +150 -86
  97. package/network-policy.cjs +11 -1
  98. package/network-policy.d.cts +1 -0
  99. package/pack-facts.d.cts +3 -0
  100. package/package.json +27 -1
  101. package/required-credential-transport.cjs +29 -0
  102. package/required-credential-transport.d.cts +3 -0
  103. package/src/actions.ts +78 -21
  104. package/src/ancestry.ts +46 -24
  105. package/src/blob-store.ts +59 -1
  106. package/src/changeset.ts +1 -1
  107. package/src/clickhouse/compression.ts +172 -0
  108. package/src/clickhouse/index.ts +2 -0
  109. package/src/derived-core.ts +356 -61
  110. package/src/derived-real.ts +80 -14
  111. package/src/derived.ts +9 -1
  112. package/src/executor.ts +17 -3
  113. package/src/fork.ts +1 -1
  114. package/src/git/lfs.ts +40 -9
  115. package/src/grpc-wire.ts +2 -1
  116. package/src/h2.ts +46 -5
  117. package/src/head.ts +15 -0
  118. package/src/history.ts +7 -7
  119. package/src/index.ts +7 -1
  120. package/src/live/ingest.ts +7 -3
  121. package/src/live/rtmp.ts +7 -5
  122. package/src/live/segmenter.ts +7 -1
  123. package/src/log.ts +147 -32
  124. package/src/machines.ts +5 -1
  125. package/src/managed-go-programs.ts +146 -0
  126. package/src/managed-original-inputs.ts +163 -0
  127. package/src/mongodb/client.ts +27 -0
  128. package/src/mongodb/index.ts +5 -0
  129. package/src/mongodb/stream.ts +223 -0
  130. package/src/observe.ts +1 -1
  131. package/src/pack-fetch.ts +66 -16
  132. package/src/pack-paths.ts +5 -1
  133. package/src/packRegistry.ts +3 -15
  134. package/src/protocol.ts +13 -0
  135. package/src/redis/engine.ts +100 -57
  136. package/src/redis/member-storage.ts +17 -9
  137. package/src/redis/service-times.ts +81 -0
  138. package/src/redis/stream.ts +66 -14
  139. package/src/resource-blob.ts +9 -1
  140. package/src/runtime-state.ts +14 -0
  141. package/src/runtime.ts +10 -3
  142. package/src/serve-http.ts +65 -6
  143. package/src/serve.ts +45 -3
  144. package/src/sockets.ts +39 -8
  145. package/src/storage.ts +5 -3
  146. package/src/vendor-call.ts +54 -0
  147. package/src/world-boot.ts +6 -0
  148. package/src/world-clock.ts +6 -2
  149. package/src/world-store.ts +768 -91
  150. package/src/xml.ts +71 -0
@@ -0,0 +1,30 @@
1
+ export type XmlElement = {
2
+ kind: 'element';
3
+ name: string;
4
+ attributes: Record<string, string>;
5
+ content: XmlContent[];
6
+ };
7
+ export type XmlText = {
8
+ kind: 'text' | 'cdata' | 'comment';
9
+ value: string;
10
+ };
11
+ export type XmlInstruction = {
12
+ kind: 'processing-instruction';
13
+ target: string;
14
+ value: string;
15
+ };
16
+ export type XmlContent = XmlElement | XmlText | XmlInstruction;
17
+ export type XmlDocument = {
18
+ root: XmlElement;
19
+ prologue: Array<XmlText | XmlInstruction>;
20
+ epilogue: Array<XmlText | XmlInstruction>;
21
+ };
22
+ export declare class XmlDocumentError extends Error {
23
+ readonly code: 'parser-unavailable' | 'unsupported-declaration' | 'malformed-document' | 'parsing-limit';
24
+ constructor(code: 'parser-unavailable' | 'unsupported-declaration' | 'malformed-document' | 'parsing-limit');
25
+ }
26
+ /** No I/O, globals, vendor names, defaults or recovery. Importing this module does not load the grammar.
27
+ * The XML declaration is a processing instruction in the prologue. A leading BOM is refused.
28
+ * Raw DOCTYPE/ENTITY markers refuse even inside comments or CDATA: this conservative preflight is linear.
29
+ */
30
+ export declare function parseDocument(source: string): Promise<XmlDocument>;
@@ -0,0 +1,74 @@
1
+ export class XmlDocumentError extends Error {
2
+ code;
3
+ constructor(code) {
4
+ super(code === 'parser-unavailable' ? 'Strict XML parser @xmldom/xmldom 0.9.12 is unavailable'
5
+ : code === 'unsupported-declaration' ? 'DTD and entity declarations are unsupported'
6
+ : code === 'parsing-limit' ? 'XML document exceeds the supported parsing limits'
7
+ : 'XML document is not well formed');
8
+ this.code = code;
9
+ this.name = 'XmlDocumentError';
10
+ }
11
+ }
12
+ let grammar;
13
+ function loadGrammar() {
14
+ return grammar ??= import('@xmldom/xmldom').catch(() => { grammar = undefined; throw new XmlDocumentError('parser-unavailable'); });
15
+ }
16
+ /** No I/O, globals, vendor names, defaults or recovery. Importing this module does not load the grammar.
17
+ * The XML declaration is a processing instruction in the prologue. A leading BOM is refused.
18
+ * Raw DOCTYPE/ENTITY markers refuse even inside comments or CDATA: this conservative preflight is linear.
19
+ */
20
+ export async function parseDocument(source) {
21
+ if (typeof source !== 'string' || source.charCodeAt(0) === 0xfeff)
22
+ throw new XmlDocumentError('malformed-document');
23
+ if (source.indexOf('<!DOCTYPE') !== -1 || source.indexOf('<!ENTITY') !== -1)
24
+ throw new XmlDocumentError('unsupported-declaration');
25
+ const { DOMParser } = await loadGrammar();
26
+ try {
27
+ const document = new DOMParser({ onError: () => { throw new XmlDocumentError('malformed-document'); } }).parseFromString(source, 'application/xml');
28
+ const convert = (node) => {
29
+ if (node.nodeType === 1) {
30
+ const element = node;
31
+ const attributes = Object.create(null);
32
+ for (const attr of Array.from(element.attributes))
33
+ attributes[attr.name] = attr.value;
34
+ return { kind: 'element', name: element.tagName, attributes, content: [] };
35
+ }
36
+ if (node.nodeType === 3 || node.nodeType === 4 || node.nodeType === 8)
37
+ return { kind: node.nodeType === 3 ? 'text' : node.nodeType === 4 ? 'cdata' : 'comment', value: node.nodeValue ?? '' };
38
+ if (node.nodeType === 7)
39
+ return { kind: 'processing-instruction', target: node.nodeName, value: node.nodeValue ?? '' };
40
+ throw new XmlDocumentError(node.nodeType === 10 ? 'unsupported-declaration' : 'malformed-document');
41
+ };
42
+ const pending = [];
43
+ const one = (source) => {
44
+ const target = convert(source);
45
+ if (target.kind === 'element')
46
+ pending.push({ source, target });
47
+ return target;
48
+ };
49
+ const nodes = Array.from(document.childNodes).map(one);
50
+ while (pending.length) {
51
+ const { source, target } = pending.pop();
52
+ for (const child of Array.from(source.childNodes))
53
+ target.content.push(one(child));
54
+ }
55
+ const roots = nodes.filter((node) => node.kind === 'element');
56
+ if (roots.length !== 1)
57
+ throw new XmlDocumentError('malformed-document');
58
+ const root = roots[0], index = nodes.indexOf(root);
59
+ const outside = (list) => list.map(node => {
60
+ if (node.kind === 'element' || node.kind === 'cdata' || (node.kind === 'text' && node.value.trim()))
61
+ throw new XmlDocumentError('malformed-document');
62
+ return node;
63
+ });
64
+ return { root, prologue: outside(nodes.slice(0, index)), epilogue: outside(nodes.slice(index + 1)) };
65
+ }
66
+ catch (error) {
67
+ if (error instanceof XmlDocumentError)
68
+ throw error;
69
+ if (error instanceof RangeError)
70
+ throw new XmlDocumentError('parsing-limit');
71
+ // The grammar's diagnostics can contain source bytes. Expose a fixed error, keeping credentials out of reports.
72
+ throw new XmlDocumentError('malformed-document');
73
+ }
74
+ }
@@ -221,6 +221,50 @@
221
221
  },
222
222
  "serveExport": "createAxiomTwinServer"
223
223
  },
224
+ "bitly": {
225
+ "adoption": {
226
+ "sdks": [],
227
+ "envStems": [
228
+ "BITLY",
229
+ "BUFFER_BITLY"
230
+ ]
231
+ },
232
+ "hosts": [
233
+ {
234
+ "host": "api-ssl.bitly.com"
235
+ },
236
+ {
237
+ "host": "bitly.com",
238
+ "pathPattern": "^/oauth/authorize/?$"
239
+ }
240
+ ],
241
+ "archetype": "crud",
242
+ "protocol": {
243
+ "declared": "3",
244
+ "major": 3,
245
+ "standing": "current"
246
+ },
247
+ "transport": "rest",
248
+ "resources": [
249
+ "group",
250
+ "bitlink"
251
+ ],
252
+ "endpointEnvNone": "Dub uses literal vendor URLs and native fetch; the World routes them by host.",
253
+ "credentialDoor": {
254
+ "path": "/_twin/signup",
255
+ "body": {
256
+ "email": "publisher@example.test",
257
+ "password": "throwaway-bitly-password",
258
+ "login": "publisher"
259
+ },
260
+ "fill": {
261
+ "BITLY_CLIENT_ID": "client_id",
262
+ "BITLY_CLIENT_SECRET": "client_secret",
263
+ "BUFFER_BITLY_API_KEY": "access_token"
264
+ }
265
+ },
266
+ "serveExport": "createBitlyTwinServer"
267
+ },
224
268
  "cerebras": {
225
269
  "adoption": {
226
270
  "sdks": [
@@ -331,6 +375,65 @@
331
375
  },
332
376
  "serveExport": "createClerkTwinServer"
333
377
  },
378
+ "clickhouse": {
379
+ "adoption": {
380
+ "sdks": [
381
+ "@clickhouse/client",
382
+ "@clickhouse/client-web"
383
+ ],
384
+ "pypi": [
385
+ "clickhouse-driver",
386
+ "clickhouse-connect",
387
+ "infi-clickhouse-orm"
388
+ ],
389
+ "envStems": [
390
+ "CLICKHOUSE"
391
+ ]
392
+ },
393
+ "hostsNone": "Self-hosted database: its own declared host and allocated listener are supplied by managed infrastructure.",
394
+ "archetype": "crud",
395
+ "protocol": {
396
+ "declared": "3",
397
+ "major": 3,
398
+ "standing": "current"
399
+ },
400
+ "transport": "rest",
401
+ "resources": [
402
+ "database",
403
+ "table",
404
+ "row"
405
+ ],
406
+ "endpointEnv": {
407
+ "name": "CLICKHOUSE_URL",
408
+ "note": "HTTP base URL read by the documented JavaScript client."
409
+ },
410
+ "managedService": {
411
+ "kind": "clickhouse",
412
+ "scheme": "http",
413
+ "configurationArg": "--configuration",
414
+ "originalInputs": {
415
+ "version": 1,
416
+ "manifestArg": "--original-inputs",
417
+ "rootArg": "--original-root",
418
+ "digestArg": "--original-inputs-sha256",
419
+ "paths": [
420
+ "/etc/clickhouse-server",
421
+ "/docker-entrypoint-initdb.d",
422
+ "/entrypoint.sh"
423
+ ]
424
+ },
425
+ "note": "One HTTP8123/native9000 process and store; declared operator configuration is installed before listeners."
426
+ },
427
+ "sidePorts": [
428
+ {
429
+ "name": "native",
430
+ "option": "nativePort",
431
+ "flag": "--native-port",
432
+ "note": "ClickHouse native TCP protocol, normally9000, beside HTTP8123."
433
+ }
434
+ ],
435
+ "serveExport": "createClickhouseTwinServer"
436
+ },
334
437
  "cloudflare": {
335
438
  "adoption": {
336
439
  "pypi": [
@@ -538,7 +641,7 @@
538
641
  },
539
642
  "transport": "rest",
540
643
  "resources": [],
541
- "endpointEnvNone": "Postiz calls https://api.deepgram.com/v1/listen; the World claims the host",
644
+ "endpointEnvNone": "No scanned application calls Deepgram; the World claims api.deepgram.com",
542
645
  "serveExport": "createDeepgramTwinServer"
543
646
  },
544
647
  "discord": {
@@ -786,7 +889,7 @@
786
889
  },
787
890
  "transport": "rest",
788
891
  "resources": [],
789
- "endpointEnvNone": "Postiz calls https://fal.run/fal-ai/<model>; the World claims the hosts",
892
+ "endpointEnvNone": "the customer life calls https://fal.run/fal-ai/<model>; the World claims the hosts",
790
893
  "credentialDoor": {
791
894
  "path": "/_twin/app-credentials",
792
895
  "body": {},
@@ -956,7 +1059,7 @@
956
1059
  },
957
1060
  {
958
1061
  "host": "github.com",
959
- "pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+/(?:info/refs|git-upload-pack|git-receive-pack)$|^/[^/]+/[^/]+\\.git/"
1062
+ "pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+/(?:info/refs|git-upload-pack|git-receive-pack)$|^/[^/]+/[^/]+\\.git/|^/[^/]+/[^/]+/?$|^/[^/]+/[^/]+/(?:issues|pulls?|blob|raw|tree|commits?|compare)(?:/|$)"
960
1063
  }
961
1064
  ],
962
1065
  "archetype": "crud",
@@ -1014,6 +1117,55 @@
1014
1117
  "endpointEnvNone": "Google generated clients take rootUrl in code; the World routes the declared Calendar API paths.",
1015
1118
  "serveExport": "createGooglecalendarTwinServer"
1016
1119
  },
1120
+ "googlefonts": {
1121
+ "adoption": {
1122
+ "sdks": [],
1123
+ "envStems": [
1124
+ "GOOGLE_FONTS"
1125
+ ]
1126
+ },
1127
+ "hosts": [
1128
+ {
1129
+ "host": "www.googleapis.com",
1130
+ "pathPattern": "^/webfonts/v1/webfonts$"
1131
+ },
1132
+ {
1133
+ "host": "webfonts.googleapis.com",
1134
+ "pathPattern": "^/v1/webfonts$"
1135
+ },
1136
+ {
1137
+ "host": "fonts.googleapis.com",
1138
+ "pathPattern": "^/css2?$"
1139
+ },
1140
+ {
1141
+ "host": "fonts.gstatic.com",
1142
+ "pathPattern": "^/(s/|l/font$)"
1143
+ }
1144
+ ],
1145
+ "archetype": "crud",
1146
+ "protocol": {
1147
+ "declared": "3",
1148
+ "major": 3,
1149
+ "standing": "current"
1150
+ },
1151
+ "transport": "rest",
1152
+ "resources": [
1153
+ "webfont",
1154
+ "_api_key",
1155
+ "_font_catalog",
1156
+ "_stylesheet",
1157
+ "_font_file"
1158
+ ],
1159
+ "endpointEnvNone": "Pinned helper hardcodes the vendor API and CSS hosts, then downloads their returned gstatic URLs. Scoped host routing preserves these URLs.",
1160
+ "credentialDoor": {
1161
+ "path": "/_twin/app-credentials",
1162
+ "body": {},
1163
+ "fill": {
1164
+ "GOOGLE_FONTS_API_KEY": "api_key"
1165
+ }
1166
+ },
1167
+ "serveExport": "createGooglefontsTwinServer"
1168
+ },
1017
1169
  "googleoauth": {
1018
1170
  "adoption": {
1019
1171
  "sdks": [
@@ -1516,6 +1668,38 @@
1516
1668
  },
1517
1669
  "serveExport": "createMistralTwinServer"
1518
1670
  },
1671
+ "mongodb": {
1672
+ "adoption": {
1673
+ "sdks": [
1674
+ "mongodb",
1675
+ "mongoose"
1676
+ ],
1677
+ "envStems": [
1678
+ "MONGODB",
1679
+ "MONGO"
1680
+ ]
1681
+ },
1682
+ "hosts": [],
1683
+ "archetype": "crud",
1684
+ "protocol": {
1685
+ "declared": "3",
1686
+ "major": 3,
1687
+ "standing": "current"
1688
+ },
1689
+ "transport": "raw-tcp",
1690
+ "resources": [
1691
+ "collection",
1692
+ "index",
1693
+ "document"
1694
+ ],
1695
+ "endpointEnvNone": "Managed infrastructure injects the connection address from the declared mongodb service; it is a TCP endpoint, with no HTTP API host.",
1696
+ "managedService": {
1697
+ "kind": "mongodb",
1698
+ "scheme": "mongodb",
1699
+ "note": "MongoDB 7.0 wire: standalone, or a declared single-member handshake without sessions; state in the World tree"
1700
+ },
1701
+ "serveExport": "createMongodbTwinServer"
1702
+ },
1519
1703
  "npm-registry": {
1520
1704
  "adoption": {
1521
1705
  "envStems": [
@@ -1910,6 +2094,10 @@
1910
2094
  "host": "reddit.com",
1911
2095
  "demandPathPattern": "^/api/"
1912
2096
  },
2097
+ {
2098
+ "host": "old.reddit.com",
2099
+ "demandPathPattern": "^/api/"
2100
+ },
1913
2101
  {
1914
2102
  "host": "reddit-uploaded-media.s3-accelerate.amazonaws.com"
1915
2103
  },
@@ -2566,7 +2754,7 @@
2566
2754
  "publish",
2567
2755
  "video"
2568
2756
  ],
2569
- "endpointEnvNone": "Postiz calls open.tiktokapis.com and sends people to www.tiktok.com; the World claims the hosts",
2757
+ "endpointEnvNone": "an app calls open.tiktokapis.com and sends people to www.tiktok.com; the World claims the hosts",
2570
2758
  "credentialDoor": {
2571
2759
  "path": "/_twin/app-credentials",
2572
2760
  "body": {},
@@ -3149,6 +3337,18 @@
3149
3337
  "_code_challenge",
3150
3338
  "upload"
3151
3339
  ],
3340
+ "credentialDoor": {
3341
+ "path": "/_twin/app-credentials",
3342
+ "body": {},
3343
+ "fill": {
3344
+ "TWITTER_API_KEY": "consumer_key",
3345
+ "TWITTER_API_SECRET": "consumer_secret",
3346
+ "TWITTER_ACCESS_TOKEN": "access_token",
3347
+ "TWITTER_ACCESS_SECRET": "access_token_secret",
3348
+ "TWITTER_CLIENT_ID": "client_id",
3349
+ "TWITTER_CLIENT_SECRET": "client_secret"
3350
+ }
3351
+ },
3152
3352
  "serveExport": "createXTwinServer"
3153
3353
  },
3154
3354
  "xai": {