@smoothbricks/lmao 0.1.4 → 0.2.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.
- package/dist/cloudflare.d.ts +15 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +14 -0
- package/dist/es.js +1 -0
- package/dist/lib/JsBufferStrategy.d.ts.map +1 -1
- package/dist/lib/JsBufferStrategy.js +12 -0
- package/dist/lib/archive/chunkEnvelope.js +1 -0
- package/dist/lib/archive/chunkRouting.js +1 -0
- package/dist/lib/archive/chunkStats.js +1 -0
- package/dist/lib/arrow/capacityStats.js +1 -0
- package/dist/lib/arrow/dictionaries.d.ts.map +1 -1
- package/dist/lib/buffer/Nanoseconds.d.ts.map +1 -1
- package/dist/lib/buffer/Nanoseconds.js +34 -0
- package/dist/lib/bufferStrategy.js +21 -0
- package/dist/lib/capacityTuning.js +26 -0
- package/dist/lib/cleanupDiagnostics.js +2 -2
- package/dist/lib/cloudflare/classSplit.d.ts +73 -0
- package/dist/lib/cloudflare/classSplit.d.ts.map +1 -0
- package/dist/lib/cloudflare/classSplit.js +101 -0
- package/dist/lib/cloudflare/collectorClient.d.ts +69 -0
- package/dist/lib/cloudflare/collectorClient.d.ts.map +1 -0
- package/dist/lib/cloudflare/collectorClient.js +82 -0
- package/dist/lib/cloudflare/diagnosticDrain.d.ts +78 -0
- package/dist/lib/cloudflare/diagnosticDrain.d.ts.map +1 -0
- package/dist/lib/cloudflare/diagnosticDrain.js +120 -0
- package/dist/lib/cloudflare/traceRows.d.ts +19 -0
- package/dist/lib/cloudflare/traceRows.d.ts.map +1 -0
- package/dist/lib/cloudflare/traceRows.js +51 -0
- package/dist/lib/codegen/evaluatorGenerator.js +2 -1
- package/dist/lib/codegen/fixedPositionWriterGenerator.d.ts +8 -0
- package/dist/lib/codegen/fixedPositionWriterGenerator.d.ts.map +1 -1
- package/dist/lib/codegen/fixedPositionWriterGenerator.js +18 -1
- package/dist/lib/codegen/spanLoggerGenerator.js +1 -0
- package/dist/lib/errors/Blocked.d.ts +1 -1
- package/dist/lib/errors/Blocked.d.ts.map +1 -1
- package/dist/lib/errors/Blocked.js +53 -0
- package/dist/lib/errors/CodeError.d.ts.map +1 -1
- package/dist/lib/errors/CodeError.js +31 -0
- package/dist/lib/errors/RetriesExhausted.d.ts +1 -1
- package/dist/lib/errors/RetriesExhausted.d.ts.map +1 -1
- package/dist/lib/errors/RetriesExhausted.js +38 -0
- package/dist/lib/errors/Transient.d.ts +1 -1
- package/dist/lib/errors/Transient.d.ts.map +1 -1
- package/dist/lib/errors/Transient.js +31 -0
- package/dist/lib/errors/retry-policy.js +1 -0
- package/dist/lib/flushScheduler.d.ts +0 -3
- package/dist/lib/flushScheduler.d.ts.map +1 -1
- package/dist/lib/library.js +1 -0
- package/dist/lib/logApi.js +11 -0
- package/dist/lib/logBinding.js +13 -0
- package/dist/lib/op.d.ts.map +1 -1
- package/dist/lib/op.js +15 -0
- package/dist/lib/opContext/contextTypes.d.ts +1 -1
- package/dist/lib/opContext/contextTypes.d.ts.map +1 -1
- package/dist/lib/opContext/createOpGroup.js +1 -0
- package/dist/lib/opContext/featureFlagTypes.js +13 -0
- package/dist/lib/opContext/opGroupTypes.d.ts +1 -1
- package/dist/lib/opContext/opGroupTypes.d.ts.map +1 -1
- package/dist/lib/opContext/opGroupTypes.js +16 -0
- package/dist/lib/opContext/opTypes.js +14 -0
- package/dist/lib/opContext/spanContextTypes.js +19 -0
- package/dist/lib/opContext/types.js +15 -0
- package/dist/lib/result.d.ts.map +1 -1
- package/dist/lib/schema/LogSchema.d.ts.map +1 -1
- package/dist/lib/schema/builder.js +1 -0
- package/dist/lib/schema/defineFeatureFlags.js +1 -0
- package/dist/lib/schema/defineLogSchema.js +10 -0
- package/dist/lib/schema/evaluator.d.ts.map +1 -1
- package/dist/lib/schema/evaluator.js +1 -0
- package/dist/lib/schema/systemSchema.d.ts +1 -1
- package/dist/lib/schema/systemSchema.d.ts.map +1 -1
- package/dist/lib/schema/systemSchema.js +8 -0
- package/dist/lib/schema/types.js +6 -0
- package/dist/lib/spanBuffer.d.ts.map +1 -1
- package/dist/lib/spanBufferHelpers.js +1 -0
- package/dist/lib/spanBufferStats.js +24 -0
- package/dist/lib/spanContext.js +1 -0
- package/dist/lib/sqlite/sqlite-async-writer.d.ts.map +1 -1
- package/dist/lib/sqlite/sqlite-common.d.ts +2 -0
- package/dist/lib/sqlite/sqlite-common.d.ts.map +1 -1
- package/dist/lib/sqlite/sqlite-common.js +4 -0
- package/dist/lib/sqlite/sqlite-d1.js +8 -0
- package/dist/lib/sqlite/sqlite-db.js +8 -0
- package/dist/lib/sqlite/sqlite-writer.d.ts.map +1 -1
- package/dist/lib/testing/bun-harness.d.ts +4 -0
- package/dist/lib/testing/bun-harness.d.ts.map +1 -1
- package/dist/lib/testing/extractFacts.js +8 -0
- package/dist/lib/testing/facts.d.ts.map +1 -1
- package/dist/lib/testing/facts.js +19 -0
- package/dist/lib/testing/queryable-span.js +16 -0
- package/dist/lib/testing/span-query.js +8 -0
- package/dist/lib/testing/trace-query.d.ts.map +1 -1
- package/dist/lib/testing/trace-query.js +247 -219
- package/dist/lib/traceContext.js +8 -0
- package/dist/lib/traceId.js +1 -0
- package/dist/lib/traceRoot.d.ts +5 -5
- package/dist/lib/traceRoot.es.d.ts.map +1 -1
- package/dist/lib/traceRoot.es.js +2 -1
- package/dist/lib/traceRoot.js +16 -1
- package/dist/lib/traceRoot.node.d.ts +2 -2
- package/dist/lib/traceRoot.node.d.ts.map +1 -1
- package/dist/lib/traceRoot.node.js +4 -3
- package/dist/lib/tracer.d.ts.map +1 -1
- package/dist/lib/tracer.js +61 -0
- package/dist/lib/tracers/ArrayQueueTracer.d.ts.map +1 -1
- package/dist/lib/tracers/ArrayQueueTracer.js +1 -0
- package/dist/lib/tracers/CompositeTracer.d.ts.map +1 -1
- package/dist/lib/tracers/CompositeTracer.js +1 -0
- package/dist/lib/tracers/NoOpTracer.d.ts.map +1 -1
- package/dist/lib/tracers/NoOpTracer.js +25 -0
- package/dist/lib/tracers/SQLiteTracer.d.ts.map +1 -1
- package/dist/lib/tracers/StdioTracer.d.ts.map +1 -1
- package/dist/lib/tracers/StdioTracer.js +39 -6
- package/dist/lib/tracers/TestTracer.d.ts.map +1 -1
- package/dist/lib/tracers/TestTracer.js +30 -0
- package/dist/lib/types.js +10 -0
- package/dist/lib/utf8Cache.d.ts.map +1 -1
- package/dist/lib/utf8Cache.js +1 -0
- package/dist/lib/wasm/WasmBufferStrategy.d.ts.map +1 -1
- package/dist/lib/wasm/WasmBufferStrategy.js +15 -0
- package/dist/lib/wasm/wasmAllocator.js +16 -0
- package/dist/lib/wasm/wasmSpanBuffer.js +12 -0
- package/dist/lib/wasm/wasmTraceRoot.d.ts.map +1 -1
- package/dist/lib/wasm/wasmTraceRoot.js +2 -1
- package/dist/node.js +1 -0
- package/package.json +11 -4
- package/src/cloudflare.ts +35 -0
- package/src/lib/bufferStrategy.ts +2 -2
- package/src/lib/cleanupDiagnostics.ts +2 -2
- package/src/lib/cloudflare/__tests__/classSplit.test.ts +171 -0
- package/src/lib/cloudflare/__tests__/collectorClient.test.ts +104 -0
- package/src/lib/cloudflare/__tests__/diagnosticDrain.test.ts +165 -0
- package/src/lib/cloudflare/classSplit.ts +139 -0
- package/src/lib/cloudflare/collectorClient.ts +117 -0
- package/src/lib/cloudflare/diagnosticDrain.ts +152 -0
- package/src/lib/cloudflare/traceRows.ts +60 -0
- package/src/lib/codegen/__tests__/fixedPositionWriter-uint64.test.ts +304 -0
- package/src/lib/codegen/evaluatorGenerator.ts +2 -2
- package/src/lib/codegen/fixedPositionWriterGenerator.ts +26 -1
- package/src/lib/schema/defineFeatureFlags.ts +2 -2
- package/src/lib/schema/evaluator.ts +2 -2
- package/src/lib/sqlite/sqlite-common.ts +5 -0
- package/src/lib/testing/__tests__/facts.test.ts +6 -6
- package/src/lib/traceRoot.es.ts +2 -2
- package/src/lib/traceRoot.node.ts +3 -3
- package/src/lib/traceRoot.ts +5 -5
- package/src/lib/tracers/ArrayQueueTracer.ts +2 -2
- package/src/lib/codegen/__tests__/__snapshots__/spanLoggerGenerator.test.ts.snap +0 -1965
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import * as _accessExpressionAsString_1 from "typia/lib/internal/_accessExpressionAsString";
|
|
2
|
+
import * as _validateReport_1 from "typia/lib/internal/_validateReport";
|
|
3
|
+
import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSchema";
|
|
4
4
|
/**
|
|
5
5
|
* TraceQuery - Post-run query API for the SQLite trace database.
|
|
6
6
|
*
|
|
@@ -30,259 +30,287 @@ let validateLatestTraceRunRow;
|
|
|
30
30
|
let validateRootSpanRow;
|
|
31
31
|
let validateTraceQueryResultRow;
|
|
32
32
|
function getValidateTraceRunRow() {
|
|
33
|
-
validateTraceRunRow ??= (() => {
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
const value = input[key];
|
|
37
|
-
if (undefined === value)
|
|
38
|
-
return true;
|
|
39
|
-
return false;
|
|
40
|
-
})); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.traceId || _report(_exceptionable, {
|
|
41
|
-
path: _path + ".traceId",
|
|
42
|
-
expected: "string",
|
|
43
|
-
value: input.traceId
|
|
44
|
-
}), "string" === typeof input.spanName || _report(_exceptionable, {
|
|
45
|
-
path: _path + ".spanName",
|
|
46
|
-
expected: "string",
|
|
47
|
-
value: input.spanName
|
|
48
|
-
}), "number" === typeof input.startedAt || _report(_exceptionable, {
|
|
49
|
-
path: _path + ".startedAt",
|
|
50
|
-
expected: "number",
|
|
51
|
-
value: input.startedAt
|
|
52
|
-
}), 3 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
33
|
+
validateTraceRunRow ??= (() => {
|
|
34
|
+
const _io0 = (input, _exceptionable = true) => "string" === typeof input.traceId && "string" === typeof input.spanName && "number" === typeof input.startedAt && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
53
35
|
if (["traceId", "spanName", "startedAt"].some(prop => key === prop))
|
|
54
36
|
return true;
|
|
55
37
|
const value = input[key];
|
|
56
38
|
if (undefined === value)
|
|
57
39
|
return true;
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
value
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
40
|
+
return false;
|
|
41
|
+
}));
|
|
42
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.traceId || _report(_exceptionable, {
|
|
43
|
+
path: _path + ".traceId",
|
|
44
|
+
expected: "string",
|
|
45
|
+
value: input.traceId
|
|
46
|
+
}), "string" === typeof input.spanName || _report(_exceptionable, {
|
|
47
|
+
path: _path + ".spanName",
|
|
48
|
+
expected: "string",
|
|
49
|
+
value: input.spanName
|
|
50
|
+
}), "number" === typeof input.startedAt || _report(_exceptionable, {
|
|
51
|
+
path: _path + ".startedAt",
|
|
52
|
+
expected: "number",
|
|
53
|
+
value: input.startedAt
|
|
54
|
+
}), 3 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
55
|
+
if (["traceId", "spanName", "startedAt"].some(prop => key === prop))
|
|
56
|
+
return true;
|
|
57
|
+
const value = input[key];
|
|
58
|
+
if (undefined === value)
|
|
59
|
+
return true;
|
|
60
|
+
return _report(_exceptionable, {
|
|
61
|
+
path: _path + _accessExpressionAsString_1._accessExpressionAsString(key),
|
|
62
|
+
expected: "undefined",
|
|
63
|
+
value: value,
|
|
64
|
+
description: [
|
|
65
|
+
`The property \`${key}\` is not defined in the object type.`,
|
|
66
|
+
"",
|
|
67
|
+
"Please remove the property next time."
|
|
68
|
+
].join("\n")
|
|
69
|
+
});
|
|
70
|
+
}).every(flag => flag))].every(flag => flag);
|
|
71
|
+
const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
72
|
+
let errors;
|
|
73
|
+
let _report;
|
|
74
|
+
return _createStandardSchema_1._createStandardSchema(input => {
|
|
75
|
+
if (false === __is(input)) {
|
|
76
|
+
errors = [];
|
|
77
|
+
_report = _validateReport_1._validateReport(errors);
|
|
78
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
79
|
+
path: _path + "",
|
|
80
|
+
expected: "TraceRunRow",
|
|
81
|
+
value: input
|
|
82
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
83
|
+
path: _path + "",
|
|
84
|
+
expected: "TraceRunRow",
|
|
85
|
+
value: input
|
|
86
|
+
}))(input, "$input", true);
|
|
87
|
+
const success = 0 === errors.length;
|
|
88
|
+
return success ? {
|
|
89
|
+
success,
|
|
90
|
+
data: input
|
|
91
|
+
} : {
|
|
92
|
+
success,
|
|
93
|
+
errors,
|
|
94
|
+
data: input
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
success: true,
|
|
88
99
|
data: input
|
|
89
100
|
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
success: true,
|
|
93
|
-
data: input
|
|
94
|
-
};
|
|
95
|
-
}); })();
|
|
101
|
+
});
|
|
102
|
+
})();
|
|
96
103
|
return validateTraceRunRow;
|
|
97
104
|
}
|
|
98
105
|
function getValidateLatestTraceRunRow() {
|
|
99
|
-
validateLatestTraceRunRow ??= (() => {
|
|
100
|
-
|
|
101
|
-
return true;
|
|
102
|
-
const value = input[key];
|
|
103
|
-
if (undefined === value)
|
|
104
|
-
return true;
|
|
105
|
-
return false;
|
|
106
|
-
})); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.traceId || _report(_exceptionable, {
|
|
107
|
-
path: _path + ".traceId",
|
|
108
|
-
expected: "string",
|
|
109
|
-
value: input.traceId
|
|
110
|
-
}), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
106
|
+
validateLatestTraceRunRow ??= (() => {
|
|
107
|
+
const _io0 = (input, _exceptionable = true) => "string" === typeof input.traceId && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
111
108
|
if (["traceId"].some(prop => key === prop))
|
|
112
109
|
return true;
|
|
113
110
|
const value = input[key];
|
|
114
111
|
if (undefined === value)
|
|
115
112
|
return true;
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}))(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
errors
|
|
113
|
+
return false;
|
|
114
|
+
}));
|
|
115
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.traceId || _report(_exceptionable, {
|
|
116
|
+
path: _path + ".traceId",
|
|
117
|
+
expected: "string",
|
|
118
|
+
value: input.traceId
|
|
119
|
+
}), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
120
|
+
if (["traceId"].some(prop => key === prop))
|
|
121
|
+
return true;
|
|
122
|
+
const value = input[key];
|
|
123
|
+
if (undefined === value)
|
|
124
|
+
return true;
|
|
125
|
+
return _report(_exceptionable, {
|
|
126
|
+
path: _path + _accessExpressionAsString_1._accessExpressionAsString(key),
|
|
127
|
+
expected: "undefined",
|
|
128
|
+
value: value,
|
|
129
|
+
description: [
|
|
130
|
+
`The property \`${key}\` is not defined in the object type.`,
|
|
131
|
+
"",
|
|
132
|
+
"Please remove the property next time."
|
|
133
|
+
].join("\n")
|
|
134
|
+
});
|
|
135
|
+
}).every(flag => flag))].every(flag => flag);
|
|
136
|
+
const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
137
|
+
let errors;
|
|
138
|
+
let _report;
|
|
139
|
+
return _createStandardSchema_1._createStandardSchema(input => {
|
|
140
|
+
if (false === __is(input)) {
|
|
141
|
+
errors = [];
|
|
142
|
+
_report = _validateReport_1._validateReport(errors);
|
|
143
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
144
|
+
path: _path + "",
|
|
145
|
+
expected: "LatestTraceRunRow",
|
|
146
|
+
value: input
|
|
147
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
148
|
+
path: _path + "",
|
|
149
|
+
expected: "LatestTraceRunRow",
|
|
150
|
+
value: input
|
|
151
|
+
}))(input, "$input", true);
|
|
152
|
+
const success = 0 === errors.length;
|
|
153
|
+
return success ? {
|
|
154
|
+
success,
|
|
155
|
+
data: input
|
|
156
|
+
} : {
|
|
157
|
+
success,
|
|
158
|
+
errors,
|
|
159
|
+
data: input
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
success: true,
|
|
146
164
|
data: input
|
|
147
165
|
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
success: true,
|
|
151
|
-
data: input
|
|
152
|
-
};
|
|
153
|
-
}); })();
|
|
166
|
+
});
|
|
167
|
+
})();
|
|
154
168
|
return validateLatestTraceRunRow;
|
|
155
169
|
}
|
|
156
170
|
function getValidateRootSpanRow() {
|
|
157
|
-
validateRootSpanRow ??= (() => {
|
|
158
|
-
|
|
159
|
-
return true;
|
|
160
|
-
const value = input[key];
|
|
161
|
-
if (undefined === value)
|
|
162
|
-
return true;
|
|
163
|
-
return false;
|
|
164
|
-
})); const _vo0 = (input, _path, _exceptionable = true) => ["number" === typeof input.span_id || _report(_exceptionable, {
|
|
165
|
-
path: _path + ".span_id",
|
|
166
|
-
expected: "number",
|
|
167
|
-
value: input.span_id
|
|
168
|
-
}), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
171
|
+
validateRootSpanRow ??= (() => {
|
|
172
|
+
const _io0 = (input, _exceptionable = true) => "number" === typeof input.span_id && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
169
173
|
if (["span_id"].some(prop => key === prop))
|
|
170
174
|
return true;
|
|
171
175
|
const value = input[key];
|
|
172
176
|
if (undefined === value)
|
|
173
177
|
return true;
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}))(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
errors
|
|
178
|
+
return false;
|
|
179
|
+
}));
|
|
180
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["number" === typeof input.span_id || _report(_exceptionable, {
|
|
181
|
+
path: _path + ".span_id",
|
|
182
|
+
expected: "number",
|
|
183
|
+
value: input.span_id
|
|
184
|
+
}), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
185
|
+
if (["span_id"].some(prop => key === prop))
|
|
186
|
+
return true;
|
|
187
|
+
const value = input[key];
|
|
188
|
+
if (undefined === value)
|
|
189
|
+
return true;
|
|
190
|
+
return _report(_exceptionable, {
|
|
191
|
+
path: _path + _accessExpressionAsString_1._accessExpressionAsString(key),
|
|
192
|
+
expected: "undefined",
|
|
193
|
+
value: value,
|
|
194
|
+
description: [
|
|
195
|
+
`The property \`${key}\` is not defined in the object type.`,
|
|
196
|
+
"",
|
|
197
|
+
"Please remove the property next time."
|
|
198
|
+
].join("\n")
|
|
199
|
+
});
|
|
200
|
+
}).every(flag => flag))].every(flag => flag);
|
|
201
|
+
const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
202
|
+
let errors;
|
|
203
|
+
let _report;
|
|
204
|
+
return _createStandardSchema_1._createStandardSchema(input => {
|
|
205
|
+
if (false === __is(input)) {
|
|
206
|
+
errors = [];
|
|
207
|
+
_report = _validateReport_1._validateReport(errors);
|
|
208
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
209
|
+
path: _path + "",
|
|
210
|
+
expected: "RootSpanRow",
|
|
211
|
+
value: input
|
|
212
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
213
|
+
path: _path + "",
|
|
214
|
+
expected: "RootSpanRow",
|
|
215
|
+
value: input
|
|
216
|
+
}))(input, "$input", true);
|
|
217
|
+
const success = 0 === errors.length;
|
|
218
|
+
return success ? {
|
|
219
|
+
success,
|
|
220
|
+
data: input
|
|
221
|
+
} : {
|
|
222
|
+
success,
|
|
223
|
+
errors,
|
|
224
|
+
data: input
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
success: true,
|
|
204
229
|
data: input
|
|
205
230
|
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
success: true,
|
|
209
|
-
data: input
|
|
210
|
-
};
|
|
211
|
-
}); })();
|
|
231
|
+
});
|
|
232
|
+
})();
|
|
212
233
|
return validateRootSpanRow;
|
|
213
234
|
}
|
|
214
235
|
function getValidateTraceQueryResultRow() {
|
|
215
|
-
validateTraceQueryResultRow ??= (() => {
|
|
216
|
-
|
|
217
|
-
return true;
|
|
218
|
-
const value = input[key];
|
|
219
|
-
if (undefined === value)
|
|
220
|
-
return true;
|
|
221
|
-
return false;
|
|
222
|
-
})); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.spanName || _report(_exceptionable, {
|
|
223
|
-
path: _path + ".spanName",
|
|
224
|
-
expected: "string",
|
|
225
|
-
value: input.spanName
|
|
226
|
-
}), "ok" === input.status || "err" === input.status || "exception" === input.status || "running" === input.status || _report(_exceptionable, {
|
|
227
|
-
path: _path + ".status",
|
|
228
|
-
expected: "(\"err\" | \"exception\" | \"ok\" | \"running\")",
|
|
229
|
-
value: input.status
|
|
230
|
-
}), null === input.durationNs || "number" === typeof input.durationNs || _report(_exceptionable, {
|
|
231
|
-
path: _path + ".durationNs",
|
|
232
|
-
expected: "(null | number)",
|
|
233
|
-
value: input.durationNs
|
|
234
|
-
}), null === input.describe || "string" === typeof input.describe || _report(_exceptionable, {
|
|
235
|
-
path: _path + ".describe",
|
|
236
|
-
expected: "(null | string)",
|
|
237
|
-
value: input.describe
|
|
238
|
-
}), "number" === typeof input.parentSpanId || _report(_exceptionable, {
|
|
239
|
-
path: _path + ".parentSpanId",
|
|
240
|
-
expected: "number",
|
|
241
|
-
value: input.parentSpanId
|
|
242
|
-
}), 5 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
236
|
+
validateTraceQueryResultRow ??= (() => {
|
|
237
|
+
const _io0 = (input, _exceptionable = true) => "string" === typeof input.spanName && ("err" === input.status || "exception" === input.status || "ok" === input.status || "running" === input.status) && (null === input.durationNs || "number" === typeof input.durationNs) && (null === input.describe || "string" === typeof input.describe) && "number" === typeof input.parentSpanId && (5 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
243
238
|
if (["spanName", "status", "durationNs", "describe", "parentSpanId"].some(prop => key === prop))
|
|
244
239
|
return true;
|
|
245
240
|
const value = input[key];
|
|
246
241
|
if (undefined === value)
|
|
247
242
|
return true;
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
path: _path + "",
|
|
264
|
-
expected: "
|
|
265
|
-
value: input
|
|
266
|
-
})
|
|
267
|
-
path: _path + "",
|
|
268
|
-
expected: "
|
|
269
|
-
value: input
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
243
|
+
return false;
|
|
244
|
+
}));
|
|
245
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.spanName || _report(_exceptionable, {
|
|
246
|
+
path: _path + ".spanName",
|
|
247
|
+
expected: "string",
|
|
248
|
+
value: input.spanName
|
|
249
|
+
}), "err" === input.status || "exception" === input.status || "ok" === input.status || "running" === input.status || _report(_exceptionable, {
|
|
250
|
+
path: _path + ".status",
|
|
251
|
+
expected: "(\"err\" | \"exception\" | \"ok\" | \"running\")",
|
|
252
|
+
value: input.status
|
|
253
|
+
}), null === input.durationNs || "number" === typeof input.durationNs || _report(_exceptionable, {
|
|
254
|
+
path: _path + ".durationNs",
|
|
255
|
+
expected: "(null | number)",
|
|
256
|
+
value: input.durationNs
|
|
257
|
+
}), null === input.describe || "string" === typeof input.describe || _report(_exceptionable, {
|
|
258
|
+
path: _path + ".describe",
|
|
259
|
+
expected: "(null | string)",
|
|
260
|
+
value: input.describe
|
|
261
|
+
}), "number" === typeof input.parentSpanId || _report(_exceptionable, {
|
|
262
|
+
path: _path + ".parentSpanId",
|
|
263
|
+
expected: "number",
|
|
264
|
+
value: input.parentSpanId
|
|
265
|
+
}), 5 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
266
|
+
if (["spanName", "status", "durationNs", "describe", "parentSpanId"].some(prop => key === prop))
|
|
267
|
+
return true;
|
|
268
|
+
const value = input[key];
|
|
269
|
+
if (undefined === value)
|
|
270
|
+
return true;
|
|
271
|
+
return _report(_exceptionable, {
|
|
272
|
+
path: _path + _accessExpressionAsString_1._accessExpressionAsString(key),
|
|
273
|
+
expected: "undefined",
|
|
274
|
+
value: value,
|
|
275
|
+
description: [
|
|
276
|
+
`The property \`${key}\` is not defined in the object type.`,
|
|
277
|
+
"",
|
|
278
|
+
"Please remove the property next time."
|
|
279
|
+
].join("\n")
|
|
280
|
+
});
|
|
281
|
+
}).every(flag => flag))].every(flag => flag);
|
|
282
|
+
const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
283
|
+
let errors;
|
|
284
|
+
let _report;
|
|
285
|
+
return _createStandardSchema_1._createStandardSchema(input => {
|
|
286
|
+
if (false === __is(input)) {
|
|
287
|
+
errors = [];
|
|
288
|
+
_report = _validateReport_1._validateReport(errors);
|
|
289
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
290
|
+
path: _path + "",
|
|
291
|
+
expected: "TraceQueryResultRow",
|
|
292
|
+
value: input
|
|
293
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
294
|
+
path: _path + "",
|
|
295
|
+
expected: "TraceQueryResultRow",
|
|
296
|
+
value: input
|
|
297
|
+
}))(input, "$input", true);
|
|
298
|
+
const success = 0 === errors.length;
|
|
299
|
+
return success ? {
|
|
300
|
+
success,
|
|
301
|
+
data: input
|
|
302
|
+
} : {
|
|
303
|
+
success,
|
|
304
|
+
errors,
|
|
305
|
+
data: input
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
return {
|
|
309
|
+
success: true,
|
|
278
310
|
data: input
|
|
279
311
|
};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
success: true,
|
|
283
|
-
data: input
|
|
284
|
-
};
|
|
285
|
-
}); })();
|
|
312
|
+
});
|
|
313
|
+
})();
|
|
286
314
|
return validateTraceQueryResultRow;
|
|
287
315
|
}
|
|
288
316
|
function describeSqliteBoundaryError(boundary, errors, rowIndex) {
|
package/dist/lib/traceContext.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TraceContext Types and Prototype System
|
|
3
|
+
*
|
|
4
|
+
* Per specs/lmao/01c_context_flow_and_op_wrappers.md and specs/lmao/01l_op_context_pattern.md:
|
|
5
|
+
* - TraceContext is created via module.traceContext() at request entry
|
|
6
|
+
* - Uses prototype-based inheritance for V8 hidden class optimization
|
|
7
|
+
* - Contains system properties (traceId, timestamps, threadId) + user Extra
|
|
8
|
+
*/
|
|
1
9
|
// =============================================================================
|
|
2
10
|
// Prototype System for V8 Hidden Class Optimization
|
|
3
11
|
// =============================================================================
|
package/dist/lib/traceId.js
CHANGED
package/dist/lib/traceRoot.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Platform-specific implementations:
|
|
10
10
|
* - TraceRoot.es.ts: Browser - uses performance.now() for timing
|
|
11
|
-
* - TraceRoot.node.ts: Node.js -
|
|
11
|
+
* - TraceRoot.node.ts: Node.js - process.hrtime.bigint(), pure-JS writes to SpanBuffer state
|
|
12
12
|
*
|
|
13
13
|
* @module traceRoot
|
|
14
14
|
*/
|
|
@@ -47,7 +47,7 @@ export interface TracerLifecycleHooks {
|
|
|
47
47
|
*
|
|
48
48
|
* Total: 17 + trace_id.length bytes
|
|
49
49
|
*
|
|
50
|
-
* This layout enables
|
|
50
|
+
* This layout enables the WASM path to read anchors directly without BigInt extraction.
|
|
51
51
|
*/
|
|
52
52
|
export declare const TRACE_ROOT_ANCHOR_EPOCH_OFFSET = 0;
|
|
53
53
|
export declare const TRACE_ROOT_ANCHOR_PERF_OFFSET = 8;
|
|
@@ -58,7 +58,7 @@ export declare const TRACE_ROOT_TRACE_ID_OFFSET = 17;
|
|
|
58
58
|
*
|
|
59
59
|
* Each implementation handles timestamp calculation and span writes differently:
|
|
60
60
|
* - Browser: Pure JS with performance.now()
|
|
61
|
-
* - Node.js: NAPI addon
|
|
61
|
+
* - Node.js: process.hrtime.bigint() (pure JS; a NAPI addon was benchmarked slower than WASM and removed)
|
|
62
62
|
*/
|
|
63
63
|
/**
|
|
64
64
|
* Factory function type for creating platform-specific TraceRoot instances.
|
|
@@ -70,7 +70,7 @@ export type TraceRootFactory = (trace_id: string, tracer: TracerLifecycleHooks)
|
|
|
70
70
|
export interface ITraceRoot {
|
|
71
71
|
/**
|
|
72
72
|
* Raw backing buffer containing anchor timestamps and trace_id.
|
|
73
|
-
*
|
|
73
|
+
* The WASM path can read this directly without BigInt extraction.
|
|
74
74
|
*/
|
|
75
75
|
readonly _system: ArrayBuffer;
|
|
76
76
|
/**
|
|
@@ -89,7 +89,7 @@ export interface ITraceRoot {
|
|
|
89
89
|
/**
|
|
90
90
|
* High-resolution timer anchor when trace was created.
|
|
91
91
|
* Browser: performance.now() value (number)
|
|
92
|
-
* Node.js: stored as number
|
|
92
|
+
* Node.js: stored as number in the shared layout (WASM-readable), but represents hrtime
|
|
93
93
|
*/
|
|
94
94
|
readonly anchorPerfNow: number;
|
|
95
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceRoot.es.d.ts","sourceRoot":"","sources":["../../src/lib/traceRoot.es.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,KAAK,UAAU,EAKf,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,UAAU;IAC1C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;
|
|
1
|
+
{"version":3,"file":"traceRoot.es.d.ts","sourceRoot":"","sources":["../../src/lib/traceRoot.es.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,KAAK,UAAU,EAKf,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,UAAU;IAC1C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IAEzC,YAAY,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAmB3G;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAGtB;IAGD;;;OAGG;IACH,iBAAiB,IAAI,WAAW,CAK/B;IAGD;;;;OAIG;IACH,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAY5D;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAG3D;IAED;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAM9D;CACF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAIzF"}
|
package/dist/lib/traceRoot.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region smoo/lmao!n/es-trace-root
|
|
2
2
|
/**
|
|
3
3
|
* TraceRoot - Browser/ES implementation.
|
|
4
4
|
*
|
|
@@ -130,3 +130,4 @@ export function createTraceRoot(trace_id, tracer) {
|
|
|
130
130
|
const anchorPerfNow = performance.now();
|
|
131
131
|
return new TraceRoot(createTraceId(trace_id), anchorEpochNanos, anchorPerfNow, tracer);
|
|
132
132
|
}
|
|
133
|
+
//#endregion smoo/lmao!n/es-trace-root
|
package/dist/lib/traceRoot.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TraceRoot - Platform-agnostic interface for trace anchoring and timestamp writes.
|
|
3
|
+
*
|
|
4
|
+
* TraceRoot manages:
|
|
5
|
+
* - Trace ID storage
|
|
6
|
+
* - Timestamp anchoring (epoch + high-res timer reference)
|
|
7
|
+
* - Writing span-start/span-end to SpanBuffer's _system columns
|
|
8
|
+
*
|
|
9
|
+
* Platform-specific implementations:
|
|
10
|
+
* - TraceRoot.es.ts: Browser - uses performance.now() for timing
|
|
11
|
+
* - TraceRoot.node.ts: Node.js - process.hrtime.bigint(), pure-JS writes to SpanBuffer state
|
|
12
|
+
*
|
|
13
|
+
* @module traceRoot
|
|
14
|
+
*/
|
|
1
15
|
// Re-export TraceId types from traceId.ts
|
|
2
16
|
export { createTraceId, extractSpanIdentity, generateTraceId, isValidTraceId, MAX_TRACE_ID_LENGTH } from './traceId.js';
|
|
3
17
|
//#endregion smoo/lmao!n/buffer-tuning-observability
|
|
@@ -12,10 +26,11 @@ export { createTraceId, extractSpanIdentity, generateTraceId, isValidTraceId, MA
|
|
|
12
26
|
*
|
|
13
27
|
* Total: 17 + trace_id.length bytes
|
|
14
28
|
*
|
|
15
|
-
* This layout enables
|
|
29
|
+
* This layout enables the WASM path to read anchors directly without BigInt extraction.
|
|
16
30
|
*/
|
|
17
31
|
//#region smoo/lmao!n/trace-root-timestamps #contract
|
|
18
32
|
export const TRACE_ROOT_ANCHOR_EPOCH_OFFSET = 0;
|
|
19
33
|
export const TRACE_ROOT_ANCHOR_PERF_OFFSET = 8;
|
|
20
34
|
export const TRACE_ROOT_TRACE_ID_LEN_OFFSET = 16;
|
|
21
35
|
export const TRACE_ROOT_TRACE_ID_OFFSET = 17;
|
|
36
|
+
//#endregion smoo/lmao!n/trace-root-timestamps
|