apps 0.0.1-beta.0 → 0.0.1-beta.2
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/README.md +97 -4
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
- package/js/chunk-5MQZEB6Y.js +172 -0
- package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
- package/js/chunk-CZ7CSFO4.js +39 -0
- package/js/chunk-D47C7KG5.js +172 -0
- package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
- package/js/chunk-FDNTX5QJ.js +78 -0
- package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
- package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
- package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
- package/js/{chunk-WIDTG42X.js → chunk-HDTGZWP2.js} +79 -26
- package/js/{chunk-Q2FD5IBM.js → chunk-J7O55ZV7.js} +298 -37
- package/js/{chunk-X3YBZCJW.js → chunk-JN55AYQH.js} +8 -41
- package/js/chunk-LGIYBDWA.js +85 -0
- package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
- package/js/{chunk-HP7E42X6.js → chunk-MYYEW3RA.js} +767 -249
- package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
- package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
- package/js/{chunk-C24KEZXR.js → chunk-PYUYJRSK.js} +36 -2
- package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
- package/js/{chunk-KWTCHVLT.js → chunk-RN2MXB4R.js} +47 -51
- package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
- package/js/chunk-SWPD52J7.js +35 -0
- package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
- package/js/chunk-UVL56Z6E.js +6641 -0
- package/js/chunk-W7D7WVSY.js +18 -0
- package/js/{chunk-BPEFS4YF.js → chunk-WFSQXYUT.js} +109 -17
- package/js/chunk-YEJOQEII.js +104 -0
- package/js/{chunk-LOKGDT6B.js → chunk-Z5NMEGJN.js} +5 -4
- package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
- package/js/chunk-ZJWDMTE3.js +63 -0
- package/js/client.js +11 -11
- package/js/contracts.js +88 -25
- package/js/effect.js +21 -15
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +224 -121
- package/js/host.js +76 -19
- package/js/index.js +193 -51
- package/js/mcp/effect.js +25 -17
- package/js/mcp/stdio.js +23 -17
- package/js/mcp.js +110 -24
- package/js/openapi.js +3045 -105
- package/js/operations/approval.js +1 -1
- package/js/react.js +4 -4
- package/js/skills/effect.js +11 -0
- package/js/skills.js +894 -0
- package/js/storage/facet.js +7 -7
- package/js/ui/auth/contracts.js +6 -6
- package/js/ui/auth.js +8 -8
- package/js/ui/contracts.js +5 -5
- package/js/ui/serving.js +12 -12
- package/package.json +9 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +119 -0
- package/types/app-cache/src/index.d.ts +93 -0
- package/types/apps/src/contracts/api-response-error.d.ts +43 -0
- package/types/apps/src/contracts/app.d.ts +11 -0
- package/types/apps/src/contracts/cache.d.ts +44 -0
- package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
- package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
- package/types/apps/src/contracts/graphql.d.ts +18 -1
- package/types/apps/src/contracts/host.d.ts +54 -525
- package/types/apps/src/contracts/mcp.d.ts +3 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
- package/types/apps/src/contracts/openapi-document.d.ts +53 -0
- package/types/apps/src/contracts/openapi.d.ts +156 -30
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
- package/types/apps/src/contracts/provider-error.d.ts +15 -0
- package/types/apps/src/contracts/provider.d.ts +18 -1
- package/types/apps/src/contracts/skills.d.ts +122 -0
- package/types/apps/src/contracts/swagger-client.d.ts +29 -0
- package/types/apps/src/graphql.d.ts +6 -6
- package/types/apps/src/host.d.ts +1 -0
- package/types/apps/src/implementation/account-operations.d.ts +122 -3
- package/types/apps/src/implementation/app.d.ts +1 -1
- package/types/apps/src/implementation/cache-session.d.ts +7 -0
- package/types/apps/src/implementation/cache.d.ts +8 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
- package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
- package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
- package/types/apps/src/implementation/elicitation.d.ts +12 -12
- package/types/apps/src/implementation/git.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
- package/types/apps/src/implementation/graphql.d.ts +81 -3
- package/types/apps/src/implementation/inflate.d.ts +16 -0
- package/types/apps/src/implementation/input-problems.d.ts +3 -0
- package/types/apps/src/implementation/mcp-call.d.ts +3 -2
- package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
- package/types/apps/src/implementation/mcp-client.d.ts +9 -8
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
- package/types/apps/src/implementation/mcp.d.ts +39 -2
- package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
- package/types/apps/src/implementation/openapi-document.d.ts +51 -0
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -4
- package/types/apps/src/implementation/openapi-source.d.ts +40 -0
- package/types/apps/src/implementation/openapi.d.ts +39 -3
- package/types/apps/src/implementation/provider-error.d.ts +10 -0
- package/types/apps/src/implementation/schema.d.ts +6 -5
- package/types/apps/src/implementation/skill-files.d.ts +10 -0
- package/types/apps/src/implementation/skills.d.ts +43 -0
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/index.d.ts +7 -0
- package/types/apps/src/mcp.d.ts +5 -5
- package/types/apps/src/openapi.d.ts +3 -1
- package/types/apps/src/skills.d.ts +75 -0
- package/types/telemetry/src/config.d.ts +2 -0
- package/js/chunk-22WRQZT7.js +0 -389
- package/js/chunk-MLKGABMK.js +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FetchHttpClient_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HDJH3RPR.js";
|
|
4
4
|
import {
|
|
5
5
|
HttpBody_exports,
|
|
6
6
|
HttpClient,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
setBody,
|
|
19
19
|
transformResponse,
|
|
20
20
|
uint8Array
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QKHR7BMF.js";
|
|
22
22
|
import {
|
|
23
23
|
Array as Array2,
|
|
24
24
|
Boolean2 as Boolean,
|
|
@@ -125,10 +125,10 @@ import {
|
|
|
125
125
|
withDefault2 as withDefault,
|
|
126
126
|
withTracerEnabled,
|
|
127
127
|
zero
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-FW5HBOIK.js";
|
|
129
129
|
import {
|
|
130
130
|
__export
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-CZ7CSFO4.js";
|
|
132
132
|
|
|
133
133
|
// ../telemetry/src/context.ts
|
|
134
134
|
var captureTelemetry = Effect_exports.gen(function* () {
|
|
@@ -210,6 +210,7 @@ var invocationFetch = (signal) => Effect_exports.gen(function* () {
|
|
|
210
210
|
});
|
|
211
211
|
|
|
212
212
|
// ../telemetry/src/config.ts
|
|
213
|
+
var telemetryRequestTimeout = "5 seconds";
|
|
213
214
|
var Endpoint = Schema_exports.String.check(
|
|
214
215
|
Schema_exports.makeFilter(
|
|
215
216
|
(value) => {
|
|
@@ -725,7 +726,11 @@ var CurrentTelemetryClient = Context_exports.Reference(
|
|
|
725
726
|
var selectedClient = Layer_exports.unwrap(
|
|
726
727
|
CurrentTelemetryClient.pipe(
|
|
727
728
|
Effect_exports.map(
|
|
728
|
-
(client) =>
|
|
729
|
+
(client) => (
|
|
730
|
+
// Export-only RequestInit options, such as browser keepalive, must not
|
|
731
|
+
// enter product clients that share the page's Layer memo map.
|
|
732
|
+
client === void 0 ? Layer_exports.fresh(FetchHttpClient_exports.layer) : Layer_exports.succeed(HttpClient_exports.HttpClient, client)
|
|
733
|
+
)
|
|
729
734
|
)
|
|
730
735
|
)
|
|
731
736
|
);
|
|
@@ -812,10 +817,27 @@ var telemetryHttpClient = Layer_exports.effect(
|
|
|
812
817
|
HttpClient_exports.transform(
|
|
813
818
|
(response, request) => response.pipe(
|
|
814
819
|
Effect_exports.tap(acknowledge),
|
|
820
|
+
Effect_exports.timeout(telemetryRequestTimeout),
|
|
821
|
+
Effect_exports.catchTag(
|
|
822
|
+
"TimeoutError",
|
|
823
|
+
() => Effect_exports.fail(
|
|
824
|
+
new HttpClientError_exports.HttpClientError({
|
|
825
|
+
reason: new HttpClientError_exports.TransportError({
|
|
826
|
+
request,
|
|
827
|
+
description: "Telemetry collector acknowledgement timed out"
|
|
828
|
+
})
|
|
829
|
+
})
|
|
830
|
+
)
|
|
831
|
+
),
|
|
815
832
|
Effect_exports.tapError(
|
|
816
833
|
(error) => recordExportFailure(
|
|
817
834
|
new URL(request.url).pathname,
|
|
818
835
|
HttpClientError_exports.isHttpClientError(error) && error.reason instanceof HttpClientError_exports.DecodeError ? "acknowledgement" : "transport"
|
|
836
|
+
).pipe(
|
|
837
|
+
Effect_exports.annotateLogs({
|
|
838
|
+
"executor.telemetry.http_status": error.response?.status ?? 0,
|
|
839
|
+
"executor.telemetry.timed_out": error.reason instanceof HttpClientError_exports.TransportError && error.reason.description === "Telemetry collector acknowledgement timed out"
|
|
840
|
+
})
|
|
819
841
|
)
|
|
820
842
|
),
|
|
821
843
|
Effect_exports.onInterrupt(
|
|
@@ -919,7 +941,7 @@ var spanAttributes = (clock, recordAll = false) => Layer_exports.effect(Tracer_e
|
|
|
919
941
|
);
|
|
920
942
|
var allowlistedSpans = spanAttributes();
|
|
921
943
|
|
|
922
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
944
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpLogger.js
|
|
923
945
|
var OtlpLogger_exports = {};
|
|
924
946
|
__export(OtlpLogger_exports, {
|
|
925
947
|
layer: () => layer2,
|
|
@@ -927,7 +949,7 @@ __export(OtlpLogger_exports, {
|
|
|
927
949
|
make: () => make6
|
|
928
950
|
});
|
|
929
951
|
|
|
930
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
952
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/internal/otlpEnv.js
|
|
931
953
|
var exporterList = (path) => Array2(String2, path).pipe(map3((_) => _.map((_2) => _2.toLowerCase().trim()).filter((_2) => _2 !== "")));
|
|
932
954
|
var headersRecord = (path) => Record(String2, StringFromUriComponent, path);
|
|
933
955
|
var headers = (signal) => headersRecord(`OTEL_EXPORTER_OTLP_${signal}_HEADERS`).pipe(orElse(() => headersRecord("OTEL_EXPORTER_OTLP_HEADERS")), withDefault(void 0));
|
|
@@ -938,7 +960,7 @@ var endpoint = (signal) => URL2(`OTEL_EXPORTER_OTLP_${signal}_ENDPOINT`).pipe(or
|
|
|
938
960
|
}))), withDefault(void 0));
|
|
939
961
|
var exporters = (signal) => exporterList(`OTEL_${signal}_EXPORTER`).pipe(withDefault([]));
|
|
940
962
|
|
|
941
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
963
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpExporter.js
|
|
942
964
|
var OtlpExporter_exports = {};
|
|
943
965
|
__export(OtlpExporter_exports, {
|
|
944
966
|
Flusher: () => Flusher,
|
|
@@ -1050,7 +1072,7 @@ var make4 = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
1050
1072
|
};
|
|
1051
1073
|
});
|
|
1052
1074
|
|
|
1053
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1075
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpResource.js
|
|
1054
1076
|
var make5 = (options) => {
|
|
1055
1077
|
const resourceAttributes = options.attributes ? entriesToAttributes(Object.entries(options.attributes)) : [];
|
|
1056
1078
|
resourceAttributes.push({
|
|
@@ -1139,7 +1161,7 @@ var unknownToAttributeValue = (value) => {
|
|
|
1139
1161
|
}
|
|
1140
1162
|
};
|
|
1141
1163
|
|
|
1142
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1164
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpSerialization.js
|
|
1143
1165
|
var OtlpSerialization_exports = {};
|
|
1144
1166
|
__export(OtlpSerialization_exports, {
|
|
1145
1167
|
OtlpSerialization: () => OtlpSerialization,
|
|
@@ -1147,7 +1169,7 @@ __export(OtlpSerialization_exports, {
|
|
|
1147
1169
|
layerProtobuf: () => layerProtobuf
|
|
1148
1170
|
});
|
|
1149
1171
|
|
|
1150
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1172
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/internal/protobuf.js
|
|
1151
1173
|
var WireType2 = {
|
|
1152
1174
|
Varint: 0,
|
|
1153
1175
|
Fixed64: 1,
|
|
@@ -1216,7 +1238,7 @@ var messageField = (fieldNumber, message) => lengthDelimitedField(fieldNumber, m
|
|
|
1216
1238
|
var repeatedField = (fieldNumber, values, encode) => concat(...values.map((v) => messageField(fieldNumber, encode(v))));
|
|
1217
1239
|
var optionalStringField = (fieldNumber, value) => value !== void 0 && value !== "" ? stringField(fieldNumber, value) : new Uint8Array(0);
|
|
1218
1240
|
|
|
1219
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1241
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/internal/otlpProtobuf.js
|
|
1220
1242
|
var encodeAnyValue = (value) => {
|
|
1221
1243
|
if (value.stringValue !== void 0 && value.stringValue !== null) {
|
|
1222
1244
|
return stringField(1, value.stringValue);
|
|
@@ -1271,7 +1293,7 @@ var encodeScopeLogs = (scopeLogs) => concat(messageField(1, encodeInstrumentatio
|
|
|
1271
1293
|
var encodeResourceLogs = (resourceLogs) => concat(messageField(1, encodeResource(resourceLogs.resource)), repeatedField(2, resourceLogs.scopeLogs, encodeScopeLogs), optionalStringField(3, resourceLogs.schemaUrl));
|
|
1272
1294
|
var encodeLogsData = (logsData) => repeatedField(1, logsData.resourceLogs, encodeResourceLogs);
|
|
1273
1295
|
|
|
1274
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1296
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpSerialization.js
|
|
1275
1297
|
var OtlpSerialization = class extends (/* @__PURE__ */ Service()("effect/observability/OtlpSerialization")) {
|
|
1276
1298
|
};
|
|
1277
1299
|
var layerJson = /* @__PURE__ */ succeed(OtlpSerialization, {
|
|
@@ -1285,7 +1307,7 @@ var layerProtobuf = /* @__PURE__ */ succeed(OtlpSerialization, {
|
|
|
1285
1307
|
logs: (logs) => uint8Array(encodeLogsData(logs), "application/x-protobuf")
|
|
1286
1308
|
});
|
|
1287
1309
|
|
|
1288
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1310
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpLogger.js
|
|
1289
1311
|
var make6 = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
1290
1312
|
const serialization = yield* OtlpSerialization;
|
|
1291
1313
|
const otelResource = yield* fromConfig(options.resource);
|
|
@@ -1451,7 +1473,7 @@ var ESeverityNumber = {
|
|
|
1451
1473
|
SEVERITY_NUMBER_FATAL4: 24
|
|
1452
1474
|
};
|
|
1453
1475
|
|
|
1454
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1476
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpMetrics.js
|
|
1455
1477
|
var OtlpMetrics_exports = {};
|
|
1456
1478
|
__export(OtlpMetrics_exports, {
|
|
1457
1479
|
layer: () => layer3,
|
|
@@ -1914,7 +1936,7 @@ var EAggregationTemporality = {
|
|
|
1914
1936
|
AGGREGATION_TEMPORALITY_CUMULATIVE: 2
|
|
1915
1937
|
};
|
|
1916
1938
|
|
|
1917
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1939
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/observability/OtlpTracer.js
|
|
1918
1940
|
var OtlpTracer_exports = {};
|
|
1919
1941
|
__export(OtlpTracer_exports, {
|
|
1920
1942
|
layer: () => layer4,
|
|
@@ -2259,31 +2281,25 @@ var TelemetryBatch = Schema_exports.Struct({
|
|
|
2259
2281
|
dropped: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
2260
2282
|
});
|
|
2261
2283
|
var collectTelemetry = (effect2) => Effect_exports.gen(function* () {
|
|
2262
|
-
const traces = [];
|
|
2263
|
-
const logs = [];
|
|
2284
|
+
const traces = recordPacker('{"resourceSpans":[{"scopeSpans":[{"spans":[', "]}]}]}");
|
|
2285
|
+
const logs = recordPacker('{"resourceLogs":[{"scopeLogs":[{"logRecords":[', "]}]}]}");
|
|
2264
2286
|
let dropped = 0;
|
|
2265
2287
|
const capture = async (input, init) => {
|
|
2266
2288
|
const request = new Request(input, init);
|
|
2267
2289
|
const body = await request.text();
|
|
2268
2290
|
if (new URL(request.url).pathname === "/v1/traces") {
|
|
2269
2291
|
const payload = Schema_exports.decodeUnknownSync(TracePayload)(body);
|
|
2270
|
-
dropped +=
|
|
2292
|
+
dropped += traces.append(
|
|
2271
2293
|
payload.resourceSpans.flatMap(
|
|
2272
2294
|
(resource) => resource.scopeSpans.flatMap((scope) => scope.spans)
|
|
2273
|
-
)
|
|
2274
|
-
traces,
|
|
2275
|
-
'{"resourceSpans":[{"scopeSpans":[{"spans":[',
|
|
2276
|
-
"]}]}]}"
|
|
2295
|
+
)
|
|
2277
2296
|
);
|
|
2278
2297
|
} else {
|
|
2279
2298
|
const payload = Schema_exports.decodeUnknownSync(LogPayload)(body);
|
|
2280
|
-
dropped +=
|
|
2299
|
+
dropped += logs.append(
|
|
2281
2300
|
payload.resourceLogs.flatMap(
|
|
2282
2301
|
(resource) => resource.scopeLogs.flatMap((scope) => scope.logRecords)
|
|
2283
|
-
)
|
|
2284
|
-
logs,
|
|
2285
|
-
'{"resourceLogs":[{"scopeLogs":[{"logRecords":[',
|
|
2286
|
-
"]}]}]}"
|
|
2302
|
+
)
|
|
2287
2303
|
);
|
|
2288
2304
|
}
|
|
2289
2305
|
return Response.json({});
|
|
@@ -2304,36 +2320,45 @@ var collectTelemetry = (effect2) => Effect_exports.gen(function* () {
|
|
|
2304
2320
|
),
|
|
2305
2321
|
Effect_exports.provideService(FetchHttpClient_exports.Fetch, capture)
|
|
2306
2322
|
);
|
|
2307
|
-
return { value, telemetry: { traces, logs, dropped } };
|
|
2323
|
+
return { value, telemetry: { traces: traces.finish(), logs: logs.finish(), dropped } };
|
|
2308
2324
|
});
|
|
2309
|
-
var
|
|
2325
|
+
var recordPacker = (prefix, suffix) => {
|
|
2326
|
+
const target = [];
|
|
2310
2327
|
let parts = [];
|
|
2311
2328
|
const overhead = encoder.encode(prefix + suffix).byteLength;
|
|
2312
2329
|
let bytes = overhead;
|
|
2313
|
-
let dropped = 0;
|
|
2314
2330
|
const flush = () => {
|
|
2315
2331
|
if (parts.length === 0) return;
|
|
2316
2332
|
target.push(prefix + parts.join(",") + suffix);
|
|
2317
2333
|
parts = [];
|
|
2318
2334
|
bytes = overhead;
|
|
2319
2335
|
};
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2336
|
+
return {
|
|
2337
|
+
append(records) {
|
|
2338
|
+
let dropped = 0;
|
|
2339
|
+
for (const record of records) {
|
|
2340
|
+
const encoded = JSON.stringify(record);
|
|
2341
|
+
const size = encoder.encode(encoded).byteLength;
|
|
2342
|
+
if (size + overhead > payloadBytes || target.length >= 4) {
|
|
2343
|
+
dropped++;
|
|
2344
|
+
continue;
|
|
2345
|
+
}
|
|
2346
|
+
if (parts.length >= 1e3 || bytes + size + (parts.length > 0 ? 1 : 0) > payloadBytes)
|
|
2347
|
+
flush();
|
|
2348
|
+
if (target.length >= 4) {
|
|
2349
|
+
dropped++;
|
|
2350
|
+
continue;
|
|
2351
|
+
}
|
|
2352
|
+
bytes += size + (parts.length > 0 ? 1 : 0);
|
|
2353
|
+
parts.push(encoded);
|
|
2354
|
+
}
|
|
2355
|
+
return dropped;
|
|
2356
|
+
},
|
|
2357
|
+
finish() {
|
|
2358
|
+
flush();
|
|
2359
|
+
return target;
|
|
2331
2360
|
}
|
|
2332
|
-
|
|
2333
|
-
parts.push(encoded);
|
|
2334
|
-
}
|
|
2335
|
-
flush();
|
|
2336
|
-
return dropped;
|
|
2361
|
+
};
|
|
2337
2362
|
};
|
|
2338
2363
|
var HexTrace = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{32}$/));
|
|
2339
2364
|
var HexSpan = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{16}$/));
|
|
@@ -2381,46 +2406,50 @@ var forwardTelemetry = (batch, traceId, build, service = "executor-app") => Effe
|
|
|
2381
2406
|
if (batch.dropped > 0) yield* recordExportFailure("app", "capacity", batch.dropped);
|
|
2382
2407
|
for (const signal of ["traces", "logs"]) {
|
|
2383
2408
|
const target = config[signal];
|
|
2384
|
-
if (target === void 0) continue;
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2409
|
+
if (target === void 0 || batch[signal].length === 0) continue;
|
|
2410
|
+
const data = signal === "traces" ? yield* Effect_exports.forEach(
|
|
2411
|
+
batch.traces,
|
|
2412
|
+
(body) => Schema_exports.decodeUnknownEffect(TracePayload)(body)
|
|
2413
|
+
).pipe(
|
|
2414
|
+
Effect_exports.map((payloads) => ({
|
|
2415
|
+
resourceSpans: [
|
|
2416
|
+
{
|
|
2417
|
+
resource,
|
|
2418
|
+
scopeSpans: [
|
|
2419
|
+
{
|
|
2420
|
+
scope: { name: service },
|
|
2421
|
+
spans: payloads.flatMap((payload) => payload.resourceSpans).flatMap((r) => r.scopeSpans.flatMap((s) => s.spans)).filter((span) => traceId === void 0 || span.traceId === traceId)
|
|
2422
|
+
}
|
|
2423
|
+
]
|
|
2424
|
+
}
|
|
2425
|
+
]
|
|
2426
|
+
}))
|
|
2427
|
+
) : yield* Effect_exports.forEach(
|
|
2428
|
+
batch.logs,
|
|
2429
|
+
(body) => Schema_exports.decodeUnknownEffect(LogPayload)(body)
|
|
2430
|
+
).pipe(
|
|
2431
|
+
Effect_exports.map((payloads) => ({
|
|
2432
|
+
resourceLogs: [
|
|
2433
|
+
{
|
|
2434
|
+
resource,
|
|
2435
|
+
scopeLogs: [
|
|
2436
|
+
{
|
|
2437
|
+
scope: { name: service },
|
|
2438
|
+
logRecords: payloads.flatMap((payload) => payload.resourceLogs).flatMap((r) => r.scopeLogs.flatMap((s) => s.logRecords)).filter((log) => traceId === void 0 || log.traceId === traceId)
|
|
2439
|
+
}
|
|
2440
|
+
]
|
|
2441
|
+
}
|
|
2442
|
+
]
|
|
2443
|
+
}))
|
|
2444
|
+
);
|
|
2445
|
+
yield* client.pipe(HttpClient_exports.filterStatusOk).execute(
|
|
2446
|
+
HttpClientRequest_exports.post(target.url).pipe(
|
|
2447
|
+
HttpClientRequest_exports.setHeaders(
|
|
2448
|
+
target.headers === void 0 ? {} : Redacted_exports.value(target.headers)
|
|
2449
|
+
),
|
|
2450
|
+
HttpClientRequest_exports.bodyJsonUnsafe(data)
|
|
2451
|
+
)
|
|
2452
|
+
);
|
|
2424
2453
|
}
|
|
2425
2454
|
}).pipe(
|
|
2426
2455
|
Effect_exports.provide(telemetryHttpClient),
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProviderError
|
|
3
|
+
} from "./chunk-W7D7WVSY.js";
|
|
4
|
+
import {
|
|
5
|
+
AccountId
|
|
6
|
+
} from "./chunk-SATWJKN6.js";
|
|
7
|
+
import {
|
|
8
|
+
Option_exports,
|
|
9
|
+
Schema_exports
|
|
10
|
+
} from "./chunk-FW5HBOIK.js";
|
|
11
|
+
|
|
12
|
+
// src/implementation/provider-error.ts
|
|
13
|
+
function parseProviderError(error) {
|
|
14
|
+
return Schema_exports.decodeUnknownOption(ProviderError)(error).pipe(
|
|
15
|
+
Option_exports.map(({ reason, status, accountId }) => new ProviderError({ reason, status, accountId }))
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function httpProviderError(status, headers = {}) {
|
|
19
|
+
if (status >= 500 && status <= 599) return new ProviderError({ reason: "unavailable", status });
|
|
20
|
+
if (status === 401) return new ProviderError({ reason: "unauthorized", status });
|
|
21
|
+
if (status === 429) return new ProviderError({ reason: "rate_limited", status });
|
|
22
|
+
if (status !== 403) return void 0;
|
|
23
|
+
const retry = headers["retry-after"];
|
|
24
|
+
if (headers["x-ratelimit-remaining"] === "0" || retry !== void 0 && (/^\d+$/.test(retry) || Number.isFinite(Date.parse(retry))))
|
|
25
|
+
return new ProviderError({ reason: "rate_limited", status });
|
|
26
|
+
if (/\bBearer\b.*\berror="insufficient_scope"/i.test(headers["www-authenticate"] ?? ""))
|
|
27
|
+
return new ProviderError({ reason: "forbidden", status });
|
|
28
|
+
return new ProviderError({ reason: "rejected", status });
|
|
29
|
+
}
|
|
30
|
+
function accountProviderError(error, accountId) {
|
|
31
|
+
const parsed = parseProviderError(error);
|
|
32
|
+
const account = Schema_exports.decodeUnknownOption(AccountId)(accountId);
|
|
33
|
+
if (Option_exports.isNone(parsed) || Option_exports.isNone(account)) return error;
|
|
34
|
+
return new ProviderError({
|
|
35
|
+
reason: parsed.value.reason,
|
|
36
|
+
status: parsed.value.status,
|
|
37
|
+
accountId: account.value
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function graphqlProviderError(errors, status) {
|
|
41
|
+
const codes = errors.flatMap((error) => {
|
|
42
|
+
const parsed = Schema_exports.decodeUnknownOption(
|
|
43
|
+
Schema_exports.Struct({
|
|
44
|
+
type: Schema_exports.optional(Schema_exports.String),
|
|
45
|
+
extensions: Schema_exports.optional(Schema_exports.Struct({ code: Schema_exports.optional(Schema_exports.String) }))
|
|
46
|
+
})
|
|
47
|
+
)(error);
|
|
48
|
+
return Option_exports.isSome(parsed) ? [parsed.value.type, parsed.value.extensions?.code] : [];
|
|
49
|
+
});
|
|
50
|
+
if (codes.includes("RATE_LIMITED") || codes.includes("TOO_MANY_REQUESTS"))
|
|
51
|
+
return new ProviderError({ reason: "rate_limited", status });
|
|
52
|
+
if (codes.includes("UNAUTHENTICATED"))
|
|
53
|
+
return new ProviderError({ reason: "unauthorized", status });
|
|
54
|
+
if (codes.includes("FORBIDDEN")) return new ProviderError({ reason: "forbidden", status });
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
parseProviderError,
|
|
60
|
+
httpProviderError,
|
|
61
|
+
accountProviderError,
|
|
62
|
+
graphqlProviderError
|
|
63
|
+
};
|
package/js/client.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
UiContext,
|
|
5
5
|
UiDeploymentChanged,
|
|
6
6
|
UiFailed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OHRT55C4.js";
|
|
8
8
|
import {
|
|
9
9
|
AsyncResult_exports,
|
|
10
10
|
AtomRegistry_exports,
|
|
11
11
|
Atom_exports,
|
|
12
12
|
queryResult
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-EVJUVWN2.js";
|
|
14
|
+
import "./chunk-M6ZRRIBI.js";
|
|
15
15
|
import {
|
|
16
16
|
OtlpExporter_exports,
|
|
17
17
|
TraceContext,
|
|
@@ -19,22 +19,22 @@ import {
|
|
|
19
19
|
pendingSpan,
|
|
20
20
|
telemetryLayer,
|
|
21
21
|
traceLinks
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZCAMUXSG.js";
|
|
23
23
|
import {
|
|
24
24
|
FetchHttpClient_exports
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HDJH3RPR.js";
|
|
26
26
|
import {
|
|
27
27
|
HttpClientError_exports
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-QKHR7BMF.js";
|
|
29
29
|
import {
|
|
30
30
|
decoderOf
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WFSQXYUT.js";
|
|
32
32
|
import {
|
|
33
33
|
StorageName
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-FZJOYIZO.js";
|
|
35
35
|
import {
|
|
36
36
|
JsonValue
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SATWJKN6.js";
|
|
38
38
|
import {
|
|
39
39
|
Cause_exports,
|
|
40
40
|
Clock_exports,
|
|
@@ -52,8 +52,8 @@ import {
|
|
|
52
52
|
Semaphore_exports,
|
|
53
53
|
Stream_exports,
|
|
54
54
|
Tracer_exports
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-FW5HBOIK.js";
|
|
56
|
+
import "./chunk-CZ7CSFO4.js";
|
|
57
57
|
|
|
58
58
|
// src/contracts/live.ts
|
|
59
59
|
var AppQueryFailed = class extends Schema_exports.TaggedError()("AppQueryFailed", {}) {
|