gmail proxy tool with token refresh, claude pro bearer auth, pi --list-models stderr fallback, tool object input type

- add getValidGoogleAccessToken helper and use it in email-cron, email account auth resolver, and the new gmail proxy
- POST /api/integrations/google/gmail-proxy forwards arbitrary gmail rest calls server-side, with auto-refreshed oauth
- pi-manager and claude user-instance inject OFFICER_API_URL + per-session JWT so tools can call back as the user
- claude anthropic proxy uses Authorization: Bearer + preserves any anthropic-beta headers (pro oauth tokens are rejected via x-api-key, and overwriting the beta header broke context_management)
- pi --list-models: fall back to stderr when stdout is empty (pi v0.73.1 writes the table to stderr)
- mcp tool server + pi tool loader: accept type: object inputs so json bodies stay structured

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 17:07:51 +00:00
co-authored by Claude Opus 4.7
parent 8a583da19b
commit 3540d53a00
10 changed files with 129 additions and 17 deletions
+4 -1
View File
@@ -18,7 +18,7 @@ import { join, dirname } from 'node:path';
// ── Types ──
type ToolParamType = 'string' | 'number' | 'boolean' | 'enum';
type ToolParamType = 'string' | 'number' | 'boolean' | 'enum' | 'object';
type ToolParam = {
type: ToolParamType;
@@ -178,6 +178,9 @@ function buildZodSchema(inputs: Record<string, ToolParam>): z.ZodRawShape {
case 'boolean':
field = z.boolean().describe(param.description);
break;
case 'object':
field = z.record(z.string(), z.unknown()).describe(param.description);
break;
default:
field = z.string().describe(param.description);
}