@chen_hu_hu/pi-qq 1.3.4 → 1.3.5
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/CHANGELOG.md +8 -1
- package/README-zh.md +1 -0
- package/README.md +1 -0
- package/doc/send-skill.md +257 -0
- package/package.json +1 -1
- package/src/relay/bubble-writer.ts +9 -1
- package/src/relay/run-stream-relay.ts +19 -3
- package/src/relay/stream-block-format.ts +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.5] - 2026-11-04
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Reading a `SKILL.md` now renders a dedicated `## 🧩 Skill` block on QQ instead of a generic read tool; the file content is not forwarded.
|
|
15
|
+
|
|
10
16
|
## [1.3.4] - 2026-11-04
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -73,7 +79,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
73
79
|
- Added thinking labels, per-tool icons, model-error recovery, and idle-safe session handling.
|
|
74
80
|
- Reorganized modules by bounded context and updated settings and delivery documentation.
|
|
75
81
|
|
|
76
|
-
[Unreleased]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.
|
|
82
|
+
[Unreleased]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.5...HEAD
|
|
83
|
+
[1.3.5]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.4...v1.3.5
|
|
77
84
|
[1.3.4]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.3...v1.3.4
|
|
78
85
|
[1.3.3]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.2...v1.3.3
|
|
79
86
|
[1.3.2]: https://github.com/CQ-Developer/pi-qq/compare/v1.3.1...v1.3.2
|
package/README-zh.md
CHANGED
|
@@ -164,6 +164,7 @@ npm run format:check
|
|
|
164
164
|
- 图片会保存为文件,并通过 pi 的 `read` 工具查看;当前模型必须支持图片输入才能看到内容。
|
|
165
165
|
- 保存的附件位于工作区 `.pi/` 下;如有需要,请把 `.pi/` 加入你自己的项目 `.gitignore`。
|
|
166
166
|
- QQ 对每条入站消息的被动回复次数有限制。可用 `/qq-test-budget` 查看本地额度。
|
|
167
|
+
- 读取 `SKILL.md` 时,QQ 显示 `## 🧩 Skill` 和 skill 名称,不转发文件内容。
|
|
167
168
|
|
|
168
169
|
## 许可证
|
|
169
170
|
|
package/README.md
CHANGED
|
@@ -164,6 +164,7 @@ The extension entrypoint is `index.ts`. Source modules are grouped by responsibi
|
|
|
164
164
|
- Images are saved as files and read through pi's `read` tool; the current model must support image input to see them.
|
|
165
165
|
- Saved attachments are workspace-local under `.pi/`; add `.pi/` to your own project `.gitignore` if needed.
|
|
166
166
|
- QQ limits passive replies per inbound message. Use `/qq-test-budget` to inspect the local budget.
|
|
167
|
+
- Reading a `SKILL.md` is shown as a `## 🧩 Skill` block with the skill name; the file content is not forwarded to QQ.
|
|
167
168
|
|
|
168
169
|
## License
|
|
169
170
|
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# QQ 侧 Skill 执行显示设计
|
|
2
|
+
|
|
3
|
+
> 状态:设计文档,已实现
|
|
4
|
+
> 日期:2026-11-04
|
|
5
|
+
> 涉及版本:pi-qq 1.3.4,pi 1.5.0
|
|
6
|
+
> 证据截图:
|
|
7
|
+
>
|
|
8
|
+
> - pi TUI:`/home/chen/project/pi-qq-test/pi.png`
|
|
9
|
+
> - QQ:`/home/chen/project/pi-qq-test/qq.jpg`
|
|
10
|
+
|
|
11
|
+
## 1. 目标
|
|
12
|
+
|
|
13
|
+
用户在 QQ 上应该看到 **Skill 的执行**,而不是普通的 `read` 工具执行。
|
|
14
|
+
|
|
15
|
+
目标格式:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
## 🧩 Skill
|
|
19
|
+
|
|
20
|
+
`playwright-cli`
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
明确不做:
|
|
24
|
+
|
|
25
|
+
- 不显示 `SKILL.md` 的完整内容;
|
|
26
|
+
- 不显示 skill 的来源路径(全局/项目);
|
|
27
|
+
- 不支持 QQ 侧 `/skill:` 命令;
|
|
28
|
+
- 不区分“自动选择”和“显式调用”,只展示 skill 名称。
|
|
29
|
+
|
|
30
|
+
## 2. 调研结论
|
|
31
|
+
|
|
32
|
+
### 2.1 pi 的 `[skill]` 是什么
|
|
33
|
+
|
|
34
|
+
截图中的:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
[skill] playwright-cli (ctrl+o to expand)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
是 pi TUI 对 **读取 `SKILL.md` 的 read 工具** 的特殊渲染,不是独立的 skill 事件。
|
|
41
|
+
|
|
42
|
+
pi 的 read 渲染器会检测文件名:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// pi: dist/core/tools/renderers/read.js
|
|
46
|
+
if (fileName === "SKILL.md") {
|
|
47
|
+
return { kind: "skill", label: basename(dirname(absolutePath)) };
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
所以 TUI 把它折叠成 `[skill]`;会话记录中实际仍然是:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
toolCall: read /home/chen/.pi/agent/skills/playwright-cli/SKILL.md
|
|
55
|
+
toolResult: SKILL.md 内容
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
对应会话:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
/home/chen/.pi/agent/sessions/--home-chen-project-pi-qq-test--/
|
|
62
|
+
2026-11-03T15-37-34-742Z_01a1a20f-0115-7773-a4c5-a011cda00d57.jsonl
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2.2 QQ 当前显示什么
|
|
66
|
+
|
|
67
|
+
`qq.jpg` 中显示的是:
|
|
68
|
+
|
|
69
|
+
- `📖 read` 工具气泡;
|
|
70
|
+
- 参数路径 `.../playwright-cli/SKILL.md`;
|
|
71
|
+
- `SKILL.md` 的完整内容;
|
|
72
|
+
- 后续思考和 bash。
|
|
73
|
+
|
|
74
|
+
因此当前 QQ **有内容**,但语义上是“read 了一个文件”,不是“执行了 skill”。这正是需要改变的地方。
|
|
75
|
+
|
|
76
|
+
### 2.3 显式 `/skill:` 路径
|
|
77
|
+
|
|
78
|
+
pi 也支持从 TUI 执行 `/skill:name`,会展开成一条包含 `<skill ...>` 的 user message,并用 `SkillInvocationMessageComponent` 渲染。
|
|
79
|
+
|
|
80
|
+
但本设计**不支持 QQ `/skill:`**:
|
|
81
|
+
|
|
82
|
+
- QQ 入站命令路由会把 `/skill:` 当未知命令;
|
|
83
|
+
- pi-qq 不转发 user message;
|
|
84
|
+
- 这些行为保持不变。
|
|
85
|
+
|
|
86
|
+
本次只处理模型自动读取 `SKILL.md` 的情况。
|
|
87
|
+
|
|
88
|
+
## 3. 当前实现路径
|
|
89
|
+
|
|
90
|
+
模型读取 `SKILL.md` 时,pi-qq 收到普通工具事件:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
tool_execution_start: toolName=read, args.path=/.../SKILL.md
|
|
94
|
+
tool_execution_end: result=SKILL.md 内容
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
当前链路:
|
|
98
|
+
|
|
99
|
+
- `src/relay/run-stream-relay.ts` 把 `read` 加入工具队列;
|
|
100
|
+
- `src/relay/bubble-writer.ts` 调用 `formatToolLine("read", args)`;
|
|
101
|
+
- `src/relay/stream-block-format.ts` 输出 `**📖 read**` + 路径;
|
|
102
|
+
- `onToolEnd` 再输出完整 `SKILL.md` 结果。
|
|
103
|
+
|
|
104
|
+
没有任何 skill 识别逻辑,所以 QQ 看到的是普通 read。
|
|
105
|
+
|
|
106
|
+
## 4. 根因
|
|
107
|
+
|
|
108
|
+
pi 的 `[skill]` 是 **展示层分类**,不是协议事件:
|
|
109
|
+
|
|
110
|
+
- 没有 `skill_start` / `skill_end`;
|
|
111
|
+
- pi-qq 无法从事件类型知道“这是 skill”;
|
|
112
|
+
- 唯一可用的信号是 `read` 工具参数中的 `SKILL.md` 路径;
|
|
113
|
+
- 当前格式化逻辑没有利用这个信号。
|
|
114
|
+
|
|
115
|
+
## 5. 修改方案
|
|
116
|
+
|
|
117
|
+
### 5.1 识别 skill read
|
|
118
|
+
|
|
119
|
+
新增纯函数,例如:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
export interface SkillRead {
|
|
123
|
+
name: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function detectSkillRead(toolName: string, args: unknown): SkillRead | undefined;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
规则:
|
|
130
|
+
|
|
131
|
+
- `toolName === "read"`;
|
|
132
|
+
- 参数路径的最后一段是 `SKILL.md`;
|
|
133
|
+
- 支持 `path` 和 `file_path` 两种参数名;
|
|
134
|
+
- 支持 `/` 和 `\` 路径分隔符;
|
|
135
|
+
- skill 名称取父目录名:
|
|
136
|
+
- `.../playwright-cli/SKILL.md` → `playwright-cli`;
|
|
137
|
+
- `.../my-skill/SKILL.md` → `my-skill`。
|
|
138
|
+
|
|
139
|
+
不读取、不解析 `SKILL.md` 内容,也不显示路径。
|
|
140
|
+
|
|
141
|
+
### 5.2 渲染 skill 气泡
|
|
142
|
+
|
|
143
|
+
在 `formatToolLine()` 或 `BubbleWriter` 中增加 skill 分支,输出:
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## 🧩 Skill
|
|
147
|
+
|
|
148
|
+
`playwright-cli`
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- 标题使用 Markdown 二级标题;
|
|
152
|
+
- skill 名称用行内代码;
|
|
153
|
+
- 不附加路径、来源、描述或内容。
|
|
154
|
+
|
|
155
|
+
标题固定为英文 `Skill`,不跟随 `language` 配置,也不做翻译。
|
|
156
|
+
|
|
157
|
+
### 5.3 抑制原 read 工具输出
|
|
158
|
+
|
|
159
|
+
检测到 skill read 后:
|
|
160
|
+
|
|
161
|
+
- **不输出** `📖 read` 工具行;
|
|
162
|
+
- **不输出** `SKILL.md` 的 tool result;
|
|
163
|
+
- 只输出一个 skill 气泡;
|
|
164
|
+
- 后续 assistant 文本/工具继续按原顺序输出。
|
|
165
|
+
|
|
166
|
+
实现上需要在 `ToolCall` 上记录 skill 信息:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
interface ToolCall {
|
|
170
|
+
...
|
|
171
|
+
skillName?: string;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
- `onToolStart` 检测并写入 `skillName`;
|
|
176
|
+
- `startNextTool` 如果 `skillName` 存在,调用 `writer.pushSkill(name)`;
|
|
177
|
+
- `finishTool` 对 skill 跳过 `pushToolResult`,但仍清理 active tool、启动下一个工具、flush deferred 文本。
|
|
178
|
+
|
|
179
|
+
### 5.4 顺序与气泡边界
|
|
180
|
+
|
|
181
|
+
- skill 气泡独立成泡;
|
|
182
|
+
- skill 之后如果还有工具,继续按工具顺序输出;
|
|
183
|
+
- 如果 skill 后面是 assistant 文本,文本从新气泡开始;
|
|
184
|
+
- 如果同一个 run 多次读取 `SKILL.md`,每次读取都会产生一个 skill 气泡;第一版不做去重。
|
|
185
|
+
|
|
186
|
+
### 5.5 失败处理
|
|
187
|
+
|
|
188
|
+
当前实现:
|
|
189
|
+
|
|
190
|
+
- 仍然显示 skill 气泡,表示模型尝试加载该 skill;
|
|
191
|
+
- 不显示 `SKILL.md` 内容;
|
|
192
|
+
- 不额外显示失败原因。后续如需提示加载失败,可以再调整。
|
|
193
|
+
|
|
194
|
+
## 6. 执行计划
|
|
195
|
+
|
|
196
|
+
### Phase 1:识别与格式
|
|
197
|
+
|
|
198
|
+
- [x] 新增 `detectSkillRead()`,处理 `path` / `file_path`、Unix/Windows 路径;
|
|
199
|
+
- [x] 新增 `formatSkillBlock(name)`;
|
|
200
|
+
- [x] 单元测试:
|
|
201
|
+
- `read .../playwright-cli/SKILL.md` → skill;
|
|
202
|
+
- 普通 `read` 不受影响;
|
|
203
|
+
- Windows 路径;
|
|
204
|
+
- 大小写/非 `SKILL.md` 文件名;
|
|
205
|
+
- 缺少父目录时的回退名称。
|
|
206
|
+
|
|
207
|
+
### Phase 2:接入 relay
|
|
208
|
+
|
|
209
|
+
- [x] `ToolCall` 增加 `skillName`;
|
|
210
|
+
- [x] `onToolStart` 检测 skill;
|
|
211
|
+
- [x] `BubbleWriter` 增加 `pushSkill(name)`;
|
|
212
|
+
- [x] `startNextTool` 对 skill 使用 `pushSkill`;
|
|
213
|
+
- [x] `finishTool` 对 skill 跳过 read 结果;
|
|
214
|
+
- [x] 测试:
|
|
215
|
+
- 只出现 skill 气泡,不出现 read 工具行/结果;
|
|
216
|
+
- skill 与前后工具的顺序;
|
|
217
|
+
- 流式熔断时 skill 仍按现有 fallback 行为;
|
|
218
|
+
- 多个 skill / 多次读取。
|
|
219
|
+
|
|
220
|
+
### Phase 3:文案与文档
|
|
221
|
+
|
|
222
|
+
- [x] 更新 README 的 skill 说明;
|
|
223
|
+
- [x] 更新 `CHANGELOG.md`。
|
|
224
|
+
|
|
225
|
+
### Phase 4:验证
|
|
226
|
+
|
|
227
|
+
- [x] `npm run lint`
|
|
228
|
+
- [x] `npm run typecheck`
|
|
229
|
+
- [x] `npm test`
|
|
230
|
+
- [x] `npm run format:check`
|
|
231
|
+
- [ ] 在 `pi-qq-test` 中让模型读取 `playwright-cli/SKILL.md`,对比:
|
|
232
|
+
- pi TUI:`[skill] playwright-cli`
|
|
233
|
+
- QQ:`## 🧩 Skill` + `playwright-cli`
|
|
234
|
+
- QQ 不再出现 `📖 read` 和 `SKILL.md` 全文
|
|
235
|
+
|
|
236
|
+
## 7. 变更文件
|
|
237
|
+
|
|
238
|
+
| 文件 | 变更 |
|
|
239
|
+
| ---------------------------------------- | ----------------------------------------- |
|
|
240
|
+
| `src/relay/stream-block-format.ts` | `detectSkillRead()`、`formatSkillBlock()` |
|
|
241
|
+
| `src/relay/run-stream-relay.ts` | `ToolCall.skillName`、start/finish 分支 |
|
|
242
|
+
| `src/relay/bubble-writer.ts` | `pushSkill()` |
|
|
243
|
+
| `test/relay/stream-block-format.test.ts` | skill 识别/格式测试 |
|
|
244
|
+
| `test/relay/run-stream-relay.test.ts` | skill 气泡与 read 抑制测试 |
|
|
245
|
+
| `README.md` / `README-zh.md` | skill 显示说明 |
|
|
246
|
+
| `CHANGELOG.md` | `[Unreleased]` 变更 |
|
|
247
|
+
|
|
248
|
+
## 8. 已确认
|
|
249
|
+
|
|
250
|
+
1. QQ 显示 skill 执行,不显示普通 read 工具;
|
|
251
|
+
2. 格式为 `## 🧩 Skill` + skill 名称;
|
|
252
|
+
3. 标题固定英文,不跟随语言配置;
|
|
253
|
+
4. 不显示 `SKILL.md` 完整内容;
|
|
254
|
+
5. 不支持 QQ `/skill:` 命令;
|
|
255
|
+
6. 不显示 skill 来源;
|
|
256
|
+
7. 读取失败时仍显示 skill 气泡,不显示错误;
|
|
257
|
+
8. 同一个 run 多次读取 `SKILL.md` 不去重。
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import type { QQBot } from "@tencent-connect/qqbot-nodejs";
|
|
|
2
2
|
import { AppendStream, type AppendStreamCheckpoint } from "./stream-session";
|
|
3
3
|
import type { ReplyBudget } from "../quota/reply-quota";
|
|
4
4
|
import { log } from "../infra/file-logger";
|
|
5
|
-
import { formatToolLine, formatToolResult, thinkingHeader } from "./stream-block-format";
|
|
5
|
+
import { formatSkillBlock, formatToolLine, formatToolResult, thinkingHeader } from "./stream-block-format";
|
|
6
6
|
import { t } from "../infra/i18n";
|
|
7
7
|
|
|
8
8
|
type BlockKind = "none" | "thinking" | "tool" | "text";
|
|
@@ -80,6 +80,14 @@ export class BubbleWriter {
|
|
|
80
80
|
this.push(`${prefix}${formatToolLine(name, args)}\n\n`, prefix.length > 0 || newBubble, false, newBubble);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
pushSkill(name: string): void {
|
|
84
|
+
if (this.streamDead || this.disposed) return;
|
|
85
|
+
this.toolOpen = false;
|
|
86
|
+
const newBubble = true;
|
|
87
|
+
const prefix = this.beginBlock("tool", newBubble);
|
|
88
|
+
this.push(`${prefix}${formatSkillBlock(name)}`, prefix.length > 0 || newBubble, false, newBubble);
|
|
89
|
+
}
|
|
90
|
+
|
|
83
91
|
pushToolResult(result: unknown, isError: boolean): void {
|
|
84
92
|
if (this.streamDead || this.disposed) return;
|
|
85
93
|
const prefix = this.beginBlock("tool");
|
|
@@ -2,6 +2,7 @@ import type { QQBot } from "@tencent-connect/qqbot-nodejs";
|
|
|
2
2
|
import { BubbleWriter } from "./bubble-writer";
|
|
3
3
|
import type { ReplyBudget } from "../quota/reply-quota";
|
|
4
4
|
import { log } from "../infra/file-logger";
|
|
5
|
+
import { detectSkillRead } from "./stream-block-format";
|
|
5
6
|
|
|
6
7
|
export interface RunFeedbackDeps {
|
|
7
8
|
bot: () => QQBot | undefined;
|
|
@@ -15,6 +16,7 @@ interface ToolCall {
|
|
|
15
16
|
name: string;
|
|
16
17
|
args?: unknown;
|
|
17
18
|
result?: { isError: boolean; result?: unknown };
|
|
19
|
+
skillName?: string;
|
|
18
20
|
started: boolean;
|
|
19
21
|
finished: boolean;
|
|
20
22
|
}
|
|
@@ -157,7 +159,15 @@ export class RunFeedback {
|
|
|
157
159
|
if (!run || run.writer.dead) return;
|
|
158
160
|
const id = toolCallId ?? toolName;
|
|
159
161
|
if (run.tools.some((tool) => tool.id === id)) return;
|
|
160
|
-
|
|
162
|
+
const skill = detectSkillRead(toolName, args);
|
|
163
|
+
run.tools.push({
|
|
164
|
+
id,
|
|
165
|
+
name: toolName,
|
|
166
|
+
args,
|
|
167
|
+
...(skill ? { skillName: skill.name } : {}),
|
|
168
|
+
started: false,
|
|
169
|
+
finished: false,
|
|
170
|
+
});
|
|
161
171
|
this.startNextTool(run);
|
|
162
172
|
}
|
|
163
173
|
|
|
@@ -299,14 +309,20 @@ export class RunFeedback {
|
|
|
299
309
|
if (!tool) return;
|
|
300
310
|
tool.started = true;
|
|
301
311
|
run.activeTool = tool.id;
|
|
302
|
-
|
|
312
|
+
if (tool.skillName) {
|
|
313
|
+
run.writer.pushSkill(tool.skillName);
|
|
314
|
+
} else {
|
|
315
|
+
run.writer.pushTool(tool.name, tool.args);
|
|
316
|
+
}
|
|
303
317
|
if (tool.result) this.finishTool(run, tool);
|
|
304
318
|
}
|
|
305
319
|
|
|
306
320
|
private finishTool(run: RunState, tool: ToolCall): void {
|
|
307
321
|
if (!tool.result || tool.finished) return;
|
|
308
322
|
tool.finished = true;
|
|
309
|
-
|
|
323
|
+
if (!tool.skillName) {
|
|
324
|
+
run.writer.pushToolResult(tool.result.result, tool.result.isError);
|
|
325
|
+
}
|
|
310
326
|
run.writer.schedule(() => {
|
|
311
327
|
if (this.run !== run) return;
|
|
312
328
|
if (run.activeTool !== tool.id) return;
|
|
@@ -74,6 +74,30 @@ function primaryArg(args: unknown): string {
|
|
|
74
74
|
return normalized.length > ARG_MAX_CHARS ? `${normalized.slice(0, ARG_MAX_CHARS)}…` : normalized;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
export interface SkillRead {
|
|
78
|
+
name: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Detect a read of a SKILL.md file. pi renders this as "[skill]" in the TUI;
|
|
83
|
+
* QQ should show a dedicated skill block instead of a generic read tool.
|
|
84
|
+
*/
|
|
85
|
+
export function detectSkillRead(toolName: string, args: unknown): SkillRead | undefined {
|
|
86
|
+
if (toolName !== "read" || !args || typeof args !== "object") return undefined;
|
|
87
|
+
const record = args as Record<string, unknown>;
|
|
88
|
+
const rawPath =
|
|
89
|
+
typeof record.path === "string" ? record.path : typeof record.file_path === "string" ? record.file_path : undefined;
|
|
90
|
+
if (!rawPath) return undefined;
|
|
91
|
+
const parts = rawPath.split(/[\\/]+/).filter((part) => part.length > 0 && part !== ".");
|
|
92
|
+
if (parts.length < 2 || parts[parts.length - 1] !== "SKILL.md") return undefined;
|
|
93
|
+
const name = parts[parts.length - 2];
|
|
94
|
+
return name ? { name } : undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function formatSkillBlock(name: string): string {
|
|
98
|
+
return `## 🧩 Skill\n\n${inlineCode(name)}\n`;
|
|
99
|
+
}
|
|
100
|
+
|
|
77
101
|
export function formatToolLine(name: string, args: unknown): string {
|
|
78
102
|
const primary = primaryArg(args);
|
|
79
103
|
const label = `${TOOL_ICONS[name.toLowerCase()] ?? "🔧"} ${name}`;
|