@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.
- package/attach.cjs +2 -0
- package/capability-decision.cjs +6 -4
- package/dist/attach.cjs +2 -0
- package/dist/capability-decision.cjs +6 -4
- package/dist/generated/pack-facts.json +204 -4
- package/dist/inject.cjs +150 -86
- package/dist/network-policy.cjs +11 -1
- package/dist/network-policy.d.cts +1 -0
- package/dist/pack-facts.d.cts +3 -0
- package/dist/required-credential-transport.cjs +29 -0
- package/dist/required-credential-transport.d.cts +3 -0
- package/dist/src/actions.d.ts +15 -0
- package/dist/src/actions.js +82 -21
- package/dist/src/ancestry.d.ts +5 -4
- package/dist/src/ancestry.js +53 -28
- package/dist/src/blob-store.d.ts +16 -0
- package/dist/src/blob-store.js +76 -1
- package/dist/src/changeset.js +1 -1
- package/dist/src/clickhouse/compression.d.ts +28 -0
- package/dist/src/clickhouse/compression.js +281 -0
- package/dist/src/clickhouse/index.d.ts +1 -0
- package/dist/src/clickhouse/index.js +1 -0
- package/dist/src/derived-core.d.ts +84 -7
- package/dist/src/derived-core.js +336 -61
- package/dist/src/derived-real.js +97 -15
- package/dist/src/derived.d.ts +5 -0
- package/dist/src/derived.js +3 -0
- package/dist/src/executor.d.ts +7 -0
- package/dist/src/executor.js +15 -1
- package/dist/src/fork.js +1 -1
- package/dist/src/git/lfs.d.ts +13 -3
- package/dist/src/git/lfs.js +41 -9
- package/dist/src/grpc-wire.js +2 -1
- package/dist/src/h2.js +63 -10
- package/dist/src/head.d.ts +5 -0
- package/dist/src/head.js +15 -0
- package/dist/src/history.d.ts +1 -1
- package/dist/src/history.js +7 -7
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.js +6 -1
- package/dist/src/live/ingest.js +9 -13
- package/dist/src/live/rtmp.js +7 -5
- package/dist/src/live/segmenter.js +7 -1
- package/dist/src/log.d.ts +23 -3
- package/dist/src/log.js +160 -37
- package/dist/src/machines.js +5 -1
- package/dist/src/managed-go-programs.d.ts +55 -0
- package/dist/src/managed-go-programs.js +133 -0
- package/dist/src/managed-original-inputs.d.ts +101 -0
- package/dist/src/managed-original-inputs.js +125 -0
- package/dist/src/mongodb/client.d.ts +8 -0
- package/dist/src/mongodb/client.js +27 -0
- package/dist/src/mongodb/index.d.ts +2 -0
- package/dist/src/mongodb/index.js +5 -0
- package/dist/src/mongodb/stream.d.ts +97 -0
- package/dist/src/mongodb/stream.js +206 -0
- package/dist/src/observe.js +1 -1
- package/dist/src/pack-fetch.d.ts +6 -1
- package/dist/src/pack-fetch.js +69 -14
- package/dist/src/pack-paths.d.ts +2 -1
- package/dist/src/pack-paths.js +6 -1
- package/dist/src/packRegistry.d.ts +10 -14
- package/dist/src/packRegistry.js +2 -13
- package/dist/src/protocol.d.ts +13 -0
- package/dist/src/protocol.js +13 -0
- package/dist/src/redis/engine.d.ts +10 -4
- package/dist/src/redis/engine.js +103 -32
- package/dist/src/redis/member-storage.js +20 -8
- package/dist/src/redis/service-times.d.ts +25 -0
- package/dist/src/redis/service-times.js +87 -0
- package/dist/src/redis/stream.d.ts +2 -1
- package/dist/src/redis/stream.js +109 -20
- package/dist/src/resource-blob.d.ts +4 -0
- package/dist/src/resource-blob.js +8 -1
- package/dist/src/runtime-state.d.ts +11 -0
- package/dist/src/runtime-state.js +13 -0
- package/dist/src/runtime.d.ts +7 -5
- package/dist/src/runtime.js +7 -4
- package/dist/src/serve-http.d.ts +2 -0
- package/dist/src/serve-http.js +73 -6
- package/dist/src/serve.d.ts +10 -0
- package/dist/src/serve.js +43 -3
- package/dist/src/sockets.d.ts +4 -1
- package/dist/src/sockets.js +59 -6
- package/dist/src/storage.d.ts +2 -1
- package/dist/src/storage.js +6 -3
- package/dist/src/vendor-call.js +58 -0
- package/dist/src/world-boot.d.ts +1 -0
- package/dist/src/world-boot.js +6 -0
- package/dist/src/world-clock.js +6 -2
- package/dist/src/world-store.d.ts +122 -7
- package/dist/src/world-store.js +959 -103
- package/dist/src/xml.d.ts +30 -0
- package/dist/src/xml.js +74 -0
- package/generated/pack-facts.json +204 -4
- package/inject.cjs +150 -86
- package/network-policy.cjs +11 -1
- package/network-policy.d.cts +1 -0
- package/pack-facts.d.cts +3 -0
- package/package.json +27 -1
- package/required-credential-transport.cjs +29 -0
- package/required-credential-transport.d.cts +3 -0
- package/src/actions.ts +78 -21
- package/src/ancestry.ts +46 -24
- package/src/blob-store.ts +59 -1
- package/src/changeset.ts +1 -1
- package/src/clickhouse/compression.ts +172 -0
- package/src/clickhouse/index.ts +2 -0
- package/src/derived-core.ts +356 -61
- package/src/derived-real.ts +80 -14
- package/src/derived.ts +9 -1
- package/src/executor.ts +17 -3
- package/src/fork.ts +1 -1
- package/src/git/lfs.ts +40 -9
- package/src/grpc-wire.ts +2 -1
- package/src/h2.ts +46 -5
- package/src/head.ts +15 -0
- package/src/history.ts +7 -7
- package/src/index.ts +7 -1
- package/src/live/ingest.ts +7 -3
- package/src/live/rtmp.ts +7 -5
- package/src/live/segmenter.ts +7 -1
- package/src/log.ts +147 -32
- package/src/machines.ts +5 -1
- package/src/managed-go-programs.ts +146 -0
- package/src/managed-original-inputs.ts +163 -0
- package/src/mongodb/client.ts +27 -0
- package/src/mongodb/index.ts +5 -0
- package/src/mongodb/stream.ts +223 -0
- package/src/observe.ts +1 -1
- package/src/pack-fetch.ts +66 -16
- package/src/pack-paths.ts +5 -1
- package/src/packRegistry.ts +3 -15
- package/src/protocol.ts +13 -0
- package/src/redis/engine.ts +100 -57
- package/src/redis/member-storage.ts +17 -9
- package/src/redis/service-times.ts +81 -0
- package/src/redis/stream.ts +66 -14
- package/src/resource-blob.ts +9 -1
- package/src/runtime-state.ts +14 -0
- package/src/runtime.ts +10 -3
- package/src/serve-http.ts +65 -6
- package/src/serve.ts +45 -3
- package/src/sockets.ts +39 -8
- package/src/storage.ts +5 -3
- package/src/vendor-call.ts +54 -0
- package/src/world-boot.ts +6 -0
- package/src/world-clock.ts +6 -2
- package/src/world-store.ts +768 -91
- package/src/xml.ts +71 -0
package/src/xml.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Strict XML grammar is shared mechanics; element interpretation belongs to the consuming pack.
|
|
2
|
+
// The exact optional dependency belongs to this kernel, so Node and browser bundles resolve one parser.
|
|
3
|
+
// Source: @xmldom/xmldom 0.9.12 lib/dom-parser.js and index.d.ts (DOMParser/onError).
|
|
4
|
+
export type XmlElement = { kind: 'element'; name: string; attributes: Record<string, string>; content: XmlContent[] };
|
|
5
|
+
export type XmlText = { kind: 'text' | 'cdata' | 'comment'; value: string };
|
|
6
|
+
export type XmlInstruction = { kind: 'processing-instruction'; target: string; value: string };
|
|
7
|
+
export type XmlContent = XmlElement | XmlText | XmlInstruction;
|
|
8
|
+
export type XmlDocument = { root: XmlElement; prologue: Array<XmlText | XmlInstruction>; epilogue: Array<XmlText | XmlInstruction> };
|
|
9
|
+
export class XmlDocumentError extends Error {
|
|
10
|
+
constructor(readonly code: 'parser-unavailable' | 'unsupported-declaration' | 'malformed-document' | 'parsing-limit') {
|
|
11
|
+
super(code === 'parser-unavailable' ? 'Strict XML parser @xmldom/xmldom 0.9.12 is unavailable'
|
|
12
|
+
: code === 'unsupported-declaration' ? 'DTD and entity declarations are unsupported'
|
|
13
|
+
: code === 'parsing-limit' ? 'XML document exceeds the supported parsing limits'
|
|
14
|
+
: 'XML document is not well formed');
|
|
15
|
+
this.name = 'XmlDocumentError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
type Grammar = typeof import('@xmldom/xmldom');
|
|
19
|
+
let grammar: Promise<Grammar> | undefined;
|
|
20
|
+
function loadGrammar(): Promise<Grammar> {
|
|
21
|
+
return grammar ??= import('@xmldom/xmldom').catch(() => { grammar = undefined; throw new XmlDocumentError('parser-unavailable'); });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** No I/O, globals, vendor names, defaults or recovery. Importing this module does not load the grammar.
|
|
25
|
+
* The XML declaration is a processing instruction in the prologue. A leading BOM is refused.
|
|
26
|
+
* Raw DOCTYPE/ENTITY markers refuse even inside comments or CDATA: this conservative preflight is linear.
|
|
27
|
+
*/
|
|
28
|
+
export async function parseDocument(source: string): Promise<XmlDocument> {
|
|
29
|
+
if (typeof source !== 'string' || source.charCodeAt(0) === 0xfeff) throw new XmlDocumentError('malformed-document');
|
|
30
|
+
if (source.indexOf('<!DOCTYPE') !== -1 || source.indexOf('<!ENTITY') !== -1) throw new XmlDocumentError('unsupported-declaration');
|
|
31
|
+
const { DOMParser } = await loadGrammar();
|
|
32
|
+
try {
|
|
33
|
+
const document = new DOMParser({ onError: () => { throw new XmlDocumentError('malformed-document'); } }).parseFromString(source, 'application/xml');
|
|
34
|
+
const convert = (node: import('@xmldom/xmldom').Node): XmlContent => {
|
|
35
|
+
if (node.nodeType === 1) {
|
|
36
|
+
const element = node as import('@xmldom/xmldom').Element;
|
|
37
|
+
const attributes: Record<string, string> = Object.create(null);
|
|
38
|
+
for (const attr of Array.from(element.attributes)) attributes[attr.name] = attr.value;
|
|
39
|
+
return { kind: 'element', name: element.tagName, attributes, content: [] };
|
|
40
|
+
}
|
|
41
|
+
if (node.nodeType === 3 || node.nodeType === 4 || node.nodeType === 8)
|
|
42
|
+
return { kind: node.nodeType === 3 ? 'text' : node.nodeType === 4 ? 'cdata' : 'comment', value: node.nodeValue ?? '' };
|
|
43
|
+
if (node.nodeType === 7) return { kind: 'processing-instruction', target: node.nodeName, value: node.nodeValue ?? '' };
|
|
44
|
+
throw new XmlDocumentError(node.nodeType === 10 ? 'unsupported-declaration' : 'malformed-document');
|
|
45
|
+
};
|
|
46
|
+
const pending: Array<{ source: import('@xmldom/xmldom').Node; target: XmlElement }> = [];
|
|
47
|
+
const one = (source: import('@xmldom/xmldom').Node): XmlContent => {
|
|
48
|
+
const target = convert(source);
|
|
49
|
+
if (target.kind === 'element') pending.push({ source, target });
|
|
50
|
+
return target;
|
|
51
|
+
};
|
|
52
|
+
const nodes = Array.from(document.childNodes).map(one);
|
|
53
|
+
while (pending.length) {
|
|
54
|
+
const { source, target } = pending.pop()!;
|
|
55
|
+
for (const child of Array.from(source.childNodes)) target.content.push(one(child));
|
|
56
|
+
}
|
|
57
|
+
const roots = nodes.filter((node): node is XmlElement => node.kind === 'element');
|
|
58
|
+
if (roots.length !== 1) throw new XmlDocumentError('malformed-document');
|
|
59
|
+
const root = roots[0]!, index = nodes.indexOf(root);
|
|
60
|
+
const outside = (list: XmlContent[]): Array<XmlText | XmlInstruction> => list.map(node => {
|
|
61
|
+
if (node.kind === 'element' || node.kind === 'cdata' || (node.kind === 'text' && node.value.trim())) 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
|
+
} catch (error) {
|
|
66
|
+
if (error instanceof XmlDocumentError) throw error;
|
|
67
|
+
if (error instanceof RangeError) throw new XmlDocumentError('parsing-limit');
|
|
68
|
+
// The grammar's diagnostics can contain source bytes. Expose a fixed error, keeping credentials out of reports.
|
|
69
|
+
throw new XmlDocumentError('malformed-document');
|
|
70
|
+
}
|
|
71
|
+
}
|