Skip to content
This repository was archived by the owner on Jun 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ components:
type: string
model:
type: string
userEmail:
type: string
format: email
maxTokens:
type: integer
exclusiveMinimum: 0
Expand All @@ -58,9 +55,6 @@ components:
type: string
model:
type: string
userEmail:
type: string
format: email
schema:
type: object
properties:
Expand Down Expand Up @@ -110,9 +104,6 @@ components:
type: string
model:
type: string
userEmail:
type: string
format: email
required:
- prompt
StreamObjectRequest:
Expand All @@ -126,9 +117,6 @@ components:
type: string
model:
type: string
userEmail:
type: string
format: email
schema:
type: object
properties:
Expand Down Expand Up @@ -459,9 +447,6 @@ paths:
type: string
model:
type: string
userEmail:
type: string
format: email
maxTokens:
type: integer
exclusiveMinimum: 0
Expand Down Expand Up @@ -577,9 +562,6 @@ paths:
type: string
model:
type: string
userEmail:
type: string
format: email
schema:
type: object
properties:
Expand Down Expand Up @@ -722,9 +704,6 @@ paths:
type: string
model:
type: string
userEmail:
type: string
format: email
required:
- prompt
responses:
Expand Down Expand Up @@ -795,9 +774,6 @@ paths:
type: string
model:
type: string
userEmail:
type: string
format: email
schema:
type: object
properties:
Expand Down
23 changes: 2 additions & 21 deletions packages/gateway/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ import {
* OAuth tokens (Claude Pro/Max) operate under Anthropic's Consumer Terms which
* prohibit automated access. Use ANTHROPIC_API_KEY for all automation.
* See: https://www.anthropic.com/legal/consumer-terms
*
* Also passes through tool proxy variables for Claude skills that need to
* invoke Inbox Zero API tools.
*/
export function buildClaudeEnv(options?: {
userEmail?: string;
}): NodeJS.ProcessEnv {
export function buildClaudeEnv(): NodeJS.ProcessEnv {
const env = { ...process.env };

// API key takes precedence - OAuth is undocumented fallback for personal testing only.
Expand All @@ -31,18 +26,6 @@ export function buildClaudeEnv(options?: {
env.CLAUDE_CODE_OAUTH_TOKEN = undefined;
}

// Pass through tool proxy variables for Claude skills
// These enable the inbox-zero-tools skill to invoke the LLM Tool Proxy API
if (process.env.INBOX_ZERO_API_URL) {
env.INBOX_ZERO_API_URL = process.env.INBOX_ZERO_API_URL;
}
if (process.env.LLM_TOOL_PROXY_TOKEN) {
env.LLM_TOOL_PROXY_TOKEN = process.env.LLM_TOOL_PROXY_TOKEN;
}
if (options?.userEmail) {
env.INBOX_ZERO_USER_EMAIL = options.userEmail;
}

return env;
}

Expand All @@ -57,8 +40,6 @@ export interface ClaudeCliOptions {
timeoutMs?: number;
/** Model alias (e.g., 'sonnet', 'haiku') or full name */
model?: string;
/** User email for tool proxy access (enables Claude skills to call Inbox Zero tools) */
userEmail?: string;
/** JSON schema for constrained decoding (CLI enforces valid JSON output) */
jsonSchema?: Record<string, unknown>;
}
Expand Down Expand Up @@ -91,7 +72,7 @@ export async function executeClaudeCli(

const claude = spawn("claude", args, {
stdio: ["pipe", "pipe", "pipe"],
env: buildClaudeEnv({ userEmail: options.userEmail }),
env: buildClaudeEnv(),
});

// Set up execution timeout
Expand Down
7 changes: 2 additions & 5 deletions packages/gateway/src/routes/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ router.post(
return;
}

const { prompt, system, sessionId, model, userEmail } = parseResult.data;
const { prompt, system, sessionId, model } = parseResult.data;

logger.info("generate-text", {
model: model || "default",
Expand All @@ -50,7 +50,6 @@ router.post(
system,
sessionId,
model,
userEmail,
});

res.json({
Expand Down Expand Up @@ -90,8 +89,7 @@ router.post(
return;
}

const { prompt, system, schema, sessionId, model, userEmail } =
parseResult.data;
const { prompt, system, schema, sessionId, model } = parseResult.data;

logger.info("generate-object", {
model: model || "default",
Expand All @@ -105,7 +103,6 @@ router.post(
system,
sessionId,
model,
userEmail,
jsonSchema: schema,
});

Expand Down
5 changes: 2 additions & 3 deletions packages/gateway/src/routes/stream-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ router.post(
return;
}

const { prompt, system, sessionId, model, userEmail, schema } =
parseResult.data;
const { prompt, system, sessionId, model, schema } = parseResult.data;

// Set up SSE headers
res.setHeader("Content-Type", "text/event-stream");
Expand Down Expand Up @@ -113,7 +112,7 @@ router.post(

const claude = spawn("claude", args, {
stdio: ["pipe", "pipe", "pipe"],
env: buildClaudeEnv({ userEmail }),
env: buildClaudeEnv(),
});

const currentSessionId = sessionId || uuidv4();
Expand Down
4 changes: 2 additions & 2 deletions packages/gateway/src/routes/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ router.post(
return;
}

const { prompt, system, sessionId, model, userEmail } = parseResult.data;
const { prompt, system, sessionId, model } = parseResult.data;

// Set up SSE headers
res.setHeader("Content-Type", "text/event-stream");
Expand All @@ -103,7 +103,7 @@ router.post(

const claude = spawn("claude", args, {
stdio: ["pipe", "pipe", "pipe"],
env: buildClaudeEnv({ userEmail }),
env: buildClaudeEnv(),
});

const currentSessionId = sessionId || uuidv4();
Expand Down
2 changes: 0 additions & 2 deletions packages/gateway/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const baseRequestSchema = z.object({
prompt: z.string(),
sessionId: z.string().optional(),
model: z.string().optional(),
/** User email for tool proxy access (enables Claude skills to call Inbox Zero tools) */
userEmail: z.string().email().optional(),
});

export const generateTextRequestSchema = baseRequestSchema.extend({
Expand Down
Loading