@openclaw/feishu 2026.9.1-beta.1 → 2026.9.2
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/{accounts-RwSyseKr.js → accounts-cCMNFBKg.js} +1 -1
- package/dist/api.js +222 -284
- package/dist/{app-registration-BpfUzS9m.js → app-registration-BI99e_JI.js} +12 -9
- package/dist/{channel-Dpgf8wLD.js → channel-VytDDz_B.js} +244 -582
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BIEERwaT.js → channel.runtime-CAD74kBO.js} +15 -19
- package/dist/{chat-C1nuW5UY.js → chat-DDhIcPQy.js} +13 -13
- package/dist/{client-DalLmpMf.js → client-DMbIL3UH.js} +3 -6
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/doctor-contract-w6FpMypv.js +465 -0
- package/dist/index.js +11 -42
- package/dist/{json-response-CheljwGr.js → json-response-DXajw_FU.js} +1 -1
- package/dist/{monitor.startup-D-gL82OO.js → monitor-rPJ_Mz4M.js} +62 -2
- package/dist/{monitor.account-DhhotI_Q.js → monitor.account-v0XIDyfs.js} +270 -299
- package/dist/{probe-CfhhR_0a.js → probe-D_SatdZl.js} +3 -3
- package/dist/{presentation-card-C8Z7Tgru.js → reply-delivery-result-CYaKkbUN.js} +334 -240
- package/dist/{security-audit-D6Fz2h6p.js → security-audit-DKfR4Cv3.js} +1 -1
- package/dist/{security-audit-shared-BgpY7AiJ.js → security-audit-shared-CK5rVR-1.js} +2 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{subagent-hooks-KUi-7vUy.js → subagent-hooks-Buadpie_.js} +3 -6
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{targets-BUjQ1TcA.js → targets-BTQCYRZQ.js} +4 -4
- package/dist/{thread-bindings-CptM_YU6.js → thread-bindings-BiL1wGqK.js} +20 -9
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/ws/package.json +1 -1
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- 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/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +45 -238
- package/package.json +6 -5
- package/dist/doctor-contract-bEQXIXyP.js +0 -158
- package/dist/monitor-BRg3sHH7.js +0 -62
package/openclaw.plugin.json
CHANGED
|
@@ -302,242 +302,8 @@
|
|
|
302
302
|
],
|
|
303
303
|
"configSchema": {
|
|
304
304
|
"type": "object",
|
|
305
|
-
"additionalProperties":
|
|
306
|
-
"
|
|
307
|
-
"secretRef": {
|
|
308
|
-
"type": "object",
|
|
309
|
-
"additionalProperties": false,
|
|
310
|
-
"properties": {
|
|
311
|
-
"source": {
|
|
312
|
-
"type": "string",
|
|
313
|
-
"enum": [
|
|
314
|
-
"env",
|
|
315
|
-
"file",
|
|
316
|
-
"exec",
|
|
317
|
-
"store"
|
|
318
|
-
]
|
|
319
|
-
},
|
|
320
|
-
"provider": {
|
|
321
|
-
"type": "string"
|
|
322
|
-
},
|
|
323
|
-
"id": {
|
|
324
|
-
"type": "string"
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
"required": [
|
|
328
|
-
"source",
|
|
329
|
-
"provider",
|
|
330
|
-
"id"
|
|
331
|
-
]
|
|
332
|
-
},
|
|
333
|
-
"secretInput": {
|
|
334
|
-
"anyOf": [
|
|
335
|
-
{
|
|
336
|
-
"type": "string",
|
|
337
|
-
"minLength": 1
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
"$ref": "#/$defs/secretRef"
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
},
|
|
344
|
-
"streaming": {
|
|
345
|
-
"type": "object",
|
|
346
|
-
"additionalProperties": false,
|
|
347
|
-
"properties": {
|
|
348
|
-
"mode": {
|
|
349
|
-
"type": "string",
|
|
350
|
-
"enum": [
|
|
351
|
-
"off",
|
|
352
|
-
"partial"
|
|
353
|
-
],
|
|
354
|
-
"description": "\"partial\" (default) enables streaming-card replies; \"off\" sends one final message."
|
|
355
|
-
},
|
|
356
|
-
"chunkMode": {
|
|
357
|
-
"type": "string",
|
|
358
|
-
"enum": [
|
|
359
|
-
"length",
|
|
360
|
-
"newline"
|
|
361
|
-
]
|
|
362
|
-
},
|
|
363
|
-
"block": {
|
|
364
|
-
"type": "object",
|
|
365
|
-
"additionalProperties": false,
|
|
366
|
-
"properties": {
|
|
367
|
-
"enabled": {
|
|
368
|
-
"type": "boolean"
|
|
369
|
-
},
|
|
370
|
-
"coalesce": {
|
|
371
|
-
"type": "object",
|
|
372
|
-
"additionalProperties": false,
|
|
373
|
-
"properties": {
|
|
374
|
-
"minChars": {
|
|
375
|
-
"type": "integer",
|
|
376
|
-
"minimum": 1
|
|
377
|
-
},
|
|
378
|
-
"maxChars": {
|
|
379
|
-
"type": "integer",
|
|
380
|
-
"minimum": 1
|
|
381
|
-
},
|
|
382
|
-
"idleMs": {
|
|
383
|
-
"type": "integer",
|
|
384
|
-
"minimum": 0
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
"account": {
|
|
393
|
-
"type": "object",
|
|
394
|
-
"additionalProperties": true,
|
|
395
|
-
"properties": {
|
|
396
|
-
"enabled": {
|
|
397
|
-
"type": "boolean"
|
|
398
|
-
},
|
|
399
|
-
"name": {
|
|
400
|
-
"type": "string"
|
|
401
|
-
},
|
|
402
|
-
"appId": {
|
|
403
|
-
"type": "string"
|
|
404
|
-
},
|
|
405
|
-
"appSecret": {
|
|
406
|
-
"$ref": "#/$defs/secretInput"
|
|
407
|
-
},
|
|
408
|
-
"encryptKey": {
|
|
409
|
-
"$ref": "#/$defs/secretInput"
|
|
410
|
-
},
|
|
411
|
-
"verificationToken": {
|
|
412
|
-
"$ref": "#/$defs/secretInput"
|
|
413
|
-
},
|
|
414
|
-
"domain": {
|
|
415
|
-
"anyOf": [
|
|
416
|
-
{
|
|
417
|
-
"type": "string",
|
|
418
|
-
"enum": [
|
|
419
|
-
"feishu",
|
|
420
|
-
"lark"
|
|
421
|
-
]
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
"type": "string",
|
|
425
|
-
"format": "uri"
|
|
426
|
-
}
|
|
427
|
-
]
|
|
428
|
-
},
|
|
429
|
-
"connectionMode": {
|
|
430
|
-
"type": "string",
|
|
431
|
-
"enum": [
|
|
432
|
-
"websocket",
|
|
433
|
-
"webhook"
|
|
434
|
-
]
|
|
435
|
-
},
|
|
436
|
-
"renderMode": {
|
|
437
|
-
"type": "string",
|
|
438
|
-
"enum": [
|
|
439
|
-
"auto",
|
|
440
|
-
"raw",
|
|
441
|
-
"card"
|
|
442
|
-
]
|
|
443
|
-
},
|
|
444
|
-
"streaming": {
|
|
445
|
-
"$ref": "#/$defs/streaming"
|
|
446
|
-
},
|
|
447
|
-
"replyInThread": {
|
|
448
|
-
"type": "string",
|
|
449
|
-
"enum": [
|
|
450
|
-
"disabled",
|
|
451
|
-
"enabled"
|
|
452
|
-
]
|
|
453
|
-
},
|
|
454
|
-
"allowBots": {
|
|
455
|
-
"type": "boolean"
|
|
456
|
-
},
|
|
457
|
-
"vcAutoJoin": {
|
|
458
|
-
"type": "boolean"
|
|
459
|
-
},
|
|
460
|
-
"typingIndicator": {
|
|
461
|
-
"type": "boolean"
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
"properties": {
|
|
467
|
-
"enabled": {
|
|
468
|
-
"type": "boolean"
|
|
469
|
-
},
|
|
470
|
-
"defaultAccount": {
|
|
471
|
-
"type": "string"
|
|
472
|
-
},
|
|
473
|
-
"appId": {
|
|
474
|
-
"type": "string"
|
|
475
|
-
},
|
|
476
|
-
"appSecret": {
|
|
477
|
-
"$ref": "#/$defs/secretInput"
|
|
478
|
-
},
|
|
479
|
-
"encryptKey": {
|
|
480
|
-
"$ref": "#/$defs/secretInput"
|
|
481
|
-
},
|
|
482
|
-
"verificationToken": {
|
|
483
|
-
"$ref": "#/$defs/secretInput"
|
|
484
|
-
},
|
|
485
|
-
"domain": {
|
|
486
|
-
"anyOf": [
|
|
487
|
-
{
|
|
488
|
-
"type": "string",
|
|
489
|
-
"enum": [
|
|
490
|
-
"feishu",
|
|
491
|
-
"lark"
|
|
492
|
-
]
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
"type": "string",
|
|
496
|
-
"format": "uri"
|
|
497
|
-
}
|
|
498
|
-
]
|
|
499
|
-
},
|
|
500
|
-
"connectionMode": {
|
|
501
|
-
"type": "string",
|
|
502
|
-
"enum": [
|
|
503
|
-
"websocket",
|
|
504
|
-
"webhook"
|
|
505
|
-
]
|
|
506
|
-
},
|
|
507
|
-
"renderMode": {
|
|
508
|
-
"type": "string",
|
|
509
|
-
"enum": [
|
|
510
|
-
"auto",
|
|
511
|
-
"raw",
|
|
512
|
-
"card"
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
"streaming": {
|
|
516
|
-
"$ref": "#/$defs/streaming"
|
|
517
|
-
},
|
|
518
|
-
"replyInThread": {
|
|
519
|
-
"type": "string",
|
|
520
|
-
"enum": [
|
|
521
|
-
"disabled",
|
|
522
|
-
"enabled"
|
|
523
|
-
]
|
|
524
|
-
},
|
|
525
|
-
"allowBots": {
|
|
526
|
-
"type": "boolean"
|
|
527
|
-
},
|
|
528
|
-
"vcAutoJoin": {
|
|
529
|
-
"type": "boolean"
|
|
530
|
-
},
|
|
531
|
-
"typingIndicator": {
|
|
532
|
-
"type": "boolean"
|
|
533
|
-
},
|
|
534
|
-
"accounts": {
|
|
535
|
-
"type": "object",
|
|
536
|
-
"additionalProperties": {
|
|
537
|
-
"$ref": "#/$defs/account"
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
305
|
+
"additionalProperties": false,
|
|
306
|
+
"properties": {}
|
|
541
307
|
},
|
|
542
308
|
"channelConfigs": {
|
|
543
309
|
"feishu": {
|
|
@@ -551,6 +317,31 @@
|
|
|
551
317
|
"defaultAccount": {
|
|
552
318
|
"type": "string"
|
|
553
319
|
},
|
|
320
|
+
"stickerSets": {
|
|
321
|
+
"type": "object",
|
|
322
|
+
"propertyNames": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"pattern": "^(?!\\s)(?![\\s\\S]*\\s$)[^\\p{Cs}]{1,128}$"
|
|
325
|
+
},
|
|
326
|
+
"additionalProperties": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"propertyNames": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"pattern": "^(?!\\s)(?![\\s\\S]*\\s$)(?![\\s\\S]*\\.\\.)[^\\p{Cc}\\p{Cs}/\\\\]{1,512}$"
|
|
331
|
+
},
|
|
332
|
+
"additionalProperties": {
|
|
333
|
+
"minItems": 1,
|
|
334
|
+
"maxItems": 8,
|
|
335
|
+
"type": "array",
|
|
336
|
+
"items": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"pattern": "^(?!\\s)(?![\\s\\S]*\\s$)[^\\p{Cs}]{1,64}$"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"maxProperties": 256
|
|
342
|
+
},
|
|
343
|
+
"maxProperties": 32
|
|
344
|
+
},
|
|
554
345
|
"appId": {
|
|
555
346
|
"type": "string"
|
|
556
347
|
},
|
|
@@ -870,7 +661,7 @@
|
|
|
870
661
|
{
|
|
871
662
|
"type": "string",
|
|
872
663
|
"format": "uri",
|
|
873
|
-
"pattern": "^
|
|
664
|
+
"pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/"
|
|
874
665
|
}
|
|
875
666
|
]
|
|
876
667
|
},
|
|
@@ -925,6 +716,14 @@
|
|
|
925
716
|
"configWrites": {
|
|
926
717
|
"type": "boolean"
|
|
927
718
|
},
|
|
719
|
+
"contextVisibility": {
|
|
720
|
+
"type": "string",
|
|
721
|
+
"enum": [
|
|
722
|
+
"all",
|
|
723
|
+
"allowlist",
|
|
724
|
+
"allowlist_quote"
|
|
725
|
+
]
|
|
726
|
+
},
|
|
928
727
|
"replyToMode": {
|
|
929
728
|
"anyOf": [
|
|
930
729
|
{
|
|
@@ -1732,7 +1531,7 @@
|
|
|
1732
1531
|
{
|
|
1733
1532
|
"type": "string",
|
|
1734
1533
|
"format": "uri",
|
|
1735
|
-
"pattern": "^
|
|
1534
|
+
"pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/"
|
|
1736
1535
|
}
|
|
1737
1536
|
]
|
|
1738
1537
|
},
|
|
@@ -1785,6 +1584,14 @@
|
|
|
1785
1584
|
"configWrites": {
|
|
1786
1585
|
"type": "boolean"
|
|
1787
1586
|
},
|
|
1587
|
+
"contextVisibility": {
|
|
1588
|
+
"type": "string",
|
|
1589
|
+
"enum": [
|
|
1590
|
+
"all",
|
|
1591
|
+
"allowlist",
|
|
1592
|
+
"allowlist_quote"
|
|
1593
|
+
]
|
|
1594
|
+
},
|
|
1788
1595
|
"replyToMode": {
|
|
1789
1596
|
"anyOf": [
|
|
1790
1597
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.2",
|
|
4
4
|
"description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"mdast-util-from-markdown": "2.0.3",
|
|
13
13
|
"mdast-util-gfm-table": "2.0.0",
|
|
14
14
|
"micromark-extension-gfm-table": "2.1.1",
|
|
15
|
-
"typebox": "1.3.
|
|
15
|
+
"typebox": "1.3.18",
|
|
16
16
|
"zod": "4.4.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.9.
|
|
19
|
+
"openclaw": ">=2026.9.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -62,10 +62,11 @@
|
|
|
62
62
|
"minHostVersion": ">=2026.5.29"
|
|
63
63
|
},
|
|
64
64
|
"compat": {
|
|
65
|
-
"pluginApi": ">=2026.9.
|
|
65
|
+
"pluginApi": ">=2026.9.2"
|
|
66
66
|
},
|
|
67
67
|
"build": {
|
|
68
|
-
"
|
|
68
|
+
"bundledDist": false,
|
|
69
|
+
"openclawVersion": "2026.9.2"
|
|
69
70
|
},
|
|
70
71
|
"release": {
|
|
71
72
|
"publishToClawHub": true,
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { asObjectRecord, defineChannelAliasMigration, defineKeyMoveMigration, hasLegacyAccountStreamingAliases, normalizeChannelConfigEntries } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
2
|
-
//#region extensions/feishu/src/webhook-path.ts
|
|
3
|
-
const DEFAULT_FEISHU_WEBHOOK_PATH = "/feishu/events";
|
|
4
|
-
/** Normalize trusted configuration only; incoming request targets must remain unmodified. */
|
|
5
|
-
function normalizeFeishuWebhookPath(value) {
|
|
6
|
-
const configured = value?.trim();
|
|
7
|
-
if (!configured) return DEFAULT_FEISHU_WEBHOOK_PATH;
|
|
8
|
-
try {
|
|
9
|
-
const parsed = new URL(configured, "http://localhost");
|
|
10
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
11
|
-
const emptyQuery = !parsed.search && parsed.href.endsWith("?") && !configured.includes("#") ? "?" : "";
|
|
12
|
-
return `${parsed.pathname}${parsed.search}${emptyQuery}`;
|
|
13
|
-
} catch {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region extensions/feishu/src/doctor-contract.ts
|
|
19
|
-
const streamingAliasMigration = defineChannelAliasMigration({
|
|
20
|
-
channelId: "feishu",
|
|
21
|
-
streaming: { defaultMode: "partial" },
|
|
22
|
-
accountStreamingReplacesRoot: true
|
|
23
|
-
});
|
|
24
|
-
const LEGACY_COALESCE_FIELDS = [
|
|
25
|
-
"enabled",
|
|
26
|
-
"minDelayMs",
|
|
27
|
-
"maxDelayMs"
|
|
28
|
-
];
|
|
29
|
-
const LEGACY_HEARTBEAT_FIELDS = ["visibility", "intervalMs"];
|
|
30
|
-
const toolsBaseMigration = defineKeyMoveMigration({
|
|
31
|
-
from: ["tools", "base"],
|
|
32
|
-
to: ["tools", "bitable"],
|
|
33
|
-
match: (value) => typeof value === "boolean",
|
|
34
|
-
sourceOwn: false
|
|
35
|
-
});
|
|
36
|
-
function sanitizeLegacyHeartbeatFields(params) {
|
|
37
|
-
const heartbeat = asObjectRecord(params.entry.heartbeat);
|
|
38
|
-
if (!heartbeat || Object.keys(heartbeat).length > 0 && !LEGACY_HEARTBEAT_FIELDS.some((field) => Object.hasOwn(heartbeat, field))) return {
|
|
39
|
-
entry: params.entry,
|
|
40
|
-
changed: false
|
|
41
|
-
};
|
|
42
|
-
const next = { ...params.entry };
|
|
43
|
-
delete next.heartbeat;
|
|
44
|
-
params.changes.push(`Removed ${params.pathPrefix}.heartbeat (legacy Feishu fields were never read by runtime).`);
|
|
45
|
-
return {
|
|
46
|
-
entry: next,
|
|
47
|
-
changed: true
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function sanitizeLegacyCoalesceFields(params) {
|
|
51
|
-
const streaming = asObjectRecord(params.entry.streaming);
|
|
52
|
-
const block = asObjectRecord(streaming?.block);
|
|
53
|
-
const coalesce = asObjectRecord(block?.coalesce);
|
|
54
|
-
if (!streaming || !block || !coalesce) return {
|
|
55
|
-
entry: params.entry,
|
|
56
|
-
changed: false
|
|
57
|
-
};
|
|
58
|
-
const removed = LEGACY_COALESCE_FIELDS.filter((field) => coalesce[field] !== void 0);
|
|
59
|
-
if (removed.length === 0) return {
|
|
60
|
-
entry: params.entry,
|
|
61
|
-
changed: false
|
|
62
|
-
};
|
|
63
|
-
const nextCoalesce = { ...coalesce };
|
|
64
|
-
for (const field of removed) delete nextCoalesce[field];
|
|
65
|
-
params.changes.push(`Removed ${params.pathPrefix}.streaming.block.coalesce.{${removed.join(",")}} (legacy Feishu-only fields; block delivery reads minChars/maxChars/idleMs).`);
|
|
66
|
-
return {
|
|
67
|
-
entry: {
|
|
68
|
-
...params.entry,
|
|
69
|
-
streaming: {
|
|
70
|
-
...streaming,
|
|
71
|
-
block: {
|
|
72
|
-
...block,
|
|
73
|
-
coalesce: nextCoalesce
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
changed: true
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function hasLegacyWebhookPath(value) {
|
|
81
|
-
const path = asObjectRecord(value)?.webhookPath;
|
|
82
|
-
return typeof path === "string" && normalizeFeishuWebhookPath(path) !== path;
|
|
83
|
-
}
|
|
84
|
-
function normalizeLegacyWebhookPath(params) {
|
|
85
|
-
const path = params.entry.webhookPath;
|
|
86
|
-
if (typeof path !== "string") return {
|
|
87
|
-
entry: params.entry,
|
|
88
|
-
changed: false
|
|
89
|
-
};
|
|
90
|
-
const normalized = normalizeFeishuWebhookPath(path);
|
|
91
|
-
const canonical = normalized ?? "/feishu/events";
|
|
92
|
-
if (canonical === path) return {
|
|
93
|
-
entry: params.entry,
|
|
94
|
-
changed: false
|
|
95
|
-
};
|
|
96
|
-
params.changes.push(normalized === null ? `Reset invalid ${params.pathPrefix}.webhookPath to ${DEFAULT_FEISHU_WEBHOOK_PATH}.` : `Normalized ${params.pathPrefix}.webhookPath to its HTTP request path.`);
|
|
97
|
-
return {
|
|
98
|
-
entry: {
|
|
99
|
-
...params.entry,
|
|
100
|
-
webhookPath: canonical
|
|
101
|
-
},
|
|
102
|
-
changed: true
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function normalizeFeishuLegacyConfigEntries(cfg, changes) {
|
|
106
|
-
return normalizeChannelConfigEntries({
|
|
107
|
-
cfg,
|
|
108
|
-
channelId: "feishu",
|
|
109
|
-
changes,
|
|
110
|
-
normalizeEntry: (params) => {
|
|
111
|
-
const tools = toolsBaseMigration.normalize(params);
|
|
112
|
-
const coalesce = sanitizeLegacyCoalesceFields({
|
|
113
|
-
...params,
|
|
114
|
-
entry: tools.entry
|
|
115
|
-
});
|
|
116
|
-
const heartbeat = sanitizeLegacyHeartbeatFields({
|
|
117
|
-
...params,
|
|
118
|
-
entry: coalesce.entry
|
|
119
|
-
});
|
|
120
|
-
const webhook = normalizeLegacyWebhookPath({
|
|
121
|
-
...params,
|
|
122
|
-
entry: heartbeat.entry
|
|
123
|
-
});
|
|
124
|
-
return {
|
|
125
|
-
entry: webhook.entry,
|
|
126
|
-
changed: tools.changed || coalesce.changed || heartbeat.changed || webhook.changed
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}).config;
|
|
130
|
-
}
|
|
131
|
-
const legacyConfigRules = [
|
|
132
|
-
...streamingAliasMigration.legacyConfigRules,
|
|
133
|
-
{
|
|
134
|
-
path: ["channels", "feishu"],
|
|
135
|
-
message: "channels.feishu[.accounts.<id>].webhookPath must be a canonical HTTP request path; run \"openclaw doctor --fix\".",
|
|
136
|
-
match: (value) => {
|
|
137
|
-
const entry = asObjectRecord(value);
|
|
138
|
-
return hasLegacyWebhookPath(entry) || hasLegacyAccountStreamingAliases(entry?.accounts, hasLegacyWebhookPath);
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
path: ["channels", "feishu"],
|
|
143
|
-
message: "channels.feishu[.accounts.<id>].tools.base is legacy; use tools.bitable. Run \"openclaw doctor --fix\".",
|
|
144
|
-
match: (value) => {
|
|
145
|
-
const entry = asObjectRecord(value);
|
|
146
|
-
return toolsBaseMigration.hasLegacy(entry) || hasLegacyAccountStreamingAliases(entry?.accounts, toolsBaseMigration.hasLegacy);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
|
-
function normalizeCompatibilityConfig({ cfg }) {
|
|
151
|
-
const aliases = streamingAliasMigration.normalizeChannelConfig({ cfg });
|
|
152
|
-
return {
|
|
153
|
-
config: normalizeFeishuLegacyConfigEntries(aliases.config, aliases.changes),
|
|
154
|
-
changes: aliases.changes
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
export { normalizeFeishuWebhookPath as i, normalizeCompatibilityConfig as n, DEFAULT_FEISHU_WEBHOOK_PATH as r, legacyConfigRules as t };
|
package/dist/monitor-BRg3sHH7.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-RwSyseKr.js";
|
|
2
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor.startup-D-gL82OO.js";
|
|
3
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
|
-
//#region extensions/feishu/src/monitor.ts
|
|
5
|
-
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-DhhotI_Q.js"));
|
|
6
|
-
async function monitorFeishuProvider(opts = {}) {
|
|
7
|
-
const cfg = opts.config;
|
|
8
|
-
if (!cfg) throw new Error("Config is required for Feishu monitor");
|
|
9
|
-
const log = opts.runtime?.log ?? console.log;
|
|
10
|
-
if (opts.accountId) {
|
|
11
|
-
const account = resolveFeishuRuntimeAccount({
|
|
12
|
-
cfg,
|
|
13
|
-
accountId: opts.accountId
|
|
14
|
-
}, { requireEventSecrets: true });
|
|
15
|
-
if (!account.enabled || !account.configured) throw new Error(`Feishu account "${opts.accountId}" not configured or disabled`);
|
|
16
|
-
const { monitorSingleAccount } = await loadMonitorAccountRuntime();
|
|
17
|
-
return monitorSingleAccount({
|
|
18
|
-
cfg,
|
|
19
|
-
account,
|
|
20
|
-
channelRuntime: opts.channelRuntime,
|
|
21
|
-
runtime: opts.runtime,
|
|
22
|
-
abortSignal: opts.abortSignal,
|
|
23
|
-
...opts.statusSink ? { statusSink: opts.statusSink } : {}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const accounts = listEnabledFeishuAccounts(cfg);
|
|
27
|
-
if (accounts.length === 0) throw new Error("No enabled Feishu accounts configured");
|
|
28
|
-
log(`feishu: starting ${accounts.length} account(s): ${accounts.map((a) => a.accountId).join(", ")}`);
|
|
29
|
-
const { monitorSingleAccount } = await loadMonitorAccountRuntime();
|
|
30
|
-
const monitorPromises = [];
|
|
31
|
-
for (const account of accounts) {
|
|
32
|
-
if (opts.abortSignal?.aborted) {
|
|
33
|
-
log("feishu: abort signal received during startup preflight; stopping startup");
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
const { botOpenId, botName, source } = await fetchBotIdentityForMonitor(account, {
|
|
37
|
-
runtime: opts.runtime,
|
|
38
|
-
abortSignal: opts.abortSignal
|
|
39
|
-
});
|
|
40
|
-
if (opts.abortSignal?.aborted) {
|
|
41
|
-
log("feishu: abort signal received during startup preflight; stopping startup");
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
monitorPromises.push(monitorSingleAccount({
|
|
45
|
-
cfg,
|
|
46
|
-
account,
|
|
47
|
-
channelRuntime: opts.channelRuntime,
|
|
48
|
-
runtime: opts.runtime,
|
|
49
|
-
abortSignal: opts.abortSignal,
|
|
50
|
-
botOpenIdSource: {
|
|
51
|
-
kind: "prefetched",
|
|
52
|
-
botOpenId,
|
|
53
|
-
botName,
|
|
54
|
-
source
|
|
55
|
-
},
|
|
56
|
-
...opts.statusSink ? { statusSink: opts.statusSink } : {}
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
await Promise.all(monitorPromises);
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
export { monitorFeishuProvider };
|