@ai-setting/roy-agent-core 1.7.67 → 1.7.68
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/env/event-source/event-source-handlers.js +4 -4
- package/dist/env/event-source/index.js +5 -5
- package/dist/env/index.js +6 -6
- package/dist/env/task/plugins/index.js +2 -2
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +77 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.js +7 -1
- package/dist/env/workflow/plugins/index.js +2 -2
- package/dist/index.js +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-k4ps1hxp.js → roy-agent-core-19na22cc.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-8zas6w5q.js → roy-agent-core-43r4bxey.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0ys85x46.js → roy-agent-core-8bjj3d1b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-b7jbqfsy.js → roy-agent-core-keyb45z3.js} +2 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zk2jg0v7.js → roy-agent-core-tadj19vp.js} +106 -22
- package/dist/shared/@ai-setting/{roy-agent-core-1kxf910n.js → roy-agent-core-x0ddc2cr.js} +1 -1
- package/package.json +1 -1
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
patchCardByLarkCli,
|
|
12
12
|
renderRuleNoticeSection,
|
|
13
13
|
timerHandler
|
|
14
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "../../shared/@ai-setting/roy-agent-core-19na22cc.js";
|
|
15
15
|
import"../../shared/@ai-setting/roy-agent-core-bxkjk7zx.js";
|
|
16
16
|
import"../../shared/@ai-setting/roy-agent-core-add1zqsh.js";
|
|
17
17
|
import {
|
|
18
18
|
cliCommandHandler
|
|
19
19
|
} from "../../shared/@ai-setting/roy-agent-core-v0hf14bj.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-tm1mxttk.js";
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-keyb45z3.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-na18zwj0.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-abqhkbn3.js";
|
|
24
24
|
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
25
25
|
import"../../shared/@ai-setting/roy-agent-core-ma35jyd9.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
27
27
|
import"../../shared/@ai-setting/roy-agent-core-6m4bw8jy.js";
|
|
28
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
29
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
28
|
+
import"../../shared/@ai-setting/roy-agent-core-8bjj3d1b.js";
|
|
29
|
+
import"../../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
30
30
|
import"../../shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
31
31
|
import"../../shared/@ai-setting/roy-agent-core-yr1mryb8.js";
|
|
32
32
|
import"../../shared/@ai-setting/roy-agent-core-mds8tqd0.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import"../../shared/@ai-setting/roy-agent-core-b4x6x4k2.js";
|
|
2
2
|
import {
|
|
3
3
|
EventSourceComponent
|
|
4
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "../../shared/@ai-setting/roy-agent-core-x0ddc2cr.js";
|
|
5
5
|
import {
|
|
6
6
|
BountyIMInstance,
|
|
7
7
|
COMMAND_PREFIX,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
timerHandler,
|
|
34
34
|
translateCardActionToCommand,
|
|
35
35
|
writeFallbackModelList
|
|
36
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
36
|
+
} from "../../shared/@ai-setting/roy-agent-core-19na22cc.js";
|
|
37
37
|
import {
|
|
38
38
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
39
39
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
parseCliSessionChatId
|
|
53
53
|
} from "../../shared/@ai-setting/roy-agent-core-v0hf14bj.js";
|
|
54
54
|
import"../../shared/@ai-setting/roy-agent-core-tm1mxttk.js";
|
|
55
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
55
|
+
import"../../shared/@ai-setting/roy-agent-core-keyb45z3.js";
|
|
56
56
|
import {
|
|
57
57
|
EventStoreImpl,
|
|
58
58
|
getSharedEventStore,
|
|
@@ -64,8 +64,8 @@ import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
|
64
64
|
import"../../shared/@ai-setting/roy-agent-core-ma35jyd9.js";
|
|
65
65
|
import"../../shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
66
66
|
import"../../shared/@ai-setting/roy-agent-core-6m4bw8jy.js";
|
|
67
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
68
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
67
|
+
import"../../shared/@ai-setting/roy-agent-core-8bjj3d1b.js";
|
|
68
|
+
import"../../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
69
69
|
import"../../shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
70
70
|
import"../../shared/@ai-setting/roy-agent-core-yr1mryb8.js";
|
|
71
71
|
import"../../shared/@ai-setting/roy-agent-core-mds8tqd0.js";
|
package/dist/env/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseEnvironment
|
|
3
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-43r4bxey.js";
|
|
4
4
|
import {
|
|
5
5
|
TaskComponent
|
|
6
6
|
} from "../shared/@ai-setting/roy-agent-core-1k83dq3a.js";
|
|
@@ -14,11 +14,11 @@ import"../shared/@ai-setting/roy-agent-core-h5vmff8w.js";
|
|
|
14
14
|
import"../shared/@ai-setting/roy-agent-core-p5cz9m8v.js";
|
|
15
15
|
import {
|
|
16
16
|
EventSourceComponent
|
|
17
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
} from "../shared/@ai-setting/roy-agent-core-x0ddc2cr.js";
|
|
18
18
|
import {
|
|
19
19
|
builtInHandlers,
|
|
20
20
|
larkCliHandler
|
|
21
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
21
|
+
} from "../shared/@ai-setting/roy-agent-core-19na22cc.js";
|
|
22
22
|
import {
|
|
23
23
|
EventSourceInitHooks,
|
|
24
24
|
getDefaultConfigForType,
|
|
@@ -29,15 +29,15 @@ import {
|
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-add1zqsh.js";
|
|
30
30
|
import"../shared/@ai-setting/roy-agent-core-v0hf14bj.js";
|
|
31
31
|
import"../shared/@ai-setting/roy-agent-core-tm1mxttk.js";
|
|
32
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
32
|
+
import"../shared/@ai-setting/roy-agent-core-keyb45z3.js";
|
|
33
33
|
import"../shared/@ai-setting/roy-agent-core-na18zwj0.js";
|
|
34
34
|
import"../shared/@ai-setting/roy-agent-core-abqhkbn3.js";
|
|
35
35
|
import"../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
36
36
|
import"../shared/@ai-setting/roy-agent-core-ma35jyd9.js";
|
|
37
37
|
import"../shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
38
38
|
import"../shared/@ai-setting/roy-agent-core-6m4bw8jy.js";
|
|
39
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
40
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
39
|
+
import"../shared/@ai-setting/roy-agent-core-8bjj3d1b.js";
|
|
40
|
+
import"../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
41
41
|
import {
|
|
42
42
|
WorkflowComponent
|
|
43
43
|
} from "../shared/@ai-setting/roy-agent-core-37tj4y6a.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
formatExtractorInput,
|
|
14
14
|
formatExtractorInputFromDescription,
|
|
15
15
|
parseExtractorOutput
|
|
16
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
} from "../../../shared/@ai-setting/roy-agent-core-keyb45z3.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-na18zwj0.js";
|
|
18
18
|
import"../../../shared/@ai-setting/roy-agent-core-abqhkbn3.js";
|
|
19
19
|
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
renderWorkflowInfoLines,
|
|
39
39
|
resolveTaskTitleForDisplay,
|
|
40
40
|
sanitizeInlineText
|
|
41
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
41
|
+
} from "../../../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
42
42
|
import"../../../shared/@ai-setting/roy-agent-core-yr1mryb8.js";
|
|
43
43
|
import"../../../shared/@ai-setting/roy-agent-core-mds8tqd0.js";
|
|
44
44
|
import"../../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
@@ -206,6 +206,14 @@ export interface FinishTaskOptions {
|
|
|
206
206
|
* 否则归档任务的卡片会误显示"已暂停"。
|
|
207
207
|
*/
|
|
208
208
|
pausedMilestoneTitle?: string;
|
|
209
|
+
/**
|
|
210
|
+
* 是否展开"执行动态"折叠面板(覆盖按 status 推导的默认值)
|
|
211
|
+
*
|
|
212
|
+
* ★ xval MINOR-2:`status` = "stopped" 时无法区分 task 的 paused(可 resume,
|
|
213
|
+
* 非终态 → 折叠)与 archived(终态 → 展开)。调用方(知道原始 task.status
|
|
214
|
+
* 的那层)显式传入即可覆盖。
|
|
215
|
+
*/
|
|
216
|
+
expandTimeline?: boolean;
|
|
209
217
|
}
|
|
210
218
|
export interface StartTaskResult {
|
|
211
219
|
messageId: string;
|
|
@@ -372,6 +380,53 @@ export declare function resolveTaskTitleForDisplay(opts: {
|
|
|
372
380
|
* ★ 用户要求:卡片里不要出现 JSON。
|
|
373
381
|
*/
|
|
374
382
|
export declare function humanizeValue(value: unknown, maxLen?: number): string;
|
|
383
|
+
/**
|
|
384
|
+
* 判断"执行动态"折叠面板在初始状态下是否**展开**
|
|
385
|
+
*
|
|
386
|
+
* ★ Task #4845:运行中默认折叠(避免刷屏),真终态自动展开
|
|
387
|
+
* —— 用户在任务结束时最关心的就是「最后做了什么」,
|
|
388
|
+
* 不该还要再点一次折叠面板才能看到。
|
|
389
|
+
*
|
|
390
|
+
* ★ xval MINOR-2:`stopped`(= task.status=paused)**不展开**。
|
|
391
|
+
* paused 是可 resume 的高频非终态(max-iteration reminder / 用户 stop
|
|
392
|
+
* 都会走 pauseTask),展开反而正是用户抱怨的"刷屏"场景。
|
|
393
|
+
* 这里与仓库自身终态集合(lark-cli-task-notify-plugin.isTerminalTaskStatus)
|
|
394
|
+
* 保持一致:completed / failed / cancelled / deleted 才算"收尾"。
|
|
395
|
+
*/
|
|
396
|
+
export declare function isTerminalStatusForTimeline(status: CardStatus): boolean;
|
|
397
|
+
/**
|
|
398
|
+
* 判断 **workflow** 卡片的"执行动态"面板是否展开
|
|
399
|
+
*
|
|
400
|
+
* ★ xval MINOR-2:workflow 的 "stopped" 是**真终态**(run 结束 → 卡片 unpin、
|
|
401
|
+
* 状态清除、不会 resume),与 task 侧 "stopped"(= paused,可 resume)语义相反。
|
|
402
|
+
* 所以 workflow 不能复用 task 的判定:workflow 只要不是 running 就展开。
|
|
403
|
+
*/
|
|
404
|
+
export declare function isTerminalStatusForWorkflowTimeline(status: WorkflowCardStatus): boolean;
|
|
405
|
+
/**
|
|
406
|
+
* 构造飞书卡片 2.0 的**折叠面板**(collapsible_panel)
|
|
407
|
+
*
|
|
408
|
+
* ★ Task #4845:用户反馈「这些是不是可以默认折叠起来,比较干扰阅读」
|
|
409
|
+
* —— 群里「📊 Task 实时更新」卡片满屏任务元信息 + 里程碑时间线,干扰群聊阅读。
|
|
410
|
+
*
|
|
411
|
+
* 飞书卡片 2.0 **原生**支持折叠面板(官方文档:
|
|
412
|
+
* open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/collapsible-panel
|
|
413
|
+
* ),关键契约:
|
|
414
|
+
* - `tag: "collapsible_panel"`
|
|
415
|
+
* - `header.title.content` = 面板标题(折叠时唯一可见的文字)
|
|
416
|
+
* - `elements` = 面板内的子组件数组(markdown / hr / …)
|
|
417
|
+
* - `expanded` = 是否展开,**默认 false**(默认折叠)
|
|
418
|
+
*
|
|
419
|
+
* @param title 面板标题(折叠状态下用户看到的唯一文字)
|
|
420
|
+
* @param elements 面板内子组件
|
|
421
|
+
* @param expanded 是否默认展开(默认 false = 折叠)
|
|
422
|
+
* @param elementId 面板唯一 id(JSON 2.0;同一张卡片内全局唯一)
|
|
423
|
+
*/
|
|
424
|
+
export declare function buildCollapsiblePanel(opts: {
|
|
425
|
+
title: string;
|
|
426
|
+
elements: Array<Record<string, any>>;
|
|
427
|
+
expanded?: boolean;
|
|
428
|
+
elementId?: string;
|
|
429
|
+
}): Record<string, any>;
|
|
375
430
|
/**
|
|
376
431
|
* 渲染"任务栏位"区块(用户验收要求的第一块)
|
|
377
432
|
*
|
|
@@ -419,6 +474,20 @@ export declare function buildTaskCard(opts: {
|
|
|
419
474
|
progress?: number;
|
|
420
475
|
updateCount?: number;
|
|
421
476
|
spinner?: string;
|
|
477
|
+
/**
|
|
478
|
+
* 是否展开"执行动态"折叠面板(覆盖按 status 推导的默认值)
|
|
479
|
+
*
|
|
480
|
+
* ★ xval MINOR-2:task.status=paused 与 archived 都映射成 CardStatus
|
|
481
|
+
* "stopped",但语义不同:
|
|
482
|
+
* - paused = 可 resume 的**非终态** → 时间线保持折叠(避免刷屏)
|
|
483
|
+
* - archived = **终态**(归档后不再有进展)→ 时间线应展开
|
|
484
|
+
* 卡片状态本身无法区分二者,所以由调用方(知道原始 task.status 的那层)
|
|
485
|
+
* 显式传 true/false 覆盖。
|
|
486
|
+
*
|
|
487
|
+
* 不传 → 按 status 推导(completed/failed/cancelled/deleted 展开,
|
|
488
|
+
* running/stopped 折叠)。
|
|
489
|
+
*/
|
|
490
|
+
expandTimeline?: boolean;
|
|
422
491
|
}): CardPayload;
|
|
423
492
|
/**
|
|
424
493
|
* 生成"打开飞书群"的 app link(Task #4230 follow-up 修复)
|
|
@@ -482,6 +551,14 @@ export declare function buildWorkflowCard(opts: {
|
|
|
482
551
|
error?: string;
|
|
483
552
|
updateCount?: number;
|
|
484
553
|
spinner?: string;
|
|
554
|
+
/**
|
|
555
|
+
* 是否展开"执行动态"折叠面板(覆盖按 status 推导的默认值)
|
|
556
|
+
*
|
|
557
|
+
* ★ xval MINOR-2:workflow 的 "stopped" 是**真终态**(run 结束、卡片 unpin、
|
|
558
|
+
* 状态清除),与 task 的 paused(可 resume)语义不同 → workflow 侧
|
|
559
|
+
* stopped 必须展开时间线,否则用户看不到 run 停在哪一步。
|
|
560
|
+
*/
|
|
561
|
+
expandTimeline?: boolean;
|
|
485
562
|
}): CardPayload;
|
|
486
563
|
/**
|
|
487
564
|
* 卡片状态的对外快照(Task #4536)
|
|
@@ -2,12 +2,15 @@ import {
|
|
|
2
2
|
DEFAULT_APP_LINK_BASE,
|
|
3
3
|
LarkCardPatchNotifier,
|
|
4
4
|
buildChatAppLink,
|
|
5
|
+
buildCollapsiblePanel,
|
|
5
6
|
buildTaskCard,
|
|
6
7
|
buildWorkflowCard,
|
|
7
8
|
formatDateTimeForDisplay,
|
|
8
9
|
formatDurationMs,
|
|
9
10
|
formatTimestampForDisplay,
|
|
10
11
|
humanizeValue,
|
|
12
|
+
isTerminalStatusForTimeline,
|
|
13
|
+
isTerminalStatusForWorkflowTimeline,
|
|
11
14
|
renderContextAsLines,
|
|
12
15
|
renderMilestones,
|
|
13
16
|
renderProcessSteps,
|
|
@@ -16,7 +19,7 @@ import {
|
|
|
16
19
|
renderWorkflowInfoLines,
|
|
17
20
|
resolveTaskTitleForDisplay,
|
|
18
21
|
sanitizeInlineText
|
|
19
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
22
|
+
} from "../../../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
20
23
|
import"../../../shared/@ai-setting/roy-agent-core-qq96p0tj.js";
|
|
21
24
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
22
25
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
@@ -30,12 +33,15 @@ export {
|
|
|
30
33
|
renderProcessSteps,
|
|
31
34
|
renderMilestones,
|
|
32
35
|
renderContextAsLines,
|
|
36
|
+
isTerminalStatusForWorkflowTimeline,
|
|
37
|
+
isTerminalStatusForTimeline,
|
|
33
38
|
humanizeValue,
|
|
34
39
|
formatTimestampForDisplay,
|
|
35
40
|
formatDurationMs,
|
|
36
41
|
formatDateTimeForDisplay,
|
|
37
42
|
buildWorkflowCard,
|
|
38
43
|
buildTaskCard,
|
|
44
|
+
buildCollapsiblePanel,
|
|
39
45
|
buildChatAppLink,
|
|
40
46
|
LarkCardPatchNotifier,
|
|
41
47
|
DEFAULT_APP_LINK_BASE
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LarkCliWorkflowNotifyHook,
|
|
3
3
|
createLarkCliWorkflowNotifyHook
|
|
4
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
5
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "../../../shared/@ai-setting/roy-agent-core-8bjj3d1b.js";
|
|
5
|
+
import"../../../shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
6
6
|
import"../../../shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-ax9e9szb.js";
|
|
8
8
|
import"../../../shared/@ai-setting/roy-agent-core-cpcd24n2.js";
|
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
BaseEnvironment,
|
|
62
62
|
generateDescendingId,
|
|
63
63
|
generateId
|
|
64
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
64
|
+
} from "./shared/@ai-setting/roy-agent-core-43r4bxey.js";
|
|
65
65
|
import {
|
|
66
66
|
TaskComponent
|
|
67
67
|
} from "./shared/@ai-setting/roy-agent-core-1k83dq3a.js";
|
|
@@ -75,7 +75,7 @@ import"./shared/@ai-setting/roy-agent-core-h5vmff8w.js";
|
|
|
75
75
|
import"./shared/@ai-setting/roy-agent-core-p5cz9m8v.js";
|
|
76
76
|
import {
|
|
77
77
|
EventSourceComponent
|
|
78
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
78
|
+
} from "./shared/@ai-setting/roy-agent-core-x0ddc2cr.js";
|
|
79
79
|
import {
|
|
80
80
|
BountyIMInstance,
|
|
81
81
|
COMMAND_PREFIX,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
timerHandler,
|
|
108
108
|
translateCardActionToCommand,
|
|
109
109
|
writeFallbackModelList
|
|
110
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
110
|
+
} from "./shared/@ai-setting/roy-agent-core-19na22cc.js";
|
|
111
111
|
import {
|
|
112
112
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
113
113
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
import {
|
|
133
133
|
TaskTagPlugin,
|
|
134
134
|
createAutoTaskPlugin
|
|
135
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
135
|
+
} from "./shared/@ai-setting/roy-agent-core-keyb45z3.js";
|
|
136
136
|
import {
|
|
137
137
|
EventStoreImpl,
|
|
138
138
|
getSharedEventStore,
|
|
@@ -152,8 +152,8 @@ import {
|
|
|
152
152
|
} from "./shared/@ai-setting/roy-agent-core-ma35jyd9.js";
|
|
153
153
|
import"./shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
154
154
|
import"./shared/@ai-setting/roy-agent-core-6m4bw8jy.js";
|
|
155
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
156
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
155
|
+
import"./shared/@ai-setting/roy-agent-core-8bjj3d1b.js";
|
|
156
|
+
import"./shared/@ai-setting/roy-agent-core-tadj19vp.js";
|
|
157
157
|
import {
|
|
158
158
|
WorkflowComponent
|
|
159
159
|
} from "./shared/@ai-setting/roy-agent-core-37tj4y6a.js";
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
createPerTaskGroupChatPlugin,
|
|
14
14
|
extractPerTaskChatId,
|
|
15
15
|
extractPerTaskChatName
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-keyb45z3.js";
|
|
17
17
|
import {
|
|
18
18
|
getSharedEventStore
|
|
19
19
|
} from "./roy-agent-core-na18zwj0.js";
|
|
20
20
|
import {
|
|
21
21
|
createLarkCliWorkflowNotifyHook
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-8bjj3d1b.js";
|
|
23
23
|
import {
|
|
24
24
|
LarkCardPatchNotifier,
|
|
25
25
|
buildTaskCard
|
|
26
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-tadj19vp.js";
|
|
27
27
|
import {
|
|
28
28
|
normalizeLarkAtMentions
|
|
29
29
|
} from "./roy-agent-core-m880qz3y.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
LarkCardPatchNotifier,
|
|
26
26
|
humanizeValue
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-tadj19vp.js";
|
|
28
28
|
import {
|
|
29
29
|
validateWorkflowDefinition
|
|
30
30
|
} from "./roy-agent-core-yr1mryb8.js";
|
|
@@ -2176,6 +2176,7 @@ class LarkCliTaskNotifyHook {
|
|
|
2176
2176
|
status,
|
|
2177
2177
|
meta: this.buildTaskMeta(task),
|
|
2178
2178
|
finalStep: task.current_status || undefined,
|
|
2179
|
+
expandTimeline: rawStatus === "archived" ? true : undefined,
|
|
2179
2180
|
...rawStatus === "archived" ? { pausedMilestoneTitle: "Task 已归档" } : {}
|
|
2180
2181
|
});
|
|
2181
2182
|
if (isPaused) {
|
|
@@ -148,6 +148,33 @@ var CONTEXT_SKIP_KEYS = new Set([
|
|
|
148
148
|
"larkPerTaskChatTaskId",
|
|
149
149
|
"larkPerTaskChatCreatedAt"
|
|
150
150
|
]);
|
|
151
|
+
function isTerminalStatusForTimeline(status) {
|
|
152
|
+
return status === "completed" || status === "failed" || status === "cancelled" || status === "deleted";
|
|
153
|
+
}
|
|
154
|
+
function isTerminalStatusForWorkflowTimeline(status) {
|
|
155
|
+
return status !== "running";
|
|
156
|
+
}
|
|
157
|
+
function appendHr(elements) {
|
|
158
|
+
if (elements.length > 0 && elements[elements.length - 1].tag === "hr")
|
|
159
|
+
return;
|
|
160
|
+
elements.push({ tag: "hr" });
|
|
161
|
+
}
|
|
162
|
+
function buildCollapsiblePanel(opts) {
|
|
163
|
+
const panel = {
|
|
164
|
+
tag: "collapsible_panel",
|
|
165
|
+
expanded: opts.expanded ?? false,
|
|
166
|
+
header: {
|
|
167
|
+
title: {
|
|
168
|
+
tag: "markdown",
|
|
169
|
+
content: sanitizeInlineText(opts.title, 120)
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
elements: opts.elements
|
|
173
|
+
};
|
|
174
|
+
if (opts.elementId)
|
|
175
|
+
panel.element_id = opts.elementId;
|
|
176
|
+
return panel;
|
|
177
|
+
}
|
|
151
178
|
function renderTaskInfoLines(meta) {
|
|
152
179
|
const lines = [];
|
|
153
180
|
if (meta.id !== undefined)
|
|
@@ -274,20 +301,51 @@ function buildTaskCard(opts) {
|
|
|
274
301
|
tag: "markdown",
|
|
275
302
|
content: `[${label}](${link})`
|
|
276
303
|
});
|
|
277
|
-
elements
|
|
304
|
+
appendHr(elements);
|
|
278
305
|
}
|
|
279
306
|
const infoLines = renderTaskInfoLines(opts.meta);
|
|
280
307
|
if (infoLines.length > 0) {
|
|
281
|
-
elements.push({
|
|
282
|
-
|
|
283
|
-
|
|
308
|
+
elements.push(buildCollapsiblePanel({
|
|
309
|
+
title: "\uD83D\uDCCB 任务详情",
|
|
310
|
+
elementId: "task_detail",
|
|
311
|
+
elements: [{ tag: "markdown", content: infoLines.join(`
|
|
312
|
+
`) }]
|
|
313
|
+
}));
|
|
314
|
+
appendHr(elements);
|
|
284
315
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
316
|
+
const timelineElements = [];
|
|
317
|
+
if (milestones.length > 0) {
|
|
318
|
+
timelineElements.push({
|
|
319
|
+
tag: "markdown",
|
|
320
|
+
content: `## \uD83C\uDFAF 里程碑序列`
|
|
321
|
+
});
|
|
322
|
+
timelineElements.push({
|
|
323
|
+
tag: "markdown",
|
|
324
|
+
content: renderMilestones(milestones)
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
if (processSteps.length > 0) {
|
|
328
|
+
if (timelineElements.length > 0)
|
|
329
|
+
timelineElements.push({ tag: "hr" });
|
|
330
|
+
timelineElements.push({
|
|
331
|
+
tag: "markdown",
|
|
332
|
+
content: `## \uD83D\uDD27 过程信息`
|
|
333
|
+
});
|
|
334
|
+
timelineElements.push({
|
|
335
|
+
tag: "markdown",
|
|
336
|
+
content: renderProcessSteps(processSteps)
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (timelineElements.length > 0) {
|
|
340
|
+
const timelineTitle = `⏱️ 执行动态(${milestones.length} 里程碑 / ${processSteps.length} 过程)`;
|
|
341
|
+
elements.push(buildCollapsiblePanel({
|
|
342
|
+
title: timelineTitle,
|
|
343
|
+
elementId: "task_timeline",
|
|
344
|
+
expanded: opts.expandTimeline ?? isTerminalStatusForTimeline(status),
|
|
345
|
+
elements: timelineElements
|
|
346
|
+
}));
|
|
347
|
+
}
|
|
348
|
+
appendHr(elements);
|
|
291
349
|
const effectiveProgress = status === "completed" ? 100 : opts.progress;
|
|
292
350
|
const isTerminalStatus = status !== "running";
|
|
293
351
|
const terminalProgressText = status === "deleted" ? "任务已取消(删除),记录已归档" : status === "cancelled" ? "任务已取消" : status === "stopped" ? "任务已停止(可恢复)" : status === "failed" ? "任务失败" : "任务已完成";
|
|
@@ -402,21 +460,45 @@ function buildWorkflowCard(opts) {
|
|
|
402
460
|
error: opts.error
|
|
403
461
|
});
|
|
404
462
|
if (infoLines.length > 0) {
|
|
405
|
-
elements.push({
|
|
406
|
-
|
|
407
|
-
|
|
463
|
+
elements.push(buildCollapsiblePanel({
|
|
464
|
+
title: "\uD83D\uDCCB 运行详情",
|
|
465
|
+
elementId: "workflow_detail",
|
|
466
|
+
elements: [{ tag: "markdown", content: infoLines.join(`
|
|
467
|
+
`) }]
|
|
468
|
+
}));
|
|
469
|
+
appendHr(elements);
|
|
470
|
+
}
|
|
471
|
+
const timelineElements = [];
|
|
472
|
+
if (milestones.length > 0) {
|
|
473
|
+
timelineElements.push({ tag: "markdown", content: `## \uD83C\uDFAF 里程碑序列` });
|
|
474
|
+
timelineElements.push({
|
|
475
|
+
tag: "markdown",
|
|
476
|
+
content: renderMilestones(milestones)
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
if (processSteps.length > 0) {
|
|
480
|
+
if (timelineElements.length > 0)
|
|
481
|
+
timelineElements.push({ tag: "hr" });
|
|
482
|
+
timelineElements.push({ tag: "markdown", content: `## \uD83D\uDD27 过程信息` });
|
|
483
|
+
timelineElements.push({
|
|
484
|
+
tag: "markdown",
|
|
485
|
+
content: renderProcessSteps(processSteps)
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
if (timelineElements.length > 0) {
|
|
489
|
+
elements.push(buildCollapsiblePanel({
|
|
490
|
+
title: `⏱️ 执行动态(${milestones.length} 里程碑 / ${processSteps.length} 过程)`,
|
|
491
|
+
elementId: "workflow_timeline",
|
|
492
|
+
expanded: opts.expandTimeline ?? isTerminalStatusForWorkflowTimeline(status),
|
|
493
|
+
elements: timelineElements
|
|
494
|
+
}));
|
|
408
495
|
}
|
|
409
|
-
elements.push({ tag: "markdown", content: `## \uD83C\uDFAF 里程碑序列` });
|
|
410
|
-
elements.push({ tag: "markdown", content: renderMilestones(milestones) });
|
|
411
|
-
elements.push({ tag: "hr" });
|
|
412
|
-
elements.push({ tag: "markdown", content: `## \uD83D\uDD27 过程信息` });
|
|
413
|
-
elements.push({ tag: "markdown", content: renderProcessSteps(processSteps) });
|
|
414
496
|
const effectiveProgress = status === "completed" ? 100 : deriveProgress({
|
|
415
497
|
completedNodes: opts.completedNodes,
|
|
416
498
|
totalNodes: opts.totalNodes,
|
|
417
499
|
progress: opts.progress
|
|
418
500
|
});
|
|
419
|
-
elements
|
|
501
|
+
appendHr(elements);
|
|
420
502
|
elements.push({
|
|
421
503
|
tag: "markdown",
|
|
422
504
|
content: effectiveProgress !== undefined ? `**\uD83D\uDCCA 进度**:${renderProgressBar(effectiveProgress)}` : `**\uD83D\uDCCA 进度**:进行中(第 ${updateCount} 次更新,尚未上报百分比)`
|
|
@@ -598,7 +680,8 @@ class LarkCardPatchNotifier {
|
|
|
598
680
|
milestones: mergeUnique(state?.milestones ?? [], [pauseMilestone], milestoneKey),
|
|
599
681
|
processSteps: state?.processSteps ?? [],
|
|
600
682
|
updateCount,
|
|
601
|
-
spinner
|
|
683
|
+
spinner,
|
|
684
|
+
expandTimeline: opts.expandTimeline
|
|
602
685
|
});
|
|
603
686
|
await this.runLarkCli(this.buildPatchCardArgs({
|
|
604
687
|
messageId: opts.messageId,
|
|
@@ -653,7 +736,8 @@ class LarkCardPatchNotifier {
|
|
|
653
736
|
milestones: mergeUnique(state?.milestones ?? [], [finalMilestone], milestoneKey),
|
|
654
737
|
processSteps: state?.processSteps ?? [],
|
|
655
738
|
updateCount,
|
|
656
|
-
spinner
|
|
739
|
+
spinner,
|
|
740
|
+
expandTimeline: opts.expandTimeline
|
|
657
741
|
});
|
|
658
742
|
await this.runLarkCli(this.buildPatchCardArgs({
|
|
659
743
|
messageId: opts.messageId,
|
|
@@ -1167,4 +1251,4 @@ function sanitize(text) {
|
|
|
1167
1251
|
return `${trimmed.slice(0, 500)}…`;
|
|
1168
1252
|
}
|
|
1169
1253
|
|
|
1170
|
-
export { formatTimestampForDisplay, sanitizeInlineText, formatDateTimeForDisplay, renderProgressBar, resolveTaskTitleForDisplay, humanizeValue, renderTaskInfoLines, renderContextAsLines, renderMilestones, renderProcessSteps, buildTaskCard, buildChatAppLink, DEFAULT_APP_LINK_BASE, formatDurationMs, renderWorkflowInfoLines, buildWorkflowCard, LarkCardPatchNotifier };
|
|
1254
|
+
export { formatTimestampForDisplay, sanitizeInlineText, formatDateTimeForDisplay, renderProgressBar, resolveTaskTitleForDisplay, humanizeValue, isTerminalStatusForTimeline, isTerminalStatusForWorkflowTimeline, buildCollapsiblePanel, renderTaskInfoLines, renderContextAsLines, renderMilestones, renderProcessSteps, buildTaskCard, buildChatAppLink, DEFAULT_APP_LINK_BASE, formatDurationMs, renderWorkflowInfoLines, buildWorkflowCard, LarkCardPatchNotifier };
|