@absolutejs/voice 0.0.22-beta.240 → 0.0.22-beta.242
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/index.d.ts +2 -0
- package/dist/index.js +184 -71
- package/dist/proofTrends.d.ts +108 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export { buildVoiceDeliverySinkReport, createVoiceDeliverySinkDescriptor, create
|
|
|
16
16
|
export { buildVoiceOpsActionHistoryReport, createVoiceOpsActionAuditRoutes, recordVoiceOpsActionAudit, renderVoiceOpsActionHistoryHTML } from './opsActionAuditRoutes';
|
|
17
17
|
export { buildVoicePlatformCoverageSummary, createVoicePlatformCoverageRoutes } from './platformCoverage';
|
|
18
18
|
export type { VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
|
|
19
|
+
export { buildEmptyVoiceProofTrendReport, buildVoiceProofTrendReport, createVoiceProofTrendRoutes, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, formatVoiceProofTrendAge, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile } from './proofTrends';
|
|
20
|
+
export type { VoiceProofTrendCycle, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendStatus, VoiceProofTrendSummary } from './proofTrends';
|
|
19
21
|
export { buildVoiceLiveOpsControlState, createVoiceLiveOpsController, createVoiceLiveOpsRoutes, createVoiceMemoryLiveOpsControlStore, getVoiceLiveOpsControlStatus, VOICE_LIVE_OPS_ACTIONS } from './liveOps';
|
|
20
22
|
export type { VoiceLiveOpsAction, VoiceLiveOpsActionInput, VoiceLiveOpsActionResult, VoiceLiveOpsControllerOptions, VoiceLiveOpsControlState, VoiceLiveOpsControlStatus, VoiceLiveOpsControlStore, VoiceLiveOpsRoutesOptions } from './liveOps';
|
|
21
23
|
export { buildVoiceDeliveryRuntimeReport, createVoiceDeliveryRuntime, createVoiceDeliveryRuntimePresetConfig, createVoiceDeliveryRuntimeRoutes, renderVoiceDeliveryRuntimeHTML } from './deliveryRuntime';
|
package/dist/index.js
CHANGED
|
@@ -12291,8 +12291,114 @@ var createVoicePlatformCoverageRoutes = (options) => {
|
|
|
12291
12291
|
});
|
|
12292
12292
|
return routes;
|
|
12293
12293
|
};
|
|
12294
|
-
// src/
|
|
12294
|
+
// src/proofTrends.ts
|
|
12295
12295
|
import { Elysia as Elysia14 } from "elysia";
|
|
12296
|
+
var DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
12297
|
+
var normalizeMaxAgeMs = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? value : DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS;
|
|
12298
|
+
var toTimeMs = (value) => {
|
|
12299
|
+
if (value instanceof Date) {
|
|
12300
|
+
return value.getTime();
|
|
12301
|
+
}
|
|
12302
|
+
if (typeof value === "number") {
|
|
12303
|
+
return value;
|
|
12304
|
+
}
|
|
12305
|
+
if (typeof value === "string") {
|
|
12306
|
+
return Date.parse(value);
|
|
12307
|
+
}
|
|
12308
|
+
return Date.now();
|
|
12309
|
+
};
|
|
12310
|
+
var buildVoiceProofTrendReport = (input = {}) => {
|
|
12311
|
+
const maxAgeMs = normalizeMaxAgeMs(input.maxAgeMs);
|
|
12312
|
+
const nowMs = toTimeMs(input.now);
|
|
12313
|
+
const generatedAtMs = typeof input.generatedAt === "string" ? Date.parse(input.generatedAt) : Number.NaN;
|
|
12314
|
+
const ageMs = Number.isFinite(generatedAtMs) && Number.isFinite(nowMs) ? Math.max(0, nowMs - generatedAtMs) : undefined;
|
|
12315
|
+
const freshUntil = Number.isFinite(generatedAtMs) && Number.isFinite(maxAgeMs) ? new Date(generatedAtMs + maxAgeMs).toISOString() : undefined;
|
|
12316
|
+
const isFresh = ageMs !== undefined && ageMs <= maxAgeMs;
|
|
12317
|
+
const status = input.status === "empty" ? "empty" : !isFresh ? "stale" : input.ok === true ? "pass" : "fail";
|
|
12318
|
+
return {
|
|
12319
|
+
ageMs,
|
|
12320
|
+
baseUrl: input.baseUrl,
|
|
12321
|
+
cycles: input.cycles ?? [],
|
|
12322
|
+
freshUntil,
|
|
12323
|
+
generatedAt: input.generatedAt,
|
|
12324
|
+
maxAgeMs,
|
|
12325
|
+
ok: input.ok === true && status === "pass",
|
|
12326
|
+
outputDir: input.outputDir,
|
|
12327
|
+
runId: input.runId,
|
|
12328
|
+
source: input.source ?? "",
|
|
12329
|
+
status,
|
|
12330
|
+
summary: input.summary ?? {}
|
|
12331
|
+
};
|
|
12332
|
+
};
|
|
12333
|
+
var buildEmptyVoiceProofTrendReport = (source = "", maxAgeMs) => buildVoiceProofTrendReport({
|
|
12334
|
+
maxAgeMs,
|
|
12335
|
+
source,
|
|
12336
|
+
status: "empty"
|
|
12337
|
+
});
|
|
12338
|
+
var normalizeVoiceProofTrendReport = (value, options = {}) => {
|
|
12339
|
+
if ("status" in value && value.status === "empty") {
|
|
12340
|
+
return buildEmptyVoiceProofTrendReport(value.source || options.source || "", options.maxAgeMs ?? value.maxAgeMs);
|
|
12341
|
+
}
|
|
12342
|
+
return buildVoiceProofTrendReport({
|
|
12343
|
+
...value,
|
|
12344
|
+
maxAgeMs: options.maxAgeMs ?? value.maxAgeMs,
|
|
12345
|
+
source: value.source ?? options.source
|
|
12346
|
+
});
|
|
12347
|
+
};
|
|
12348
|
+
var readVoiceProofTrendReportFile = async (path, options = {}) => {
|
|
12349
|
+
const file = Bun.file(path);
|
|
12350
|
+
if (!await file.exists()) {
|
|
12351
|
+
return buildEmptyVoiceProofTrendReport(path, options.maxAgeMs);
|
|
12352
|
+
}
|
|
12353
|
+
try {
|
|
12354
|
+
const parsed = await file.json();
|
|
12355
|
+
return normalizeVoiceProofTrendReport(parsed, {
|
|
12356
|
+
maxAgeMs: options.maxAgeMs,
|
|
12357
|
+
source: path
|
|
12358
|
+
});
|
|
12359
|
+
} catch {
|
|
12360
|
+
return buildVoiceProofTrendReport({
|
|
12361
|
+
maxAgeMs: options.maxAgeMs,
|
|
12362
|
+
source: path
|
|
12363
|
+
});
|
|
12364
|
+
}
|
|
12365
|
+
};
|
|
12366
|
+
var createVoiceProofTrendRoutes = (options) => {
|
|
12367
|
+
const path = options.path ?? "/api/voice/proof-trends";
|
|
12368
|
+
const routes = new Elysia14({
|
|
12369
|
+
name: options.name ?? "absolutejs-voice-proof-trends"
|
|
12370
|
+
});
|
|
12371
|
+
routes.get(path, async () => {
|
|
12372
|
+
const value = options.source !== undefined ? typeof options.source === "function" ? await options.source() : options.source : options.jsonPath ? await readVoiceProofTrendReportFile(options.jsonPath, {
|
|
12373
|
+
maxAgeMs: options.maxAgeMs
|
|
12374
|
+
}) : buildEmptyVoiceProofTrendReport("", options.maxAgeMs);
|
|
12375
|
+
return Response.json(normalizeVoiceProofTrendReport(value, {
|
|
12376
|
+
maxAgeMs: options.maxAgeMs,
|
|
12377
|
+
source: options.jsonPath
|
|
12378
|
+
}), { headers: options.headers });
|
|
12379
|
+
});
|
|
12380
|
+
return routes;
|
|
12381
|
+
};
|
|
12382
|
+
var formatVoiceProofTrendAge = (ageMs) => {
|
|
12383
|
+
if (typeof ageMs !== "number" || !Number.isFinite(ageMs)) {
|
|
12384
|
+
return "unknown";
|
|
12385
|
+
}
|
|
12386
|
+
const minutes = Math.floor(ageMs / 60000);
|
|
12387
|
+
if (minutes < 1) {
|
|
12388
|
+
return "less than 1m";
|
|
12389
|
+
}
|
|
12390
|
+
if (minutes < 60) {
|
|
12391
|
+
return `${minutes}m`;
|
|
12392
|
+
}
|
|
12393
|
+
const hours = Math.floor(minutes / 60);
|
|
12394
|
+
if (hours < 48) {
|
|
12395
|
+
return `${hours}h ${minutes % 60}m`;
|
|
12396
|
+
}
|
|
12397
|
+
const days = Math.floor(hours / 24);
|
|
12398
|
+
return `${days}d ${hours % 24}h`;
|
|
12399
|
+
};
|
|
12400
|
+
// src/liveOps.ts
|
|
12401
|
+
import { Elysia as Elysia15 } from "elysia";
|
|
12296
12402
|
var VOICE_LIVE_OPS_ACTIONS = [
|
|
12297
12403
|
"assign",
|
|
12298
12404
|
"create-task",
|
|
@@ -12457,7 +12563,7 @@ var createVoiceLiveOpsRoutes = (options = {}) => {
|
|
|
12457
12563
|
const controller = createVoiceLiveOpsController(options);
|
|
12458
12564
|
const path = options.path ?? "/api/voice/live-ops/action";
|
|
12459
12565
|
const controlPath = options.controlPath ?? "/api/voice/live-ops/control/:sessionId";
|
|
12460
|
-
return new
|
|
12566
|
+
return new Elysia15({
|
|
12461
12567
|
name: options.name ?? "absolutejs-voice-live-ops"
|
|
12462
12568
|
}).post(path, async ({ request, set }) => {
|
|
12463
12569
|
try {
|
|
@@ -12479,7 +12585,7 @@ var createVoiceLiveOpsRoutes = (options = {}) => {
|
|
|
12479
12585
|
});
|
|
12480
12586
|
};
|
|
12481
12587
|
// src/deliveryRuntime.ts
|
|
12482
|
-
import { Elysia as
|
|
12588
|
+
import { Elysia as Elysia16 } from "elysia";
|
|
12483
12589
|
import { mkdir } from "fs/promises";
|
|
12484
12590
|
import { dirname, join } from "path";
|
|
12485
12591
|
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
@@ -12733,7 +12839,7 @@ var createVoiceDeliveryRuntimeRoutes = (options) => {
|
|
|
12733
12839
|
const htmlPath = options.htmlPath === undefined ? "/delivery-runtime" : options.htmlPath;
|
|
12734
12840
|
const tickPath = options.tickPath === undefined ? "/api/voice-delivery-runtime/tick" : options.tickPath;
|
|
12735
12841
|
const requeueDeadLettersPath = options.requeueDeadLettersPath === undefined ? "/api/voice-delivery-runtime/requeue-dead-letters" : options.requeueDeadLettersPath;
|
|
12736
|
-
const routes = new
|
|
12842
|
+
const routes = new Elysia16({
|
|
12737
12843
|
name: options.name ?? "absolutejs-voice-delivery-runtime"
|
|
12738
12844
|
}).get(path, () => buildVoiceDeliveryRuntimeReport(options.runtime));
|
|
12739
12845
|
if (tickPath !== false) {
|
|
@@ -12769,7 +12875,7 @@ var createVoiceDeliveryRuntimeRoutes = (options) => {
|
|
|
12769
12875
|
return routes;
|
|
12770
12876
|
};
|
|
12771
12877
|
// src/dataControl.ts
|
|
12772
|
-
import { Elysia as
|
|
12878
|
+
import { Elysia as Elysia17 } from "elysia";
|
|
12773
12879
|
var voiceComplianceRedactionDefaults = {
|
|
12774
12880
|
keys: [
|
|
12775
12881
|
"apiKey",
|
|
@@ -13176,7 +13282,7 @@ var parseRetentionPolicyBody = (body, options, dryRun) => {
|
|
|
13176
13282
|
var createVoiceDataControlRoutes = (options) => {
|
|
13177
13283
|
const path = options.path ?? "/data-control";
|
|
13178
13284
|
const title = options.title ?? "AbsoluteJS Voice Data Control";
|
|
13179
|
-
const routes = new
|
|
13285
|
+
const routes = new Elysia17({
|
|
13180
13286
|
name: options.name ?? "absolutejs-voice-data-control"
|
|
13181
13287
|
});
|
|
13182
13288
|
routes.get(path, async ({ query }) => {
|
|
@@ -13249,15 +13355,15 @@ var createVoiceDataControlRoutes = (options) => {
|
|
|
13249
13355
|
return routes;
|
|
13250
13356
|
};
|
|
13251
13357
|
// src/evalRoutes.ts
|
|
13252
|
-
import { Elysia as
|
|
13358
|
+
import { Elysia as Elysia20 } from "elysia";
|
|
13253
13359
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
13254
13360
|
import { dirname as dirname2 } from "path";
|
|
13255
13361
|
|
|
13256
13362
|
// src/qualityRoutes.ts
|
|
13257
|
-
import { Elysia as
|
|
13363
|
+
import { Elysia as Elysia19 } from "elysia";
|
|
13258
13364
|
|
|
13259
13365
|
// src/handoffHealth.ts
|
|
13260
|
-
import { Elysia as
|
|
13366
|
+
import { Elysia as Elysia18 } from "elysia";
|
|
13261
13367
|
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
13262
13368
|
var getString7 = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
|
|
13263
13369
|
var isStatus = (value) => value === "delivered" || value === "failed" || value === "skipped";
|
|
@@ -13440,7 +13546,7 @@ var createVoiceHandoffHealthHTMLHandler = (options = {}) => async ({ query }) =>
|
|
|
13440
13546
|
var createVoiceHandoffHealthRoutes = (options = {}) => {
|
|
13441
13547
|
const path = options.path ?? "/api/voice-handoffs";
|
|
13442
13548
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
13443
|
-
const routes = new
|
|
13549
|
+
const routes = new Elysia18({
|
|
13444
13550
|
name: options.name ?? "absolutejs-voice-handoff-health"
|
|
13445
13551
|
}).get(path, createVoiceHandoffHealthJSONHandler(options));
|
|
13446
13552
|
if (htmlPath) {
|
|
@@ -13571,7 +13677,7 @@ var renderVoiceQualityHTML = (report, options = {}) => {
|
|
|
13571
13677
|
};
|
|
13572
13678
|
var createVoiceQualityRoutes = (options) => {
|
|
13573
13679
|
const path = options.path ?? "/quality";
|
|
13574
|
-
const routes = new
|
|
13680
|
+
const routes = new Elysia19({
|
|
13575
13681
|
name: options.name ?? "absolutejs-voice-quality"
|
|
13576
13682
|
});
|
|
13577
13683
|
const getReport = () => evaluateVoiceQuality({
|
|
@@ -13984,7 +14090,7 @@ var renderVoiceScenarioFixtureEvalHTML = (report, options = {}) => {
|
|
|
13984
14090
|
};
|
|
13985
14091
|
var createVoiceEvalRoutes = (options) => {
|
|
13986
14092
|
const path = options.path ?? "/evals";
|
|
13987
|
-
const routes = new
|
|
14093
|
+
const routes = new Elysia20({
|
|
13988
14094
|
name: options.name ?? "absolutejs-voice-evals"
|
|
13989
14095
|
});
|
|
13990
14096
|
const getReport = () => runVoiceSessionEvals({
|
|
@@ -14121,10 +14227,10 @@ var createVoiceEvalRoutes = (options) => {
|
|
|
14121
14227
|
return routes;
|
|
14122
14228
|
};
|
|
14123
14229
|
// src/simulationSuite.ts
|
|
14124
|
-
import { Elysia as
|
|
14230
|
+
import { Elysia as Elysia23 } from "elysia";
|
|
14125
14231
|
|
|
14126
14232
|
// src/outcomeContract.ts
|
|
14127
|
-
import { Elysia as
|
|
14233
|
+
import { Elysia as Elysia21 } from "elysia";
|
|
14128
14234
|
var escapeHtml21 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
14129
14235
|
var resolveSessionHref2 = (value, sessionId) => {
|
|
14130
14236
|
if (value === false) {
|
|
@@ -14290,7 +14396,7 @@ var createVoiceOutcomeContractHTMLHandler = (options) => async () => {
|
|
|
14290
14396
|
var createVoiceOutcomeContractRoutes = (options) => {
|
|
14291
14397
|
const path = options.path ?? "/api/outcome-contracts";
|
|
14292
14398
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
14293
|
-
const routes = new
|
|
14399
|
+
const routes = new Elysia21({
|
|
14294
14400
|
name: options.name ?? "absolutejs-voice-outcome-contracts"
|
|
14295
14401
|
}).get(path, createVoiceOutcomeContractJSONHandler(options));
|
|
14296
14402
|
if (htmlPath) {
|
|
@@ -14300,7 +14406,7 @@ var createVoiceOutcomeContractRoutes = (options) => {
|
|
|
14300
14406
|
};
|
|
14301
14407
|
|
|
14302
14408
|
// src/toolContract.ts
|
|
14303
|
-
import { Elysia as
|
|
14409
|
+
import { Elysia as Elysia22 } from "elysia";
|
|
14304
14410
|
|
|
14305
14411
|
// src/toolRuntime.ts
|
|
14306
14412
|
var toErrorMessage4 = (error) => error instanceof Error ? error.message : String(error);
|
|
@@ -14752,7 +14858,7 @@ var createVoiceToolContractHTMLHandler = (options) => async () => {
|
|
|
14752
14858
|
var createVoiceToolContractRoutes = (options) => {
|
|
14753
14859
|
const path = options.path ?? "/api/tool-contracts";
|
|
14754
14860
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
14755
|
-
const routes = new
|
|
14861
|
+
const routes = new Elysia22({
|
|
14756
14862
|
name: options.name ?? "absolutejs-voice-tool-contracts"
|
|
14757
14863
|
}).get(path, createVoiceToolContractJSONHandler(options));
|
|
14758
14864
|
if (htmlPath) {
|
|
@@ -14949,7 +15055,7 @@ app.use(
|
|
|
14949
15055
|
var createVoiceSimulationSuiteRoutes = (options) => {
|
|
14950
15056
|
const path = options.path ?? "/api/voice/simulations";
|
|
14951
15057
|
const htmlPath = options.htmlPath === undefined ? "/voice/simulations" : options.htmlPath;
|
|
14952
|
-
const app = new
|
|
15058
|
+
const app = new Elysia23({
|
|
14953
15059
|
name: options.name ?? "absolutejs-voice-simulation-suite"
|
|
14954
15060
|
}).get(path, () => runVoiceSimulationSuite(options));
|
|
14955
15061
|
if (htmlPath) {
|
|
@@ -15261,7 +15367,7 @@ var createVoiceWorkflowContractHandler = (input) => {
|
|
|
15261
15367
|
};
|
|
15262
15368
|
};
|
|
15263
15369
|
// src/sessionReplay.ts
|
|
15264
|
-
import { Elysia as
|
|
15370
|
+
import { Elysia as Elysia24 } from "elysia";
|
|
15265
15371
|
var getString10 = (value) => typeof value === "string" ? value : undefined;
|
|
15266
15372
|
var escapeHtml24 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
15267
15373
|
var increment4 = (record, key) => {
|
|
@@ -15501,7 +15607,7 @@ var createVoiceSessionsHTMLHandler = (options = {}) => async ({ query }) => {
|
|
|
15501
15607
|
var createVoiceSessionListRoutes = (options = {}) => {
|
|
15502
15608
|
const path = options.path ?? "/api/voice-sessions";
|
|
15503
15609
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
15504
|
-
const routes = new
|
|
15610
|
+
const routes = new Elysia24({
|
|
15505
15611
|
name: options.name ?? "absolutejs-voice-session-list"
|
|
15506
15612
|
}).get(path, createVoiceSessionsJSONHandler(options));
|
|
15507
15613
|
if (htmlPath) {
|
|
@@ -15529,7 +15635,7 @@ var createVoiceSessionReplayHTMLHandler = (options) => async ({ params }) => {
|
|
|
15529
15635
|
var createVoiceSessionReplayRoutes = (options) => {
|
|
15530
15636
|
const path = options.path ?? "/api/voice-sessions/:sessionId/replay";
|
|
15531
15637
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
15532
|
-
const routes = new
|
|
15638
|
+
const routes = new Elysia24({
|
|
15533
15639
|
name: options.name ?? "absolutejs-voice-session-replay"
|
|
15534
15640
|
}).get(path, createVoiceSessionReplayJSONHandler(options));
|
|
15535
15641
|
if (htmlPath) {
|
|
@@ -15758,7 +15864,7 @@ var assertVoiceAgentSquadContract = async (options) => {
|
|
|
15758
15864
|
return report;
|
|
15759
15865
|
};
|
|
15760
15866
|
// src/turnLatency.ts
|
|
15761
|
-
import { Elysia as
|
|
15867
|
+
import { Elysia as Elysia25 } from "elysia";
|
|
15762
15868
|
var DEFAULT_WARN_AFTER_MS = 1800;
|
|
15763
15869
|
var DEFAULT_FAIL_AFTER_MS = 3200;
|
|
15764
15870
|
var escapeHtml25 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
@@ -15914,7 +16020,7 @@ var createVoiceTurnLatencyHTMLHandler = (options) => async () => {
|
|
|
15914
16020
|
var createVoiceTurnLatencyRoutes = (options) => {
|
|
15915
16021
|
const path = options.path ?? "/api/turn-latency";
|
|
15916
16022
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
15917
|
-
const routes = new
|
|
16023
|
+
const routes = new Elysia25({
|
|
15918
16024
|
name: options.name ?? "absolutejs-voice-turn-latency"
|
|
15919
16025
|
}).get(path, createVoiceTurnLatencyJSONHandler(options));
|
|
15920
16026
|
if (htmlPath) {
|
|
@@ -15923,7 +16029,7 @@ var createVoiceTurnLatencyRoutes = (options) => {
|
|
|
15923
16029
|
return routes;
|
|
15924
16030
|
};
|
|
15925
16031
|
// src/liveLatency.ts
|
|
15926
|
-
import { Elysia as
|
|
16032
|
+
import { Elysia as Elysia26 } from "elysia";
|
|
15927
16033
|
var escapeHtml26 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
15928
16034
|
var percentile = (values, percentileValue) => {
|
|
15929
16035
|
if (values.length === 0) {
|
|
@@ -15997,7 +16103,7 @@ await traceStore.append({
|
|
|
15997
16103
|
var createVoiceLiveLatencyRoutes = (options) => {
|
|
15998
16104
|
const path = options.path ?? "/api/live-latency";
|
|
15999
16105
|
const htmlPath = options.htmlPath === undefined ? "/live-latency" : options.htmlPath;
|
|
16000
|
-
const routes = new
|
|
16106
|
+
const routes = new Elysia26({
|
|
16001
16107
|
name: options.name ?? "absolutejs-voice-live-latency"
|
|
16002
16108
|
}).get(path, () => summarizeVoiceLiveLatency(options));
|
|
16003
16109
|
if (htmlPath) {
|
|
@@ -16316,7 +16422,7 @@ None.
|
|
|
16316
16422
|
`}`;
|
|
16317
16423
|
};
|
|
16318
16424
|
// src/turnQuality.ts
|
|
16319
|
-
import { Elysia as
|
|
16425
|
+
import { Elysia as Elysia27 } from "elysia";
|
|
16320
16426
|
var DEFAULT_CONFIDENCE_WARN_THRESHOLD = 0.72;
|
|
16321
16427
|
var escapeHtml27 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
16322
16428
|
var getTurnLatencyMs = (turn) => {
|
|
@@ -16423,7 +16529,7 @@ var createVoiceTurnQualityHTMLHandler = (options) => async () => {
|
|
|
16423
16529
|
var createVoiceTurnQualityRoutes = (options) => {
|
|
16424
16530
|
const path = options.path ?? "/api/turn-quality";
|
|
16425
16531
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
16426
|
-
const routes = new
|
|
16532
|
+
const routes = new Elysia27({
|
|
16427
16533
|
name: options.name ?? "absolutejs-voice-turn-quality"
|
|
16428
16534
|
}).get(path, createVoiceTurnQualityJSONHandler(options));
|
|
16429
16535
|
if (htmlPath) {
|
|
@@ -16432,7 +16538,7 @@ var createVoiceTurnQualityRoutes = (options) => {
|
|
|
16432
16538
|
return routes;
|
|
16433
16539
|
};
|
|
16434
16540
|
// src/telephonyOutcome.ts
|
|
16435
|
-
import { Elysia as
|
|
16541
|
+
import { Elysia as Elysia28 } from "elysia";
|
|
16436
16542
|
var DEFAULT_COMPLETED_STATUSES = [
|
|
16437
16543
|
"answered",
|
|
16438
16544
|
"completed",
|
|
@@ -17082,7 +17188,7 @@ var createVoiceTelephonyWebhookHandler = (options = {}) => async (input) => {
|
|
|
17082
17188
|
var createVoiceTelephonyWebhookRoutes = (options = {}) => {
|
|
17083
17189
|
const path = options.path ?? "/api/voice/telephony/webhook";
|
|
17084
17190
|
const handler = createVoiceTelephonyWebhookHandler(options);
|
|
17085
|
-
return new
|
|
17191
|
+
return new Elysia28({
|
|
17086
17192
|
name: options.name ?? "absolutejs-voice-telephony-webhooks"
|
|
17087
17193
|
}).post(path, async ({ query, request }) => {
|
|
17088
17194
|
try {
|
|
@@ -17103,11 +17209,11 @@ var createVoiceTelephonyWebhookRoutes = (options = {}) => {
|
|
|
17103
17209
|
});
|
|
17104
17210
|
};
|
|
17105
17211
|
// src/phoneAgent.ts
|
|
17106
|
-
import { Elysia as
|
|
17212
|
+
import { Elysia as Elysia34 } from "elysia";
|
|
17107
17213
|
|
|
17108
17214
|
// src/telephony/plivo.ts
|
|
17109
17215
|
import { Buffer as Buffer5 } from "buffer";
|
|
17110
|
-
import { Elysia as
|
|
17216
|
+
import { Elysia as Elysia30 } from "elysia";
|
|
17111
17217
|
|
|
17112
17218
|
// src/telephony/contract.ts
|
|
17113
17219
|
var DEFAULT_REQUIREMENTS = [
|
|
@@ -17191,7 +17297,7 @@ var evaluateVoiceTelephonyContract = (input) => {
|
|
|
17191
17297
|
|
|
17192
17298
|
// src/telephony/twilio.ts
|
|
17193
17299
|
import { Buffer as Buffer4 } from "buffer";
|
|
17194
|
-
import { Elysia as
|
|
17300
|
+
import { Elysia as Elysia29 } from "elysia";
|
|
17195
17301
|
var TWILIO_MULAW_SAMPLE_RATE = 8000;
|
|
17196
17302
|
var VOICE_PCM_SAMPLE_RATE = 16000;
|
|
17197
17303
|
var escapeXml2 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
@@ -17764,7 +17870,7 @@ var createTwilioVoiceRoutes = (options) => {
|
|
|
17764
17870
|
const smokePath = options.smoke?.path === false ? false : options.smoke?.path ?? "/api/voice/twilio/smoke";
|
|
17765
17871
|
const bridges = new WeakMap;
|
|
17766
17872
|
const webhookPolicy = options.webhook?.policy ?? options.outcomePolicy ?? createVoiceTelephonyOutcomePolicy();
|
|
17767
|
-
const app = new
|
|
17873
|
+
const app = new Elysia29({
|
|
17768
17874
|
name: options.name ?? "absolutejs-voice-twilio"
|
|
17769
17875
|
}).get(twimlPath, async ({ query, request }) => {
|
|
17770
17876
|
const streamUrl = await resolveTwilioStreamUrl(options, {
|
|
@@ -18261,7 +18367,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
|
|
|
18261
18367
|
request: input.request
|
|
18262
18368
|
}) : verificationUrl ?? input.request.url
|
|
18263
18369
|
}) : undefined);
|
|
18264
|
-
const app = new
|
|
18370
|
+
const app = new Elysia30({
|
|
18265
18371
|
name: options.name ?? "absolutejs-voice-plivo"
|
|
18266
18372
|
}).get(answerPath, async ({ query, request }) => {
|
|
18267
18373
|
const streamUrl = await resolvePlivoStreamUrl(options, {
|
|
@@ -18372,7 +18478,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
|
|
|
18372
18478
|
|
|
18373
18479
|
// src/telephony/telnyx.ts
|
|
18374
18480
|
import { Buffer as Buffer6 } from "buffer";
|
|
18375
|
-
import { Elysia as
|
|
18481
|
+
import { Elysia as Elysia31 } from "elysia";
|
|
18376
18482
|
var escapeXml4 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
18377
18483
|
var escapeHtml30 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
18378
18484
|
var joinUrlPath4 = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
@@ -18683,7 +18789,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
|
|
|
18683
18789
|
publicKey: options.webhook?.publicKey,
|
|
18684
18790
|
toleranceSeconds: options.webhook?.toleranceSeconds
|
|
18685
18791
|
}) : undefined);
|
|
18686
|
-
const app = new
|
|
18792
|
+
const app = new Elysia31({
|
|
18687
18793
|
name: options.name ?? "absolutejs-voice-telnyx"
|
|
18688
18794
|
}).get(texmlPath, async ({ query, request }) => {
|
|
18689
18795
|
const streamUrl = await resolveTelnyxStreamUrl(options, {
|
|
@@ -18793,7 +18899,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
|
|
|
18793
18899
|
};
|
|
18794
18900
|
|
|
18795
18901
|
// src/telephony/matrix.ts
|
|
18796
|
-
import { Elysia as
|
|
18902
|
+
import { Elysia as Elysia32 } from "elysia";
|
|
18797
18903
|
var escapeHtml31 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
18798
18904
|
var labelForProvider = (provider) => provider.split("-").map((part) => `${part.slice(0, 1).toUpperCase()}${part.slice(1)}`).join(" ");
|
|
18799
18905
|
var resolveEntryStatus = (contract, setup, smoke) => {
|
|
@@ -18877,7 +18983,7 @@ ${entry.issues.length ? `<ul style="margin:12px 0 0; padding-left:18px;">${entry
|
|
|
18877
18983
|
</main>`;
|
|
18878
18984
|
var createVoiceTelephonyCarrierMatrixRoutes = (options) => {
|
|
18879
18985
|
const path = options.path ?? "/api/voice/telephony/carriers";
|
|
18880
|
-
return new
|
|
18986
|
+
return new Elysia32({
|
|
18881
18987
|
name: options.name ?? "absolutejs-voice-telephony-carrier-matrix"
|
|
18882
18988
|
}).get(path, async ({ query, request }) => {
|
|
18883
18989
|
const providers = await options.load({ query, request });
|
|
@@ -18899,7 +19005,7 @@ var createVoiceTelephonyCarrierMatrixRoutes = (options) => {
|
|
|
18899
19005
|
};
|
|
18900
19006
|
|
|
18901
19007
|
// src/phoneAgentProductionSmoke.ts
|
|
18902
|
-
import { Elysia as
|
|
19008
|
+
import { Elysia as Elysia33 } from "elysia";
|
|
18903
19009
|
var defaultRequirements = [
|
|
18904
19010
|
"media-started",
|
|
18905
19011
|
"transcript",
|
|
@@ -19042,7 +19148,7 @@ var createVoicePhoneAgentProductionSmokeHTMLHandler = (options) => async ({
|
|
|
19042
19148
|
var createVoicePhoneAgentProductionSmokeRoutes = (options) => {
|
|
19043
19149
|
const path = options.path ?? "/api/voice/phone/smoke-contract";
|
|
19044
19150
|
const htmlPath = options.htmlPath === undefined ? "/voice/phone/smoke-contract" : options.htmlPath;
|
|
19045
|
-
const routes = new
|
|
19151
|
+
const routes = new Elysia33({
|
|
19046
19152
|
name: options.name ?? "absolutejs-voice-phone-smoke-contract"
|
|
19047
19153
|
}).get(path, createVoicePhoneAgentProductionSmokeJSONHandler(options));
|
|
19048
19154
|
if (htmlPath) {
|
|
@@ -19230,7 +19336,7 @@ var createVoicePhoneAgent = (options) => {
|
|
|
19230
19336
|
setupPath: resolveSetupPath(carrier),
|
|
19231
19337
|
smokePath: resolveSmokePath(carrier)
|
|
19232
19338
|
}));
|
|
19233
|
-
const app = new
|
|
19339
|
+
const app = new Elysia34({
|
|
19234
19340
|
name: options.name ?? "absolutejs-voice-phone-agent"
|
|
19235
19341
|
});
|
|
19236
19342
|
for (const carrier of options.carriers) {
|
|
@@ -21289,7 +21395,7 @@ var createOpenAIVoiceTTS = (options) => {
|
|
|
21289
21395
|
};
|
|
21290
21396
|
};
|
|
21291
21397
|
// src/providerCapabilities.ts
|
|
21292
|
-
import { Elysia as
|
|
21398
|
+
import { Elysia as Elysia35 } from "elysia";
|
|
21293
21399
|
var escapeHtml34 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
21294
21400
|
var fromProviderList = (kind, providers, options) => (providers ?? []).map((provider) => ({
|
|
21295
21401
|
configured: true,
|
|
@@ -21390,7 +21496,7 @@ var createVoiceProviderCapabilityHTMLHandler = (options) => async () => {
|
|
|
21390
21496
|
var createVoiceProviderCapabilityRoutes = (options) => {
|
|
21391
21497
|
const path = options.path ?? "/api/provider-capabilities";
|
|
21392
21498
|
const htmlPath = options.htmlPath === undefined ? `${path}/htmx` : options.htmlPath;
|
|
21393
|
-
const routes = new
|
|
21499
|
+
const routes = new Elysia35({
|
|
21394
21500
|
name: options.name ?? "absolutejs-voice-provider-capabilities"
|
|
21395
21501
|
}).get(path, createVoiceProviderCapabilityJSONHandler(options));
|
|
21396
21502
|
if (htmlPath) {
|
|
@@ -21399,7 +21505,7 @@ var createVoiceProviderCapabilityRoutes = (options) => {
|
|
|
21399
21505
|
return routes;
|
|
21400
21506
|
};
|
|
21401
21507
|
// src/resilienceRoutes.ts
|
|
21402
|
-
import { Elysia as
|
|
21508
|
+
import { Elysia as Elysia36 } from "elysia";
|
|
21403
21509
|
var escapeHtml35 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
21404
21510
|
var getString13 = (value) => typeof value === "string" ? value : undefined;
|
|
21405
21511
|
var getNumber7 = (value) => typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
@@ -21843,7 +21949,7 @@ var registerSimulationRoutes = (routes, simulation, defaultPathPrefix) => {
|
|
|
21843
21949
|
};
|
|
21844
21950
|
var createVoiceResilienceRoutes = (options) => {
|
|
21845
21951
|
const path = options.path ?? "/resilience";
|
|
21846
|
-
const routes = new
|
|
21952
|
+
const routes = new Elysia36({
|
|
21847
21953
|
name: options.name ?? "absolutejs-voice-resilience"
|
|
21848
21954
|
}).get(path, async () => {
|
|
21849
21955
|
const events = await options.store.list();
|
|
@@ -21921,7 +22027,7 @@ var assertVoiceProviderRoutingContract = async (options) => {
|
|
|
21921
22027
|
return report;
|
|
21922
22028
|
};
|
|
21923
22029
|
// src/providerSlo.ts
|
|
21924
|
-
import { Elysia as
|
|
22030
|
+
import { Elysia as Elysia37 } from "elysia";
|
|
21925
22031
|
var defaultThresholds = {
|
|
21926
22032
|
llm: {
|
|
21927
22033
|
maxAverageElapsedMs: 2500,
|
|
@@ -22188,7 +22294,7 @@ var createVoiceProviderSloRoutes = (options) => {
|
|
|
22188
22294
|
...options.headers ?? {}
|
|
22189
22295
|
};
|
|
22190
22296
|
const buildReport = () => buildVoiceProviderSloReport(options);
|
|
22191
|
-
const app = new
|
|
22297
|
+
const app = new Elysia37({ name: options.name ?? "absolute-voice-provider-slos" });
|
|
22192
22298
|
app.get(path, async () => Response.json(await buildReport(), { headers }));
|
|
22193
22299
|
if (markdownPath !== false) {
|
|
22194
22300
|
app.get(markdownPath, async () => {
|
|
@@ -22218,10 +22324,10 @@ var createVoiceProviderSloRoutes = (options) => {
|
|
|
22218
22324
|
return app;
|
|
22219
22325
|
};
|
|
22220
22326
|
// src/productionReadiness.ts
|
|
22221
|
-
import { Elysia as
|
|
22327
|
+
import { Elysia as Elysia42 } from "elysia";
|
|
22222
22328
|
|
|
22223
22329
|
// src/opsRecovery.ts
|
|
22224
|
-
import { Elysia as
|
|
22330
|
+
import { Elysia as Elysia38 } from "elysia";
|
|
22225
22331
|
var escapeHtml37 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
22226
22332
|
var getString14 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
22227
22333
|
var hrefForSession = (value, sessionId) => {
|
|
@@ -22448,7 +22554,7 @@ var createVoiceOpsRecoveryRoutes = (options = {}) => {
|
|
|
22448
22554
|
const path = options.path ?? "/api/voice/ops-recovery";
|
|
22449
22555
|
const htmlPath = options.htmlPath === undefined ? "/ops-recovery" : options.htmlPath;
|
|
22450
22556
|
const markdownPath = options.markdownPath === undefined ? `${path}.md` : options.markdownPath;
|
|
22451
|
-
const routes = new
|
|
22557
|
+
const routes = new Elysia38({
|
|
22452
22558
|
name: options.name ?? "absolutejs-voice-ops-recovery"
|
|
22453
22559
|
}).get(path, async () => buildVoiceOpsRecoveryReport(options));
|
|
22454
22560
|
if (htmlPath) {
|
|
@@ -22478,17 +22584,17 @@ var createVoiceOpsRecoveryRoutes = (options = {}) => {
|
|
|
22478
22584
|
};
|
|
22479
22585
|
|
|
22480
22586
|
// src/observabilityExport.ts
|
|
22481
|
-
import { Elysia as
|
|
22587
|
+
import { Elysia as Elysia41 } from "elysia";
|
|
22482
22588
|
import { Database } from "bun:sqlite";
|
|
22483
22589
|
import { createHash } from "crypto";
|
|
22484
22590
|
import { mkdir as mkdir4, readFile as readFile2, stat, unlink } from "fs/promises";
|
|
22485
22591
|
import { join as join3 } from "path";
|
|
22486
22592
|
|
|
22487
22593
|
// src/operationsRecord.ts
|
|
22488
|
-
import { Elysia as
|
|
22594
|
+
import { Elysia as Elysia40 } from "elysia";
|
|
22489
22595
|
|
|
22490
22596
|
// src/traceTimeline.ts
|
|
22491
|
-
import { Elysia as
|
|
22597
|
+
import { Elysia as Elysia39 } from "elysia";
|
|
22492
22598
|
var escapeHtml38 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
22493
22599
|
var getString15 = (value) => typeof value === "string" && value.trim() ? value : undefined;
|
|
22494
22600
|
var getNumber8 = (value) => typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
@@ -22714,7 +22820,7 @@ var createVoiceTraceTimelineRoutes = (options) => {
|
|
|
22714
22820
|
const path = options.path ?? "/api/voice-traces";
|
|
22715
22821
|
const htmlPath = options.htmlPath ?? "/traces";
|
|
22716
22822
|
const title = options.title ?? "AbsoluteJS Voice Trace Timelines";
|
|
22717
|
-
const routes = new
|
|
22823
|
+
const routes = new Elysia39({
|
|
22718
22824
|
name: options.name ?? "absolutejs-voice-trace-timelines"
|
|
22719
22825
|
});
|
|
22720
22826
|
const buildReport = async () => summarizeVoiceTraceTimeline(await options.store.list(), {
|
|
@@ -22965,7 +23071,7 @@ var createVoiceOperationsRecordRoutes = (options) => {
|
|
|
22965
23071
|
const htmlPath = options.htmlPath === undefined ? "/voice-operations/:sessionId" : options.htmlPath;
|
|
22966
23072
|
const incidentPath = options.incidentPath === undefined ? `${path}/incident.md` : options.incidentPath;
|
|
22967
23073
|
const incidentHtmlPath = options.incidentHtmlPath === undefined && htmlPath ? `${htmlPath}/incident.md` : options.incidentHtmlPath;
|
|
22968
|
-
const routes = new
|
|
23074
|
+
const routes = new Elysia40({
|
|
22969
23075
|
name: options.name ?? "absolutejs-voice-operations-record"
|
|
22970
23076
|
});
|
|
22971
23077
|
const buildRecord = (sessionId) => buildVoiceOperationsRecord({
|
|
@@ -23560,7 +23666,7 @@ var createVoiceObservabilityExportReplayRoutes = (options) => {
|
|
|
23560
23666
|
...options.headers ?? {}
|
|
23561
23667
|
};
|
|
23562
23668
|
const buildReport = () => resolveVoiceObservabilityExportReplayReport(options.source);
|
|
23563
|
-
const app = new
|
|
23669
|
+
const app = new Elysia41({
|
|
23564
23670
|
name: options.name ?? "absolute-voice-observability-export-replay"
|
|
23565
23671
|
});
|
|
23566
23672
|
app.get(path, async () => Response.json(await buildReport(), { headers }));
|
|
@@ -24286,7 +24392,7 @@ var createVoiceObservabilityExportRoutes = (options = {}) => {
|
|
|
24286
24392
|
artifactDownload: options.links?.artifactDownload ?? (artifactDownloadPath ? (artifact) => `${artifactDownloadPath}/${encodeURIComponent(artifact.id)}` : undefined)
|
|
24287
24393
|
}
|
|
24288
24394
|
});
|
|
24289
|
-
const app = new
|
|
24395
|
+
const app = new Elysia41({
|
|
24290
24396
|
name: options.name ?? "absolute-voice-observability-export"
|
|
24291
24397
|
});
|
|
24292
24398
|
app.get(path, async () => Response.json(await buildReport(), { headers }));
|
|
@@ -25591,7 +25697,7 @@ var createVoiceProductionReadinessRoutes = (options) => {
|
|
|
25591
25697
|
const path = options.path ?? "/api/production-readiness";
|
|
25592
25698
|
const gatePath = options.gatePath === undefined ? "/api/production-readiness/gate" : options.gatePath;
|
|
25593
25699
|
const htmlPath = options.htmlPath ?? "/production-readiness";
|
|
25594
|
-
const routes = new
|
|
25700
|
+
const routes = new Elysia42({
|
|
25595
25701
|
name: options.name ?? "absolutejs-voice-production-readiness"
|
|
25596
25702
|
});
|
|
25597
25703
|
routes.get(path, async ({ query, request }) => buildVoiceProductionReadinessReport(options, { query, request }));
|
|
@@ -25976,7 +26082,7 @@ var recommendVoiceReadinessProfile = (options) => {
|
|
|
25976
26082
|
};
|
|
25977
26083
|
};
|
|
25978
26084
|
// src/providerStackRecommendations.ts
|
|
25979
|
-
import { Elysia as
|
|
26085
|
+
import { Elysia as Elysia43 } from "elysia";
|
|
25980
26086
|
var escapeHtml41 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
25981
26087
|
var profileProviderPriorities = {
|
|
25982
26088
|
"meeting-recorder": {
|
|
@@ -26266,7 +26372,7 @@ var createVoiceProviderContractMatrixHTMLHandler = (options) => async () => {
|
|
|
26266
26372
|
var createVoiceProviderContractMatrixRoutes = (options) => {
|
|
26267
26373
|
const path = options.path ?? "/api/provider-contracts";
|
|
26268
26374
|
const htmlPath = options.htmlPath ?? "/provider-contracts";
|
|
26269
|
-
const routes = new
|
|
26375
|
+
const routes = new Elysia43({
|
|
26270
26376
|
name: options.name ?? "absolutejs-voice-provider-contract-matrix"
|
|
26271
26377
|
});
|
|
26272
26378
|
const jsonHandler = createVoiceProviderContractMatrixJSONHandler(options.matrix);
|
|
@@ -26325,7 +26431,7 @@ var evaluateVoiceProviderStackGaps = (input) => {
|
|
|
26325
26431
|
};
|
|
26326
26432
|
};
|
|
26327
26433
|
// src/opsConsoleRoutes.ts
|
|
26328
|
-
import { Elysia as
|
|
26434
|
+
import { Elysia as Elysia44 } from "elysia";
|
|
26329
26435
|
var DEFAULT_LINKS = [
|
|
26330
26436
|
{
|
|
26331
26437
|
description: "Quality gates for CI, deploy checks, and production readiness.",
|
|
@@ -26442,7 +26548,7 @@ var renderVoiceOpsConsoleHTML = (report, options = {}) => {
|
|
|
26442
26548
|
};
|
|
26443
26549
|
var createVoiceOpsConsoleRoutes = (options) => {
|
|
26444
26550
|
const path = options.path ?? "/ops-console";
|
|
26445
|
-
const routes = new
|
|
26551
|
+
const routes = new Elysia44({
|
|
26446
26552
|
name: options.name ?? "absolutejs-voice-ops-console"
|
|
26447
26553
|
});
|
|
26448
26554
|
const getReport = () => buildVoiceOpsConsoleReport(options);
|
|
@@ -26459,7 +26565,7 @@ var createVoiceOpsConsoleRoutes = (options) => {
|
|
|
26459
26565
|
return routes;
|
|
26460
26566
|
};
|
|
26461
26567
|
// src/incidentBundle.ts
|
|
26462
|
-
import { Elysia as
|
|
26568
|
+
import { Elysia as Elysia45 } from "elysia";
|
|
26463
26569
|
var filterIncidentBundleArtifacts = (artifacts, filter = {}) => artifacts.filter((artifact) => {
|
|
26464
26570
|
if (filter.sessionId && artifact.sessionId !== filter.sessionId) {
|
|
26465
26571
|
return false;
|
|
@@ -26658,7 +26764,7 @@ var buildVoiceIncidentBundle = async (options) => {
|
|
|
26658
26764
|
var createVoiceIncidentBundleRoutes = (options) => {
|
|
26659
26765
|
const path = options.path ?? "/api/voice-incidents/:sessionId";
|
|
26660
26766
|
const markdownPath = options.markdownPath === undefined ? "/voice-incidents/:sessionId/markdown" : options.markdownPath;
|
|
26661
|
-
const routes = new
|
|
26767
|
+
const routes = new Elysia45({
|
|
26662
26768
|
name: options.name ?? "absolutejs-voice-incident-bundle"
|
|
26663
26769
|
});
|
|
26664
26770
|
const getSessionId = (params) => params.sessionId ?? "";
|
|
@@ -26859,7 +26965,7 @@ var summarizeVoiceOpsStatus = async (options) => {
|
|
|
26859
26965
|
};
|
|
26860
26966
|
};
|
|
26861
26967
|
// src/opsStatusRoutes.ts
|
|
26862
|
-
import { Elysia as
|
|
26968
|
+
import { Elysia as Elysia46 } from "elysia";
|
|
26863
26969
|
var escapeHtml43 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
26864
26970
|
var renderVoiceOpsStatusHTML = (report, options = {}) => {
|
|
26865
26971
|
const title = options.title ?? "AbsoluteJS Voice Ops Status";
|
|
@@ -26871,7 +26977,7 @@ var renderVoiceOpsStatusHTML = (report, options = {}) => {
|
|
|
26871
26977
|
};
|
|
26872
26978
|
var createVoiceOpsStatusRoutes = (options) => {
|
|
26873
26979
|
const path = options.path ?? "/api/voice/ops-status";
|
|
26874
|
-
const routes = new
|
|
26980
|
+
const routes = new Elysia46({
|
|
26875
26981
|
name: options.name ?? "absolutejs-voice-ops-status"
|
|
26876
26982
|
});
|
|
26877
26983
|
routes.get(path, async () => summarizeVoiceOpsStatus(options));
|
|
@@ -27304,7 +27410,7 @@ var createVoiceTTSProviderRouter = (options) => {
|
|
|
27304
27410
|
};
|
|
27305
27411
|
};
|
|
27306
27412
|
// src/traceDeliveryRoutes.ts
|
|
27307
|
-
import { Elysia as
|
|
27413
|
+
import { Elysia as Elysia47 } from "elysia";
|
|
27308
27414
|
var escapeHtml44 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
27309
27415
|
var getString19 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
27310
27416
|
var getNumber11 = (value) => {
|
|
@@ -27413,7 +27519,7 @@ var createVoiceTraceDeliveryRoutes = (options) => {
|
|
|
27413
27519
|
const path = options.path ?? "/api/voice-trace-deliveries";
|
|
27414
27520
|
const htmlPath = options.htmlPath === undefined ? "/traces/deliveries" : options.htmlPath;
|
|
27415
27521
|
const workerPath = options.workerPath === undefined ? `${path}/drain` : options.workerPath;
|
|
27416
|
-
const routes = new
|
|
27522
|
+
const routes = new Elysia47({
|
|
27417
27523
|
name: options.name ?? "absolutejs-voice-trace-deliveries"
|
|
27418
27524
|
}).get(path, createVoiceTraceDeliveryJSONHandler(options));
|
|
27419
27525
|
if (htmlPath !== false) {
|
|
@@ -28037,7 +28143,7 @@ var createVoiceMemoryStore = () => {
|
|
|
28037
28143
|
return { get, getOrCreate, list, remove, set };
|
|
28038
28144
|
};
|
|
28039
28145
|
// src/opsWebhook.ts
|
|
28040
|
-
import { Elysia as
|
|
28146
|
+
import { Elysia as Elysia48 } from "elysia";
|
|
28041
28147
|
var toHex6 = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
28042
28148
|
var signVoiceOpsWebhookBody = async (input) => {
|
|
28043
28149
|
const encoder = new TextEncoder;
|
|
@@ -28167,7 +28273,7 @@ var verifyVoiceOpsWebhookSignature = async (input) => {
|
|
|
28167
28273
|
};
|
|
28168
28274
|
var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
|
|
28169
28275
|
const path = options.path ?? "/api/voice-ops/webhook";
|
|
28170
|
-
return new
|
|
28276
|
+
return new Elysia48().post(path, async ({ body, request, set }) => {
|
|
28171
28277
|
const bodyText = typeof body === "string" ? body : JSON.stringify(body);
|
|
28172
28278
|
if (options.signingSecret) {
|
|
28173
28279
|
const verification = await verifyVoiceOpsWebhookSignature({
|
|
@@ -29160,9 +29266,11 @@ export {
|
|
|
29160
29266
|
recordVoiceAuditEvent,
|
|
29161
29267
|
recommendVoiceReadinessProfile,
|
|
29162
29268
|
recommendVoiceProviderStack,
|
|
29269
|
+
readVoiceProofTrendReportFile,
|
|
29163
29270
|
pruneVoiceTraceEvents,
|
|
29164
29271
|
pruneVoiceIncidentBundleArtifacts,
|
|
29165
29272
|
parseVoiceTelephonyWebhookEvent,
|
|
29273
|
+
normalizeVoiceProofTrendReport,
|
|
29166
29274
|
matchesVoiceOpsTaskAssignmentRule,
|
|
29167
29275
|
markVoiceOpsTaskSLABreached,
|
|
29168
29276
|
loadVoiceObservabilityExportReplaySource,
|
|
@@ -29174,6 +29282,7 @@ export {
|
|
|
29174
29282
|
hasVoiceOpsTaskSLABreach,
|
|
29175
29283
|
getVoiceLiveOpsControlStatus,
|
|
29176
29284
|
getVoiceCampaignDialerProofStatus,
|
|
29285
|
+
formatVoiceProofTrendAge,
|
|
29177
29286
|
filterVoiceTraceEvents,
|
|
29178
29287
|
filterVoiceAuditEvents,
|
|
29179
29288
|
failVoiceOpsTask,
|
|
@@ -29290,6 +29399,7 @@ export {
|
|
|
29290
29399
|
createVoiceProviderCapabilityRoutes,
|
|
29291
29400
|
createVoiceProviderCapabilityJSONHandler,
|
|
29292
29401
|
createVoiceProviderCapabilityHTMLHandler,
|
|
29402
|
+
createVoiceProofTrendRoutes,
|
|
29293
29403
|
createVoiceProductionReadinessRoutes,
|
|
29294
29404
|
createVoicePostgresTraceSinkDeliveryStore,
|
|
29295
29405
|
createVoicePostgresTraceEventStore,
|
|
@@ -29457,6 +29567,7 @@ export {
|
|
|
29457
29567
|
buildVoiceTraceDeliveryReport,
|
|
29458
29568
|
buildVoiceProviderSloReport,
|
|
29459
29569
|
buildVoiceProviderContractMatrix,
|
|
29570
|
+
buildVoiceProofTrendReport,
|
|
29460
29571
|
buildVoiceProductionReadinessReport,
|
|
29461
29572
|
buildVoiceProductionReadinessGate,
|
|
29462
29573
|
buildVoicePlatformCoverageSummary,
|
|
@@ -29484,6 +29595,7 @@ export {
|
|
|
29484
29595
|
buildVoiceAuditTrailReport,
|
|
29485
29596
|
buildVoiceAuditExport,
|
|
29486
29597
|
buildVoiceAuditDeliveryReport,
|
|
29598
|
+
buildEmptyVoiceProofTrendReport,
|
|
29487
29599
|
assignVoiceOpsTask,
|
|
29488
29600
|
assertVoiceProviderRoutingContract,
|
|
29489
29601
|
assertVoiceObservabilityExportSchema,
|
|
@@ -29499,5 +29611,6 @@ export {
|
|
|
29499
29611
|
applyRiskTieredPhraseHintCorrections,
|
|
29500
29612
|
applyPhraseHintCorrections,
|
|
29501
29613
|
VOICE_LIVE_OPS_ACTIONS,
|
|
29502
|
-
TURN_PROFILE_DEFAULTS
|
|
29614
|
+
TURN_PROFILE_DEFAULTS,
|
|
29615
|
+
DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS
|
|
29503
29616
|
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
export type VoiceProofTrendStatus = 'empty' | 'fail' | 'pass' | 'stale';
|
|
3
|
+
export type VoiceProofTrendSummary = {
|
|
4
|
+
cycles?: number;
|
|
5
|
+
maxLiveP95Ms?: number;
|
|
6
|
+
maxProviderP95Ms?: number;
|
|
7
|
+
maxTurnP95Ms?: number;
|
|
8
|
+
};
|
|
9
|
+
export type VoiceProofTrendCycle = {
|
|
10
|
+
at?: string;
|
|
11
|
+
cycle?: number;
|
|
12
|
+
liveLatency?: {
|
|
13
|
+
p95Ms?: number;
|
|
14
|
+
samples?: number;
|
|
15
|
+
};
|
|
16
|
+
ok?: boolean;
|
|
17
|
+
opsRecovery?: {
|
|
18
|
+
issues?: number;
|
|
19
|
+
status?: string;
|
|
20
|
+
};
|
|
21
|
+
productionReadiness?: {
|
|
22
|
+
status?: string;
|
|
23
|
+
};
|
|
24
|
+
providerSlo?: {
|
|
25
|
+
events?: number;
|
|
26
|
+
eventsWithLatency?: number;
|
|
27
|
+
status?: string;
|
|
28
|
+
};
|
|
29
|
+
turnLatency?: {
|
|
30
|
+
p95Ms?: number;
|
|
31
|
+
samples?: number;
|
|
32
|
+
status?: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type VoiceProofTrendReportInput = {
|
|
36
|
+
baseUrl?: string;
|
|
37
|
+
cycles?: VoiceProofTrendCycle[];
|
|
38
|
+
generatedAt?: string;
|
|
39
|
+
maxAgeMs?: number;
|
|
40
|
+
now?: Date | number | string;
|
|
41
|
+
ok?: boolean;
|
|
42
|
+
outputDir?: string;
|
|
43
|
+
runId?: string;
|
|
44
|
+
source?: string;
|
|
45
|
+
status?: VoiceProofTrendStatus;
|
|
46
|
+
summary?: VoiceProofTrendSummary;
|
|
47
|
+
};
|
|
48
|
+
export type VoiceProofTrendReport = {
|
|
49
|
+
ageMs?: number;
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
cycles: VoiceProofTrendCycle[];
|
|
52
|
+
freshUntil?: string;
|
|
53
|
+
generatedAt?: string;
|
|
54
|
+
maxAgeMs: number;
|
|
55
|
+
ok: boolean;
|
|
56
|
+
outputDir?: string;
|
|
57
|
+
runId?: string;
|
|
58
|
+
source: string;
|
|
59
|
+
status: VoiceProofTrendStatus;
|
|
60
|
+
summary: VoiceProofTrendSummary;
|
|
61
|
+
};
|
|
62
|
+
export type VoiceProofTrendRoutesOptions = {
|
|
63
|
+
headers?: HeadersInit;
|
|
64
|
+
jsonPath?: string;
|
|
65
|
+
maxAgeMs?: number;
|
|
66
|
+
name?: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
source?: (() => Promise<VoiceProofTrendReport | VoiceProofTrendReportInput> | VoiceProofTrendReport | VoiceProofTrendReportInput) | VoiceProofTrendReport | VoiceProofTrendReportInput;
|
|
69
|
+
};
|
|
70
|
+
export declare const DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS: number;
|
|
71
|
+
export declare const buildVoiceProofTrendReport: (input?: VoiceProofTrendReportInput) => VoiceProofTrendReport;
|
|
72
|
+
export declare const buildEmptyVoiceProofTrendReport: (source?: string, maxAgeMs?: number) => VoiceProofTrendReport;
|
|
73
|
+
export declare const normalizeVoiceProofTrendReport: (value: VoiceProofTrendReport | VoiceProofTrendReportInput, options?: {
|
|
74
|
+
maxAgeMs?: number;
|
|
75
|
+
source?: string;
|
|
76
|
+
}) => VoiceProofTrendReport;
|
|
77
|
+
export declare const readVoiceProofTrendReportFile: (path: string, options?: {
|
|
78
|
+
maxAgeMs?: number;
|
|
79
|
+
}) => Promise<VoiceProofTrendReport>;
|
|
80
|
+
export declare const createVoiceProofTrendRoutes: (options: VoiceProofTrendRoutesOptions) => Elysia<"", {
|
|
81
|
+
decorator: {};
|
|
82
|
+
store: {};
|
|
83
|
+
derive: {};
|
|
84
|
+
resolve: {};
|
|
85
|
+
}, {
|
|
86
|
+
typebox: {};
|
|
87
|
+
error: {};
|
|
88
|
+
}, {
|
|
89
|
+
schema: {};
|
|
90
|
+
standaloneSchema: {};
|
|
91
|
+
macro: {};
|
|
92
|
+
macroFn: {};
|
|
93
|
+
parser: {};
|
|
94
|
+
response: {};
|
|
95
|
+
}, {}, {
|
|
96
|
+
derive: {};
|
|
97
|
+
resolve: {};
|
|
98
|
+
schema: {};
|
|
99
|
+
standaloneSchema: {};
|
|
100
|
+
response: {};
|
|
101
|
+
}, {
|
|
102
|
+
derive: {};
|
|
103
|
+
resolve: {};
|
|
104
|
+
schema: {};
|
|
105
|
+
standaloneSchema: {};
|
|
106
|
+
response: {};
|
|
107
|
+
}>;
|
|
108
|
+
export declare const formatVoiceProofTrendAge: (ageMs: unknown) => string;
|