@openclaw/facetime 2026.10.10 → 2026.11.5-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-C3uKLO8_.mjs → setup-ByISvnBj.mjs} +51 -99
- package/dist/.source-module-urls/38481bccca5fbb406e50ac928748f9f04f5a6cf5623980901b3cebc6ee82dfb6.json +1 -1
- package/dist/index.js +9 -21
- package/dist/runtime-api.js +225 -337
- package/docs/phase1-verification.md +1 -1
- package/index.ts +13 -20
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/package.json +5 -6
- package/scripts/inject-helper-terminal.sh +1 -1
- package/scripts/inject-helper.sh +3 -7
- package/scripts/install-driver.sh +1 -1
- package/src/audio-pump.ts +5 -13
- package/src/command-output.ts +3 -0
- package/src/driver-setup.ts +15 -23
- package/src/helper-results.ts +31 -37
- package/src/helper-rpc.ts +55 -68
- package/src/helper-supervisor.ts +20 -28
- package/src/outbound-call.ts +2 -13
- package/src/plugin-paths.ts +13 -23
- package/src/preflight.ts +10 -33
- package/src/runtime-call-control.ts +11 -23
- package/src/runtime-call-events.ts +10 -7
- package/src/runtime-carrier-process.ts +1 -5
- package/src/runtime-helper-results.ts +5 -38
- package/src/runtime-state.ts +178 -10
- package/src/runtime-status.ts +2 -3
- package/src/runtime.ts +5 -7
- package/src/setup.ts +58 -69
- package/src/talk-consult-controller.ts +1 -19
- package/src/talk-driver.ts +31 -25
- package/src/talk-events-summary.ts +8 -19
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
- package/src/call-lifecycle.ts +0 -171
- package/src/runtime-lifecycle.ts +0 -17
- package/src/talk-initial-greeting.ts +0 -42
package/src/outbound-call.ts
CHANGED
|
@@ -32,18 +32,7 @@ export type PendingFaceTimeDial = FaceTimeDialRequest & {
|
|
|
32
32
|
proxyIdentifier?: string;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
event: "ft-outbound-call-identified";
|
|
37
|
-
data: {
|
|
38
|
-
dial_id: string;
|
|
39
|
-
call_uuid?: string;
|
|
40
|
-
proxy_identifier?: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export function normalizeFaceTimeOutboundIdentityEvent(
|
|
45
|
-
value: unknown,
|
|
46
|
-
): FaceTimeOutboundIdentityEvent | undefined {
|
|
35
|
+
export function normalizeFaceTimeOutboundIdentityEvent(value: unknown) {
|
|
47
36
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
48
37
|
return undefined;
|
|
49
38
|
}
|
|
@@ -62,7 +51,7 @@ export function normalizeFaceTimeOutboundIdentityEvent(
|
|
|
62
51
|
return undefined;
|
|
63
52
|
}
|
|
64
53
|
return {
|
|
65
|
-
event: "ft-outbound-call-identified",
|
|
54
|
+
event: "ft-outbound-call-identified" as const,
|
|
66
55
|
data: {
|
|
67
56
|
dial_id: dialID,
|
|
68
57
|
...(callUUID ? { call_uuid: callUUID } : {}),
|
package/src/plugin-paths.ts
CHANGED
|
@@ -34,12 +34,7 @@ async function resolveNativeInstall(): Promise<{ buildId: string; capture: strin
|
|
|
34
34
|
const buildIdFile = resolve(directory, "FaceTimeHelper.build-id");
|
|
35
35
|
const protocolFile = resolve(directory, "native-protocol.env");
|
|
36
36
|
try {
|
|
37
|
-
await Promise.all([
|
|
38
|
-
access(capture, constants.X_OK),
|
|
39
|
-
access(helper, constants.R_OK),
|
|
40
|
-
access(buildIdFile, constants.R_OK),
|
|
41
|
-
access(protocolFile, constants.R_OK),
|
|
42
|
-
]);
|
|
37
|
+
await Promise.all([access(capture, constants.X_OK), access(helper, constants.R_OK)]);
|
|
43
38
|
const [buildId, protocol] = await Promise.all([
|
|
44
39
|
readFile(buildIdFile, "utf8").then((value) => value.trim()),
|
|
45
40
|
readFile(protocolFile, "utf8").then((value) => value.trim()),
|
|
@@ -62,14 +57,7 @@ export async function inspectFaceTimeNativePackage(): Promise<boolean> {
|
|
|
62
57
|
);
|
|
63
58
|
}
|
|
64
59
|
|
|
65
|
-
export async function inspectFaceTimeArtifacts()
|
|
66
|
-
nativeInstall: boolean;
|
|
67
|
-
stagedHelper: boolean;
|
|
68
|
-
helperKey: boolean;
|
|
69
|
-
helperBuildStamp: boolean;
|
|
70
|
-
stagedHelperDylibs: number;
|
|
71
|
-
cachedDriver: boolean;
|
|
72
|
-
}> {
|
|
60
|
+
export async function inspectFaceTimeArtifacts() {
|
|
73
61
|
const readable = async (file: string, mode: number) => {
|
|
74
62
|
try {
|
|
75
63
|
await access(file, mode);
|
|
@@ -78,8 +66,13 @@ export async function inspectFaceTimeArtifacts(): Promise<{
|
|
|
78
66
|
return false;
|
|
79
67
|
}
|
|
80
68
|
};
|
|
81
|
-
const
|
|
82
|
-
|
|
69
|
+
const helperTempDir = resolve(
|
|
70
|
+
homedir(),
|
|
71
|
+
"Library",
|
|
72
|
+
"Containers",
|
|
73
|
+
"com.apple.FaceTime",
|
|
74
|
+
"Data",
|
|
75
|
+
"tmp",
|
|
83
76
|
);
|
|
84
77
|
const countHelpers = async (directory: string) => {
|
|
85
78
|
try {
|
|
@@ -102,9 +95,7 @@ export async function inspectFaceTimeArtifacts(): Promise<{
|
|
|
102
95
|
readable(resolveHelperDylib(), constants.R_OK),
|
|
103
96
|
readable(resolveHelperStateFile("helper-ipc-key"), constants.R_OK),
|
|
104
97
|
readable(resolveHelperStateFile("helper-build.sha256"), constants.R_OK),
|
|
105
|
-
|
|
106
|
-
counts.reduce((total, count) => total + count, 0),
|
|
107
|
-
),
|
|
98
|
+
countHelpers(helperTempDir),
|
|
108
99
|
readable(
|
|
109
100
|
resolve(
|
|
110
101
|
homedir(),
|
|
@@ -135,7 +126,7 @@ export async function ensureCaptureBinary(): Promise<string> {
|
|
|
135
126
|
export async function ensureHelperArtifacts(params: {
|
|
136
127
|
pluginRoot: string;
|
|
137
128
|
runCommandWithTimeout: PluginRuntime["system"]["runCommandWithTimeout"];
|
|
138
|
-
}): Promise<{ buildId: string;
|
|
129
|
+
}): Promise<{ buildId: string; ipcKey: string }> {
|
|
139
130
|
const installation = await resolveNativeInstall();
|
|
140
131
|
const stageScript = resolve(params.pluginRoot, "scripts", "stage-helper.sh");
|
|
141
132
|
const result = await params.runCommandWithTimeout(["/bin/bash", stageScript, "--if-needed"], {
|
|
@@ -146,8 +137,7 @@ export async function ensureHelperArtifacts(params: {
|
|
|
146
137
|
`FaceTime native helper staging failed: ${result.stderr || result.stdout || `exit ${result.code}`}`,
|
|
147
138
|
);
|
|
148
139
|
}
|
|
149
|
-
|
|
150
|
-
await access(dylib, constants.R_OK);
|
|
140
|
+
await access(resolveHelperDylib(), constants.R_OK);
|
|
151
141
|
const ipcKey = (await readFile(resolveHelperStateFile("helper-ipc-key"), "utf8")).trim();
|
|
152
142
|
const stagedBuildId = (
|
|
153
143
|
await readFile(resolveHelperStateFile("helper-build.sha256"), "utf8")
|
|
@@ -158,5 +148,5 @@ export async function ensureHelperArtifacts(params: {
|
|
|
158
148
|
if (stagedBuildId !== installation.buildId) {
|
|
159
149
|
throw new Error("Staged FaceTime helper does not match the installed native package");
|
|
160
150
|
}
|
|
161
|
-
return { buildId: installation.buildId,
|
|
151
|
+
return { buildId: installation.buildId, ipcKey };
|
|
162
152
|
}
|
package/src/preflight.ts
CHANGED
|
@@ -3,11 +3,10 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
|
3
3
|
import type { PluginRuntime } from "openclaw/plugin-sdk/plugin-runtime";
|
|
4
4
|
import { asRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { FACETIME_FEED_DEVICE_NAME, FACETIME_MIC_DEVICE_NAME } from "./audio-pump.js";
|
|
6
|
+
import { firstLine } from "./command-output.js";
|
|
6
7
|
import type { FaceTimeConfig } from "./config.js";
|
|
7
8
|
import { agentIdFromSessionKey, resolveFaceTimeRealtimeProvider } from "./talk-driver-config.js";
|
|
8
9
|
|
|
9
|
-
type RunCommandWithTimeout = PluginRuntime["system"]["runCommandWithTimeout"];
|
|
10
|
-
|
|
11
10
|
type AudioDeviceDescription = {
|
|
12
11
|
isAggregate: boolean;
|
|
13
12
|
name: string;
|
|
@@ -61,10 +60,6 @@ export type FaceTimePreflightResult = {
|
|
|
61
60
|
checks: FaceTimePreflightCheck[];
|
|
62
61
|
};
|
|
63
62
|
|
|
64
|
-
function firstLine(value: unknown) {
|
|
65
|
-
return typeof value === "string" ? value.trim().split(/\r?\n/u)[0] || undefined : undefined;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
63
|
function pushCheck(
|
|
69
64
|
checks: FaceTimePreflightCheck[],
|
|
70
65
|
check: Omit<FaceTimePreflightCheck, "required"> & { required?: boolean },
|
|
@@ -114,32 +109,6 @@ function findPhysicalOutputProblem(
|
|
|
114
109
|
return undefined;
|
|
115
110
|
}
|
|
116
111
|
|
|
117
|
-
async function checkCallApp(params: {
|
|
118
|
-
runCommandWithTimeout: RunCommandWithTimeout;
|
|
119
|
-
checks: FaceTimePreflightCheck[];
|
|
120
|
-
}) {
|
|
121
|
-
for (const app of ["FaceTime", "Phone"]) {
|
|
122
|
-
const result = await params.runCommandWithTimeout(["/usr/bin/pgrep", "-x", app], {
|
|
123
|
-
timeoutMs: 5_000,
|
|
124
|
-
});
|
|
125
|
-
if (result.code === 0) {
|
|
126
|
-
pushCheck(params.checks, {
|
|
127
|
-
id: "call-app-running",
|
|
128
|
-
label: "FaceTime or Phone process",
|
|
129
|
-
ok: true,
|
|
130
|
-
message: app,
|
|
131
|
-
});
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
pushCheck(params.checks, {
|
|
136
|
-
id: "call-app-running",
|
|
137
|
-
label: "FaceTime or Phone process",
|
|
138
|
-
ok: false,
|
|
139
|
-
message: "open FaceTime for video calls or Phone for FaceTime audio calls",
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
112
|
export async function runFaceTimePreflight(params: {
|
|
144
113
|
config: FaceTimeConfig;
|
|
145
114
|
fullConfig: OpenClawConfig;
|
|
@@ -171,7 +140,15 @@ export async function runFaceTimePreflight(params: {
|
|
|
171
140
|
: "capture helper is missing; reinstall with brew install openclaw/tap/openclaw-facetime",
|
|
172
141
|
});
|
|
173
142
|
|
|
174
|
-
await
|
|
143
|
+
const result = await runCommandWithTimeout(["/usr/bin/pgrep", "-x", "FaceTime"], {
|
|
144
|
+
timeoutMs: 5_000,
|
|
145
|
+
});
|
|
146
|
+
pushCheck(checks, {
|
|
147
|
+
id: "call-app-running",
|
|
148
|
+
label: "FaceTime process",
|
|
149
|
+
ok: result.code === 0,
|
|
150
|
+
message: result.code === 0 ? "FaceTime" : "open FaceTime for audio or video calls",
|
|
151
|
+
});
|
|
175
152
|
|
|
176
153
|
const profiler = await runCommandWithTimeout(
|
|
177
154
|
["/usr/sbin/system_profiler", "SPAudioDataType", "-json"],
|
|
@@ -5,22 +5,21 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
|
5
5
|
import type { PluginRuntime, RuntimeLogger } from "openclaw/plugin-sdk/plugin-runtime";
|
|
6
6
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { FACETIME_FEED_DEVICE_NAME, FACETIME_MIC_DEVICE_NAME } from "./audio-pump.js";
|
|
8
|
-
import { FaceTimeCallRegistry } from "./call-lifecycle.js";
|
|
9
8
|
import type { FaceTimeConfig } from "./config.js";
|
|
10
9
|
import {
|
|
11
10
|
FaceTimeHelperAmbiguousError,
|
|
11
|
+
assertFaceTimeNativeAction,
|
|
12
12
|
projectCompleteFaceTimeAbsence,
|
|
13
|
-
projectFaceTimeNativeAction,
|
|
14
13
|
type HelperActionResult,
|
|
15
14
|
} from "./helper-results.js";
|
|
16
15
|
import type { FaceTimeHelperSocketServer } from "./helper-rpc.js";
|
|
17
16
|
import { terminateExactCarrierProcesses } from "./runtime-carrier-process.js";
|
|
18
17
|
import { retainHelperResultPeers } from "./runtime-helper-results.js";
|
|
19
|
-
import type { ActiveFaceTimeCall } from "./runtime-state.js";
|
|
18
|
+
import type { ActiveFaceTimeCall, FaceTimeCallRegistry } from "./runtime-state.js";
|
|
20
19
|
import { startFaceTimeTalkDriver } from "./talk-driver.js";
|
|
21
20
|
|
|
22
21
|
export function createFaceTimeCallControl(params: {
|
|
23
|
-
calls: FaceTimeCallRegistry
|
|
22
|
+
calls: FaceTimeCallRegistry;
|
|
24
23
|
helper: FaceTimeHelperSocketServer;
|
|
25
24
|
config: FaceTimeConfig;
|
|
26
25
|
fullConfig: OpenClawConfig;
|
|
@@ -48,7 +47,7 @@ export function createFaceTimeCallControl(params: {
|
|
|
48
47
|
allowClosing: true,
|
|
49
48
|
action: async () => await request.run(candidate),
|
|
50
49
|
});
|
|
51
|
-
|
|
50
|
+
assertFaceTimeNativeAction(request.action, result);
|
|
52
51
|
request.call.promoteCarrierCallUUID(candidate);
|
|
53
52
|
return result;
|
|
54
53
|
} catch (error) {
|
|
@@ -84,7 +83,6 @@ export function createFaceTimeCallControl(params: {
|
|
|
84
83
|
feedDevice: FACETIME_FEED_DEVICE_NAME,
|
|
85
84
|
microphoneDevice: FACETIME_MIC_DEVICE_NAME,
|
|
86
85
|
processInputVerified: false,
|
|
87
|
-
processOutputSuppressed: false,
|
|
88
86
|
};
|
|
89
87
|
call.lastRoutingError = undefined;
|
|
90
88
|
})();
|
|
@@ -106,25 +104,24 @@ export function createFaceTimeCallControl(params: {
|
|
|
106
104
|
}
|
|
107
105
|
};
|
|
108
106
|
const enableCallAudio = async (call: ActiveFaceTimeCall) => {
|
|
109
|
-
const generation = call.
|
|
107
|
+
const generation = call.generation;
|
|
110
108
|
const mutedResult = await call.runCarrierCommand({
|
|
111
109
|
generation,
|
|
112
110
|
action: async () => await params.helper.setMuted(call.carrierCallUUID, false),
|
|
113
111
|
});
|
|
114
112
|
call.lastHelperAction = mutedResult;
|
|
115
113
|
retainHelperResultPeers(call, mutedResult);
|
|
116
|
-
|
|
114
|
+
assertFaceTimeNativeAction("unmute", mutedResult);
|
|
117
115
|
const transmissionResult = await call.runCarrierCommand({
|
|
118
116
|
generation,
|
|
119
117
|
action: async () => await params.helper.startTransmission(call.carrierCallUUID),
|
|
120
118
|
});
|
|
121
119
|
call.lastHelperAction = transmissionResult;
|
|
122
120
|
retainHelperResultPeers(call, transmissionResult);
|
|
123
|
-
|
|
121
|
+
assertFaceTimeNativeAction("activate", transmissionResult);
|
|
124
122
|
call.markCarrierActive(generation);
|
|
125
123
|
if (call.audioTransport) {
|
|
126
124
|
call.audioTransport.processInputVerified = true;
|
|
127
|
-
call.audioTransport.processOutputSuppressed = call.talk?.processOutputSuppressed() === true;
|
|
128
125
|
}
|
|
129
126
|
};
|
|
130
127
|
const closeCall = async (call: ActiveFaceTimeCall, reason: string) => {
|
|
@@ -178,7 +175,7 @@ export function createFaceTimeCallControl(params: {
|
|
|
178
175
|
return undefined;
|
|
179
176
|
}
|
|
180
177
|
try {
|
|
181
|
-
return projectCompleteFaceTimeAbsence(error.result)
|
|
178
|
+
return projectCompleteFaceTimeAbsence(error.result);
|
|
182
179
|
} catch {
|
|
183
180
|
return undefined;
|
|
184
181
|
}
|
|
@@ -217,10 +214,7 @@ export function createFaceTimeCallControl(params: {
|
|
|
217
214
|
const first = projectCompleteFaceTimeAbsence(await inspect());
|
|
218
215
|
await sleepWithAbort(100, undefined, { ref: false });
|
|
219
216
|
const second = projectCompleteFaceTimeAbsence(await inspect());
|
|
220
|
-
return (
|
|
221
|
-
first.topologyGeneration === second.topologyGeneration &&
|
|
222
|
-
params.getHelperTopologyVersion() === topologyVersion
|
|
223
|
-
);
|
|
217
|
+
return first === second && params.getHelperTopologyVersion() === topologyVersion;
|
|
224
218
|
} catch {
|
|
225
219
|
return false;
|
|
226
220
|
}
|
|
@@ -283,7 +277,7 @@ export function createFaceTimeCallControl(params: {
|
|
|
283
277
|
]);
|
|
284
278
|
};
|
|
285
279
|
const terminateCarrierProcesses = async (call: ActiveFaceTimeCall): Promise<void> => {
|
|
286
|
-
const generation = call.
|
|
280
|
+
const generation = call.generation;
|
|
287
281
|
await terminateExactCarrierProcesses({
|
|
288
282
|
runtime: params.runtime,
|
|
289
283
|
peers: call.carrierPeers,
|
|
@@ -322,7 +316,6 @@ export function createFaceTimeCallControl(params: {
|
|
|
322
316
|
logger: params.logger,
|
|
323
317
|
callUUID,
|
|
324
318
|
senderId: call.senderId,
|
|
325
|
-
senderIsOwner: call.senderIsOwner,
|
|
326
319
|
captureBinary: params.captureBinary,
|
|
327
320
|
signal: call.lifecycleAbort.signal,
|
|
328
321
|
async onHangupRequested() {
|
|
@@ -348,9 +341,6 @@ export function createFaceTimeCallControl(params: {
|
|
|
348
341
|
return;
|
|
349
342
|
}
|
|
350
343
|
call.talk = talk;
|
|
351
|
-
if (call.audioTransport) {
|
|
352
|
-
call.audioTransport.processOutputSuppressed = true;
|
|
353
|
-
}
|
|
354
344
|
params.logger.info("[facetime] realtime talk suppression ready");
|
|
355
345
|
})();
|
|
356
346
|
}
|
|
@@ -364,14 +354,12 @@ export function createFaceTimeCallControl(params: {
|
|
|
364
354
|
}
|
|
365
355
|
};
|
|
366
356
|
const activateCallTalk = async (call: ActiveFaceTimeCall) => {
|
|
367
|
-
const generation = call.
|
|
357
|
+
const generation = call.generation;
|
|
368
358
|
if (!call.talkActivation) {
|
|
369
359
|
call.talkActivation = (async () => {
|
|
370
360
|
await call.talk?.readyForAudio();
|
|
371
|
-
call.assertCurrent(generation);
|
|
372
361
|
call.markModelReady(generation);
|
|
373
362
|
await enableCallAudio(call);
|
|
374
|
-
call.assertCurrent(generation);
|
|
375
363
|
call.markModelActive(generation);
|
|
376
364
|
call.talk?.activate();
|
|
377
365
|
})();
|
|
@@ -12,9 +12,8 @@ import {
|
|
|
12
12
|
type AuthenticatedFaceTimeOwner,
|
|
13
13
|
type FaceTimeCallStatusEvent,
|
|
14
14
|
} from "./call-events.js";
|
|
15
|
-
import type { FaceTimeCallRegistry } from "./call-lifecycle.js";
|
|
16
15
|
import type { FaceTimeConfig } from "./config.js";
|
|
17
|
-
import {
|
|
16
|
+
import { assertFaceTimeNativeAction } from "./helper-results.js";
|
|
18
17
|
import type { FaceTimeHelperPeer, FaceTimeHelperSocketServer } from "./helper-rpc.js";
|
|
19
18
|
import {
|
|
20
19
|
doesFaceTimeCallMatchPendingDial,
|
|
@@ -23,10 +22,14 @@ import {
|
|
|
23
22
|
} from "./outbound-call.js";
|
|
24
23
|
import type { createFaceTimeCallControl } from "./runtime-call-control.js";
|
|
25
24
|
import { retainHelperResultPeers } from "./runtime-helper-results.js";
|
|
26
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
ActiveFaceTimeCall,
|
|
27
|
+
updateCallStatus,
|
|
28
|
+
type FaceTimeCallRegistry,
|
|
29
|
+
} from "./runtime-state.js";
|
|
27
30
|
|
|
28
31
|
export function createFaceTimeCallEventHandler(params: {
|
|
29
|
-
calls: FaceTimeCallRegistry
|
|
32
|
+
calls: FaceTimeCallRegistry;
|
|
30
33
|
helper: FaceTimeHelperSocketServer;
|
|
31
34
|
config: FaceTimeConfig;
|
|
32
35
|
logger: RuntimeLogger;
|
|
@@ -164,7 +167,7 @@ export function createFaceTimeCallEventHandler(params: {
|
|
|
164
167
|
generation,
|
|
165
168
|
action: async () => await params.helper.answerCall(callUUID),
|
|
166
169
|
});
|
|
167
|
-
|
|
170
|
+
assertFaceTimeNativeAction("answer", answerResult);
|
|
168
171
|
retainHelperResultPeers(call, answerResult);
|
|
169
172
|
await params.callControl.activateCallTalk(call);
|
|
170
173
|
params.logger.info("[facetime] answered authorized FaceTime call");
|
|
@@ -299,14 +302,14 @@ export function createFaceTimeCallEventHandler(params: {
|
|
|
299
302
|
}
|
|
300
303
|
if (ringingCall) {
|
|
301
304
|
try {
|
|
302
|
-
const generation = ringingCall.
|
|
305
|
+
const generation = ringingCall.generation;
|
|
303
306
|
const muteResult = await ringingCall.runCarrierCommand({
|
|
304
307
|
generation,
|
|
305
308
|
action: async () => await params.helper.safetyMute(ringingCall.carrierCallUUID),
|
|
306
309
|
});
|
|
307
310
|
ringingCall.lastHelperAction = muteResult;
|
|
308
311
|
retainHelperResultPeers(ringingCall, muteResult);
|
|
309
|
-
|
|
312
|
+
assertFaceTimeNativeAction("safe-mute", muteResult);
|
|
310
313
|
} catch (error) {
|
|
311
314
|
params.logger.warn(
|
|
312
315
|
`[facetime] outbound ringing safety mute failed: ${formatErrorMessage(error)}`,
|
|
@@ -16,11 +16,7 @@ export async function terminateExactCarrierProcesses(params: {
|
|
|
16
16
|
? "FaceTime"
|
|
17
17
|
: peer.bundleIdentifier === "com.apple.FaceTime.FTConversationService"
|
|
18
18
|
? "FTConversationService"
|
|
19
|
-
:
|
|
20
|
-
? "Phone"
|
|
21
|
-
: peer.bundleIdentifier === "com.apple.TelephonyUtilities"
|
|
22
|
-
? "TelephonyUtilities"
|
|
23
|
-
: "";
|
|
19
|
+
: "";
|
|
24
20
|
const inspectExactProcess = async (): Promise<boolean> => {
|
|
25
21
|
const inspected = await params.runtime.system.runCommandWithTimeout(
|
|
26
22
|
["/bin/ps", "-p", String(peer.processId), "-o", "comm="],
|
|
@@ -1,40 +1,12 @@
|
|
|
1
1
|
import { sleep } from "openclaw/plugin-sdk/runtime-env";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import { readHelperResults, type HelperActionResult } from "./helper-results.js";
|
|
3
|
+
import { DIAL_BUNDLES, readHelperResults, type HelperActionResult } from "./helper-results.js";
|
|
4
4
|
import type { FaceTimeHelperPeer, FaceTimeHelperSocketServer } from "./helper-rpc.js";
|
|
5
5
|
import { retainFaceTimeDialCallUUID, type PendingFaceTimeDial } from "./outbound-call.js";
|
|
6
6
|
import type { ActiveFaceTimeCall } from "./runtime-state.js";
|
|
7
7
|
|
|
8
|
-
export const OUTBOUND_DIAL_HELPER_BUNDLES = new Set([
|
|
9
|
-
"com.apple.FaceTime",
|
|
10
|
-
"com.apple.FaceTime.FTConversationService",
|
|
11
|
-
]);
|
|
12
|
-
|
|
13
8
|
function readHelperPeers(result: HelperActionResult): FaceTimeHelperPeer[] {
|
|
14
|
-
|
|
15
|
-
for (const entry of readHelperResults(result)) {
|
|
16
|
-
const peer = entry.helperPeer;
|
|
17
|
-
if (
|
|
18
|
-
peer &&
|
|
19
|
-
typeof peer === "object" &&
|
|
20
|
-
"processId" in peer &&
|
|
21
|
-
"bundleIdentifier" in peer &&
|
|
22
|
-
"connectionGeneration" in peer &&
|
|
23
|
-
"processStartedAtMs" in peer &&
|
|
24
|
-
typeof peer.processId === "number" &&
|
|
25
|
-
typeof peer.bundleIdentifier === "string" &&
|
|
26
|
-
typeof peer.connectionGeneration === "number" &&
|
|
27
|
-
typeof peer.processStartedAtMs === "number"
|
|
28
|
-
) {
|
|
29
|
-
peers.push({
|
|
30
|
-
bundleIdentifier: peer.bundleIdentifier,
|
|
31
|
-
processId: peer.processId,
|
|
32
|
-
processStartedAtMs: peer.processStartedAtMs,
|
|
33
|
-
connectionGeneration: peer.connectionGeneration,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return peers;
|
|
9
|
+
return readHelperResults(result).flatMap((entry) => (entry.helperPeer ? [entry.helperPeer] : []));
|
|
38
10
|
}
|
|
39
11
|
|
|
40
12
|
export function retainHelperResultPeers(
|
|
@@ -60,7 +32,7 @@ export function retainOutboundDialHelperPeers(
|
|
|
60
32
|
continue;
|
|
61
33
|
}
|
|
62
34
|
for (const peer of readHelperPeers(entry)) {
|
|
63
|
-
if (
|
|
35
|
+
if (DIAL_BUNDLES.has(peer.bundleIdentifier)) {
|
|
64
36
|
peers.set(peer.processId, peer);
|
|
65
37
|
}
|
|
66
38
|
}
|
|
@@ -80,11 +52,7 @@ export function readOutboundProxyIdentifier(result: HelperActionResult): string
|
|
|
80
52
|
}
|
|
81
53
|
|
|
82
54
|
export function hasDialHelperConfirmation(results: HelperActionResult[]): boolean {
|
|
83
|
-
return results.some(
|
|
84
|
-
(entry) =>
|
|
85
|
-
typeof entry.helperBundleIdentifier === "string" &&
|
|
86
|
-
OUTBOUND_DIAL_HELPER_BUNDLES.has(entry.helperBundleIdentifier),
|
|
87
|
-
);
|
|
55
|
+
return results.some((entry) => DIAL_BUNDLES.has(entry.helperBundleIdentifier ?? ""));
|
|
88
56
|
}
|
|
89
57
|
|
|
90
58
|
function hasDefinitiveDialHelperAbsence(
|
|
@@ -164,8 +132,7 @@ export async function reconcilePendingFaceTimeCarrier(params: {
|
|
|
164
132
|
) {
|
|
165
133
|
return;
|
|
166
134
|
}
|
|
167
|
-
const topologyGeneration =
|
|
168
|
-
typeof result.topologyGeneration === "number" ? result.topologyGeneration : undefined;
|
|
135
|
+
const topologyGeneration = result.topologyGeneration;
|
|
169
136
|
const completeAbsence = hasDefinitiveDialHelperAbsence(result, params.peers.keys());
|
|
170
137
|
if (
|
|
171
138
|
completeAbsence &&
|