chatccc 0.2.102 → 0.2.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatccc",
3
- "version": "0.2.102",
3
+ "version": "0.2.103",
4
4
  "description": "Feishu bot bridge for Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -9,6 +9,9 @@ import {
9
9
  unstable_v2_resumeSession,
10
10
  getSessionInfo as sdkGetSessionInfo,
11
11
  } from "@anthropic-ai/claude-agent-sdk";
12
+ import { readdirSync, existsSync } from "node:fs";
13
+ import { join } from "node:path";
14
+ import { homedir } from "node:os";
12
15
 
13
16
  import type {
14
17
  ToolAdapter,
@@ -125,6 +128,22 @@ function resolveSettingSources(
125
128
  return ["user", "project", "local"];
126
129
  }
127
130
 
131
+ // ---------------------------------------------------------------------------
132
+ // collectSkillNames — 扫描用户级 skill 目录,返回所有 skill 名
133
+ // ---------------------------------------------------------------------------
134
+
135
+ function collectSkillNames(): string[] {
136
+ const userSkillsDir = join(homedir(), ".claude", "skills");
137
+ if (!existsSync(userSkillsDir)) return [];
138
+ try {
139
+ return readdirSync(userSkillsDir, { withFileTypes: true })
140
+ .filter((d) => d.isDirectory())
141
+ .map((d) => d.name);
142
+ } catch {
143
+ return [];
144
+ }
145
+ }
146
+
128
147
  // ---------------------------------------------------------------------------
129
148
  // buildSessionOptions — 还原 claudeSdkSessionOptions 的精确行为
130
149
  // ---------------------------------------------------------------------------
@@ -144,6 +163,7 @@ function buildSessionOptions(
144
163
  allowDangerouslySkipPermissions: true,
145
164
  autoCompactEnabled: true,
146
165
  settingSources: resolveSettingSources(apiKey, baseUrl),
166
+ skills: collectSkillNames(),
147
167
  };
148
168
  if (!isEmpty(model)) o.model = model;
149
169
  if (!isEmpty(effort)) o.effort = effort;