@kmlckj/licos-ai-cli 1.6.5 → 1.7.0
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/lib/__templates__/agent/AGENTS.md +10 -1
- package/lib/__templates__/agent/README.md +35 -1
- package/lib/__templates__/agent/config/agent_llm_config.json +12 -0
- package/lib/__templates__/agent/examples/README.md +47 -0
- package/lib/__templates__/agent/examples/__init__.py +1 -0
- package/lib/__templates__/agent/examples/experts.py +35 -0
- package/lib/__templates__/agent/examples/functional.py +18 -0
- package/lib/__templates__/agent/examples/handoff.py +33 -0
- package/lib/__templates__/agent/examples/human_input.py +34 -0
- package/lib/__templates__/agent/examples/map_reduce.py +33 -0
- package/lib/__templates__/agent/examples/memory.py +23 -0
- package/lib/__templates__/agent/pyproject.toml +4 -4
- package/lib/__templates__/agent/requirements.txt +3 -3
- package/lib/__templates__/agent/src/agents/agent.py +2 -0
- package/lib/__templates__/agent/template.config.js +4 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +10 -11
- package/lib/__templates__/expo/server/package.json +2 -2
- package/lib/__templates__/nextjs/package.json +2 -2
- package/lib/__templates__/nextjs/pnpm-lock.yaml +10 -11
- package/lib/__templates__/nuxt-vue/package.json +2 -2
- package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +10 -11
- package/lib/__templates__/taro/pnpm-lock.yaml +10 -10
- package/lib/__templates__/taro/server/package.json +2 -2
- package/lib/__templates__/templates.json +1 -1
- package/lib/__templates__/vite/package.json +2 -2
- package/lib/__templates__/vite/pnpm-lock.yaml +10 -11
- package/lib/__templates__/workflow/pyproject.toml +3 -3
- package/lib/__templates__/workflow/requirements.txt +3 -3
- package/lib/__templates__/workflow/src/graphs/graph.py +3 -1
- package/package.json +37 -37
|
@@ -35,7 +35,16 @@
|
|
|
35
35
|
- 普通链接按任务需要调用内置 `download_file(url, path)`,成功后使用返回的 `file_path`。生成文件先核对,再调用内置 `upload_file(path)`,用成功结果的完整 `url` 返回 Markdown 下载链接;上传失败说明错误,不能只交付本地路径或虚构链接。
|
|
36
36
|
- 修改业务提示词时只描述项目业务角色和额外能力;内置工具说明由运行时按实际启用集合生成。文本读取工具不负责解析 PDF、Word、Excel 等二进制文件。
|
|
37
37
|
- `input + session_id` 按认证用户、项目及环境隔离,当前进程保留最近 3 个已完成问答;显式 `messages` 沿用调用方历史协议。重启会丢失短期记忆,多副本需要会话固定路由。
|
|
38
|
-
- 顶层 `harness`
|
|
38
|
+
- 顶层 `harness` 配置计划、上下文预算、执行上限、工具策略和结果校验;`agent_runtime` 独立选择聊天历史、检查点、运行记录、Store、缓存及交互。新项目默认内存,不因已有数据库自动持久化。
|
|
39
|
+
- 用户要求记忆、状态、审批时,先区分功能和保存介质;用户未说明保存介质时请其选择,已有明确选择则直接执行。重启恢复才要求运行控制、检查点和启用的事件使用数据库。
|
|
40
|
+
- 只保存聊天可使用 `history`;已有业务会话表实现 `HistoryAdapter`,不覆盖旧表。数据库模块通过独立的 `agent_runtime_v1.sql` 迁移准备,再打开对应配置;运行时代码不执行迁移。
|
|
41
|
+
- 通用文字、单选、多选、表单和审批适用于普通预览和部署,不要求发布企业项目。启用 `interactions` 时同时启用检查点;工具审批名称仍配置在 `harness.tool_policy.require_approval`。
|
|
42
|
+
- 自定义图使用原生 StateGraph、Command、Send、reducer,通过 `compile_graph(builder, ctx=ctx)` 装配;Functional API 使用 `functional_agent`。子智能体使用 `Subagents`,独立模型、提示词和工具,继承当前用户和总预算。
|
|
43
|
+
- 标准协作可配置 `agent_runtime.subagents/collaboration`,支持总控、并行、串行、路由、交接;复杂拓扑用 SDK 代码。自定义模型或外部操作使用 `execution_slot/async_execution_slot` 接入父子共享并发,不自行另建预算。
|
|
44
|
+
- `handoff` 由当前智能体通过 `transfer_to_<目标>(context)` 交接,接收者直接对话;`initial_agent` 只指定新会话入口。显式启用内存或数据库检查点以保持 `active_agent`;`max_rounds` 限制每轮交接次数。代码方式使用 `model_handoff_agent/build_handoff`,示例为 `examples/handoff.py`。
|
|
45
|
+
- `agent_runtime.graph_version/state_version` 标识图与状态兼容性。状态检查、编辑、恢复、分支、回放通过 `/agent/v1` 或 Agent SDK;重连只订阅已有运行,不能再次提交执行。
|
|
46
|
+
- 升级已有项目先检查实际加载版本、业务代码、登录方式、配置和 Schema。未配置 `agent_runtime` 的项目继续原路径;新模板不自动覆盖旧项目,不强制用户升级依赖。
|
|
47
|
+
- 按需示例位于 `examples/`;示例不会由默认入口自动加载。业务 `sp/up` 只写业务要求,不加入测试结果、迁移步骤或平台实现细节。
|
|
39
48
|
- 输入支持 `input`、多轮 `messages`、`event` 及组合,保留附件和多模态内容。
|
|
40
49
|
- `tests/agent_cases.json` 维护可重复的输入及业务工具验收;生成或修改后对已有预览执行 `bash scripts/runtime.sh -m verify`,失败则修复后重验。
|
|
41
50
|
|
|
@@ -36,6 +36,9 @@ bash scripts/http_run.sh -p <%= port %>
|
|
|
36
36
|
- `POST /stream_run`
|
|
37
37
|
- `GET /agent/config`
|
|
38
38
|
- `POST /v1/chat/completions`
|
|
39
|
+
- `GET /agent/v1/capabilities`:查询当前启用能力及保存方式
|
|
40
|
+
- `/agent/v1/runs`:创建、查询、取消、恢复运行,事件按游标续读
|
|
41
|
+
- `/agent/v1/threads/{session_id}`:检查点状态、历史、编辑、分支、回放
|
|
39
42
|
|
|
40
43
|
`POST /run` 的 Body 是智能体状态输入,常用:
|
|
41
44
|
|
|
@@ -74,7 +77,7 @@ Body 可以同时带 `attachments`、`files`、`references` 等业务字段;
|
|
|
74
77
|
|
|
75
78
|
升级已有项目时,如果曾手动加入 `create_file_transfer_tools(...)`,删除该注册及配置中的 `download_file`、`upload_file`,由运行时统一提供。
|
|
76
79
|
|
|
77
|
-
`config/event_subscriptions.json`
|
|
80
|
+
`config/event_subscriptions.json` 默认为空数组。启用本体订阅时,配置 `agent_runtime.deliveries` 的存储和身份解析函数,事件进入同一运行队列;数据库保存需要用户明确选择。绑定当前工作空间、项目及源码指纹,运行 `bash scripts/runtime.sh -m fingerprint` 获取源码版本。持续监听需要常驻部署;上游当前不保证稳定事件 ID 或断线补发。
|
|
78
81
|
|
|
79
82
|
`POST /run` 和 `POST /stream_run` 支持 `input` / `messages`,也支持平台 `content.query.prompt` 包装;文本和附件会归一成智能体图输入,`references` 等业务字段会保留并传给智能体图。`content.query.prompt` 内的 `upload_file` 由运行时在模型执行前保存到当前用户会话目录的 `assets/upload/`,并写入 `attachments` 和 `files`。预览页传 HTTP(S) 文件 URL,SDK 聊天页传 `data:<mime>;base64,...`,两种均自动落地,不依赖模型调用 `download_file`。
|
|
80
83
|
|
|
@@ -125,12 +128,43 @@ Body 可以同时带 `attachments`、`files`、`references` 等业务字段;
|
|
|
125
128
|
- `up`:用户提示补充
|
|
126
129
|
- `tools`:业务工具名称列表,新增或删除业务工具时同步维护;运行时的八个内置工具不列入此数组
|
|
127
130
|
- `harness`:版本 1 的短期记忆、计划、模型上下文预算、调用限制、工具策略、结果校验和思考内容透传;配置修改从下一任务生效
|
|
131
|
+
- `agent_runtime`:版本 1 的运行协议,分别开启功能并选择 `memory` 或 `database`;默认只在内存保存运行和事件,保留原有三轮短期记忆
|
|
128
132
|
- `harness.thinking.forward_to_frontend`:默认 `false`。开启时,模型返回的思考内容以独立流事件发送到预览页和 SDK 页面,思考完成自动折叠;与 `config.thinking` 的模型思考开关分别控制
|
|
129
133
|
|
|
130
134
|
模板 `sp` 保存业务角色和真实结果要求。`build_project_agent` 按实际启用的工具追加文件及技能能力说明;禁用工具不会暴露给模型。模型上下文窗口来自平台目录,缺少窗口信息会返回配置错误。
|
|
131
135
|
|
|
136
|
+
## 按需启用状态与协作
|
|
137
|
+
|
|
138
|
+
| 需要的功能 | 配置或代码 |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| 完成后的聊天记录 | `agent_runtime.history.enabled`;已有表可用 `history.adapter` |
|
|
141
|
+
| 查看状态、继续执行、分支、回放 | `checkpoints.enabled`,默认内存 |
|
|
142
|
+
| 提问、表单、工具审批 | 同时开启 `checkpoints` 和 `interactions`;工具名单放在 `harness.tool_policy.require_approval` |
|
|
143
|
+
| 审查最终输出 | `interactions.review_output: true`;批准后交付最终答案 |
|
|
144
|
+
| 跨会话记忆、语义搜索 | `store`;语义搜索另外配置真实 embedding 工厂、维度和索引版本 |
|
|
145
|
+
| 节点缓存与重试 | `cache` 和节点 `CachePolicy`;`retry` 默认不重试工具写操作 |
|
|
146
|
+
| 子智能体、路由、并行、交接 | `agent_runtime.subagents/collaboration`;复杂图用 `Subagents`、`SubagentSpec`、`route`、`dispatch` |
|
|
147
|
+
| Functional API | `functional_agent`、原生 `task` |
|
|
148
|
+
| 重启或多副本恢复 | 运行控制、检查点、事件选择数据库;后台恢复另配置原用户身份解析函数 |
|
|
149
|
+
|
|
150
|
+
数据库已存在也不会自动启用上述功能。用户选择持久化后,先检查现有 Schema,使用数据库 CLI 执行运行时包附带的独立迁移 `licos_agent_runtime/migrations/agent_runtime_v1.sql`。默认不建表;业务历史表可以通过适配器复用。
|
|
151
|
+
|
|
152
|
+
示例见 [examples/README.md](examples/README.md),包括单智能体、人工输入、专家协作、Send 汇总、Functional API 和 Store。它们由项目按需导入,不会自动运行。完整 API 见运行时包的 `docs/agent-capabilities.md`。
|
|
153
|
+
|
|
154
|
+
配置协作支持 `supervisor/parallel/sequence/router/handoff`,分别对应总控、并行、串行、路由和交接。每个子智能体声明模型、提示词、业务工具名、记忆范围及允许传入的业务 context 字段。父子共用调用预算与标准模型/工具并发限制;自定义调用节点使用 `execution_slot/async_execution_slot` 加入共享并发。
|
|
155
|
+
|
|
156
|
+
`handoff` 的接收者直接回答用户,同一会话下一轮继续由当前智能体处理。它要求显式开启检查点,默认选择内存;`initial_agent` 指定初始处理者,`max_rounds` 限制每轮交接次数。配置方式自动提供交接工具,代码方式见 `examples/handoff.py`。交接只传用户可见对话、附件和明确说明,保留双方各自的内部工具历史。
|
|
157
|
+
|
|
158
|
+
内存状态在当前服务进程存活期间可用;数据库模式不依赖粘性会话。运行总时限包含人工等待,审批期限另由 `interactions.timeout_seconds` 控制。恢复必须使用原调用者的有效授权,不能换为项目负责人。已经开始但没有确认回执的外部操作需要业务核对,不能盲目重做。
|
|
159
|
+
|
|
160
|
+
旧项目不增加 `agent_runtime` 时继续原协议。新模板不会重写已发布项目;用户主动升级时保留业务代码、登录机制、`sp/up` 和已有表。切换存储采用显式导出、导入,图或状态版本改变需要项目提供迁移方案。
|
|
161
|
+
|
|
132
162
|
## 项目上下文
|
|
133
163
|
|
|
164
|
+
会话列表、创建、重命名、删除及消息分页由 SDK 提供,界面按能力查询启用。目录跟随聊天历史的存储,未启用历史时跟随运行控制;数据库表结构需显式安装。检查点复制、按运行删除和裁剪供停止写入后的维护使用,用户分支使用 `forkThread`。
|
|
165
|
+
|
|
166
|
+
调用企业发布项目使用 `licos_agent_runtime.enterprise_agents.invoke_enterprise`;当前用户与来源项目凭证分别验证,交互沿用图中断和真实用户回执。后台结果通过 `deliveries.callbacks` 注册异步处理函数,业务按事件 ID 去重。配置和 API 详见运行时包 `docs/agent-capabilities.md`。
|
|
167
|
+
|
|
134
168
|
项目内的 `AGENTS.md` 用于记录可由用户维护的项目上下文,例如业务目标、已实现工具和测试样例。新增工具时通常需要同步:
|
|
135
169
|
|
|
136
170
|
- `src/tools/*_tool.py`:工具实现
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
"sp": "你是一个 LICOS 智能体,根据用户需求和当前可用工具完成任务。修改文件前先读取,写入后核对。工具报错后根据错误修正参数或调整步骤,不编造文件内容、执行结果或业务数据。",
|
|
11
11
|
"up": "",
|
|
12
12
|
"tools": [],
|
|
13
|
+
"agent_runtime": {
|
|
14
|
+
"version": 1,
|
|
15
|
+
"graph_version": "1",
|
|
16
|
+
"state_version": "1",
|
|
17
|
+
"runs": { "enabled": true, "storage": "memory" },
|
|
18
|
+
"events": { "enabled": true, "storage": "memory", "ttl_seconds": 86400 },
|
|
19
|
+
"history": { "enabled": false, "storage": "memory" },
|
|
20
|
+
"checkpoints": { "enabled": false, "storage": "memory" },
|
|
21
|
+
"store": { "enabled": false, "storage": "memory" },
|
|
22
|
+
"cache": { "enabled": false, "storage": "memory" },
|
|
23
|
+
"interactions": { "enabled": false, "timeout_seconds": 3600 }
|
|
24
|
+
},
|
|
13
25
|
"harness": {
|
|
14
26
|
"version": 1,
|
|
15
27
|
"memory": { "enabled": true, "recent_turns": 3, "idle_ttl_seconds": 3600 },
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 按需使用的智能体示例
|
|
2
|
+
|
|
3
|
+
默认入口仍是 `src/agents/agent.py`,不会自动加载本目录。选择示例后,在该入口中导入它的 `create_agent`,例如 `from examples.human_input import create_agent`。保留项目已有业务配置和认证方式。
|
|
4
|
+
|
|
5
|
+
| 文件 | 能力 | 必需配置 |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| 默认 `src/agents/agent.py` | 单智能体、文件、技能、三轮内存 | 模板默认配置 |
|
|
8
|
+
| `human_input.py` | 单选交互、自定义状态、自定义进度 | `checkpoints.enabled`、`interactions.enabled` |
|
|
9
|
+
| `experts.py` | 总控和独立专家模型、子工具调用 | `agent_runtime`;选 `per_thread` 时再开启检查点 |
|
|
10
|
+
| `handoff.py` | 智能体主动交接、直接对话、跨轮次保持当前处理者 | `checkpoints.enabled`,内存或数据库按需选择 |
|
|
11
|
+
| `map_reduce.py` | 原生 Send、reducer、并发汇总、节点超时 | 缓存可选;输入 `{"items":["a","b"]}` |
|
|
12
|
+
| `functional.py` | Functional API、任务结果复用、人工输入 | `checkpoints.enabled`、`interactions.enabled` |
|
|
13
|
+
| `memory.py` | Store 工具、TTL、真实语义检索 | `store.enabled`;搜索另配 embedding 工厂及维度 |
|
|
14
|
+
|
|
15
|
+
示例启用的能力默认放内存。用户要求重启恢复时,把 `checkpoints`、`runs` 和已启用的 `events` 一起改为 `storage: "database"`,通过数据库 CLI 执行运行时提供的独立迁移。仅要保存聊天则单独配置 `history`,不必开启检查点。
|
|
16
|
+
|
|
17
|
+
`handoff.py` 使用 SDK 代码声明允许交接的目标;也可用 `collaboration.mode: "handoff"`、`participants`、`initial_agent` 配置标准交接。第一轮从初始智能体开始,后续同一会话从保存的 `active_agent` 开始;`transfer_to_<名称>` 的参数只提供需要传给接收者的交接说明。内部工具历史按子智能体的记忆范围保存。
|
|
18
|
+
|
|
19
|
+
## 审批与恢复
|
|
20
|
+
|
|
21
|
+
开启交互和检查点后,把需要审批的真实工具名加入 `harness.tool_policy.require_approval`。前端支持允许、拒绝、修改参数后批准;`interactions.review_output` 可要求审查最终答案。文字、多选、表单通过 `ask_user` 的 `kind/options/schema` 参数定义。
|
|
22
|
+
|
|
23
|
+
SDK 调用顺序:
|
|
24
|
+
|
|
25
|
+
1. `startRun(input, { background: true, run_id })` 创建运行,保存返回的运行 ID。
|
|
26
|
+
2. `streamEvents(runId, cursor)` 或 `getRun(runId)` 查看运行;网络断开后查询原运行。
|
|
27
|
+
3. 等待用户输入时调用 `resumeRun(runId, { response_id, responses: { [interruptId]: answer } })`。
|
|
28
|
+
4. `getState/stateHistory/updateState/forkThread/replayThread` 管理检查点。回放会调用后续模型和工具,必须确认业务写入的幂等规则。
|
|
29
|
+
|
|
30
|
+
`harness.execution.max_duration_seconds` 包含人工等待;长时间审批需调整该值。内存只在当前进程有效,数据库也不能自动恢复进程中的任意 Python 行,只能从已提交的图边界继续。
|
|
31
|
+
|
|
32
|
+
## 业务扩展
|
|
33
|
+
|
|
34
|
+
- 标准协作也可直接配置 `agent_runtime.subagents` 与 `collaboration`,选择总控、并行、串行、路由或交接模式;工具必须引用已有注册函数。自定义图保留代码组合入口。
|
|
35
|
+
- 标准模型和工具共享父运行并发限制;自行编写的外部操作用 `async_execution_slot` / `execution_slot` 包围调用。可以用 `childState/childHistory` 查看子调用的检查点。
|
|
36
|
+
- 条件分支和循环:原生 `StateGraph.add_conditional_edges`;交接:`route(..., parent=True)` 返回 `Command.PARENT`。父图用 reducer 接收子图的更新。
|
|
37
|
+
- 私有上下文:`SubagentSpec.input_mapper/output_mapper` 决定子图收到与返回哪些字段。
|
|
38
|
+
- 节点级重试:在无副作用节点设置 `RetryPolicy(retry_on=...)`;缓存设置 `CachePolicy`,不缓存外部写操作。
|
|
39
|
+
- 动态提示词、模型选择、结构化输出:`build_project_agent` 的 `system_prompt` 回调、`model_selector`、`response_schema`;模型/工具前后回调为 `AgentHooks`。
|
|
40
|
+
- 外部操作:`effect/effect_sync` 接收业务幂等键及 `reconcile` 核对函数;不能用新运行替代未知结果核对。
|
|
41
|
+
- 后台任务:配置 `deliveries` 并提交稳定 `delivery_id`;数据库恢复另外配置 `recovery.identity_resolver`。解析函数必须重新取得原用户授权,不把 Token 存入运行数据。
|
|
42
|
+
- 现有业务会话表:实现 `HistoryAdapter` 的 `read/append/delete` 并配置 `history.adapter`,保留旧数据和登录方式。
|
|
43
|
+
- 会话目录:SDK `listSessions/createSession/renameSession/deleteSession/sessionMessages`,分页默认 50;用消息游标加载更早记录。目录跟随历史存储,未启用历史则跟随运行控制。
|
|
44
|
+
- 企业发布项目:节点使用 `invoke_enterprise(record_id, arguments, key=..., ctx=ctx)`,平台验证当前使用者、来源项目及发布契约;人工交互沿用图中断和真实用户回执,不伪造个人助手身份。
|
|
45
|
+
- 后台结果:`deliveries.callbacks` 注册异步处理函数,提交时选择 `callback` 名称。业务按 `event_id` 去重;重投回调不重新执行智能体。
|
|
46
|
+
|
|
47
|
+
改变能力后,维护业务工具清单、项目说明和对应验收用例。按项目要求运行功能验收;仅能导入代码不能证明审批、重启恢复和多副本执行已经通过验证。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Optional project examples. The default entrypoint does not import them."""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Three real model calls through the platform; no database is required."""
|
|
2
|
+
from licos_agent_runtime.harness_execution import HarnessRun
|
|
3
|
+
from licos_agent_runtime.project_agent import build_project_agent
|
|
4
|
+
from licos_agent_runtime.subagents import Subagents, model_subagent
|
|
5
|
+
from licos_dev_sdk import create_chat_openai, resolve_llm_endpoint
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def configured_model(config):
|
|
9
|
+
options = dict(config)
|
|
10
|
+
thinking = options.pop("thinking", "auto")
|
|
11
|
+
if thinking != "auto":
|
|
12
|
+
options["extra_body"] = {"thinking": {"type": thinking}}
|
|
13
|
+
return create_chat_openai(**options)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def create_agent(ctx):
|
|
17
|
+
snapshot = ctx.metadata["agent_project_config"]
|
|
18
|
+
config = snapshot.raw["config"]
|
|
19
|
+
endpoint = resolve_llm_endpoint(model=config["model"], model_group=config.get("model_group", "text"))
|
|
20
|
+
harness_run = HarnessRun(snapshot.harness, endpoint.context_length, config["max_completion_tokens"],
|
|
21
|
+
input_limit=endpoint.max_input_length)
|
|
22
|
+
ctx.metadata["agent_harness_run"] = harness_run
|
|
23
|
+
# Each specialist can read its own model configuration from a project file.
|
|
24
|
+
# Use per_thread only when the user wants the specialist to remember prior calls.
|
|
25
|
+
team = Subagents([
|
|
26
|
+
model_subagent("research", "分析问题并整理依据", model=configured_model(config),
|
|
27
|
+
system_prompt="根据提供的资料分析问题。依据不足时明确说明,不编造来源。",
|
|
28
|
+
memory="per_call"),
|
|
29
|
+
model_subagent("review", "检查答案中的逻辑和事实依据", model=configured_model(config),
|
|
30
|
+
system_prompt="审查结论是否得到输入资料支持,并指出不确定性。", memory="per_call"),
|
|
31
|
+
], ctx=ctx)
|
|
32
|
+
return build_project_agent(
|
|
33
|
+
configured_model(config), team.tools(), ctx=ctx, harness=snapshot.harness, harness_run=harness_run,
|
|
34
|
+
system_prompt="协调研究和审查,按需要调用专家,再向用户提供结论。",
|
|
35
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Native tasks are replayed through the configured checkpointer."""
|
|
2
|
+
from licos_agent_runtime.graphs import task, functional_agent
|
|
3
|
+
from licos_agent_runtime.interactions import ask_user
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@task
|
|
7
|
+
def measure(payload: dict) -> dict:
|
|
8
|
+
text = payload["input"]
|
|
9
|
+
return {"characters": len(text), "words": len(text.split())}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def create_agent(ctx):
|
|
13
|
+
@functional_agent(ctx=ctx)
|
|
14
|
+
async def execute(payload: dict) -> dict:
|
|
15
|
+
result = await measure(payload)
|
|
16
|
+
title = await ask_user("请填写结果标题")
|
|
17
|
+
return {"output": {"title": title, **result}}
|
|
18
|
+
return execute
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Direct conversation handoffs; explicitly enable memory/database checkpoints."""
|
|
2
|
+
from licos_agent_runtime.agent_handoff import build_handoff, model_handoff_agent
|
|
3
|
+
from licos_agent_runtime.harness_execution import HarnessRun
|
|
4
|
+
from licos_agent_runtime.subagents import Subagents
|
|
5
|
+
from licos_dev_sdk import resolve_llm_endpoint
|
|
6
|
+
|
|
7
|
+
from examples.experts import configured_model
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def create_agent(ctx):
|
|
11
|
+
snapshot = ctx.metadata["agent_project_config"]
|
|
12
|
+
config = snapshot.raw["config"]
|
|
13
|
+
endpoint = resolve_llm_endpoint(model=config["model"], model_group=config.get("model_group", "text"))
|
|
14
|
+
ctx.metadata["agent_harness_run"] = HarnessRun(
|
|
15
|
+
snapshot.harness, endpoint.context_length, config["max_completion_tokens"],
|
|
16
|
+
input_limit=endpoint.max_input_length,
|
|
17
|
+
)
|
|
18
|
+
shared_prompt = "\n\n".join((snapshot.raw["sp"], snapshot.raw["up"]))
|
|
19
|
+
team = Subagents([
|
|
20
|
+
model_handoff_agent(
|
|
21
|
+
"reception", "接待用户并明确需求",
|
|
22
|
+
model=configured_model(config), shared_prompt=shared_prompt,
|
|
23
|
+
system_prompt="先了解用户的问题。技术问题交给 support,并说明已确认的信息。",
|
|
24
|
+
destinations={"support": "排查和解释技术问题"}, memory="per_call",
|
|
25
|
+
),
|
|
26
|
+
model_handoff_agent(
|
|
27
|
+
"support", "直接帮助用户解决技术问题",
|
|
28
|
+
model=configured_model(config), shared_prompt=shared_prompt,
|
|
29
|
+
system_prompt="直接和用户沟通技术问题,必要时继续追问。非技术咨询交回 reception。",
|
|
30
|
+
destinations={"reception": "接待与非技术咨询"}, memory="per_call",
|
|
31
|
+
),
|
|
32
|
+
], ctx=ctx)
|
|
33
|
+
return build_handoff(team, initial_agent="reception", max_handoffs=8)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Use create_agent as the project's factory; enable checkpoints and interactions."""
|
|
2
|
+
from typing_extensions import TypedDict
|
|
3
|
+
|
|
4
|
+
from licos_agent_runtime.graphs import StateGraph, START, END, compile_graph, emit_progress
|
|
5
|
+
from licos_agent_runtime.interactions import ask_user
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class State(TypedDict, total=False):
|
|
9
|
+
input: str
|
|
10
|
+
detail: str
|
|
11
|
+
output: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
async def collect(state: State):
|
|
15
|
+
detail = await ask_user("请选择内容详略", kind="single_select", options=[
|
|
16
|
+
{"id": "brief", "label": "简要", "value": "brief"},
|
|
17
|
+
{"id": "full", "label": "详细", "value": "full"},
|
|
18
|
+
])
|
|
19
|
+
emit_progress({"stage": "choice_received", "detail": detail})
|
|
20
|
+
return {"detail": detail}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def confirm(state: State):
|
|
24
|
+
return {"output": f"已收到需求:{state['input']};选择:{state['detail']}"}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def create_agent(ctx):
|
|
28
|
+
builder = StateGraph(State)
|
|
29
|
+
builder.add_node("collect", collect)
|
|
30
|
+
builder.add_node("confirm", confirm)
|
|
31
|
+
builder.add_edge(START, "collect")
|
|
32
|
+
builder.add_edge("collect", "confirm")
|
|
33
|
+
builder.add_edge("confirm", END)
|
|
34
|
+
return compile_graph(builder, ctx=ctx)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Native Send and reducers; input example: {"items": ["a", "b", "c"]}."""
|
|
2
|
+
import operator
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
from typing_extensions import TypedDict
|
|
5
|
+
|
|
6
|
+
from licos_agent_runtime.graphs import StateGraph, START, END, compile_graph, CachePolicy, TimeoutPolicy
|
|
7
|
+
from licos_agent_runtime.subagents import dispatch
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class State(TypedDict, total=False):
|
|
11
|
+
items: list[str]
|
|
12
|
+
results: Annotated[list[dict], operator.add]
|
|
13
|
+
output: dict
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
async def inspect_item(state: dict):
|
|
17
|
+
text = state["text"]
|
|
18
|
+
return {"results": [{"text": text, "characters": len(text)}]}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def summarize(state: State):
|
|
22
|
+
return {"output": {"items": state["results"], "total": sum(item["characters"] for item in state["results"])}}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def create_agent(ctx):
|
|
26
|
+
builder = StateGraph(State)
|
|
27
|
+
builder.add_conditional_edges(START, lambda state: dispatch("inspect", [{"text": s} for s in state["items"]]))
|
|
28
|
+
builder.add_node("inspect", inspect_item, cache_policy=CachePolicy(ttl=60),
|
|
29
|
+
timeout=TimeoutPolicy(run_timeout=10))
|
|
30
|
+
builder.add_node("summarize", summarize)
|
|
31
|
+
builder.add_edge("inspect", "summarize")
|
|
32
|
+
builder.add_edge("summarize", END)
|
|
33
|
+
return compile_graph(builder, ctx=ctx)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""User-scoped Store tools. Enable agent_runtime.store before registering them."""
|
|
2
|
+
from langchain_core.tools import tool
|
|
3
|
+
from licos_agent_runtime.agent_components import agent_components
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@tool
|
|
7
|
+
async def save_preference(key: str, value: str) -> dict:
|
|
8
|
+
"""保存当前用户的一项偏好;返回实际存储的键和值。"""
|
|
9
|
+
store = agent_components().store
|
|
10
|
+
if store is None:
|
|
11
|
+
raise ValueError("Enable agent_runtime.store")
|
|
12
|
+
await store.aput(("preferences",), key, {"text": value}, ttl=30 * 24 * 60)
|
|
13
|
+
return {"key": key, "text": value}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@tool
|
|
17
|
+
async def search_preferences(query: str) -> list[dict]:
|
|
18
|
+
"""用真实语义检索查找当前用户偏好;需要已配置的嵌入模型。"""
|
|
19
|
+
store = agent_components().store
|
|
20
|
+
if store is None:
|
|
21
|
+
raise ValueError("Enable agent_runtime.store")
|
|
22
|
+
return [{"key": item.key, "value": item.value, "score": item.score}
|
|
23
|
+
for item in await store.asearch(("preferences",), query=query, limit=5)]
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
name = "<%= appName %>"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
description = "LICOS LangGraph agent project"
|
|
5
|
-
requires-python = ">=3.
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
6
|
dependencies = [
|
|
7
|
-
"licos-agent-runtime>=0.
|
|
8
|
-
"licos-platform-sdk>=0.7.
|
|
9
|
-
"licos-dev-sdk>=0.6.
|
|
7
|
+
"licos-agent-runtime>=0.6.7",
|
|
8
|
+
"licos-platform-sdk>=0.7.6",
|
|
9
|
+
"licos-dev-sdk>=0.6.6",
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
[tool.uv]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
licos-agent-runtime>=0.
|
|
2
|
-
licos-platform-sdk>=0.7.
|
|
3
|
-
licos-dev-sdk>=0.6.
|
|
1
|
+
licos-agent-runtime>=0.6.7
|
|
2
|
+
licos-platform-sdk>=0.7.6
|
|
3
|
+
licos-dev-sdk>=0.6.6
|
|
@@ -49,6 +49,8 @@ def create_agent(_ctx: Any = None) -> Any:
|
|
|
49
49
|
if _ctx is not None:
|
|
50
50
|
_ctx.metadata["agent_harness_run"] = harness_run
|
|
51
51
|
prompt = "\n\n".join((settings["sp"], settings["up"]))
|
|
52
|
+
# The runtime binds request-scoped agent_runtime components. The constructor
|
|
53
|
+
# uses those components without creating a database or replacing business tables.
|
|
52
54
|
return build_project_agent(
|
|
53
55
|
model, TOOLS, system_prompt=prompt, root=root, ctx=_ctx,
|
|
54
56
|
config_path=AGENT_CONFIG_PATH, harness=snapshot.harness, harness_run=harness_run,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const description = `Agent(智能体项目):\`licos init \${LICOS_PROJECT_PATH} --template agent\`
|
|
2
2
|
- 适用:Python + LangGraph/LangChain 智能体项目
|
|
3
3
|
- 使用 licos-agent-runtime 提供 /run、/stream_run、/cancel、OpenAI compatible 等运行时接口
|
|
4
|
+
- agent_runtime 分别配置状态、聊天、Store、交互及保存方式;默认内存,用户选择持久化才接数据库
|
|
5
|
+
- 支持子智能体、原生图、人工审批、状态恢复、分支和 Functional API;examples/ 提供按需示例
|
|
4
6
|
- 使用 config/agent_llm_config.json 维护模型、业务提示词和业务工具列表,并通过 /agent/config、/agent/canvas 暴露给预览
|
|
5
7
|
- 默认提供普通文件工具和 skills/<name>/SKILL.md 自动发现,技能资源按需只读加载
|
|
6
8
|
- 上传附件自动保存到当前用户的会话目录,支持 HTTP(S) URL 和 SDK 页的 base64 data URL;默认内置 download_file、upload_file,生成文件上传后返回真实下载链接,文档处理工具按需接入
|
|
@@ -41,6 +43,8 @@ const config = {
|
|
|
41
43
|
console.log('\nConfiguration:');
|
|
42
44
|
console.log(' - Runtime: licos-agent-runtime');
|
|
43
45
|
console.log(' - Framework: LangGraph + LangChain');
|
|
46
|
+
console.log(' - State storage: memory; enable database only when requested');
|
|
47
|
+
console.log(' - Optional capabilities and examples: examples/README.md');
|
|
44
48
|
console.log(` - Port: ${_context.port}`);
|
|
45
49
|
},
|
|
46
50
|
};
|
|
@@ -266,11 +266,11 @@ importers:
|
|
|
266
266
|
server:
|
|
267
267
|
dependencies:
|
|
268
268
|
'@kmlckj/licos-dev-sdk':
|
|
269
|
-
specifier: 0.4.
|
|
270
|
-
version: 0.4.
|
|
269
|
+
specifier: 0.4.3
|
|
270
|
+
version: 0.4.3
|
|
271
271
|
'@kmlckj/licos-platform-sdk':
|
|
272
|
-
specifier: 0.12.
|
|
273
|
-
version: 0.12.
|
|
272
|
+
specifier: 0.12.4
|
|
273
|
+
version: 0.12.4
|
|
274
274
|
cors:
|
|
275
275
|
specifier: ^2.8.5
|
|
276
276
|
version: 2.8.6
|
|
@@ -1324,13 +1324,12 @@ packages:
|
|
|
1324
1324
|
'@jridgewell/trace-mapping@0.3.31':
|
|
1325
1325
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
|
1326
1326
|
|
|
1327
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
1328
|
-
resolution: {integrity: sha512-
|
|
1327
|
+
'@kmlckj/licos-dev-sdk@0.4.3':
|
|
1328
|
+
resolution: {integrity: sha512-eMCSn4pz/jaUD1hWeX1VyE6MAXKynvWMGu1EwJV2xAXcjPAxGqx6qEttRWckB7bdxjYKpqI+ZuystY+QLaX0Nw==}
|
|
1329
1329
|
engines: {node: '>=18'}
|
|
1330
1330
|
|
|
1331
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
1332
|
-
resolution:
|
|
1333
|
-
integrity: sha512-tnz1RhmkEig6iGH0hUk8aWrDf+lMqKzUjfCntyTTLUYkVfThj/E5+u/TANeBEWlq12RUmnmvXE4jMMYsssIA+g==
|
|
1331
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
1332
|
+
resolution: {integrity: sha512-0/hvBCbwPGrfYIRKKhTk8xtxZbi9eqxWCVRqCaPATstPsMtJA8BphAIjnVQAb35yziyMyxGHgDkLNdo42sNXQQ==}
|
|
1334
1333
|
|
|
1335
1334
|
'@napi-rs/wasm-runtime@0.2.12':
|
|
1336
1335
|
resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==}
|
|
@@ -7515,9 +7514,9 @@ snapshots:
|
|
|
7515
7514
|
'@jridgewell/resolve-uri': 3.1.2
|
|
7516
7515
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
7517
7516
|
|
|
7518
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
7517
|
+
'@kmlckj/licos-dev-sdk@0.4.3': {}
|
|
7519
7518
|
|
|
7520
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
7519
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
7521
7520
|
dependencies:
|
|
7522
7521
|
ajv: 8.17.1
|
|
7523
7522
|
ajv-formats: 3.0.1(ajv@8.17.1)
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"lint": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@kmlckj/licos-dev-sdk": "0.4.
|
|
14
|
-
"@kmlckj/licos-platform-sdk": "0.12.
|
|
13
|
+
"@kmlckj/licos-dev-sdk": "0.4.3",
|
|
14
|
+
"@kmlckj/licos-platform-sdk": "0.12.4",
|
|
15
15
|
"cors": "^2.8.5",
|
|
16
16
|
"dayjs": "^1.11.19",
|
|
17
17
|
"dotenv": "^17.2.3",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"ts-check": "tsc -p tsconfig.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@kmlckj/licos-dev-sdk": "0.4.
|
|
18
|
-
"@kmlckj/licos-platform-sdk": "0.12.
|
|
17
|
+
"@kmlckj/licos-dev-sdk": "0.4.3",
|
|
18
|
+
"@kmlckj/licos-platform-sdk": "0.12.4",
|
|
19
19
|
"@aws-sdk/client-s3": "^3.958.0",
|
|
20
20
|
"@aws-sdk/lib-storage": "^3.958.0",
|
|
21
21
|
"@hookform/resolvers": "^5.2.2",
|
|
@@ -18,11 +18,11 @@ importers:
|
|
|
18
18
|
specifier: ^5.2.2
|
|
19
19
|
version: 5.4.0(react-hook-form@7.77.0(react@19.2.3))
|
|
20
20
|
'@kmlckj/licos-dev-sdk':
|
|
21
|
-
specifier: 0.4.
|
|
22
|
-
version: 0.4.
|
|
21
|
+
specifier: 0.4.3
|
|
22
|
+
version: 0.4.3
|
|
23
23
|
'@kmlckj/licos-platform-sdk':
|
|
24
|
-
specifier: 0.12.
|
|
25
|
-
version: 0.12.
|
|
24
|
+
specifier: 0.12.4
|
|
25
|
+
version: 0.12.4
|
|
26
26
|
'@radix-ui/react-accordion':
|
|
27
27
|
specifier: ^1.2.12
|
|
28
28
|
version: 1.2.12(@types/react-dom@19.2.3(@types/react@19.2.16))(@types/react@19.2.16)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
@@ -1380,13 +1380,12 @@ packages:
|
|
|
1380
1380
|
'@jridgewell/trace-mapping@0.3.31':
|
|
1381
1381
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
|
1382
1382
|
|
|
1383
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
1384
|
-
resolution: {integrity: sha512-
|
|
1383
|
+
'@kmlckj/licos-dev-sdk@0.4.3':
|
|
1384
|
+
resolution: {integrity: sha512-eMCSn4pz/jaUD1hWeX1VyE6MAXKynvWMGu1EwJV2xAXcjPAxGqx6qEttRWckB7bdxjYKpqI+ZuystY+QLaX0Nw==}
|
|
1385
1385
|
engines: {node: '>=18'}
|
|
1386
1386
|
|
|
1387
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
1388
|
-
resolution:
|
|
1389
|
-
integrity: sha512-tnz1RhmkEig6iGH0hUk8aWrDf+lMqKzUjfCntyTTLUYkVfThj/E5+u/TANeBEWlq12RUmnmvXE4jMMYsssIA+g==
|
|
1387
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
1388
|
+
resolution: {integrity: sha512-0/hvBCbwPGrfYIRKKhTk8xtxZbi9eqxWCVRqCaPATstPsMtJA8BphAIjnVQAb35yziyMyxGHgDkLNdo42sNXQQ==}
|
|
1390
1389
|
|
|
1391
1390
|
'@modelcontextprotocol/sdk@1.29.0':
|
|
1392
1391
|
resolution: {integrity: sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==}
|
|
@@ -6716,9 +6715,9 @@ snapshots:
|
|
|
6716
6715
|
'@jridgewell/resolve-uri': 3.1.2
|
|
6717
6716
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
6718
6717
|
|
|
6719
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
6718
|
+
'@kmlckj/licos-dev-sdk@0.4.3': {}
|
|
6720
6719
|
|
|
6721
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
6720
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
6722
6721
|
dependencies:
|
|
6723
6722
|
ajv: 8.17.1
|
|
6724
6723
|
ajv-formats: 3.0.1(ajv@8.17.1)
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"start": "bash ./scripts/start.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@kmlckj/licos-dev-sdk": "0.4.
|
|
21
|
-
"@kmlckj/licos-platform-sdk": "0.12.
|
|
20
|
+
"@kmlckj/licos-dev-sdk": "0.4.3",
|
|
21
|
+
"@kmlckj/licos-platform-sdk": "0.12.4",
|
|
22
22
|
"@nuxt/image": "2.0.0",
|
|
23
23
|
"nuxt": "4.3.1",
|
|
24
24
|
"tailwind-merge": "2.6.0",
|
|
@@ -13,11 +13,11 @@ importers:
|
|
|
13
13
|
.:
|
|
14
14
|
dependencies:
|
|
15
15
|
'@kmlckj/licos-dev-sdk':
|
|
16
|
-
specifier: 0.4.
|
|
17
|
-
version: 0.4.
|
|
16
|
+
specifier: 0.4.3
|
|
17
|
+
version: 0.4.3
|
|
18
18
|
'@kmlckj/licos-platform-sdk':
|
|
19
|
-
specifier: 0.12.
|
|
20
|
-
version: 0.12.
|
|
19
|
+
specifier: 0.12.4
|
|
20
|
+
version: 0.12.4
|
|
21
21
|
'@nuxt/image':
|
|
22
22
|
specifier: 2.0.0
|
|
23
23
|
version: 2.0.0(db0@0.3.4)(ioredis@5.11.0)(magicast@0.5.3)(srvx@0.11.16)
|
|
@@ -731,13 +731,12 @@ packages:
|
|
|
731
731
|
'@jridgewell/trace-mapping@0.3.31':
|
|
732
732
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
|
733
733
|
|
|
734
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
735
|
-
resolution: {integrity: sha512-
|
|
734
|
+
'@kmlckj/licos-dev-sdk@0.4.3':
|
|
735
|
+
resolution: {integrity: sha512-eMCSn4pz/jaUD1hWeX1VyE6MAXKynvWMGu1EwJV2xAXcjPAxGqx6qEttRWckB7bdxjYKpqI+ZuystY+QLaX0Nw==}
|
|
736
736
|
engines: {node: '>=18'}
|
|
737
737
|
|
|
738
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
739
|
-
resolution:
|
|
740
|
-
integrity: sha512-tnz1RhmkEig6iGH0hUk8aWrDf+lMqKzUjfCntyTTLUYkVfThj/E5+u/TANeBEWlq12RUmnmvXE4jMMYsssIA+g==
|
|
738
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
739
|
+
resolution: {integrity: sha512-0/hvBCbwPGrfYIRKKhTk8xtxZbi9eqxWCVRqCaPATstPsMtJA8BphAIjnVQAb35yziyMyxGHgDkLNdo42sNXQQ==}
|
|
741
740
|
|
|
742
741
|
'@koa/router@12.0.2':
|
|
743
742
|
resolution: {integrity: sha512-sYcHglGKTxGF+hQ6x67xDfkE9o+NhVlRHBqq6gLywaMc6CojK/5vFZByphdonKinYlMLkEkacm+HEse9HzwgTA==}
|
|
@@ -4773,9 +4772,9 @@ snapshots:
|
|
|
4773
4772
|
'@jridgewell/resolve-uri': 3.1.2
|
|
4774
4773
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
4775
4774
|
|
|
4776
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
4775
|
+
'@kmlckj/licos-dev-sdk@0.4.3': {}
|
|
4777
4776
|
|
|
4778
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
4777
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
4779
4778
|
dependencies:
|
|
4780
4779
|
ajv: 8.17.1
|
|
4781
4780
|
ajv-formats: 3.0.1(ajv@8.17.1)
|
|
@@ -181,11 +181,11 @@ importers:
|
|
|
181
181
|
server:
|
|
182
182
|
dependencies:
|
|
183
183
|
'@kmlckj/licos-dev-sdk':
|
|
184
|
-
specifier: 0.4.
|
|
185
|
-
version: 0.4.
|
|
184
|
+
specifier: 0.4.3
|
|
185
|
+
version: 0.4.3
|
|
186
186
|
'@kmlckj/licos-platform-sdk':
|
|
187
|
-
specifier: 0.12.
|
|
188
|
-
version: 0.12.
|
|
187
|
+
specifier: 0.12.4
|
|
188
|
+
version: 0.12.4
|
|
189
189
|
'@nestjs/common':
|
|
190
190
|
specifier: ^10.4.15
|
|
191
191
|
version: 10.4.22(reflect-metadata@0.2.2)(rxjs@7.8.2)
|
|
@@ -2590,12 +2590,12 @@ packages:
|
|
|
2590
2590
|
'@keyv/serialize@1.1.1':
|
|
2591
2591
|
resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==}
|
|
2592
2592
|
|
|
2593
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
2594
|
-
resolution: {integrity: sha512-
|
|
2593
|
+
'@kmlckj/licos-dev-sdk@0.4.3':
|
|
2594
|
+
resolution: {integrity: sha512-eMCSn4pz/jaUD1hWeX1VyE6MAXKynvWMGu1EwJV2xAXcjPAxGqx6qEttRWckB7bdxjYKpqI+ZuystY+QLaX0Nw==}
|
|
2595
2595
|
engines: {node: '>=18'}
|
|
2596
2596
|
|
|
2597
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
2598
|
-
resolution: {integrity: sha512-
|
|
2597
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
2598
|
+
resolution: {integrity: sha512-0/hvBCbwPGrfYIRKKhTk8xtxZbi9eqxWCVRqCaPATstPsMtJA8BphAIjnVQAb35yziyMyxGHgDkLNdo42sNXQQ==}
|
|
2599
2599
|
|
|
2600
2600
|
'@leejim/wxml-parser@0.1.6':
|
|
2601
2601
|
resolution: {integrity: sha512-1u4ULGK4GKkWhTlc3Hmac8PknrmpGd7qxZOTnT/Bm6EZ/wtonLgFhJ4vyuiUZpeCptnknOLkRpGx2Um9npwdZw==}
|
|
@@ -12408,9 +12408,9 @@ snapshots:
|
|
|
12408
12408
|
|
|
12409
12409
|
'@keyv/serialize@1.1.1': {}
|
|
12410
12410
|
|
|
12411
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
12411
|
+
'@kmlckj/licos-dev-sdk@0.4.3': {}
|
|
12412
12412
|
|
|
12413
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
12413
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
12414
12414
|
dependencies:
|
|
12415
12415
|
ajv: 8.17.1
|
|
12416
12416
|
ajv-formats: 3.0.1(ajv@8.17.1)
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"start:prod": "node dist/main"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@kmlckj/licos-dev-sdk": "0.4.
|
|
15
|
-
"@kmlckj/licos-platform-sdk": "0.12.
|
|
14
|
+
"@kmlckj/licos-dev-sdk": "0.4.3",
|
|
15
|
+
"@kmlckj/licos-platform-sdk": "0.12.4",
|
|
16
16
|
"@nestjs/common": "^10.4.15",
|
|
17
17
|
"@nestjs/core": "^10.4.15",
|
|
18
18
|
"@nestjs/platform-express": "^10.4.15",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"templates": [
|
|
4
4
|
{
|
|
5
5
|
"name": "agent",
|
|
6
|
-
"description": "Agent(智能体项目):`licos init ${LICOS_PROJECT_PATH} --template agent`\n- 适用:Python + LangGraph/LangChain 智能体项目\n- 使用 licos-agent-runtime 提供 /run、/stream_run、/cancel、OpenAI compatible 等运行时接口\n- 使用 config/agent_llm_config.json
|
|
6
|
+
"description": "Agent(智能体项目):`licos init ${LICOS_PROJECT_PATH} --template agent`\n- 适用:Python + LangGraph/LangChain 智能体项目\n- 使用 licos-agent-runtime 提供 /run、/stream_run、/cancel、OpenAI compatible 等运行时接口\n- agent_runtime 分别配置状态、聊天、Store、交互及保存方式;默认内存,用户选择持久化才接数据库\n- 支持子智能体、原生图、人工审批、状态恢复、分支和 Functional API;examples/ 提供按需示例\n- 使用 config/agent_llm_config.json 维护模型、业务提示词和业务工具列表,并通过 /agent/config、/agent/canvas 暴露给预览\n- 默认提供普通文件工具和 skills/<name>/SKILL.md 自动发现,技能资源按需只读加载\n- 上传附件自动保存到当前用户的会话目录,支持 HTTP(S) URL 和 SDK 页的 base64 data URL;默认内置 download_file、upload_file,生成文件上传后返回真实下载链接,文档处理工具按需接入\n- 项目源码位于 /workspace/projects,平台数据位于 /workspace/.licos",
|
|
7
7
|
"location": "./agent",
|
|
8
8
|
"paramsSchema": {
|
|
9
9
|
"type": "object",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"ts-check": "tsc -p tsconfig.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@kmlckj/licos-dev-sdk": "0.4.
|
|
18
|
-
"@kmlckj/licos-platform-sdk": "0.12.
|
|
17
|
+
"@kmlckj/licos-dev-sdk": "0.4.3",
|
|
18
|
+
"@kmlckj/licos-platform-sdk": "0.12.4",
|
|
19
19
|
"dotenv": "^17.2.3",
|
|
20
20
|
"express": "^4.21.2"
|
|
21
21
|
},
|
|
@@ -13,11 +13,11 @@ importers:
|
|
|
13
13
|
.:
|
|
14
14
|
dependencies:
|
|
15
15
|
'@kmlckj/licos-dev-sdk':
|
|
16
|
-
specifier: 0.4.
|
|
17
|
-
version: 0.4.
|
|
16
|
+
specifier: 0.4.3
|
|
17
|
+
version: 0.4.3
|
|
18
18
|
'@kmlckj/licos-platform-sdk':
|
|
19
|
-
specifier: 0.12.
|
|
20
|
-
version: 0.12.
|
|
19
|
+
specifier: 0.12.4
|
|
20
|
+
version: 0.12.4
|
|
21
21
|
dotenv:
|
|
22
22
|
specifier: ^17.2.3
|
|
23
23
|
version: 17.2.4
|
|
@@ -291,13 +291,12 @@ packages:
|
|
|
291
291
|
'@jridgewell/trace-mapping@0.3.31':
|
|
292
292
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
|
293
293
|
|
|
294
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
295
|
-
resolution: {integrity: sha512-
|
|
294
|
+
'@kmlckj/licos-dev-sdk@0.4.3':
|
|
295
|
+
resolution: {integrity: sha512-eMCSn4pz/jaUD1hWeX1VyE6MAXKynvWMGu1EwJV2xAXcjPAxGqx6qEttRWckB7bdxjYKpqI+ZuystY+QLaX0Nw==}
|
|
296
296
|
engines: {node: '>=18'}
|
|
297
297
|
|
|
298
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
299
|
-
resolution:
|
|
300
|
-
integrity: sha512-tnz1RhmkEig6iGH0hUk8aWrDf+lMqKzUjfCntyTTLUYkVfThj/E5+u/TANeBEWlq12RUmnmvXE4jMMYsssIA+g==
|
|
298
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
299
|
+
resolution: {integrity: sha512-0/hvBCbwPGrfYIRKKhTk8xtxZbi9eqxWCVRqCaPATstPsMtJA8BphAIjnVQAb35yziyMyxGHgDkLNdo42sNXQQ==}
|
|
301
300
|
|
|
302
301
|
'@nodelib/fs.scandir@2.1.5':
|
|
303
302
|
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
|
@@ -1751,9 +1750,9 @@ snapshots:
|
|
|
1751
1750
|
'@jridgewell/resolve-uri': 3.1.2
|
|
1752
1751
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
1753
1752
|
|
|
1754
|
-
'@kmlckj/licos-dev-sdk@0.4.
|
|
1753
|
+
'@kmlckj/licos-dev-sdk@0.4.3': {}
|
|
1755
1754
|
|
|
1756
|
-
'@kmlckj/licos-platform-sdk@0.12.
|
|
1755
|
+
'@kmlckj/licos-platform-sdk@0.12.4':
|
|
1757
1756
|
dependencies:
|
|
1758
1757
|
ajv: 8.17.1
|
|
1759
1758
|
ajv-formats: 3.0.1(ajv@8.17.1)
|
|
@@ -4,9 +4,9 @@ version = "0.1.0"
|
|
|
4
4
|
description = "LICOS LangGraph workflow project"
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
dependencies = [
|
|
7
|
-
"licos-agent-runtime>=0.
|
|
8
|
-
"licos-platform-sdk>=0.7.
|
|
9
|
-
"licos-dev-sdk>=0.6.
|
|
7
|
+
"licos-agent-runtime>=0.6.7",
|
|
8
|
+
"licos-platform-sdk>=0.7.6",
|
|
9
|
+
"licos-dev-sdk>=0.6.6",
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
[tool.uv]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
licos-agent-runtime>=0.
|
|
2
|
-
licos-platform-sdk>=0.7.
|
|
3
|
-
licos-dev-sdk>=0.6.
|
|
1
|
+
licos-agent-runtime>=0.6.7
|
|
2
|
+
licos-platform-sdk>=0.7.6
|
|
3
|
+
licos-dev-sdk>=0.6.6
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@kmlckj/licos-ai-cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "LICOS AI coding workspace CLI - project template engine and dev tools",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "kmlckj",
|
|
7
|
-
"bin": {
|
|
8
|
-
"licos": "bin/main"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"lib",
|
|
12
|
-
"bin",
|
|
13
|
-
"!lib/**/node_modules/**",
|
|
14
|
-
"!lib/**/.pnpm/**",
|
|
15
|
-
"!lib/**/.pnpm-store/**",
|
|
16
|
-
"!lib/**/dist/**",
|
|
17
|
-
"!lib/**/.next/**",
|
|
18
|
-
"!lib/**/.turbo/**"
|
|
19
|
-
],
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@iarna/toml": "^2.2.5",
|
|
22
|
-
"ajv": "^8.17.1",
|
|
23
|
-
"ajv-formats": "^3.0.1",
|
|
24
|
-
"change-case": "^5.4.4",
|
|
25
|
-
"commander": "~12.1.0",
|
|
26
|
-
"debug": "^4.3.7",
|
|
27
|
-
"ejs": "^3.1.10",
|
|
28
|
-
"fast-glob": "^3.3.3",
|
|
29
|
-
"js-yaml": "^4.1.0",
|
|
30
|
-
"minimist": "^1.2.5",
|
|
31
|
-
"shelljs": "^0.10.0"
|
|
32
|
-
},
|
|
33
|
-
"publishConfig": {
|
|
34
|
-
"access": "public",
|
|
35
|
-
"registry": "https://registry.npmjs.org"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@kmlckj/licos-ai-cli",
|
|
3
|
+
"version": "1.7.0",
|
|
4
|
+
"description": "LICOS AI coding workspace CLI - project template engine and dev tools",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "kmlckj",
|
|
7
|
+
"bin": {
|
|
8
|
+
"licos": "bin/main"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"bin",
|
|
13
|
+
"!lib/**/node_modules/**",
|
|
14
|
+
"!lib/**/.pnpm/**",
|
|
15
|
+
"!lib/**/.pnpm-store/**",
|
|
16
|
+
"!lib/**/dist/**",
|
|
17
|
+
"!lib/**/.next/**",
|
|
18
|
+
"!lib/**/.turbo/**"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@iarna/toml": "^2.2.5",
|
|
22
|
+
"ajv": "^8.17.1",
|
|
23
|
+
"ajv-formats": "^3.0.1",
|
|
24
|
+
"change-case": "^5.4.4",
|
|
25
|
+
"commander": "~12.1.0",
|
|
26
|
+
"debug": "^4.3.7",
|
|
27
|
+
"ejs": "^3.1.10",
|
|
28
|
+
"fast-glob": "^3.3.3",
|
|
29
|
+
"js-yaml": "^4.1.0",
|
|
30
|
+
"minimist": "^1.2.5",
|
|
31
|
+
"shelljs": "^0.10.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"registry": "https://registry.npmjs.org"
|
|
36
|
+
}
|
|
37
|
+
}
|