chore(broker): typecheck clean (77 → 0)
paid down the broker's accumulated type debt. zero behavioral changes, purely type-system tightening: - broker.ts: row extraction helper for postgres-js result vs pg shape; findMemberByPubkey defaultGroups null-coalescing. - env.ts: zod default ordered before transform (zod v4 ordering). - index.ts: typed JSON.parse for the tg/token, upload-auth, file-upload, member patch and mesh-settings handlers; export SelfEditablePolicy from member-api; added bodyVersion to WSSendMessage; added the disconnect/kick/ban/unban/list_bans message types to WSClientMessage; String(key) cast for neo4j record symbol-typed keys. - jwt.ts, paths.ts, telegram-token.ts: typed JSON.parse results. - service-manager.ts: typed package.json + MCP JSON-RPC reader. - telegram-bridge.ts: typed WS message handler; missing log import; null-tolerant BridgeRow + skip rows missing memberId/displayName; typed e in catch. - types.ts: bodyVersion on WSSendMessage, manifest on WSSkillData, five new admin message types (kick/disconnect/ban/unban/list_bans). - packages/db/server.ts: drizzle constructor positional args + scoped ts-expect-error for the namespace-bag schema generic mismatch. apps/broker/src/types.ts will eventually want a real audit pass to catch every WS verb and surface the orphans, but this clears the path for 1.30.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -115,11 +115,11 @@ function lastAssistantHasToolUse(filePath: string): boolean {
|
||||
if (!line) continue;
|
||||
if (!line.includes('"assistant"')) continue;
|
||||
try {
|
||||
const d = JSON.parse(line);
|
||||
const d = JSON.parse(line) as { type?: string; message?: { content?: unknown } };
|
||||
if (d.type !== "assistant") continue;
|
||||
const content = d.message?.content;
|
||||
if (!Array.isArray(content)) continue;
|
||||
return content.some((c: { type?: string }) => c.type === "tool_use");
|
||||
return (content as Array<{ type?: string }>).some((c) => c.type === "tool_use");
|
||||
} catch {
|
||||
/* malformed line, skip */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user