@oyasmi/pipiclaw 0.8.9-beta.2 → 0.8.9-beta.3
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 +6 -4
- package/dist/agent/channel-runner.d.ts +6 -0
- package/dist/agent/channel-runner.js +27 -2
- package/dist/agent/command-extension.d.ts +3 -0
- package/dist/agent/command-extension.js +37 -0
- package/dist/agent/commands.js +6 -0
- package/dist/agent/prompt/sections.js +3 -3
- package/dist/paths.d.ts +0 -1
- package/dist/paths.js +0 -11
- package/dist/playbooks/runtime-orientation.md +1 -1
- package/dist/playbooks/task-delegation.md +2 -2
- package/dist/runtime/store.d.ts +1 -1
- package/dist/settings.d.ts +5 -4
- package/dist/settings.js +1 -1
- package/dist/subagents/discovery.d.ts +1 -1
- package/dist/subagents/discovery.js +10 -36
- package/dist/subagents/tool.d.ts +1 -1
- package/dist/subagents/tool.js +4 -4
- package/examples/sub-agents/README.md +21 -0
- package/examples/sub-agents/explorer.md +17 -0
- package/examples/sub-agents/git-committer.md +50 -0
- package/examples/sub-agents/researcher.md +18 -0
- package/examples/sub-agents/verifier.md +19 -0
- package/package.json +2 -1
- package/dist/subagents/builtin/explorer.md +0 -16
- package/dist/subagents/builtin/researcher.md +0 -17
- package/dist/subagents/builtin/verifier.md +0 -17
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm package: [`@oyasmi/pipiclaw`](https://www.npmjs.com/package/@oyasmi/pipiclaw
|
|
|
16
16
|
|
|
17
17
|
**自己推进长程工作。** 定时事件支持立即、单次、周期三类,`preAction` 可用脚本做零 token 的触发前门控。语义更高一层的是任务台账(task ledger):任务以 Markdown 文件持久存在,内建 task driver 到点自动恢复、有进展有界续跑、停滞自动退避;配套受预算约束的恢复、独立验收、外部副作用授权,以及 `/tasks` 系列零 LLM 成本的控制面命令。
|
|
18
18
|
|
|
19
|
-
**会用工具、能委派。** 内建 `bash`(支持 `async` 后台作业)、`read`(含目录树与 PDF)、`write` / `edit`、结构化 `grep`、`web_search` / `web_fetch`(结果缓存与分页续读),以及 `send_media
|
|
19
|
+
**会用工具、能委派。** 内建 `bash`(支持 `async` 后台作业)、`read`(含目录树与 PDF)、`write` / `edit`、结构化 `grep`、`web_search` / `web_fetch`(结果缓存与分页续读),以及 `send_media`——生成好的报表、截图、导出文件可以作为原生附件直接发回钉钉,而不是丢给你一个打不开的主机路径。工作区配置的子代理可以把 reviewer、researcher 这类角色沉淀成可复用能力,支持 worktree 隔离与独立验收(verify);workspace skills 沉淀你自己的流程知识。完整清单见 [docs/tools.md](./docs/tools.md)。
|
|
20
20
|
|
|
21
21
|
**有安全护栏。** 所有文件、命令、网络工具都经过安全守卫:`bash` 命令拦截、统一路径检查、常见凭据与敏感位置默认拒绝、阻断写入审计日志;可通过 `security.json` 做实例级策略调整。详见 [docs/security.md](./docs/security.md)。
|
|
22
22
|
|
|
@@ -140,7 +140,8 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
140
140
|
```json
|
|
141
141
|
{
|
|
142
142
|
"defaultProvider": "my-gateway",
|
|
143
|
-
"defaultModel": "gpt-4.1"
|
|
143
|
+
"defaultModel": "gpt-4.1",
|
|
144
|
+
"defaultThinkingLevel": "medium"
|
|
144
145
|
}
|
|
145
146
|
```
|
|
146
147
|
|
|
@@ -222,10 +223,11 @@ pipiclaw
|
|
|
222
223
|
| `/compact [instructions]` | 手动压缩当前会话上下文 |
|
|
223
224
|
| `/session` | 当前会话状态、消息统计、token 使用量 |
|
|
224
225
|
| `/model [引用]` | 查看或切换模型 |
|
|
226
|
+
| `/thinking [level\|cycle]` | 查看、设置或轮换当前会话的 thinking level(默认 `medium`,按模型能力自动 clamp) |
|
|
225
227
|
|
|
226
228
|
说明:
|
|
227
229
|
|
|
228
|
-
- 前九条由传输层直接处理,**忙碌时也可用**(`/context` 是只读统计,零 LLM
|
|
230
|
+
- 前九条由传输层直接处理,**忙碌时也可用**(`/context` 是只读统计,零 LLM 成本);后五条会话命令仅空闲时可用(忙碌时会收到提示)。
|
|
229
231
|
- 忙碌时的普通消息默认等价于 `/steer`,可通过 `channel.json` 的 `busyMessageDefault` 改为排队(`followUp`)。
|
|
230
232
|
- 未知的斜杠命令会被直接拒绝并提示 `/help`,不会作为普通消息发给模型(避免 `/modle` 这类笔误变成一整轮 LLM 调用)。workspace skill 也可作为命令调用(`/skill:<名称>`)。
|
|
231
233
|
- `/model` 依次尝试精确 `provider/modelId`、精确 `modelId`、对完整引用的子串匹配,只有唯一命中时才切换,例如 `/model turbo`。
|
|
@@ -242,7 +244,7 @@ pipiclaw
|
|
|
242
244
|
| [docs/memory.md](./docs/memory.md) | 记忆分层:它记得什么、怎么让它记住或忘掉 |
|
|
243
245
|
| [docs/configuration.md](./docs/configuration.md) | 全部配置项:钉钉、模型、settings、tools、TUI、记忆与工作区文件 |
|
|
244
246
|
| [docs/events-and-tasks.md](./docs/events-and-tasks.md) | 定时事件(含 `preAction` 门控、`event_manage`)、任务台账、内建 task driver、`/tasks` 控制面与 `task_manage` 工具 |
|
|
245
|
-
| [docs/sub-agents.md](./docs/sub-agents.md) |
|
|
247
|
+
| [docs/sub-agents.md](./docs/sub-agents.md) | 工作区配置子代理:委派、隔离 worktree 与独立验收 |
|
|
246
248
|
| [docs/security.md](./docs/security.md) | 默认安全策略、`security.json` 配置与已知边界 |
|
|
247
249
|
| [docs/deployment-and-operations.md](./docs/deployment-and-operations.md) | 长期运行、日志、可观测性、升级、备份与排障 |
|
|
248
250
|
| [docs/scaling-and-concurrency.md](./docs/scaling-and-concurrency.md) | 并发模型与容量边界 |
|
|
@@ -134,6 +134,12 @@ export declare class ChannelRunner implements AgentRunner {
|
|
|
134
134
|
private createResourceLoader;
|
|
135
135
|
private createAgentSessionServices;
|
|
136
136
|
private createEmptyExtensionsResult;
|
|
137
|
+
/**
|
|
138
|
+
* Resolve the initial thinking level using the same precedence as pi's SDK:
|
|
139
|
+
* session history, configured default, then medium. The effective value is
|
|
140
|
+
* clamped to the selected model before the session starts.
|
|
141
|
+
*/
|
|
142
|
+
private initializeThinkingLevel;
|
|
137
143
|
private createSessionRuntime;
|
|
138
144
|
private buildRuntimeTools;
|
|
139
145
|
private rebuildSessionTools;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import { clampThinkingLevel } from "@earendil-works/pi-ai/compat";
|
|
2
3
|
import { AgentSession, AgentSessionRuntime, convertToLlm, createExtensionRuntime, DefaultResourceLoader, SessionManager, } from "@earendil-works/pi-coding-agent";
|
|
3
4
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
4
5
|
import { dirname, join, resolve } from "path";
|
|
@@ -52,6 +53,7 @@ function getFinalOutcomeText(outcome) {
|
|
|
52
53
|
function asSdkSettingsManager(manager) {
|
|
53
54
|
return manager;
|
|
54
55
|
}
|
|
56
|
+
const DEFAULT_MAIN_THINKING_LEVEL = "medium";
|
|
55
57
|
export class ChannelRunner {
|
|
56
58
|
constructor(channelId, channelDir, paths) {
|
|
57
59
|
this.ledger = getUsageLedger();
|
|
@@ -96,7 +98,7 @@ export class ChannelRunner {
|
|
|
96
98
|
initialState: {
|
|
97
99
|
systemPrompt: "",
|
|
98
100
|
model: this.activeModel,
|
|
99
|
-
thinkingLevel:
|
|
101
|
+
thinkingLevel: DEFAULT_MAIN_THINKING_LEVEL,
|
|
100
102
|
tools: initialTools,
|
|
101
103
|
},
|
|
102
104
|
convertToLlm,
|
|
@@ -735,6 +737,7 @@ export class ChannelRunner {
|
|
|
735
737
|
// Resolve model: prefer saved global default, fall back to first available model.
|
|
736
738
|
this.activeModel = resolveInitialModel(this.modelRegistry, this.settingsManager);
|
|
737
739
|
this.agent.state.model = this.activeModel; // correct the placeholder default
|
|
740
|
+
this.initializeThinkingLevel(this.agent, this.activeModel, this.sessionManager);
|
|
738
741
|
log.logInfo(`Using model: ${this.activeModel.provider}/${this.activeModel.id} (${this.activeModel.name})`);
|
|
739
742
|
this.subAgentDiscovery = await this.refreshSubAgentDiscovery();
|
|
740
743
|
const initialResourceLoader = this.createResourceLoader();
|
|
@@ -908,6 +911,9 @@ export class ChannelRunner {
|
|
|
908
911
|
},
|
|
909
912
|
getSessionStats: () => this.session.getSessionStats(),
|
|
910
913
|
getThinkingLevel: () => this.session.thinkingLevel,
|
|
914
|
+
getAvailableThinkingLevels: () => this.session.getAvailableThinkingLevels(),
|
|
915
|
+
setThinkingLevel: (level) => this.session.setThinkingLevel(level),
|
|
916
|
+
cycleThinkingLevel: () => this.session.cycleThinkingLevel(),
|
|
911
917
|
getLastResponseModel: () => getLastAssistantUsage(this.session.messages)?.responseModel,
|
|
912
918
|
switchModel: async (model) => {
|
|
913
919
|
await this.session.setModel(model);
|
|
@@ -956,18 +962,37 @@ export class ChannelRunner {
|
|
|
956
962
|
runtime: createExtensionRuntime(),
|
|
957
963
|
};
|
|
958
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* Resolve the initial thinking level using the same precedence as pi's SDK:
|
|
967
|
+
* session history, configured default, then medium. The effective value is
|
|
968
|
+
* clamped to the selected model before the session starts.
|
|
969
|
+
*/
|
|
970
|
+
initializeThinkingLevel(agent, model, sessionManager) {
|
|
971
|
+
const branch = sessionManager.getBranch();
|
|
972
|
+
const hasThinkingEntry = branch.some((entry) => entry.type === "thinking_level_change");
|
|
973
|
+
const sessionThinkingLevel = sessionManager.buildSessionContext().thinkingLevel;
|
|
974
|
+
const requestedLevel = hasThinkingEntry
|
|
975
|
+
? sessionThinkingLevel
|
|
976
|
+
: (this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_MAIN_THINKING_LEVEL);
|
|
977
|
+
const effectiveLevel = clampThinkingLevel(model, requestedLevel);
|
|
978
|
+
agent.state.thinkingLevel = effectiveLevel;
|
|
979
|
+
if (!hasThinkingEntry) {
|
|
980
|
+
sessionManager.appendThinkingLevelChange(effectiveLevel);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
959
983
|
createSessionRuntime(sessionManager, sessionStartEvent) {
|
|
960
984
|
const tools = this.buildRuntimeTools();
|
|
961
985
|
const agent = new Agent({
|
|
962
986
|
initialState: {
|
|
963
987
|
systemPrompt: "",
|
|
964
988
|
model: this.activeModel,
|
|
965
|
-
thinkingLevel:
|
|
989
|
+
thinkingLevel: DEFAULT_MAIN_THINKING_LEVEL,
|
|
966
990
|
tools,
|
|
967
991
|
},
|
|
968
992
|
convertToLlm,
|
|
969
993
|
getApiKey: async () => getApiKeyForModel(this.modelRegistry, this.activeModel),
|
|
970
994
|
});
|
|
995
|
+
this.initializeThinkingLevel(agent, this.activeModel, sessionManager);
|
|
971
996
|
const resourceLoader = this.createResourceLoader();
|
|
972
997
|
const session = new AgentSession({
|
|
973
998
|
agent,
|
|
@@ -7,6 +7,9 @@ export interface PipiclawCommandExtensionOptions {
|
|
|
7
7
|
getAvailableModels: () => Promise<Model<Api>[]>;
|
|
8
8
|
getSessionStats: () => SessionStats;
|
|
9
9
|
getThinkingLevel: () => ThinkingLevel;
|
|
10
|
+
getAvailableThinkingLevels: () => ThinkingLevel[];
|
|
11
|
+
setThinkingLevel: (level: ThinkingLevel) => void;
|
|
12
|
+
cycleThinkingLevel: () => ThinkingLevel | undefined;
|
|
10
13
|
getLastResponseModel?: () => string | undefined;
|
|
11
14
|
switchModel: (model: Model<Api>) => Promise<void>;
|
|
12
15
|
refreshSessionResources: () => Promise<void>;
|
|
@@ -39,6 +39,14 @@ function sendCommandResult(sender, text) {
|
|
|
39
39
|
display: true,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
function buildThinkingText(current, available) {
|
|
43
|
+
return `# Thinking
|
|
44
|
+
|
|
45
|
+
Current level: \`${current}\`
|
|
46
|
+
Available levels: ${available.map((level) => `\`${level}\``).join(", ")}
|
|
47
|
+
|
|
48
|
+
Use \`/thinking <level>\` to set a level, or \`/thinking cycle\` to select the next supported level.`;
|
|
49
|
+
}
|
|
42
50
|
export function createCommandExtension(options) {
|
|
43
51
|
return (pi) => {
|
|
44
52
|
pi.registerCommand("memory", {
|
|
@@ -53,6 +61,35 @@ export function createCommandExtension(options) {
|
|
|
53
61
|
sendCommandResult(pi, buildSessionText(options.getSessionStats(), options.getCurrentModel(), options.getThinkingLevel(), options.getLastResponseModel?.()));
|
|
54
62
|
},
|
|
55
63
|
});
|
|
64
|
+
pi.registerCommand("thinking", {
|
|
65
|
+
description: sessionCommandDescription("thinking"),
|
|
66
|
+
handler: async (args) => {
|
|
67
|
+
const available = options.getAvailableThinkingLevels();
|
|
68
|
+
const normalized = args.trim().toLowerCase();
|
|
69
|
+
if (!normalized) {
|
|
70
|
+
sendCommandResult(pi, buildThinkingText(options.getThinkingLevel(), available));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (normalized === "cycle") {
|
|
74
|
+
const next = options.cycleThinkingLevel();
|
|
75
|
+
if (!next) {
|
|
76
|
+
sendCommandResult(pi, "当前模型不支持 thinking/reasoning。");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
sendCommandResult(pi, `Thinking level 已切换为 \`${next}\`。`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!available.includes(normalized)) {
|
|
83
|
+
sendCommandResult(pi, `不支持 thinking level \`${args.trim()}\`。当前模型可用值:${available
|
|
84
|
+
.map((level) => `\`${level}\``)
|
|
85
|
+
.join(", ")}`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const level = normalized;
|
|
89
|
+
options.setThinkingLevel(level);
|
|
90
|
+
sendCommandResult(pi, `Thinking level 已设置为 \`${level}\`。`);
|
|
91
|
+
},
|
|
92
|
+
});
|
|
56
93
|
pi.registerCommand("model", {
|
|
57
94
|
description: sessionCommandDescription("model"),
|
|
58
95
|
handler: async (args) => {
|
package/dist/agent/commands.js
CHANGED
|
@@ -98,6 +98,12 @@ export const SESSION_COMMANDS = [
|
|
|
98
98
|
description: "Show current session state, message stats, token usage, and model info",
|
|
99
99
|
examples: ["/session"],
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
name: "thinking",
|
|
103
|
+
argumentHint: "[off|minimal|low|medium|high|xhigh|max|cycle]",
|
|
104
|
+
description: "Show or change the thinking level for the current model",
|
|
105
|
+
examples: ["/thinking", "/thinking medium", "/thinking cycle"],
|
|
106
|
+
},
|
|
101
107
|
{
|
|
102
108
|
name: "model",
|
|
103
109
|
argumentHint: "[provider/modelId|modelId]",
|
|
@@ -122,7 +122,7 @@ export const SUBAGENTS_SECTION = {
|
|
|
122
122
|
maxChars: 2_400,
|
|
123
123
|
overflow: "truncate-items",
|
|
124
124
|
render: (context) => {
|
|
125
|
-
// Two-state (spec 032 D1): an empty
|
|
125
|
+
// Two-state (spec 032 D1): an empty configured catalog must not delete the runtime
|
|
126
126
|
// guidance that lives in this section — only the catalog itself is optional. This
|
|
127
127
|
// inline-usage text is runtime-authored, not user content; keep it under 40 units
|
|
128
128
|
// (it does not count toward the 700/1200 unit budget — see builder.ts's
|
|
@@ -130,13 +130,13 @@ export const SUBAGENTS_SECTION = {
|
|
|
130
130
|
if (context.subAgents.length === 0) {
|
|
131
131
|
return [
|
|
132
132
|
"## Sub-Agents",
|
|
133
|
-
"Delegate with `subagent`: pass an inline `systemPrompt` (no
|
|
133
|
+
"Delegate with `subagent`: pass an inline `systemPrompt` (no configured agent is required).",
|
|
134
134
|
"A sub-agent starts blank — state goal, scope, paths, constraints, acceptance criteria in `task`.",
|
|
135
135
|
"Read task-delegation.md before non-trivial delegation.",
|
|
136
136
|
].join("\n");
|
|
137
137
|
}
|
|
138
138
|
return [
|
|
139
|
-
"##
|
|
139
|
+
"## Configured Sub-Agents",
|
|
140
140
|
"A sub-agent starts blank: state the goal, scope, paths, constraints and acceptance criteria in the task you hand it.",
|
|
141
141
|
...context.subAgents.map((agent) => `- ${agent.name} — ${agent.description}`),
|
|
142
142
|
"",
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const APP_NAME = "pipiclaw";
|
|
2
2
|
/** Prefer live source docs in a checkout; installed packages fall back to dist/playbooks. */
|
|
3
3
|
export declare const PLAYBOOKS_DIR: string;
|
|
4
|
-
export declare const BUILTIN_SUB_AGENTS_DIR: string;
|
|
5
4
|
/**
|
|
6
5
|
* Legacy default app home used before the `~/.pipiclaw` default (introduced in
|
|
7
6
|
* 0.8.x). Kept only so bootstrap can migrate an existing install to the new
|
package/dist/paths.js
CHANGED
|
@@ -12,17 +12,6 @@ const bundledPlaybooksDir = fileURLToPath(new URL("./playbooks", import.meta.url
|
|
|
12
12
|
const checkoutPlaybooksDir = fileURLToPath(new URL("../src/playbooks", import.meta.url));
|
|
13
13
|
/** Prefer live source docs in a checkout; installed packages fall back to dist/playbooks. */
|
|
14
14
|
export const PLAYBOOKS_DIR = existsSync(checkoutPlaybooksDir) ? checkoutPlaybooksDir : bundledPlaybooksDir;
|
|
15
|
-
/**
|
|
16
|
-
* Built-in sub-agent definitions bundled inside the installed package (spec 032 D2),
|
|
17
|
-
* same checkout/dist split as PLAYBOOKS_DIR. `discoverSubAgents` scans this directory
|
|
18
|
-
* before the workspace `sub-agents/` directory; a workspace file with the same `name`
|
|
19
|
-
* overrides the built-in one.
|
|
20
|
-
*/
|
|
21
|
-
const bundledBuiltinSubAgentsDir = fileURLToPath(new URL("./subagents/builtin", import.meta.url));
|
|
22
|
-
const checkoutBuiltinSubAgentsDir = fileURLToPath(new URL("../src/subagents/builtin", import.meta.url));
|
|
23
|
-
export const BUILTIN_SUB_AGENTS_DIR = existsSync(checkoutBuiltinSubAgentsDir)
|
|
24
|
-
? checkoutBuiltinSubAgentsDir
|
|
25
|
-
: bundledBuiltinSubAgentsDir;
|
|
26
15
|
/**
|
|
27
16
|
* Legacy default app home used before the `~/.pipiclaw` default (introduced in
|
|
28
17
|
* 0.8.x). Kept only so bootstrap can migrate an existing install to the new
|
|
@@ -26,7 +26,7 @@ Workspace 根目录:
|
|
|
26
26
|
- `MEMORY.md`:管理员维护的共享背景,按需读取。
|
|
27
27
|
- `ENVIRONMENT.md`:机器环境事实和重要变更,按需读取、可维护。
|
|
28
28
|
- `skills/`:workspace 级程序性知识;通过 `skill_manage` 管理。
|
|
29
|
-
- `sub-agents
|
|
29
|
+
- `sub-agents/`:工作区配置的子代理;只加载实际存在的 Markdown 文件。
|
|
30
30
|
- `events/`:全 workspace 的调度事件。
|
|
31
31
|
|
|
32
32
|
当前 channel 目录:
|
|
@@ -17,9 +17,9 @@ priority: 45
|
|
|
17
17
|
- 依赖缺失、cancelled 或被治理器暂停会令 dependent 被治理器暂停。
|
|
18
18
|
- 父任务有未闭环 child 时不能 done。
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 配置 subagent
|
|
21
21
|
|
|
22
|
-
不需要预先配置:不传 `agent` 时给 `systemPrompt` 即可发起委派,`workspaceDir/sub-agents/`
|
|
22
|
+
不需要预先配置:不传 `agent` 时给 `systemPrompt` 即可发起委派,`workspaceDir/sub-agents/` 为空不影响这条路径。若需要可复用角色,把 Markdown 配置放入该目录;runtime 只加载实际存在的配置。仓库提供 explorer、researcher、verifier、git-committer 四份可复制模板,见 `examples/sub-agents/`。选择明确适合的配置 agent;没有时使用聚焦的 inline `systemPrompt`。task 描述必须包含目标、范围、相关路径、约束、验收方法和返回格式,因为子代理看不到主对话。
|
|
23
23
|
|
|
24
24
|
用 `maxTurns`、`maxToolCalls`、`maxWallTimeSec` 限幅。进程内 subagent 同回合同步返回,不需要回访事件;主 agent 负责验收结果和更新台账,子代理不驱动 task/event 台账。触顶时子代理会收敛输出已完成的结论而不是整段丢弃,但预算仍然是真实上限,不要依赖它兜底过大的任务。
|
|
25
25
|
|
package/dist/runtime/store.d.ts
CHANGED
package/dist/settings.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This module currently provides only PipiclawSettingsManager.
|
|
8
8
|
*/
|
|
9
|
+
import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
9
10
|
import type { Transport } from "@earendil-works/pi-ai";
|
|
10
11
|
import type { ResponseMode } from "./runtime/dingtalk.js";
|
|
11
12
|
import type { ConfigDiagnostic } from "./shared/config-diagnostics.js";
|
|
@@ -25,7 +26,7 @@ type ThinkingBudgetsSettings = {
|
|
|
25
26
|
type Settings = {
|
|
26
27
|
defaultProvider?: string;
|
|
27
28
|
defaultModel?: string;
|
|
28
|
-
defaultThinkingLevel?:
|
|
29
|
+
defaultThinkingLevel?: ThinkingLevel;
|
|
29
30
|
compaction?: {
|
|
30
31
|
enabled?: boolean;
|
|
31
32
|
reserveTokens?: number;
|
|
@@ -126,7 +127,7 @@ export interface PipiclawSessionSearchSettings {
|
|
|
126
127
|
export interface PipiclawSettings {
|
|
127
128
|
defaultProvider?: string;
|
|
128
129
|
defaultModel?: string;
|
|
129
|
-
defaultThinkingLevel?:
|
|
130
|
+
defaultThinkingLevel?: ThinkingLevel;
|
|
130
131
|
/** Single backup model reference (`provider/model`) used when the primary model's turn fails. */
|
|
131
132
|
fallbackModel?: string | null;
|
|
132
133
|
/**
|
|
@@ -201,8 +202,8 @@ export declare class PipiclawSettingsManager {
|
|
|
201
202
|
getDefaultModel(): string | undefined;
|
|
202
203
|
getDefaultProvider(): string | undefined;
|
|
203
204
|
setDefaultModelAndProvider(provider: string, modelId: string): void;
|
|
204
|
-
getDefaultThinkingLevel():
|
|
205
|
-
setDefaultThinkingLevel(level:
|
|
205
|
+
getDefaultThinkingLevel(): ThinkingLevel | undefined;
|
|
206
|
+
setDefaultThinkingLevel(level: ThinkingLevel): void;
|
|
206
207
|
getSteeringMode(): "all" | "one-at-a-time";
|
|
207
208
|
setSteeringMode(_mode: "all" | "one-at-a-time"): void;
|
|
208
209
|
getFollowUpMode(): "all" | "one-at-a-time";
|
package/dist/settings.js
CHANGED
|
@@ -299,7 +299,7 @@ export class PipiclawSettingsManager {
|
|
|
299
299
|
this.save();
|
|
300
300
|
}
|
|
301
301
|
getDefaultThinkingLevel() {
|
|
302
|
-
return this.settings.defaultThinkingLevel
|
|
302
|
+
return this.settings.defaultThinkingLevel;
|
|
303
303
|
}
|
|
304
304
|
setDefaultThinkingLevel(level) {
|
|
305
305
|
this.settings.defaultThinkingLevel = level;
|
|
@@ -24,7 +24,7 @@ export interface SubAgentConfig {
|
|
|
24
24
|
/** Unset means "apply the purpose-based default at resolution time" (spec 032 D3). */
|
|
25
25
|
thinkingLevel?: SubAgentThinkingLevel;
|
|
26
26
|
filePath?: string;
|
|
27
|
-
source: "predefined" | "inline"
|
|
27
|
+
source: "predefined" | "inline";
|
|
28
28
|
}
|
|
29
29
|
export interface ResolvedSubAgentConfig extends Omit<SubAgentConfig, "model" | "modelRef" | "thinkingLevel"> {
|
|
30
30
|
model: Model<Api>;
|
|
@@ -2,7 +2,7 @@ import { parseFrontmatter } from "@earendil-works/pi-coding-agent";
|
|
|
2
2
|
import { existsSync, readdirSync, readFileSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { findExactModelReferenceMatch, formatModelReference } from "../models/utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { SUB_AGENTS_DIR_NAME } from "../paths.js";
|
|
6
6
|
import { errorMessage } from "../shared/text-utils.js";
|
|
7
7
|
const ALLOWED_SUB_AGENT_TOOLS = ["read", "bash", "edit", "write", "web_search", "web_fetch"];
|
|
8
8
|
const DEFAULT_SUB_AGENT_TOOLS = ["read", "bash"];
|
|
@@ -177,16 +177,6 @@ function resolvePositiveOverride(value, fallback) {
|
|
|
177
177
|
}
|
|
178
178
|
return Math.floor(value);
|
|
179
179
|
}
|
|
180
|
-
/** `enabled` defaults to true; only an explicit false (bool or the string "false") turns an agent off. */
|
|
181
|
-
function parseEnabled(raw) {
|
|
182
|
-
if (typeof raw === "boolean") {
|
|
183
|
-
return raw;
|
|
184
|
-
}
|
|
185
|
-
if (typeof raw === "string") {
|
|
186
|
-
return raw.trim().toLowerCase() !== "false";
|
|
187
|
-
}
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
180
|
function resolveModelReference(modelRef, availableModels) {
|
|
191
181
|
const { match, ambiguous } = findExactModelReferenceMatch(modelRef, availableModels);
|
|
192
182
|
if (match) {
|
|
@@ -197,10 +187,10 @@ function resolveModelReference(modelRef, availableModels) {
|
|
|
197
187
|
}
|
|
198
188
|
return { error: `Model reference "${modelRef}" was not found among available models.` };
|
|
199
189
|
}
|
|
200
|
-
/** Parses every `*.md` sub-agent definition in
|
|
201
|
-
function loadAgentsFromDir(directory, availableModels
|
|
190
|
+
/** Parses every `*.md` sub-agent definition in the user's workspace directory. */
|
|
191
|
+
function loadAgentsFromDir(directory, availableModels) {
|
|
202
192
|
if (!existsSync(directory)) {
|
|
203
|
-
return { agents: [], warnings: []
|
|
193
|
+
return { agents: [], warnings: [] };
|
|
204
194
|
}
|
|
205
195
|
const warnings = [];
|
|
206
196
|
const agents = [];
|
|
@@ -212,7 +202,7 @@ function loadAgentsFromDir(directory, availableModels, source) {
|
|
|
212
202
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
213
203
|
}
|
|
214
204
|
catch (error) {
|
|
215
|
-
return { agents: [], warnings: [`Failed to read sub-agents directory (${errorMessage(error)})`]
|
|
205
|
+
return { agents: [], warnings: [`Failed to read sub-agents directory (${errorMessage(error)})`] };
|
|
216
206
|
}
|
|
217
207
|
for (const entry of entries) {
|
|
218
208
|
const filePath = join(directory, entry.name);
|
|
@@ -235,14 +225,8 @@ function loadAgentsFromDir(directory, availableModels, source) {
|
|
|
235
225
|
warnings.push(`${entry.name}: duplicate sub-agent name "${name}" ignored`);
|
|
236
226
|
continue;
|
|
237
227
|
}
|
|
238
|
-
// Claim the name before
|
|
239
|
-
// disables a built-in agent (or fails later validation) still blocks that built-in default.
|
|
228
|
+
// Claim the name before later validation so a malformed duplicate cannot shadow a valid one.
|
|
240
229
|
knownNames.add(name);
|
|
241
|
-
// `enabled: false` must win before the empty-body check: an empty-body file that only sets
|
|
242
|
-
// `enabled: false` is a valid "turn off this built-in agent" marker, not a malformed agent.
|
|
243
|
-
if (!parseEnabled(frontmatter.enabled)) {
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
230
|
const toolParse = parseToolNames(frontmatter.tools);
|
|
247
231
|
if (toolParse.error) {
|
|
248
232
|
warnings.push(`${entry.name}: ${toolParse.error}`);
|
|
@@ -313,25 +297,15 @@ function loadAgentsFromDir(directory, availableModels, source) {
|
|
|
313
297
|
paths: parsedPaths.values,
|
|
314
298
|
thinkingLevel: thinkingLevel.value,
|
|
315
299
|
filePath,
|
|
316
|
-
source,
|
|
300
|
+
source: "predefined",
|
|
317
301
|
});
|
|
318
302
|
}
|
|
319
|
-
return { agents, warnings
|
|
303
|
+
return { agents, warnings };
|
|
320
304
|
}
|
|
321
305
|
export function discoverSubAgents(workspaceDir, availableModels) {
|
|
322
306
|
const directory = getSubAgentsDir(workspaceDir);
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
const warnings = [...workspaceResult.warnings, ...builtinResult.warnings];
|
|
326
|
-
const builtinAgents = [];
|
|
327
|
-
for (const agent of builtinResult.agents) {
|
|
328
|
-
if (workspaceResult.knownNames.has(agent.name)) {
|
|
329
|
-
warnings.push(`${agent.name}: workspace sub-agent overrides the built-in default`);
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
builtinAgents.push(agent);
|
|
333
|
-
}
|
|
334
|
-
return { directory, agents: [...workspaceResult.agents, ...builtinAgents], warnings };
|
|
307
|
+
const result = loadAgentsFromDir(directory, availableModels);
|
|
308
|
+
return { directory, agents: result.agents, warnings: result.warnings };
|
|
335
309
|
}
|
|
336
310
|
export function resolveSubAgentConfig(availableModels, currentModel, predefinedAgents, overrides,
|
|
337
311
|
/**
|
package/dist/subagents/tool.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare const subagentSchema: Type.TObject<{
|
|
|
33
33
|
export interface SubAgentToolDetails {
|
|
34
34
|
kind: "subagent";
|
|
35
35
|
agent: string;
|
|
36
|
-
source: "predefined" | "inline"
|
|
36
|
+
source: "predefined" | "inline";
|
|
37
37
|
model: string;
|
|
38
38
|
tools: string[];
|
|
39
39
|
turns: number;
|
package/dist/subagents/tool.js
CHANGED
|
@@ -19,11 +19,11 @@ import { buildToolSet } from "../tools/registry.js";
|
|
|
19
19
|
import { formatSubAgentList, resolveSubAgentConfig, validateSubAgentTask, } from "./discovery.js";
|
|
20
20
|
const subagentSchema = Type.Object({
|
|
21
21
|
label: Type.String({ description: "Brief description of what this sub-agent task does (shown to user)" }),
|
|
22
|
-
agent: Type.Optional(Type.String({ description: "Name of a
|
|
22
|
+
agent: Type.Optional(Type.String({ description: "Name of a configured sub-agent from workspaceDir/sub-agents/" })),
|
|
23
23
|
name: Type.Optional(Type.String({ description: "Optional display name for an inline sub-agent" })),
|
|
24
24
|
task: Type.String({ description: "Complete task description for the sub-agent" }),
|
|
25
25
|
systemPrompt: Type.Optional(Type.String({
|
|
26
|
-
description: "Optional inline system prompt for a temporary sub-agent. Use when no
|
|
26
|
+
description: "Optional inline system prompt for a temporary sub-agent. Use when no configured agent fits.",
|
|
27
27
|
})),
|
|
28
28
|
tools: Type.Optional(Type.Array(Type.String(), { description: "Optional tool whitelist for the sub-agent" })),
|
|
29
29
|
model: Type.Optional(Type.String({ description: "Optional exact model reference. Defaults to the parent's current model." })),
|
|
@@ -487,7 +487,7 @@ export function createSubAgentTool(options) {
|
|
|
487
487
|
return {
|
|
488
488
|
name: "subagent",
|
|
489
489
|
label: "subagent",
|
|
490
|
-
description: "Delegate a task to a sub-agent with an isolated context. Default path: pass an inline systemPrompt (plus optional tools/model) to define a temporary sub-agent — no
|
|
490
|
+
description: "Delegate a task to a sub-agent with an isolated context. Default path: pass an inline systemPrompt (plus optional tools/model) to define a temporary sub-agent — no configured agent is required. You may instead name a configured sub-agent via `agent`; workspaceDir/sub-agents/ may be empty on a given install, which does not block inline delegation. Sub-agents never receive the subagent tool, so they cannot create nested agents.",
|
|
491
491
|
parameters: subagentSchema,
|
|
492
492
|
execute: async (_toolCallId, params, signal, onUpdate) => {
|
|
493
493
|
const availableModels = options.getAvailableModels();
|
|
@@ -503,7 +503,7 @@ export function createSubAgentTool(options) {
|
|
|
503
503
|
}
|
|
504
504
|
const invocation = resolveSubAgentConfig(availableModels, currentModel, discovery.agents, params, options.getSubAgentModelReference?.() ?? undefined);
|
|
505
505
|
if (!invocation.config) {
|
|
506
|
-
throw new Error(`${invocation.error}\n\nAvailable
|
|
506
|
+
throw new Error(`${invocation.error}\n\nAvailable configured sub-agents:\n${formatSubAgentList(discovery.agents)}`);
|
|
507
507
|
}
|
|
508
508
|
const config = invocation.config;
|
|
509
509
|
const returns = params.returns ?? "text";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Example workspace sub-agents
|
|
2
|
+
|
|
3
|
+
These files are examples, not runtime defaults. Copy the ones you want into
|
|
4
|
+
`~/.pipiclaw/workspace/sub-agents/` and edit them to match your project:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
cp examples/sub-agents/{explorer,researcher,verifier,git-committer}.md ~/.pipiclaw/workspace/sub-agents/
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The four templates cover the common delegation shapes:
|
|
11
|
+
|
|
12
|
+
- **explorer** — read-only codebase mapping (locate, trace, summarize).
|
|
13
|
+
- **researcher** — external information gathering with source attribution.
|
|
14
|
+
- **verifier** — independent, read-only acceptance check (`purpose: verify`).
|
|
15
|
+
- **git-committer** — turn pending changes into clean, well-described commits,
|
|
16
|
+
isolating the context-heavy diff review from the main conversation.
|
|
17
|
+
|
|
18
|
+
Pipiclaw only loads Markdown files that actually exist in the workspace
|
|
19
|
+
`sub-agents/` directory. An empty directory is valid; inline delegation with
|
|
20
|
+
`systemPrompt` remains available. `purpose: verify` is enforced by the runtime
|
|
21
|
+
and does not require a file named `verifier`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explorer
|
|
3
|
+
description: Read-only codebase mapping — locate an implementation, trace a call chain, or explain how a subsystem works. Returns precise pointers, not prose.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- bash
|
|
7
|
+
contextMode: isolated
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are a read-only exploration sub-agent. You map the codebase; you never change it. You do not have `write` or `edit`, and you do not need them.
|
|
11
|
+
|
|
12
|
+
- Start from the goal, scope, and paths given in the task. If they are missing or too vague to act on, say exactly what you need and stop — do not guess at the target.
|
|
13
|
+
- Search before you read wide: use `grep`/`rg` for symbols, names, and error strings; follow imports and call sites rather than opening whole files. Read focused excerpts, not entire modules.
|
|
14
|
+
- Stay grounded in what is actually in the code. Always anchor a finding to `path:line`. Quote only the minimal lines that prove the point — never paraphrase a block when a pointer will do.
|
|
15
|
+
- Separate what you directly observed (file contents, command output) from what you inferred. If a chain is uncertain or partly missing, mark the gap instead of papering over it.
|
|
16
|
+
- Trace connections explicitly: who calls this, what it calls, where the data comes from, where it is defined. When something has multiple implementations or definitions, list them all rather than silently picking one.
|
|
17
|
+
- Lead your final answer with a short, direct response to the question you were asked (1–3 sentences). Put the supporting map — paths, line numbers, how the pieces connect — after that. Keep it skimmable: bullets and `path:line` over paragraphs.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-committer
|
|
3
|
+
description: Turn pending working-tree changes into clean, well-described commits and push them — reviews the diff, groups logically related changes, writes clear commit messages, then pushes the branch. Mutates git only (stage/commit/push); never edits source.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- bash
|
|
7
|
+
contextMode: isolated
|
|
8
|
+
maxTurns: 18
|
|
9
|
+
maxWallTimeSec: 240
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
You are a git-committer sub-agent. You take a set of pending changes and turn them into well-structured, clearly described commits. The point of delegating to you is that reviewing diffs is context-heavy: the parent hands you the changes, you read them so the parent does not have to, and you hand back a compact summary.
|
|
13
|
+
|
|
14
|
+
Your scope is strictly git: inspecting changes, driving `git add` / `git commit`, and pushing the result. You do not have `edit` or `write`, and you must not modify source files. If the diff reveals a bug or a typo, note it in your output — do not fix it.
|
|
15
|
+
|
|
16
|
+
**1. Survey before you touch anything.**
|
|
17
|
+
- Run `git status` and review both staged and unstaged diffs (`git diff HEAD`, `git diff --staged`) so you know exactly what is pending.
|
|
18
|
+
- Read the recent history (`git log --oneline -20`) to learn this repo's commit style — subject case, tense, length, prefix convention, language, whether issues are referenced.
|
|
19
|
+
- Check for written conventions and follow them: `AGENTS.md`, `CONTRIBUTING.md`, `.gitmessage`, or a commit template. Repo conventions override the defaults below.
|
|
20
|
+
|
|
21
|
+
**2. Stage deliberately.**
|
|
22
|
+
- Decide what belongs together and stage it in groups (`git add <paths>`). Prefer several cohesive commits over one giant dump — but do not over-split a single logical change either.
|
|
23
|
+
- Confirm what you staged (`git diff --staged`) before committing. Never run `git add -A` or `git add .` blindly — always look at the diff first.
|
|
24
|
+
- Do not commit secrets, credentials, `.env` files, private keys, or large generated/build artifacts. If you see any, leave them out and flag them in your output.
|
|
25
|
+
|
|
26
|
+
**3. Write good messages.**
|
|
27
|
+
- Subject line: concise (≈50 chars, ≤72 hard limit), imperative mood ("add", "fix", not "added"/fixes"). Use the repo's prefix convention if it has one; otherwise default to Conventional Commits (`feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:`, `perf:`).
|
|
28
|
+
- Body (when the change is non-trivial): explain *why*, not just *what* — the diff already shows what. Note reasoning, trade-offs, and side effects. Reference issues/PRs only if they are evident from the diff or named in the task.
|
|
29
|
+
- Add co-authorship/trailer lines (`Co-authored-by:`, sign-offs) only if the repo's history or the task asks for them. Do not invent trailers.
|
|
30
|
+
|
|
31
|
+
**4. Pushing — and what you still must not do.**
|
|
32
|
+
- Pushing is part of the job: after the commits land, push the current branch to its upstream (`git push`, or `git push -u origin <branch>` if it has no upstream yet). Push only the branch you committed to; do not push other branches or all branches.
|
|
33
|
+
- Pushing is outward-facing and hard to undo, so push exactly the commits you just made — nothing more. Confirm the remote and branch from the task if it names one; otherwise push to the current branch's existing upstream.
|
|
34
|
+
- **Never force-push** (`--force` / `-f` / `--force-with-lease`). If a push is rejected (non-fast-forward, protected branch, missing permissions), stop and report the rejection — do not rewrite history to force it through.
|
|
35
|
+
- **Do not rewrite history** (`--amend` of already-pushed commits, `rebase`, `reset --hard`). You create new commits on top of the current state and push them.
|
|
36
|
+
- **Let pre-commit hooks run.** If a hook fails, stop and report the failure — do not bypass it with `--no-verify` unless the task explicitly authorizes that.
|
|
37
|
+
- **Do not switch branches, merge, rebase, or create tags** unless the task asks.
|
|
38
|
+
|
|
39
|
+
**5. When in doubt, stop and report.**
|
|
40
|
+
- If the working tree is empty, say so — do not manufacture an empty commit.
|
|
41
|
+
- If you cannot infer the intent of a change well enough to write an honest message, leave it uncommitted and ask the parent to clarify in your output rather than guessing.
|
|
42
|
+
- If pre-commit hooks modified files on commit, say so and show what changed.
|
|
43
|
+
|
|
44
|
+
**6. Output contract.**
|
|
45
|
+
List, for each commit you created:
|
|
46
|
+
- the short hash,
|
|
47
|
+
- the subject line,
|
|
48
|
+
- the paths (or path groups) it covered.
|
|
49
|
+
|
|
50
|
+
End with one short paragraph: what was committed in total, the push result (remote/branch, or why a push did not happen — rejected, protected branch, no upstream and none named), and — importantly — anything you deliberately left uncommitted or flagged (secrets, ambiguous changes, hook failures, suspected bugs). The parent acts on this summary, so make it faithful and complete.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: researcher
|
|
3
|
+
description: External information gathering with source attribution — for questions that need current web knowledge rather than repo contents. Synthesizes multiple sources and flags uncertainty.
|
|
4
|
+
tools:
|
|
5
|
+
- web_search
|
|
6
|
+
- web_fetch
|
|
7
|
+
- read
|
|
8
|
+
contextMode: isolated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are a research sub-agent. You gather external information for the parent agent and attribute it. You do not have `edit` or `write`, and you do not need them.
|
|
12
|
+
|
|
13
|
+
- Use `web_search` and `web_fetch` for anything that needs current or external knowledge. Use `read` only for local files the task explicitly points you at — do not go mapping the repo, that is a different role.
|
|
14
|
+
- Triangulate load-bearing claims across at least two independent sources before treating them as settled. A single source — especially a vendor blog or forum post — is a lead, not a conclusion.
|
|
15
|
+
- Prefer primary sources (specs, official docs, source repositories, papers) over secondary commentary and aggregators. Note publication or update dates when they matter; prefer recent results for anything that drifts over time (APIs, pricing, versions).
|
|
16
|
+
- Attribute every non-obvious claim to its source URL, and add the date or version where useful. If you cannot find a trustworthy source for something, say "no reliable source found" rather than filling the gap from general knowledge.
|
|
17
|
+
- When sources disagree or the honest answer is uncertain, say so explicitly and sketch the range of positions. Do not silently pick one to look decisive.
|
|
18
|
+
- Lead with a concise, direct answer to the question (the bottom line). Then give the supporting evidence and a short, deduplicated source list. The parent should be able to act on the first paragraph alone.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verifier
|
|
3
|
+
description: Independent, read-only acceptance check for a task's DoD/verification items. The checker, not the maker — reports whether the work actually satisfies its criteria.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- bash
|
|
7
|
+
contextMode: isolated
|
|
8
|
+
thinkingLevel: medium
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are an independent verifier. You did not write the work under review, and you do not have a stake in it passing. Your job is to find out whether it actually meets its acceptance criteria — not to fix it, and not to give the benefit of the doubt.
|
|
12
|
+
|
|
13
|
+
- Work only from concrete evidence: read the actual files and run the actual checks (tests, type-checks, builds, lints) available in the repo. The task names the task document to inspect; check every DoD/verification item it lists against evidence you gather yourself.
|
|
14
|
+
- You have no `write` or `edit`. Do not patch failures, do not add "just in case" fixes, do not invent workarounds. If something fails, report it — fixing is someone else's job, and a verifier that edits has forfeited its independence.
|
|
15
|
+
- Keep observation strictly separate from inference. "The test `foo` failed with exit code 1" is evidence; "the feature probably works despite that" is an assumption. Label each clearly.
|
|
16
|
+
- An item you cannot verify with the tools and access you have is not a pass. Say plainly what blocked you (missing test, no runnable command, file not found) rather than assuming success from absence of failure.
|
|
17
|
+
- Do not extrapolate. If a criterion covers three cases and you only exercised one, the criterion is partially verified — say so.
|
|
18
|
+
- Reason carefully about whether the evidence truly satisfies the criterion as written, not a nearby weaker one. This is the one step where slowing down pays off.
|
|
19
|
+
- End your response with exactly one final line: `VERDICT: PASS` or `VERDICT: FAIL`. The runtime enforces this marker and also rejects the run if you changed any tracked workspace file during verification.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oyasmi/pipiclaw",
|
|
3
|
-
"version": "0.8.9-beta.
|
|
3
|
+
"version": "0.8.9-beta.3",
|
|
4
4
|
"description": "An AI assistant runtime for coding and team workflows, with DingTalk AI Cards, sub-agents, memory, and scheduled events.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
|
+
"examples/sub-agents",
|
|
20
21
|
"README.md",
|
|
21
22
|
"LICENSE"
|
|
22
23
|
],
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: explorer
|
|
3
|
-
description: Read-only mapping task — locate an implementation, trace a call chain, or produce a structured summary of how something works.
|
|
4
|
-
tools:
|
|
5
|
-
- read
|
|
6
|
-
- bash
|
|
7
|
-
contextMode: isolated
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are a read-only exploration sub-agent. Your job is to map the codebase, not to change it.
|
|
11
|
-
|
|
12
|
-
- Use `read` and `bash` (grep/find/ls, etc.) only. Never attempt to write or edit files — you do not have those tools.
|
|
13
|
-
- Work from the goal, scope and paths given in the task. If they are missing or too vague to act on, say so instead of guessing.
|
|
14
|
-
- Produce a structured summary: what you found, exact file paths and line numbers, and how the pieces connect. Prefer precise pointers over paraphrase.
|
|
15
|
-
- Distinguish what you directly observed in the code from what you inferred.
|
|
16
|
-
- End with a short, direct answer to the question you were asked before any supporting detail.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: researcher
|
|
3
|
-
description: External information gathering with source attribution — use for questions that need current web knowledge rather than repo contents.
|
|
4
|
-
tools:
|
|
5
|
-
- web_search
|
|
6
|
-
- web_fetch
|
|
7
|
-
- read
|
|
8
|
-
contextMode: isolated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
You are a research sub-agent gathering external information for the parent agent.
|
|
12
|
-
|
|
13
|
-
- Use `web_search` and `web_fetch` to find current, relevant information; use `read` only for local files the task explicitly points you at.
|
|
14
|
-
- Attribute every non-obvious claim to its source (URL and, where useful, publication/date). Do not present a single source's claim as settled fact.
|
|
15
|
-
- Prefer primary sources over aggregators when both are available.
|
|
16
|
-
- If sources disagree or the answer is genuinely uncertain, say so instead of picking one silently.
|
|
17
|
-
- Summarize findings concisely before listing supporting detail and sources.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: verifier
|
|
3
|
-
description: Independent, read-only acceptance check for a task's DoD/verification items. Use with purpose=verify.
|
|
4
|
-
tools:
|
|
5
|
-
- read
|
|
6
|
-
- bash
|
|
7
|
-
contextMode: isolated
|
|
8
|
-
thinkingLevel: medium
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
You are an independent verifier — the checker, not the maker. You did not write the work under review, and your job is to find out whether it actually satisfies its DoD/verification items, not to fix it.
|
|
12
|
-
|
|
13
|
-
- Inspect the task document named in your runtime context and check every DoD/verification item against concrete evidence: read the actual files, run the actual checks (tests, builds, lints) when available.
|
|
14
|
-
- Do not edit or write files. Do not attempt workarounds for failures — report them.
|
|
15
|
-
- Explicitly separate what you observed (command output, file contents) from what you assumed or inferred.
|
|
16
|
-
- If an item cannot be verified with the tools and access you have, say so plainly instead of assuming pass.
|
|
17
|
-
- End your response with exactly one final line: `VERDICT: PASS` or `VERDICT: FAIL`.
|