@openclaw/facetime 2026.9.8 → 2026.10.1-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-CoxvlB5L.mjs → setup-zO6FazjC.mjs} +9 -19
- package/dist/doctor-contract-api.js +8 -6
- package/dist/index.js +6 -10
- package/dist/runtime-api.js +83 -187
- package/doctor-contract-api.ts +4 -11
- package/index.ts +8 -15
- package/package.json +4 -4
- package/src/audio-pump.ts +4 -15
- package/src/call-events.ts +22 -56
- package/src/call-lifecycle.ts +2 -4
- package/src/config.ts +14 -29
- package/src/helper-results.ts +10 -30
- package/src/helper-rpc.ts +18 -37
- package/src/helper-supervisor.ts +3 -41
- package/src/outbound-call.ts +1 -5
- package/src/plugin-paths.ts +8 -24
- package/src/runtime-call-control.ts +9 -31
- package/src/runtime-call-events.ts +8 -11
- package/src/runtime-helper-results.ts +7 -19
- package/src/runtime-state.ts +17 -54
- package/src/runtime.ts +12 -27
- package/src/talk-driver.ts +19 -25
- package/src/talk-events-summary.ts +6 -6
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
2
2
|
import { REALTIME_VOICE_AGENT_CONSULT_TOOL_POLICIES, isRealtimeVoiceAgentConsultToolPolicy } from "openclaw/plugin-sdk/realtime-voice";
|
|
3
|
-
import { asRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { asBoolean, asRecord, normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
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
|
//#region 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
|
-
function resolveBoolean(value, fallback) {
|
|
11
|
-
return typeof value === "boolean" ? value : fallback;
|
|
12
|
-
}
|
|
13
|
-
function resolveStringArray(value) {
|
|
14
|
-
if (!Array.isArray(value)) return [];
|
|
15
|
-
return value.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry));
|
|
16
|
-
}
|
|
17
10
|
function resolveRealtimeVoiceAgentConsultToolPolicy(value) {
|
|
18
11
|
if (value === void 0) return "owner";
|
|
19
12
|
const normalized = normalizeOptionalString(value)?.toLowerCase();
|
|
@@ -34,8 +27,8 @@ function resolveFaceTimeConfig(input) {
|
|
|
34
27
|
const realtime = asRecord(raw.realtime);
|
|
35
28
|
if (typeof realtime.instructions === "string" && realtime.instructions.length > 4e3) throw new Error("realtime.instructions must not exceed 4000 characters");
|
|
36
29
|
return {
|
|
37
|
-
enabled:
|
|
38
|
-
ownerHandles:
|
|
30
|
+
enabled: asBoolean(raw.enabled) ?? true,
|
|
31
|
+
ownerHandles: normalizeTrimmedStringList(raw.ownerHandles),
|
|
39
32
|
realtime: {
|
|
40
33
|
provider: normalizeOptionalString(realtime.provider),
|
|
41
34
|
model: normalizeOptionalString(realtime.model),
|
|
@@ -116,11 +109,8 @@ const INSTALL_COMMAND = "brew install openclaw/tap/openclaw-facetime";
|
|
|
116
109
|
function resolveHelperDylib() {
|
|
117
110
|
return resolve(homedir(), "Library", "Containers", "com.apple.FaceTime", "Data", "tmp", "FaceTimeHelper.dylib");
|
|
118
111
|
}
|
|
119
|
-
function
|
|
120
|
-
return resolve(homedir(), "Library", "Application Support", "OpenClaw", "FaceTime",
|
|
121
|
-
}
|
|
122
|
-
function resolveHelperBuildStamp() {
|
|
123
|
-
return resolve(homedir(), "Library", "Application Support", "OpenClaw", "FaceTime", "helper-build.sha256");
|
|
112
|
+
function resolveHelperStateFile(name) {
|
|
113
|
+
return resolve(homedir(), "Library", "Application Support", "OpenClaw", "FaceTime", name);
|
|
124
114
|
}
|
|
125
115
|
async function resolveNativeInstall(params) {
|
|
126
116
|
const checkAccess = params.access ?? access;
|
|
@@ -173,8 +163,8 @@ async function inspectFaceTimeArtifacts(params) {
|
|
|
173
163
|
const [nativeInstall, stagedHelper, helperKey, helperBuildStamp, stagedHelperDylibs, cachedDriver] = await Promise.all([
|
|
174
164
|
inspectFaceTimeNativePackage(params),
|
|
175
165
|
readable(resolveHelperDylib(), constants.R_OK),
|
|
176
|
-
readable(
|
|
177
|
-
readable(
|
|
166
|
+
readable(resolveHelperStateFile("helper-ipc-key"), constants.R_OK),
|
|
167
|
+
readable(resolveHelperStateFile("helper-build.sha256"), constants.R_OK),
|
|
178
168
|
Promise.all(helperTempDirs.map(countHelpers)).then((counts) => counts.reduce((total, count) => total + count, 0)),
|
|
179
169
|
readable(resolve(homedir(), "Library", "Caches", "OpenClaw", "FaceTime", "driver", "OpenClawBridge.driver"), constants.R_OK)
|
|
180
170
|
]);
|
|
@@ -203,8 +193,8 @@ async function ensureHelperArtifacts(params) {
|
|
|
203
193
|
const loadFile = params.readFile ?? readFile;
|
|
204
194
|
const dylib = resolveHelperDylib();
|
|
205
195
|
await checkAccess(dylib, constants.R_OK);
|
|
206
|
-
const ipcKey = (await loadFile(
|
|
207
|
-
const stagedBuildId = (await loadFile(
|
|
196
|
+
const ipcKey = (await loadFile(resolveHelperStateFile("helper-ipc-key"), "utf8")).trim();
|
|
197
|
+
const stagedBuildId = (await loadFile(resolveHelperStateFile("helper-build.sha256"), "utf8")).trim();
|
|
208
198
|
if (!/^[\da-f]{64}$/u.test(ipcKey)) throw new Error("FaceTime helper produced an invalid IPC authentication key");
|
|
209
199
|
if (stagedBuildId !== installation.buildId) throw new Error("Staged FaceTime helper does not match the installed native package");
|
|
210
200
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -125,6 +125,12 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
125
125
|
};
|
|
126
126
|
const prefix = `channels.${params.channelKey}`;
|
|
127
127
|
return {
|
|
128
|
+
historicalWebhookListener: {
|
|
129
|
+
channelId: params.channelKey,
|
|
130
|
+
port: params.defaultPort,
|
|
131
|
+
preserveAuthoredActivation: params.preserveAuthoredActivation,
|
|
132
|
+
...params.defaultHost === void 0 ? {} : { host: params.defaultHost }
|
|
133
|
+
},
|
|
128
134
|
legacyConfigRules: [{
|
|
129
135
|
path: ["channels", params.channelKey],
|
|
130
136
|
message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
|
|
@@ -208,10 +214,6 @@ const legacyConfigRules = [
|
|
|
208
214
|
message: "plugins.entries.facetime.config.realtime.brain is retired; FaceTime always consults the configured agent. Run \"openclaw doctor --fix\"."
|
|
209
215
|
}
|
|
210
216
|
];
|
|
211
|
-
function normalizeLegacyOwnerHandles(value) {
|
|
212
|
-
if (!Array.isArray(value)) return null;
|
|
213
|
-
return value.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry));
|
|
214
|
-
}
|
|
215
217
|
/** Moves or removes retired prototype keys so runtime sees only the canonical config shape. */
|
|
216
218
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
217
219
|
const entry = (0, runtime_doctor_migrations_exports.asObjectRecord)(cfg.plugins?.entries?.facetime);
|
|
@@ -241,7 +243,7 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
241
243
|
const targetPath = [...CONFIG_PATH, "ownerHandles"].join(".");
|
|
242
244
|
if (Object.hasOwn(nextPluginConfig, "ownerHandles")) changes.push(`Removed ${sourcePath}; ${targetPath} is authoritative.`);
|
|
243
245
|
else {
|
|
244
|
-
const handles =
|
|
246
|
+
const handles = Array.isArray(nextPluginConfig.whitelistHandles) ? normalizeTrimmedStringList(nextPluginConfig.whitelistHandles) : null;
|
|
245
247
|
if (handles) {
|
|
246
248
|
nextPluginConfig.ownerHandles = handles;
|
|
247
249
|
changes.push(`Moved ${sourcePath} to ${targetPath}.`);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as inspectFaceTimeNativePackage, c as uninstallFaceTimeDriver, i as inspectFaceTimeArtifacts, l as resolveFaceTimeConfig, o as inspectFaceTimeDriver, t as runFaceTimeSetup, u as validateFaceTimeConfig } from "./.setup/setup-
|
|
1
|
+
import { a as inspectFaceTimeNativePackage, c as uninstallFaceTimeDriver, i as inspectFaceTimeArtifacts, l as resolveFaceTimeConfig, o as inspectFaceTimeDriver, t as runFaceTimeSetup, u as validateFaceTimeConfig } from "./.setup/setup-zO6FazjC.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";
|
|
@@ -201,6 +201,9 @@ const faceTimePlugin = definePluginEntry({
|
|
|
201
201
|
runCommandWithTimeout: api.runtime.system.runCommandWithTimeout
|
|
202
202
|
});
|
|
203
203
|
};
|
|
204
|
+
const stopRuntime = () => stopRetainedRuntime(runtimePromise, (stopped) => {
|
|
205
|
+
if (runtimePromise === stopped) runtimePromise = void 0;
|
|
206
|
+
});
|
|
204
207
|
api.registerTool(() => createFaceTimeCallTool({
|
|
205
208
|
ensureRuntime,
|
|
206
209
|
getStatus
|
|
@@ -219,11 +222,7 @@ const faceTimePlugin = definePluginEntry({
|
|
|
219
222
|
api.logger.warn(`[facetime] startup skipped: ${formatErrorMessage(error)}`);
|
|
220
223
|
}
|
|
221
224
|
},
|
|
222
|
-
|
|
223
|
-
await stopRetainedRuntime(runtimePromise, (stopped) => {
|
|
224
|
-
if (runtimePromise === stopped) runtimePromise = void 0;
|
|
225
|
-
});
|
|
226
|
-
}
|
|
225
|
+
stop: stopRuntime
|
|
227
226
|
});
|
|
228
227
|
const registerGateway = (name, scope, handler) => {
|
|
229
228
|
api.registerGatewayMethod(name, async (options) => {
|
|
@@ -270,10 +269,7 @@ const faceTimePlugin = definePluginEntry({
|
|
|
270
269
|
if (uninstalling) throw new Error("facetime native uninstall is already in progress");
|
|
271
270
|
uninstalling = true;
|
|
272
271
|
try {
|
|
273
|
-
|
|
274
|
-
if (current) await stopRetainedRuntime(current, (stopped) => {
|
|
275
|
-
if (runtimePromise === stopped) runtimePromise = void 0;
|
|
276
|
-
});
|
|
272
|
+
await stopRuntime();
|
|
277
273
|
await uninstallFaceTimeDriver({
|
|
278
274
|
pluginRoot,
|
|
279
275
|
runCommandWithTimeout: api.runtime.system.runCommandWithTimeout
|