@kodelyth/voice-call 2026.5.42 → 2026.6.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/package.json +18 -6
- package/api.ts +0 -16
- package/cli-metadata.ts +0 -10
- package/config-api.ts +0 -12
- package/index.test.ts +0 -1075
- package/index.ts +0 -863
- package/runtime-api.ts +0 -20
- package/runtime-entry.ts +0 -1
- package/setup-api.ts +0 -47
- package/src/allowlist.test.ts +0 -18
- package/src/allowlist.ts +0 -19
- package/src/cli.test.ts +0 -12
- package/src/cli.ts +0 -866
- package/src/config-compat.test.ts +0 -130
- package/src/config-compat.ts +0 -227
- package/src/config.test.ts +0 -542
- package/src/config.ts +0 -883
- package/src/core-bridge.ts +0 -14
- package/src/deep-merge.test.ts +0 -40
- package/src/deep-merge.ts +0 -23
- package/src/gateway-continue-operation.ts +0 -200
- package/src/http-headers.test.ts +0 -16
- package/src/http-headers.ts +0 -15
- package/src/manager/context.ts +0 -50
- package/src/manager/events.test.ts +0 -578
- package/src/manager/events.ts +0 -332
- package/src/manager/lifecycle.ts +0 -53
- package/src/manager/lookup.test.ts +0 -52
- package/src/manager/lookup.ts +0 -35
- package/src/manager/outbound.test.ts +0 -629
- package/src/manager/outbound.ts +0 -508
- package/src/manager/state.ts +0 -48
- package/src/manager/store.ts +0 -107
- package/src/manager/timers.test.ts +0 -127
- package/src/manager/timers.ts +0 -113
- package/src/manager/twiml.test.ts +0 -13
- package/src/manager/twiml.ts +0 -17
- package/src/manager.closed-loop.test.ts +0 -259
- package/src/manager.inbound-allowlist.test.ts +0 -183
- package/src/manager.notify.test.ts +0 -390
- package/src/manager.restore.test.ts +0 -310
- package/src/manager.test-harness.ts +0 -127
- package/src/manager.ts +0 -441
- package/src/media-stream.test.ts +0 -953
- package/src/media-stream.ts +0 -876
- package/src/providers/base.ts +0 -99
- package/src/providers/mock.test.ts +0 -86
- package/src/providers/mock.ts +0 -185
- package/src/providers/plivo.test.ts +0 -93
- package/src/providers/plivo.ts +0 -601
- package/src/providers/shared/call-status.test.ts +0 -24
- package/src/providers/shared/call-status.ts +0 -24
- package/src/providers/shared/guarded-json-api.test.ts +0 -127
- package/src/providers/shared/guarded-json-api.ts +0 -49
- package/src/providers/telnyx.test.ts +0 -489
- package/src/providers/telnyx.ts +0 -419
- package/src/providers/twilio/api.test.ts +0 -184
- package/src/providers/twilio/api.ts +0 -100
- package/src/providers/twilio/twiml-policy.test.ts +0 -84
- package/src/providers/twilio/twiml-policy.ts +0 -87
- package/src/providers/twilio/webhook.ts +0 -34
- package/src/providers/twilio.test.ts +0 -607
- package/src/providers/twilio.ts +0 -861
- package/src/providers/twilio.types.ts +0 -17
- package/src/realtime-agent-context.test.ts +0 -101
- package/src/realtime-agent-context.ts +0 -149
- package/src/realtime-defaults.ts +0 -3
- package/src/realtime-fast-context.test.ts +0 -74
- package/src/realtime-fast-context.ts +0 -27
- package/src/realtime-transcription.runtime.ts +0 -4
- package/src/realtime-voice.runtime.ts +0 -5
- package/src/response-generator.test.ts +0 -385
- package/src/response-generator.ts +0 -348
- package/src/response-model.test.ts +0 -71
- package/src/response-model.ts +0 -23
- package/src/runtime.test.ts +0 -625
- package/src/runtime.ts +0 -528
- package/src/telephony-audio.test.ts +0 -61
- package/src/telephony-audio.ts +0 -12
- package/src/telephony-tts.test.ts +0 -196
- package/src/telephony-tts.ts +0 -235
- package/src/test-fixtures.ts +0 -82
- package/src/tts-provider-voice.test.ts +0 -34
- package/src/tts-provider-voice.ts +0 -21
- package/src/tunnel.test.ts +0 -173
- package/src/tunnel.ts +0 -314
- package/src/types.ts +0 -311
- package/src/utils.test.ts +0 -17
- package/src/utils.ts +0 -14
- package/src/voice-mapping.test.ts +0 -32
- package/src/voice-mapping.ts +0 -65
- package/src/webhook/realtime-audio-pacer.test.ts +0 -146
- package/src/webhook/realtime-audio-pacer.ts +0 -204
- package/src/webhook/realtime-handler.test.ts +0 -1450
- package/src/webhook/realtime-handler.ts +0 -1382
- package/src/webhook/stale-call-reaper.test.ts +0 -89
- package/src/webhook/stale-call-reaper.ts +0 -38
- package/src/webhook/stream-frame-adapter.test.ts +0 -187
- package/src/webhook/stream-frame-adapter.ts +0 -219
- package/src/webhook/tailscale.test.ts +0 -216
- package/src/webhook/tailscale.ts +0 -129
- package/src/webhook-exposure.test.ts +0 -33
- package/src/webhook-exposure.ts +0 -84
- package/src/webhook-security.test.ts +0 -813
- package/src/webhook-security.ts +0 -982
- package/src/webhook.hangup-once.lifecycle.test.ts +0 -179
- package/src/webhook.test.ts +0 -1615
- package/src/webhook.ts +0 -933
- package/src/webhook.types.ts +0 -5
- package/src/websocket-test-support.ts +0 -72
- package/tsconfig.json +0 -16
package/runtime-api.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Private runtime barrel for the bundled Voice Call extension.
|
|
2
|
-
// Keep this barrel thin and aligned with the local extension surface.
|
|
3
|
-
|
|
4
|
-
export { definePluginEntry } from "klaw/plugin-sdk/plugin-entry";
|
|
5
|
-
export type { KlawPluginApi } from "klaw/plugin-sdk/plugin-entry";
|
|
6
|
-
export type { GatewayRequestHandlerOptions } from "klaw/plugin-sdk/gateway-runtime";
|
|
7
|
-
export {
|
|
8
|
-
isRequestBodyLimitError,
|
|
9
|
-
readRequestBodyWithLimit,
|
|
10
|
-
requestBodyErrorToText,
|
|
11
|
-
} from "klaw/plugin-sdk/webhook-request-guards";
|
|
12
|
-
export { fetchWithSsrFGuard, isBlockedHostnameOrIp } from "klaw/plugin-sdk/ssrf-runtime";
|
|
13
|
-
export type { SessionEntry } from "klaw/plugin-sdk/session-store-runtime";
|
|
14
|
-
export {
|
|
15
|
-
TtsAutoSchema,
|
|
16
|
-
TtsConfigSchema,
|
|
17
|
-
TtsModeSchema,
|
|
18
|
-
TtsProviderSchema,
|
|
19
|
-
} from "klaw/plugin-sdk/tts-runtime";
|
|
20
|
-
export { sleep } from "klaw/plugin-sdk/runtime-env";
|
package/runtime-entry.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createVoiceCallRuntime, type VoiceCallRuntime } from "./src/runtime.js";
|
package/setup-api.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { KlawConfig } from "klaw/plugin-sdk/plugin-entry";
|
|
2
|
-
import { definePluginEntry } from "klaw/plugin-sdk/plugin-entry";
|
|
3
|
-
import { isRecord } from "klaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import { migrateVoiceCallLegacyConfigInput } from "./config-api.js";
|
|
5
|
-
|
|
6
|
-
function migrateVoiceCallPluginConfig(config: KlawConfig): {
|
|
7
|
-
config: KlawConfig;
|
|
8
|
-
changes: string[];
|
|
9
|
-
} | null {
|
|
10
|
-
const rawVoiceCallConfig = config.plugins?.entries?.["voice-call"]?.config;
|
|
11
|
-
if (!isRecord(rawVoiceCallConfig)) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const migration = migrateVoiceCallLegacyConfigInput({
|
|
15
|
-
value: rawVoiceCallConfig,
|
|
16
|
-
configPathPrefix: "plugins.entries.voice-call.config",
|
|
17
|
-
});
|
|
18
|
-
if (migration.changes.length === 0) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const plugins = structuredClone(config.plugins ?? {});
|
|
22
|
-
const entries = { ...plugins.entries };
|
|
23
|
-
const existingVoiceCallEntry = isRecord(entries["voice-call"])
|
|
24
|
-
? (entries["voice-call"] as Record<string, unknown>)
|
|
25
|
-
: {};
|
|
26
|
-
entries["voice-call"] = {
|
|
27
|
-
...existingVoiceCallEntry,
|
|
28
|
-
config: migration.config,
|
|
29
|
-
};
|
|
30
|
-
plugins.entries = entries;
|
|
31
|
-
return {
|
|
32
|
-
config: {
|
|
33
|
-
...config,
|
|
34
|
-
plugins,
|
|
35
|
-
},
|
|
36
|
-
changes: migration.changes,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default definePluginEntry({
|
|
41
|
-
id: "voice-call",
|
|
42
|
-
name: "Voice Call Setup",
|
|
43
|
-
description: "Lightweight Voice Call setup hooks",
|
|
44
|
-
register(api) {
|
|
45
|
-
api.registerConfigMigration((config) => migrateVoiceCallPluginConfig(config));
|
|
46
|
-
},
|
|
47
|
-
});
|
package/src/allowlist.test.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { isAllowlistedCaller, normalizePhoneNumber } from "./allowlist.js";
|
|
3
|
-
|
|
4
|
-
describe("voice-call allowlist", () => {
|
|
5
|
-
it("normalizes phone numbers by stripping non-digits", () => {
|
|
6
|
-
expect(normalizePhoneNumber("+1 (415) 555-0123")).toBe("14155550123");
|
|
7
|
-
expect(normalizePhoneNumber(" 020-7946-0958 ")).toBe("02079460958");
|
|
8
|
-
expect(normalizePhoneNumber("")).toBe("");
|
|
9
|
-
expect(normalizePhoneNumber()).toBe("");
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("matches normalized allowlist entries and rejects blank callers", () => {
|
|
13
|
-
expect(isAllowlistedCaller("14155550123", ["+1 (415) 555-0123", " 020-7946-0958 "])).toBe(true);
|
|
14
|
-
expect(isAllowlistedCaller("02079460958", ["+1 (415) 555-0123", " 020-7946-0958 "])).toBe(true);
|
|
15
|
-
expect(isAllowlistedCaller("", ["+1 (415) 555-0123"])).toBe(false);
|
|
16
|
-
expect(isAllowlistedCaller("14155550123", ["", "abc"])).toBe(false);
|
|
17
|
-
});
|
|
18
|
-
});
|
package/src/allowlist.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function normalizePhoneNumber(input?: string): string {
|
|
2
|
-
if (!input) {
|
|
3
|
-
return "";
|
|
4
|
-
}
|
|
5
|
-
return input.replace(/\D/g, "");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function isAllowlistedCaller(
|
|
9
|
-
normalizedFrom: string,
|
|
10
|
-
allowFrom: string[] | undefined,
|
|
11
|
-
): boolean {
|
|
12
|
-
if (!normalizedFrom) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return (allowFrom ?? []).some((num) => {
|
|
16
|
-
const normalizedAllow = normalizePhoneNumber(num);
|
|
17
|
-
return normalizedAllow !== "" && normalizedAllow === normalizedFrom;
|
|
18
|
-
});
|
|
19
|
-
}
|
package/src/cli.test.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { testing } from "./cli.js";
|
|
3
|
-
|
|
4
|
-
describe("voice-call CLI gateway fallback", () => {
|
|
5
|
-
it("treats abnormal local gateway closes as standalone-runtime fallback candidates", () => {
|
|
6
|
-
expect(
|
|
7
|
-
testing.isGatewayUnavailableForLocalFallback(
|
|
8
|
-
new Error("gateway closed (1006 abnormal closure (no close frame)): no close reason"),
|
|
9
|
-
),
|
|
10
|
-
).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
});
|