@morphllm/morphsdk 0.2.110 → 0.2.112

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.
package/dist/client.d.ts CHANGED
@@ -3,7 +3,7 @@ import './tools/fastapply/core.js';
3
3
  import './tools/codebase_search/core.js';
4
4
  import './tools/browser/core.js';
5
5
  import './tools/warp_grep/client.js';
6
- export { M as MorphClient, a as MorphClientConfig } from './client-BH1R-YHX.js';
6
+ export { M as MorphClient, a as MorphClientConfig } from './client-Bm_umdno.js';
7
7
  import './git/client.js';
8
8
  import './modelrouter/core.js';
9
9
  import './tools/fastapply/types.js';
package/dist/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-I72WZNZF.js";
3
+ } from "./chunk-EQHP36A2.js";
4
4
  import "./chunk-FL4ZBHK2.js";
5
5
  import "./chunk-HI35Y6EZ.js";
6
6
  import "./chunk-ALTKGCG5.js";
package/dist/index.cjs CHANGED
@@ -3719,6 +3719,8 @@ var GitHubClient = class {
3719
3719
  installations;
3720
3720
  /** Repository operations */
3721
3721
  repos;
3722
+ /** Project operations (monorepo sub-projects) */
3723
+ projects;
3722
3724
  /** Pull request operations */
3723
3725
  pullRequests;
3724
3726
  /** Deployment operations */
@@ -3727,6 +3729,13 @@ var GitHubClient = class {
3727
3729
  comments;
3728
3730
  /** Check run operations */
3729
3731
  checkRuns;
3732
+ /**
3733
+ * Get the GitHub App installation URL.
3734
+ * Users visit this URL once to install the Morph GitHub App on their account/org.
3735
+ */
3736
+ getInstallUrl() {
3737
+ return "https://github.com/apps/morph-subagents/installations/new";
3738
+ }
3730
3739
  constructor(config = {}) {
3731
3740
  this.apiKey = config.apiKey || process.env.MORPH_API_KEY || "";
3732
3741
  this.baseUrl = config.baseUrl || DEFAULT_BASE_URL;
@@ -3738,10 +3747,22 @@ var GitHubClient = class {
3738
3747
  }
3739
3748
  this.installations = {
3740
3749
  list: this.listInstallations.bind(this),
3741
- get: this.getInstallation.bind(this)
3750
+ get: this.getInstallation.bind(this),
3751
+ update: this.updateInstallation.bind(this),
3752
+ disconnect: this.disconnectInstallation.bind(this)
3742
3753
  };
3743
3754
  this.repos = {
3744
- list: this.listRepos.bind(this)
3755
+ list: this.listRepos.bind(this),
3756
+ get: this.getRepo.bind(this),
3757
+ update: this.updateRepo.bind(this),
3758
+ remove: this.removeRepo.bind(this),
3759
+ sync: this.syncRepos.bind(this)
3760
+ };
3761
+ this.projects = {
3762
+ list: this.listProjects.bind(this),
3763
+ create: this.createProject.bind(this),
3764
+ update: this.updateProject.bind(this),
3765
+ delete: this.deleteProject.bind(this)
3745
3766
  };
3746
3767
  this.pullRequests = {
3747
3768
  list: this.listPullRequests.bind(this),
@@ -3762,7 +3783,7 @@ var GitHubClient = class {
3762
3783
  };
3763
3784
  }
3764
3785
  /**
3765
- * Make an API request to the Morph GitHub proxy
3786
+ * Make an authenticated API request
3766
3787
  */
3767
3788
  async request(method, path5, body) {
3768
3789
  const url = `${this.baseUrl}${path5}`;
@@ -3784,7 +3805,7 @@ var GitHubClient = class {
3784
3805
  clearTimeout(timeoutId);
3785
3806
  if (!response.ok) {
3786
3807
  const errorData = await response.json().catch(() => ({}));
3787
- const message = errorData.error || errorData.message || response.statusText;
3808
+ const message = errorData.error || errorData.detail || errorData.message || response.statusText;
3788
3809
  if (this.debug) {
3789
3810
  console.error(`[GitHub SDK] Error ${response.status}:`, message);
3790
3811
  }
@@ -3834,6 +3855,15 @@ var GitHubClient = class {
3834
3855
  async getInstallation(installationId) {
3835
3856
  return this.request("GET", `/api/v1/github/installations/${installationId}`);
3836
3857
  }
3858
+ async updateInstallation(input) {
3859
+ if (this.debug) console.log("[GitHub SDK] updateInstallation", input.installationId);
3860
+ const { installationId, ...body } = input;
3861
+ return this.request("PATCH", `/api/v1/github/installations/${installationId}`, body);
3862
+ }
3863
+ async disconnectInstallation(installationId) {
3864
+ if (this.debug) console.log("[GitHub SDK] disconnectInstallation", installationId);
3865
+ return this.request("DELETE", `/api/v1/github/installations/${installationId}`);
3866
+ }
3837
3867
  // ==========================================================================
3838
3868
  // Repositories
3839
3869
  // ==========================================================================
@@ -3844,6 +3874,48 @@ var GitHubClient = class {
3844
3874
  }
3845
3875
  return this.request("GET", `/api/v1/github/installations/${installationId}/repos`);
3846
3876
  }
3877
+ async getRepo(repoId) {
3878
+ if (this.debug) console.log("[GitHub SDK] getRepo", repoId);
3879
+ return this.request("GET", `/api/v1/github/repos/${repoId}`);
3880
+ }
3881
+ async updateRepo(input) {
3882
+ if (this.debug) console.log("[GitHub SDK] updateRepo", input.repoId);
3883
+ const { repoId, ...body } = input;
3884
+ return this.request("PATCH", `/api/v1/github/repos/${repoId}`, body);
3885
+ }
3886
+ async removeRepo(repoId) {
3887
+ if (this.debug) console.log("[GitHub SDK] removeRepo", repoId);
3888
+ return this.request("DELETE", `/api/v1/github/repos/${repoId}`);
3889
+ }
3890
+ async syncRepos(input) {
3891
+ const installationId = input.installationId || this.defaultInstallationId;
3892
+ if (!installationId) {
3893
+ throw new NoInstallationError("installationId required. Call installations.list() first.");
3894
+ }
3895
+ if (this.debug) console.log("[GitHub SDK] syncRepos", installationId);
3896
+ return this.request("POST", `/api/v1/github/installations/${installationId}/repos/sync`);
3897
+ }
3898
+ // ==========================================================================
3899
+ // Projects (monorepo sub-projects)
3900
+ // ==========================================================================
3901
+ async listProjects(input) {
3902
+ if (this.debug) console.log("[GitHub SDK] listProjects", input.repoId);
3903
+ return this.request("GET", `/api/v1/github/repos/${input.repoId}/projects`);
3904
+ }
3905
+ async createProject(input) {
3906
+ if (this.debug) console.log("[GitHub SDK] createProject", input.repoId, input.name);
3907
+ const { repoId, ...body } = input;
3908
+ return this.request("POST", `/api/v1/github/repos/${repoId}/projects`, body);
3909
+ }
3910
+ async updateProject(input) {
3911
+ if (this.debug) console.log("[GitHub SDK] updateProject", input.projectId);
3912
+ const { projectId, ...body } = input;
3913
+ return this.request("PATCH", `/api/v1/github/projects/${projectId}`, body);
3914
+ }
3915
+ async deleteProject(projectId) {
3916
+ if (this.debug) console.log("[GitHub SDK] deleteProject", projectId);
3917
+ return this.request("DELETE", `/api/v1/github/projects/${projectId}`);
3918
+ }
3847
3919
  // ==========================================================================
3848
3920
  // Pull Requests
3849
3921
  // ==========================================================================