@phren/cli 0.1.29 → 0.1.30

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -159,8 +159,28 @@ async function main() {
159
159
  // Track MCP tool calls for telemetry (opt-in only, best-effort)
160
160
  const { trackToolCall } = await import("./telemetry.js");
161
161
  const origRegisterTool = server.registerTool.bind(server);
162
+ // Tools Claude reaches for during normal work. Marked with anthropic/alwaysLoad
163
+ // so Claude Code keeps their schemas resident instead of deferring them behind
164
+ // ToolSearch — otherwise the first call in a fresh session fails with
165
+ // InputValidationError until the schema is fetched.
166
+ const ALWAYS_LOAD_TOOLS = new Set([
167
+ "add_finding",
168
+ "add_task",
169
+ "complete_task",
170
+ "search_knowledge",
171
+ "session_start",
172
+ "session_end",
173
+ "get_findings",
174
+ "get_tasks",
175
+ ]);
162
176
  server.registerTool = function (name, config, handler) {
163
177
  const registeredName = name;
178
+ let finalConfig = config;
179
+ if (ALWAYS_LOAD_TOOLS.has(registeredName)) {
180
+ const cfgObj = config;
181
+ const existingMeta = cfgObj?._meta ?? {};
182
+ finalConfig = { ...cfgObj, _meta: { ...existingMeta, "anthropic/alwaysLoad": true } };
183
+ }
164
184
  const wrapped = async (...args) => {
165
185
  if (!indexReady || !db) {
166
186
  return {
@@ -181,7 +201,7 @@ async function main() {
181
201
  }
182
202
  return handler(...args);
183
203
  };
184
- return origRegisterTool(registeredName, config, wrapped);
204
+ return origRegisterTool(registeredName, finalConfig, wrapped);
185
205
  };
186
206
  // Register all tool handlers from domain modules
187
207
  const ctx = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phren/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Knowledge layer for AI agents — CLI, MCP server, and data layer",
5
5
  "type": "module",
6
6
  "bin": {