@xrkseek/harness 0.7.6 → 0.7.7
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/node_modules/@xrkseek/a2a/dist/inbound.d.ts.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/inbound.js +72 -2
- package/node_modules/@xrkseek/a2a/dist/inbound.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +2 -0
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/README.md +4 -3
- package/node_modules/@xrkseek/exec-voice/dist/browser/index.d.ts +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/browser/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/browser/index.js +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/browser/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/browser/wav-capture.d.ts +91 -0
- package/node_modules/@xrkseek/exec-voice/dist/browser/wav-capture.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/browser/wav-capture.js +269 -0
- package/node_modules/@xrkseek/exec-voice/dist/browser/wav-capture.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/download-http.d.ts +27 -0
- package/node_modules/@xrkseek/exec-voice/dist/download-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/download-http.js +179 -0
- package/node_modules/@xrkseek/exec-voice/dist/download-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/engine-ids.d.ts +19 -0
- package/node_modules/@xrkseek/exec-voice/dist/engine-ids.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/engine-ids.js +36 -0
- package/node_modules/@xrkseek/exec-voice/dist/engine-ids.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/engines.d.ts +60 -0
- package/node_modules/@xrkseek/exec-voice/dist/engines.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/engines.js +130 -0
- package/node_modules/@xrkseek/exec-voice/dist/engines.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/format.d.ts +13 -0
- package/node_modules/@xrkseek/exec-voice/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/format.js +22 -3
- package/node_modules/@xrkseek/exec-voice/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/index.d.ts +22 -31
- package/node_modules/@xrkseek/exec-voice/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/index.js +16 -66
- package/node_modules/@xrkseek/exec-voice/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/readiness.d.ts +14 -8
- package/node_modules/@xrkseek/exec-voice/dist/readiness.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/readiness.js +36 -27
- package/node_modules/@xrkseek/exec-voice/dist/readiness.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-assets.d.ts +48 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-assets.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-assets.js +64 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-assets.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-local.d.ts +24 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-local.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-local.js +66 -4
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-local.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-runtime.d.ts +76 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-runtime.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-runtime.js +315 -0
- package/node_modules/@xrkseek/exec-voice/dist/sensevoice-runtime.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/system-tts.d.ts +40 -0
- package/node_modules/@xrkseek/exec-voice/dist/system-tts.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/system-tts.js +260 -0
- package/node_modules/@xrkseek/exec-voice/dist/system-tts.js.map +1 -0
- package/node_modules/@xrkseek/exec-voice/dist/tools.d.ts +13 -12
- package/node_modules/@xrkseek/exec-voice/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/tools.js +12 -6
- package/node_modules/@xrkseek/exec-voice/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/types.d.ts +3 -1
- package/node_modules/@xrkseek/exec-voice/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-voice/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-voice/package.json +36 -31
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +4 -3
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +31 -18
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/dist/sidebar-previews.d.ts +2 -0
- package/node_modules/@xrkseek/protocol/dist/sidebar-previews.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/sidebar-previews.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts +21 -2
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js +56 -7
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js +26 -3
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-roles.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js +4 -0
- package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +16 -0
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/voice.d.ts +30 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/voice.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/voice.js +181 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/voice.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts +15 -0
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js +44 -10
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.js +7 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/select-session-model.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/select-session-model.js +68 -1
- package/node_modules/@xrkseek/server-face/dist/select-session-model.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.d.ts +4 -0
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js +16 -0
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tools.js +2 -0
- package/node_modules/@xrkseek/server-face/dist/session-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-document.js +56 -1
- package/node_modules/@xrkseek/server-face/dist/settings-document.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +36 -14
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts +43 -0
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +293 -24
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/wire/paths.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/wire/paths.js +6 -0
- package/node_modules/@xrkseek/server-face/dist/wire/paths.js.map +1 -1
- package/node_modules/@xrkseek/server-face/package.json +1 -0
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.js +8 -1
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +44 -45
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +2 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.js +5 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/our-free-model-host.d.ts +15 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/our-free-model-host.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/our-free-model-host.js +61 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/our-free-model-host.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wav-capture.js","sourceRoot":"","sources":["../../src/browser/wav-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEvC,yCAAyC;AACzC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAqFjC,SAAS,GAAG;IACV,OAAO,UAA+B,CAAA;AACxC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAA;IACjB,IAAI,OAAO,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,KAAK,UAAU;QAAE,OAAO,KAAK,CAAA;IACjF,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAA;QAC1D,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAA;QACtD,4EAA4E;QAC5E,IAAI,MAAM,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;IACnC,CAAC;I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AAC,EAAE,EAAE,kBAAkB,GAAG,CAAC,EAAE,IAAI,CAAC,CAAA,CAAC,YAAY;IAC7D,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA,CAAC,cAAc;IAC1C,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAA,CAAC,kBAAkB;IAC/C,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IACjB,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,CAAA;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;IACpF,OAAO,KAAK,CAAA;AACd,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,MAAM,KAAK,GAAG,MAAM,CAAA;IACpB,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC;QAC5D,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;IAC1E,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** One opened asset: status plus the body, which is null for a non-2xx. */
|
|
2
|
+
export interface DownloadStream {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly body: AsyncIterable<Uint8Array> | null;
|
|
5
|
+
}
|
|
6
|
+
interface ProxyTarget {
|
|
7
|
+
readonly host: string;
|
|
8
|
+
readonly port: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse an operator-supplied proxy URL (`http://127.0.0.1:7897`, or the bare
|
|
12
|
+
* `127.0.0.1:7897` form people paste from a Clash panel).
|
|
13
|
+
* @param value - Setting text; empty means 「no proxy」.
|
|
14
|
+
* @returns The loopback-or-remote CONNECT endpoint, or undefined when unset.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseProxy(value: string | undefined): ProxyTarget | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Open one asset URL, preferring a local proxy and falling back to a direct
|
|
19
|
+
* request when the proxy cannot carry the hop.
|
|
20
|
+
* @param rawUrl - Absolute asset URL.
|
|
21
|
+
* @param signal - Caller cancellation (no header deadline of its own).
|
|
22
|
+
* @param proxyUrl - Operator-configured proxy, if any.
|
|
23
|
+
* @returns Status plus a byte stream.
|
|
24
|
+
*/
|
|
25
|
+
export declare function openAssetStream(rawUrl: string, signal: AbortSignal, proxyUrl?: string): Promise<DownloadStream>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=download-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-http.d.ts","sourceRoot":"","sources":["../src/download-http.ts"],"names":[],"mappings":"AA6BA,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CACjD;AAED,UAAU,WAAW;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAKD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAW7E;AA+HD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CAczB"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset download that survives a filtered network.
|
|
3
|
+
*
|
|
4
|
+
* Two facts measured on the failing box, both of which `fetch` ignores:
|
|
5
|
+
*
|
|
6
|
+
* 1. `huggingface.co` / `hf-mirror.com` answer with a 302 to
|
|
7
|
+
* `cas-bridge.xethub.hf.co`, and that CloudFront host **never completes a
|
|
8
|
+
* TLS handshake from Node** (15 s timeout, then ECONNRESET) while `curl`
|
|
9
|
+
* on the same machine pulls the same URL in 1.5 s. A local proxy fixes it
|
|
10
|
+
* — `curl -x http://127.0.0.1:7897` returns 200 in 3.6 s.
|
|
11
|
+
* 2. Node's `fetch` (undici) picks one A record and gives up; `https.request`
|
|
12
|
+
* honours `autoSelectFamily`, so it already walks to a second address when
|
|
13
|
+
* the first black-holes.
|
|
14
|
+
*
|
|
15
|
+
* So the transport is: an HTTP CONNECT tunnel through the proxy the operator
|
|
16
|
+
* configured, otherwise a name-based `https` request (never a pinned IP —
|
|
17
|
+
* pinning an address bypasses proxy rules that match on hostname, which is
|
|
18
|
+
* what made the first attempt fail). The proxy is a user setting, not a guess:
|
|
19
|
+
* see `parseProxy`.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately not here: SOCKS, HTTP/2, keep-alive pooling. Three files, one
|
|
22
|
+
* press, one connection each (YAGNI).
|
|
23
|
+
*/
|
|
24
|
+
import { once } from "node:events";
|
|
25
|
+
import https from "node:https";
|
|
26
|
+
import net from "node:net";
|
|
27
|
+
import tls from "node:tls";
|
|
28
|
+
const REDIRECT_LIMIT = 5;
|
|
29
|
+
const CONNECT_TIMEOUT_MS = 8_000;
|
|
30
|
+
/**
|
|
31
|
+
* Parse an operator-supplied proxy URL (`http://127.0.0.1:7897`, or the bare
|
|
32
|
+
* `127.0.0.1:7897` form people paste from a Clash panel).
|
|
33
|
+
* @param value - Setting text; empty means 「no proxy」.
|
|
34
|
+
* @returns The loopback-or-remote CONNECT endpoint, or undefined when unset.
|
|
35
|
+
*/
|
|
36
|
+
export function parseProxy(value) {
|
|
37
|
+
if (value === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
const trimmed = value.trim();
|
|
40
|
+
if (trimmed === "")
|
|
41
|
+
return undefined;
|
|
42
|
+
try {
|
|
43
|
+
const url = new URL(trimmed.includes("://") ? trimmed : `http://${trimmed}`);
|
|
44
|
+
const port = url.port === "" ? (url.protocol === "https:" ? 443 : 80) : Number(url.port);
|
|
45
|
+
return { host: url.hostname, port };
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Open an HTTP CONNECT tunnel and wrap it in TLS for the target host.
|
|
53
|
+
* @param proxy - Local CONNECT proxy.
|
|
54
|
+
* @param hostname - Origin host the tunnel should reach.
|
|
55
|
+
* @param port - Origin port.
|
|
56
|
+
* @param signal - Caller cancellation.
|
|
57
|
+
* @returns A TLS socket already speaking to the origin.
|
|
58
|
+
*/
|
|
59
|
+
async function tunnel(proxy, hostname, port, signal) {
|
|
60
|
+
const socket = net.connect({ host: proxy.host, port: proxy.port });
|
|
61
|
+
const onAbort = () => {
|
|
62
|
+
socket.destroy();
|
|
63
|
+
};
|
|
64
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
65
|
+
try {
|
|
66
|
+
socket.setTimeout(CONNECT_TIMEOUT_MS, () => socket.destroy(new Error("proxy connect timeout")));
|
|
67
|
+
await once(socket, "connect");
|
|
68
|
+
socket.write(`CONNECT ${hostname}:${port} HTTP/1.1\r\nHost: ${hostname}:${port}\r\n\r\n`);
|
|
69
|
+
const [head] = (await once(socket, "data"));
|
|
70
|
+
const statusLine = head.toString("latin1").split("\r\n")[0] ?? "";
|
|
71
|
+
if (!/^HTTP\/1\.[01] 2\d\d/.test(statusLine)) {
|
|
72
|
+
throw new Error(`proxy refused CONNECT: ${statusLine}`);
|
|
73
|
+
}
|
|
74
|
+
socket.setTimeout(0);
|
|
75
|
+
const secured = tls.connect({ socket, servername: hostname });
|
|
76
|
+
await once(secured, "secureConnect");
|
|
77
|
+
return secured;
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
signal.removeEventListener("abort", onAbort);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Issue one GET over an established socket.
|
|
85
|
+
* @param url - Absolute https URL.
|
|
86
|
+
* @param socket - Connected TLS socket (tunnelled or direct).
|
|
87
|
+
* @param signal - Caller cancellation.
|
|
88
|
+
* @returns The response with headers already parsed.
|
|
89
|
+
*/
|
|
90
|
+
function requestOn(url, socket, signal) {
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
const request = https.request({
|
|
93
|
+
host: url.hostname,
|
|
94
|
+
port: url.port === "" ? 443 : Number(url.port),
|
|
95
|
+
servername: url.hostname,
|
|
96
|
+
path: `${url.pathname}${url.search}`,
|
|
97
|
+
method: "GET",
|
|
98
|
+
headers: { host: url.hostname, "accept-encoding": "identity" },
|
|
99
|
+
createConnection: () => socket,
|
|
100
|
+
signal,
|
|
101
|
+
}, resolve);
|
|
102
|
+
request.once("error", reject);
|
|
103
|
+
request.end();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Issue one GET letting Node own the connection (and `autoSelectFamily` own
|
|
108
|
+
* address failover).
|
|
109
|
+
* @param url - Absolute https URL.
|
|
110
|
+
* @param signal - Caller cancellation.
|
|
111
|
+
* @returns The response with headers already parsed.
|
|
112
|
+
*/
|
|
113
|
+
function requestDirect(url, signal) {
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
const request = https.request({
|
|
116
|
+
host: url.hostname,
|
|
117
|
+
port: url.port === "" ? 443 : Number(url.port),
|
|
118
|
+
servername: url.hostname,
|
|
119
|
+
path: `${url.pathname}${url.search}`,
|
|
120
|
+
method: "GET",
|
|
121
|
+
headers: { host: url.hostname, "accept-encoding": "identity" },
|
|
122
|
+
signal,
|
|
123
|
+
}, resolve);
|
|
124
|
+
request.once("error", reject);
|
|
125
|
+
request.end();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Follow redirects, opening each hop through the same transport.
|
|
130
|
+
* @param rawUrl - Absolute asset URL.
|
|
131
|
+
* @param proxy - Proxy to tunnel through, or undefined for a direct request.
|
|
132
|
+
* @param signal - Caller cancellation.
|
|
133
|
+
* @returns Status plus the body stream; non-2xx is reported, never thrown.
|
|
134
|
+
*/
|
|
135
|
+
async function openFollow(rawUrl, proxy, signal) {
|
|
136
|
+
let current = new URL(rawUrl);
|
|
137
|
+
for (let hop = 0; hop <= REDIRECT_LIMIT; hop += 1) {
|
|
138
|
+
const port = current.port === "" ? 443 : Number(current.port);
|
|
139
|
+
const response = proxy === undefined
|
|
140
|
+
? await requestDirect(current, signal)
|
|
141
|
+
: await requestOn(current, await tunnel(proxy, current.hostname, port, signal), signal);
|
|
142
|
+
const status = response.statusCode ?? 0;
|
|
143
|
+
const location = response.headers.location;
|
|
144
|
+
if (status >= 300 && status < 400 && typeof location === "string") {
|
|
145
|
+
response.resume();
|
|
146
|
+
current = new URL(location, current);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
return { status, body: status >= 200 && status < 300 ? response : null };
|
|
150
|
+
}
|
|
151
|
+
return { status: 0, body: null };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Open one asset URL, preferring a local proxy and falling back to a direct
|
|
155
|
+
* request when the proxy cannot carry the hop.
|
|
156
|
+
* @param rawUrl - Absolute asset URL.
|
|
157
|
+
* @param signal - Caller cancellation (no header deadline of its own).
|
|
158
|
+
* @param proxyUrl - Operator-configured proxy, if any.
|
|
159
|
+
* @returns Status plus a byte stream.
|
|
160
|
+
*/
|
|
161
|
+
export async function openAssetStream(rawUrl, signal, proxyUrl) {
|
|
162
|
+
// Explicit setting first, then the product's own env override. Never a
|
|
163
|
+
// guessed port: a Host must not route a user's traffic through a relay
|
|
164
|
+
// they did not name.
|
|
165
|
+
const proxy = parseProxy(proxyUrl) ?? parseProxy(process.env.XRK_DOWNLOAD_PROXY);
|
|
166
|
+
if (proxy === undefined)
|
|
167
|
+
return openFollow(rawUrl, undefined, signal);
|
|
168
|
+
try {
|
|
169
|
+
return await openFollow(rawUrl, proxy, signal);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
if (signal.aborted)
|
|
173
|
+
throw error;
|
|
174
|
+
// A proxy that cannot carry this hop must not fail the download when the
|
|
175
|
+
// direct route might work: fall through and try it.
|
|
176
|
+
return openFollow(rawUrl, undefined, signal);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=download-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-http.js","sourceRoot":"","sources":["../src/download-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,GAAG,MAAM,UAAU,CAAC;AAa3B,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAyB;IAClD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACrC,IAAI,CAAC;QACH,MA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,CAAC,kBAAkB,CAAC,CAAC;IACjF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACtE,IAAI,CAAC;QACH,OAAO,MAAM,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,OAAO;YAAE,MAAM,KAAK,CAAC;QAChC,yEAAyE;QACzE,oDAAoD;QACpD,OAAO,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine ids and the `XRK_VOICE` CI bypass, shared by the registry and the
|
|
3
|
+
* readiness copy.
|
|
4
|
+
*
|
|
5
|
+
* Kept apart from both so neither has to import the other: `engines.ts` builds
|
|
6
|
+
* Providers, `readiness.ts` only describes them, and the alias table is the
|
|
7
|
+
* single place a bypass spelling is defined.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the engine id a call should use.
|
|
11
|
+
*
|
|
12
|
+
* A non-empty `XRK_VOICE` is a CI bypass and outranks Settings; anything else
|
|
13
|
+
* falls through to the requested engine, lowercased.
|
|
14
|
+
* @param env - environment to read the bypass from.
|
|
15
|
+
* @param requested - engine id staged by the card.
|
|
16
|
+
* @returns the engine id, or the empty string when neither source names one.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveEngineId(env: NodeJS.ProcessEnv, requested: string | undefined): string;
|
|
19
|
+
//# sourceMappingURL=engine-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-ids.d.ts","sourceRoot":"","sources":["../src/engine-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,CAMR"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine ids and the `XRK_VOICE` CI bypass, shared by the registry and the
|
|
3
|
+
* readiness copy.
|
|
4
|
+
*
|
|
5
|
+
* Kept apart from both so neither has to import the other: `engines.ts` builds
|
|
6
|
+
* Providers, `readiness.ts` only describes them, and the alias table is the
|
|
7
|
+
* single place a bypass spelling is defined.
|
|
8
|
+
*/
|
|
9
|
+
/** `XRK_VOICE` aliases → engine ids. */
|
|
10
|
+
const ENV_ENGINE_ALIASES = {
|
|
11
|
+
"1": "openai",
|
|
12
|
+
openai: "openai",
|
|
13
|
+
local: "local",
|
|
14
|
+
sensevoice: "local",
|
|
15
|
+
// TTS spells its local engine `system`; the registry's table lookup falls
|
|
16
|
+
// back to that direction's local engine when the id does not exist there.
|
|
17
|
+
system: "local",
|
|
18
|
+
memory: "memory",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the engine id a call should use.
|
|
22
|
+
*
|
|
23
|
+
* A non-empty `XRK_VOICE` is a CI bypass and outranks Settings; anything else
|
|
24
|
+
* falls through to the requested engine, lowercased.
|
|
25
|
+
* @param env - environment to read the bypass from.
|
|
26
|
+
* @param requested - engine id staged by the card.
|
|
27
|
+
* @returns the engine id, or the empty string when neither source names one.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveEngineId(env, requested) {
|
|
30
|
+
const declared = String(env.XRK_VOICE ?? "").trim().toLowerCase();
|
|
31
|
+
const fromEnv = ENV_ENGINE_ALIASES[declared] ?? declared;
|
|
32
|
+
return (fromEnv !== "" ? fromEnv : (requested ?? ""))
|
|
33
|
+
.trim()
|
|
34
|
+
.toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=engine-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-ids.js","sourceRoot":"","sources":["../src/engine-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wCAAwC;AACxC,MAAM,kBAAkB,GAAqC;IAC3D,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,OAAO;IACnB,0EAA0E;IAC1E,0EAA0E;IAC1E,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAsB,EACtB,SAA6B;IAE7B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAClE,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;IACzD,OAAO,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;SAClD,IAAI,EAAE;SACN,WAAW,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { VoiceDirection, VoiceService } from "./types.js";
|
|
2
|
+
export type { VoiceDirection } from "./types.js";
|
|
3
|
+
/** Everything an engine factory may read from Settings + the environment. */
|
|
4
|
+
export interface VoiceEngineContext {
|
|
5
|
+
readonly env: NodeJS.ProcessEnv;
|
|
6
|
+
/** OpenAI-compatible endpoint override. */
|
|
7
|
+
readonly baseUrl?: string;
|
|
8
|
+
/** Local: OS voice name. Cloud: provider voice id. */
|
|
9
|
+
readonly voice?: string;
|
|
10
|
+
/** Cloud-only TTS model id. */
|
|
11
|
+
readonly model?: string;
|
|
12
|
+
readonly fetchImpl?: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
/** One registered engine. */
|
|
15
|
+
export interface VoiceEngineSpec {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly direction: VoiceDirection;
|
|
18
|
+
/** Cloud engines cannot be built without the shared OpenAI-compatible key. */
|
|
19
|
+
readonly needsKey: boolean;
|
|
20
|
+
/** Build the Provider, or undefined when its credential is missing. */
|
|
21
|
+
readonly create: (ctx: VoiceEngineContext) => VoiceService | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Every engine registered for one direction.
|
|
25
|
+
* @param direction - ASR or TTS.
|
|
26
|
+
* @returns the specs, local first.
|
|
27
|
+
*/
|
|
28
|
+
export declare function listVoiceEngines(direction: VoiceDirection): readonly VoiceEngineSpec[];
|
|
29
|
+
/** What one access request asks for. */
|
|
30
|
+
export interface VoiceAccessRequest {
|
|
31
|
+
readonly direction: VoiceDirection;
|
|
32
|
+
/** Settings engine id (`local` / `openai`). Unknown ids fall back to `local`. */
|
|
33
|
+
readonly engine?: string;
|
|
34
|
+
readonly baseUrl?: string;
|
|
35
|
+
readonly voice?: string;
|
|
36
|
+
readonly model?: string;
|
|
37
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
38
|
+
/** Injected Provider (tests / composition) wins over any engine. */
|
|
39
|
+
readonly service?: VoiceService;
|
|
40
|
+
readonly fetchImpl?: typeof fetch;
|
|
41
|
+
}
|
|
42
|
+
/** The resolved Provider plus the fact a caller may report. */
|
|
43
|
+
export interface VoiceAccess {
|
|
44
|
+
readonly service?: VoiceService;
|
|
45
|
+
/** Engine actually used after the `XRK_VOICE` bypass. */
|
|
46
|
+
readonly engine: string;
|
|
47
|
+
/** Tool-facing error when `service` is undefined. */
|
|
48
|
+
readonly unavailableMessage: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Resolve one direction's Provider from Settings + environment.
|
|
52
|
+
*
|
|
53
|
+
* Precedence: injected service → `XRK_VOICE` alias → the requested engine.
|
|
54
|
+
* An id that is not registered for this direction falls back to that
|
|
55
|
+
* direction's local engine, so a stale card value can never brick the tool.
|
|
56
|
+
* @param request - direction, engine id and provider options.
|
|
57
|
+
* @returns the Provider (when resolvable) and the honest failure copy.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createVoiceAccess(request: VoiceAccessRequest): VoiceAccess;
|
|
60
|
+
//# sourceMappingURL=engines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engines.d.ts","sourceRoot":"","sources":["../src/engines.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/D,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAED,6BAA6B;AAC7B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,YAAY,GAAG,SAAS,CAAC;CACxE;AAwED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,cAAc,GACxB,SAAS,eAAe,EAAE,CAE5B;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAED,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,CA+B1E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice engine registry — one row per Provider, split by direction.
|
|
3
|
+
*
|
|
4
|
+
* Adding an engine is one row here plus the settings enum: the Host mount, the
|
|
5
|
+
* Face handler and the cards all resolve through this table instead of each
|
|
6
|
+
* growing its own `if (engine === …)` ladder.
|
|
7
|
+
*/
|
|
8
|
+
import { createMemoryVoiceProvider } from "./memory.js";
|
|
9
|
+
import { createOpenAiVoiceProvider } from "./openai-http.js";
|
|
10
|
+
import { createSenseVoiceLocalProvider } from "./sensevoice-local.js";
|
|
11
|
+
import { createSystemVoiceProvider } from "./system-tts.js";
|
|
12
|
+
import { resolveEngineId } from "./engine-ids.js";
|
|
13
|
+
import { voiceUnavailableMessage } from "./readiness.js";
|
|
14
|
+
/** First key wins; `OPENAI_API_KEY` is the conventional fallback. */
|
|
15
|
+
function resolveApiKey(env) {
|
|
16
|
+
const explicit = String(env.XRK_VOICE_OPENAI_KEY ?? "").trim();
|
|
17
|
+
if (explicit !== "")
|
|
18
|
+
return explicit;
|
|
19
|
+
const conventional = String(env.OPENAI_API_KEY ?? "").trim();
|
|
20
|
+
return conventional === "" ? undefined : conventional;
|
|
21
|
+
}
|
|
22
|
+
function openAiEngine(direction) {
|
|
23
|
+
return {
|
|
24
|
+
id: "openai",
|
|
25
|
+
direction,
|
|
26
|
+
needsKey: true,
|
|
27
|
+
create: (ctx) => {
|
|
28
|
+
const apiKey = resolveApiKey(ctx.env);
|
|
29
|
+
if (apiKey === undefined)
|
|
30
|
+
return undefined;
|
|
31
|
+
const baseUrl = ctx.baseUrl?.trim() || String(ctx.env.XRK_VOICE_BASE_URL ?? "").trim();
|
|
32
|
+
const voice = ctx.voice?.trim();
|
|
33
|
+
const model = ctx.model?.trim();
|
|
34
|
+
return createOpenAiVoiceProvider({
|
|
35
|
+
apiKey,
|
|
36
|
+
...(baseUrl === "" ? {} : { baseUrl }),
|
|
37
|
+
...(voice === undefined || voice === "" ? {} : { defaultVoice: voice }),
|
|
38
|
+
...(model === undefined || model === "" ? {} : { ttsModel: model }),
|
|
39
|
+
...(ctx.fetchImpl ? { fetchImpl: ctx.fetchImpl } : {}),
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const ASR_ENGINES = [
|
|
45
|
+
{
|
|
46
|
+
id: "local",
|
|
47
|
+
direction: "asr",
|
|
48
|
+
needsKey: false,
|
|
49
|
+
create: (ctx) => createSenseVoiceLocalProvider({ env: ctx.env }),
|
|
50
|
+
},
|
|
51
|
+
openAiEngine("asr"),
|
|
52
|
+
// CI / demo only — reachable through `XRK_VOICE=memory`, never a card value.
|
|
53
|
+
{
|
|
54
|
+
id: "memory",
|
|
55
|
+
direction: "asr",
|
|
56
|
+
needsKey: false,
|
|
57
|
+
create: () => createMemoryVoiceProvider(),
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
const TTS_ENGINES = [
|
|
61
|
+
{
|
|
62
|
+
id: "local",
|
|
63
|
+
direction: "tts",
|
|
64
|
+
needsKey: false,
|
|
65
|
+
create: (ctx) => {
|
|
66
|
+
const voice = ctx.voice?.trim();
|
|
67
|
+
return createSystemVoiceProvider({
|
|
68
|
+
env: ctx.env,
|
|
69
|
+
...(voice === undefined || voice === "" ? {} : { defaultVoice: voice }),
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
openAiEngine("tts"),
|
|
74
|
+
{
|
|
75
|
+
id: "memory",
|
|
76
|
+
direction: "tts",
|
|
77
|
+
needsKey: false,
|
|
78
|
+
create: () => createMemoryVoiceProvider(),
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* Every engine registered for one direction.
|
|
83
|
+
* @param direction - ASR or TTS.
|
|
84
|
+
* @returns the specs, local first.
|
|
85
|
+
*/
|
|
86
|
+
export function listVoiceEngines(direction) {
|
|
87
|
+
return direction === "tts" ? TTS_ENGINES : ASR_ENGINES;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resolve one direction's Provider from Settings + environment.
|
|
91
|
+
*
|
|
92
|
+
* Precedence: injected service → `XRK_VOICE` alias → the requested engine.
|
|
93
|
+
* An id that is not registered for this direction falls back to that
|
|
94
|
+
* direction's local engine, so a stale card value can never brick the tool.
|
|
95
|
+
* @param request - direction, engine id and provider options.
|
|
96
|
+
* @returns the Provider (when resolvable) and the honest failure copy.
|
|
97
|
+
*/
|
|
98
|
+
export function createVoiceAccess(request) {
|
|
99
|
+
const env = request.env ?? process.env;
|
|
100
|
+
const table = listVoiceEngines(request.direction);
|
|
101
|
+
const requested = resolveEngineId(env, request.engine);
|
|
102
|
+
// `off` is a real answer (Settings has not enabled this direction yet), not
|
|
103
|
+
// an unknown id: it must not fall back to the local engine.
|
|
104
|
+
const spec = requested === "off"
|
|
105
|
+
? undefined
|
|
106
|
+
: (table.find((row) => row.id === requested) ?? table[0]);
|
|
107
|
+
const unavailableMessage = voiceUnavailableMessage(env, {
|
|
108
|
+
direction: request.direction,
|
|
109
|
+
engine: spec?.id ?? requested,
|
|
110
|
+
});
|
|
111
|
+
if (spec === undefined) {
|
|
112
|
+
return { engine: "off", unavailableMessage };
|
|
113
|
+
}
|
|
114
|
+
if (request.service) {
|
|
115
|
+
return { service: request.service, engine: spec.id, unavailableMessage };
|
|
116
|
+
}
|
|
117
|
+
const created = spec.create({
|
|
118
|
+
env,
|
|
119
|
+
...(request.baseUrl ? { baseUrl: request.baseUrl } : {}),
|
|
120
|
+
...(request.voice ? { voice: request.voice } : {}),
|
|
121
|
+
...(request.model ? { model: request.model } : {}),
|
|
122
|
+
...(request.fetchImpl ? { fetchImpl: request.fetchImpl } : {}),
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
...(created === undefined ? {} : { service: created }),
|
|
126
|
+
engine: spec.id,
|
|
127
|
+
unavailableMessage,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=engines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engines.js","sourceRoot":"","sources":["../src/engines.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AA2BzD,qEAAqE;AACrE,SAAS,aAAa,CAAC,GAAsB;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,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AC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC,CAAC;IACH,OAAO;QACL,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACtD,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt blocks for the voice tools.
|
|
3
|
+
*
|
|
4
|
+
* Split by switch so an agent never reads about a tool that is not bound:
|
|
5
|
+
* `tts.enabled` owns `text_to_speech`, `asr.enabled` owns transcription and
|
|
6
|
+
* the live session. `voicePromptText` picks the blocks that actually exist on
|
|
7
|
+
* the surface.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VOICE_TTS_PROMPT_TEXT: string;
|
|
10
|
+
export declare const VOICE_ASR_PROMPT_TEXT: string;
|
|
11
|
+
/** Both blocks — for callers that show voice as one subject. */
|
|
1
12
|
export declare const VOICE_PROMPT_TEXT: string;
|
|
13
|
+
/** The blocks whose tools are actually on this surface; empty when none are. */
|
|
14
|
+
export declare function voicePromptText(has: (name: string) => boolean): string;
|
|
2
15
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,qBAAqB,QAEtB,CAAC;AAEb,eAAO,MAAM,qBAAqB,QAGtB,CAAC;AAEb,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,QAE7B,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAKtE"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Prompt blocks for the voice tools.
|
|
3
|
+
*
|
|
4
|
+
* Split by switch so an agent never reads about a tool that is not bound:
|
|
5
|
+
* `tts.enabled` owns `text_to_speech`, `asr.enabled` owns transcription and
|
|
6
|
+
* the live session. `voicePromptText` picks the blocks that actually exist on
|
|
7
|
+
* the surface.
|
|
8
|
+
*/
|
|
9
|
+
export const VOICE_TTS_PROMPT_TEXT = [
|
|
3
10
|
"- `text_to_speech` speaks text via the Host TTS Provider (returns audio meta; does not play on the server).",
|
|
11
|
+
].join("\n");
|
|
12
|
+
export const VOICE_ASR_PROMPT_TEXT = [
|
|
4
13
|
"- `voice_transcribe` runs one-shot STT on base64 audio (dictation / message audio).",
|
|
5
14
|
"- `voice_session` creates a realtime voice session broker (ephemeral client secret / stub SDP); mic/speaker stay on the client. Mode is Host-side, not a Face child turn.",
|
|
6
|
-
"- Without `XRK_VOICE=1` (OpenAI key) or `XRK_VOICE=memory`, tools stay visible and fail honestly.",
|
|
7
15
|
].join("\n");
|
|
16
|
+
/** Both blocks — for callers that show voice as one subject. */
|
|
17
|
+
export const VOICE_PROMPT_TEXT = ["Voice (Host):", VOICE_TTS_PROMPT_TEXT, VOICE_ASR_PROMPT_TEXT].join("\n");
|
|
18
|
+
/** The blocks whose tools are actually on this surface; empty when none are. */
|
|
19
|
+
export function voicePromptText(has) {
|
|
20
|
+
const blocks = [];
|
|
21
|
+
if (has("text_to_speech"))
|
|
22
|
+
blocks.push(VOICE_TTS_PROMPT_TEXT);
|
|
23
|
+
if (has("voice_transcribe") || has("voice_session"))
|
|
24
|
+
blocks.push(VOICE_ASR_PROMPT_TEXT);
|
|
25
|
+
return blocks.length === 0 ? "" : ["Voice (Host):", ...blocks].join("\n");
|
|
26
|
+
}
|
|
8
27
|
//# sourceMappingURL=format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,6GAA6G;CAC9G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,qFAAqF;IACrF,2KAA2K;CAC5K,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,eAAe,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,IAAI,CACnG,IAAI,CACL,CAAC;AAEF,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,GAA8B;IAC5D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC9D,IAAI,GAAG,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACxF,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Voice Host seam: engine registry + Provider contracts + tools.
|
|
3
|
+
*
|
|
4
|
+
* One entry point builds a Provider — {@link createVoiceAccess} — and the Host,
|
|
5
|
+
* the Face handler and the cards all go through it. Adding a Provider is one
|
|
6
|
+
* row in `engines.ts` plus the settings enum; nothing else grows an engine
|
|
7
|
+
* branch.
|
|
8
|
+
*/
|
|
9
|
+
export { VoiceError, isVoiceError, type VoiceDelivery, type VoiceDirection, type VoiceErrorCode, type VoiceLiveCreateRequest, type VoiceLiveCreateResult, type VoiceLiveStatus, type VoiceService, type VoiceSynthesizeRequest, type VoiceSynthesizeResult, type VoiceTranscribeRequest, type VoiceTranscribeResult, } from "./types.js";
|
|
10
|
+
export { resolveEngineId } from "./engine-ids.js";
|
|
11
|
+
export { createVoiceAccess, listVoiceEngines, type VoiceAccess, type VoiceAccessRequest, type VoiceEngineContext, type VoiceEngineSpec, } from "./engines.js";
|
|
12
|
+
export { createVoiceTools, createSpeakTool, describeVoiceAccess, voiceUnavailableMessage, type CreateVoiceToolsOptions, type VoiceAccessDescription, type VoiceAccessFacts, type VoiceAccessKind, } from "./tools.js";
|
|
13
|
+
export { VOICE_ASR_PROMPT_TEXT, VOICE_PROMPT_TEXT, VOICE_TTS_PROMPT_TEXT, voicePromptText, } from "./format.js";
|
|
4
14
|
export { createMemoryVoiceProvider, minimalWavBytes, type MemoryVoiceOptions, } from "./memory.js";
|
|
5
15
|
export { createOpenAiVoiceProvider, type OpenAiVoiceOptions, } from "./openai-http.js";
|
|
6
|
-
export { createSenseVoiceLocalProvider, inspectSenseVoiceAssets, senseVoiceDataRoot, type SenseVoiceInspectResult, type SenseVoiceLocalOptions, } from "./sensevoice-local.js";
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
export type
|
|
10
|
-
/**
|
|
16
|
+
export { createSenseVoiceLocalProvider, inspectSenseVoiceAssets, probeSenseVoiceEngine, senseVoiceDataRoot, SENSEVOICE_PLATFORMS, type SenseVoiceEngineProbe, type SenseVoiceInspectResult, type SenseVoiceLocalOptions, } from "./sensevoice-local.js";
|
|
17
|
+
export { createSystemVoiceProvider, listSystemVoices, type SystemVoice, type SystemVoiceOptions, } from "./system-tts.js";
|
|
18
|
+
export { SENSEVOICE_ASSETS, SENSEVOICE_ORIGINS, SENSEVOICE_TOTAL_BYTES, type SenseVoiceAsset, } from "./sensevoice-assets.js";
|
|
19
|
+
export { SenseVoicePreparer, senseVoicePreparer, type SenseVoicePrepareErrorCode, type SenseVoicePrepareFailure, type SenseVoicePreparePhase, type SenseVoicePreparerOptions, type SenseVoicePrepareState, } from "./sensevoice-runtime.js";
|
|
20
|
+
/**
|
|
21
|
+
* Host-side snapshot of the ASR product carried with agent settings.
|
|
22
|
+
* Shape only — `createVoiceAccess` reads the live Settings namespace instead.
|
|
23
|
+
*/
|
|
11
24
|
export interface VoiceProductConfig {
|
|
12
|
-
readonly mode:
|
|
25
|
+
readonly mode: "off" | "openai" | "local" | "system";
|
|
13
26
|
/** Optional OpenAI-compatible base URL. */
|
|
14
27
|
readonly baseUrl?: string;
|
|
15
28
|
}
|
|
16
|
-
export interface DefaultVoiceAccessOptions {
|
|
17
|
-
readonly env?: NodeJS.ProcessEnv;
|
|
18
|
-
/**
|
|
19
|
-
* Face Settings product. Used when `XRK_VOICE` is unset
|
|
20
|
-
* (env remains the CI bypass).
|
|
21
|
-
*/
|
|
22
|
-
readonly product?: VoiceProductConfig;
|
|
23
|
-
readonly service?: VoiceService;
|
|
24
|
-
readonly fetchImpl?: typeof fetch;
|
|
25
|
-
}
|
|
26
|
-
export interface DefaultVoiceAccess {
|
|
27
|
-
readonly service?: VoiceService;
|
|
28
|
-
readonly unavailableMessage: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Resolve a voice Provider.
|
|
32
|
-
* - Injected `service` wins.
|
|
33
|
-
* - Non-empty `XRK_VOICE` is CI bypass over Face `product`.
|
|
34
|
-
* - Product / env: `off` · `openai` (`1`) · `memory` (env-only).
|
|
35
|
-
* - Else no service; tools stay registered and fail honestly.
|
|
36
|
-
*/
|
|
37
|
-
export declare function createDefaultVoiceAccess(options?: DefaultVoiceAccessOptions): DefaultVoiceAccess;
|
|
38
29
|
//# sourceMappingURL=index.d.ts.map
|