@unionschool/easy-agents 0.4.2 → 1.0.23
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/README.md +2 -2
- package/bin/easy-agents.js +6 -1
- package/bin/mac-reports.js +6 -0
- package/bin/mac-service.js +2 -2
- package/bin/portable-service.js +2 -2
- package/bin/run.js +119 -33
- package/bin/tasks.js +70 -17
- package/package.json +5 -1
- package/runtime/desktop_chat.py +118 -13
- package/runtime/doc_read.py +181 -0
- package/runtime/easyagents_core/__init__.py +4 -0
- package/runtime/easyagents_core/git_sync.py +7 -2
- package/runtime/easyagents_core/member_sync.py +6 -0
- package/runtime/easyagents_core/tools.py +1257 -0
- package/runtime/platform_prompt.py +21 -0
- package/runtime/task_run.py +3 -16
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""How an agent reaches the platform tools from a tool-enabled run (task runs and lead work messages)."""
|
|
2
|
+
import shlex
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
PACKAGE = Path(__file__).resolve().parents[1]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def platform_entry(credential_file):
|
|
10
|
+
command = shlex.join([sys.executable, "-I", "-B", str(PACKAGE / "runtime" / "mcp.py"),
|
|
11
|
+
"--credential", str(credential_file)])
|
|
12
|
+
return ("\n平台操作入口:通过终端运行 " + command + " list 查看全部工具及参数;"
|
|
13
|
+
"调用方式:同一命令后接工具名及单个 JSON 对象参数。"
|
|
14
|
+
"先调用 get_workflow_guide 获取任务规程,按需用 get_project_context 获取项目编号与安排。"
|
|
15
|
+
"登记需求用 register_requirement,提交方案用 submit_plan,用户同意后用 record_approval 登记批准,"
|
|
16
|
+
"派任务用 publish_task;领取、提问、交付、审核、部署、合并上报也必须调用真实平台工具。"
|
|
17
|
+
"本次平台调度优先于仓库中默认的本地任务流程;文档仍按规程写入仓库,"
|
|
18
|
+
"不能仅写 docs/需求.md 或任务.md 就声称平台已登记或派发,"
|
|
19
|
+
"派发一律用任务分支经平台进行(publish_task 带 task_branch),同设备、同一智能体也不例外,不再本地派发。"
|
|
20
|
+
"平台调用失败应明确报告未登记/未派发,不得改走本地;"
|
|
21
|
+
"不要读取、打印或提交凭据文件。部署只由部署阶段的部署人做;数据库迁移、修改生产数据、删除远程内容前先用 ask_user 询问用户。")
|
package/runtime/task_run.py
CHANGED
|
@@ -6,7 +6,6 @@ clarify uses the default branch. Tools run with full permissions like every task
|
|
|
6
6
|
"""
|
|
7
7
|
import json
|
|
8
8
|
import os
|
|
9
|
-
import shlex
|
|
10
9
|
import shutil
|
|
11
10
|
import signal
|
|
12
11
|
import sys
|
|
@@ -16,10 +15,12 @@ from uuid import UUID
|
|
|
16
15
|
|
|
17
16
|
resources = os.environ.get("EASYAGENTS_MAC_RESOURCES") or os.environ["EASYAGENTS_DESKTOP_RESOURCES"]
|
|
18
17
|
sys.path.insert(0, str(Path(resources) / "lib"))
|
|
19
|
-
from easyagents_core.tools import ClaudeCodeAdapter, CodexAdapter
|
|
20
18
|
PACKAGE = Path(__file__).resolve().parents[1]
|
|
21
19
|
sys.path.insert(0, str(PACKAGE))
|
|
20
|
+
# 适配器同 desktop_chat:用核心包自带的,随 npm 更新生效(2026-11-23)。
|
|
21
|
+
from runtime.easyagents_core.tools import ClaudeCodeAdapter, CodexAdapter
|
|
22
22
|
from runtime.easyagents_core.git_sync import GitError, GitWorkspace
|
|
23
|
+
from runtime.platform_prompt import platform_entry
|
|
23
24
|
|
|
24
25
|
KINDS = ("execute", "review", "deploy", "clarify")
|
|
25
26
|
FIELDS = ("status", "reply_text", "tool_session_ref", "tool_version", "model_name",
|
|
@@ -30,20 +31,6 @@ def failed(code, detail, status="failed"):
|
|
|
30
31
|
return {"status": status, "failure_code": code, "failure_detail": detail}
|
|
31
32
|
|
|
32
33
|
|
|
33
|
-
def platform_entry(credential_file):
|
|
34
|
-
command = shlex.join([sys.executable, "-I", "-B", str(PACKAGE / "runtime" / "mcp.py"),
|
|
35
|
-
"--credential", credential_file])
|
|
36
|
-
return ("\n平台操作入口:通过终端运行 " + command + " list 查看全部工具及参数;"
|
|
37
|
-
"调用方式:同一命令后接工具名及单个 JSON 对象参数。"
|
|
38
|
-
"先调用 get_workflow_guide 获取任务规程,按需用 get_project_context 获取项目编号与安排。"
|
|
39
|
-
"领取、提问、交付、审核都必须调用真实平台工具。"
|
|
40
|
-
"本次平台调度优先于仓库中默认的本地任务流程;文档仍按规程写入仓库,"
|
|
41
|
-
"不能仅写 docs/需求.md 或任务.md 就声称平台已登记或派发,"
|
|
42
|
-
"派发一律用任务分支经平台进行(publish_task 带 task_branch),不再本地派发。"
|
|
43
|
-
"平台调用失败应明确报告未登记/未派发,不得改走本地;"
|
|
44
|
-
"不要读取、打印或提交凭据文件。部署只由部署阶段的部署人做;数据库迁移、修改生产数据、删除远程内容前先用 ask_user 询问用户。")
|
|
45
|
-
|
|
46
|
-
|
|
47
34
|
def checkout_notes(sync, original):
|
|
48
35
|
notes = ""
|
|
49
36
|
if sync.isolated and sync.kind == "deploy":
|