@ai-setting/roy-agent-core 1.7.70 → 1.7.72
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/agent/agent-component.js +2 -2
- package/dist/env/agent/index.js +2 -2
- package/dist/env/agent/summary-agent.d.ts +6 -15
- package/dist/env/agent/types.d.ts +0 -17
- package/dist/env/event-source/event-source-handlers.js +6 -6
- package/dist/env/event-source/index.js +7 -7
- package/dist/env/event-source/reset-command.d.ts +41 -0
- package/dist/env/index.js +19 -20
- package/dist/env/llm/index.js +1 -1
- package/dist/env/llm/temperature-policy.d.ts +107 -0
- package/dist/env/llm/types.d.ts +2 -2
- package/dist/env/prompt/index.js +3 -3
- package/dist/env/prompt/prompts-index.d.ts +341 -3
- package/dist/env/session/__bench__/replay-compact.d.ts +137 -0
- package/dist/env/session/__bench__/run-replay.d.ts +15 -0
- package/dist/env/session/compact-checkpoint-content.d.ts +67 -0
- package/dist/env/session/index.d.ts +1 -0
- package/dist/env/session/index.js +2 -3
- package/dist/env/session/session-component.d.ts +47 -30
- package/dist/env/session/storage/index.js +1 -1
- package/dist/env/session/storage/sqlite.d.ts +8 -0
- package/dist/env/session/types.d.ts +45 -30
- package/dist/env/task/delegate/delegate-tool.js +4 -4
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/index.js +6 -6
- package/dist/env/task/mcp/index.js +2 -2
- package/dist/env/task/plugins/index.js +4 -4
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +50 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.js +3 -1
- package/dist/env/task/prompt/index.d.ts +11 -0
- package/dist/env/task/prompt/index.js +16 -0
- package/dist/env/task/prompt/task-discipline.d.ts +32 -0
- package/dist/env/task/tools/index.js +2 -2
- package/dist/env/workflow/engine/index.js +2 -3
- package/dist/env/workflow/index.js +6 -7
- package/dist/env/workflow/plugins/index.js +2 -2
- package/dist/env/workflow/tools/index.js +3 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +39 -28
- package/dist/shared/@ai-setting/{roy-agent-core-bk8kyzv8.js → roy-agent-core-1p6syv85.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8bjj3d1b.js → roy-agent-core-1w9y7mxj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nersksh1.js → roy-agent-core-2gzt2q8c.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-27f59kjv.js → roy-agent-core-34jz9mgh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tadj19vp.js → roy-agent-core-46rv4d7d.js} +71 -49
- package/dist/shared/@ai-setting/roy-agent-core-4jjwewvw.js +182 -0
- package/dist/shared/@ai-setting/{roy-agent-core-hx46nhh1.js → roy-agent-core-5gw0qa8m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-0j94tj1z.js → roy-agent-core-7qvw65jt.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-h5vmff8w.js → roy-agent-core-7sj9xs9c.js} +7 -33
- package/dist/shared/@ai-setting/{roy-agent-core-002g6nfk.js → roy-agent-core-attpry6g.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-37tj4y6a.js → roy-agent-core-gr48c89p.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-0cb6w0k7.js → roy-agent-core-hfyfavp3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-hfr6bzts.js → roy-agent-core-jgb3bb42.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9bshyqjn.js → roy-agent-core-pakhchy7.js} +183 -132
- package/dist/shared/@ai-setting/roy-agent-core-qkdegdvc.js +0 -0
- package/dist/shared/@ai-setting/{roy-agent-core-02j24hrg.js → roy-agent-core-rxb00gjm.js} +70 -3
- package/dist/shared/@ai-setting/{roy-agent-core-8cx7cfdg.js → roy-agent-core-skyc30qx.js} +1 -2
- package/dist/shared/@ai-setting/{roy-agent-core-hy3zn2q2.js → roy-agent-core-sm0sf6sb.js} +20 -0
- package/dist/shared/@ai-setting/{roy-agent-core-mw2cen6s.js → roy-agent-core-vah6g5yx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-07fvy74y.js → roy-agent-core-vm8h5zyj.js} +20 -6
- package/dist/shared/@ai-setting/{roy-agent-core-x3xpkx84.js → roy-agent-core-wr7mv7k3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-npvejsg8.js → roy-agent-core-y12kyxwa.js} +83 -3
- package/dist/shared/@ai-setting/{roy-agent-core-vaz9350j.js → roy-agent-core-yhwxpj12.js} +34 -175
- package/dist/test-utils/ipc-test-server.d.ts +10 -0
- package/package.json +6 -1
- package/dist/shared/@ai-setting/roy-agent-core-6m4bw8jy.js +0 -6
- package/dist/shared/@ai-setting/roy-agent-core-ze068vc9.js +0 -37
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Task #4889 — 任务纪律单一真相源(runtime 无关)
|
|
3
|
+
*
|
|
4
|
+
* 单一真相源:core 内 roy prompt 与所有外部 runtime
|
|
5
|
+
* (opencode / claude / codex / CLI daemon / …)的 agent
|
|
6
|
+
* prompt 都从这一个常量派生,不许各抄一份。
|
|
7
|
+
*
|
|
8
|
+
* 内容来源(报告 A /tmp/4889-phase0-roy-prompt-mechanisms.md):
|
|
9
|
+
* - 主体机制:prompts-index.ts roy prompt Task 章节(M1-M16)
|
|
10
|
+
* - goals 编号子项:create-tool.ts L144 起(M7/M8/M9)
|
|
11
|
+
* - complete 核实义务:complete-tool.ts L32-45(M10/M11/M12)
|
|
12
|
+
*
|
|
13
|
+
* 改写原则:
|
|
14
|
+
* 1. 剥离 Roy 专属内容(CLI 命令表 / {{memory}} / deniedTools 工具表)
|
|
15
|
+
* 2. 补齐 M14/M15/M16
|
|
16
|
+
* 3. 不含防退化纪律(属 Roy 全局操作纪律,不属 task 语义)
|
|
17
|
+
* 4. 共享锚点直接 import completion-copy.ts,不重打一遍
|
|
18
|
+
*
|
|
19
|
+
* ⚠️ 本模块必须保持**零依赖**:唯一允许的 import 是
|
|
20
|
+
* completion-copy.ts(同为零依赖锚点模块),以便
|
|
21
|
+
* prompts-index(超大模板串)与外部 npm 消费方安全引用。
|
|
22
|
+
*/
|
|
23
|
+
/** 分片 1:生命周期契约(M1/M2/M13/M14/M15) */
|
|
24
|
+
export declare const TASK_DISCIPLINE_LIFECYCLE = "### Task Lifecycle (7 steps, 0-6)\n\n> Tasks are the **first-class citizen**. Follow this lifecycle for every task:\n\n0. CHECK TASK CONTEXT OR SEARCH\n - If `[\u5F53\u524D Task #N]` is in the context \u2192 use `task_get #N` directly, skip searching.\n - Otherwise use `task_list` / `task_search` to find related tasks.\n - If found \u2192 reuse, extend, and update (see the reuse rules in step 1).\n If not found \u2192 proceed to step 1.\n - **Orient before creating**: read the existing tree with\n `task_tree(depth=1)` (`depth=2` for bigger trees) and decide whether the\n work belongs to an existing root (attach via `parent_task_id`) or is\n genuinely new. Keep **root tasks \u2264 10**; prefer attaching to an existing\n thematic root over spawning a new root. Never hardcode ids \u2014 read them\n from `task_tree`.\n\n1. CREATE or REUSE\n - No existing task \u2192 create a new one with title, description, goals.\n - Existing task \u2192 reuse via `task_get`, then `task_update`:\n * Append new context to description and goals (preserve the old content)\n * Add / extend `goals_and_expected_deliverables`\n * Create an operation record documenting the continuation\n * Set priority and due date if any\n * If the original task was completed \u2192 reset status to `active`\n and reset progress to a reasonable value\n\n2. GATHER CONTEXT (never skip)\n - Read description, goals, current_status\n - Check `parent_task_id` for sub-tasks\n - Read the operation history: `task_operation_list` (~20 recent records)\n - Review recent operations for history and decisions\n - Working without context risks: outdated goals, missed decisions,\n duplicated work, misalignment with the parent task\n\n3. EXECUTE\n - Use the available tools, skills and workflows to satisfy the task\n description and goals.\n - Long-running work: for work longer than 5 minutes, record a milestone\n with `task_operation_create` as you go, so the user can see progress.\n - Several independent sub-tasks may run in parallel (background `bash &`\n or parallel ReAct steps).\n - **\u8FB9\u5E72\u8FB9\u8BB0** \u2014 milestones are recorded **while working**;\n **\u7981\u6B62\u4E8B\u540E\u6279\u91CF\u8865**\uFF08do not defer them to one batch at the end\uFF09.\n - Note: `task_create` / `task_update` already create operation records\n automatically \u2014 do not create duplicates by hand.\n\n4. TRACK\n - Update progress (0-100%) as the work advances\n - Update status: todo \u2192 active \u2192 completed\n - Record `current_status` with human-readable progress\n\n5. RECORD \u2014 operation records (see Operation Discipline below)\n\n6. COMPLETE \u2014 `task_complete` after item-by-item verification\n (see Complete Discipline below)";
|
|
25
|
+
/** 分片 2:操作记录双维度规范(M3/M4/M5/M6/M16) */
|
|
26
|
+
export declare const TASK_DISCIPLINE_OPERATION = "### Operation Record \u2014 \u53CC\u7EF4\u5EA6\u5206\u5DE5\u89C4\u8303\n\n**Record milestones as you work** \u2014 call `task_operation_create` the moment a\nstage is reached, **not after the fact** (not in a batch at the end).\n\n**\u64CD\u4F5C\u8BB0\u5F55\u5FC5\u987B\u4E25\u683C\u533A\u5206\u4E24\u4E2A\u7EF4\u5EA6\uFF0C\u4E8C\u8005\u914D\u5957\u8BB0\u5F55\u3001\u5404\u53F8\u5176\u804C**\uFF1A\n\n#### \u7EF4\u5EA6 1\uFF1A\u72B6\u6001/\u91CC\u7A0B\u7891\uFF08\"\u8FBE\u5230\u4EC0\u4E48\"\uFF09\u2014 \u5FC5\u586B\u7EF4\u5EA6\n\u4F7F\u7528 `task_operation_create` \u7684 milestone_* \u4E3B\u5B57\u6BB5\uFF1A\n- **milestone_type**\uFF1A\u91CC\u7A0B\u7891\u7C7B\u578B\uFF08create / progress / milestone / problem / solution / decision / review / completed / workflow_extracted\uFF09\n- **milestone_title**\uFF1A\u91CC\u7A0B\u7891\u6807\u9898\uFF08\u4E00\u884C\uFF09\n- **milestone_description**\uFF1A\u8FBE\u6210\u7684\u72B6\u6001/\u7ED3\u679C\u63CF\u8FF0\uFF08\u53EF\u957F\u53EF\u77ED\uFF09\n\n#### \u7EF4\u5EA6 2\uFF1A\u8FC7\u7A0B\uFF08\"\u5982\u4F55\u8FBE\u5230\"\uFF09\u2014 \u53EF\u9009\u4F46\u63A8\u8350\u7EF4\u5EA6\n\u4F7F\u7528 `task_operation_create` \u7684 `process_description` \u5B57\u6BB5\uFF1A\n- \u5B57\u7B26\u8303\u56F4\u786C\u7EA6\u675F 100-500 \u5B57\u7B26 (100\u2013500 characters)\n- \u5185\u5BB9\uFF1A\u91C7\u53D6\u7684\u7B56\u7565 + \u5DE5\u5177\u6B65\u9AA4\u6982\u8981\n- \u5B8C\u6574\u8FC7\u7A0B\u901A\u8FC7 sessionId \u56DE\u67E5 session\n\n#### \u53CC\u7EF4\u5EA6\u914D\u5408\u94C1\u5F8B\n- \u274C **\u4E0D\u8981\u628A action \u5F53\u72B6\u6001**\uFF1A\u65E7 `action_*` \u547D\u540D\u504F\u52A8\u4F5C/\u884C\u4E3A\u5C42\uFF0C\u4E0D\u80FD\u8868\u8FBE\"\u6B64\u523B\u8FBE\u5230\u4EC0\u4E48\"\uFF1B\u73B0\u5728\u7EDF\u4E00\u6539\u7528 `milestone_*`\u3002\n- \u274C **\u4E0D\u8981\u8BA9 process_description \u4E0E milestone_description \u91CD\u590D**\uFF1Aprocess \u662F\"\u5982\u4F55\u8FBE\u5230\"\uFF0Cmilestone \u662F\"\u8FBE\u5230\u4EC0\u4E48\u72B6\u6001\"\u3002\n- \u2705 **\u914D\u5957\u8BB0\u5F55**\uFF1A\u6BCF\u4E2A\u6709\u610F\u4E49\u7684 operation \u90FD\u5E94\u540C\u65F6\u5305\u542B\u4E24\u8005\uFF1B\u4E0D\u5199 process \u65F6\uFF0Cdetail \u5E94\u901A\u8FC7 sessionId \u56DE\u67E5\u3002\n- \u26A0\uFE0F **\u517C\u5BB9\u7A97\u53E3\u671F**\uFF1A\u65E7 `action_type` / `action_title` / `action_description` \u4ECD\u88AB tool \u63A5\u53D7\uFF08\u6807\u8BB0 @deprecated\uFF09\uFF0C\u4F1A\u81EA\u52A8\u6620\u5C04\u5230 milestone_* \u5E76\u8FD4\u56DE deprecation warning\u3002\n\n#### \u8303\u4F8B\uFF08\u53CC\u7EF4\u5EA6\u9F50\u5168\u7684 operation \u8BB0\u5F55\uFF09\n```json\n{\n \"task_id\": 123,\n \"milestone_type\": \"milestone\",\n \"milestone_title\": \"GREEN \u901A\u8FC7\uFF1Amilestone_* schema/storage/tool \u5168\u94FE\u8DEF\",\n \"milestone_description\": \"21/21 \u6D4B\u8BD5\u901A\u8FC7\uFF0C\u5305\u542B 4 \u4E2A action_* alias \u517C\u5BB9\u6D4B\u8BD5\",\n \"process_description\": \"TDD RED \u5199 4 \u4E2A\u5931\u8D25\u6D4B\u8BD5\u8986\u76D6 storage/tool\uFF1B\u8FC1\u79FB 004 rename \u5217\uFF1BrowToOperation \u540C\u65F6\u8F93\u51FA\u53CC\u5B57\u6BB5\u517C\u5BB9\uFF1Btool zod preprocess \u81EA\u52A8\u6620\u5C04 action_*\"\n}\n```";
|
|
27
|
+
/** 分片 3:goals 编号子项规则(M7/M8/M9) */
|
|
28
|
+
export declare const TASK_DISCIPLINE_GOALS = "### Goals \u5B50\u9879\u62C6\u5206\u89C4\u5219\n\n`goals_and_expected_deliverables` **MUST** be written as\n**numbered sub-items** (\u7F16\u53F7\u5B50\u9879) that can each be verified\none by one (\u9010\u6761\u9A8C\u6536) \u2014 for `type=normal` tasks:\n\n1. \u5B9E\u73B0 X\uFF08\u542B\u6587\u4EF6\u8DEF\u5F84\uFF09\n2. \u6D4B\u8BD5 Y \u8986\u76D6 Z \u573A\u666F\uFF08pass/fail \u8BA1\u6570\uFF09\n3. \u6587\u6863 W \u843D\u76D8\u5230 <path>\n\n\u26A0\uFE0F For `type=longterm` / `type=cycle` tasks there is no\nper-item completion acceptance\uFF08\u4E0D\u8D70\u9010\u6761 complete \u9A8C\u6536\uFF09, so the\nMUST above does not apply; for those, it is **strongly recommended**\n(\u5EFA\u8BAE) to split goals into staged, individually checkable sub-items\n(\u9636\u6BB5\u6027\u53EF\u5224\u5B50\u9879) instead of one vague sentence.\n\nWhy: when the task is completed, the completion hook\n(task:after.complete) judges the whole goal against the\noperation-record chain, using each sub-item as fine-grained\nevidence (\u9010\u6761\u5BF9\u7167\u7684\u4F9D\u636E). Vague one-line goals (\u4E00\u53E5\u8BDD\u6A21\u7CCA\u76EE\u6807\uFF0C\n\u5982\u300C\u505A\u597D X\u300D\u300C\u5B8C\u6210\u8C03\u7814\u300D) give the judge nothing to check\nand make a completion hint much more likely.\n\nReference the four atomic assertion forms (Task #4768\n\u56DB\u539F\u5B50\u5F62\u6001) when writing each sub-item:\n\n- \u6587\u4EF6\u65AD\u8A00 (file assertion): file exists / size / content grep\n- \u8FDB\u7A0B\u65AD\u8A00 (process assertion): command exit code / stdout match\n- \u6D4B\u8BD5\u65AD\u8A00 (test assertion): pass/fail counts, no NEW fail\n- \u72B6\u6001\u65AD\u8A00 (state assertion): version number / HTTP 200 / status field";
|
|
29
|
+
/** 分片 4:complete 逐条验收 + HINT 核实义务(M10/M11/M12) */
|
|
30
|
+
export declare const TASK_DISCIPLINE_COMPLETE = "### Task Complete \u2014 \u6838\u5B9E\u4E49\u52A1\n\nBefore calling `task_complete`, you MUST:\n\n1. Read the task's `goal` (description) and `delivery` (goals_and_expected_deliverables) fields.\n - Use `task_get(task_id=<id>)` to fetch the full task record.\n2. **Validate whether each goal sub-item was achieved** \u2014 accept the goal\n **item-by-item** (\u6309\u5B50\u9879\u9010\u6761\u9A8C\u6536).\n - Goals should be numbered sub-items (\u7F16\u53F7\u5B50\u9879). Check\n each sub-item against the operation-record chain (\u64CD\u4F5C\u8BB0\u5F55\u94FE) and the\n deliverable evidence (context.deliverable_storage_path).\n - The completion hook (task:after.complete) judges the whole goal vs.\n deliverables; numbered sub-items give it finer-grained evidence to\n reason with (\u9010\u6761\u5BF9\u7167\u7684\u8BC1\u636E\u7C92\u5EA6). If it detects that the goal or\n deliverables appear unmet, the task context will carry a\n `[TASK_COMPLETION_HINT]`.\n - **If you receive a [TASK_COMPLETION_HINT]**, you MUST verify it\n (\u6838\u5B9E\u4E49\u52A1): re-read the task via `task_get`, then do exactly one of:\n (a) \u786E\u8BA4\u672A\u5B8C\u6210 \u2192 `task_update(task_id=<id>, status=todo)` to **reopen**\n the task and continue the work; or\n (b) \u786E\u8BA4\u5DF2\u5B8C\u6210 \u2192 `task_operation_create` (milestone_type=decision,\n milestone_title=<\u4E00\u884C\u7ED3\u8BBA>) **state why** the sub-items are actually\n met (\u8BF4\u660E\u7406\u7531).\n Never ignore it (\u4E0D\u5141\u8BB8\u65E0\u89C6).\n - If the goal and delivery mismatch **without** a hint, either:\n (a) extend the task via `task_update`, or\n (b) record the discrepancy via `task_operation_create`\n (milestone_type=decision) \u2014 the reason **must** land in the\n operation record (\u5FC5\u987B\u843D\u5230\u64CD\u4F5C\u8BB0\u5F55\u91CC), not merely a line in\n your final report (\u4E0D\u80FD\u53EA\u5728\u62A5\u544A\u91CC\u5E26\u4E00\u53E5).\n3. **Provide `deliverable_storage_path`** parameter with the deliverable's address.\n It may name **multiple paths** (multiple deliverables), space-separated\n (`/tmp/report.md /tmp/diff.patch`) \u2014 the judge splits on whitespace as\n well as `,` `;` `\u3001` and ` + `. A local path may also be written in its\n `file://` form (`file:///tmp/report.md`) \u2014 the scheme is stripped and the\n path kept. Declare **every** artefact you produced: a path left out reads\n as \"not produced\".\n - Feishu doc URL (e.g., https://my.feishu.cn/docx/abc)\n - Local file path (e.g., /tmp/report.md)\n - Git branch or worktree path (e.g., feature/my-feature)\n - GitHub commit URL or PR URL\n - Cloud drive URL (e.g., https://my.feishu.cn/file/abc)\n - Or any other locator that points to where the work product lives\n\nThe `deliverable_storage_path` will be persisted to the task's\n`context.deliverable_storage_path` for future reference and traceability.";
|
|
31
|
+
/** 完整纪律正文(主出口):4 分片拼装 */
|
|
32
|
+
export declare const TASK_DISCIPLINE_PROMPT: string;
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
searchTasksTool,
|
|
10
10
|
treeTasksTool,
|
|
11
11
|
updateTaskTool
|
|
12
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
12
|
+
} from "../../../shared/@ai-setting/roy-agent-core-7sj9xs9c.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-4jjwewvw.js";
|
|
15
15
|
import"../../../shared/@ai-setting/roy-agent-core-7cbpmk4q.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-qq96p0tj.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
@@ -5,12 +5,11 @@ import {
|
|
|
5
5
|
Scheduler,
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
init_engine
|
|
8
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../../shared/@ai-setting/roy-agent-core-vah6g5yx.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-attpry6g.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-efkjyh69.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
13
|
-
import"../../../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
14
13
|
import"../../../shared/@ai-setting/roy-agent-core-dvtg4sn0.js";
|
|
15
14
|
import"../../../shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
16
15
|
import"../../../shared/@ai-setting/roy-agent-core-sjr1kmfz.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-gr48c89p.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-es203w7p.js";
|
|
5
5
|
import {
|
|
6
6
|
Edge,
|
|
@@ -14,17 +14,16 @@ import {
|
|
|
14
14
|
DecoratorNode,
|
|
15
15
|
init_decorator_node
|
|
16
16
|
} from "../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
import"../../shared/@ai-setting/roy-agent-core-hfyfavp3.js";
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-pakhchy7.js";
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-sm0sf6sb.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-12n08pg5.js";
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-vah6g5yx.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
24
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-attpry6g.js";
|
|
25
25
|
import"../../shared/@ai-setting/roy-agent-core-efkjyh69.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
27
|
-
import"../../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
28
27
|
import"../../shared/@ai-setting/roy-agent-core-dvtg4sn0.js";
|
|
29
28
|
import"../../shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
30
29
|
import"../../shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
@@ -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-1w9y7mxj.js";
|
|
5
|
+
import"../../../shared/@ai-setting/roy-agent-core-46rv4d7d.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";
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
getRunWorkflowTool,
|
|
25
25
|
initRunWorkflowTool,
|
|
26
26
|
resetRunWorkflowTool
|
|
27
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
28
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
29
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "../../../shared/@ai-setting/roy-agent-core-hfyfavp3.js";
|
|
28
|
+
import"../../../shared/@ai-setting/roy-agent-core-pakhchy7.js";
|
|
29
|
+
import"../../../shared/@ai-setting/roy-agent-core-sm0sf6sb.js";
|
|
30
30
|
import"../../../shared/@ai-setting/roy-agent-core-12n08pg5.js";
|
|
31
31
|
import {
|
|
32
32
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
init_submit_json_output_tool,
|
|
36
36
|
parseWorkflowJsonOutput
|
|
37
37
|
} from "../../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
38
|
-
import"../../../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
39
38
|
import"../../../shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
40
39
|
import"../../../shared/@ai-setting/roy-agent-core-yr1mryb8.js";
|
|
41
40
|
import"../../../shared/@ai-setting/roy-agent-core-mds8tqd0.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { PromptStore } from "./env/prompt/prompt-store";
|
|
|
26
26
|
export { closeDatabase } from "./env/workflow/storage/sqlite";
|
|
27
27
|
export type { PromptConfig, PromptPath, PromptEntry, PromptSource, PromptHook, RenderHookContext, PromptHookMap, } from "./env/prompt/types";
|
|
28
28
|
export { SessionComponent, MemorySessionStore, } from "./env/session";
|
|
29
|
-
export type { Session, SessionMessage, SessionConfig, CreateSessionOptions, UpdateSessionOptions, ListSessionsOptions, AddMessageOptions, SessionCheckpoint, CompactOptions, CompactResult, CompactPreview, GetContextOptions, GetContextResult, CheckpointType, SearchMessagesOptions, MessageMatch, SearchResult, } from "./env/session/types";
|
|
29
|
+
export type { Session, SessionMessage, SessionConfig, CreateSessionOptions, UpdateSessionOptions, ListSessionsOptions, AddMessageOptions, SessionCheckpoint, CompactOptions, CompactResult, CompactPreview, CheckpointAdaptReport, GetContextOptions, GetContextResult, CheckpointType, SearchMessagesOptions, MessageMatch, SearchResult, } from "./env/session/types";
|
|
30
30
|
export { cascadeStopSessionTree, type CascadeStopOptions, type CascadeStopResult, } from "./env/session-tree-stopper";
|
|
31
31
|
export { createMemoryAgentTools, } from "./env/memory/tools/memory-agent-tools";
|
|
32
32
|
export type { SearchSessionsParams, GetSessionParams, WriteMemoryParams, } from "./env/memory/tools/memory-agent-tools";
|
|
@@ -35,6 +35,7 @@ export { TaskComponent, SQLiteTaskStore, getDefaultTaskDbPath, } from "./env/tas
|
|
|
35
35
|
export type { Task, TaskOperation, TaskStatus, TaskPriority, ActionType, CreateTaskOptions, UpdateTaskOptions, ListTasksOptions, CreateOperationOptions, ListOperationsOptions, TaskConfig, } from "./env/task/types";
|
|
36
36
|
export { TaskTagPlugin, createAutoTaskPlugin, type AutoTaskPluginConfig, } from "./env/task/plugins";
|
|
37
37
|
export { TaskHookPoints, type TaskHookPoint, } from "./env/task/hooks";
|
|
38
|
+
export { TASK_DISCIPLINE_PROMPT, TASK_DISCIPLINE_LIFECYCLE, TASK_DISCIPLINE_OPERATION, TASK_DISCIPLINE_GOALS, TASK_DISCIPLINE_COMPLETE, } from "./env/task/prompt";
|
|
38
39
|
export { SkillComponent, } from "./env/skill";
|
|
39
40
|
export type { SkillEntry, SkillListItem, SkillConfig, SkillPath, SkillSource, SkillToolParams, } from "./env/skill/types";
|
|
40
41
|
export { McpComponent, } from "./env/mcp";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PromptComponent,
|
|
3
|
+
PromptStore
|
|
4
|
+
} from "./shared/@ai-setting/roy-agent-core-34jz9mgh.js";
|
|
1
5
|
import {
|
|
2
6
|
LLMComponent,
|
|
3
7
|
LLMConfigSchema,
|
|
@@ -5,7 +9,7 @@ import {
|
|
|
5
9
|
ModelLimitsSchema,
|
|
6
10
|
ProviderCapabilitiesSchema,
|
|
7
11
|
ProviderConfigSchema
|
|
8
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
12
|
+
} from "./shared/@ai-setting/roy-agent-core-rxb00gjm.js";
|
|
9
13
|
import"./shared/@ai-setting/roy-agent-core-wjmwwc4a.js";
|
|
10
14
|
import"./shared/@ai-setting/roy-agent-core-pnj0zh25.js";
|
|
11
15
|
import {
|
|
@@ -28,10 +32,7 @@ import {
|
|
|
28
32
|
ConfigComponent
|
|
29
33
|
} from "./shared/@ai-setting/roy-agent-core-zxz5fkwj.js";
|
|
30
34
|
import"./shared/@ai-setting/roy-agent-core-adg9ghbt.js";
|
|
31
|
-
import
|
|
32
|
-
PromptComponent,
|
|
33
|
-
PromptStore
|
|
34
|
-
} from "./shared/@ai-setting/roy-agent-core-27f59kjv.js";
|
|
35
|
+
import"./shared/@ai-setting/roy-agent-core-qkdegdvc.js";
|
|
35
36
|
import {
|
|
36
37
|
MemoryComponent
|
|
37
38
|
} from "./shared/@ai-setting/roy-agent-core-nwbfepba.js";
|
|
@@ -61,21 +62,21 @@ import {
|
|
|
61
62
|
BaseEnvironment,
|
|
62
63
|
generateDescendingId,
|
|
63
64
|
generateId
|
|
64
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
65
|
+
} from "./shared/@ai-setting/roy-agent-core-1p6syv85.js";
|
|
65
66
|
import {
|
|
66
67
|
TaskComponent
|
|
67
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
68
|
+
} from "./shared/@ai-setting/roy-agent-core-2gzt2q8c.js";
|
|
68
69
|
import"./shared/@ai-setting/roy-agent-core-58804s3j.js";
|
|
69
70
|
import"./shared/@ai-setting/roy-agent-core-jm136jzh.js";
|
|
70
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
71
|
+
import"./shared/@ai-setting/roy-agent-core-7qvw65jt.js";
|
|
71
72
|
import"./shared/@ai-setting/roy-agent-core-fttgm52a.js";
|
|
72
73
|
import"./shared/@ai-setting/roy-agent-core-ntq0gz7q.js";
|
|
73
74
|
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
74
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
75
|
+
import"./shared/@ai-setting/roy-agent-core-7sj9xs9c.js";
|
|
75
76
|
import"./shared/@ai-setting/roy-agent-core-p5cz9m8v.js";
|
|
76
77
|
import {
|
|
77
78
|
EventSourceComponent
|
|
78
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
79
|
+
} from "./shared/@ai-setting/roy-agent-core-wr7mv7k3.js";
|
|
79
80
|
import {
|
|
80
81
|
BountyIMInstance,
|
|
81
82
|
COMMAND_PREFIX,
|
|
@@ -107,7 +108,7 @@ import {
|
|
|
107
108
|
timerHandler,
|
|
108
109
|
translateCardActionToCommand,
|
|
109
110
|
writeFallbackModelList
|
|
110
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
111
|
+
} from "./shared/@ai-setting/roy-agent-core-y12kyxwa.js";
|
|
111
112
|
import {
|
|
112
113
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
113
114
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -132,13 +133,17 @@ import {
|
|
|
132
133
|
import {
|
|
133
134
|
TaskTagPlugin,
|
|
134
135
|
createAutoTaskPlugin
|
|
135
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
136
|
+
} from "./shared/@ai-setting/roy-agent-core-5gw0qa8m.js";
|
|
136
137
|
import {
|
|
137
138
|
EventStoreImpl,
|
|
138
139
|
getSharedEventStore,
|
|
139
140
|
resetSharedEventStore,
|
|
140
141
|
setSharedEventStore
|
|
141
142
|
} from "./shared/@ai-setting/roy-agent-core-na18zwj0.js";
|
|
143
|
+
import {
|
|
144
|
+
getBuiltInPrompt,
|
|
145
|
+
getBuiltInPromptNames
|
|
146
|
+
} from "./shared/@ai-setting/roy-agent-core-yhwxpj12.js";
|
|
142
147
|
import {
|
|
143
148
|
SQLiteTaskStore,
|
|
144
149
|
getDefaultTaskDbPath
|
|
@@ -146,17 +151,19 @@ import {
|
|
|
146
151
|
import {
|
|
147
152
|
TaskHookPoints
|
|
148
153
|
} from "./shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
149
|
-
import {
|
|
150
|
-
getBuiltInPrompt,
|
|
151
|
-
getBuiltInPromptNames
|
|
152
|
-
} from "./shared/@ai-setting/roy-agent-core-vaz9350j.js";
|
|
153
154
|
import"./shared/@ai-setting/roy-agent-core-tr3ep81v.js";
|
|
154
|
-
import
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
import {
|
|
156
|
+
TASK_DISCIPLINE_COMPLETE,
|
|
157
|
+
TASK_DISCIPLINE_GOALS,
|
|
158
|
+
TASK_DISCIPLINE_LIFECYCLE,
|
|
159
|
+
TASK_DISCIPLINE_OPERATION,
|
|
160
|
+
TASK_DISCIPLINE_PROMPT
|
|
161
|
+
} from "./shared/@ai-setting/roy-agent-core-4jjwewvw.js";
|
|
162
|
+
import"./shared/@ai-setting/roy-agent-core-1w9y7mxj.js";
|
|
163
|
+
import"./shared/@ai-setting/roy-agent-core-46rv4d7d.js";
|
|
157
164
|
import {
|
|
158
165
|
WorkflowComponent
|
|
159
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
166
|
+
} from "./shared/@ai-setting/roy-agent-core-gr48c89p.js";
|
|
160
167
|
import {
|
|
161
168
|
init_node_registry_helper,
|
|
162
169
|
registerDecoratorNodeType
|
|
@@ -169,21 +176,20 @@ import {
|
|
|
169
176
|
createWorkflowFromClass
|
|
170
177
|
} from "./shared/@ai-setting/roy-agent-core-h0x19xgn.js";
|
|
171
178
|
import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
172
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
179
|
+
import"./shared/@ai-setting/roy-agent-core-hfyfavp3.js";
|
|
173
180
|
import {
|
|
174
181
|
SessionComponent
|
|
175
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
182
|
+
} from "./shared/@ai-setting/roy-agent-core-pakhchy7.js";
|
|
176
183
|
import {
|
|
177
184
|
MemorySessionStore
|
|
178
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
185
|
+
} from "./shared/@ai-setting/roy-agent-core-sm0sf6sb.js";
|
|
179
186
|
import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
180
187
|
import"./shared/@ai-setting/roy-agent-core-12n08pg5.js";
|
|
181
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
188
|
+
import"./shared/@ai-setting/roy-agent-core-vah6g5yx.js";
|
|
182
189
|
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
183
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
190
|
+
import"./shared/@ai-setting/roy-agent-core-attpry6g.js";
|
|
184
191
|
import"./shared/@ai-setting/roy-agent-core-efkjyh69.js";
|
|
185
192
|
import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
186
|
-
import"./shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
187
193
|
import"./shared/@ai-setting/roy-agent-core-dvtg4sn0.js";
|
|
188
194
|
import"./shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
189
195
|
import"./shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
@@ -200,7 +206,7 @@ import"./shared/@ai-setting/roy-agent-core-jagkferh.js";
|
|
|
200
206
|
import {
|
|
201
207
|
AgentComponent,
|
|
202
208
|
AgentComponentConfigSchema
|
|
203
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
209
|
+
} from "./shared/@ai-setting/roy-agent-core-jgb3bb42.js";
|
|
204
210
|
import {
|
|
205
211
|
ToolComponent,
|
|
206
212
|
ToolRegistry,
|
|
@@ -209,7 +215,7 @@ import {
|
|
|
209
215
|
import"./shared/@ai-setting/roy-agent-core-jvv2h3d6.js";
|
|
210
216
|
import {
|
|
211
217
|
AgentRegistry
|
|
212
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
218
|
+
} from "./shared/@ai-setting/roy-agent-core-vm8h5zyj.js";
|
|
213
219
|
import {
|
|
214
220
|
XDG_PATHS,
|
|
215
221
|
getXDGPath,
|
|
@@ -666,6 +672,11 @@ export {
|
|
|
666
672
|
TaskTagPlugin,
|
|
667
673
|
TaskHookPoints,
|
|
668
674
|
TaskComponent,
|
|
675
|
+
TASK_DISCIPLINE_PROMPT,
|
|
676
|
+
TASK_DISCIPLINE_OPERATION,
|
|
677
|
+
TASK_DISCIPLINE_LIFECYCLE,
|
|
678
|
+
TASK_DISCIPLINE_GOALS,
|
|
679
|
+
TASK_DISCIPLINE_COMPLETE,
|
|
669
680
|
SpanStatus,
|
|
670
681
|
SpanKind,
|
|
671
682
|
SkillComponent,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
BackgroundTaskManager,
|
|
9
9
|
createDelegateTool
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-7qvw65jt.js";
|
|
11
11
|
import {
|
|
12
12
|
TaskEntityEventTypes
|
|
13
13
|
} from "./roy-agent-core-8gxth0eh.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
searchTasksTool,
|
|
23
23
|
treeTasksTool,
|
|
24
24
|
updateTaskTool
|
|
25
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-7sj9xs9c.js";
|
|
26
26
|
import {
|
|
27
27
|
createOperationTool,
|
|
28
28
|
deleteOperationTool,
|
|
@@ -271,7 +271,68 @@ function milestoneKey(m) {
|
|
|
271
271
|
return `${m.title}|${m.timestamp ?? ""}|${m.description ?? ""}`;
|
|
272
272
|
}
|
|
273
273
|
function processStepKey(s) {
|
|
274
|
-
|
|
274
|
+
if (s.id)
|
|
275
|
+
return `id:${s.id}`;
|
|
276
|
+
return [
|
|
277
|
+
s.title,
|
|
278
|
+
s.timestamp ?? "",
|
|
279
|
+
s.endTimestamp ?? "",
|
|
280
|
+
s.description ?? "",
|
|
281
|
+
s.category ?? "",
|
|
282
|
+
s.source ?? ""
|
|
283
|
+
].join("|");
|
|
284
|
+
}
|
|
285
|
+
function partitionProcessSteps(steps) {
|
|
286
|
+
const operations = [];
|
|
287
|
+
const toolTraces = [];
|
|
288
|
+
for (const s of steps) {
|
|
289
|
+
if (s.source === "tool-trace")
|
|
290
|
+
toolTraces.push(s);
|
|
291
|
+
else
|
|
292
|
+
operations.push(s);
|
|
293
|
+
}
|
|
294
|
+
return { operations, toolTraces };
|
|
295
|
+
}
|
|
296
|
+
function buildTimelineElements(milestones, processSteps) {
|
|
297
|
+
const elements = [];
|
|
298
|
+
const { operations, toolTraces } = partitionProcessSteps(processSteps);
|
|
299
|
+
if (milestones.length > 0) {
|
|
300
|
+
elements.push({ tag: "markdown", content: `## \uD83C\uDFAF 里程碑序列` });
|
|
301
|
+
elements.push({ tag: "markdown", content: renderMilestones(milestones) });
|
|
302
|
+
}
|
|
303
|
+
if (operations.length > 0) {
|
|
304
|
+
if (elements.length > 0)
|
|
305
|
+
elements.push({ tag: "hr" });
|
|
306
|
+
elements.push({ tag: "markdown", content: `## \uD83D\uDCDD 操作记录` });
|
|
307
|
+
elements.push({ tag: "markdown", content: renderProcessSteps(operations) });
|
|
308
|
+
}
|
|
309
|
+
if (toolTraces.length > 0) {
|
|
310
|
+
if (elements.length > 0)
|
|
311
|
+
elements.push({ tag: "hr" });
|
|
312
|
+
elements.push({
|
|
313
|
+
tag: "markdown",
|
|
314
|
+
content: `## \uD83D\uDD27 执行轨迹(工具调用)`
|
|
315
|
+
});
|
|
316
|
+
elements.push({
|
|
317
|
+
tag: "markdown",
|
|
318
|
+
content: renderProcessSteps(toolTraces)
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
elements,
|
|
323
|
+
opCount: operations.length,
|
|
324
|
+
toolCount: toolTraces.length
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function buildTimelinePanelTitle(milestoneCount, opCount, toolCount) {
|
|
328
|
+
const parts = [];
|
|
329
|
+
if (milestoneCount > 0)
|
|
330
|
+
parts.push(`${milestoneCount} 里程碑`);
|
|
331
|
+
if (opCount > 0)
|
|
332
|
+
parts.push(`${opCount} 操作记录`);
|
|
333
|
+
if (toolCount > 0)
|
|
334
|
+
parts.push(`${toolCount} 工具调用`);
|
|
335
|
+
return `⏱️ 执行动态${parts.length > 0 ? `(${parts.join(" / ")})` : ""}`;
|
|
275
336
|
}
|
|
276
337
|
function buildTaskCard(opts) {
|
|
277
338
|
const status = opts.status ?? "running";
|
|
@@ -313,36 +374,13 @@ function buildTaskCard(opts) {
|
|
|
313
374
|
}));
|
|
314
375
|
appendHr(elements);
|
|
315
376
|
}
|
|
316
|
-
const
|
|
317
|
-
if (
|
|
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} 过程)`;
|
|
377
|
+
const timeline = buildTimelineElements(milestones, processSteps);
|
|
378
|
+
if (timeline.elements.length > 0) {
|
|
341
379
|
elements.push(buildCollapsiblePanel({
|
|
342
|
-
title:
|
|
380
|
+
title: buildTimelinePanelTitle(milestones.length, timeline.opCount, timeline.toolCount),
|
|
343
381
|
elementId: "task_timeline",
|
|
344
382
|
expanded: opts.expandTimeline ?? isTerminalStatusForTimeline(status),
|
|
345
|
-
elements:
|
|
383
|
+
elements: timeline.elements
|
|
346
384
|
}));
|
|
347
385
|
}
|
|
348
386
|
appendHr(elements);
|
|
@@ -468,29 +506,13 @@ function buildWorkflowCard(opts) {
|
|
|
468
506
|
}));
|
|
469
507
|
appendHr(elements);
|
|
470
508
|
}
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
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) {
|
|
509
|
+
const timeline = buildTimelineElements(milestones, processSteps);
|
|
510
|
+
if (timeline.elements.length > 0) {
|
|
489
511
|
elements.push(buildCollapsiblePanel({
|
|
490
|
-
title:
|
|
512
|
+
title: buildTimelinePanelTitle(milestones.length, timeline.opCount, timeline.toolCount),
|
|
491
513
|
elementId: "workflow_timeline",
|
|
492
514
|
expanded: opts.expandTimeline ?? isTerminalStatusForWorkflowTimeline(status),
|
|
493
|
-
elements:
|
|
515
|
+
elements: timeline.elements
|
|
494
516
|
}));
|
|
495
517
|
}
|
|
496
518
|
const effectiveProgress = status === "completed" ? 100 : deriveProgress({
|
|
@@ -1251,4 +1273,4 @@ function sanitize(text) {
|
|
|
1251
1273
|
return `${trimmed.slice(0, 500)}…`;
|
|
1252
1274
|
}
|
|
1253
1275
|
|
|
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 };
|
|
1276
|
+
export { formatTimestampForDisplay, sanitizeInlineText, formatDateTimeForDisplay, renderProgressBar, resolveTaskTitleForDisplay, humanizeValue, isTerminalStatusForTimeline, isTerminalStatusForWorkflowTimeline, buildCollapsiblePanel, renderTaskInfoLines, renderContextAsLines, renderMilestones, renderProcessSteps, partitionProcessSteps, buildTaskCard, buildChatAppLink, DEFAULT_APP_LINK_BASE, formatDurationMs, renderWorkflowInfoLines, buildWorkflowCard, LarkCardPatchNotifier };
|