@morphllm/morphsdk 0.2.105 → 0.2.106

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.
@@ -199,10 +199,10 @@ var GitHubClient = class {
199
199
  // Installations
200
200
  // ==========================================================================
201
201
  async listInstallations() {
202
- return this.request("GET", "/v1/github/installations");
202
+ return this.request("GET", "/api/v1/github/installations");
203
203
  }
204
204
  async getInstallation(installationId) {
205
- return this.request("GET", `/v1/github/installations/${installationId}`);
205
+ return this.request("GET", `/api/v1/github/installations/${installationId}`);
206
206
  }
207
207
  // ==========================================================================
208
208
  // Repositories
@@ -212,7 +212,7 @@ var GitHubClient = class {
212
212
  if (!installationId) {
213
213
  throw new NoInstallationError("installationId required. Call installations.list() first.");
214
214
  }
215
- return this.request("GET", `/v1/github/installations/${installationId}/repos`);
215
+ return this.request("GET", `/api/v1/github/installations/${installationId}/repos`);
216
216
  }
217
217
  // ==========================================================================
218
218
  // Pull Requests
@@ -225,7 +225,7 @@ var GitHubClient = class {
225
225
  ...input.state && { state: input.state },
226
226
  ...installationId && { installationId }
227
227
  });
228
- return this.request("GET", `/v1/github/pulls?${params}`);
228
+ return this.request("GET", `/api/v1/github/pulls?${params}`);
229
229
  }
230
230
  async getPullRequest(input) {
231
231
  const installationId = this.getInstallationId(input);
@@ -236,7 +236,7 @@ var GitHubClient = class {
236
236
  });
237
237
  return this.request(
238
238
  "GET",
239
- `/v1/github/pulls/${input.number}?${params}`
239
+ `/api/v1/github/pulls/${input.number}?${params}`
240
240
  );
241
241
  }
242
242
  // ==========================================================================
@@ -251,7 +251,7 @@ var GitHubClient = class {
251
251
  ...input.environment && { environment: input.environment },
252
252
  ...installationId && { installationId }
253
253
  });
254
- return this.request("GET", `/v1/github/deployments?${params}`);
254
+ return this.request("GET", `/api/v1/github/deployments?${params}`);
255
255
  }
256
256
  // ==========================================================================
257
257
  // Comments
@@ -264,11 +264,11 @@ var GitHubClient = class {
264
264
  pr: String(input.pr),
265
265
  ...installationId && { installationId }
266
266
  });
267
- return this.request("GET", `/v1/github/comments?${params}`);
267
+ return this.request("GET", `/api/v1/github/comments?${params}`);
268
268
  }
269
269
  async createComment(input) {
270
270
  const installationId = this.getInstallationId(input);
271
- return this.request("POST", "/v1/github/comments", {
271
+ return this.request("POST", "/api/v1/github/comments", {
272
272
  owner: input.owner,
273
273
  repo: input.repo,
274
274
  pr: input.pr,
@@ -278,7 +278,7 @@ var GitHubClient = class {
278
278
  }
279
279
  async updateComment(input) {
280
280
  const installationId = this.getInstallationId(input);
281
- return this.request("PATCH", `/v1/github/comments/${input.commentId}`, {
281
+ return this.request("PATCH", `/api/v1/github/comments/${input.commentId}`, {
282
282
  owner: input.owner,
283
283
  repo: input.repo,
284
284
  body: input.body,
@@ -292,14 +292,14 @@ var GitHubClient = class {
292
292
  repo: input.repo,
293
293
  ...installationId && { installationId }
294
294
  });
295
- await this.request("DELETE", `/v1/github/comments/${input.commentId}?${params}`);
295
+ await this.request("DELETE", `/api/v1/github/comments/${input.commentId}?${params}`);
296
296
  }
297
297
  // ==========================================================================
298
298
  // Check Runs
299
299
  // ==========================================================================
300
300
  async createCheckRun(input) {
301
301
  const installationId = this.getInstallationId(input);
302
- return this.request("POST", "/v1/github/check-runs", {
302
+ return this.request("POST", "/api/v1/github/check-runs", {
303
303
  owner: input.owner,
304
304
  repo: input.repo,
305
305
  sha: input.sha,
@@ -312,7 +312,7 @@ var GitHubClient = class {
312
312
  }
313
313
  async updateCheckRun(input) {
314
314
  const installationId = this.getInstallationId(input);
315
- return this.request("PATCH", `/v1/github/check-runs/${input.checkRunId}`, {
315
+ return this.request("PATCH", `/api/v1/github/check-runs/${input.checkRunId}`, {
316
316
  owner: input.owner,
317
317
  repo: input.repo,
318
318
  ...input.status && { status: input.status },
@@ -571,4 +571,4 @@ export {
571
571
  VercelToolFactory,
572
572
  MorphClient
573
573
  };
574
- //# sourceMappingURL=chunk-DX5HVNUP.js.map
574
+ //# sourceMappingURL=chunk-GOPNOZVI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../tools/github/types.ts","../tools/github/core.ts","../factories/openai.ts","../factories/anthropic.ts","../factories/vercel.ts","../client.ts"],"sourcesContent":["/**\n * GitHub SDK Types\n *\n * Type definitions for the Morph GitHub integration.\n * Users connect GitHub in the Morph dashboard, then use these\n * types to interact with their GitHub repos through the SDK.\n */\n\n// =============================================================================\n// Configuration\n// =============================================================================\n\n/**\n * Configuration for the GitHub client\n */\nexport interface GitHubClientConfig {\n /** Morph API key (defaults to MORPH_API_KEY env var) */\n apiKey?: string;\n /** Default installation ID to use (optional, can be specified per-request) */\n installationId?: string;\n /** Base URL for the Morph API (defaults to https://api.morphllm.com) */\n baseUrl?: string;\n /** Request timeout in milliseconds */\n timeout?: number;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n// =============================================================================\n// Core Types\n// =============================================================================\n\n/**\n * A GitHub App installation (connected GitHub account)\n */\nexport interface Installation {\n /** Installation ID (use this for subsequent requests) */\n id: string;\n /** GitHub account login (username or org name) */\n accountLogin: string;\n /** Account type */\n accountType: \"User\" | \"Organization\";\n /** Custom display name (set in Morph dashboard) */\n displayName?: string;\n}\n\n/**\n * A GitHub repository\n */\nexport interface Repo {\n /** GitHub's numeric repo ID */\n id: number;\n /** Repository name (e.g., \"app\") */\n name: string;\n /** Full name including owner (e.g., \"acme/app\") */\n fullName: string;\n /** Whether the repo is private */\n private: boolean;\n /** Default branch name */\n defaultBranch?: string;\n}\n\n/**\n * A pull request (basic info)\n */\nexport interface PullRequest {\n /** PR number */\n number: number;\n /** PR title */\n title: string;\n /** PR description/body */\n body: string | null;\n /** PR state */\n state: \"open\" | \"closed\";\n /** Author's GitHub username */\n author: string;\n /** HEAD commit SHA */\n headSha: string;\n /** Base branch name */\n baseBranch: string;\n /** HEAD branch name */\n headBranch: string;\n /** Creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n}\n\n/**\n * A pull request with full context (diff and files)\n */\nexport interface PullRequestWithContext extends PullRequest {\n /** Full unified diff */\n diff: string;\n /** List of changed files with patches */\n files: FileChange[];\n}\n\n/**\n * A file changed in a pull request\n */\nexport interface FileChange {\n /** File path */\n filename: string;\n /** Change status */\n status: \"added\" | \"removed\" | \"modified\" | \"renamed\";\n /** Number of lines added */\n additions: number;\n /** Number of lines deleted */\n deletions: number;\n /** Unified diff patch for this file */\n patch?: string;\n}\n\n/**\n * A deployment (e.g., Vercel preview)\n */\nexport interface Deployment {\n /** Deployment ID */\n id: number;\n /** Commit SHA this deployment is for */\n sha: string;\n /** Environment name (e.g., \"preview\", \"production\") */\n environment: string;\n /** Deployment state */\n state: \"pending\" | \"success\" | \"failure\" | \"error\" | \"inactive\" | \"in_progress\" | \"queued\";\n /** Preview/deployment URL (if available) */\n url: string | null;\n /** Creation timestamp (ISO 8601) */\n createdAt: string;\n}\n\n/**\n * A comment on a PR/issue\n */\nexport interface Comment {\n /** Comment ID */\n id: number;\n /** Comment body/content */\n body: string;\n /** Author's GitHub username */\n author: string;\n /** Creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n}\n\n/**\n * A GitHub check run (CI status)\n */\nexport interface CheckRun {\n /** Check run ID */\n id: number;\n /** Check run name */\n name: string;\n /** Current status */\n status: \"queued\" | \"in_progress\" | \"completed\";\n /** Conclusion (only set when status is \"completed\") */\n conclusion?:\n | \"success\"\n | \"failure\"\n | \"neutral\"\n | \"cancelled\"\n | \"skipped\"\n | \"timed_out\"\n | \"action_required\";\n /** Start timestamp (ISO 8601) */\n startedAt?: string;\n /** Completion timestamp (ISO 8601) */\n completedAt?: string;\n}\n\n// =============================================================================\n// Input Types\n// =============================================================================\n\n/**\n * Input for listing repositories\n */\nexport interface ListReposInput {\n /** Installation ID to list repos for */\n installationId: string;\n}\n\n/**\n * Input for listing pull requests\n */\nexport interface ListPullRequestsInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Filter by PR state (default: \"open\") */\n state?: \"open\" | \"closed\" | \"all\";\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for getting a single pull request\n */\nexport interface GetPullRequestInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** PR number */\n number: number;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for listing deployments\n */\nexport interface ListDeploymentsInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Filter by commit SHA */\n sha?: string;\n /** Filter by environment name */\n environment?: string;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for listing comments on a PR\n */\nexport interface ListCommentsInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** PR number */\n pr: number;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for creating a comment\n */\nexport interface CreateCommentInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** PR number */\n pr: number;\n /** Comment body (Markdown supported) */\n body: string;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for updating a comment\n */\nexport interface UpdateCommentInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Comment ID to update */\n commentId: number;\n /** New comment body */\n body: string;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for deleting a comment\n */\nexport interface DeleteCommentInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Comment ID to delete */\n commentId: number;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for creating a check run\n */\nexport interface CreateCheckRunInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Commit SHA to create check run for */\n sha: string;\n /** Check run name (e.g., \"Preview Test\") */\n name: string;\n /** Initial status */\n status: \"queued\" | \"in_progress\";\n /** Output title */\n title?: string;\n /** Output summary (Markdown supported) */\n summary?: string;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n/**\n * Input for updating a check run\n */\nexport interface UpdateCheckRunInput {\n /** Repository owner */\n owner: string;\n /** Repository name */\n repo: string;\n /** Check run ID to update */\n checkRunId: number;\n /** New status */\n status?: \"queued\" | \"in_progress\" | \"completed\";\n /** Conclusion (required if status is \"completed\") */\n conclusion?: CheckRun[\"conclusion\"];\n /** Output title */\n title?: string;\n /** Output summary (Markdown supported) */\n summary?: string;\n /** Output text (detailed info, Markdown supported) */\n text?: string;\n /** Installation ID (uses default if not specified) */\n installationId?: string;\n}\n\n// =============================================================================\n// Error Types\n// =============================================================================\n\n/**\n * Error thrown by GitHub operations\n */\nexport class GitHubError extends Error {\n /** HTTP status code */\n status: number;\n /** Error code from API */\n code?: string;\n\n constructor(message: string, status: number, code?: string) {\n super(message);\n this.name = \"GitHubError\";\n this.status = status;\n this.code = code;\n }\n}\n\n/**\n * Error thrown when no installation is found or specified\n */\nexport class NoInstallationError extends GitHubError {\n constructor(message = \"No GitHub installation found. Connect GitHub at morphllm.com/dashboard/integrations/github\") {\n super(message, 404, \"NO_INSTALLATION\");\n }\n}\n\n/**\n * Error thrown when resource is not found\n */\nexport class NotFoundError extends GitHubError {\n constructor(resource: string) {\n super(`${resource} not found`, 404, \"NOT_FOUND\");\n }\n}\n\n/**\n * Error thrown when user lacks permission\n */\nexport class PermissionError extends GitHubError {\n constructor(message = \"Insufficient permissions for this operation\") {\n super(message, 403, \"PERMISSION_DENIED\");\n }\n}\n","/**\n * GitHub SDK Client\n *\n * Provides access to GitHub repositories, pull requests, deployments,\n * comments, and check runs through the user's connected GitHub account.\n *\n * All operations are proxied through the Morph API - installation tokens\n * are never exposed to the client.\n */\n\nimport type {\n GitHubClientConfig,\n Installation,\n Repo,\n PullRequest,\n PullRequestWithContext,\n Deployment,\n Comment,\n CheckRun,\n ListReposInput,\n ListPullRequestsInput,\n GetPullRequestInput,\n ListDeploymentsInput,\n ListCommentsInput,\n CreateCommentInput,\n UpdateCommentInput,\n DeleteCommentInput,\n CreateCheckRunInput,\n UpdateCheckRunInput,\n} from \"./types.js\";\n\nimport { GitHubError, NoInstallationError, NotFoundError, PermissionError } from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://api.morphllm.com\";\nconst DEFAULT_TIMEOUT = 30000;\n\n/**\n * GitHub SDK Client\n *\n * @example\n * ```typescript\n * import { MorphClient } from '@morphllm/morphsdk';\n *\n * const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });\n *\n * // List installations\n * const installations = await morph.github.installations.list();\n *\n * // Get PR with context\n * const pr = await morph.github.pullRequests.get({\n * owner: \"acme\",\n * repo: \"app\",\n * number: 42\n * });\n * ```\n */\nexport class GitHubClient {\n private apiKey: string;\n private baseUrl: string;\n private timeout: number;\n private debug: boolean;\n private defaultInstallationId?: string;\n\n /** Installation operations */\n public installations: {\n list: () => Promise<Installation[]>;\n get: (installationId: string) => Promise<Installation>;\n };\n\n /** Repository operations */\n public repos: {\n list: (input: ListReposInput) => Promise<Repo[]>;\n };\n\n /** Pull request operations */\n public pullRequests: {\n list: (input: ListPullRequestsInput) => Promise<PullRequest[]>;\n get: (input: GetPullRequestInput) => Promise<PullRequestWithContext>;\n };\n\n /** Deployment operations */\n public deployments: {\n list: (input: ListDeploymentsInput) => Promise<Deployment[]>;\n };\n\n /** Comment operations */\n public comments: {\n list: (input: ListCommentsInput) => Promise<Comment[]>;\n create: (input: CreateCommentInput) => Promise<Comment>;\n update: (input: UpdateCommentInput) => Promise<Comment>;\n delete: (input: DeleteCommentInput) => Promise<void>;\n };\n\n /** Check run operations */\n public checkRuns: {\n create: (input: CreateCheckRunInput) => Promise<CheckRun>;\n update: (input: UpdateCheckRunInput) => Promise<CheckRun>;\n };\n\n constructor(config: GitHubClientConfig = {}) {\n this.apiKey = config.apiKey || process.env.MORPH_API_KEY || \"\";\n this.baseUrl = config.baseUrl || DEFAULT_BASE_URL;\n this.timeout = config.timeout || DEFAULT_TIMEOUT;\n this.debug = config.debug || false;\n this.defaultInstallationId = config.installationId;\n\n if (!this.apiKey) {\n throw new Error(\"API key required. Set MORPH_API_KEY or pass apiKey in config.\");\n }\n\n // Bind all methods\n this.installations = {\n list: this.listInstallations.bind(this),\n get: this.getInstallation.bind(this),\n };\n\n this.repos = {\n list: this.listRepos.bind(this),\n };\n\n this.pullRequests = {\n list: this.listPullRequests.bind(this),\n get: this.getPullRequest.bind(this),\n };\n\n this.deployments = {\n list: this.listDeployments.bind(this),\n };\n\n this.comments = {\n list: this.listComments.bind(this),\n create: this.createComment.bind(this),\n update: this.updateComment.bind(this),\n delete: this.deleteComment.bind(this),\n };\n\n this.checkRuns = {\n create: this.createCheckRun.bind(this),\n update: this.updateCheckRun.bind(this),\n };\n }\n\n /**\n * Make an API request to the Morph GitHub proxy\n */\n private async request<T>(\n method: string,\n path: string,\n body?: Record<string, unknown>\n ): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n\n if (this.debug) {\n console.log(`[GitHub SDK] ${method} ${path}`, body || \"\");\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(url, {\n method,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${this.apiKey}`,\n },\n body: body ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const message = errorData.error || errorData.message || response.statusText;\n\n if (this.debug) {\n console.error(`[GitHub SDK] Error ${response.status}:`, message);\n }\n\n // Map to specific error types\n if (response.status === 404) {\n if (message.includes(\"installation\")) {\n throw new NoInstallationError(message);\n }\n throw new NotFoundError(message);\n }\n if (response.status === 403) {\n throw new PermissionError(message);\n }\n throw new GitHubError(message, response.status, errorData.code);\n }\n\n const data = await response.json();\n\n if (this.debug) {\n console.log(`[GitHub SDK] Response:`, JSON.stringify(data).slice(0, 200));\n }\n\n return data as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof GitHubError) {\n throw error;\n }\n\n if (error instanceof Error && error.name === \"AbortError\") {\n throw new GitHubError(\"Request timeout\", 408, \"TIMEOUT\");\n }\n\n throw new GitHubError(\n error instanceof Error ? error.message : \"Unknown error\",\n 500,\n \"UNKNOWN\"\n );\n }\n }\n\n /**\n * Get the installation ID to use for a request\n */\n private getInstallationId(input?: { installationId?: string }): string | undefined {\n return input?.installationId || this.defaultInstallationId;\n }\n\n // ==========================================================================\n // Installations\n // ==========================================================================\n\n private async listInstallations(): Promise<Installation[]> {\n return this.request<Installation[]>(\"GET\", \"/api/v1/github/installations\");\n }\n\n private async getInstallation(installationId: string): Promise<Installation> {\n return this.request<Installation>(\"GET\", `/api/v1/github/installations/${installationId}`);\n }\n\n // ==========================================================================\n // Repositories\n // ==========================================================================\n\n private async listRepos(input: ListReposInput): Promise<Repo[]> {\n const installationId = input.installationId || this.defaultInstallationId;\n if (!installationId) {\n throw new NoInstallationError(\"installationId required. Call installations.list() first.\");\n }\n return this.request<Repo[]>(\"GET\", `/api/v1/github/installations/${installationId}/repos`);\n }\n\n // ==========================================================================\n // Pull Requests\n // ==========================================================================\n\n private async listPullRequests(input: ListPullRequestsInput): Promise<PullRequest[]> {\n const installationId = this.getInstallationId(input);\n const params = new URLSearchParams({\n owner: input.owner,\n repo: input.repo,\n ...(input.state && { state: input.state }),\n ...(installationId && { installationId }),\n });\n return this.request<PullRequest[]>(\"GET\", `/api/v1/github/pulls?${params}`);\n }\n\n private async getPullRequest(input: GetPullRequestInput): Promise<PullRequestWithContext> {\n const installationId = this.getInstallationId(input);\n const params = new URLSearchParams({\n owner: input.owner,\n repo: input.repo,\n ...(installationId && { installationId }),\n });\n return this.request<PullRequestWithContext>(\n \"GET\",\n `/api/v1/github/pulls/${input.number}?${params}`\n );\n }\n\n // ==========================================================================\n // Deployments\n // ==========================================================================\n\n private async listDeployments(input: ListDeploymentsInput): Promise<Deployment[]> {\n const installationId = this.getInstallationId(input);\n const params = new URLSearchParams({\n owner: input.owner,\n repo: input.repo,\n ...(input.sha && { sha: input.sha }),\n ...(input.environment && { environment: input.environment }),\n ...(installationId && { installationId }),\n });\n return this.request<Deployment[]>(\"GET\", `/api/v1/github/deployments?${params}`);\n }\n\n // ==========================================================================\n // Comments\n // ==========================================================================\n\n private async listComments(input: ListCommentsInput): Promise<Comment[]> {\n const installationId = this.getInstallationId(input);\n const params = new URLSearchParams({\n owner: input.owner,\n repo: input.repo,\n pr: String(input.pr),\n ...(installationId && { installationId }),\n });\n return this.request<Comment[]>(\"GET\", `/api/v1/github/comments?${params}`);\n }\n\n private async createComment(input: CreateCommentInput): Promise<Comment> {\n const installationId = this.getInstallationId(input);\n return this.request<Comment>(\"POST\", \"/api/v1/github/comments\", {\n owner: input.owner,\n repo: input.repo,\n pr: input.pr,\n body: input.body,\n ...(installationId && { installationId }),\n });\n }\n\n private async updateComment(input: UpdateCommentInput): Promise<Comment> {\n const installationId = this.getInstallationId(input);\n return this.request<Comment>(\"PATCH\", `/api/v1/github/comments/${input.commentId}`, {\n owner: input.owner,\n repo: input.repo,\n body: input.body,\n ...(installationId && { installationId }),\n });\n }\n\n private async deleteComment(input: DeleteCommentInput): Promise<void> {\n const installationId = this.getInstallationId(input);\n const params = new URLSearchParams({\n owner: input.owner,\n repo: input.repo,\n ...(installationId && { installationId }),\n });\n await this.request<void>(\"DELETE\", `/api/v1/github/comments/${input.commentId}?${params}`);\n }\n\n // ==========================================================================\n // Check Runs\n // ==========================================================================\n\n private async createCheckRun(input: CreateCheckRunInput): Promise<CheckRun> {\n const installationId = this.getInstallationId(input);\n return this.request<CheckRun>(\"POST\", \"/api/v1/github/check-runs\", {\n owner: input.owner,\n repo: input.repo,\n sha: input.sha,\n name: input.name,\n status: input.status,\n ...(input.title && { title: input.title }),\n ...(input.summary && { summary: input.summary }),\n ...(installationId && { installationId }),\n });\n }\n\n private async updateCheckRun(input: UpdateCheckRunInput): Promise<CheckRun> {\n const installationId = this.getInstallationId(input);\n return this.request<CheckRun>(\"PATCH\", `/api/v1/github/check-runs/${input.checkRunId}`, {\n owner: input.owner,\n repo: input.repo,\n ...(input.status && { status: input.status }),\n ...(input.conclusion && { conclusion: input.conclusion }),\n ...(input.title && { title: input.title }),\n ...(input.summary && { summary: input.summary }),\n ...(input.text && { text: input.text }),\n ...(installationId && { installationId }),\n });\n }\n}\n","/**\n * OpenAI Tool Factory for MorphClient\n * \n * Creates OpenAI-compatible tools that inherit the API key from MorphClient.\n */\n\nimport type { MorphClientConfig } from '../client.js';\nimport { createWarpGrepTool } from '../tools/warp_grep/openai.js';\nimport { createCodebaseSearchTool } from '../tools/codebase_search/openai.js';\nimport { createEditFileTool } from '../tools/fastapply/openai.js';\nimport type { WarpGrepToolConfig } from '../tools/warp_grep/types.js';\nimport type { CodebaseSearchConfig } from '../tools/codebase_search/types.js';\nimport type { EditFileConfig } from '../tools/fastapply/types.js';\n\n/**\n * Factory for creating OpenAI-compatible tools with inherited API key\n * \n * @example\n * ```typescript\n * const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });\n * \n * const grepTool = morph.openai.createWarpGrepTool({ repoRoot: '.' });\n * const searchTool = morph.openai.createCodebaseSearchTool({ repoId: 'my-project' });\n * const editTool = morph.openai.createEditFileTool({ baseDir: './src' });\n * \n * // Use with OpenAI client\n * const response = await openai.chat.completions.create({\n * model: 'gpt-4o',\n * tools: [grepTool, searchTool, editTool],\n * messages: [{ role: 'user', content: 'Find and fix the bug' }]\n * });\n * ```\n */\nexport class OpenAIToolFactory {\n constructor(private config: MorphClientConfig) {}\n\n /**\n * Create an OpenAI-compatible warp grep tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns OpenAI ChatCompletionTool with execute and formatResult methods\n */\n createWarpGrepTool(toolConfig: Omit<WarpGrepToolConfig, 'morphApiKey'>) {\n return createWarpGrepTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n }\n\n /**\n * Create an OpenAI-compatible codebase search tool\n * \n * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)\n * @returns OpenAI ChatCompletionTool with execute and formatResult methods\n */\n createCodebaseSearchTool(toolConfig: Omit<CodebaseSearchConfig, 'apiKey'>) {\n return createCodebaseSearchTool({ \n ...toolConfig, \n apiKey: this.config.apiKey,\n });\n }\n\n /**\n * Create an OpenAI-compatible edit file tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns OpenAI ChatCompletionTool with execute and formatResult methods\n */\n createEditFileTool(toolConfig: Omit<EditFileConfig, 'morphApiKey'> = {}) {\n return createEditFileTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n }\n}\n\n","/**\n * Anthropic Tool Factory for MorphClient\n * \n * Creates Anthropic-compatible tools that inherit the API key from MorphClient.\n */\n\nimport type { MorphClientConfig } from '../client.js';\nimport { createWarpGrepTool } from '../tools/warp_grep/anthropic.js';\nimport { createCodebaseSearchTool } from '../tools/codebase_search/anthropic.js';\nimport { createEditFileTool } from '../tools/fastapply/anthropic.js';\nimport type { WarpGrepToolConfig } from '../tools/warp_grep/types.js';\nimport type { CodebaseSearchConfig } from '../tools/codebase_search/types.js';\nimport type { EditFileConfig } from '../tools/fastapply/types.js';\n\n/**\n * Factory for creating Anthropic-compatible tools with inherited API key\n * \n * @example\n * ```typescript\n * const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });\n * \n * const grepTool = morph.anthropic.createWarpGrepTool({ repoRoot: '.' });\n * const searchTool = morph.anthropic.createCodebaseSearchTool({ repoId: 'my-project' });\n * const editTool = morph.anthropic.createEditFileTool({ baseDir: './src' });\n * \n * // Use with Anthropic client\n * const response = await anthropic.messages.create({\n * model: 'claude-sonnet-4-5-20250929',\n * tools: [grepTool, searchTool, editTool],\n * messages: [{ role: 'user', content: 'Find and fix the bug' }]\n * });\n * ```\n */\nexport class AnthropicToolFactory {\n constructor(private config: MorphClientConfig) {}\n\n /**\n * Create an Anthropic-compatible warp grep tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns Anthropic Tool with execute and formatResult methods\n */\n createWarpGrepTool(toolConfig: Omit<WarpGrepToolConfig, 'morphApiKey'>) {\n return createWarpGrepTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n\n }\n\n /**\n * Create an Anthropic-compatible codebase search tool\n * \n * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)\n * @returns Anthropic Tool with execute and formatResult methods\n */\n createCodebaseSearchTool(toolConfig: Omit<CodebaseSearchConfig, 'apiKey'>) {\n return createCodebaseSearchTool({ \n ...toolConfig, \n apiKey: this.config.apiKey,\n });\n }\n\n /**\n * Create an Anthropic-compatible edit file tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns Anthropic Tool with execute and formatResult methods\n */\n createEditFileTool(toolConfig: Omit<EditFileConfig, 'morphApiKey'> = {}) {\n return createEditFileTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n }\n}\n\n","/**\n * Vercel AI SDK Tool Factory for MorphClient\n * \n * Creates Vercel AI SDK-compatible tools that inherit the API key from MorphClient.\n */\n\nimport type { MorphClientConfig } from '../client.js';\nimport { createWarpGrepTool } from '../tools/warp_grep/vercel.js';\nimport { createCodebaseSearchTool } from '../tools/codebase_search/vercel.js';\nimport { createEditFileTool } from '../tools/fastapply/vercel.js';\nimport type { WarpGrepToolConfig } from '../tools/warp_grep/types.js';\nimport type { CodebaseSearchConfig } from '../tools/codebase_search/types.js';\nimport type { EditFileConfig } from '../tools/fastapply/types.js';\n\n/**\n * Factory for creating Vercel AI SDK-compatible tools with inherited API key\n * \n * @example\n * ```typescript\n * const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });\n * \n * const grepTool = morph.vercel.createWarpGrepTool({ repoRoot: '.' });\n * const searchTool = morph.vercel.createCodebaseSearchTool({ repoId: 'my-project' });\n * const editTool = morph.vercel.createEditFileTool({ baseDir: './src' });\n * \n * // Use with Vercel AI SDK\n * const result = await generateText({\n * model: anthropic('claude-sonnet-4-5-20250929'),\n * tools: { grep: grepTool, search: searchTool, edit: editTool },\n * prompt: 'Find and fix the bug'\n * });\n * ```\n */\nexport class VercelToolFactory {\n constructor(private config: MorphClientConfig) {}\n\n /**\n * Create a Vercel AI SDK-compatible warp grep tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns Vercel AI SDK tool\n */\n createWarpGrepTool(toolConfig: Omit<WarpGrepToolConfig, 'morphApiKey'>) {\n return createWarpGrepTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n }\n\n /**\n * Create a Vercel AI SDK-compatible codebase search tool\n * \n * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)\n * @returns Vercel AI SDK tool\n */\n createCodebaseSearchTool(toolConfig: Omit<CodebaseSearchConfig, 'apiKey'>) {\n return createCodebaseSearchTool({ \n ...toolConfig, \n apiKey: this.config.apiKey,\n });\n }\n\n /**\n * Create a Vercel AI SDK-compatible edit file tool\n * \n * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)\n * @returns Vercel AI SDK tool\n */\n createEditFileTool(toolConfig: Omit<EditFileConfig, 'morphApiKey'> = {}) {\n return createEditFileTool({ \n ...toolConfig, \n morphApiKey: this.config.apiKey,\n });\n }\n}\n\n","/**\n * Unified Morph SDK Client\n * \n * Provides access to all Morph tools through a single interface\n * \n * @example\n * ```typescript\n * import { MorphClient } from '@morphllm/morphsdk';\n * \n * const morph = new MorphClient({ \n * apiKey: process.env.MORPH_API_KEY,\n * debug: true,\n * timeout: 60000\n * });\n * \n * // Direct execution\n * await morph.fastApply.execute({ target_filepath: 'src/index.ts', ... });\n * await morph.warpGrep.execute({ query: 'Find auth', repoRoot: '.' });\n * await morph.codebaseSearch.search({ query: 'auth logic', repoId: 'x' });\n * \n * // Tool creation for AI agents (API key inherited)\n * const grepTool = morph.openai.createWarpGrepTool({ repoRoot: '.' });\n * const searchTool = morph.anthropic.createCodebaseSearchTool({ repoId: 'x' });\n * const editTool = morph.vercel.createEditFileTool({ baseDir: './src' });\n * \n * // Use tools with OpenAI\n * const response = await openai.chat.completions.create({\n * model: 'gpt-4o',\n * tools: [grepTool],\n * messages: [{ role: 'user', content: 'Find the bug' }]\n * });\n * ```\n */\n\nimport type { RetryConfig } from './tools/utils/resilience.js';\nimport { FastApplyClient } from './tools/fastapply/core.js';\nimport { CodebaseSearchClient } from './tools/codebase_search/core.js';\nimport { BrowserClient } from './tools/browser/core.js';\nimport { WarpGrepClient } from './tools/warp_grep/client.js';\nimport { GitHubClient } from './tools/github/core.js';\nimport { MorphGit } from './git/index.js';\nimport { OpenAIRouter, AnthropicRouter, GeminiRouter, RawRouter } from './modelrouter/core.js';\nimport { OpenAIToolFactory, AnthropicToolFactory, VercelToolFactory } from './factories/index.js';\n\n/**\n * Configuration for the MorphClient\n */\nexport interface MorphClientConfig {\n /** Morph API key for authentication (defaults to MORPH_API_KEY env var) */\n apiKey?: string;\n /** Enable debug logging across all tools */\n debug?: boolean;\n /** Default timeout in milliseconds for API requests */\n timeout?: number;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** GitHub-specific configuration */\n github?: {\n /** Default installation ID for GitHub operations */\n installationId?: string;\n };\n}\n\n/**\n * Unified Morph SDK Client\n * \n * Provides access to all Morph tools through a single interface:\n * - fastApply: AI-powered file editing with intelligent merging\n * - codebaseSearch: Semantic code search\n * - warpGrep: Fast code search with ripgrep\n * - browser: AI-powered browser automation\n * - git: Version control operations\n * - routers: Intelligent model selection (OpenAI, Anthropic, Gemini)\n * - openai/anthropic/vercel: Tool factories for agent frameworks\n */\nexport class MorphClient {\n /** Client configuration */\n public config: MorphClientConfig;\n\n /** FastApply tool for editing files with AI-powered merge */\n public fastApply: FastApplyClient;\n\n /** CodebaseSearch tool for semantic code search */\n public codebaseSearch: CodebaseSearchClient;\n\n /** WarpGrep tool for fast code search using ripgrep */\n public warpGrep: WarpGrepClient;\n\n /** Browser tool for AI-powered browser automation */\n public browser: BrowserClient;\n\n /** GitHub tool for PR context, comments, and check runs */\n public github: GitHubClient;\n\n /** Git tool for version control operations */\n public git: MorphGit;\n\n /** Model routers for intelligent model selection */\n public routers: {\n openai: OpenAIRouter;\n anthropic: AnthropicRouter;\n gemini: GeminiRouter;\n raw: RawRouter;\n };\n\n /** OpenAI-compatible tool factories */\n public openai: OpenAIToolFactory;\n\n /** Anthropic-compatible tool factories */\n public anthropic: AnthropicToolFactory;\n\n /** Vercel AI SDK tool factories */\n public vercel: VercelToolFactory;\n\n /**\n * Create a new Morph SDK client\n * \n * @param config - Client configuration (apiKey, debug, timeout, retryConfig)\n * \n * @example\n * ```typescript\n * const morph = new MorphClient({ \n * apiKey: process.env.MORPH_API_KEY,\n * debug: true,\n * timeout: 60000\n * });\n * ```\n */\n constructor(config: MorphClientConfig = {}) {\n this.config = config;\n\n // Initialize all sub-clients with shared config\n this.fastApply = new FastApplyClient({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n });\n\n this.codebaseSearch = new CodebaseSearchClient({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n });\n\n this.warpGrep = new WarpGrepClient({\n morphApiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n });\n\n this.browser = new BrowserClient({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n });\n\n this.github = new GitHubClient({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n installationId: config.github?.installationId,\n });\n\n this.git = new MorphGit({\n apiKey: config.apiKey,\n retryConfig: config.retryConfig,\n });\n\n this.routers = {\n openai: new OpenAIRouter({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n }),\n anthropic: new AnthropicRouter({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n }),\n gemini: new GeminiRouter({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n }),\n raw: new RawRouter({\n apiKey: config.apiKey,\n debug: config.debug,\n timeout: config.timeout,\n retryConfig: config.retryConfig,\n }),\n };\n\n // Initialize tool factories\n this.openai = new OpenAIToolFactory(config);\n this.anthropic = new AnthropicToolFactory(config);\n this.vercel = new VercelToolFactory(config);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsVO,IAAM,cAAN,cAA0B,MAAM;AAAA;AAAA,EAErC;AAAA;AAAA,EAEA;AAAA,EAEA,YAAY,SAAiB,QAAgB,MAAe;AAC1D,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,sBAAN,cAAkC,YAAY;AAAA,EACnD,YAAY,UAAU,8FAA8F;AAClH,UAAM,SAAS,KAAK,iBAAiB;AAAA,EACvC;AACF;AAKO,IAAM,gBAAN,cAA4B,YAAY;AAAA,EAC7C,YAAY,UAAkB;AAC5B,UAAM,GAAG,QAAQ,cAAc,KAAK,WAAW;AAAA,EACjD;AACF;AAKO,IAAM,kBAAN,cAA8B,YAAY;AAAA,EAC/C,YAAY,UAAU,+CAA+C;AACnE,UAAM,SAAS,KAAK,mBAAmB;AAAA,EACzC;AACF;;;AC5VA,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AAsBjB,IAAM,eAAN,MAAmB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGD;AAAA;AAAA,EAMA;AAAA;AAAA,EAKA;AAAA;AAAA,EAMA;AAAA;AAAA,EAKA;AAAA;AAAA,EAQA;AAAA,EAKP,YAAY,SAA6B,CAAC,GAAG;AAC3C,SAAK,SAAS,OAAO,UAAU,QAA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epTool","createCodebaseSearchTool","createEditFileTool","createWarpGrepTool","createCodebaseSearchTool","createEditFileTool"]}
package/dist/client.cjs CHANGED
@@ -3800,10 +3800,10 @@ var GitHubClient = class {
3800
3800
  // Installations
3801
3801
  // ==========================================================================
3802
3802
  async listInstallations() {
3803
- return this.request("GET", "/v1/github/installations");
3803
+ return this.request("GET", "/api/v1/github/installations");
3804
3804
  }
3805
3805
  async getInstallation(installationId) {
3806
- return this.request("GET", `/v1/github/installations/${installationId}`);
3806
+ return this.request("GET", `/api/v1/github/installations/${installationId}`);
3807
3807
  }
3808
3808
  // ==========================================================================
3809
3809
  // Repositories
@@ -3813,7 +3813,7 @@ var GitHubClient = class {
3813
3813
  if (!installationId) {
3814
3814
  throw new NoInstallationError("installationId required. Call installations.list() first.");
3815
3815
  }
3816
- return this.request("GET", `/v1/github/installations/${installationId}/repos`);
3816
+ return this.request("GET", `/api/v1/github/installations/${installationId}/repos`);
3817
3817
  }
3818
3818
  // ==========================================================================
3819
3819
  // Pull Requests
@@ -3826,7 +3826,7 @@ var GitHubClient = class {
3826
3826
  ...input.state && { state: input.state },
3827
3827
  ...installationId && { installationId }
3828
3828
  });
3829
- return this.request("GET", `/v1/github/pulls?${params}`);
3829
+ return this.request("GET", `/api/v1/github/pulls?${params}`);
3830
3830
  }
3831
3831
  async getPullRequest(input) {
3832
3832
  const installationId = this.getInstallationId(input);
@@ -3837,7 +3837,7 @@ var GitHubClient = class {
3837
3837
  });
3838
3838
  return this.request(
3839
3839
  "GET",
3840
- `/v1/github/pulls/${input.number}?${params}`
3840
+ `/api/v1/github/pulls/${input.number}?${params}`
3841
3841
  );
3842
3842
  }
3843
3843
  // ==========================================================================
@@ -3852,7 +3852,7 @@ var GitHubClient = class {
3852
3852
  ...input.environment && { environment: input.environment },
3853
3853
  ...installationId && { installationId }
3854
3854
  });
3855
- return this.request("GET", `/v1/github/deployments?${params}`);
3855
+ return this.request("GET", `/api/v1/github/deployments?${params}`);
3856
3856
  }
3857
3857
  // ==========================================================================
3858
3858
  // Comments
@@ -3865,11 +3865,11 @@ var GitHubClient = class {
3865
3865
  pr: String(input.pr),
3866
3866
  ...installationId && { installationId }
3867
3867
  });
3868
- return this.request("GET", `/v1/github/comments?${params}`);
3868
+ return this.request("GET", `/api/v1/github/comments?${params}`);
3869
3869
  }
3870
3870
  async createComment(input) {
3871
3871
  const installationId = this.getInstallationId(input);
3872
- return this.request("POST", "/v1/github/comments", {
3872
+ return this.request("POST", "/api/v1/github/comments", {
3873
3873
  owner: input.owner,
3874
3874
  repo: input.repo,
3875
3875
  pr: input.pr,
@@ -3879,7 +3879,7 @@ var GitHubClient = class {
3879
3879
  }
3880
3880
  async updateComment(input) {
3881
3881
  const installationId = this.getInstallationId(input);
3882
- return this.request("PATCH", `/v1/github/comments/${input.commentId}`, {
3882
+ return this.request("PATCH", `/api/v1/github/comments/${input.commentId}`, {
3883
3883
  owner: input.owner,
3884
3884
  repo: input.repo,
3885
3885
  body: input.body,
@@ -3893,14 +3893,14 @@ var GitHubClient = class {
3893
3893
  repo: input.repo,
3894
3894
  ...installationId && { installationId }
3895
3895
  });
3896
- await this.request("DELETE", `/v1/github/comments/${input.commentId}?${params}`);
3896
+ await this.request("DELETE", `/api/v1/github/comments/${input.commentId}?${params}`);
3897
3897
  }
3898
3898
  // ==========================================================================
3899
3899
  // Check Runs
3900
3900
  // ==========================================================================
3901
3901
  async createCheckRun(input) {
3902
3902
  const installationId = this.getInstallationId(input);
3903
- return this.request("POST", "/v1/github/check-runs", {
3903
+ return this.request("POST", "/api/v1/github/check-runs", {
3904
3904
  owner: input.owner,
3905
3905
  repo: input.repo,
3906
3906
  sha: input.sha,
@@ -3913,7 +3913,7 @@ var GitHubClient = class {
3913
3913
  }
3914
3914
  async updateCheckRun(input) {
3915
3915
  const installationId = this.getInstallationId(input);
3916
- return this.request("PATCH", `/v1/github/check-runs/${input.checkRunId}`, {
3916
+ return this.request("PATCH", `/api/v1/github/check-runs/${input.checkRunId}`, {
3917
3917
  owner: input.owner,
3918
3918
  repo: input.repo,
3919
3919
  ...input.status && { status: input.status },