@morphllm/morphsdk 0.2.111 → 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/{chunk-JYKYQ5DN.js → chunk-EQHP36A2.js} +15 -36
- package/dist/chunk-EQHP36A2.js.map +1 -0
- package/dist/{client-DksVOIsG.d.ts → client-Bm_umdno.d.ts} +3 -14
- package/dist/client.cjs +14 -35
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/index.cjs +14 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JYKYQ5DN.js.map +0 -1
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-
|
|
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
package/dist/index.cjs
CHANGED
|
@@ -3707,13 +3707,11 @@ var PermissionError = class extends GitHubError {
|
|
|
3707
3707
|
};
|
|
3708
3708
|
|
|
3709
3709
|
// tools/github/core.ts
|
|
3710
|
-
var
|
|
3711
|
-
var BACKEND_BASE_URL = "https://browser.morphllm.com";
|
|
3710
|
+
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
3712
3711
|
var DEFAULT_TIMEOUT2 = 3e4;
|
|
3713
3712
|
var GitHubClient = class {
|
|
3714
3713
|
apiKey;
|
|
3715
|
-
|
|
3716
|
-
backendUrl;
|
|
3714
|
+
baseUrl;
|
|
3717
3715
|
timeout;
|
|
3718
3716
|
debug;
|
|
3719
3717
|
defaultInstallationId;
|
|
@@ -3740,8 +3738,7 @@ var GitHubClient = class {
|
|
|
3740
3738
|
}
|
|
3741
3739
|
constructor(config = {}) {
|
|
3742
3740
|
this.apiKey = config.apiKey || process.env.MORPH_API_KEY || "";
|
|
3743
|
-
this.
|
|
3744
|
-
this.backendUrl = config.backendUrl || BACKEND_BASE_URL;
|
|
3741
|
+
this.baseUrl = config.baseUrl || DEFAULT_BASE_URL;
|
|
3745
3742
|
this.timeout = config.timeout || DEFAULT_TIMEOUT2;
|
|
3746
3743
|
this.debug = config.debug || false;
|
|
3747
3744
|
this.defaultInstallationId = config.installationId;
|
|
@@ -3786,24 +3783,10 @@ var GitHubClient = class {
|
|
|
3786
3783
|
};
|
|
3787
3784
|
}
|
|
3788
3785
|
/**
|
|
3789
|
-
* Make an API request
|
|
3786
|
+
* Make an authenticated API request
|
|
3790
3787
|
*/
|
|
3791
3788
|
async request(method, path5, body) {
|
|
3792
|
-
|
|
3793
|
-
}
|
|
3794
|
-
// TODO: These endpoints use Octokit and currently live in landing.
|
|
3795
|
-
// Move them to the backend so all GitHub SDK traffic goes through a single URL.
|
|
3796
|
-
/**
|
|
3797
|
-
* Make an API request to the landing app (Octokit-based endpoints)
|
|
3798
|
-
*/
|
|
3799
|
-
async landingRequest(method, path5, body) {
|
|
3800
|
-
return this._fetch(this.landingUrl, method, path5, body);
|
|
3801
|
-
}
|
|
3802
|
-
/**
|
|
3803
|
-
* Shared fetch logic for both backend and landing requests
|
|
3804
|
-
*/
|
|
3805
|
-
async _fetch(baseUrl, method, path5, body) {
|
|
3806
|
-
const url = `${baseUrl}${path5}`;
|
|
3789
|
+
const url = `${this.baseUrl}${path5}`;
|
|
3807
3790
|
if (this.debug) {
|
|
3808
3791
|
console.log(`[GitHub SDK] ${method} ${path5}`, body || "");
|
|
3809
3792
|
}
|
|
@@ -3935,7 +3918,6 @@ var GitHubClient = class {
|
|
|
3935
3918
|
}
|
|
3936
3919
|
// ==========================================================================
|
|
3937
3920
|
// Pull Requests
|
|
3938
|
-
// TODO: Move to backend — currently uses Octokit in landing
|
|
3939
3921
|
// ==========================================================================
|
|
3940
3922
|
async listPullRequests(input) {
|
|
3941
3923
|
const installationId = this.getInstallationId(input);
|
|
@@ -3945,7 +3927,7 @@ var GitHubClient = class {
|
|
|
3945
3927
|
...input.state && { state: input.state },
|
|
3946
3928
|
...installationId && { installationId }
|
|
3947
3929
|
});
|
|
3948
|
-
return this.
|
|
3930
|
+
return this.request("GET", `/api/v1/github/pulls?${params}`);
|
|
3949
3931
|
}
|
|
3950
3932
|
async getPullRequest(input) {
|
|
3951
3933
|
const installationId = this.getInstallationId(input);
|
|
@@ -3954,14 +3936,13 @@ var GitHubClient = class {
|
|
|
3954
3936
|
repo: input.repo,
|
|
3955
3937
|
...installationId && { installationId }
|
|
3956
3938
|
});
|
|
3957
|
-
return this.
|
|
3939
|
+
return this.request(
|
|
3958
3940
|
"GET",
|
|
3959
3941
|
`/api/v1/github/pulls/${input.number}?${params}`
|
|
3960
3942
|
);
|
|
3961
3943
|
}
|
|
3962
3944
|
// ==========================================================================
|
|
3963
3945
|
// Deployments
|
|
3964
|
-
// TODO: Move to backend — currently uses Octokit in landing
|
|
3965
3946
|
// ==========================================================================
|
|
3966
3947
|
async listDeployments(input) {
|
|
3967
3948
|
const installationId = this.getInstallationId(input);
|
|
@@ -3972,11 +3953,10 @@ var GitHubClient = class {
|
|
|
3972
3953
|
...input.environment && { environment: input.environment },
|
|
3973
3954
|
...installationId && { installationId }
|
|
3974
3955
|
});
|
|
3975
|
-
return this.
|
|
3956
|
+
return this.request("GET", `/api/v1/github/deployments?${params}`);
|
|
3976
3957
|
}
|
|
3977
3958
|
// ==========================================================================
|
|
3978
3959
|
// Comments
|
|
3979
|
-
// TODO: Move to backend — currently uses Octokit in landing
|
|
3980
3960
|
// ==========================================================================
|
|
3981
3961
|
async listComments(input) {
|
|
3982
3962
|
const installationId = this.getInstallationId(input);
|
|
@@ -3986,11 +3966,11 @@ var GitHubClient = class {
|
|
|
3986
3966
|
pr: String(input.pr),
|
|
3987
3967
|
...installationId && { installationId }
|
|
3988
3968
|
});
|
|
3989
|
-
return this.
|
|
3969
|
+
return this.request("GET", `/api/v1/github/comments?${params}`);
|
|
3990
3970
|
}
|
|
3991
3971
|
async createComment(input) {
|
|
3992
3972
|
const installationId = this.getInstallationId(input);
|
|
3993
|
-
return this.
|
|
3973
|
+
return this.request("POST", "/api/v1/github/comments", {
|
|
3994
3974
|
owner: input.owner,
|
|
3995
3975
|
repo: input.repo,
|
|
3996
3976
|
pr: input.pr,
|
|
@@ -4000,7 +3980,7 @@ var GitHubClient = class {
|
|
|
4000
3980
|
}
|
|
4001
3981
|
async updateComment(input) {
|
|
4002
3982
|
const installationId = this.getInstallationId(input);
|
|
4003
|
-
return this.
|
|
3983
|
+
return this.request("PATCH", `/api/v1/github/comments/${input.commentId}`, {
|
|
4004
3984
|
owner: input.owner,
|
|
4005
3985
|
repo: input.repo,
|
|
4006
3986
|
body: input.body,
|
|
@@ -4014,15 +3994,14 @@ var GitHubClient = class {
|
|
|
4014
3994
|
repo: input.repo,
|
|
4015
3995
|
...installationId && { installationId }
|
|
4016
3996
|
});
|
|
4017
|
-
await this.
|
|
3997
|
+
await this.request("DELETE", `/api/v1/github/comments/${input.commentId}?${params}`);
|
|
4018
3998
|
}
|
|
4019
3999
|
// ==========================================================================
|
|
4020
4000
|
// Check Runs
|
|
4021
|
-
// TODO: Move to backend — currently uses Octokit in landing
|
|
4022
4001
|
// ==========================================================================
|
|
4023
4002
|
async createCheckRun(input) {
|
|
4024
4003
|
const installationId = this.getInstallationId(input);
|
|
4025
|
-
return this.
|
|
4004
|
+
return this.request("POST", "/api/v1/github/check-runs", {
|
|
4026
4005
|
owner: input.owner,
|
|
4027
4006
|
repo: input.repo,
|
|
4028
4007
|
sha: input.sha,
|
|
@@ -4035,7 +4014,7 @@ var GitHubClient = class {
|
|
|
4035
4014
|
}
|
|
4036
4015
|
async updateCheckRun(input) {
|
|
4037
4016
|
const installationId = this.getInstallationId(input);
|
|
4038
|
-
return this.
|
|
4017
|
+
return this.request("PATCH", `/api/v1/github/check-runs/${input.checkRunId}`, {
|
|
4039
4018
|
owner: input.owner,
|
|
4040
4019
|
repo: input.repo,
|
|
4041
4020
|
...input.status && { status: input.status },
|