repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/structured-content.test.ts
src/filesystem/__tests__/structured-content.test.ts
import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import * as fs from 'fs/promises'; import * as path from 'path'; import * as os from 'os'; import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; import { ...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/directory-tree.test.ts
src/filesystem/__tests__/directory-tree.test.ts
import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import * as fs from 'fs/promises'; import * as path from 'path'; import * as os from 'os'; // We need to test the buildTree function, but it's defined inside the request handler // So we'll extract the core logic into a testable function import { mi...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/path-validation.test.ts
src/filesystem/__tests__/path-validation.test.ts
import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import * as path from 'path'; import * as fs from 'fs/promises'; import * as os from 'os'; import { isPathWithinAllowedDirectories } from '../path-validation.js'; /** * Check if the current environment supports symlink creation */ async function c...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
true
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/lib.test.ts
src/filesystem/__tests__/lib.test.ts
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import fs from 'fs/promises'; import path from 'path'; import os from 'os'; import { // Pure utility functions formatSize, normalizeLineEndings, createUnifiedDiff, // Security & validation functions validatePath, setAllowedDirectori...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/path-utils.test.ts
src/filesystem/__tests__/path-utils.test.ts
import { describe, it, expect, afterEach } from 'vitest'; import { normalizePath, expandHome, convertToWindowsPath } from '../path-utils.js'; describe('Path Utilities', () => { describe('convertToWindowsPath', () => { it('leaves Unix paths unchanged', () => { expect(convertToWindowsPath('/usr/local/bin')) ...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/filesystem/__tests__/roots-utils.test.ts
src/filesystem/__tests__/roots-utils.test.ts
import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { getValidRootDirectories } from '../roots-utils.js'; import { mkdtempSync, rmSync, mkdirSync, writeFileSync, realpathSync } from 'fs'; import { tmpdir } from 'os'; import { join } from 'path'; import type { Root } from '@modelcontextprotocol/...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/sequentialthinking/vitest.config.ts
src/sequentialthinking/vitest.config.ts
import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { globals: true, environment: 'node', include: ['**/__tests__/**/*.test.ts'], coverage: { provider: 'v8', include: ['**/*.ts'], exclude: ['**/__tests__/**', '**/dist/**'], }, }, });
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/sequentialthinking/lib.ts
src/sequentialthinking/lib.ts
import chalk from 'chalk'; export interface ThoughtData { thought: string; thoughtNumber: number; totalThoughts: number; isRevision?: boolean; revisesThought?: number; branchFromThought?: number; branchId?: string; needsMoreThoughts?: boolean; nextThoughtNeeded: boolean; } export class SequentialThi...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/sequentialthinking/index.ts
src/sequentialthinking/index.ts
#!/usr/bin/env node import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { SequentialThinkingServer } from './lib.js'; const server = new McpServer({ name: "sequential-thinking-server", ...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/sequentialthinking/__tests__/lib.test.ts
src/sequentialthinking/__tests__/lib.test.ts
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import { SequentialThinkingServer, ThoughtData } from '../lib.js'; // Mock chalk to avoid ESM issues vi.mock('chalk', () => { const chalkMock = { yellow: (str: string) => str, green: (str: string) => str, blue: (str: string) => str...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/index.ts
src/everything/index.ts
#!/usr/bin/env node // Parse command line arguments first const args = process.argv.slice(2); const scriptName = args[0] || "stdio"; async function run() { try { // Dynamically import only the requested module to prevent all modules from initializing switch (scriptName) { case "stdio": // Impo...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/trigger-long-running-operation.ts
src/everything/tools/trigger-long-running-operation.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; // Tool input schema const TriggerLongRunningOperationSchema = z.object({ duration: z .number() .default(10) .describe("Duration of the operat...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/trigger-elicitation-request.ts
src/everything/tools/trigger-elicitation-request.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { ElicitResultSchema } from "@modelcontextprotocol/sdk/types.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; // Tool configuration const name = "trigger-elicitation-request"; const config = { title: "Trigger Elicita...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/trigger-sampling-request.ts
src/everything/tools/trigger-sampling-request.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult, CreateMessageRequest, CreateMessageResultSchema, } from "@modelcontextprotocol/sdk/types.js"; import { z } from "zod"; // Tool input schema const TriggerSamplingRequestSchema = z.object({ prompt: z.string().describe("...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-roots-list.ts
src/everything/tools/get-roots-list.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { syncRoots } from "../server/roots.js"; // Tool configuration const name = "get-roots-list"; const config = { title: "Get Roots List Tool", description: "Lists the c...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-env.ts
src/everything/tools/get-env.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; // Tool configuration const name = "get-env"; const config = { title: "Print Environment Tool", description: "Returns all environment variables, helpful for debugging MCP se...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-sum.ts
src/everything/tools/get-sum.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; // Tool input schema const GetSumSchema = z.object({ a: z.number().describe("First number"), b: z.number().describe("Second number"), }); // Tool confi...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/echo.ts
src/everything/tools/echo.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { z } from "zod"; // Tool input schema export const EchoSchema = z.object({ message: z.string().describe("Message to echo"), }); // Tool configuration const name = "echo";...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-structured-content.ts
src/everything/tools/get-structured-content.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult, ContentBlock, } from "@modelcontextprotocol/sdk/types.js"; // Tool input schema const GetStructuredContentInputSchema = { location: z .enum(["New York", "Chicago", "Los Angeles"]) .descr...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-resource-links.ts
src/everything/tools/get-resource-links.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { textResource, textResourceUri, blobResourceUri, blobResource, } from "../resources/templates.js"; // Tool input schema const GetResourceLin...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-resource-reference.ts
src/everything/tools/get-resource-reference.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { textResource, textResourceUri, blobResourceUri, blobResource, RESOURCE_TYPE_BLOB, RESOURCE_TYPE_TEXT, RESOURCE_TYPES, } from "../resou...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-annotated-message.ts
src/everything/tools/get-annotated-message.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { z } from "zod"; import { MCP_TINY_IMAGE } from "./get-tiny-image.js"; // Tool input schema const GetAnnotatedMessageSchema = z.object({ messageType: z .enum(["error",...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/toggle-simulated-logging.ts
src/everything/tools/toggle-simulated-logging.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { beginSimulatedLogging, stopSimulatedLogging, } from "../server/logging.js"; // Tool configuration const name = "toggle-simulated-logging"; const config = { title: "To...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/toggle-subscriber-updates.ts
src/everything/tools/toggle-subscriber-updates.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { beginSimulatedResourceUpdates, stopSimulatedResourceUpdates, } from "../resources/subscriptions.js"; // Tool configuration const name = "toggle-subscriber-updates"; con...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/index.ts
src/everything/tools/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerGetAnnotatedMessageTool } from "./get-annotated-message.js"; import { registerEchoTool } from "./echo.js"; import { registerGetEnvTool } from "./get-env.js"; import { registerGetResourceLinksTool } from "./get-resource-links.js"; impo...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/gzip-file-as-resource.ts
src/everything/tools/gzip-file-as-resource.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult, Resource } from "@modelcontextprotocol/sdk/types.js"; import { gzipSync } from "node:zlib"; import { getSessionResourceURI, registerSessionResource, } from "../resources/session.js"; // Maximum in...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/tools/get-tiny-image.ts
src/everything/tools/get-tiny-image.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; // A tiny encoded MCP logo image export const MCP_TINY_IMAGE = "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKsGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU+kSgOfe9JDQEiIgJfQmSCeAlBBaAAXpYCM...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/prompts/args.ts
src/everything/prompts/args.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; /** * Register a prompt with arguments * - Two arguments, one required and one optional * - Combines argument values in the returned prompt * * @param server */ export const registerArgumentsPrompt = (server: McpServer)...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/prompts/index.ts
src/everything/prompts/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerSimplePrompt } from "./simple.js"; import { registerArgumentsPrompt } from "./args.js"; import { registerPromptWithCompletions } from "./completions.js"; import { registerEmbeddedResourcePrompt } from "./resource.js"; /** * Register...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/prompts/resource.ts
src/everything/prompts/resource.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { resourceTypeCompleter, resourceIdForPromptCompleter, } from "../resources/templates.js"; import { textResource, textResourceUri, blobResourceUri, blobResource, RESOURCE_TYPE_BLOB, RESOURCE_TYPE_TEXT, RESOURCE_TYPES, } from "...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/prompts/simple.ts
src/everything/prompts/simple.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; /** * Register a simple prompt with no arguments * - Returns the fixed text of the prompt with no modifications * * @param server */ export const registerSimplePrompt = (server: McpServer) => { // Register the prompt server.registerPrompt( ...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/prompts/completions.ts
src/everything/prompts/completions.ts
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { completable } from "@modelcontextprotocol/sdk/server/completable.js"; /** * Register a prompt with completable arguments * - Two required arguments, both with completion handlers * - First argument value will be i...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/server/logging.ts
src/everything/server/logging.ts
import { LoggingLevel } from "@modelcontextprotocol/sdk/types.js"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; // Map session ID to the interval for sending logging messages to the client const logsUpdateIntervals: Map<string | undefined, NodeJS.Timeout | undefined> = new Map<string | undefi...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/server/roots.ts
src/everything/server/roots.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { Root, RootsListChangedNotificationSchema, } from "@modelcontextprotocol/sdk/types.js"; // Track roots by session id export const roots: Map<string | undefined, Root[]> = new Map< string | undefined, Root[] >(); /** * Get the latest...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/server/index.ts
src/everything/server/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { setSubscriptionHandlers, stopSimulatedResourceUpdates, } from "../resources/subscriptions.js"; import { registerConditionalTools, registerTools } from "../tools/index.js"; import { registerResources, readInstructions } from "../resources/...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/transports/stdio.ts
src/everything/transports/stdio.ts
#!/usr/bin/env node import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { createServer } from "../server/index.js"; console.error("Starting default (STDIO) server..."); /** * The main method * - Initializes the StdioServerTransport, sets up the server, * - Handles cleanup on p...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/transports/streamableHttp.ts
src/everything/transports/streamableHttp.ts
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; import { InMemoryEventStore } from "@modelcontextprotocol/sdk/examples/shared/inMemoryEventStore.js"; import express, { Request, Response } from "express"; import { createServer } from "../server/index.js"; import { rand...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/transports/sse.ts
src/everything/transports/sse.ts
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"; import express from "express"; import { createServer } from "../server/index.js"; import cors from "cors"; console.error("Starting SSE server..."); // Express app with permissive CORS for testing with Inspector direct connect mode const app...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/resources/templates.ts
src/everything/resources/templates.ts
import { z } from "zod"; import { CompleteResourceTemplateCallback, McpServer, ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js"; import { completable } from "@modelcontextprotocol/sdk/server/completable.js"; // Resource types export const RESOURCE_TYPE_TEXT = "Text" as const; export const RESOU...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/resources/files.ts
src/everything/resources/files.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { dirname, join } from "path"; import { fileURLToPath } from "url"; import { readdirSync, readFileSync, statSync } from "fs"; /** * Register static file resources * - Each file in src/everything/docs is exposed as an individual static resour...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/resources/session.ts
src/everything/resources/session.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { Resource, ResourceLink } from "@modelcontextprotocol/sdk/types.js"; /** * Generates a session-scoped resource URI string based on the provided resource name. * * @param {string} name - The name of the resource to create a URI for. * @ret...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/resources/subscriptions.ts
src/everything/resources/subscriptions.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { SubscribeRequestSchema, UnsubscribeRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; // Track subscriber session id lists by URI const subscriptions: Map<string, Set<string | undefined>> = new Map< string, Set<string | unde...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
modelcontextprotocol/servers
https://github.com/modelcontextprotocol/servers/blob/dcb47d2d94a3a33340053d2df550ae68d2795a3f/src/everything/resources/index.ts
src/everything/resources/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerResourceTemplates } from "./templates.js"; import { registerFileResources } from "./files.js"; import { fileURLToPath } from "url"; import { dirname, join } from "path"; import { readFileSync } from "fs"; /** * Register the resource...
typescript
MIT
dcb47d2d94a3a33340053d2df550ae68d2795a3f
2026-01-04T15:25:50.287739Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/next-env.d.ts
apps/portal/next-env.d.ts
/// <reference types="next" /> /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information.
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/middleware.ts
apps/portal/src/middleware.ts
import type { NextRequest } from 'next/server'; import { NextResponse } from 'next/server'; export function middleware(request: NextRequest) { const country = request.geo?.country ?? null; const response = NextResponse.next(); if (country != null) { response.cookies.set('country', country); } return resp...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/mappers/offers-mappers.ts
apps/portal/src/mappers/offers-mappers.ts
import type { City, Company, Country, OffersAnalysis, OffersAnalysisUnit, OffersBackground, OffersCurrency, OffersEducation, OffersExperience, OffersFullTime, OffersIntern, OffersOffer, OffersProfile, OffersReply, OffersSpecificYoe, State, User, } from '@prisma/client'; import { JobTyp...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/profile.tsx
apps/portal/src/pages/profile.tsx
import { useSession } from 'next-auth/react'; export default function ProfilePage() { const { data: session, status } = useSession(); const isSessionLoading = status === 'loading'; if (isSessionLoading) { return null; } return ( <main className="flex-1 space-y-6 overflow-y-auto p-6"> <h1 clas...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/test__.tsx
apps/portal/src/pages/test__.tsx
import { useState } from 'react'; import type { TypeaheadOption } from '~/ui'; import { Button } from '~/ui'; import { useToast } from '~/ui'; import { HorizontalDivider } from '~/ui'; import CitiesTypeahead from '~/components/shared/CitiesTypeahead'; import CompaniesTypeahead from '~/components/shared/CompaniesTypeah...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/_app.tsx
apps/portal/src/pages/_app.tsx
import type { AppType } from 'next/app'; import type { Session } from 'next-auth'; import { SessionProvider } from 'next-auth/react'; import React from 'react'; import superjson from 'superjson'; import { ToastsProvider } from '~/ui'; import { httpBatchLink } from '@trpc/client/links/httpBatchLink'; import { loggerLink...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/404.tsx
apps/portal/src/pages/404.tsx
import Link from 'next/link'; import { ChevronRightIcon } from '@heroicons/react/20/solid'; import { BriefcaseIcon, CurrencyDollarIcon, DocumentTextIcon, } from '@heroicons/react/24/outline'; const links = [ { description: ( <> Explore offer data points, benchmark and analyze your offers ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/index.tsx
apps/portal/src/pages/index.tsx
import Head from 'next/head'; import { Button } from '~/ui'; import Container from '~/components/shared/Container'; const features = [ { description: "Preparing resumes for your next role? Browse for our community's best resumes. Upload yours and source for community reviews. Start your next job/internshi...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/settings.tsx
apps/portal/src/pages/settings.tsx
import Head from 'next/head'; import type { Session } from 'next-auth'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; import { Button, HorizontalDivider, TextInput, useToast } from '~/ui'; import Container from '~/components/shared/Container'; import { trpc } from '~/utils/trpc'; fu...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/_document.tsx
apps/portal/src/pages/_document.tsx
import { Head, Html, Main, NextScript } from 'next/document'; export default function Document() { return ( <Html lang="en" className="bg-slate-50"> <Head /> <body> <Main /> <NextScript /> </body> </Html> ); }
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/login.tsx
apps/portal/src/pages/login.tsx
import { useRouter } from 'next/router'; import type { GetServerSideProps, InferGetServerSidePropsType, } from 'next/types'; import { getProviders, signIn } from 'next-auth/react'; import { Button } from '~/ui'; import GitHubIcon from '~/components/shared/icons/GitHubIcon'; export const getServerSideProps: GetSer...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/about.tsx
apps/portal/src/pages/questions/about.tsx
import Head from 'next/head'; import Container from '~/components/shared/Container'; const people = [ { bio: 'Dysfunctional human who cannot survive without 10 hours of sleep.', imageUrl: '/team/weilin.jpg', name: 'Ren Weilin', role: 'Front End Engineer', }, { bio: 'Software engineer focused...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/history.tsx
apps/portal/src/pages/questions/history.tsx
import Head from 'next/head'; import { APP_TITLE } from '~/utils/questions/constants'; export default function HistoryPage() { return ( <> <Head> <title>History - {APP_TITLE}</title> </Head> <div className="v-full flex w-full items-center justify-center"> <h1 className="text-ce...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/index.tsx
apps/portal/src/pages/questions/index.tsx
import Head from 'next/head'; import { useRouter } from 'next/router'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import type { LandingQueryData } from '~/components/questions/LandingComponent'; import LandingComponent from '~/components/questions/LandingComponent'; import { APP_TITLE }...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/my-questions.tsx
apps/portal/src/pages/questions/my-questions.tsx
import Head from 'next/head'; import { APP_TITLE } from '~/utils/questions/constants'; export default function MyQuestionsPage() { return ( <> <Head> <title>My Questions - {APP_TITLE}</title> </Head> <div className="v-full flex w-full items-center justify-center"> <h1 className...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/lists.tsx
apps/portal/src/pages/questions/lists.tsx
import Head from 'next/head'; import { useState } from 'react'; import { Menu } from '@headlessui/react'; import { EllipsisVerticalIcon, NoSymbolIcon, PlusIcon, TrashIcon, } from '@heroicons/react/24/outline'; import { Button, Select } from '~/ui'; import QuestionListCard from '~/components/questions/card/ques...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/browse.tsx
apps/portal/src/pages/questions/browse.tsx
import { subMonths, subYears } from 'date-fns'; import Head from 'next/head'; import Router, { useRouter } from 'next/router'; import { useEffect, useMemo, useState } from 'react'; import { Bars3BottomLeftIcon } from '@heroicons/react/20/solid'; import { NoSymbolIcon } from '@heroicons/react/24/outline'; import type { ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
import Head from 'next/head'; import { useRouter } from 'next/router'; import { useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; import { Button, Collapsible, HorizontalDivider, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import FullQues...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx
apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx
import Head from 'next/head'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { Button, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import FullAnswerCard from '~/components/questions/card/...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/dashboard.tsx
apps/portal/src/pages/offers/dashboard.tsx
import Head from 'next/head'; import { useRouter } from 'next/router'; import { signIn, useSession } from 'next-auth/react'; import { useState } from 'react'; import { Button, Spinner } from '~/ui'; import DashboardProfileCard from '~/components/offers/dashboard/DashboardProfileCard'; import Container from '~/componen...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/admin.tsx
apps/portal/src/pages/offers/admin.tsx
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next'; import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { MapPinIcon } from '@heroicons/react/24/outline'; import { Banner, Spinner } from '~/ui'; import { ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/about.tsx
apps/portal/src/pages/offers/about.tsx
import Head from 'next/head'; import Container from '~/components/shared/Container'; const people = [ { bio: 'I like to play games, so I treat life like a game. I collect achievements by crossing items off my bucket list.', imageUrl: '/team/bryann.jpg', name: 'Bryann Yeap', role: 'Back End Engineer'...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/index.tsx
apps/portal/src/pages/offers/index.tsx
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next'; import Head from 'next/head'; import Link from 'next/link'; import { useState } from 'react'; import { MapPinIcon } from '@heroicons/react/24/outline'; import { Banner } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/Goo...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/features.tsx
apps/portal/src/pages/offers/features.tsx
import Head from 'next/head'; import type { SVGProps } from 'react'; import { BookmarkSquareIcon, ChartBarSquareIcon, InformationCircleIcon, ShareIcon, TableCellsIcon, UsersIcon, } from '@heroicons/react/24/outline'; import { HOME_URL, OFFERS_SUBMIT_URL } from '~/components/offers/constants'; import offers...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/submit/index.tsx
apps/portal/src/pages/offers/submit/index.tsx
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next'; import Head from 'next/head'; import OffersSubmissionForm from '~/components/offers/offersSubmission/OffersSubmissionForm'; export const getServerSideProps: GetServerSideProps = async ({ req }) => { return { props: { country: req...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx
apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx
import Error from 'next/error'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { useEffect, useRef, useState } from 'react'; import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/20/solid'; import { EyeIcon } from '@heroicons/react/2...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/profile/[offerProfileId].tsx
apps/portal/src/pages/offers/profile/[offerProfileId].tsx
import Error from 'next/error'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import { ProfileDetailTab } from '~/components/offers/constant...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx
apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next'; import Error from 'next/error'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { JobType } from '@prisma/client'; import OffersSubmissionForm, { DEFAULT_CURRENCY, } from '~/co...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/resumes/about.tsx
apps/portal/src/pages/resumes/about.tsx
import Head from 'next/head'; import Container from '~/components/shared/Container'; const people = [ { bio: 'Keane loves to try out new technologies and build awesome stuff with awesome people. He spends most of his free time travelling to eat good food (that he can afford) and going to the gym.', imageUrl...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/resumes/index.tsx
apps/portal/src/pages/resumes/index.tsx
import Head from 'next/head'; import Router, { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { Fragment, useEffect, useMemo, useState } from 'react'; import { Dialog, Disclosure, Transition } from '@headlessui/react'; import { FunnelIcon, MinusIcon, PlusIcon } from '@heroicons/rea...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/resumes/features.tsx
apps/portal/src/pages/resumes/features.tsx
import Head from 'next/head'; import { CallToAction } from '~/components/resumes/landing/CallToAction'; import { Hero } from '~/components/resumes/landing/Hero'; import { PrimaryFeatures } from '~/components/resumes/landing/PrimaryFeatures'; export default function Home() { return ( <> <Head> <tit...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/resumes/[resumeId].tsx
apps/portal/src/pages/resumes/[resumeId].tsx
import axios from 'axios'; import clsx from 'clsx'; import formatDistanceToNow from 'date-fns/formatDistanceToNow'; import Error from 'next/error'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; import { AcademicCa...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/resumes/submit.tsx
apps/portal/src/pages/resumes/submit.tsx
import axios from 'axios'; import clsx from 'clsx'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { useCallback, useEffect, useMemo, useState } from 'react'; import type { FileRejection } from 'react-dropzone'; import { useDropzone } from 're...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/api/file-storage.ts
apps/portal/src/pages/api/file-storage.ts
import formidable from 'formidable'; import * as fs from 'fs'; import type { NextApiRequest, NextApiResponse } from 'next'; import { env } from '~/env/server.mjs'; import { supabase } from '~/utils/supabase'; export const config = { api: { bodyParser: false, }, }; const BASE_FILE_URL = `${env.SUPABASE_URL}/s...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/api/restricted.ts
apps/portal/src/pages/api/restricted.ts
// Example of a restricted endpoint that only authenticated users can access from https://next-auth.js.org/getting-started/example import type { NextApiRequest, NextApiResponse } from 'next'; import { getServerAuthSession } from '~/server/common/get-server-auth-session'; const restricted = async (req: NextApiRequest...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/api/auth/[...nextauth].ts
apps/portal/src/pages/api/auth/[...nextauth].ts
import NextAuth, { type NextAuthOptions } from 'next-auth'; import GitHubProvider from 'next-auth/providers/github'; import { PrismaAdapter } from '@next-auth/prisma-adapter'; import { env } from '~/env/server.mjs'; import { prisma } from '~/server/db/client'; export const authOptions: NextAuthOptions = { // Config...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/api/trpc/[trpc].ts
apps/portal/src/pages/api/trpc/[trpc].ts
import { createNextApiHandler } from '@trpc/server/adapters/next'; import { env } from '~/env/server.mjs'; import { appRouter } from '~/server/router'; import { createContext } from '~/server/router/context'; // Export API handler export default createNextApiHandler({ createContext, onError: env.NODE_ENV === ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/todos/index.tsx
apps/portal/src/pages/todos/index.tsx
import Head from 'next/head'; import Link from 'next/link'; import { useSession } from 'next-auth/react'; import { useRef, useState } from 'react'; import { trpc } from '~/utils/trpc'; export default function TodoList() { const { data } = useSession(); // Fetches todos when the component mounts. const todosQue...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/pages/todos/new.tsx
apps/portal/src/pages/todos/new.tsx
import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { useRef, useState } from 'react'; import { trpc } from '~/utils/trpc'; export default function TodosCreate() { const todoCreateMutation = trpc.useMutation('todos.user.create'); const [todoText, setTodoText...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/LandingComponent.tsx
apps/portal/src/components/questions/LandingComponent.tsx
import { useEffect, useState } from 'react'; import { ArrowSmallRightIcon } from '@heroicons/react/24/outline'; import type { QuestionsQuestionType } from '@prisma/client'; import type { TypeaheadOption } from '~/ui'; import { Button, Select } from '~/ui'; import Container from '~/components/shared/Container'; import...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/ContributeQuestionCard.tsx
apps/portal/src/components/questions/ContributeQuestionCard.tsx
import { useState } from 'react'; import { useProtectedCallback } from '~/utils/questions/useProtectedCallback'; import ContributeQuestionDialog from './ContributeQuestionDialog'; import type { ContributeQuestionFormProps } from './forms/ContributeQuestionForm'; export type ContributeQuestionCardProps = Pick< Cont...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/QuestionTypeBadge.tsx
apps/portal/src/components/questions/QuestionTypeBadge.tsx
import type { ComponentProps } from 'react'; import { BookOpenIcon, ChatBubbleLeftRightIcon, CodeBracketIcon, WrenchIcon, } from '@heroicons/react/20/solid'; import type { QuestionsQuestionType } from '@prisma/client'; import type { BadgeVariant } from '~/ui'; import { Badge } from '~/ui'; import { QUESTION_TY...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/CreateListDialog.tsx
apps/portal/src/components/questions/CreateListDialog.tsx
import { useForm } from 'react-hook-form'; import { Button, Dialog, TextInput } from '~/ui'; import { useFormRegister } from '~/utils/questions/useFormRegister'; export type CreateListFormData = { name: string; }; export type CreateListDialogProps = { onCancel: () => void; onSubmit: (data: CreateListFormData) ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/SortOptionsSelect.tsx
apps/portal/src/components/questions/SortOptionsSelect.tsx
import { Select } from '~/ui'; import { SORT_ORDERS, SORT_TYPES } from '~/utils/questions/constants'; import type { SortOrder, SortType } from '~/types/questions.d'; export type SortOption<Value> = { label: string; value: Value; }; type SortOrderProps<Order> = { onSortOrderChange?: (sortValue: Order) => void; ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/DiscardDraftDialog.tsx
apps/portal/src/components/questions/DiscardDraftDialog.tsx
import { Button, Dialog } from '~/ui'; export type DiscardDraftDialogProps = { onCancel: () => void; onDiscard: () => void; show: boolean; }; export default function DiscardDraftDialog({ show, onCancel, onDiscard, }: DiscardDraftDialogProps) { return ( <Dialog isShown={show} primaryButton...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/AddToListDropdown.tsx
apps/portal/src/components/questions/AddToListDropdown.tsx
import clsx from 'clsx'; import type { PropsWithChildren } from 'react'; import { useMemo } from 'react'; import { Fragment, useRef, useState } from 'react'; import { Menu, Transition } from '@headlessui/react'; import { CheckIcon, HeartIcon, PlusIcon } from '@heroicons/react/20/solid'; import { useAddQuestionToList...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/PaginationLoadMoreButton.tsx
apps/portal/src/components/questions/PaginationLoadMoreButton.tsx
import type { UseInfiniteQueryResult } from 'react-query'; import { Button } from '~/ui'; export type PaginationLoadMoreButtonProps = { query: UseInfiniteQueryResult; }; export default function PaginationLoadMoreButton( props: PaginationLoadMoreButtonProps, ) { const { query: { data, hasNextPage, isFetching...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/QuestionContainer.tsx
apps/portal/src/components/questions/QuestionContainer.tsx
// TODO: Remove this after Steps import clsx from 'clsx'; import React from 'react'; type Props = Readonly<{ children: React.ReactNode; className?: string; variant?: 'md' | 'sm' | 'xs'; }>; export default function QuestionContainer({ children, className, variant = 'md', }: Props) { return ( <div ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/ContributeQuestionDialog.tsx
apps/portal/src/components/questions/ContributeQuestionDialog.tsx
import { Fragment, useState } from 'react'; import { Dialog, Transition } from '@headlessui/react'; import { HorizontalDivider, useToast } from '~/ui'; import DiscardDraftDialog from './DiscardDraftDialog'; import type { ContributeQuestionFormProps } from './forms/ContributeQuestionForm'; import ContributeQuestionForm...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/VotingButtons.tsx
apps/portal/src/components/questions/VotingButtons.tsx
import clsx from 'clsx'; import React from 'react'; import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; import type { Vote } from '@prisma/client'; import { useProtectedCallback } from '~/utils/questions/useProtectedCallback'; export type BackendVote = { id: string; vote: Vote; }; expor...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/QuestionAggregateBadge.tsx
apps/portal/src/components/questions/QuestionAggregateBadge.tsx
import { useMemo } from 'react'; import { usePopperTooltip } from 'react-popper-tooltip'; import 'react-popper-tooltip/dist/styles.css'; export type QuestionAggregateBadgeProps = Readonly<{ icon: (props: React.ComponentProps<'svg'>) => JSX.Element; statistics: Record<string, number>; }>; export default function ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/QuestionsNavigation.tsx
apps/portal/src/components/questions/QuestionsNavigation.tsx
import type { ProductNavigationItems } from '~/components/global/ProductNavigation'; const navigation: ProductNavigationItems = [ { href: '/questions/browse', name: 'Browse' }, { href: '/questions/lists', name: 'My Lists' }, { href: '/questions/about', name: 'About' }, ]; const config = { logo: ( <img ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/FullScreenSpinner.tsx
apps/portal/src/components/questions/FullScreenSpinner.tsx
import { Spinner } from '~/ui'; export default function FullScreenSpinner() { return ( <div className="flex h-full w-full items-center justify-center"> <Spinner size="lg" /> </div> ); }
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/DeleteListDialog.tsx
apps/portal/src/components/questions/DeleteListDialog.tsx
import { Button, Dialog } from '~/ui'; export type DeleteListDialogProps = { onCancel: () => void; onDelete: () => void; show: boolean; }; export default function DeleteListDialog({ show, onCancel, onDelete, }: DeleteListDialogProps) { return ( <Dialog isShown={show} primaryButton={ ...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/QuestionSearchBar.tsx
apps/portal/src/components/questions/QuestionSearchBar.tsx
import { AdjustmentsHorizontalIcon, MagnifyingGlassIcon, } from '@heroicons/react/24/outline'; import { Button, Tabs, TextInput } from '~/ui'; import { SORT_ORDERS } from '~/utils/questions/constants'; import type { SortOptionsSelectProps } from './SortOptionsSelect'; import { SortOrder, SortType } from '~/types...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/filter/FilterSection.tsx
apps/portal/src/components/questions/filter/FilterSection.tsx
import { useMemo } from 'react'; import type { UseFormRegisterReturn } from 'react-hook-form'; import { useForm } from 'react-hook-form'; import { CheckboxInput, CheckboxList, Collapsible, RadioList } from '~/ui'; export type FilterChoice<V extends string = string> = { id: string; label: string; value: V; }; ex...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false
yangshun/tech-interview-handbook
https://github.com/yangshun/tech-interview-handbook/blob/9430396f989730fab83f3ccba16b4955577f107d/apps/portal/src/components/questions/card/AnswerCard.tsx
apps/portal/src/components/questions/card/AnswerCard.tsx
import clsx from 'clsx'; import { formatDistanceToNow } from 'date-fns'; import { ChatBubbleLeftRightIcon } from '@heroicons/react/24/outline'; import useAnswerVote from '~/utils/questions/vote/useAnswerVote'; import type { VotingButtonsProps } from '../VotingButtons'; import VotingButtons from '../VotingButtons'; e...
typescript
MIT
9430396f989730fab83f3ccba16b4955577f107d
2026-01-04T15:25:31.531135Z
false