draftgo-cli 3.0.55 → 3.0.56
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "draftgo-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.56",
|
|
4
4
|
"description": "Install and manage the DraftGo skill across AI coding agents (Claude Code, Codex, Cursor, Windsurf, Antigravity, Copilot, Gemini, Kiro).",
|
|
5
5
|
"bin": {
|
|
6
6
|
"draftgo": "bin/draftgo.js"
|
|
@@ -44,7 +44,8 @@ AIHub 是结构化远端资源,不 checkout,也不生成本地镜像。先
|
|
|
44
44
|
| `ttft_timeout` | number(秒,1–600,空=不启用) | 首字超时 failover:首个 SSE data 事件超时即跨模型+跨供应商切换,推理模型不误杀 |
|
|
45
45
|
| `sync_request_timeout` | number(秒,1–600,默认 100) | 非流式请求上限 |
|
|
46
46
|
| `stream_ttl` | number(秒,1–3600,默认 600) | 流式请求上限 |
|
|
47
|
-
| `
|
|
47
|
+
| `max_tokens` | number / 空 | 最大输出 token;留空时不写入请求,即不由 Agent 额外限制 |
|
|
48
|
+
| `reasoning_effort` | `off`/`minimal`/`low`/`medium`/`high` | `off`/留空均不透传;其它值仅 OpenAI 系模型生效 |
|
|
48
49
|
| `system_prompt_template` | string | 系统提示模板 |
|
|
49
50
|
| `context.max_history` | number(默认 20) | 工作窗口:保留最近 N 条;关闭持续对话时即滑动窗口硬上限 |
|
|
50
51
|
| `output_format.mode` | `text` / `json` | JSON 时按 `output_format.json.{schema,schema_name,strategy}` 约束/校验/降级 |
|
|
@@ -68,7 +69,9 @@ AIHub 是结构化远端资源,不 checkout,也不生成本地镜像。先
|
|
|
68
69
|
| `memory.{enabled,scope}` | false / `user_agent` | 长期记忆:对话后自动提炼、下轮召回注入;作用域 `agent`/`user`/`user_agent` |
|
|
69
70
|
| `compaction.{enabled,keep_recent,trigger_messages,trigger_tokens,preset}` | 关闭 | **持续对话/上下文闭环**:见下 |
|
|
70
71
|
| `checkpoint_input_mode` / `checkpoint_max_messages` / `checkpoint_ttl_seconds` | 全量 / 100 / 86400 | 会话历史持久化(配合请求 `session_id`) |
|
|
71
|
-
| `delegation.{max_depth,max_total_calls}` | 2 / 8 |
|
|
72
|
+
| `delegation.{max_depth,max_total_calls}` | 2 / 8 | 最大嵌套层数与整棵调用树共享的子 Agent 调用次数;并行分支也从同一预算扣减 |
|
|
73
|
+
|
|
74
|
+
同一模型步骤返回多个子 Agent 工具调用时,运行时立即按 `tool_concurrency` 并发执行;不同步骤自然串行,由模型自行决定编排方式。委派成功后,子 Agent 的每个模型回合 token 会汇总到入口 run,总量也写入对应委派 span。一次入口请求只创建一条主 run,Agent 列归属入口 Agent,委派链路从 span 查看。
|
|
72
75
|
|
|
73
76
|
### 持续对话(上下文闭环)
|
|
74
77
|
|
|
@@ -85,4 +88,6 @@ AIHub 是结构化远端资源,不 checkout,也不生成本地镜像。先
|
|
|
85
88
|
每次调用都开一条 AI run,管理台 `/admin/ai-runs` 展示状态、tokens、延迟、`ttft_ms` 与 span 链路。
|
|
86
89
|
运行记录接口通过 MCP `draftgo_api_search` / `draftgo_api_describe` 实时发现,不维护静态路径表。
|
|
87
90
|
|
|
91
|
+
Agent 对外响应(`/api/agents/{id}/chat`、图片接口、Go/Script SDK Agent 调用)不返回内部 `model`、`fallback_models` 或 `upstream_model`;错误也不暴露内部模型名、供应商名称、服务地址或运行时实现名。只有显式启用 `model_selection.user_selectable` 后,`/selectable-models` 才作为授权的模型选择目录返回可选逻辑模型名。运行日志仍在服务端保留真实模型、供应商与链路信息用于定位。
|
|
92
|
+
|
|
88
93
|
> 权威细节以 DraftGo 后端 `docs/backend/modules/agent-runtime.md` 为准;本页是基座开发者视角的字段速查。
|
|
@@ -165,6 +165,9 @@ chat.addEventListener('dg-chat:run-finish', event => {
|
|
|
165
165
|
- `persist` 默认开启,将 UI thread 历史写入 `localStorage`;敏感或临时页面设为 `false`。
|
|
166
166
|
- 同一路由存在多个实例时,每个实例设置唯一 `storageKey`。
|
|
167
167
|
- 每个 UI thread 自动维护独立 `sessionId`;`draftgo-agent` 将其作为 `session_id` 发送。
|
|
168
|
+
- 切换会话只改变当前视图,不会停止其它 thread 的在途请求。会话列表标题左侧显示运行中状态;后台完成或失败后显示未读状态,进入该会话即视为已读并清除。
|
|
169
|
+
- 每个请求使用独立 `run_id`。用户停止或 SDK 超时会调用 Agent 取消接口;普通会话切换不会发送取消。
|
|
170
|
+
- 推理片段和工具调用按服务端事件的输出位置保留在消息内,不固定贴在消息底部;思考在正文、工具或结束事件到达后进入完成态,不再闪烁或滚动预览。
|
|
168
171
|
- `newThread()` 创建新的后端会话边界;不要让不同用户共享固定 `storageKey` 或 `sessionId`。
|
|
169
172
|
- `clear()` 和 `setMessages([])` 会重置当前 session,避免视觉清空后恢复旧 checkpoint。
|
|
170
173
|
|
|
@@ -197,5 +200,12 @@ chat.configure({ protocol: 'page-protocol' });
|
|
|
197
200
|
- 页面 HTML、JSON config、`headers`、`context` 和 `localStorage` 中不得保存长期供应商密钥。
|
|
198
201
|
- 不把模型输出直接赋给 `innerHTML`;使用 SDK 内置 Markdown/URL 安全渲染或显式净化。
|
|
199
202
|
- 后端始终负责 Agent 调用权限、模型白名单、附件能力和大小限制,前端开关不能越权。
|
|
203
|
+
- Agent 协议响应不应包含 Agent 内部模型名。模型选择器只能读取 Agent 明确授权的 `/selectable-models` 目录。
|
|
200
204
|
|
|
201
205
|
交付前确认:只加载一个完整版脚本;新页面以 `<dg-chat>` 为对话 UI;同页多实例隔离 `storageKey`;外部协议走服务端代理;页面离开时停止在途请求。
|
|
206
|
+
|
|
207
|
+
## 移动端契约
|
|
208
|
+
|
|
209
|
+
- `inline`、`floating`、`drawer`、`fullscreen` 四种 surface 均由 SDK 自适应窄屏;`threads`、`workspace` 和 Artifact 会按容器宽度自动收敛为单栏,不要复制 Shadow DOM 内部布局规则。
|
|
210
|
+
- SDK 使用 `VisualViewport` 和 `safe-area-inset-*` 跟随软键盘、浏览器工具栏与横竖屏变化。触摸设备打开面板时不会主动弹出软键盘。
|
|
211
|
+
- 触摸端按钮和行操作具有移动端点击尺寸,输入字号防止 iOS 自动缩放;所有内部滚动区隐藏滚动条,但仍保留触摸、滚轮和键盘滚动能力。
|
|
@@ -181,6 +181,8 @@ draftgo.Log.Info("service completed")
|
|
|
181
181
|
reply, err := draftgo.AIHub.Chat(draftgo.Context(), sdk.AIChatRequest{
|
|
182
182
|
AgentID: 12,
|
|
183
183
|
Message: "总结订单",
|
|
184
|
+
SessionID: "optional-conversation-id",
|
|
185
|
+
RunID: "optional-client-run-id",
|
|
184
186
|
})
|
|
185
187
|
|
|
186
188
|
direct, err := draftgo.AIHub.Chat(draftgo.Context(), sdk.AIChatRequest{
|