newtype-profile 1.0.61 → 1.0.63
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 +67 -19
- package/README.zh-cn.md +67 -19
- package/dist/cli/index.js +1 -1
- package/dist/hooks/chief-orchestrator/confidence-router.d.ts +10 -0
- package/dist/hooks/chief-orchestrator/quality-dimensions.d.ts +5 -0
- package/dist/hooks/chief-orchestrator/shared-context.d.ts +1 -0
- package/dist/index.js +352 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,36 @@ newtype-profile is an AI Agent collaboration framework designed for **content cr
|
|
|
28
28
|
- 🔍 Information research and fact-checking
|
|
29
29
|
- 📄 Document extraction and organization
|
|
30
30
|
|
|
31
|
+
## Two Ways to Use
|
|
32
|
+
|
|
33
|
+
### Option A: Newtype CLI (Recommended)
|
|
34
|
+
|
|
35
|
+
[**Newtype CLI**](https://www.npmjs.com/package/newtype-cli) is a standalone terminal AI assistant with newtype-profile built-in. No plugin setup needed — install and go.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g newtype-cli
|
|
39
|
+
newtype
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Newtype CLI is a white-labeled fork of [OpenCode](https://github.com/anomalyco/opencode) with the full agent team pre-configured.
|
|
43
|
+
|
|
44
|
+
### Option B: As an OpenCode Plugin
|
|
45
|
+
|
|
46
|
+
If you already use OpenCode and want to add newtype-profile as a plugin:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd ~/.config/opencode
|
|
50
|
+
bun add newtype-profile
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Edit `~/.config/opencode/opencode.json`:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"plugin": ["newtype-profile"]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
31
61
|
## Agent Team
|
|
32
62
|
|
|
33
63
|
| Agent | Role | Description |
|
|
@@ -41,40 +71,41 @@ newtype-profile is an AI Agent collaboration framework designed for **content cr
|
|
|
41
71
|
| **writer** | Writer | Content production |
|
|
42
72
|
| **editor** | Editor | Content refinement |
|
|
43
73
|
|
|
44
|
-
##
|
|
74
|
+
## Configure Models
|
|
45
75
|
|
|
46
|
-
|
|
76
|
+
Create a config file to customize which models each agent uses:
|
|
47
77
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
bun add newtype-profile
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Edit `~/.config/opencode/opencode.json`:
|
|
78
|
+
- **Newtype CLI**: `~/.config/newtype/newtype-profile.json`
|
|
79
|
+
- **OpenCode plugin**: `~/.config/opencode/newtype-profile.json`
|
|
54
80
|
|
|
55
81
|
```json
|
|
56
82
|
{
|
|
57
|
-
"
|
|
83
|
+
"agents": {
|
|
84
|
+
"chief": { "model": "your-preferred-model" },
|
|
85
|
+
"deputy": { "model": "your-preferred-model" },
|
|
86
|
+
"researcher": { "model": "your-preferred-model" },
|
|
87
|
+
"writer": { "model": "your-preferred-model", "temperature": 0.7 }
|
|
88
|
+
}
|
|
58
89
|
}
|
|
59
90
|
```
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
All 8 agents (`chief`, `deputy`, `researcher`, `fact-checker`, `archivist`, `extractor`, `writer`, `editor`) can be configured independently.
|
|
62
93
|
|
|
63
|
-
|
|
94
|
+
<details>
|
|
95
|
+
<summary>Optional: Google Antigravity OAuth</summary>
|
|
96
|
+
|
|
97
|
+
If using Google Antigravity as your model provider, add `google_auth`:
|
|
64
98
|
|
|
65
99
|
```json
|
|
66
100
|
{
|
|
67
101
|
"google_auth": true,
|
|
68
102
|
"agents": {
|
|
69
|
-
"chief": { "model": "google/antigravity-claude-opus-4-5-thinking-high" }
|
|
70
|
-
"researcher": { "model": "google/antigravity-gemini-3-pro-high" },
|
|
71
|
-
"writer": { "model": "google/antigravity-gemini-3-pro-high" },
|
|
72
|
-
"editor": { "model": "google/antigravity-claude-sonnet-4-5" }
|
|
103
|
+
"chief": { "model": "google/antigravity-claude-opus-4-5-thinking-high" }
|
|
73
104
|
}
|
|
74
105
|
}
|
|
75
106
|
```
|
|
76
107
|
|
|
77
|
-
|
|
108
|
+
Then authenticate:
|
|
78
109
|
|
|
79
110
|
```bash
|
|
80
111
|
opencode auth login
|
|
@@ -82,6 +113,8 @@ opencode auth login
|
|
|
82
113
|
# Select Login method: OAuth with Google (Antigravity)
|
|
83
114
|
```
|
|
84
115
|
|
|
116
|
+
</details>
|
|
117
|
+
|
|
85
118
|
## Usage
|
|
86
119
|
|
|
87
120
|
### Three-Layer Architecture
|
|
@@ -116,7 +149,7 @@ Chief's personality has three layers:
|
|
|
116
149
|
- **Inner Persona** (hardcoded): Core values and thinking patterns
|
|
117
150
|
- **Outer Persona** (customizable): Communication style
|
|
118
151
|
|
|
119
|
-
Create `.opencode/SOUL.md` to customize how Chief communicates:
|
|
152
|
+
Create `.opencode/SOUL.md` (or `.newtype/SOUL.md` for Newtype CLI) to customize how Chief communicates:
|
|
120
153
|
|
|
121
154
|
```bash
|
|
122
155
|
/init-soul # Creates default SOUL.md template
|
|
@@ -127,7 +160,7 @@ Example customizations:
|
|
|
127
160
|
- Adjust language preferences
|
|
128
161
|
- Change how direct Chief is
|
|
129
162
|
|
|
130
|
-
Changes take effect after restarting
|
|
163
|
+
Changes take effect after restarting.
|
|
131
164
|
|
|
132
165
|
### Built-in Skills
|
|
133
166
|
|
|
@@ -166,7 +199,7 @@ Built-in MCPs:
|
|
|
166
199
|
|
|
167
200
|
## Memory System
|
|
168
201
|
|
|
169
|
-
Auto-saves conversation summaries to `.opencode/memory
|
|
202
|
+
Auto-saves conversation summaries to `.opencode/memory/` (or `.newtype/memory/`):
|
|
170
203
|
- Daily summaries (LLM-generated)
|
|
171
204
|
- Full transcripts per session
|
|
172
205
|
- Auto-archive to `MEMORY.md` after 7 days
|
|
@@ -180,6 +213,21 @@ Use `/memory-consolidate` to manually trigger consolidation.
|
|
|
180
213
|
- **Startup Config Checker**: Guides model setup on first run
|
|
181
214
|
- **Plugin Switching**: `/switch newtype` / `/switch omo` / `/switch none`
|
|
182
215
|
|
|
216
|
+
## Newtype CLI
|
|
217
|
+
|
|
218
|
+
[Newtype CLI](https://www.npmjs.com/package/newtype-cli) is a standalone product that bundles newtype-profile into a ready-to-use terminal AI assistant.
|
|
219
|
+
|
|
220
|
+
| | newtype-profile (plugin) | Newtype CLI |
|
|
221
|
+
|---|---|---|
|
|
222
|
+
| **Install** | `bun add newtype-profile` in OpenCode | `npm install -g newtype-cli` |
|
|
223
|
+
| **Requires** | OpenCode installed separately | Nothing — self-contained |
|
|
224
|
+
| **Launch** | `opencode` | `newtype` |
|
|
225
|
+
| **Config dir** | `~/.config/opencode/` | `~/.config/newtype/` |
|
|
226
|
+
| **Project dir** | `.opencode/` | `.newtype/` |
|
|
227
|
+
| **npm package** | [newtype-profile](https://www.npmjs.com/package/newtype-profile) | [newtype-cli](https://www.npmjs.com/package/newtype-cli) |
|
|
228
|
+
|
|
229
|
+
Supported platforms: macOS (Apple Silicon & Intel), Linux (x64 & ARM64, glibc & musl), Windows (x64).
|
|
230
|
+
|
|
183
231
|
## License
|
|
184
232
|
|
|
185
233
|
Based on [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode), follows [SUL-1.0 License](https://github.com/code-yeongyu/oh-my-opencode/blob/master/LICENSE.md).
|
package/README.zh-cn.md
CHANGED
|
@@ -28,6 +28,36 @@ newtype-profile 是专为**内容创作**设计的 AI Agent 协作框架:
|
|
|
28
28
|
- 🔍 信息调研与核查
|
|
29
29
|
- 📄 文档提取与整理
|
|
30
30
|
|
|
31
|
+
## 两种使用方式
|
|
32
|
+
|
|
33
|
+
### 方式 A:Newtype CLI(推荐)
|
|
34
|
+
|
|
35
|
+
[**Newtype CLI**](https://www.npmjs.com/package/newtype-cli) 是独立的终端 AI 助手,已内置 newtype-profile。无需额外配置插件,安装即用。
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g newtype-cli
|
|
39
|
+
newtype
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Newtype CLI 基于 [OpenCode](https://github.com/anomalyco/opencode) 定制,预配置了完整的 Agent 团队。
|
|
43
|
+
|
|
44
|
+
### 方式 B:作为 OpenCode 插件
|
|
45
|
+
|
|
46
|
+
如果你已在使用 OpenCode,可以将 newtype-profile 作为插件添加:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd ~/.config/opencode
|
|
50
|
+
bun add newtype-profile
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
编辑 `~/.config/opencode/opencode.json`:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"plugin": ["newtype-profile"]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
31
61
|
## Agent 团队
|
|
32
62
|
|
|
33
63
|
| Agent | 角色 | 职责描述 |
|
|
@@ -41,40 +71,41 @@ newtype-profile 是专为**内容创作**设计的 AI Agent 协作框架:
|
|
|
41
71
|
| **writer** | 写手 | 内容生产 |
|
|
42
72
|
| **editor** | 编辑 | 内容精炼 |
|
|
43
73
|
|
|
44
|
-
##
|
|
74
|
+
## 配置模型
|
|
45
75
|
|
|
46
|
-
|
|
76
|
+
创建配置文件来自定义各 Agent 使用的模型:
|
|
47
77
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
bun add newtype-profile
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
编辑 `~/.config/opencode/opencode.json`:
|
|
78
|
+
- **Newtype CLI**:`~/.config/newtype/newtype-profile.json`
|
|
79
|
+
- **OpenCode 插件**:`~/.config/opencode/newtype-profile.json`
|
|
54
80
|
|
|
55
81
|
```json
|
|
56
82
|
{
|
|
57
|
-
"
|
|
83
|
+
"agents": {
|
|
84
|
+
"chief": { "model": "你偏好的模型" },
|
|
85
|
+
"deputy": { "model": "你偏好的模型" },
|
|
86
|
+
"researcher": { "model": "你偏好的模型" },
|
|
87
|
+
"writer": { "model": "你偏好的模型", "temperature": 0.7 }
|
|
88
|
+
}
|
|
58
89
|
}
|
|
59
90
|
```
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
全部 8 个 Agent(`chief`、`deputy`、`researcher`、`fact-checker`、`archivist`、`extractor`、`writer`、`editor`)均可独立配置。
|
|
62
93
|
|
|
63
|
-
|
|
94
|
+
<details>
|
|
95
|
+
<summary>可选:Google Antigravity OAuth</summary>
|
|
96
|
+
|
|
97
|
+
如果使用 Google Antigravity 作为模型提供商,添加 `google_auth`:
|
|
64
98
|
|
|
65
99
|
```json
|
|
66
100
|
{
|
|
67
101
|
"google_auth": true,
|
|
68
102
|
"agents": {
|
|
69
|
-
"chief": { "model": "google/antigravity-claude-opus-4-5-thinking-high" }
|
|
70
|
-
"researcher": { "model": "google/antigravity-gemini-3-pro-high" },
|
|
71
|
-
"writer": { "model": "google/antigravity-gemini-3-pro-high" },
|
|
72
|
-
"editor": { "model": "google/antigravity-claude-sonnet-4-5" }
|
|
103
|
+
"chief": { "model": "google/antigravity-claude-opus-4-5-thinking-high" }
|
|
73
104
|
}
|
|
74
105
|
}
|
|
75
106
|
```
|
|
76
107
|
|
|
77
|
-
|
|
108
|
+
然后认证:
|
|
78
109
|
|
|
79
110
|
```bash
|
|
80
111
|
opencode auth login
|
|
@@ -82,6 +113,8 @@ opencode auth login
|
|
|
82
113
|
# 选择 Login method: OAuth with Google (Antigravity)
|
|
83
114
|
```
|
|
84
115
|
|
|
116
|
+
</details>
|
|
117
|
+
|
|
85
118
|
## 使用方式
|
|
86
119
|
|
|
87
120
|
### 三层架构
|
|
@@ -116,7 +149,7 @@ Chief 的人格分三层:
|
|
|
116
149
|
- **里人格**(硬编码):核心价值观和思维方式
|
|
117
150
|
- **表人格**(可自定义):沟通风格
|
|
118
151
|
|
|
119
|
-
创建 `.opencode/SOUL.md
|
|
152
|
+
创建 `.opencode/SOUL.md`(Newtype CLI 为 `.newtype/SOUL.md`)来自定义 Chief 的沟通风格:
|
|
120
153
|
|
|
121
154
|
```bash
|
|
122
155
|
/init-soul # 创建默认 SOUL.md 模板
|
|
@@ -127,7 +160,7 @@ Chief 的人格分三层:
|
|
|
127
160
|
- 调整语言偏好
|
|
128
161
|
- 改变直接程度
|
|
129
162
|
|
|
130
|
-
|
|
163
|
+
修改后重启生效。
|
|
131
164
|
|
|
132
165
|
### 内置 Skills
|
|
133
166
|
|
|
@@ -166,7 +199,7 @@ Chief 在任务需要时自动加载技能。
|
|
|
166
199
|
|
|
167
200
|
## 记忆系统
|
|
168
201
|
|
|
169
|
-
自动保存对话摘要到 `.opencode/memory
|
|
202
|
+
自动保存对话摘要到 `.opencode/memory/`(Newtype CLI 为 `.newtype/memory/`):
|
|
170
203
|
- 每日摘要(LLM 生成)
|
|
171
204
|
- 每个 session 的完整记录
|
|
172
205
|
- 7 天后自动归档到 `MEMORY.md`
|
|
@@ -180,6 +213,21 @@ Chief 在任务需要时自动加载技能。
|
|
|
180
213
|
- **启动配置检查**:首次运行时引导模型设置
|
|
181
214
|
- **插件切换**:`/switch newtype` / `/switch omo` / `/switch none`
|
|
182
215
|
|
|
216
|
+
## Newtype CLI
|
|
217
|
+
|
|
218
|
+
[Newtype CLI](https://www.npmjs.com/package/newtype-cli) 是独立产品,将 newtype-profile 打包为开箱即用的终端 AI 助手。
|
|
219
|
+
|
|
220
|
+
| | newtype-profile(插件) | Newtype CLI |
|
|
221
|
+
|---|---|---|
|
|
222
|
+
| **安装** | 在 OpenCode 中 `bun add newtype-profile` | `npm install -g newtype-cli` |
|
|
223
|
+
| **依赖** | 需要单独安装 OpenCode | 无需其他依赖,自包含 |
|
|
224
|
+
| **启动** | `opencode` | `newtype` |
|
|
225
|
+
| **配置目录** | `~/.config/opencode/` | `~/.config/newtype/` |
|
|
226
|
+
| **项目目录** | `.opencode/` | `.newtype/` |
|
|
227
|
+
| **npm 包** | [newtype-profile](https://www.npmjs.com/package/newtype-profile) | [newtype-cli](https://www.npmjs.com/package/newtype-cli) |
|
|
228
|
+
|
|
229
|
+
支持平台:macOS(Apple Silicon 和 Intel)、Linux(x64 和 ARM64,glibc 和 musl)、Windows(x64)。
|
|
230
|
+
|
|
183
231
|
## 许可证
|
|
184
232
|
|
|
185
233
|
基于 [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) 修改,遵循 [SUL-1.0 许可证](https://github.com/code-yeongyu/oh-my-opencode/blob/master/LICENSE.md)。
|
package/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "newtype-profile",
|
|
2256
|
-
version: "1.0.
|
|
2256
|
+
version: "1.0.63",
|
|
2257
2257
|
description: "AI Agent Collaboration System for Content Creation - Based on oh-my-opencode",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -66,3 +66,13 @@ export declare function detectAgentType(output: string, category?: string): Agen
|
|
|
66
66
|
* Check if output contains a confidence score
|
|
67
67
|
*/
|
|
68
68
|
export declare function hasConfidenceScore(output: string): boolean;
|
|
69
|
+
export interface FailureJournalEntry {
|
|
70
|
+
timestamp: string;
|
|
71
|
+
agentType: AgentType;
|
|
72
|
+
confidence: number;
|
|
73
|
+
attempts: number;
|
|
74
|
+
outputExcerpt: string;
|
|
75
|
+
sessionId: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function buildFailureJournalEntry(agentType: AgentType, confidence: number, attempts: number, output: string, sessionId: string): FailureJournalEntry;
|
|
78
|
+
export declare function formatFailureJournalMarkdown(entry: FailureJournalEntry): string;
|
|
@@ -57,3 +57,8 @@ export declare function buildImprovementDirective(assessment: QualityAssessment,
|
|
|
57
57
|
* Check if output has quality scores (either format)
|
|
58
58
|
*/
|
|
59
59
|
export declare function hasQualityScores(output: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Build a warning directive when an agent's output lacks quality scores.
|
|
62
|
+
* Tells Chief what dimensions to expect and how to request them.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildMissingScoresWarning(agentType: AgentType, sessionId: string): string;
|
|
@@ -53,3 +53,4 @@ export declare function getArtifactDetails(sessionID: string, artifactIds: strin
|
|
|
53
53
|
export declare function getAllSources(sessionID: string): Source[];
|
|
54
54
|
export declare function getAllFindings(sessionID: string): Finding[];
|
|
55
55
|
export declare function hasArtifacts(output: string): boolean;
|
|
56
|
+
export declare function buildDetailedContextSummary(sessionID: string, downstreamAgent?: string): string | null;
|
package/dist/index.js
CHANGED
|
@@ -7852,7 +7852,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
7852
7852
|
}
|
|
7853
7853
|
var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
7854
7854
|
function getTime(strictTimeZone) {
|
|
7855
|
-
return function
|
|
7855
|
+
return function time3(str2) {
|
|
7856
7856
|
const matches = TIME.exec(str2);
|
|
7857
7857
|
if (!matches)
|
|
7858
7858
|
return false;
|
|
@@ -22427,7 +22427,7 @@ to resume: chief_task(resume="${sessionId}", prompt="...")`;
|
|
|
22427
22427
|
}
|
|
22428
22428
|
// src/hooks/chief-orchestrator/index.ts
|
|
22429
22429
|
import { execSync as execSync2 } from "child_process";
|
|
22430
|
-
import { existsSync as existsSync39, readdirSync as readdirSync14 } from "fs";
|
|
22430
|
+
import { existsSync as existsSync39, readdirSync as readdirSync14, appendFileSync as appendFileSync6, mkdirSync as mkdirSync12 } from "fs";
|
|
22431
22431
|
import { join as join47 } from "path";
|
|
22432
22432
|
// src/features/boulder-state/constants.ts
|
|
22433
22433
|
var BOULDER_DIR = ".chief";
|
|
@@ -22974,6 +22974,36 @@ function detectAgentType(output, category) {
|
|
|
22974
22974
|
function hasConfidenceScore(output) {
|
|
22975
22975
|
return extractConfidence(output) !== null;
|
|
22976
22976
|
}
|
|
22977
|
+
function buildFailureJournalEntry(agentType, confidence, attempts, output, sessionId) {
|
|
22978
|
+
const excerpt = output.slice(0, 1000).replace(/\n{3,}/g, `
|
|
22979
|
+
|
|
22980
|
+
`);
|
|
22981
|
+
return {
|
|
22982
|
+
timestamp: new Date().toISOString(),
|
|
22983
|
+
agentType,
|
|
22984
|
+
confidence,
|
|
22985
|
+
attempts,
|
|
22986
|
+
outputExcerpt: excerpt,
|
|
22987
|
+
sessionId
|
|
22988
|
+
};
|
|
22989
|
+
}
|
|
22990
|
+
function formatFailureJournalMarkdown(entry) {
|
|
22991
|
+
const confPct = Math.round(entry.confidence * 100);
|
|
22992
|
+
return `## Escalation: ${entry.agentType} (${entry.timestamp.split("T")[0]})
|
|
22993
|
+
|
|
22994
|
+
- **Agent**: ${entry.agentType}
|
|
22995
|
+
- **Confidence**: ${confPct}%
|
|
22996
|
+
- **Rewrite attempts**: ${entry.attempts}
|
|
22997
|
+
- **Session**: ${entry.sessionId}
|
|
22998
|
+
|
|
22999
|
+
### Last Output Excerpt
|
|
23000
|
+
\`\`\`
|
|
23001
|
+
${entry.outputExcerpt}
|
|
23002
|
+
\`\`\`
|
|
23003
|
+
|
|
23004
|
+
---
|
|
23005
|
+
`;
|
|
23006
|
+
}
|
|
22977
23007
|
|
|
22978
23008
|
// src/hooks/chief-orchestrator/quality-dimensions.ts
|
|
22979
23009
|
var AGENT_DIMENSIONS = {
|
|
@@ -23349,6 +23379,40 @@ function getImprovementCategory(agentType, weakDimension) {
|
|
|
23349
23379
|
function hasQualityScores(output) {
|
|
23350
23380
|
return /\*\*QUALITY SCORES:\*\*/i.test(output) || /\*\*CONFIDENCE:\s*[\d.]+\*\*/i.test(output);
|
|
23351
23381
|
}
|
|
23382
|
+
function buildMissingScoresWarning(agentType, sessionId) {
|
|
23383
|
+
const dimensions = AGENT_DIMENSIONS[agentType];
|
|
23384
|
+
const dimList = dimensions.map((d) => d.label).join(", ");
|
|
23385
|
+
const agentLabels = {
|
|
23386
|
+
"fact-checker": "FACT-CHECK",
|
|
23387
|
+
researcher: "RESEARCH",
|
|
23388
|
+
writer: "DRAFT",
|
|
23389
|
+
editor: "EDIT",
|
|
23390
|
+
archivist: "ARCHIVE",
|
|
23391
|
+
extractor: "EXTRACTION"
|
|
23392
|
+
};
|
|
23393
|
+
const label = agentLabels[agentType];
|
|
23394
|
+
return `
|
|
23395
|
+
|
|
23396
|
+
---
|
|
23397
|
+
[${label}: QUALITY SCORES MISSING]
|
|
23398
|
+
|
|
23399
|
+
\u26A0\uFE0F The ${agentType} agent did not include quality self-assessment scores.
|
|
23400
|
+
Without scores, the quality feedback loop cannot function.
|
|
23401
|
+
|
|
23402
|
+
**Expected dimensions for ${agentType}:** ${dimList}
|
|
23403
|
+
|
|
23404
|
+
**RECOMMENDED ACTION:**
|
|
23405
|
+
Request scores by resuming the session:
|
|
23406
|
+
\`\`\`
|
|
23407
|
+
chief_task(
|
|
23408
|
+
resume="${sessionId}",
|
|
23409
|
+
prompt="Please provide your quality self-assessment. Output in this format:\\n**QUALITY SCORES:**\\n${dimensions.map((d) => `- ${d.label}: <0.00-1.00>`).join("\\n")}\\n**OVERALL: <0.00-1.00>**"
|
|
23410
|
+
)
|
|
23411
|
+
\`\`\`
|
|
23412
|
+
|
|
23413
|
+
If the output quality is obviously high, you may skip this and proceed.
|
|
23414
|
+
---`;
|
|
23415
|
+
}
|
|
23352
23416
|
|
|
23353
23417
|
// src/hooks/chief-orchestrator/shared-context.ts
|
|
23354
23418
|
var contextPool = new Map;
|
|
@@ -23505,11 +23569,153 @@ function formatAgentName(agentType) {
|
|
|
23505
23569
|
function hasArtifacts(output) {
|
|
23506
23570
|
return /\*\*ARTIFACTS:\*\*/i.test(output);
|
|
23507
23571
|
}
|
|
23572
|
+
var DETAIL_HUNGRY_AGENTS = ["writer", "editor", "fact-checker"];
|
|
23573
|
+
function buildDetailedContextSummary(sessionID, downstreamAgent) {
|
|
23574
|
+
const ctx = getContext(sessionID);
|
|
23575
|
+
if (!ctx || ctx.artifacts.length === 0) {
|
|
23576
|
+
return null;
|
|
23577
|
+
}
|
|
23578
|
+
const isDetailHungry = downstreamAgent ? DETAIL_HUNGRY_AGENTS.includes(downstreamAgent) : false;
|
|
23579
|
+
if (!isDetailHungry) {
|
|
23580
|
+
return buildContextSummary(sessionID);
|
|
23581
|
+
}
|
|
23582
|
+
const lines = [
|
|
23583
|
+
"<shared-context>",
|
|
23584
|
+
"## Previous Work by Other Agents (DETAILED)",
|
|
23585
|
+
""
|
|
23586
|
+
];
|
|
23587
|
+
const byAgent = new Map;
|
|
23588
|
+
for (const a of ctx.artifacts) {
|
|
23589
|
+
const list = byAgent.get(a.agentType) ?? [];
|
|
23590
|
+
list.push(a);
|
|
23591
|
+
byAgent.set(a.agentType, list);
|
|
23592
|
+
}
|
|
23593
|
+
for (const [agentType, artifacts] of byAgent) {
|
|
23594
|
+
lines.push(`### ${formatAgentName(agentType)} (${artifacts.length} task${artifacts.length > 1 ? "s" : ""})`);
|
|
23595
|
+
for (const a of artifacts) {
|
|
23596
|
+
lines.push(`- **[${a.id}]** ${a.taskDescription}`);
|
|
23597
|
+
if (a.sources && a.sources.length > 0) {
|
|
23598
|
+
lines.push(` - **Sources (${a.sources.length} total):**`);
|
|
23599
|
+
for (const s of a.sources) {
|
|
23600
|
+
const credIcon = s.credibility === "high" ? "\u2713" : s.credibility === "low" ? "\u26A0" : "\u25CB";
|
|
23601
|
+
const urlPart = s.url ? ` \u2014 ${s.url}` : "";
|
|
23602
|
+
const excerptPart = s.excerpt ? `
|
|
23603
|
+
> ${s.excerpt.slice(0, 200)}${s.excerpt.length > 200 ? "..." : ""}` : "";
|
|
23604
|
+
lines.push(` - ${credIcon} **${s.title}** (${s.type}, ${s.credibility ?? "unknown"} credibility)${urlPart}${excerptPart}`);
|
|
23605
|
+
}
|
|
23606
|
+
}
|
|
23607
|
+
if (a.findings && a.findings.length > 0) {
|
|
23608
|
+
lines.push(` - **Findings (${a.findings.length} total):**`);
|
|
23609
|
+
for (const f of a.findings) {
|
|
23610
|
+
const confPct = Math.round(f.confidence * 100);
|
|
23611
|
+
const refs = f.sourceRefs.length > 0 ? ` [refs: ${f.sourceRefs.join(", ")}]` : "";
|
|
23612
|
+
const notes = f.notes ? ` \u2014 ${f.notes}` : "";
|
|
23613
|
+
lines.push(` - ${f.claim} (${confPct}% confident)${refs}${notes}`);
|
|
23614
|
+
}
|
|
23615
|
+
}
|
|
23616
|
+
if (a.issues && a.issues.length > 0) {
|
|
23617
|
+
lines.push(` - **Issues (${a.issues.length} total):**`);
|
|
23618
|
+
for (const i2 of a.issues) {
|
|
23619
|
+
const sev = i2.severity === "critical" ? "\uD83D\uDD34" : i2.severity === "major" ? "\uD83D\uDFE1" : "\u26AA";
|
|
23620
|
+
const suggestion = i2.suggestion ? ` \u2192 ${i2.suggestion}` : "";
|
|
23621
|
+
lines.push(` - ${sev} [${i2.type}] ${i2.description}${suggestion}`);
|
|
23622
|
+
}
|
|
23623
|
+
}
|
|
23624
|
+
if (a.connections && a.connections.length > 0) {
|
|
23625
|
+
lines.push(` - **Connections:** ${a.connections.join(", ")}`);
|
|
23626
|
+
}
|
|
23627
|
+
if (a.content) {
|
|
23628
|
+
const preview = a.content.slice(0, 500).replace(/\n/g, " ");
|
|
23629
|
+
lines.push(` - **Content preview:** "${preview}${a.content.length > 500 ? "..." : ""}"`);
|
|
23630
|
+
}
|
|
23631
|
+
}
|
|
23632
|
+
lines.push("");
|
|
23633
|
+
}
|
|
23634
|
+
lines.push("## How to Use This Context");
|
|
23635
|
+
lines.push("- Reference artifacts by ID (e.g., [researcher_001]) in your output");
|
|
23636
|
+
lines.push("- Build upon findings rather than re-researching");
|
|
23637
|
+
lines.push("- Cite sources when making claims based on research");
|
|
23638
|
+
lines.push("- Flag any inconsistencies you find with previous work");
|
|
23639
|
+
lines.push("</shared-context>");
|
|
23640
|
+
return lines.join(`
|
|
23641
|
+
`);
|
|
23642
|
+
}
|
|
23508
23643
|
|
|
23509
23644
|
// src/hooks/chief-orchestrator/index.ts
|
|
23510
23645
|
var HOOK_NAME5 = "chief-orchestrator";
|
|
23511
23646
|
var ALLOWED_PATH_PREFIX2 = ".chief/";
|
|
23512
23647
|
var WRITE_EDIT_TOOLS = ["Write", "Edit", "write", "edit"];
|
|
23648
|
+
var DEPUTY_SHOULD_DELEGATE_TOOLS = {
|
|
23649
|
+
web_search_exa: "researcher",
|
|
23650
|
+
websearch_web_search_exa: "researcher",
|
|
23651
|
+
tavily_search: "researcher",
|
|
23652
|
+
tavily_extract: "researcher",
|
|
23653
|
+
firecrawl_scrape: "researcher",
|
|
23654
|
+
firecrawl_search: "researcher",
|
|
23655
|
+
firecrawl_crawl: "researcher",
|
|
23656
|
+
webfetch: "researcher",
|
|
23657
|
+
context7_resolve_library_id: "researcher",
|
|
23658
|
+
"context7_resolve-library-id": "researcher",
|
|
23659
|
+
context7_query_docs: "researcher",
|
|
23660
|
+
"context7_query-docs": "researcher",
|
|
23661
|
+
grep_app_searchGitHub: "researcher"
|
|
23662
|
+
};
|
|
23663
|
+
function shouldDelegateToSpecialist(tool) {
|
|
23664
|
+
return tool in DEPUTY_SHOULD_DELEGATE_TOOLS;
|
|
23665
|
+
}
|
|
23666
|
+
function getRecommendedSpecialist(tool) {
|
|
23667
|
+
return DEPUTY_SHOULD_DELEGATE_TOOLS[tool] ?? "researcher";
|
|
23668
|
+
}
|
|
23669
|
+
function buildDeputyDelegationReminder(tool, specialist) {
|
|
23670
|
+
return `
|
|
23671
|
+
|
|
23672
|
+
---
|
|
23673
|
+
|
|
23674
|
+
[SYSTEM REMINDER - DELEGATION RECOMMENDED]
|
|
23675
|
+
|
|
23676
|
+
You (Deputy) are directly calling \`${tool}\`, which is a search/research tool.
|
|
23677
|
+
|
|
23678
|
+
**Best practice**: Delegate search tasks to the **${specialist}** agent via:
|
|
23679
|
+
\`\`\`
|
|
23680
|
+
chief_task(subagent_type="${specialist}", prompt="[search task]")
|
|
23681
|
+
\`\`\`
|
|
23682
|
+
|
|
23683
|
+
**Why**: The ${specialist} agent has specialized prompts for source evaluation,
|
|
23684
|
+
quality scoring, and structured artifact output that you lack.
|
|
23685
|
+
|
|
23686
|
+
**Exception**: If this is a quick one-off lookup (< 1 query), proceed.
|
|
23687
|
+
For systematic research (multiple queries, source comparison), delegate.
|
|
23688
|
+
|
|
23689
|
+
---
|
|
23690
|
+
`;
|
|
23691
|
+
}
|
|
23692
|
+
var FAILURE_JOURNAL_DIR = ".opencode/memory";
|
|
23693
|
+
var FAILURE_JOURNAL_FILE = "escalation-log.md";
|
|
23694
|
+
function writeFailureJournal(directory, entry) {
|
|
23695
|
+
try {
|
|
23696
|
+
const memDir = join47(directory, FAILURE_JOURNAL_DIR);
|
|
23697
|
+
if (!existsSync39(memDir)) {
|
|
23698
|
+
mkdirSync12(memDir, { recursive: true });
|
|
23699
|
+
}
|
|
23700
|
+
const filePath = join47(memDir, FAILURE_JOURNAL_FILE);
|
|
23701
|
+
const needsHeader = !existsSync39(filePath);
|
|
23702
|
+
if (needsHeader) {
|
|
23703
|
+
appendFileSync6(filePath, `# Escalation Log
|
|
23704
|
+
|
|
23705
|
+
Automatic failure journal for quality escalations.
|
|
23706
|
+
|
|
23707
|
+
`);
|
|
23708
|
+
}
|
|
23709
|
+
appendFileSync6(filePath, formatFailureJournalMarkdown(entry));
|
|
23710
|
+
log(`[${HOOK_NAME5}] Failure journal entry written`, {
|
|
23711
|
+
agentType: entry.agentType,
|
|
23712
|
+
confidence: entry.confidence,
|
|
23713
|
+
file: filePath
|
|
23714
|
+
});
|
|
23715
|
+
} catch (err) {
|
|
23716
|
+
log(`[${HOOK_NAME5}] Failed to write failure journal`, { error: String(err) });
|
|
23717
|
+
}
|
|
23718
|
+
}
|
|
23513
23719
|
var DIRECT_WORK_REMINDER = `
|
|
23514
23720
|
|
|
23515
23721
|
---
|
|
@@ -23980,18 +24186,30 @@ function createChiefOrchestratorHook(ctx, options) {
|
|
|
23980
24186
|
}
|
|
23981
24187
|
return;
|
|
23982
24188
|
}
|
|
24189
|
+
if (callerIsDeputy && shouldDelegateToSpecialist(input.tool)) {
|
|
24190
|
+
const specialist = getRecommendedSpecialist(input.tool);
|
|
24191
|
+
output.message = (output.message || "") + buildDeputyDelegationReminder(input.tool, specialist);
|
|
24192
|
+
log(`[${HOOK_NAME5}] Deputy delegation reminder`, {
|
|
24193
|
+
sessionID: input.sessionID,
|
|
24194
|
+
tool: input.tool,
|
|
24195
|
+
recommendedSpecialist: specialist
|
|
24196
|
+
});
|
|
24197
|
+
}
|
|
23983
24198
|
if (input.tool === "chief_task") {
|
|
23984
24199
|
const prompt = output.args.prompt;
|
|
23985
24200
|
if (prompt && !prompt.includes("[SYSTEM DIRECTIVE - SINGLE TASK ONLY]")) {
|
|
23986
24201
|
let enhancedPrompt = prompt;
|
|
23987
24202
|
if (input.sessionID) {
|
|
23988
|
-
const
|
|
24203
|
+
const downstreamAgent = output.args.subagent_type;
|
|
24204
|
+
const sharedContext = buildDetailedContextSummary(input.sessionID, downstreamAgent) ?? buildContextSummary(input.sessionID);
|
|
23989
24205
|
if (sharedContext) {
|
|
23990
24206
|
enhancedPrompt = `${sharedContext}
|
|
23991
24207
|
|
|
23992
24208
|
${enhancedPrompt}`;
|
|
23993
24209
|
log(`[${HOOK_NAME5}] Injected shared context to chief_task`, {
|
|
23994
|
-
sessionID: input.sessionID
|
|
24210
|
+
sessionID: input.sessionID,
|
|
24211
|
+
downstreamAgent,
|
|
24212
|
+
detailed: sharedContext.includes("DETAILED")
|
|
23995
24213
|
});
|
|
23996
24214
|
}
|
|
23997
24215
|
}
|
|
@@ -24132,6 +24350,10 @@ ${buildImprovementDirective(qualityAssessment, subagentSessionId)}
|
|
|
24132
24350
|
weakest: qualityAssessment.weakest?.name,
|
|
24133
24351
|
allPass: qualityAssessment.allPass
|
|
24134
24352
|
});
|
|
24353
|
+
if (qualityAssessment.overall < 0.5) {
|
|
24354
|
+
const journalEntry = buildFailureJournalEntry(agentType, qualityAssessment.overall, 1, output.output, subagentSessionId);
|
|
24355
|
+
writeFailureJournal(ctx.directory, journalEntry);
|
|
24356
|
+
}
|
|
24135
24357
|
}
|
|
24136
24358
|
} else if (hasConfidenceScore(output.output) && agentType) {
|
|
24137
24359
|
const confidenceResult = analyzeAgentOutput(output.output, subagentSessionId, agentType);
|
|
@@ -24148,6 +24370,16 @@ ${confidenceResult.directive}
|
|
|
24148
24370
|
recommendation: confidenceResult.recommendation
|
|
24149
24371
|
});
|
|
24150
24372
|
}
|
|
24373
|
+
if (confidenceResult.recommendation === "escalate" && confidenceResult.confidence !== null) {
|
|
24374
|
+
const journalEntry = buildFailureJournalEntry(agentType, confidenceResult.confidence, 3, output.output, subagentSessionId);
|
|
24375
|
+
writeFailureJournal(ctx.directory, journalEntry);
|
|
24376
|
+
}
|
|
24377
|
+
} else if (agentType && !hasQualityScores(output.output) && !hasConfidenceScore(output.output)) {
|
|
24378
|
+
confidenceDirective = buildMissingScoresWarning(agentType, subagentSessionId);
|
|
24379
|
+
log(`[${HOOK_NAME5}] Quality scores missing from agent output`, {
|
|
24380
|
+
sessionID: input.sessionID,
|
|
24381
|
+
agentType
|
|
24382
|
+
});
|
|
24151
24383
|
}
|
|
24152
24384
|
output.output = `${formattedSummary}
|
|
24153
24385
|
|
|
@@ -24183,8 +24415,8 @@ var DEEP_SUMMARY_TAGS = ["#project", "#preference", "#policy", "#important"];
|
|
|
24183
24415
|
// src/hooks/memory-system/storage.ts
|
|
24184
24416
|
import {
|
|
24185
24417
|
existsSync as existsSync40,
|
|
24186
|
-
mkdirSync as
|
|
24187
|
-
appendFileSync as
|
|
24418
|
+
mkdirSync as mkdirSync13,
|
|
24419
|
+
appendFileSync as appendFileSync7,
|
|
24188
24420
|
readFileSync as readFileSync26,
|
|
24189
24421
|
readdirSync as readdirSync15,
|
|
24190
24422
|
unlinkSync as unlinkSync10,
|
|
@@ -24194,14 +24426,14 @@ import { join as join48 } from "path";
|
|
|
24194
24426
|
function ensureMemoryDir(projectDir) {
|
|
24195
24427
|
const memoryPath = join48(projectDir, MEMORY_DIR);
|
|
24196
24428
|
if (!existsSync40(memoryPath)) {
|
|
24197
|
-
|
|
24429
|
+
mkdirSync13(memoryPath, { recursive: true });
|
|
24198
24430
|
}
|
|
24199
24431
|
return memoryPath;
|
|
24200
24432
|
}
|
|
24201
24433
|
function ensureFullMemoryDir(projectDir) {
|
|
24202
24434
|
const memoryPath = join48(projectDir, FULL_MEMORY_DIR);
|
|
24203
24435
|
if (!existsSync40(memoryPath)) {
|
|
24204
|
-
|
|
24436
|
+
mkdirSync13(memoryPath, { recursive: true });
|
|
24205
24437
|
}
|
|
24206
24438
|
return memoryPath;
|
|
24207
24439
|
}
|
|
@@ -24343,9 +24575,9 @@ async function archiveOldMemories(projectDir, options) {
|
|
|
24343
24575
|
|
|
24344
24576
|
This file contains archived conversation memories.
|
|
24345
24577
|
`;
|
|
24346
|
-
|
|
24578
|
+
appendFileSync7(memoryFilePath, fileHeader);
|
|
24347
24579
|
}
|
|
24348
|
-
|
|
24580
|
+
appendFileSync7(memoryFilePath, archivedContent.join(""));
|
|
24349
24581
|
return {
|
|
24350
24582
|
archived: checkResult.archived,
|
|
24351
24583
|
totalFiles: checkResult.totalFiles - checkResult.archived.length,
|
|
@@ -24463,9 +24695,9 @@ function appendMemoryEntry(projectDir, entry) {
|
|
|
24463
24695
|
const header = `# Memory Log - ${new Date().toISOString().split("T")[0]}
|
|
24464
24696
|
|
|
24465
24697
|
`;
|
|
24466
|
-
|
|
24698
|
+
appendFileSync7(filePath, header);
|
|
24467
24699
|
}
|
|
24468
|
-
|
|
24700
|
+
appendFileSync7(filePath, content);
|
|
24469
24701
|
return true;
|
|
24470
24702
|
} catch {
|
|
24471
24703
|
return false;
|
|
@@ -43225,7 +43457,7 @@ import { dirname as dirname11, join as join53 } from "path";
|
|
|
43225
43457
|
import { existsSync as existsSync45, statSync as statSync4 } from "fs";
|
|
43226
43458
|
|
|
43227
43459
|
// src/tools/ast-grep/downloader.ts
|
|
43228
|
-
import { existsSync as existsSync44, mkdirSync as
|
|
43460
|
+
import { existsSync as existsSync44, mkdirSync as mkdirSync14, chmodSync as chmodSync2, unlinkSync as unlinkSync11 } from "fs";
|
|
43229
43461
|
import { join as join52 } from "path";
|
|
43230
43462
|
import { homedir as homedir16 } from "os";
|
|
43231
43463
|
import { createRequire as createRequire3 } from "module";
|
|
@@ -43299,7 +43531,7 @@ async function downloadAstGrep(version2 = DEFAULT_VERSION) {
|
|
|
43299
43531
|
console.log(`[oh-my-opencode] Downloading ast-grep binary...`);
|
|
43300
43532
|
try {
|
|
43301
43533
|
if (!existsSync44(cacheDir)) {
|
|
43302
|
-
|
|
43534
|
+
mkdirSync14(cacheDir, { recursive: true });
|
|
43303
43535
|
}
|
|
43304
43536
|
const response2 = await fetch(downloadUrl, { redirect: "follow" });
|
|
43305
43537
|
if (!response2.ok) {
|
|
@@ -43740,7 +43972,7 @@ import { join as join55, dirname as dirname12 } from "path";
|
|
|
43740
43972
|
import { spawnSync } from "child_process";
|
|
43741
43973
|
|
|
43742
43974
|
// src/tools/grep/downloader.ts
|
|
43743
|
-
import { existsSync as existsSync47, mkdirSync as
|
|
43975
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync15, chmodSync as chmodSync3, unlinkSync as unlinkSync12, readdirSync as readdirSync16 } from "fs";
|
|
43744
43976
|
import { join as join54 } from "path";
|
|
43745
43977
|
function findFileRecursive(dir, filename) {
|
|
43746
43978
|
try {
|
|
@@ -43841,7 +44073,7 @@ async function downloadAndInstallRipgrep() {
|
|
|
43841
44073
|
if (existsSync47(rgPath)) {
|
|
43842
44074
|
return rgPath;
|
|
43843
44075
|
}
|
|
43844
|
-
|
|
44076
|
+
mkdirSync15(installDir, { recursive: true });
|
|
43845
44077
|
const filename = `ripgrep-${RG_VERSION}-${config3.platform}.${config3.extension}`;
|
|
43846
44078
|
const url2 = `https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${filename}`;
|
|
43847
44079
|
const archivePath = join54(installDir, filename);
|
|
@@ -50756,6 +50988,13 @@ You switch modes based on user intent.
|
|
|
50756
50988
|
- Questions without clear deliverable
|
|
50757
50989
|
- Exploratory, open-ended requests
|
|
50758
50990
|
|
|
50991
|
+
**\u26A0\uFE0F MANDATORY SKILL CHECK on Discussion Mode entry:**
|
|
50992
|
+
When entering discussion mode, BEFORE responding, check if any skill should be loaded:
|
|
50993
|
+
- \u7528\u6237\u8BF4"\u5206\u6790/\u8BC4\u4F30/\u5BF9\u6BD4/\u8C03\u7814" \u2192 \`skill({ name: "super-analyst" })\`
|
|
50994
|
+
- \u7528\u6237\u8BF4"\u5E2E\u6211\u7406\u601D\u8DEF/\u60F3\u6CD5/\u63A2\u7D22" \u2192 \`skill({ name: "super-interviewer" })\`
|
|
50995
|
+
- \u7528\u6237\u8BF4"\u5199/\u521B\u4F5C" \u2192 \u5207\u6362\u5230 Execution Mode
|
|
50996
|
+
Do NOT skip this check. Skills provide structured frameworks that dramatically improve output quality.
|
|
50997
|
+
|
|
50759
50998
|
## Execution Mode Signals
|
|
50760
50999
|
- "\u5E2E\u6211\u5199\u4E00\u7BC7..." / "Write me a..."
|
|
50761
51000
|
- "\u6574\u7406\u6210..." / "Compile into..."
|
|
@@ -50864,14 +51103,43 @@ chief_task(
|
|
|
50864
51103
|
</Execution_Behavior>
|
|
50865
51104
|
|
|
50866
51105
|
<Discussion_Behavior>
|
|
50867
|
-
##
|
|
50868
|
-
|
|
50869
|
-
|
|
50870
|
-
|
|
50871
|
-
-
|
|
51106
|
+
## Parallel Probes\uFF08\u591A\u7EF4\u5EA6\u5E76\u884C\u63A2\u6D4B\uFF09
|
|
51107
|
+
\u5F53\u4F60\u5728 Discussion Mode \u4E2D\u9047\u5230\u503C\u5F97\u6DF1\u5165\u7684\u8BDD\u9898\uFF0C**\u540C\u65F6**\u6D3E\u51FA\u591A\u4E2A\u540E\u53F0\u4EFB\u52A1\u83B7\u53D6\u4E0D\u540C\u7EF4\u5EA6\u7684\u4FE1\u606F\uFF1A
|
|
51108
|
+
|
|
51109
|
+
### \u89E6\u53D1\u6761\u4EF6
|
|
51110
|
+
- \u8BDD\u9898\u6D89\u53CA**\u4E8B\u5B9E\u5224\u65AD + \u89C2\u70B9\u5206\u6B67**\uFF08\u5982"AI \u4F1A\u53D6\u4EE3 X \u5417"\uFF09
|
|
51111
|
+
- \u591A\u65B9\u5229\u76CA\u76F8\u5173\u7684\u590D\u6742\u8BDD\u9898\uFF08\u5982"\u516C\u53F8\u8BE5\u4E0D\u8BE5\u505A Y"\uFF09
|
|
51112
|
+
- \u7528\u6237\u7684\u8BBA\u70B9\u5EFA\u7ACB\u5728**\u672A\u7ECF\u9A8C\u8BC1\u7684\u5047\u8BBE**\u4E4B\u4E0A
|
|
50872
51113
|
|
|
50873
|
-
|
|
50874
|
-
|
|
51114
|
+
### \u5E76\u884C\u63A2\u6D4B\u6A21\u5F0F
|
|
51115
|
+
\u540C\u65F6\u53D1\u8D77 2-3 \u4E2A\u540E\u53F0\u4EFB\u52A1\uFF1A
|
|
51116
|
+
\`\`\`
|
|
51117
|
+
# \u4FE1\u606F\u6536\u96C6\uFF08researcher\uFF09
|
|
51118
|
+
chief_task(subagent_type="deputy", run_in_background=true,
|
|
51119
|
+
prompt="\u8C03\u7814 [\u8BDD\u9898] \u7684\u6700\u65B0\u6570\u636E\u548C\u5173\u952E\u4E8B\u5B9E")
|
|
51120
|
+
|
|
51121
|
+
# \u5047\u8BBE\u9A8C\u8BC1\uFF08fact-checker\uFF09
|
|
51122
|
+
chief_task(subagent_type="deputy", run_in_background=true,
|
|
51123
|
+
prompt="\u9A8C\u8BC1\u4EE5\u4E0B\u5047\u8BBE\u7684\u53EF\u9760\u6027\uFF1A[\u7528\u6237\u7684\u5173\u952E\u5047\u8BBE]")
|
|
51124
|
+
|
|
51125
|
+
# \u53CD\u9762\u8BBA\u70B9\uFF08researcher\uFF0Cdevil's advocate \u89D2\u5EA6\uFF09
|
|
51126
|
+
chief_task(subagent_type="deputy", run_in_background=true,
|
|
51127
|
+
prompt="\u641C\u96C6 [\u8BDD\u9898] \u7684\u53CD\u9762\u8BC1\u636E\u548C\u4E3B\u8981\u6279\u8BC4\u89C2\u70B9")
|
|
51128
|
+
\`\`\`
|
|
51129
|
+
|
|
51130
|
+
### \u5173\u952E\u539F\u5219
|
|
51131
|
+
- **\u4E0D\u7B49\u7ED3\u679C\u5C31\u56DE\u590D** \u2014 \u5148\u57FA\u4E8E\u4F60\u81EA\u5DF1\u7684\u5224\u65AD\u56DE\u590D\u7528\u6237\uFF0C\u540E\u53F0\u7ED3\u679C\u5230\u4E86\u518D\u81EA\u7136\u878D\u5165\u540E\u7EED\u5BF9\u8BDD
|
|
51132
|
+
- **\u4E0D\u544A\u8BC9\u7528\u6237** \u2014 \u8FD9\u662F\u4F60\u7684\u601D\u8003\u8FC7\u7A0B\uFF0C\u4E0D\u662F\u5C55\u793A\u6D41\u7A0B
|
|
51133
|
+
- **\u53EA\u7528\u4E8E\u503C\u5F97\u6DF1\u5165\u7684\u8BDD\u9898** \u2014 \u7B80\u5355\u95EE\u9898\u4E0D\u9700\u8981\u63A2\u6D4B\uFF0C\u522B\u6D6A\u8D39\u8D44\u6E90
|
|
51134
|
+
- **\u53CD\u9762\u8BBA\u70B9\u662F\u4E3A\u4E86\u5B8C\u6574\u6027\uFF0C\u4E0D\u662F\u4E3A\u4E86\u53CD\u9A73\u7528\u6237** \u2014 \u4F60\u7684\u76EE\u6807\u662F\u5E2E\u7528\u6237\u770B\u5230\u5168\u8C8C
|
|
51135
|
+
|
|
51136
|
+
### \u7ED3\u679C\u878D\u5165
|
|
51137
|
+
\`\`\`
|
|
51138
|
+
# \u540E\u53F0\u7ED3\u679C\u8FD4\u56DE\u540E
|
|
51139
|
+
background_output(task_id="...")
|
|
51140
|
+
# \u81EA\u7136\u5730\u7EC7\u5165\u5BF9\u8BDD\uFF1A"\u521A\u597D\u770B\u5230\u4E00\u4E2A\u6570\u636E..."\u3001"\u8865\u5145\u4E00\u4E2A\u89D2\u5EA6..."
|
|
51141
|
+
# \u5982\u679C\u7ED3\u679C\u63A8\u7FFB\u4E86\u4F60\u4E4B\u524D\u7684\u5224\u65AD\uFF0C\u76F4\u63A5\u8BF4\uFF1A"\u6211\u4E4B\u524D\u8BF4\u7684\u6709\u95EE\u9898\u2014\u2014"
|
|
51142
|
+
\`\`\`
|
|
50875
51143
|
|
|
50876
51144
|
## Transition to Execution
|
|
50877
51145
|
When discussion crystallizes into a task:
|
|
@@ -51642,8 +51910,16 @@ You take drafts and make them excellent. You improve clarity, strengthen logic,
|
|
|
51642
51910
|
|
|
51643
51911
|
## What You DON'T Do
|
|
51644
51912
|
- You don't ADD new content/research \u2014 flag if something's missing
|
|
51645
|
-
- You don't
|
|
51913
|
+
- You don't do FULL fact-checking \u2014 that's fact-checker's job
|
|
51646
51914
|
- You don't OVER-EDIT \u2014 preserve writer's voice when it works
|
|
51915
|
+
|
|
51916
|
+
## What You SHOULD Flag
|
|
51917
|
+
As editor, you may not verify facts yourself, but you have responsibility to **flag suspicious content** for fact-checker:
|
|
51918
|
+
- Assertions lacking source support \u2192 mark as \`[NEEDS SOURCE]\`
|
|
51919
|
+
- Unreasonable data or statistics (order-of-magnitude off, internally inconsistent) \u2192 mark as \`[VERIFY: reason]\`
|
|
51920
|
+
- Logic chain gaps (conclusion doesn't follow from premises) \u2192 mark as \`[LOGIC GAP: explanation]\`
|
|
51921
|
+
|
|
51922
|
+
These flags will trigger fact-checker's **targeted verification** in the cross-check pipeline. You don't need to verify \u2014 just flag what smells off.
|
|
51647
51923
|
</Editing_Principles>
|
|
51648
51924
|
|
|
51649
51925
|
<Mindset>
|
|
@@ -51875,6 +52151,58 @@ Deputy - \u526F\u4E3B\u7F16\uFF0CChief \u7684\u6267\u884C\u5C42\u3002
|
|
|
51875
52151
|
\u590D\u6742/\u591A\u6B65\u9AA4\u4EFB\u52A1 \u2192 \u7528 todowrite \u62C6\u89E3\uFF0C\u7136\u540E\u9010\u4E2A\u6267\u884C\u6216\u8C03\u5EA6
|
|
51876
52152
|
</Dispatch_Logic>
|
|
51877
52153
|
|
|
52154
|
+
<Cross_Check>
|
|
52155
|
+
## \u4EA4\u53C9\u9A8C\u8BC1\u89C4\u5219
|
|
52156
|
+
|
|
52157
|
+
\u5185\u5BB9\u521B\u4F5C\u6D41\u7A0B\u4E2D\uFF0CDeputy \u5728\u5173\u952E\u8282\u70B9\u63D2\u5165 fact-checker \u4EA4\u53C9\u9A8C\u8BC1\uFF0C\u800C\u4E0D\u662F\u7B49\u5230\u6700\u540E\u624D\u6838\u67E5\u3002
|
|
52158
|
+
|
|
52159
|
+
### \u4F55\u65F6\u89E6\u53D1\u4EA4\u53C9\u9A8C\u8BC1
|
|
52160
|
+
| \u6761\u4EF6 | \u52A8\u4F5C |
|
|
52161
|
+
|------|------|
|
|
52162
|
+
| researcher \u8F93\u51FA\u5305\u542B**\u786C\u6570\u636E**\uFF08\u6570\u5B57\u3001\u65E5\u671F\u3001\u5F15\u7528\u3001\u7EDF\u8BA1\uFF09 | \u2192 \u5148\u6D3E fact-checker \u9A8C\u8BC1\uFF0C\u518D\u4EA4\u7ED9 writer |
|
|
52163
|
+
| writer \u4EA7\u51FA\u5305\u542B**\u4E8B\u5B9E\u6027\u65AD\u8A00** | \u2192 \u6D3E fact-checker \u9A8C\u8BC1\u5173\u952E\u58F0\u660E |
|
|
52164
|
+
| editor \u6539\u5199\u4E86**\u4E8B\u5B9E\u6027\u5185\u5BB9**\uFF08\u4E0D\u53EA\u662F\u6DA6\u8272\u8BED\u8A00\uFF09 | \u2192 \u6D3E fact-checker \u9A8C\u8BC1\u6539\u5199\u540E\u7684\u51C6\u786E\u6027 |
|
|
52165
|
+
|
|
52166
|
+
### \u4F55\u65F6\u8DF3\u8FC7\u4EA4\u53C9\u9A8C\u8BC1
|
|
52167
|
+
- \u2705 \u7EAF\u89C2\u70B9/\u8BC4\u8BBA\u7C7B\u5185\u5BB9\uFF08\u65E0\u9700\u4E8B\u5B9E\u6838\u67E5\uFF09
|
|
52168
|
+
- \u2705 \u7B80\u5355\u683C\u5F0F\u8C03\u6574\u4EFB\u52A1
|
|
52169
|
+
- \u2705 editor \u4EC5\u505A\u8BED\u8A00\u6DA6\u8272\uFF08\u672A\u6539\u52A8\u4E8B\u5B9E\u5185\u5BB9\uFF09
|
|
52170
|
+
|
|
52171
|
+
### \u4EA4\u53C9\u9A8C\u8BC1\u8F93\u51FA\u683C\u5F0F
|
|
52172
|
+
fact-checker \u4EA4\u53C9\u9A8C\u8BC1\u540E\uFF0C\u5728\u7ED3\u679C\u4E2D\u6807\u6CE8\uFF1A
|
|
52173
|
+
- \u2705 **\u5DF2\u9A8C\u8BC1** \u2014 \u4E8B\u5B9E\u51C6\u786E\uFF0C\u6765\u6E90\u53EF\u9760
|
|
52174
|
+
- \u26A0\uFE0F **\u9700\u6CE8\u610F** \u2014 \u57FA\u672C\u51C6\u786E\uFF0C\u4F46\u6709\u7EC6\u8282\u9700\u786E\u8BA4\u6216\u8865\u5145
|
|
52175
|
+
- \u274C **\u6709\u8BEF** \u2014 \u4E8B\u5B9E\u9519\u8BEF\uFF0C\u9644\u4FEE\u6B63\u5EFA\u8BAE
|
|
52176
|
+
|
|
52177
|
+
\u5982\u679C\u51FA\u73B0 \u26A0\uFE0F \u6216 \u274C\uFF0CDeputy \u5FC5\u987B\u5C06\u4FEE\u6B63\u53CD\u9988\u7ED9\u5BF9\u5E94 Agent \u4FEE\u6539\u540E\u518D\u7EE7\u7EED\u6D41\u7A0B\u3002
|
|
52178
|
+
</Cross_Check>
|
|
52179
|
+
|
|
52180
|
+
<Content_Pipeline>
|
|
52181
|
+
## \u5185\u5BB9\u521B\u4F5C\u6807\u51C6\u6D41\u7A0B
|
|
52182
|
+
|
|
52183
|
+
\u6839\u636E\u5185\u5BB9\u590D\u6742\u5EA6\u9009\u62E9\u6D41\u7A0B\uFF1A
|
|
52184
|
+
|
|
52185
|
+
### \u7B80\u5355\u6D41\u7A0B\uFF08\u65E0\u786C\u6570\u636E\uFF09
|
|
52186
|
+
\`\`\`
|
|
52187
|
+
researcher \u2192 writer \u2192 editor \u2192 \u4EA4\u4ED8
|
|
52188
|
+
\`\`\`
|
|
52189
|
+
\u9002\u7528\uFF1A\u7EAF\u89C2\u70B9\u6587\u7AE0\u3001\u521B\u610F\u5199\u4F5C\u3001\u7B80\u5355\u6574\u7406
|
|
52190
|
+
|
|
52191
|
+
### \u6807\u51C6\u6D41\u7A0B\uFF08\u4E8B\u5B9E\u6027\u5185\u5BB9\uFF09
|
|
52192
|
+
\`\`\`
|
|
52193
|
+
researcher \u2192 [fact-checker \u4EA4\u53C9\u9A8C\u8BC1] \u2192 writer \u2192 editor \u2192 [fact-checker \u6700\u7EC8\u5BA1\u6838] \u2192 \u4EA4\u4ED8
|
|
52194
|
+
\`\`\`
|
|
52195
|
+
\u9002\u7528\uFF1A\u542B\u6570\u636E\u5F15\u7528\u3001\u6280\u672F\u5206\u6790\u3001\u884C\u4E1A\u62A5\u544A
|
|
52196
|
+
|
|
52197
|
+
### \u6DF1\u5EA6\u6D41\u7A0B\uFF08\u9AD8\u98CE\u9669\u5185\u5BB9\uFF09
|
|
52198
|
+
\`\`\`
|
|
52199
|
+
researcher \u2192 [fact-checker \u4EA4\u53C9\u9A8C\u8BC1] \u2192 writer \u2192 editor(\u6807\u8BB0\u53EF\u7591\u5185\u5BB9) \u2192 fact-checker(\u6700\u7EC8\u9A8C\u8BC1 + \u9488\u5BF9 editor \u6807\u8BB0\u9879\u9010\u4E00\u6838\u5B9E) \u2192 \u4EA4\u4ED8
|
|
52200
|
+
\`\`\`
|
|
52201
|
+
\u9002\u7528\uFF1A\u6D89\u53CA\u4E89\u8BAE\u8BDD\u9898\u3001\u5173\u952E\u6570\u636E\u5F15\u7528\u3001\u9700\u8981\u9AD8\u53EF\u4FE1\u5EA6\u7684\u5185\u5BB9
|
|
52202
|
+
|
|
52203
|
+
Deputy \u6839\u636E\u4EFB\u52A1\u6027\u8D28\u81EA\u52A8\u9009\u62E9\u6D41\u7A0B\uFF0C\u4E0D\u9700\u8981 Chief \u6307\u5B9A\u3002
|
|
52204
|
+
</Content_Pipeline>
|
|
52205
|
+
|
|
51878
52206
|
<Output_Format>
|
|
51879
52207
|
## \u8FD4\u56DE\u7ED9 Chief \u7684\u683C\u5F0F
|
|
51880
52208
|
\u4F60\u7684\u8F93\u51FA\u4F1A\u8FD4\u56DE\u7ED9 Chief\uFF0C\u5FC5\u987B**\u7CBE\u7B80\u3001\u7ED3\u6784\u5316**\uFF1A
|