@yoooclaw/phone-notifications 1.11.2-beta.1 → 1.11.2-beta.3
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/index.cjs +263 -196
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
- package/skills/notification-monitor/SKILL.md +5 -5
package/dist/index.cjs
CHANGED
|
@@ -265,13 +265,13 @@ var init_env = __esm({
|
|
|
265
265
|
init_credentials();
|
|
266
266
|
init_host();
|
|
267
267
|
ENV_CONFIG = {
|
|
268
|
-
|
|
269
|
-
lightApiUrl: "https://openclaw-service-
|
|
270
|
-
relayTunnelUrl: "wss://openclaw-service-
|
|
271
|
-
appNameMapUrl: "https://openclaw-service-
|
|
272
|
-
modelProxyLongRecordingSubmitTaskUrl: "https://openclaw-service-
|
|
273
|
-
modelProxyLongRecordingQueryTaskResultBaseUrl: "https://openclaw-service-
|
|
274
|
-
accountFileDeleteUrl: "https://openclaw-service-
|
|
268
|
+
test: {
|
|
269
|
+
lightApiUrl: "https://openclaw-service-test.yoooclaw.com/api/message/tob/sendMessage",
|
|
270
|
+
relayTunnelUrl: "wss://openclaw-service-test.yoooclaw.com/message/messages/ws/plugin",
|
|
271
|
+
appNameMapUrl: "https://openclaw-service-test.yoooclaw.com/api/application-config/app-package/config-all",
|
|
272
|
+
modelProxyLongRecordingSubmitTaskUrl: "https://openclaw-service-test.yoooclaw.com/api/model-proxy/long-recording/submit-task",
|
|
273
|
+
modelProxyLongRecordingQueryTaskResultBaseUrl: "https://openclaw-service-test.yoooclaw.com/api/model-proxy/long-recording/query-task-result",
|
|
274
|
+
accountFileDeleteUrl: "https://openclaw-service-test.yoooclaw.com/api/account/file/delete"
|
|
275
275
|
},
|
|
276
276
|
production: {
|
|
277
277
|
lightApiUrl: "https://openclaw-service.yoootek.com/api/message/tob/sendMessage",
|
|
@@ -279,7 +279,7 @@ var init_env = __esm({
|
|
|
279
279
|
appNameMapUrl: "https://openclaw-service.yoootek.com/api/application-config/app-package/config-all",
|
|
280
280
|
modelProxyLongRecordingSubmitTaskUrl: "https://openclaw-service.yoootek.com/api/model-proxy/long-recording/submit-task",
|
|
281
281
|
modelProxyLongRecordingQueryTaskResultBaseUrl: "https://openclaw-service.yoootek.com/api/model-proxy/long-recording/query-task-result",
|
|
282
|
-
accountFileDeleteUrl: "https://openclaw-service.yoootek.com/account/file/delete"
|
|
282
|
+
accountFileDeleteUrl: "https://openclaw-service.yoootek.com/api/account/file/delete"
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
285
|
VALID_ENVS = new Set(Object.keys(ENV_CONFIG));
|
|
@@ -5438,7 +5438,7 @@ function readBuildInjectedVersion() {
|
|
|
5438
5438
|
if (false) {
|
|
5439
5439
|
return void 0;
|
|
5440
5440
|
}
|
|
5441
|
-
const version = "1.11.2-beta.
|
|
5441
|
+
const version = "1.11.2-beta.3".trim();
|
|
5442
5442
|
return version || void 0;
|
|
5443
5443
|
}
|
|
5444
5444
|
function readPluginVersionFromPackageJson() {
|
|
@@ -6002,6 +6002,32 @@ function isRecord(value) {
|
|
|
6002
6002
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6003
6003
|
}
|
|
6004
6004
|
|
|
6005
|
+
// src/light-rules/names.ts
|
|
6006
|
+
var LIGHT_RULE_GATEWAY_METHODS = {
|
|
6007
|
+
list: "lightrules.list",
|
|
6008
|
+
create: "lightrules.create",
|
|
6009
|
+
update: "lightrules.update",
|
|
6010
|
+
delete: "lightrules.delete"
|
|
6011
|
+
};
|
|
6012
|
+
var LIGHT_RULE_GATEWAY_METHOD_LIST = [
|
|
6013
|
+
LIGHT_RULE_GATEWAY_METHODS.list,
|
|
6014
|
+
LIGHT_RULE_GATEWAY_METHODS.create,
|
|
6015
|
+
LIGHT_RULE_GATEWAY_METHODS.update,
|
|
6016
|
+
LIGHT_RULE_GATEWAY_METHODS.delete
|
|
6017
|
+
];
|
|
6018
|
+
var LIGHT_RULE_TOOL_NAMES = {
|
|
6019
|
+
list: "lightrules_list",
|
|
6020
|
+
create: "lightrules_create",
|
|
6021
|
+
update: "lightrules_update",
|
|
6022
|
+
delete: "lightrules_delete"
|
|
6023
|
+
};
|
|
6024
|
+
var LIGHT_RULE_TOOL_NAME_LIST = [
|
|
6025
|
+
LIGHT_RULE_TOOL_NAMES.list,
|
|
6026
|
+
LIGHT_RULE_TOOL_NAMES.create,
|
|
6027
|
+
LIGHT_RULE_TOOL_NAMES.update,
|
|
6028
|
+
LIGHT_RULE_TOOL_NAMES.delete
|
|
6029
|
+
];
|
|
6030
|
+
|
|
6005
6031
|
// src/light-rules/storage.ts
|
|
6006
6032
|
var import_node_fs4 = require("fs");
|
|
6007
6033
|
var import_node_path3 = require("path");
|
|
@@ -6190,7 +6216,7 @@ function registerLightRulesGateway(api, registry, logger, rememberBroadcast) {
|
|
|
6190
6216
|
return handler(opts);
|
|
6191
6217
|
});
|
|
6192
6218
|
};
|
|
6193
|
-
registerGatewayMethodWithBroadcastCapture(
|
|
6219
|
+
registerGatewayMethodWithBroadcastCapture(LIGHT_RULE_GATEWAY_METHODS.list, async ({ respond }) => {
|
|
6194
6220
|
try {
|
|
6195
6221
|
registry.reload();
|
|
6196
6222
|
const rules = registry.list().map((rule) => ({
|
|
@@ -6199,92 +6225,26 @@ function registerLightRulesGateway(api, registry, logger, rememberBroadcast) {
|
|
|
6199
6225
|
}));
|
|
6200
6226
|
respond(true, { ok: true, rules });
|
|
6201
6227
|
} catch (err2) {
|
|
6202
|
-
logger.warn(
|
|
6228
|
+
logger.warn(`${LIGHT_RULE_GATEWAY_METHODS.list} failed: ${err2?.message}`);
|
|
6203
6229
|
respond(false, null, {
|
|
6204
6230
|
code: "INTERNAL_ERROR",
|
|
6205
6231
|
message: err2?.message ?? "Unknown error"
|
|
6206
6232
|
});
|
|
6207
6233
|
}
|
|
6208
6234
|
});
|
|
6209
|
-
registerGatewayMethodWithBroadcastCapture(
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
if (!validation.valid) {
|
|
6222
|
-
respond(false, null, {
|
|
6223
|
-
code: "VALIDATION_FAILED",
|
|
6224
|
-
message: JSON.stringify(validation.errors)
|
|
6225
|
-
});
|
|
6226
|
-
return;
|
|
6227
|
-
}
|
|
6228
|
-
let repeatTimes;
|
|
6229
|
-
try {
|
|
6230
|
-
repeatTimes = normalizeRepeatTimes({ repeat, repeat_times });
|
|
6231
|
-
assertAncsRepeatTimes(repeatTimes);
|
|
6232
|
-
} catch (err2) {
|
|
6233
|
-
respond(false, null, { code: "VALIDATION_FAILED", message: err2?.message ?? "Unknown error" });
|
|
6234
|
-
return;
|
|
6235
|
-
}
|
|
6236
|
-
try {
|
|
6237
|
-
const result = await registry.create({
|
|
6238
|
-
name,
|
|
6239
|
-
title: resolvedTitle,
|
|
6240
|
-
description,
|
|
6241
|
-
segments: validation.segments,
|
|
6242
|
-
repeat_times: repeatTimes
|
|
6243
|
-
});
|
|
6244
|
-
logger.info(`Light rule created: ${name}`);
|
|
6245
|
-
respond(true, {
|
|
6246
|
-
ok: true,
|
|
6247
|
-
id: result.meta.name,
|
|
6248
|
-
name: result.meta.name,
|
|
6249
|
-
title: result.meta.title,
|
|
6250
|
-
rule: result.meta
|
|
6251
|
-
});
|
|
6252
|
-
} catch (err2) {
|
|
6253
|
-
if (err2 instanceof LightRuleError) {
|
|
6254
|
-
respond(false, null, { code: err2.code, message: err2.message });
|
|
6255
|
-
} else {
|
|
6256
|
-
logger.warn(`lightrules.create failed: ${err2?.message}`);
|
|
6257
|
-
respond(false, null, { code: "INTERNAL_ERROR", message: err2?.message ?? "Unknown error" });
|
|
6235
|
+
registerGatewayMethodWithBroadcastCapture(
|
|
6236
|
+
LIGHT_RULE_GATEWAY_METHODS.create,
|
|
6237
|
+
async ({ params, respond }) => {
|
|
6238
|
+
const { name, title, description, segments, repeat, repeat_times } = params;
|
|
6239
|
+
const resolvedTitle = typeof title === "string" && title.trim() ? title.trim() : name;
|
|
6240
|
+
if (!name || typeof name !== "string") {
|
|
6241
|
+
respond(false, null, { code: "INVALID_PARAMS", message: "name is required" });
|
|
6242
|
+
return;
|
|
6243
|
+
}
|
|
6244
|
+
if (!description || typeof description !== "string") {
|
|
6245
|
+
respond(false, null, { code: "INVALID_PARAMS", message: "description is required" });
|
|
6246
|
+
return;
|
|
6258
6247
|
}
|
|
6259
|
-
}
|
|
6260
|
-
});
|
|
6261
|
-
registerGatewayMethodWithBroadcastCapture("lightrules.update", async ({ params, respond }) => {
|
|
6262
|
-
const { title, description, segments, repeat, repeat_times, enabled } = params;
|
|
6263
|
-
const name = resolveRuleIdentifier(params);
|
|
6264
|
-
const resolvedTitle = typeof title === "string" ? title.trim() : void 0;
|
|
6265
|
-
if (!name) {
|
|
6266
|
-
respond(false, null, {
|
|
6267
|
-
code: "INVALID_PARAMS",
|
|
6268
|
-
message: "name is required (or provide id/ruleId/ruleName)"
|
|
6269
|
-
});
|
|
6270
|
-
return;
|
|
6271
|
-
}
|
|
6272
|
-
if (title !== void 0 && !resolvedTitle) {
|
|
6273
|
-
respond(false, null, {
|
|
6274
|
-
code: "INVALID_PARAMS",
|
|
6275
|
-
message: "title must be a non-empty string"
|
|
6276
|
-
});
|
|
6277
|
-
return;
|
|
6278
|
-
}
|
|
6279
|
-
if (description !== void 0 && typeof description !== "string") {
|
|
6280
|
-
respond(false, null, {
|
|
6281
|
-
code: "INVALID_PARAMS",
|
|
6282
|
-
message: "description must be a string"
|
|
6283
|
-
});
|
|
6284
|
-
return;
|
|
6285
|
-
}
|
|
6286
|
-
let validatedSegments;
|
|
6287
|
-
if (segments !== void 0) {
|
|
6288
6248
|
const validation = validateSegments(segments);
|
|
6289
6249
|
if (!validation.valid) {
|
|
6290
6250
|
respond(false, null, {
|
|
@@ -6293,72 +6253,162 @@ function registerLightRulesGateway(api, registry, logger, rememberBroadcast) {
|
|
|
6293
6253
|
});
|
|
6294
6254
|
return;
|
|
6295
6255
|
}
|
|
6296
|
-
|
|
6297
|
-
}
|
|
6298
|
-
let repeatTimes;
|
|
6299
|
-
if (repeat !== void 0 || repeat_times !== void 0) {
|
|
6256
|
+
let repeatTimes;
|
|
6300
6257
|
try {
|
|
6301
6258
|
repeatTimes = normalizeRepeatTimes({ repeat, repeat_times });
|
|
6302
6259
|
assertAncsRepeatTimes(repeatTimes);
|
|
6303
6260
|
} catch (err2) {
|
|
6304
|
-
respond(false, null, {
|
|
6261
|
+
respond(false, null, {
|
|
6262
|
+
code: "VALIDATION_FAILED",
|
|
6263
|
+
message: err2?.message ?? "Unknown error"
|
|
6264
|
+
});
|
|
6305
6265
|
return;
|
|
6306
6266
|
}
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6267
|
+
try {
|
|
6268
|
+
const result = await registry.create({
|
|
6269
|
+
name,
|
|
6270
|
+
title: resolvedTitle,
|
|
6271
|
+
description,
|
|
6272
|
+
segments: validation.segments,
|
|
6273
|
+
repeat_times: repeatTimes
|
|
6274
|
+
});
|
|
6275
|
+
logger.info(`Light rule created: ${name}`);
|
|
6276
|
+
respond(true, {
|
|
6277
|
+
ok: true,
|
|
6278
|
+
id: result.meta.name,
|
|
6279
|
+
name: result.meta.name,
|
|
6280
|
+
title: result.meta.title,
|
|
6281
|
+
rule: result.meta
|
|
6282
|
+
});
|
|
6283
|
+
} catch (err2) {
|
|
6284
|
+
if (err2 instanceof LightRuleError) {
|
|
6285
|
+
respond(false, null, { code: err2.code, message: err2.message });
|
|
6286
|
+
} else {
|
|
6287
|
+
logger.warn(`${LIGHT_RULE_GATEWAY_METHODS.create} failed: ${err2?.message}`);
|
|
6288
|
+
respond(false, null, {
|
|
6289
|
+
code: "INTERNAL_ERROR",
|
|
6290
|
+
message: err2?.message ?? "Unknown error"
|
|
6291
|
+
});
|
|
6292
|
+
}
|
|
6332
6293
|
}
|
|
6333
6294
|
}
|
|
6334
|
-
|
|
6335
|
-
registerGatewayMethodWithBroadcastCapture(
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6295
|
+
);
|
|
6296
|
+
registerGatewayMethodWithBroadcastCapture(
|
|
6297
|
+
LIGHT_RULE_GATEWAY_METHODS.update,
|
|
6298
|
+
async ({ params, respond }) => {
|
|
6299
|
+
const { title, description, segments, repeat, repeat_times, enabled } = params;
|
|
6300
|
+
const name = resolveRuleIdentifier(params);
|
|
6301
|
+
const resolvedTitle = typeof title === "string" ? title.trim() : void 0;
|
|
6302
|
+
if (!name) {
|
|
6303
|
+
respond(false, null, {
|
|
6304
|
+
code: "INVALID_PARAMS",
|
|
6305
|
+
message: "name is required (or provide id/ruleId/ruleName)"
|
|
6306
|
+
});
|
|
6307
|
+
return;
|
|
6308
|
+
}
|
|
6309
|
+
if (title !== void 0 && !resolvedTitle) {
|
|
6310
|
+
respond(false, null, {
|
|
6311
|
+
code: "INVALID_PARAMS",
|
|
6312
|
+
message: "title must be a non-empty string"
|
|
6313
|
+
});
|
|
6314
|
+
return;
|
|
6315
|
+
}
|
|
6316
|
+
if (description !== void 0 && typeof description !== "string") {
|
|
6317
|
+
respond(false, null, {
|
|
6318
|
+
code: "INVALID_PARAMS",
|
|
6319
|
+
message: "description must be a string"
|
|
6320
|
+
});
|
|
6321
|
+
return;
|
|
6322
|
+
}
|
|
6323
|
+
let validatedSegments;
|
|
6324
|
+
if (segments !== void 0) {
|
|
6325
|
+
const validation = validateSegments(segments);
|
|
6326
|
+
if (!validation.valid) {
|
|
6327
|
+
respond(false, null, {
|
|
6328
|
+
code: "VALIDATION_FAILED",
|
|
6329
|
+
message: JSON.stringify(validation.errors)
|
|
6330
|
+
});
|
|
6331
|
+
return;
|
|
6332
|
+
}
|
|
6333
|
+
validatedSegments = validation.segments;
|
|
6334
|
+
}
|
|
6335
|
+
let repeatTimes;
|
|
6336
|
+
if (repeat !== void 0 || repeat_times !== void 0) {
|
|
6337
|
+
try {
|
|
6338
|
+
repeatTimes = normalizeRepeatTimes({ repeat, repeat_times });
|
|
6339
|
+
assertAncsRepeatTimes(repeatTimes);
|
|
6340
|
+
} catch (err2) {
|
|
6341
|
+
respond(false, null, {
|
|
6342
|
+
code: "VALIDATION_FAILED",
|
|
6343
|
+
message: err2?.message ?? "Unknown error"
|
|
6344
|
+
});
|
|
6345
|
+
return;
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
try {
|
|
6349
|
+
const result = await registry.update({
|
|
6350
|
+
name,
|
|
6351
|
+
title: resolvedTitle,
|
|
6352
|
+
description,
|
|
6353
|
+
segments: validatedSegments,
|
|
6354
|
+
repeat_times: repeatTimes,
|
|
6355
|
+
enabled
|
|
6356
|
+
});
|
|
6357
|
+
logger.info(`Light rule updated: ${name}`);
|
|
6358
|
+
respond(true, {
|
|
6359
|
+
ok: true,
|
|
6360
|
+
id: result.meta.name,
|
|
6361
|
+
name: result.meta.name,
|
|
6362
|
+
title: result.meta.title,
|
|
6363
|
+
updated: true,
|
|
6364
|
+
rule: result.meta
|
|
6365
|
+
});
|
|
6366
|
+
} catch (err2) {
|
|
6367
|
+
if (err2 instanceof LightRuleError) {
|
|
6368
|
+
respond(false, null, { code: err2.code, message: err2.message });
|
|
6369
|
+
} else {
|
|
6370
|
+
logger.warn(`${LIGHT_RULE_GATEWAY_METHODS.update} failed: ${err2?.message}`);
|
|
6371
|
+
respond(false, null, {
|
|
6372
|
+
code: "INTERNAL_ERROR",
|
|
6373
|
+
message: err2?.message ?? "Unknown error"
|
|
6374
|
+
});
|
|
6375
|
+
}
|
|
6376
|
+
}
|
|
6343
6377
|
}
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6378
|
+
);
|
|
6379
|
+
registerGatewayMethodWithBroadcastCapture(
|
|
6380
|
+
LIGHT_RULE_GATEWAY_METHODS.delete,
|
|
6381
|
+
async ({ params, respond }) => {
|
|
6382
|
+
const name = resolveRuleIdentifier(params);
|
|
6383
|
+
if (!name) {
|
|
6384
|
+
respond(false, null, {
|
|
6385
|
+
code: "INVALID_PARAMS",
|
|
6386
|
+
message: "name is required (or provide id/ruleId/ruleName)"
|
|
6387
|
+
});
|
|
6388
|
+
return;
|
|
6389
|
+
}
|
|
6390
|
+
try {
|
|
6391
|
+
const result = await registry.delete(name);
|
|
6392
|
+
logger.info(`Light rule deleted: ${result.name}`);
|
|
6393
|
+
respond(true, {
|
|
6394
|
+
ok: true,
|
|
6395
|
+
id: result.name,
|
|
6396
|
+
name: result.name,
|
|
6397
|
+
deleted: true
|
|
6398
|
+
});
|
|
6399
|
+
} catch (err2) {
|
|
6400
|
+
if (err2 instanceof LightRuleError) {
|
|
6401
|
+
respond(false, null, { code: err2.code, message: err2.message });
|
|
6402
|
+
} else {
|
|
6403
|
+
logger.warn(`${LIGHT_RULE_GATEWAY_METHODS.delete} failed: ${err2?.message}`);
|
|
6404
|
+
respond(false, null, {
|
|
6405
|
+
code: "INTERNAL_ERROR",
|
|
6406
|
+
message: err2?.message ?? "Unknown error"
|
|
6407
|
+
});
|
|
6408
|
+
}
|
|
6359
6409
|
}
|
|
6360
6410
|
}
|
|
6361
|
-
|
|
6411
|
+
);
|
|
6362
6412
|
}
|
|
6363
6413
|
|
|
6364
6414
|
// src/light-rules/registry.ts
|
|
@@ -6759,17 +6809,11 @@ function err(code, message) {
|
|
|
6759
6809
|
const data = { ok: false, error: { code, message } };
|
|
6760
6810
|
return { content: [{ type: "text", text: JSON.stringify(data) }], details: data };
|
|
6761
6811
|
}
|
|
6762
|
-
function registerToolWithAliases(api, tool, aliases) {
|
|
6763
|
-
api.registerTool(tool);
|
|
6764
|
-
for (const alias of aliases) {
|
|
6765
|
-
api.registerTool({ ...tool, name: alias });
|
|
6766
|
-
}
|
|
6767
|
-
}
|
|
6768
6812
|
function registerLightRulesTools(api, registry, logger) {
|
|
6769
|
-
|
|
6770
|
-
name:
|
|
6813
|
+
api.registerTool({
|
|
6814
|
+
name: LIGHT_RULE_TOOL_NAMES.list,
|
|
6771
6815
|
label: "List Light Rules",
|
|
6772
|
-
description: '\u5217\u51FA\u6240\u6709\u706F\u6548\u89C4\u5219\uFF08\u5305\u542B enabled/disabled \u72B6\u6001\uFF09\u3002\u5F53\u7528\u6237\u8BF4"\u5217\u51FA\u706F\u6548\u89C4\u5219"\u3001"\u6709\u54EA\u4E9B\u706F\u6548\u89C4\u5219"\u3001"\u67E5\u770B\u89C4\u5219"\u7B49\u65F6\u8C03\u7528\u3002\u6CE8\u610F\uFF1A\u706F\u6548\u89C4\u5219\u7684\u6240\u6709 CRUD \u64CD\u4F5C\u5FC5\u987B\u901A\u8FC7
|
|
6816
|
+
description: '\u5217\u51FA\u6240\u6709\u706F\u6548\u89C4\u5219\uFF08\u5305\u542B enabled/disabled \u72B6\u6001\uFF09\u3002\u5F53\u7528\u6237\u8BF4"\u5217\u51FA\u706F\u6548\u89C4\u5219"\u3001"\u6709\u54EA\u4E9B\u706F\u6548\u89C4\u5219"\u3001"\u67E5\u770B\u89C4\u5219"\u7B49\u65F6\u8C03\u7528\u3002\u6CE8\u610F\uFF1A\u706F\u6548\u89C4\u5219\u7684\u6240\u6709 CRUD \u64CD\u4F5C\u5FC5\u987B\u901A\u8FC7 lightrules_* \u5DE5\u5177\u5B8C\u6210\uFF0C\u7981\u6B62\u76F4\u63A5\u7528 write/edit \u4FEE\u6539 tasks/*/meta.json\u3002',
|
|
6773
6817
|
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
6774
6818
|
async execute(_toolCallId, _params) {
|
|
6775
6819
|
try {
|
|
@@ -6777,13 +6821,13 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6777
6821
|
const rules = registry.list().map((rule) => ({ ...rule, id: rule.name }));
|
|
6778
6822
|
return ok({ ok: true, rules });
|
|
6779
6823
|
} catch (e) {
|
|
6780
|
-
logger.warn(
|
|
6824
|
+
logger.warn(`${LIGHT_RULE_TOOL_NAMES.list} tool failed: ${e?.message}`);
|
|
6781
6825
|
return err("INTERNAL_ERROR", e?.message ?? "Unknown error");
|
|
6782
6826
|
}
|
|
6783
6827
|
}
|
|
6784
|
-
}
|
|
6785
|
-
|
|
6786
|
-
name:
|
|
6828
|
+
});
|
|
6829
|
+
api.registerTool({
|
|
6830
|
+
name: LIGHT_RULE_TOOL_NAMES.create,
|
|
6787
6831
|
label: "Create Light Rule",
|
|
6788
6832
|
description: '\u521B\u5EFA\u4E00\u6761\u6301\u4E45\u706F\u6548\u89C4\u5219\uFF0C\u6307\u5B9A\u5185\u90E8\u6807\u8BC6 name\u3001\u5C55\u793A\u540D title\u3001\u81EA\u7136\u8BED\u8A00\u89E6\u53D1\u63CF\u8FF0\u548C\u706F\u6548\u53C2\u6570\u3002\u89C4\u5219\u4F1A\u4FDD\u5B58\u5230 tasks/<name>/meta.json\uFF0C\u5E76\u7531\u901A\u77E5\u5230\u8FBE\u540E\u7684\u4E8B\u4EF6\u9A71\u52A8\u8BC4\u4F30\u89E6\u53D1\u3002\u5F53\u7528\u6237\u8BF4"\u6536\u5230\u67D0\u7C7B\u901A\u77E5/\u6D88\u606F\u65F6\u4EAE\u706F/\u95EA\u706F/\u53D8\u706F\u6548"\u3001"\u5F53\u8001\u677F\u53D1\u6D88\u606F\u4EAE\u7EA2\u706F"\u3001"\u65B0\u589E/\u521B\u5EFA\u706F\u6548\u89C4\u5219"\u7B49\u65F6\u8C03\u7528\u3002\u4E0D\u8981\u76F4\u63A5\u8C03\u7528 light_control \u4EE3\u66FF\u521B\u5EFA\u89C4\u5219\uFF1Blight_control \u53EA\u4F1A\u7ACB\u5373\u4EAE\u4E00\u6B21\u706F\uFF0C\u4E0D\u4F1A\u51FA\u73B0\u5728\u706F\u6548\u89C4\u5219\u67E5\u8BE2\u4E2D\u3002',
|
|
6789
6833
|
parameters: {
|
|
@@ -6834,7 +6878,7 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6834
6878
|
segments: validation.segments,
|
|
6835
6879
|
repeat_times: repeatTimes
|
|
6836
6880
|
});
|
|
6837
|
-
logger.info(
|
|
6881
|
+
logger.info(`${LIGHT_RULE_TOOL_NAMES.create} tool: created ${name}`);
|
|
6838
6882
|
return ok({
|
|
6839
6883
|
ok: true,
|
|
6840
6884
|
id: result.meta.name,
|
|
@@ -6844,13 +6888,13 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6844
6888
|
});
|
|
6845
6889
|
} catch (e) {
|
|
6846
6890
|
if (e instanceof LightRuleError) return err(e.code, e.message);
|
|
6847
|
-
logger.warn(
|
|
6891
|
+
logger.warn(`${LIGHT_RULE_TOOL_NAMES.create} tool failed: ${e?.message}`);
|
|
6848
6892
|
return err("INTERNAL_ERROR", e?.message ?? "Unknown error");
|
|
6849
6893
|
}
|
|
6850
6894
|
}
|
|
6851
|
-
}
|
|
6852
|
-
|
|
6853
|
-
name:
|
|
6895
|
+
});
|
|
6896
|
+
api.registerTool({
|
|
6897
|
+
name: LIGHT_RULE_TOOL_NAMES.update,
|
|
6854
6898
|
label: "Update Light Rule",
|
|
6855
6899
|
description: '\u4FEE\u6539\u706F\u6548\u89C4\u5219\uFF08\u542F\u7528/\u7981\u7528\u3001\u6539 title\u3001\u6539\u63CF\u8FF0\u3001\u6539\u706F\u6548\u53C2\u6570\uFF09\u3002\u5F53\u7528\u6237\u8BF4"\u7981\u7528\u67D0\u6761\u89C4\u5219"\u3001"\u542F\u7528\u89C4\u5219"\u3001"\u4FEE\u6539\u706F\u6548\u89C4\u5219"\u7B49\u65F6\u8C03\u7528\u3002',
|
|
6856
6900
|
parameters: {
|
|
@@ -6902,7 +6946,7 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6902
6946
|
repeat_times: repeatTimes,
|
|
6903
6947
|
enabled
|
|
6904
6948
|
});
|
|
6905
|
-
logger.info(
|
|
6949
|
+
logger.info(`${LIGHT_RULE_TOOL_NAMES.update} tool: updated ${name}`);
|
|
6906
6950
|
return ok({
|
|
6907
6951
|
ok: true,
|
|
6908
6952
|
name: result.meta.name,
|
|
@@ -6912,13 +6956,13 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6912
6956
|
});
|
|
6913
6957
|
} catch (e) {
|
|
6914
6958
|
if (e instanceof LightRuleError) return err(e.code, e.message);
|
|
6915
|
-
logger.warn(
|
|
6959
|
+
logger.warn(`${LIGHT_RULE_TOOL_NAMES.update} tool failed: ${e?.message}`);
|
|
6916
6960
|
return err("INTERNAL_ERROR", e?.message ?? "Unknown error");
|
|
6917
6961
|
}
|
|
6918
6962
|
}
|
|
6919
|
-
}
|
|
6920
|
-
|
|
6921
|
-
name:
|
|
6963
|
+
});
|
|
6964
|
+
api.registerTool({
|
|
6965
|
+
name: LIGHT_RULE_TOOL_NAMES.delete,
|
|
6922
6966
|
label: "Delete Light Rule",
|
|
6923
6967
|
description: '\u5220\u9664\u4E00\u6761\u706F\u6548\u89C4\u5219\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\u3002\u5F53\u7528\u6237\u8BF4"\u5220\u9664\u706F\u6548\u89C4\u5219"\u3001"\u79FB\u9664\u89C4\u5219"\u7B49\u65F6\u8C03\u7528\u3002',
|
|
6924
6968
|
parameters: {
|
|
@@ -6935,15 +6979,15 @@ function registerLightRulesTools(api, registry, logger) {
|
|
|
6935
6979
|
return err("INVALID_PARAMS", "name is required");
|
|
6936
6980
|
try {
|
|
6937
6981
|
const result = await registry.delete(name);
|
|
6938
|
-
logger.info(
|
|
6982
|
+
logger.info(`${LIGHT_RULE_TOOL_NAMES.delete} tool: deleted ${name}`);
|
|
6939
6983
|
return ok({ ok: true, name: result.name, deleted: true });
|
|
6940
6984
|
} catch (e) {
|
|
6941
6985
|
if (e instanceof LightRuleError) return err(e.code, e.message);
|
|
6942
|
-
logger.warn(
|
|
6986
|
+
logger.warn(`${LIGHT_RULE_TOOL_NAMES.delete} tool failed: ${e?.message}`);
|
|
6943
6987
|
return err("INTERNAL_ERROR", e?.message ?? "Unknown error");
|
|
6944
6988
|
}
|
|
6945
6989
|
}
|
|
6946
|
-
}
|
|
6990
|
+
});
|
|
6947
6991
|
}
|
|
6948
6992
|
|
|
6949
6993
|
// src/light-rules/inline-evaluator.ts
|
|
@@ -7265,7 +7309,7 @@ function resolveUpdateChannel(params) {
|
|
|
7265
7309
|
if (params.currentVersion.includes("-")) {
|
|
7266
7310
|
return "beta";
|
|
7267
7311
|
}
|
|
7268
|
-
return params.envName === "
|
|
7312
|
+
return params.envName === "test" ? "beta" : "latest";
|
|
7269
7313
|
}
|
|
7270
7314
|
|
|
7271
7315
|
// src/update/index.ts
|
|
@@ -8291,17 +8335,7 @@ function resolveConfigPath2() {
|
|
|
8291
8335
|
if (fromEnv) return fromEnv;
|
|
8292
8336
|
return (0, import_node_path11.join)((0, import_node_os2.homedir)(), ".openclaw", "openclaw.json");
|
|
8293
8337
|
}
|
|
8294
|
-
var LIGHT_TOOLS = [
|
|
8295
|
-
"light_control",
|
|
8296
|
-
"lightrules.list",
|
|
8297
|
-
"lightrules.create",
|
|
8298
|
-
"lightrules.update",
|
|
8299
|
-
"lightrules.delete",
|
|
8300
|
-
"lightrules_list",
|
|
8301
|
-
"lightrules_create",
|
|
8302
|
-
"lightrules_update",
|
|
8303
|
-
"lightrules_delete"
|
|
8304
|
-
];
|
|
8338
|
+
var LIGHT_TOOLS = ["light_control", ...LIGHT_RULE_TOOL_NAME_LIST];
|
|
8305
8339
|
function upsertLightControlAlsoAllow(cfg) {
|
|
8306
8340
|
if (!isObject(cfg.tools)) cfg.tools = {};
|
|
8307
8341
|
const toolsAlsoAllow = ensureArray(cfg.tools, "alsoAllow");
|
|
@@ -8955,7 +8989,8 @@ function registerRecList(rec, ctx) {
|
|
|
8955
8989
|
has_audio: !!r.audioFile,
|
|
8956
8990
|
has_transcript: !!r.transcriptFile,
|
|
8957
8991
|
created_at: r.metadata.created_at,
|
|
8958
|
-
updated_at: r.updatedAt
|
|
8992
|
+
updated_at: r.updatedAt,
|
|
8993
|
+
error: r.lastError ?? null
|
|
8959
8994
|
}));
|
|
8960
8995
|
output({ ok: true, total: items.length, recordings: items });
|
|
8961
8996
|
});
|
|
@@ -8988,6 +9023,7 @@ function registerRecStatus(rec, ctx) {
|
|
|
8988
9023
|
transcriptFile: entry.transcriptFile ?? null,
|
|
8989
9024
|
summaryFile: entry.summaryFile ?? null,
|
|
8990
9025
|
title: entry.title ?? null,
|
|
9026
|
+
error: entry.lastError ?? null,
|
|
8991
9027
|
ingestedAt: entry.ingestedAt,
|
|
8992
9028
|
updatedAt: entry.updatedAt
|
|
8993
9029
|
}
|
|
@@ -9458,7 +9494,7 @@ function registerLightControlTool(api, logger) {
|
|
|
9458
9494
|
api.registerTool({
|
|
9459
9495
|
name: "light_control",
|
|
9460
9496
|
label: "Light Control",
|
|
9461
|
-
description:
|
|
9497
|
+
description: `\u7ACB\u5373\u63A7\u5236\u786C\u4EF6\u706F\u6548\uFF08\u4E00\u6B21\u6027\u6267\u884C\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u6216\u4FDD\u5B58\u901A\u77E5\u89E6\u53D1\u89C4\u5219\uFF09\uFF0C\u652F\u6301 1\u201312 \u6BB5\u987A\u5E8F\u706F\u6548\uFF0C\u6BCF\u6BB5\u72EC\u7ACB\u53C2\u6570\uFF086 \u79CD\u6A21\u5F0F\uFF1A\u6CE2\u6D6A/\u547C\u5438/\u9891\u95EA/\u5E38\u4EAE/\u6D41\u5149/\u9010\u7EC4\u50CF\u7D20\u5E27\uFF09\u3002Tool \u5185\u90E8\u81EA\u52A8\u91CF\u5316\u4E3A\u5D4C\u5165\u5F0F\u534F\u8BAE\u5B9A\u4E49\u7684\u79BB\u6563\u6863\u4F4D\uFF0C\u5E76\u6309\u6A21\u5F0F\u7CBE\u7B80\u4E3A\u53D8\u957F ANCS \u63A7\u5236\u5E8F\u5217\uFF0C\u901A\u8FC7 HTTP \u63A5\u53E3\u4E0B\u53D1\u706F\u6548\u6307\u4EE4\u3002\u5F53\u7528\u6237\u8BF4"\u5F00\u706F"\u3001"\u6362\u4E2A\u706F\u6548"\u3001"\u628A\u706F\u8C03\u6210\u7EA2\u8272"\u3001"\u8425\u9020\u6C1B\u56F4"\u3001"\u6D4B\u8BD5/\u9884\u89C8\u706F\u6548"\u7B49\u4E0E\u5F53\u524D\u5373\u65F6\u706F\u5149\u63A7\u5236\u76F8\u5173\u7684\u8868\u8FBE\u65F6\u8C03\u7528\u3002\u5982\u679C\u7528\u6237\u8BF4"\u6536\u5230\u67D0\u7C7B\u901A\u77E5/\u6D88\u606F\u65F6\u4EAE\u706F/\u95EA\u706F/\u53D8\u706F\u6548"\uFF0C\u90A3\u662F\u6301\u4E45\u706F\u6548\u89C4\u5219\uFF0C\u6539\u7528 ${LIGHT_RULE_TOOL_NAMES.create} \u6216 ${LIGHT_RULE_TOOL_NAMES.update}\u3002`,
|
|
9462
9498
|
parameters: lightControlParameters,
|
|
9463
9499
|
async execute(_toolCallId, params) {
|
|
9464
9500
|
let apiKey;
|
|
@@ -9976,7 +10012,8 @@ var VALID_TRANSITIONS = /* @__PURE__ */ new Map([
|
|
|
9976
10012
|
["pending_oss_upload", /* @__PURE__ */ new Set(["uploading_oss"])],
|
|
9977
10013
|
["uploading_oss", /* @__PURE__ */ new Set(["oss_uploaded"])],
|
|
9978
10014
|
["oss_uploaded", /* @__PURE__ */ new Set(["syncing_openclaw"])],
|
|
9979
|
-
["syncing_openclaw", /* @__PURE__ */ new Set(["synced"])],
|
|
10015
|
+
["syncing_openclaw", /* @__PURE__ */ new Set(["synced", "sync_failed"])],
|
|
10016
|
+
["sync_failed", /* @__PURE__ */ new Set(["syncing_openclaw"])],
|
|
9980
10017
|
["synced", /* @__PURE__ */ new Set(["transcribing"])],
|
|
9981
10018
|
["transcribing", /* @__PURE__ */ new Set(["transcribed", "transcribe_failed"])],
|
|
9982
10019
|
["transcribe_failed", /* @__PURE__ */ new Set(["transcribing"])],
|
|
@@ -10134,7 +10171,7 @@ var RecordingStorage = class {
|
|
|
10134
10171
|
const existing = this.findById(id);
|
|
10135
10172
|
if (existing) {
|
|
10136
10173
|
const sameAudioUrl = existing.metadata.oss_audio_url === metadata.oss_audio_url;
|
|
10137
|
-
const canPreserveSyncState = sameAudioUrl && !!existing.audioFile && existing.status !== "syncing_openclaw";
|
|
10174
|
+
const canPreserveSyncState = sameAudioUrl && !!existing.audioFile && existing.status !== "syncing_openclaw" && existing.status !== "sync_failed";
|
|
10138
10175
|
if (canPreserveSyncState) {
|
|
10139
10176
|
existing.metadata = metadata;
|
|
10140
10177
|
existing.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10159,6 +10196,7 @@ var RecordingStorage = class {
|
|
|
10159
10196
|
existing.transcriptFile = void 0;
|
|
10160
10197
|
existing.summaryFile = void 0;
|
|
10161
10198
|
existing.title = void 0;
|
|
10199
|
+
existing.lastError = void 0;
|
|
10162
10200
|
existing.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
10163
10201
|
this.logger.info(`\u5F55\u97F3\u5143\u6570\u636E\u5DF2\u66F4\u65B0: ${id}`);
|
|
10164
10202
|
} else {
|
|
@@ -10263,6 +10301,16 @@ var RecordingStorage = class {
|
|
|
10263
10301
|
entry.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
10264
10302
|
this.saveIndex();
|
|
10265
10303
|
}
|
|
10304
|
+
/**
|
|
10305
|
+
* 记录最近一次失败原因;传 undefined 表示清除错误
|
|
10306
|
+
*/
|
|
10307
|
+
setLastError(recordingId, error) {
|
|
10308
|
+
const entry = this.findById(recordingId);
|
|
10309
|
+
if (!entry) return;
|
|
10310
|
+
entry.lastError = error?.trim() || void 0;
|
|
10311
|
+
entry.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
10312
|
+
this.saveIndex();
|
|
10313
|
+
}
|
|
10266
10314
|
/**
|
|
10267
10315
|
* 读取摘要文本
|
|
10268
10316
|
*/
|
|
@@ -10531,6 +10579,9 @@ var RecordingStorage = class {
|
|
|
10531
10579
|
needsRewrite = true;
|
|
10532
10580
|
}
|
|
10533
10581
|
}
|
|
10582
|
+
if (typeof entry.lastError === "string" && entry.lastError.trim()) {
|
|
10583
|
+
compacted.lastError = entry.lastError.trim();
|
|
10584
|
+
}
|
|
10534
10585
|
return compacted;
|
|
10535
10586
|
});
|
|
10536
10587
|
const hadLargeFields = raw.recordings.some(
|
|
@@ -10729,6 +10780,7 @@ function emitRecordingStatus(recordingId, storage, logger, notifyStatus, error,
|
|
|
10729
10780
|
return;
|
|
10730
10781
|
}
|
|
10731
10782
|
const title = extras?.title?.trim() || entry.title?.trim() || entry.metadata.name?.trim() || entry.id;
|
|
10783
|
+
const persistedError = entry.lastError?.trim() || void 0;
|
|
10732
10784
|
try {
|
|
10733
10785
|
notifyStatus({
|
|
10734
10786
|
recordingId: entry.id,
|
|
@@ -10741,7 +10793,7 @@ function emitRecordingStatus(recordingId, storage, logger, notifyStatus, error,
|
|
|
10741
10793
|
summary: extras?.summary,
|
|
10742
10794
|
title,
|
|
10743
10795
|
updatedAt: entry.updatedAt,
|
|
10744
|
-
error
|
|
10796
|
+
error: error ?? persistedError
|
|
10745
10797
|
});
|
|
10746
10798
|
} catch (err2) {
|
|
10747
10799
|
logger.error(
|
|
@@ -10768,6 +10820,8 @@ async function runRecordingSyncInBackground(metadata, recordingId, storage, asrC
|
|
|
10768
10820
|
if (!downloadResult.audio.ok) {
|
|
10769
10821
|
const error = `\u97F3\u9891\u4E0B\u8F7D\u5931\u8D25: ${downloadResult.audio.error}`;
|
|
10770
10822
|
logger.error(`[recording-sync] ${error}: ${recordingId}`);
|
|
10823
|
+
storage.updateStatus(recordingId, "sync_failed");
|
|
10824
|
+
storage.setLastError(recordingId, error);
|
|
10771
10825
|
emitRecordingStatus(
|
|
10772
10826
|
recordingId,
|
|
10773
10827
|
storage,
|
|
@@ -10777,6 +10831,7 @@ async function runRecordingSyncInBackground(metadata, recordingId, storage, asrC
|
|
|
10777
10831
|
);
|
|
10778
10832
|
return;
|
|
10779
10833
|
}
|
|
10834
|
+
storage.setLastError(recordingId, void 0);
|
|
10780
10835
|
storage.setAudioFile(
|
|
10781
10836
|
recordingId,
|
|
10782
10837
|
storage.buildAudioFilename(recordingId, metadata.oss_audio_url)
|
|
@@ -10799,7 +10854,7 @@ async function runRecordingSyncInBackground(metadata, recordingId, storage, asrC
|
|
|
10799
10854
|
}
|
|
10800
10855
|
async function handleRecordingSync(recordingId, metadata, storage, asrConfig, logger, options = {}) {
|
|
10801
10856
|
const existing = storage.findById(recordingId);
|
|
10802
|
-
const shouldDownloadAndSync = !existing || existing.metadata.oss_audio_url !== metadata.oss_audio_url || !existing.audioFile || existing.status === "syncing_openclaw";
|
|
10857
|
+
const shouldDownloadAndSync = !existing || existing.metadata.oss_audio_url !== metadata.oss_audio_url || !existing.audioFile || existing.status === "syncing_openclaw" || existing.status === "sync_failed";
|
|
10803
10858
|
storage.ingest(recordingId, metadata);
|
|
10804
10859
|
if (shouldDownloadAndSync) {
|
|
10805
10860
|
runRecordingSyncInBackground(
|
|
@@ -10812,6 +10867,11 @@ async function handleRecordingSync(recordingId, metadata, storage, asrConfig, lo
|
|
|
10812
10867
|
).catch((err2) => {
|
|
10813
10868
|
const error = `\u5F55\u97F3\u540C\u6B65\u5931\u8D25: ${err2?.message ?? err2}`;
|
|
10814
10869
|
logger.error(`[recording-sync] ${error}: ${recordingId}`);
|
|
10870
|
+
const current2 = storage.findById(recordingId);
|
|
10871
|
+
if (current2?.status === "syncing_openclaw") {
|
|
10872
|
+
storage.updateStatus(recordingId, "sync_failed");
|
|
10873
|
+
}
|
|
10874
|
+
storage.setLastError(recordingId, error);
|
|
10815
10875
|
emitRecordingStatus(
|
|
10816
10876
|
recordingId,
|
|
10817
10877
|
storage,
|
|
@@ -10825,8 +10885,8 @@ async function handleRecordingSync(recordingId, metadata, storage, asrConfig, lo
|
|
|
10825
10885
|
`[recording-sync] \u5F55\u97F3\u5DF2\u5B58\u5728\u4E14\u97F3\u9891\u672A\u53D8\u5316\uFF0C\u8DF3\u8FC7\u91CD\u590D\u4E0B\u8F7D: ${recordingId}`
|
|
10826
10886
|
);
|
|
10827
10887
|
emitRecordingStatus(recordingId, storage, logger, options.notifyStatus);
|
|
10828
|
-
const
|
|
10829
|
-
if (
|
|
10888
|
+
const current2 = storage.findById(recordingId);
|
|
10889
|
+
if (current2?.status === "synced" && isAsrConfigured(asrConfig)) {
|
|
10830
10890
|
triggerTranscription(
|
|
10831
10891
|
recordingId,
|
|
10832
10892
|
storage,
|
|
@@ -10840,10 +10900,12 @@ async function handleRecordingSync(recordingId, metadata, storage, asrConfig, lo
|
|
|
10840
10900
|
});
|
|
10841
10901
|
}
|
|
10842
10902
|
}
|
|
10903
|
+
const current = storage.findById(recordingId);
|
|
10843
10904
|
return {
|
|
10844
10905
|
ok: true,
|
|
10845
10906
|
recordingId,
|
|
10846
|
-
transfer_status:
|
|
10907
|
+
transfer_status: current?.status ?? "syncing_openclaw",
|
|
10908
|
+
...current?.lastError ? { error: current.lastError } : {}
|
|
10847
10909
|
};
|
|
10848
10910
|
}
|
|
10849
10911
|
async function triggerTranscription(recordingId, storage, asrConfig, logger, options = {}) {
|
|
@@ -10859,6 +10921,7 @@ async function triggerTranscription(recordingId, storage, asrConfig, logger, opt
|
|
|
10859
10921
|
return;
|
|
10860
10922
|
}
|
|
10861
10923
|
storage.updateStatus(recordingId, "transcribing");
|
|
10924
|
+
storage.setLastError(recordingId, void 0);
|
|
10862
10925
|
emitRecordingStatus(recordingId, storage, logger, options.notifyStatus);
|
|
10863
10926
|
const audioFilePath = storage.getAudioFilePath(recordingId);
|
|
10864
10927
|
const result = await runTranscriptionWorkflow({
|
|
@@ -10910,6 +10973,7 @@ async function triggerTranscription(recordingId, storage, asrConfig, logger, opt
|
|
|
10910
10973
|
}
|
|
10911
10974
|
} else {
|
|
10912
10975
|
storage.updateStatus(recordingId, "transcribe_failed");
|
|
10976
|
+
storage.setLastError(recordingId, result.error);
|
|
10913
10977
|
emitRecordingStatus(
|
|
10914
10978
|
recordingId,
|
|
10915
10979
|
storage,
|
|
@@ -12744,6 +12808,7 @@ var RECORDING_TRANSFER_STATUSES = /* @__PURE__ */ new Set([
|
|
|
12744
12808
|
"uploading_oss",
|
|
12745
12809
|
"oss_uploaded",
|
|
12746
12810
|
"syncing_openclaw",
|
|
12811
|
+
"sync_failed",
|
|
12747
12812
|
"synced",
|
|
12748
12813
|
"transcribing",
|
|
12749
12814
|
"transcribe_failed",
|
|
@@ -12767,7 +12832,8 @@ function buildRecordingListItem(entry) {
|
|
|
12767
12832
|
audioFile: entry.audioFile,
|
|
12768
12833
|
transcriptDataFile: entry.transcriptDataFile,
|
|
12769
12834
|
transcriptFile: entry.transcriptFile,
|
|
12770
|
-
updatedAt: entry.updatedAt
|
|
12835
|
+
updatedAt: entry.updatedAt,
|
|
12836
|
+
...entry.lastError ? { error: entry.lastError } : {}
|
|
12771
12837
|
};
|
|
12772
12838
|
}
|
|
12773
12839
|
function isRelayInternalHttpRequest2(req) {
|
|
@@ -12800,7 +12866,8 @@ function buildRecordingDetail(entry, extras) {
|
|
|
12800
12866
|
transcript: extras?.transcript,
|
|
12801
12867
|
transcriptData: extras?.transcriptData,
|
|
12802
12868
|
ingestedAt: entry.ingestedAt,
|
|
12803
|
-
updatedAt: entry.updatedAt
|
|
12869
|
+
updatedAt: entry.updatedAt,
|
|
12870
|
+
...entry.lastError ? { error: entry.lastError } : {}
|
|
12804
12871
|
};
|
|
12805
12872
|
}
|
|
12806
12873
|
function registerRecordingInterfaces(deps) {
|
|
@@ -13193,9 +13260,9 @@ function isPluginCliInvocation(argv = process.argv) {
|
|
|
13193
13260
|
// src/index.ts
|
|
13194
13261
|
var LIGHT_RULE_PROMPT_GUIDANCE = [
|
|
13195
13262
|
"\u706F\u6548\u89C4\u5219\u8DEF\u7531\u63D0\u793A\uFF1A",
|
|
13196
|
-
|
|
13263
|
+
`- \u5F53\u7528\u6237\u8868\u8FBE\u201C\u6536\u5230/\u5F53/\u5982\u679C/\u6709\u67D0\u7C7B\u901A\u77E5\u6216\u6D88\u606F\u65F6\uFF0C\u4EAE\u706F/\u95EA\u706F/\u53D8\u6210\u67D0\u79CD\u706F\u6548\u201D\u65F6\uFF0C\u8FD9\u662F\u6301\u4E45\u706F\u6548\u89C4\u5219\u8BF7\u6C42\uFF0C\u5FC5\u987B\u8C03\u7528 ${LIGHT_RULE_TOOL_NAMES.create} \u6216 ${LIGHT_RULE_TOOL_NAMES.update}\u3002`,
|
|
13197
13264
|
"- \u4E0D\u8981\u4E3A\u8FD9\u7C7B\u901A\u77E5\u89E6\u53D1\u89C4\u5219\u76F4\u63A5\u8C03\u7528 light_control\uFF1Blight_control \u53EA\u7528\u4E8E\u5F53\u524D\u7ACB\u5373\u6267\u884C\u7684\u4E00\u6B21\u6027\u706F\u6548\u3001\u6D4B\u8BD5\u6216\u9884\u89C8\u3002",
|
|
13198
|
-
"- \u4E0D\u8981\u624B\u5199\u6216\u7F16\u8F91 tasks/*/meta.json\uFF1B\u706F\u6548\u89C4\u5219\u7684\u521B\u5EFA\u3001\u4FEE\u6539\u3001\u5220\u9664\u548C\u67E5\u8BE2\u90FD\u8D70
|
|
13265
|
+
"- \u4E0D\u8981\u624B\u5199\u6216\u7F16\u8F91 tasks/*/meta.json\uFF1B\u706F\u6548\u89C4\u5219\u7684\u521B\u5EFA\u3001\u4FEE\u6539\u3001\u5220\u9664\u548C\u67E5\u8BE2\u90FD\u8D70 lightrules_* \u5DE5\u5177\u3002"
|
|
13199
13266
|
].join("\n");
|
|
13200
13267
|
var index_default = {
|
|
13201
13268
|
id: "phone-notifications",
|
|
@@ -13330,7 +13397,7 @@ var index_default = {
|
|
|
13330
13397
|
registerLightRulesGateway(api, lightRuleRegistry, logger, cacheBroadcast);
|
|
13331
13398
|
registerLightRulesTools(api, lightRuleRegistry, logger);
|
|
13332
13399
|
logger.info(
|
|
13333
|
-
|
|
13400
|
+
`\u706F\u6548\u89C4\u5219\u65B9\u6CD5\u5DF2\u6CE8\u518C: gateway=${LIGHT_RULE_GATEWAY_METHOD_LIST.join(", ")}; tools=${LIGHT_RULE_TOOL_NAME_LIST.join(", ")}`
|
|
13334
13401
|
);
|
|
13335
13402
|
autoUpdateLifecycle = registerAutoUpdateLifecycle({
|
|
13336
13403
|
api,
|