@ai-setting/roy-agent-core 1.7.65 → 1.7.67

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.
Files changed (64) hide show
  1. package/dist/env/agent/agent-component.d.ts +56 -3
  2. package/dist/env/agent/agent-component.js +2 -2
  3. package/dist/env/agent/index.js +2 -2
  4. package/dist/env/agent/types.d.ts +28 -0
  5. package/dist/env/environment.d.ts +13 -0
  6. package/dist/env/event-source/command-card-action.d.ts +105 -0
  7. package/dist/env/event-source/command-cards.d.ts +72 -0
  8. package/dist/env/event-source/command-registry.d.ts +181 -0
  9. package/dist/env/event-source/command-types.d.ts +8 -0
  10. package/dist/env/event-source/event-source-handlers.d.ts +66 -0
  11. package/dist/env/event-source/event-source-handlers.js +7 -4
  12. package/dist/env/event-source/fallback-model-command.d.ts +80 -0
  13. package/dist/env/event-source/index.d.ts +7 -0
  14. package/dist/env/event-source/index.js +48 -7
  15. package/dist/env/event-source/timer-handler.d.ts +93 -1
  16. package/dist/env/index.js +15 -14
  17. package/dist/env/llm/index.js +1 -1
  18. package/dist/env/prompt/index.js +3 -2
  19. package/dist/env/prompt/prompts-index.d.ts +3 -8
  20. package/dist/env/task/delegate/delegate-tool.d.ts +58 -2
  21. package/dist/env/task/delegate/delegate-tool.js +5 -2
  22. package/dist/env/task/delegate/index.js +3 -2
  23. package/dist/env/task/index.js +9 -8
  24. package/dist/env/task/mcp/index.js +3 -2
  25. package/dist/env/task/plugins/__e2e__/laya-completion-e2e.d.ts +16 -0
  26. package/dist/env/task/plugins/index.js +4 -3
  27. package/dist/env/task/plugins/laya-completion-plugin.d.ts +133 -0
  28. package/dist/env/task/plugins/laya-port.d.ts +23 -0
  29. package/dist/env/task/storage/index.js +2 -2
  30. package/dist/env/task/storage/migrations/003_add_process_description.d.ts +1 -1
  31. package/dist/env/task/storage/migrations/log-migration.d.ts +49 -3
  32. package/dist/env/task/task-component.d.ts +43 -0
  33. package/dist/env/task/tools/completion-copy.d.ts +27 -0
  34. package/dist/env/task/tools/index.js +2 -1
  35. package/dist/env/task/tools/operation/create-tool.d.ts +1 -1
  36. package/dist/env/task/tools/operation/index.js +1 -1
  37. package/dist/env/task/tools/operation/operation-types.d.ts +10 -8
  38. package/dist/env/task/types.d.ts +3 -3
  39. package/dist/env/tool/built-in/index.js +2 -2
  40. package/dist/env/tool/built-in/query-background-process-tool.d.ts +10 -0
  41. package/dist/env/tool/index.js +3 -3
  42. package/dist/env/tool/types.d.ts +6 -0
  43. package/dist/index.js +60 -19
  44. package/dist/shared/@ai-setting/{roy-agent-core-rjzdj0xb.js → roy-agent-core-02j24hrg.js} +2 -0
  45. package/dist/shared/@ai-setting/{roy-agent-core-hmdcz3g9.js → roy-agent-core-1k83dq3a.js} +16 -6
  46. package/dist/shared/@ai-setting/{roy-agent-core-e42v9bcq.js → roy-agent-core-1kxf910n.js} +1 -1
  47. package/dist/shared/@ai-setting/{roy-agent-core-amkqnyzy.js → roy-agent-core-58804s3j.js} +10 -0
  48. package/dist/shared/@ai-setting/roy-agent-core-6m4bw8jy.js +6 -0
  49. package/dist/shared/@ai-setting/roy-agent-core-8zas6w5q.js +1083 -0
  50. package/dist/shared/@ai-setting/{roy-agent-core-9bs6xrav.js → roy-agent-core-abqhkbn3.js} +6 -3
  51. package/dist/shared/@ai-setting/{roy-agent-core-f6c0nadn.js → roy-agent-core-b7jbqfsy.js} +25 -11
  52. package/dist/shared/@ai-setting/{roy-agent-core-hjejpcg5.js → roy-agent-core-dnjm17sa.js} +51 -9
  53. package/dist/shared/@ai-setting/{roy-agent-core-t0ktaevq.js → roy-agent-core-h5vmff8w.js} +60 -4
  54. package/dist/shared/@ai-setting/{roy-agent-core-xhrrgfdy.js → roy-agent-core-hfr6bzts.js} +168 -52
  55. package/dist/shared/@ai-setting/{roy-agent-core-18am1h07.js → roy-agent-core-k4ps1hxp.js} +1085 -46
  56. package/dist/shared/@ai-setting/{roy-agent-core-jz8dsypm.js → roy-agent-core-kpg25s2q.js} +1 -1
  57. package/dist/shared/@ai-setting/{roy-agent-core-6masakz4.js → roy-agent-core-ma35jyd9.js} +19 -8
  58. package/dist/shared/@ai-setting/{roy-agent-core-gxzxq1sf.js → roy-agent-core-ntq0gz7q.js} +1 -1
  59. package/dist/shared/@ai-setting/{roy-agent-core-rn57psp0.js → roy-agent-core-p5cz9m8v.js} +3 -3
  60. package/dist/shared/@ai-setting/{roy-agent-core-w07ymg29.js → roy-agent-core-wksgtqf9.js} +1 -1
  61. package/package.json +1 -1
  62. package/dist/shared/@ai-setting/roy-agent-core-6z412atw.js +0 -654
  63. /package/dist/shared/@ai-setting/{roy-agent-core-5enxfga2.js → roy-agent-core-b4x6x4k2.js} +0 -0
  64. /package/dist/shared/@ai-setting/{roy-agent-core-es467wsz.js → roy-agent-core-dt104qa1.js} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./roy-agent-core-xwm8zavb.js";
4
4
  import {
5
5
  queryBackgroundProcessTool
6
- } from "./roy-agent-core-amkqnyzy.js";
6
+ } from "./roy-agent-core-58804s3j.js";
7
7
  import {
8
8
  getCurrentProcessRegistry,
9
9
  killProcessTree
@@ -1,3 +1,9 @@
1
+ import {
2
+ TASK_COMPLETE_ITEM_BY_ITEM,
3
+ TASK_COMPLETE_VERIFY_DUTY,
4
+ TASK_COMPLETION_HINT_ANCHOR
5
+ } from "./roy-agent-core-6m4bw8jy.js";
6
+
1
7
  // src/env/prompt/prompts-index.ts
2
8
  var builtInPrompts = {
3
9
  default: `你是 {{agent_name}} 接待智能体(Receptionist Agent)—— {{agent_name}} 系统的智能入口。
@@ -125,7 +131,7 @@ var builtInPrompts = {
125
131
  - ✅ 功能开发、bug 修复、重构、文档生成
126
132
  - ✅ 网络搜索和研究
127
133
 
128
- **roy** 的提示词中内置了任务生命周期——它知道如何使用 \`task_create\`、\`task_update\`、\`task_operation_create\` 和 \`task_complete\` 来跟踪每项工作。
134
+ **roy** 的提示词中内置了任务生命周期——它知道如何使用 \`task_create\`、\`task_update\`、\`task_operation_create\` 和 \`task_complete\` 来跟踪每项工作。task_complete 时会${TASK_COMPLETE_VERIFY_DUTY}:按子项逐条验收(${TASK_COMPLETE_ITEM_BY_ITEM}),若收到 [${TASK_COMPLETION_HINT_ANCHOR}] 必须核实并二选一(重开 / 落 decision 说明理由)。
129
135
 
130
136
  推荐使用:
131
137
  \`\`\`
@@ -808,7 +814,7 @@ roy-agent <command> <subcmd> --help
808
814
  | \`task_list\` | List tasks with optional filters for status/priority |
809
815
  | \`task_complete\` | Mark a task as completed (progress=100, status=completed). Creates an operation record. |
810
816
  | \`task_delete\` | Delete a task and all its operation records |
811
- | \`task_operation_create\` | Create operation records — **双维度**: milestone_* (状态/里程碑) + process_description (过程, 100-150 字符) |
817
+ | \`task_operation_create\` | Create operation records — **双维度**: milestone_* (状态/里程碑) + process_description (过程, 100-500 字符) |
812
818
  | \`task_operation_list\` | List operation records for a task |
813
819
 
814
820
  ### ❌ 禁止使用的工具(你不能调用以下工具)
@@ -882,7 +888,7 @@ Follow this lifecycle for every task:
882
888
  │ 5. RECORD (task_operation_create) — **双维度分工** │
883
889
  │ - **状态/里程碑维度**:用 milestone_type / milestone_title / │
884
890
  │ milestone_description 描述"达成的状态/里程碑"。 │
885
- │ - **过程维度**:用 process_description(100-150 字符) │
891
+ │ - **过程维度**:用 process_description(100-500 字符) │
886
892
  │ 简要记录"如何达到"——采取了什么策略 + 工具步骤概要。 │
887
893
  │ - ⚠️ **不要把 action 当状态**,也不要让 process_description 与 │
888
894
  │ milestone_description 重复。 │
@@ -893,8 +899,13 @@ Follow this lifecycle for every task:
893
899
  ┌─────────────────────────────────────────────────────────────────┐
894
900
  │ 6. COMPLETE (task_complete) │
895
901
  │ - Mark task as completed (progress=100%, status=completed) │
896
- │ - Verify all goals_and_expected_deliverables are met │
897
- │ - Create completion operation record │
902
+ │ - ${TASK_COMPLETE_ITEM_BY_ITEM}: check each goal sub-item │
903
+ │ against the operation-record chain + deliverable evidence │
904
+ │ - If a [${TASK_COMPLETION_HINT_ANCHOR}] appears in task │
905
+ │ context, you MUST ${TASK_COMPLETE_VERIFY_DUTY}: reopen │
906
+ │ (task_update status=todo) or record why it is met │
907
+ │ (task_operation_create decision). Never ignore it. │
908
+ │ - Create completion operation record │
898
909
  └─────────────────────────────────────────────────────────────────┘
899
910
  \`\`\`
900
911
 
@@ -931,7 +942,7 @@ When reusing an existing task, you MUST follow these rules:
931
942
 
932
943
  #### 维度 2:过程("如何达到")— 可选但推荐维度
933
944
  使用 \`task_operation_create\` 的 \`process_description\` 字段:
934
- - 字符范围硬约束 100-150 字符
945
+ - 字符范围硬约束 100-500 字符
935
946
  - 内容:采取的策略 + 工具步骤概要
936
947
  - 完整过程通过 sessionId 回查 session
937
948
 
@@ -1954,7 +1965,7 @@ task_operation_create( \\
1954
1965
  milestone_type="progress", \\
1955
1966
  milestone_title="建立 self-task 跟踪 (Task #$SELF_TASK_ID)", \\
1956
1967
  milestone_description="任务整理开始,建立 self-task 跟踪本次 reparent/upgrade 操作链", \\
1957
- process_description="通过 task_create 建 tracking task + task_operation_create 留痕起步 100-150 字符" \\
1968
+ process_description="通过 task_create 建 tracking task + task_operation_create 留痕起步 100-500 字符" \\
1958
1969
  )
1959
1970
 
1960
1971
  # 3. 自此所有 reparent / 升级 type 操作都必须 task_update 关联到 $SELF_TASK_ID
@@ -2142,7 +2153,7 @@ task_operation_create({
2142
2153
  - **milestone_type**: \`decision\`("为什么挂这里")或 \`milestone\`("达成了什么")
2143
2154
  - **milestone_title**: 一句话标题(如 "Reparent #X → #Y(longterm 锚点)")
2144
2155
  - **milestone_description**: 详细描述(决策依据、强度、项目路径)
2145
- - **process_description**: 100-150 字符简要过程
2156
+ - **process_description**: 100-500 字符简要过程
2146
2157
 
2147
2158
  ---
2148
2159
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_sqlite_task_store
3
- } from "./roy-agent-core-9bs6xrav.js";
3
+ } from "./roy-agent-core-abqhkbn3.js";
4
4
 
5
5
  // src/env/task/storage/index.ts
6
6
  init_sqlite_task_store();
@@ -15,7 +15,7 @@ var ActionTypeEnum = z.enum([
15
15
  "workflow_extracted"
16
16
  ]);
17
17
  var PROCESS_DESCRIPTION_MIN_LENGTH = 100;
18
- var PROCESS_DESCRIPTION_MAX_LENGTH = 150;
18
+ var PROCESS_DESCRIPTION_MAX_LENGTH = 500;
19
19
  var MILESTONE_DESCRIPTION_MAX_LENGTH = 5000;
20
20
  var MILESTONE_TITLE_MIN_LENGTH = 1;
21
21
  var MILESTONE_TITLE_MAX_LENGTH = 200;
@@ -147,7 +147,7 @@ function ensureRequiredMilestoneFields(params) {
147
147
  function createOperationTool(taskComponent) {
148
148
  return {
149
149
  name: "task_operation_create",
150
- description: "Create an operation record for a task. Tracks milestones (state/result) and process (strategy + tool steps). " + "Dual-dimension schema: milestone_type/title/description captures WHAT milestone was reached; " + "process_description (100-150 chars) captures HOW. " + "Legacy action_* fields are accepted as deprecated aliases.",
150
+ description: "Create an operation record for a task. Tracks milestones (state/result) and process (strategy + tool steps). " + "Dual-dimension schema: milestone_type/title/description captures WHAT milestone was reached; " + "process_description (100-500 chars) captures HOW. " + "Legacy action_* fields are accepted as deprecated aliases.",
151
151
  parameters: CreateOperationToolSchema,
152
152
  execute: async (args, ctx) => {
153
153
  let params;
@@ -301,7 +301,7 @@ function formatZodError2(err) {
301
301
  function updateOperationTool(taskComponent) {
302
302
  return {
303
303
  name: "task_operation_update",
304
- description: "Update an operation record. Use milestone_title / milestone_description (canonical) " + "or action_title / action_description (deprecated, auto-mapped). " + "process_description captures the process (100-150 chars).",
304
+ description: "Update an operation record. Use milestone_title / milestone_description (canonical) " + "or action_title / action_description (deprecated, auto-mapped). " + "process_description captures the process (100-500 chars).",
305
305
  parameters: UpdateOperationToolSchema,
306
306
  execute: async (args, ctx) => {
307
307
  let params;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  builtInPrompts
3
- } from "./roy-agent-core-6masakz4.js";
3
+ } from "./roy-agent-core-ma35jyd9.js";
4
4
  import {
5
5
  getXDGPath
6
6
  } from "./roy-agent-core-qxnbvgwe.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-core",
3
- "version": "1.7.65",
3
+ "version": "1.7.67",
4
4
  "type": "module",
5
5
  "description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
6
6
  "main": "./dist/index.js",