@openclaw/facetime 2026.11.5-beta.4 → 2026.11.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{setup-D3xHzHpV.mjs → setup-ByISvnBj.mjs} +5 -10
- package/dist/.source-module-urls/38481bccca5fbb406e50ac928748f9f04f5a6cf5623980901b3cebc6ee82dfb6.json +1 -1
- package/dist/doctor-contract-api.js +6 -12
- package/dist/index.js +4 -7
- package/dist/runtime-api.js +33 -64
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/package.json +5 -5
- package/src/audio-pump.ts +2 -4
- package/src/helper-rpc.ts +1 -2
- package/src/helper-supervisor.ts +2 -4
- package/src/runtime-call-control.ts +1 -2
- package/src/runtime.ts +1 -2
- package/src/talk-driver.ts +1 -2
|
@@ -5,7 +5,7 @@ import { resolve } from "node:path";
|
|
|
5
5
|
import { constants } from "node:fs";
|
|
6
6
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
|
-
|
|
8
|
+
// extensions/facetime/src/config.ts
|
|
9
9
|
const DEFAULT_INSTRUCTIONS = ["You are the realtime voice surface for the configured OpenClaw agent during a private 1:1 FaceTime call.", "Keep replies concise, natural, and useful for a hands-free voice conversation."].join(" ");
|
|
10
10
|
function resolveRealtimeVoiceAgentConsultToolPolicy(value) {
|
|
11
11
|
if (value === void 0) return "owner";
|
|
@@ -49,8 +49,7 @@ function validateFaceTimeConfig(config) {
|
|
|
49
49
|
errors
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
//#region extensions/facetime/src/driver-setup.ts
|
|
52
|
+
// extensions/facetime/src/driver-setup.ts
|
|
54
53
|
function readDriverStatus(output) {
|
|
55
54
|
const status = output.trim();
|
|
56
55
|
if (status === "current" || status === "invalid" || status === "missing" || status === "outdated") return status;
|
|
@@ -92,8 +91,7 @@ async function installFaceTimeDriver(params) {
|
|
|
92
91
|
async function uninstallFaceTimeDriver(params) {
|
|
93
92
|
await runDriverSetup(params, "uninstall");
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
//#region extensions/facetime/src/plugin-paths.ts
|
|
94
|
+
// extensions/facetime/src/plugin-paths.ts
|
|
97
95
|
const NATIVE_PROTOCOL = "NATIVE_PROTOCOL_VERSION=1";
|
|
98
96
|
const NATIVE_DIRS = ["/opt/homebrew/opt/openclaw-facetime/libexec", "/usr/local/opt/openclaw-facetime/libexec"];
|
|
99
97
|
const INSTALL_COMMAND = "brew install openclaw/tap/openclaw-facetime";
|
|
@@ -180,13 +178,11 @@ async function ensureHelperArtifacts(params) {
|
|
|
180
178
|
ipcKey
|
|
181
179
|
};
|
|
182
180
|
}
|
|
183
|
-
|
|
184
|
-
//#region extensions/facetime/src/command-output.ts
|
|
181
|
+
// extensions/facetime/src/command-output.ts
|
|
185
182
|
function firstLine(value) {
|
|
186
183
|
return typeof value === "string" ? value.trim().split(/\r?\n/u)[0] || void 0 : void 0;
|
|
187
184
|
}
|
|
188
|
-
|
|
189
|
-
//#region extensions/facetime/src/setup.ts
|
|
185
|
+
// extensions/facetime/src/setup.ts
|
|
190
186
|
const XCODE_APP = "/Applications/Xcode.app";
|
|
191
187
|
const XCODE_CLANG = `${XCODE_APP}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang`;
|
|
192
188
|
const XCODE_MACOS_SDK = `${XCODE_APP}/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk`;
|
|
@@ -484,5 +480,4 @@ async function runFaceTimeSetup(params) {
|
|
|
484
480
|
actions: [...new Set(checks.flatMap((check) => check.actionId ? [check.actionId] : []))].map((id) => Object.assign({ id }, SETUP_ACTIONS[id]))
|
|
485
481
|
};
|
|
486
482
|
}
|
|
487
|
-
//#endregion
|
|
488
483
|
export { inspectFaceTimeArtifacts as a, installFaceTimeDriver as c, validateFaceTimeConfig as d, ensureHelperArtifacts as i, uninstallFaceTimeDriver as l, firstLine as n, inspectFaceTimeNativePackage as o, ensureCaptureBinary as r, inspectFaceTimeDriver as s, runFaceTimeSetup as t, resolveFaceTimeConfig as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"doctor-contract-api.js","source":"extensions/facetime/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/facetime/index.ts"},{"output":"runtime-api.js","source":"extensions/facetime/runtime-api.ts"}],"chunks":[{"output":".setup/setup-
|
|
1
|
+
{"version":3,"entries":[{"output":"doctor-contract-api.js","source":"extensions/facetime/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/facetime/index.ts"},{"output":"runtime-api.js","source":"extensions/facetime/runtime-api.ts"}],"chunks":[{"output":".setup/setup-ByISvnBj.mjs","sha256":"09e732d794b64a6dbcf8759386d4ff4cf65055e396f9ca80d103e1d72fe224c2","facadeSource":null,"sources":["extensions/facetime/src/command-output.ts","extensions/facetime/src/config.ts","extensions/facetime/src/driver-setup.ts","extensions/facetime/src/plugin-paths.ts","extensions/facetime/src/setup.ts"]},{"output":"doctor-contract-api.js","sha256":"c7a8b2f5905715f132439189cfca5c14a3158628998594e98525ca3d0adda557","facadeSource":"extensions/facetime/doctor-contract-api.ts","sources":["extensions/facetime/doctor-contract-api.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":"index.js","sha256":"34c68c8f7c65e4136199e5e083569fec5812521076b3d5439f8b730bf499997c","facadeSource":"extensions/facetime/index.ts","sources":["extensions/facetime/index.ts","extensions/facetime/src/static-status.ts","extensions/facetime/src/tool.ts"]},{"output":"runtime-api.js","sha256":"6522e957a49f9bab971144598df97bd367c3fff3b936264e55d7859dbeefc2b1","facadeSource":"extensions/facetime/runtime-api.ts","sources":["extensions/facetime/helper-endpoint.json","extensions/facetime/src/audio-pump.ts","extensions/facetime/src/call-events.ts","extensions/facetime/src/helper-endpoint.ts","extensions/facetime/src/helper-results.ts","extensions/facetime/src/helper-rpc.ts","extensions/facetime/src/helper-supervisor.ts","extensions/facetime/src/outbound-call.ts","extensions/facetime/src/pending-dial-store.ts","extensions/facetime/src/preflight.ts","extensions/facetime/src/runtime-call-control.ts","extensions/facetime/src/runtime-call-events.ts","extensions/facetime/src/runtime-carrier-process.ts","extensions/facetime/src/runtime-helper-results.ts","extensions/facetime/src/runtime-state.ts","extensions/facetime/src/runtime-status.ts","extensions/facetime/src/runtime.ts","extensions/facetime/src/talk-consult-controller.ts","extensions/facetime/src/talk-driver-config.ts","extensions/facetime/src/talk-driver.ts","extensions/facetime/src/talk-events-summary.ts"]}],"unrenderedSources":["extensions/facetime/runtime-api.ts"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,8 +24,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
|
|
28
|
-
//#region packages/normalization-core/src/record-coerce.ts
|
|
27
|
+
// packages/normalization-core/src/record-coerce.ts
|
|
29
28
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
30
29
|
function isRecord(value) {
|
|
31
30
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -34,8 +33,7 @@ function isRecord(value) {
|
|
|
34
33
|
function asNullableRecord(value) {
|
|
35
34
|
return isRecord(value) ? value : null;
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/config/channel-config-normalization.ts
|
|
36
|
+
// src/config/channel-config-normalization.ts
|
|
39
37
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
40
38
|
function normalizeChannelAccounts(params) {
|
|
41
39
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -111,8 +109,7 @@ function normalizeChannelConfigEntries(params) {
|
|
|
111
109
|
changes
|
|
112
110
|
};
|
|
113
111
|
}
|
|
114
|
-
|
|
115
|
-
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
112
|
+
// src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
116
113
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
117
114
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
118
115
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -182,13 +179,11 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
182
179
|
}
|
|
183
180
|
};
|
|
184
181
|
}
|
|
185
|
-
|
|
186
|
-
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
182
|
+
// \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
187
183
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
188
184
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
189
185
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
190
|
-
|
|
191
|
-
//#region extensions/facetime/doctor-contract-api.ts
|
|
186
|
+
// extensions/facetime/doctor-contract-api.ts
|
|
192
187
|
const CONFIG_PATH = [
|
|
193
188
|
"plugins",
|
|
194
189
|
"entries",
|
|
@@ -269,5 +264,4 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
269
264
|
changes
|
|
270
265
|
};
|
|
271
266
|
}
|
|
272
|
-
//#endregion
|
|
273
267
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as inspectFaceTimeArtifacts, d as validateFaceTimeConfig, l as uninstallFaceTimeDriver, o as inspectFaceTimeNativePackage, s as inspectFaceTimeDriver, t as runFaceTimeSetup, u as resolveFaceTimeConfig } from "./.setup/setup-
|
|
1
|
+
import { a as inspectFaceTimeArtifacts, d as validateFaceTimeConfig, l as uninstallFaceTimeDriver, o as inspectFaceTimeNativePackage, s as inspectFaceTimeDriver, t as runFaceTimeSetup, u as resolveFaceTimeConfig } from "./.setup/setup-ByISvnBj.mjs";
|
|
2
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
import { ErrorCodes, errorShape } from "openclaw/plugin-sdk/gateway-runtime";
|
|
4
4
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
@@ -6,7 +6,7 @@ import { asRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-co
|
|
|
6
6
|
import { stringEnum } from "openclaw/plugin-sdk/channel-actions";
|
|
7
7
|
import { jsonResult } from "openclaw/plugin-sdk/tool-results";
|
|
8
8
|
import { Type } from "typebox";
|
|
9
|
-
|
|
9
|
+
// extensions/facetime/src/static-status.ts
|
|
10
10
|
async function inspectFaceTimeStaticStatus(params) {
|
|
11
11
|
const [artifacts, driver] = await Promise.all([inspectFaceTimeArtifacts(), inspectFaceTimeDriver(params).then((status) => ({ status }), (error) => ({ error: formatErrorMessage(error) }))]);
|
|
12
12
|
return {
|
|
@@ -20,8 +20,7 @@ async function inspectFaceTimeStaticStatus(params) {
|
|
|
20
20
|
note: "Static inspection only; helper, carrier, model media, and remote audibility were not activated or tested."
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
//#region extensions/facetime/src/tool.ts
|
|
23
|
+
// extensions/facetime/src/tool.ts
|
|
25
24
|
const FaceTimeCallToolSchema = Type.Object({
|
|
26
25
|
action: stringEnum([
|
|
27
26
|
"get_status",
|
|
@@ -144,8 +143,7 @@ function createFaceTimeCallTool(params) {
|
|
|
144
143
|
}
|
|
145
144
|
};
|
|
146
145
|
}
|
|
147
|
-
|
|
148
|
-
//#region extensions/facetime/index.ts
|
|
146
|
+
// extensions/facetime/index.ts
|
|
149
147
|
const faceTimePlugin = definePluginEntry({
|
|
150
148
|
id: "facetime",
|
|
151
149
|
name: "FaceTime",
|
|
@@ -291,5 +289,4 @@ const faceTimePlugin = definePluginEntry({
|
|
|
291
289
|
});
|
|
292
290
|
}
|
|
293
291
|
});
|
|
294
|
-
//#endregion
|
|
295
292
|
export { faceTimePlugin as default };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as installFaceTimeDriver, d as validateFaceTimeConfig, i as ensureHelperArtifacts, n as firstLine, r as ensureCaptureBinary, t as runFaceTimeSetup, u as resolveFaceTimeConfig } from "./.setup/setup-
|
|
1
|
+
import { c as installFaceTimeDriver, d as validateFaceTimeConfig, i as ensureHelperArtifacts, n as firstLine, r as ensureCaptureBinary, t as runFaceTimeSetup, u as resolveFaceTimeConfig } from "./.setup/setup-ByISvnBj.mjs";
|
|
2
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_PCM16_24KHZ, buildRealtimeVoiceAgentCancelProviderResult, buildRealtimeVoiceAgentConsultPolicyInstructions, buildRealtimeVoiceAgentConsultWorkingResponse, consultRealtimeVoiceAgent, createRealtimeVoiceBridgeSession, createTalkSessionController, getRealtimeVoiceProvider, recordRealtimeVoiceTranscript, recordTalkObservabilityEvent, resolveConfiguredRealtimeVoiceProviderAsync, resolveRealtimeVoiceAgentConsultTools, resolveRealtimeVoiceAgentConsultToolsAllow } from "openclaw/plugin-sdk/realtime-voice";
|
|
4
4
|
import { asBoolean, asFiniteNumber, asRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -16,7 +16,7 @@ import { parseAgentSessionKey, resolveAgentIdFromSessionKey } from "openclaw/plu
|
|
|
16
16
|
import { resolveConfiguredSecretInputString } from "openclaw/plugin-sdk/secret-input-runtime";
|
|
17
17
|
import { resolveRealtimeVoiceAgentContextInstructions } from "openclaw/plugin-sdk/realtime-bootstrap-context";
|
|
18
18
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
19
|
-
|
|
19
|
+
// extensions/facetime/src/call-events.ts
|
|
20
20
|
const TU_CALL_STATUS = {
|
|
21
21
|
outgoingCreated: 0,
|
|
22
22
|
active: 1,
|
|
@@ -158,13 +158,11 @@ function isEndedCall(event) {
|
|
|
158
158
|
function isUnknownCallStatus(event) {
|
|
159
159
|
return !isIncomingRingingCall(event) && !isOutgoingRingingCall(event) && !isActiveCall(event) && !isEndedCall(event);
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
//#region extensions/facetime/helper-endpoint.json
|
|
161
|
+
// extensions/facetime/helper-endpoint.json
|
|
163
162
|
var host = "127.0.0.1";
|
|
164
163
|
var basePort = 45670;
|
|
165
164
|
var maxPort = 65535;
|
|
166
|
-
|
|
167
|
-
//#region extensions/facetime/src/helper-endpoint.ts
|
|
165
|
+
// extensions/facetime/src/helper-endpoint.ts
|
|
168
166
|
function resolveFaceTimeHelperEndpoint() {
|
|
169
167
|
const uid = typeof process.getuid === "function" ? process.getuid() : 501;
|
|
170
168
|
if (host !== "127.0.0.1" || !Number.isSafeInteger(basePort) || !Number.isSafeInteger(maxPort) || basePort < 1024 || maxPort > 65535 || basePort > maxPort || !Number.isSafeInteger(uid)) throw new Error("Invalid FaceTime loopback helper endpoint contract");
|
|
@@ -173,8 +171,7 @@ function resolveFaceTimeHelperEndpoint() {
|
|
|
173
171
|
port: Math.min(Math.max(basePort + uid - 501, basePort), maxPort)
|
|
174
172
|
};
|
|
175
173
|
}
|
|
176
|
-
|
|
177
|
-
//#region extensions/facetime/src/helper-results.ts
|
|
174
|
+
// extensions/facetime/src/helper-results.ts
|
|
178
175
|
const DIAL_BUNDLES = /* @__PURE__ */ new Set(["com.apple.FaceTime", "com.apple.FaceTime.FTConversationService"]);
|
|
179
176
|
var FaceTimeHelperAmbiguousError = class extends Error {
|
|
180
177
|
constructor(message, result = {}) {
|
|
@@ -210,8 +207,7 @@ function projectCompleteFaceTimeAbsence(result) {
|
|
|
210
207
|
if (result.topologyGeneration === void 0) throw new FaceTimeHelperAmbiguousError("FaceTime topology generation is missing", result);
|
|
211
208
|
return result.topologyGeneration;
|
|
212
209
|
}
|
|
213
|
-
|
|
214
|
-
//#region extensions/facetime/src/helper-rpc.ts
|
|
210
|
+
// extensions/facetime/src/helper-rpc.ts
|
|
215
211
|
const LEGACY_PHONE_BUNDLES = /* @__PURE__ */ new Set(["com.apple.mobilephone", "com.apple.TelephonyUtilities"]);
|
|
216
212
|
const FACETIME_HELPER_BUNDLES = /* @__PURE__ */ new Set([...DIAL_BUNDLES, ...LEGACY_PHONE_BUNDLES]);
|
|
217
213
|
const isCallHelper = (bundleIdentifier) => DIAL_BUNDLES.has(bundleIdentifier);
|
|
@@ -329,8 +325,7 @@ var FaceTimeHelperSocketServer = class {
|
|
|
329
325
|
socket.setEncoding("utf8");
|
|
330
326
|
const authDeadline = setTimeout(() => {
|
|
331
327
|
if (!this.#socketPeers.has(socket)) socket.destroy();
|
|
332
|
-
}, AUTH_DEADLINE_MS);
|
|
333
|
-
authDeadline.unref?.();
|
|
328
|
+
}, AUTH_DEADLINE_MS).unref();
|
|
334
329
|
this.#authDeadlineTimers.set(socket, authDeadline);
|
|
335
330
|
let buffer = "";
|
|
336
331
|
socket.on("data", (chunk) => {
|
|
@@ -594,8 +589,7 @@ var FaceTimeHelperSocketServer = class {
|
|
|
594
589
|
});
|
|
595
590
|
}
|
|
596
591
|
};
|
|
597
|
-
|
|
598
|
-
//#region extensions/facetime/src/helper-supervisor.ts
|
|
592
|
+
// extensions/facetime/src/helper-supervisor.ts
|
|
599
593
|
const FACETIME_HELPER_TARGETS = ["FaceTime"];
|
|
600
594
|
const RETRY_DELAYS_MS = [
|
|
601
595
|
1e3,
|
|
@@ -696,8 +690,7 @@ var FaceTimeHelperSupervisor = class {
|
|
|
696
690
|
const timer = setTimeout(() => {
|
|
697
691
|
this.#timers.delete(target);
|
|
698
692
|
this.#enqueueInjection(target);
|
|
699
|
-
}, delayMs);
|
|
700
|
-
timer.unref?.();
|
|
693
|
+
}, delayMs).unref();
|
|
701
694
|
this.#timers.set(target, timer);
|
|
702
695
|
}
|
|
703
696
|
#scheduleStaleProcessCheck(target, processId) {
|
|
@@ -722,8 +715,7 @@ var FaceTimeHelperSupervisor = class {
|
|
|
722
715
|
state.attempts = 0;
|
|
723
716
|
state.lastError = void 0;
|
|
724
717
|
this.#schedule(target, 0);
|
|
725
|
-
}, 2e3);
|
|
726
|
-
timer.unref?.();
|
|
718
|
+
}, 2e3).unref();
|
|
727
719
|
this.#timers.set(target, timer);
|
|
728
720
|
}
|
|
729
721
|
#enqueueInjection(target) {
|
|
@@ -789,8 +781,7 @@ var FaceTimeHelperSupervisor = class {
|
|
|
789
781
|
}
|
|
790
782
|
}
|
|
791
783
|
};
|
|
792
|
-
|
|
793
|
-
//#region extensions/facetime/src/outbound-call.ts
|
|
784
|
+
// extensions/facetime/src/outbound-call.ts
|
|
794
785
|
function normalizeFaceTimeOutboundIdentityEvent(value) {
|
|
795
786
|
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
796
787
|
const record = asRecord(value);
|
|
@@ -872,8 +863,7 @@ function retainFaceTimeDialCallUUID(pending, callUUID) {
|
|
|
872
863
|
function doesPendingFaceTimeDialHaveCallUUID(pending, callUUID) {
|
|
873
864
|
return pending.callUUID === callUUID || pending.callUUIDAliases?.has(callUUID) === true;
|
|
874
865
|
}
|
|
875
|
-
|
|
876
|
-
//#region extensions/facetime/src/pending-dial-store.ts
|
|
866
|
+
// extensions/facetime/src/pending-dial-store.ts
|
|
877
867
|
const PENDING_DIAL_KEY = "active";
|
|
878
868
|
function decodePendingDial(value) {
|
|
879
869
|
if (!value || value.version !== 1 || !Number.isSafeInteger(value.ownerEpoch) || value.ownerEpoch < 1 || typeof value.dialID !== "string" || typeof value.handle !== "string" || value.mode !== "audio" && value.mode !== "video" || value.delivery !== "in-flight" && value.delivery !== "accepted" && value.delivery !== "ambiguous" && value.delivery !== "cancelling" || typeof value.requestedAt !== "string") return;
|
|
@@ -932,8 +922,7 @@ var PendingFaceTimeDialStore = class {
|
|
|
932
922
|
return this.#tail;
|
|
933
923
|
}
|
|
934
924
|
};
|
|
935
|
-
|
|
936
|
-
//#region extensions/facetime/src/audio-pump.ts
|
|
925
|
+
// extensions/facetime/src/audio-pump.ts
|
|
937
926
|
const CAFFEINATE_COMMAND = "/usr/bin/caffeinate";
|
|
938
927
|
const CAPTURE_CLOSE_SAFE_FRAME = Buffer.from([
|
|
939
928
|
4,
|
|
@@ -1114,8 +1103,7 @@ function createAudioReadiness() {
|
|
|
1114
1103
|
promise: deferred.promise,
|
|
1115
1104
|
start(timeoutMs, onTimeout) {
|
|
1116
1105
|
if (settled || timer) return;
|
|
1117
|
-
timer = setTimeout(onTimeout, timeoutMs);
|
|
1118
|
-
timer.unref?.();
|
|
1106
|
+
timer = setTimeout(onTimeout, timeoutMs).unref();
|
|
1119
1107
|
},
|
|
1120
1108
|
settle(error) {
|
|
1121
1109
|
if (settled) return;
|
|
@@ -1277,8 +1265,7 @@ function startFaceTimeAudioPump(params) {
|
|
|
1277
1265
|
if (stopped || mediaSuspended) return;
|
|
1278
1266
|
const delayMs = Math.ceil(playbackClock.millisecondsUntilDrained());
|
|
1279
1267
|
if (delayMs > 0) {
|
|
1280
|
-
drainTimer = setTimeout(notifyWhenDrained, Math.max(1, delayMs));
|
|
1281
|
-
drainTimer.unref?.();
|
|
1268
|
+
drainTimer = setTimeout(notifyWhenDrained, Math.max(1, delayMs)).unref();
|
|
1282
1269
|
return;
|
|
1283
1270
|
}
|
|
1284
1271
|
drainTimer = void 0;
|
|
@@ -1302,8 +1289,7 @@ function startFaceTimeAudioPump(params) {
|
|
|
1302
1289
|
stop
|
|
1303
1290
|
};
|
|
1304
1291
|
}
|
|
1305
|
-
|
|
1306
|
-
//#region extensions/facetime/src/talk-driver-config.ts
|
|
1292
|
+
// extensions/facetime/src/talk-driver-config.ts
|
|
1307
1293
|
const CONSULT_SYSTEM_PROMPT = [
|
|
1308
1294
|
"You are the configured OpenClaw agent receiving a delegated request from an authenticated owner in a private 1:1 FaceTime call.",
|
|
1309
1295
|
"The authenticated caller is the configured owner/user described by this agent's workspace context, including USER.md. When asked who is speaking, identify them from that workspace context without asking them to reconfirm.",
|
|
@@ -1394,8 +1380,7 @@ async function resolveFaceTimeRealtimeProvider(params) {
|
|
|
1394
1380
|
noRegisteredProviderMessage: "No realtime voice provider registered"
|
|
1395
1381
|
});
|
|
1396
1382
|
}
|
|
1397
|
-
|
|
1398
|
-
//#region extensions/facetime/src/preflight.ts
|
|
1383
|
+
// extensions/facetime/src/preflight.ts
|
|
1399
1384
|
function parseDefaultAudioDevices(raw) {
|
|
1400
1385
|
const parsed = JSON.parse(raw);
|
|
1401
1386
|
const record = asRecord(parsed);
|
|
@@ -1570,8 +1555,7 @@ async function runFaceTimePreflight(params) {
|
|
|
1570
1555
|
checks
|
|
1571
1556
|
};
|
|
1572
1557
|
}
|
|
1573
|
-
|
|
1574
|
-
//#region extensions/facetime/src/runtime-carrier-process.ts
|
|
1558
|
+
// extensions/facetime/src/runtime-carrier-process.ts
|
|
1575
1559
|
async function terminateExactCarrierProcesses(params) {
|
|
1576
1560
|
params.assertCurrent();
|
|
1577
1561
|
if (params.peers.size === 0) throw new Error("no authenticated carrier process identity is available for safe shutdown");
|
|
@@ -1618,8 +1602,7 @@ async function terminateExactCarrierProcesses(params) {
|
|
|
1618
1602
|
if (alive) throw new Error("authenticated carrier process remains alive after force termination");
|
|
1619
1603
|
}
|
|
1620
1604
|
}
|
|
1621
|
-
|
|
1622
|
-
//#region extensions/facetime/src/runtime-helper-results.ts
|
|
1605
|
+
// extensions/facetime/src/runtime-helper-results.ts
|
|
1623
1606
|
function readHelperPeers(result) {
|
|
1624
1607
|
return readHelperResults(result).flatMap((entry) => entry.helperPeer ? [entry.helperPeer] : []);
|
|
1625
1608
|
}
|
|
@@ -1682,8 +1665,7 @@ async function reconcilePendingFaceTimeCarrier(params) {
|
|
|
1682
1665
|
if (attempt + 1 < 12) await sleep(250);
|
|
1683
1666
|
}
|
|
1684
1667
|
}
|
|
1685
|
-
|
|
1686
|
-
//#region extensions/facetime/src/talk-consult-controller.ts
|
|
1668
|
+
// extensions/facetime/src/talk-consult-controller.ts
|
|
1687
1669
|
function createFaceTimeConsultController(params) {
|
|
1688
1670
|
const pending = /* @__PURE__ */ new Map();
|
|
1689
1671
|
let hangupRequested = false;
|
|
@@ -1947,8 +1929,7 @@ function createFaceTimeConsultController(params) {
|
|
|
1947
1929
|
handleToolCall
|
|
1948
1930
|
};
|
|
1949
1931
|
}
|
|
1950
|
-
|
|
1951
|
-
//#region extensions/facetime/src/talk-driver.ts
|
|
1932
|
+
// extensions/facetime/src/talk-driver.ts
|
|
1952
1933
|
const FACETIME_INITIAL_GREETING = "Greet the caller briefly, introduce yourself using your configured identity, and ask how you can help.";
|
|
1953
1934
|
const FACETIME_GREETING_MEDIA_SETTLE_MS = 100;
|
|
1954
1935
|
async function startFaceTimeTalkDriver(params) {
|
|
@@ -2012,8 +1993,7 @@ async function startFaceTimeTalkDriver(params) {
|
|
|
2012
1993
|
timer = void 0;
|
|
2013
1994
|
dismissed = true;
|
|
2014
1995
|
if (!stopped && !mediaSuspended && activated && providerReady) bridge?.triggerGreeting(FACETIME_INITIAL_GREETING);
|
|
2015
|
-
}, FACETIME_GREETING_MEDIA_SETTLE_MS);
|
|
2016
|
-
timer.unref?.();
|
|
1996
|
+
}, FACETIME_GREETING_MEDIA_SETTLE_MS).unref();
|
|
2017
1997
|
},
|
|
2018
1998
|
cancel() {
|
|
2019
1999
|
dismissed = true;
|
|
@@ -2421,8 +2401,7 @@ async function startFaceTimeTalkDriver(params) {
|
|
|
2421
2401
|
close
|
|
2422
2402
|
};
|
|
2423
2403
|
}
|
|
2424
|
-
|
|
2425
|
-
//#region extensions/facetime/src/runtime-call-control.ts
|
|
2404
|
+
// extensions/facetime/src/runtime-call-control.ts
|
|
2426
2405
|
function createFaceTimeCallControl(params) {
|
|
2427
2406
|
const runCarrierActionAcrossAliases = async (request) => {
|
|
2428
2407
|
const candidates = [request.call.carrierCallUUID, ...[...request.call.carrierCallUUIDs].toReversed()].filter((candidate, index, all) => all.indexOf(candidate) === index);
|
|
@@ -2585,13 +2564,10 @@ function createFaceTimeCallControl(params) {
|
|
|
2585
2564
|
if (closeLocal) await closeCall(call, reason);
|
|
2586
2565
|
return true;
|
|
2587
2566
|
}
|
|
2588
|
-
if (scheduleRetry && !call.carrierHangupRetryTimer) {
|
|
2589
|
-
call.carrierHangupRetryTimer =
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
}, 1e3);
|
|
2593
|
-
call.carrierHangupRetryTimer.unref?.();
|
|
2594
|
-
}
|
|
2567
|
+
if (scheduleRetry && !call.carrierHangupRetryTimer) call.carrierHangupRetryTimer = setTimeout(() => {
|
|
2568
|
+
call.carrierHangupRetryTimer = void 0;
|
|
2569
|
+
attemptCarrierHangup(call, reason);
|
|
2570
|
+
}, 1e3).unref();
|
|
2595
2571
|
return false;
|
|
2596
2572
|
};
|
|
2597
2573
|
const waitForStartupCarrierHangup = async (call, reason) => {
|
|
@@ -2694,8 +2670,7 @@ function createFaceTimeCallControl(params) {
|
|
|
2694
2670
|
stopCall
|
|
2695
2671
|
};
|
|
2696
2672
|
}
|
|
2697
|
-
|
|
2698
|
-
//#region extensions/facetime/src/runtime-state.ts
|
|
2673
|
+
// extensions/facetime/src/runtime-state.ts
|
|
2699
2674
|
function normalizeCallIdentity(value) {
|
|
2700
2675
|
return value.trim().toLowerCase();
|
|
2701
2676
|
}
|
|
@@ -2841,8 +2816,7 @@ function updateCallStatus(call, event) {
|
|
|
2841
2816
|
if (event.data.local_meter_level !== void 0) call.maxLocalMeterLevel = Math.max(call.maxLocalMeterLevel ?? 0, event.data.local_meter_level);
|
|
2842
2817
|
if (event.data.remote_meter_level !== void 0) call.maxRemoteMeterLevel = Math.max(call.maxRemoteMeterLevel ?? 0, event.data.remote_meter_level);
|
|
2843
2818
|
}
|
|
2844
|
-
|
|
2845
|
-
//#region extensions/facetime/src/runtime-call-events.ts
|
|
2819
|
+
// extensions/facetime/src/runtime-call-events.ts
|
|
2846
2820
|
function createFaceTimeCallEventHandler(params) {
|
|
2847
2821
|
const eventIdentities = (event) => [
|
|
2848
2822
|
event.data.call_uuid,
|
|
@@ -3091,8 +3065,7 @@ function createFaceTimeCallEventHandler(params) {
|
|
|
3091
3065
|
};
|
|
3092
3066
|
return { handleCallEvent };
|
|
3093
3067
|
}
|
|
3094
|
-
|
|
3095
|
-
//#region extensions/facetime/src/talk-events-summary.ts
|
|
3068
|
+
// extensions/facetime/src/talk-events-summary.ts
|
|
3096
3069
|
function summarizeRecentTalkEvents(events) {
|
|
3097
3070
|
return events.slice(-12).map((event) => {
|
|
3098
3071
|
const payload = asRecord(event.payload);
|
|
@@ -3108,8 +3081,7 @@ function summarizeRecentTalkEvents(events) {
|
|
|
3108
3081
|
};
|
|
3109
3082
|
});
|
|
3110
3083
|
}
|
|
3111
|
-
|
|
3112
|
-
//#region extensions/facetime/src/runtime-status.ts
|
|
3084
|
+
// extensions/facetime/src/runtime-status.ts
|
|
3113
3085
|
function buildFaceTimeRuntimeStatus(params) {
|
|
3114
3086
|
const calls = [...params.calls.values()];
|
|
3115
3087
|
return {
|
|
@@ -3169,8 +3141,7 @@ function buildFaceTimeRuntimeStatus(params) {
|
|
|
3169
3141
|
}))
|
|
3170
3142
|
};
|
|
3171
3143
|
}
|
|
3172
|
-
|
|
3173
|
-
//#region extensions/facetime/src/runtime.ts
|
|
3144
|
+
// extensions/facetime/src/runtime.ts
|
|
3174
3145
|
const OUTBOUND_RECONCILE_DELAY_MS = 1e3;
|
|
3175
3146
|
async function createFaceTimeRuntime(params) {
|
|
3176
3147
|
const config = resolveFaceTimeConfig(params.config);
|
|
@@ -3272,8 +3243,7 @@ async function createFaceTimeRuntime(params) {
|
|
|
3272
3243
|
observePendingOperation(reconcilePendingOutboundCall().finally(() => {
|
|
3273
3244
|
if (outboundCallPending === pending) scheduleOutboundReconciliation();
|
|
3274
3245
|
}));
|
|
3275
|
-
}, OUTBOUND_RECONCILE_DELAY_MS);
|
|
3276
|
-
outboundReconcileTimer.unref?.();
|
|
3246
|
+
}, OUTBOUND_RECONCILE_DELAY_MS).unref();
|
|
3277
3247
|
};
|
|
3278
3248
|
const cancelPendingOutboundCall = async () => {
|
|
3279
3249
|
const pending = outboundCallPending;
|
|
@@ -3605,5 +3575,4 @@ async function createFaceTimeRuntime(params) {
|
|
|
3605
3575
|
}
|
|
3606
3576
|
};
|
|
3607
3577
|
}
|
|
3608
|
-
//#endregion
|
|
3609
3578
|
export { createFaceTimeRuntime };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the
|
|
2
|
+
* Returns true if the string is an [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) date-time with optional [RFC 9557](https://datatracker.ietf.org/doc/html/rfc9557) suffix.
|
|
3
3
|
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc9557
|
|
4
5
|
* @example `2020-12-12T20:20:40+00:00`
|
|
5
6
|
*/
|
|
6
7
|
export declare function IsDateTime(value: string): boolean;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { IsDate } from './date.mjs';
|
|
2
2
|
import { IsTime } from './time.mjs';
|
|
3
|
+
// ------------------------------------------------------------------
|
|
4
|
+
// RFC 9557 DATE_TIME_SUFFIX
|
|
5
|
+
// ------------------------------------------------------------------
|
|
6
|
+
const DATE_TIME_SUFFIX = /^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;
|
|
3
7
|
/**
|
|
4
|
-
* Returns true if the
|
|
8
|
+
* Returns true if the string is an [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) date-time with optional [RFC 9557](https://datatracker.ietf.org/doc/html/rfc9557) suffix.
|
|
5
9
|
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
10
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc9557
|
|
6
11
|
* @example `2020-12-12T20:20:40+00:00`
|
|
7
12
|
*/
|
|
8
13
|
export function IsDateTime(value) {
|
|
9
|
-
const
|
|
10
|
-
|
|
14
|
+
const index = value.indexOf('[');
|
|
15
|
+
const datetime = index === -1 ? value : value.slice(0, index);
|
|
16
|
+
if (index !== -1 && !DATE_TIME_SUFFIX.test(value.slice(index)))
|
|
17
|
+
return false;
|
|
18
|
+
const split = datetime.split(/T/i);
|
|
19
|
+
return split.length === 2 && IsDate(split[0]) && IsTime(split[1]);
|
|
11
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/facetime",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.10-beta.1",
|
|
4
4
|
"description": "Experimental FaceTime realtime voice carrier for OpenClaw agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "OpenClaw contributors",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"inject:helper:terminal": "bash scripts/inject-helper-terminal.sh"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"typebox": "1.4.
|
|
65
|
+
"typebox": "1.4.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"openclaw": ">=2026.11.
|
|
68
|
+
"openclaw": ">=2026.11.10-beta.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"openclaw": {
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"allowInvalidConfigRecovery": true
|
|
85
85
|
},
|
|
86
86
|
"compat": {
|
|
87
|
-
"pluginApi": ">=2026.11.
|
|
87
|
+
"pluginApi": ">=2026.11.10-beta.1"
|
|
88
88
|
},
|
|
89
89
|
"build": {
|
|
90
90
|
"bundledDist": false,
|
|
91
|
-
"openclawVersion": "2026.11.
|
|
91
|
+
"openclawVersion": "2026.11.10-beta.1"
|
|
92
92
|
},
|
|
93
93
|
"release": {
|
|
94
94
|
"publishToClawHub": true,
|
package/src/audio-pump.ts
CHANGED
|
@@ -209,8 +209,7 @@ function createAudioReadiness() {
|
|
|
209
209
|
if (settled || timer) {
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
timer = setTimeout(onTimeout, timeoutMs);
|
|
213
|
-
timer.unref?.();
|
|
212
|
+
timer = setTimeout(onTimeout, timeoutMs).unref();
|
|
214
213
|
},
|
|
215
214
|
settle(error?: Error) {
|
|
216
215
|
if (settled) {
|
|
@@ -424,8 +423,7 @@ export function startFaceTimeAudioPump(params: {
|
|
|
424
423
|
}
|
|
425
424
|
const delayMs = Math.ceil(playbackClock.millisecondsUntilDrained());
|
|
426
425
|
if (delayMs > 0) {
|
|
427
|
-
drainTimer = setTimeout(notifyWhenDrained, Math.max(1, delayMs));
|
|
428
|
-
drainTimer.unref?.();
|
|
426
|
+
drainTimer = setTimeout(notifyWhenDrained, Math.max(1, delayMs)).unref();
|
|
429
427
|
return;
|
|
430
428
|
}
|
|
431
429
|
drainTimer = undefined;
|
package/src/helper-rpc.ts
CHANGED
|
@@ -214,8 +214,7 @@ export class FaceTimeHelperSocketServer {
|
|
|
214
214
|
if (!this.#socketPeers.has(socket)) {
|
|
215
215
|
socket.destroy();
|
|
216
216
|
}
|
|
217
|
-
}, AUTH_DEADLINE_MS);
|
|
218
|
-
authDeadline.unref?.();
|
|
217
|
+
}, AUTH_DEADLINE_MS).unref();
|
|
219
218
|
this.#authDeadlineTimers.set(socket, authDeadline);
|
|
220
219
|
let buffer = "";
|
|
221
220
|
socket.on("data", (chunk) => {
|
package/src/helper-supervisor.ts
CHANGED
|
@@ -168,8 +168,7 @@ export class FaceTimeHelperSupervisor {
|
|
|
168
168
|
const timer = setTimeout(() => {
|
|
169
169
|
this.#timers.delete(target);
|
|
170
170
|
this.#enqueueInjection(target);
|
|
171
|
-
}, delayMs);
|
|
172
|
-
timer.unref?.();
|
|
171
|
+
}, delayMs).unref();
|
|
173
172
|
this.#timers.set(target, timer);
|
|
174
173
|
}
|
|
175
174
|
|
|
@@ -204,8 +203,7 @@ export class FaceTimeHelperSupervisor {
|
|
|
204
203
|
state.attempts = 0;
|
|
205
204
|
state.lastError = undefined;
|
|
206
205
|
this.#schedule(target, 0);
|
|
207
|
-
}, 2_000);
|
|
208
|
-
timer.unref?.();
|
|
206
|
+
}, 2_000).unref();
|
|
209
207
|
this.#timers.set(target, timer);
|
|
210
208
|
}
|
|
211
209
|
|
|
@@ -244,8 +244,7 @@ export function createFaceTimeCallControl(params: {
|
|
|
244
244
|
call.carrierHangupRetryTimer = setTimeout(() => {
|
|
245
245
|
call.carrierHangupRetryTimer = undefined;
|
|
246
246
|
void attemptCarrierHangup(call, reason);
|
|
247
|
-
}, 1_000);
|
|
248
|
-
call.carrierHangupRetryTimer.unref?.();
|
|
247
|
+
}, 1_000).unref();
|
|
249
248
|
}
|
|
250
249
|
return false;
|
|
251
250
|
};
|
package/src/runtime.ts
CHANGED
|
@@ -206,8 +206,7 @@ export async function createFaceTimeRuntime(params: {
|
|
|
206
206
|
}
|
|
207
207
|
}),
|
|
208
208
|
);
|
|
209
|
-
}, OUTBOUND_RECONCILE_DELAY_MS);
|
|
210
|
-
outboundReconcileTimer.unref?.();
|
|
209
|
+
}, OUTBOUND_RECONCILE_DELAY_MS).unref();
|
|
211
210
|
};
|
|
212
211
|
const cancelPendingOutboundCall = async (): Promise<
|
|
213
212
|
| {
|
package/src/talk-driver.ts
CHANGED
|
@@ -146,8 +146,7 @@ export async function startFaceTimeTalkDriver(params: {
|
|
|
146
146
|
if (!stopped && !mediaSuspended && activated && providerReady) {
|
|
147
147
|
bridge?.triggerGreeting(FACETIME_INITIAL_GREETING);
|
|
148
148
|
}
|
|
149
|
-
}, FACETIME_GREETING_MEDIA_SETTLE_MS);
|
|
150
|
-
timer.unref?.();
|
|
149
|
+
}, FACETIME_GREETING_MEDIA_SETTLE_MS).unref();
|
|
151
150
|
},
|
|
152
151
|
cancel() {
|
|
153
152
|
dismissed = true;
|