@morphllm/morphsdk 0.2.38 → 0.2.40
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-AKVAAKRB.js → chunk-3NTGAUTJ.js} +73 -2
- package/dist/chunk-3NTGAUTJ.js.map +1 -0
- package/dist/{chunk-TBVDBQZ2.js → chunk-4WIBODS7.js} +61 -3
- package/dist/chunk-4WIBODS7.js.map +1 -0
- package/dist/{chunk-LN4CTQZG.js → chunk-7MCSSJJA.js} +2 -2
- package/dist/{chunk-DJSQUQGY.js → chunk-DIWNR3UP.js} +3 -3
- package/dist/{chunk-W5CHJ6OX.js → chunk-JSZQVUSE.js} +2 -2
- package/dist/{chunk-YSBSDU75.js → chunk-LUI7APXX.js} +2 -2
- package/dist/{chunk-EAA7D24N.js → chunk-N5654KQR.js} +13 -13
- package/dist/client.cjs +60 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +3 -3
- package/dist/git/client.cjs +60 -2
- package/dist/git/client.cjs.map +1 -1
- package/dist/git/client.js +1 -1
- package/dist/git/index.cjs +60 -2
- package/dist/git/index.cjs.map +1 -1
- package/dist/git/index.js +1 -1
- package/dist/git/types.cjs.map +1 -1
- package/dist/index.cjs +60 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/modelrouter/core.cjs +74 -2
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +5 -3
- package/dist/modelrouter/index.cjs +74 -2
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +5 -3
- package/dist/modelrouter/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +5 -5
- package/dist/tools/warp_grep/anthropic.js +6 -6
- package/dist/tools/warp_grep/index.js +8 -8
- package/dist/tools/warp_grep/openai.js +6 -6
- package/dist/tools/warp_grep/vercel.js +6 -6
- package/package.json +1 -1
- package/dist/anthropic-DpEAqqZF.d.ts +0 -88
- package/dist/chunk-AKVAAKRB.js.map +0 -1
- package/dist/chunk-TBVDBQZ2.js.map +0 -1
- package/dist/client.d.ts +0 -114
- package/dist/git/client.d.ts +0 -261
- package/dist/git/config.d.ts +0 -11
- package/dist/git/index.d.ts +0 -5
- package/dist/git/types.d.ts +0 -102
- package/dist/index.d.ts +0 -14
- package/dist/modelrouter/core.d.ts +0 -56
- package/dist/modelrouter/index.d.ts +0 -2
- package/dist/modelrouter/types.d.ts +0 -35
- package/dist/openai-BkKsS30n.d.ts +0 -111
- package/dist/tools/browser/anthropic.d.ts +0 -51
- package/dist/tools/browser/core.d.ts +0 -203
- package/dist/tools/browser/index.d.ts +0 -72
- package/dist/tools/browser/openai.d.ts +0 -73
- package/dist/tools/browser/prompts.d.ts +0 -7
- package/dist/tools/browser/types.d.ts +0 -255
- package/dist/tools/browser/vercel.d.ts +0 -69
- package/dist/tools/codebase_search/anthropic.d.ts +0 -40
- package/dist/tools/codebase_search/core.d.ts +0 -40
- package/dist/tools/codebase_search/index.d.ts +0 -10
- package/dist/tools/codebase_search/openai.d.ts +0 -87
- package/dist/tools/codebase_search/prompts.d.ts +0 -7
- package/dist/tools/codebase_search/types.d.ts +0 -50
- package/dist/tools/codebase_search/vercel.d.ts +0 -65
- package/dist/tools/fastapply/anthropic.d.ts +0 -4
- package/dist/tools/fastapply/core.d.ts +0 -41
- package/dist/tools/fastapply/index.d.ts +0 -10
- package/dist/tools/fastapply/openai.d.ts +0 -4
- package/dist/tools/fastapply/prompts.d.ts +0 -7
- package/dist/tools/fastapply/types.d.ts +0 -77
- package/dist/tools/fastapply/vercel.d.ts +0 -4
- package/dist/tools/index.d.ts +0 -10
- package/dist/tools/utils/resilience.d.ts +0 -58
- package/dist/tools/warp_grep/agent/config.d.ts +0 -8
- package/dist/tools/warp_grep/agent/formatter.d.ts +0 -14
- package/dist/tools/warp_grep/agent/grep_helpers.d.ts +0 -16
- package/dist/tools/warp_grep/agent/parser.d.ts +0 -16
- package/dist/tools/warp_grep/agent/prompt.d.ts +0 -4
- package/dist/tools/warp_grep/agent/runner.d.ts +0 -10
- package/dist/tools/warp_grep/agent/types.d.ts +0 -44
- package/dist/tools/warp_grep/anthropic.d.ts +0 -14
- package/dist/tools/warp_grep/index.d.ts +0 -11
- package/dist/tools/warp_grep/openai.d.ts +0 -33
- package/dist/tools/warp_grep/providers/command.d.ts +0 -48
- package/dist/tools/warp_grep/providers/local.d.ts +0 -30
- package/dist/tools/warp_grep/providers/types.d.ts +0 -49
- package/dist/tools/warp_grep/tools/analyse.d.ts +0 -10
- package/dist/tools/warp_grep/tools/finish.d.ts +0 -10
- package/dist/tools/warp_grep/tools/grep.d.ts +0 -8
- package/dist/tools/warp_grep/tools/read.d.ts +0 -9
- package/dist/tools/warp_grep/utils/files.d.ts +0 -3
- package/dist/tools/warp_grep/utils/format.d.ts +0 -4
- package/dist/tools/warp_grep/utils/paths.d.ts +0 -7
- package/dist/tools/warp_grep/utils/ripgrep.d.ts +0 -11
- package/dist/tools/warp_grep/vercel.d.ts +0 -33
- package/dist/vercel-B1GZ_g9N.d.ts +0 -69
- /package/dist/{chunk-LN4CTQZG.js.map → chunk-7MCSSJJA.js.map} +0 -0
- /package/dist/{chunk-DJSQUQGY.js.map → chunk-DIWNR3UP.js.map} +0 -0
- /package/dist/{chunk-W5CHJ6OX.js.map → chunk-JSZQVUSE.js.map} +0 -0
- /package/dist/{chunk-YSBSDU75.js.map → chunk-LUI7APXX.js.map} +0 -0
- /package/dist/{chunk-EAA7D24N.js.map → chunk-N5654KQR.js.map} +0 -0
package/dist/client.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { RetryConfig } from './tools/utils/resilience.js';
|
|
2
|
-
import { FastApplyClient } from './tools/fastapply/core.js';
|
|
3
|
-
import { CodebaseSearchClient } from './tools/codebase_search/core.js';
|
|
4
|
-
import { BrowserClient } from './tools/browser/core.js';
|
|
5
|
-
import { MorphGit } from './git/client.js';
|
|
6
|
-
import { OpenAIRouter, AnthropicRouter, GeminiRouter } from './modelrouter/core.js';
|
|
7
|
-
import './git/types.js';
|
|
8
|
-
import './tools/fastapply/types.js';
|
|
9
|
-
import './tools/codebase_search/types.js';
|
|
10
|
-
import './tools/browser/types.js';
|
|
11
|
-
import './modelrouter/types.js';
|
|
12
|
-
import 'isomorphic-git';
|
|
13
|
-
import 'isomorphic-git/http/node';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Unified Morph SDK Client
|
|
17
|
-
*
|
|
18
|
-
* Provides access to all Morph tools through a single interface
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* import { MorphClient } from '@cuda_oom/morphsdk';
|
|
23
|
-
*
|
|
24
|
-
* const morph = new MorphClient({
|
|
25
|
-
* apiKey: process.env.MORPH_API_KEY,
|
|
26
|
-
* debug: true,
|
|
27
|
-
* timeout: 60000
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* // Use FastApply
|
|
31
|
-
* const editResult = await morph.fastApply.execute({
|
|
32
|
-
* target_filepath: 'src/index.ts',
|
|
33
|
-
* instructions: 'Add error handling',
|
|
34
|
-
* code_edit: 'try { ... } catch (e) { ... }'
|
|
35
|
-
* });
|
|
36
|
-
*
|
|
37
|
-
* // Use CodebaseSearch
|
|
38
|
-
* const searchResult = await morph.codebaseSearch.search({
|
|
39
|
-
* query: 'authentication logic',
|
|
40
|
-
* repoId: 'my-project'
|
|
41
|
-
* });
|
|
42
|
-
*
|
|
43
|
-
* // Use Browser automation
|
|
44
|
-
* const browserResult = await morph.browser.execute({
|
|
45
|
-
* task: 'Test the checkout flow',
|
|
46
|
-
* url: 'https://example.com'
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* // Use Model Router
|
|
50
|
-
* const { model } = await morph.routers.openai.selectModel({
|
|
51
|
-
* input: 'Complex refactoring task',
|
|
52
|
-
* mode: 'balanced'
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Configuration for the MorphClient
|
|
59
|
-
*/
|
|
60
|
-
interface MorphClientConfig {
|
|
61
|
-
/** Morph API key for authentication (defaults to MORPH_API_KEY env var) */
|
|
62
|
-
apiKey?: string;
|
|
63
|
-
/** Enable debug logging across all tools */
|
|
64
|
-
debug?: boolean;
|
|
65
|
-
/** Default timeout in milliseconds for API requests */
|
|
66
|
-
timeout?: number;
|
|
67
|
-
/** Retry configuration for failed requests */
|
|
68
|
-
retryConfig?: RetryConfig;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Unified Morph SDK Client
|
|
72
|
-
*
|
|
73
|
-
* Provides access to all Morph tools through a single interface:
|
|
74
|
-
* - fastApply: AI-powered file editing with intelligent merging
|
|
75
|
-
* - codebaseSearch: Semantic code search
|
|
76
|
-
* - browser: AI-powered browser automation
|
|
77
|
-
* - git: Version control operations
|
|
78
|
-
* - routers: Intelligent model selection (OpenAI, Anthropic, Gemini)
|
|
79
|
-
*/
|
|
80
|
-
declare class MorphClient {
|
|
81
|
-
/** Client configuration */
|
|
82
|
-
config: MorphClientConfig;
|
|
83
|
-
/** FastApply tool for editing files with AI-powered merge */
|
|
84
|
-
fastApply: FastApplyClient;
|
|
85
|
-
/** CodebaseSearch tool for semantic code search */
|
|
86
|
-
codebaseSearch: CodebaseSearchClient;
|
|
87
|
-
/** Browser tool for AI-powered browser automation */
|
|
88
|
-
browser: BrowserClient;
|
|
89
|
-
/** Git tool for version control operations */
|
|
90
|
-
git: MorphGit;
|
|
91
|
-
/** Model routers for intelligent model selection */
|
|
92
|
-
routers: {
|
|
93
|
-
openai: OpenAIRouter;
|
|
94
|
-
anthropic: AnthropicRouter;
|
|
95
|
-
gemini: GeminiRouter;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Create a new Morph SDK client
|
|
99
|
-
*
|
|
100
|
-
* @param config - Client configuration (apiKey, debug, timeout, retryConfig)
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* const morph = new MorphClient({
|
|
105
|
-
* apiKey: process.env.MORPH_API_KEY,
|
|
106
|
-
* debug: true,
|
|
107
|
-
* timeout: 60000
|
|
108
|
-
* });
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
constructor(config?: MorphClientConfig);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export { MorphClient, type MorphClientConfig };
|
package/dist/git/client.d.ts
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { MorphGitConfig, CloneOptions, PushOptions, PullOptions, AddOptions, CommitOptions, StatusOptions, LogOptions, CommitObject, CheckoutOptions, BranchOptions, StatusResult, CommitMetadata } from './types.js';
|
|
2
|
-
import 'isomorphic-git';
|
|
3
|
-
import 'isomorphic-git/http/node';
|
|
4
|
-
import '../tools/utils/resilience.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Morph Git Client - Simple, high-level Git operations
|
|
8
|
-
* Built on isomorphic-git with explicit configuration
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* MorphGit - Git operations for AI agents with Morph backend
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* import { MorphGit } from 'morphsdk/git';
|
|
17
|
-
*
|
|
18
|
-
* const morphGit = new MorphGit({
|
|
19
|
-
* apiKey: process.env.MORPH_API_KEY!,
|
|
20
|
-
* proxyUrl: 'https://repos.morphllm.com' // Optional
|
|
21
|
-
* });
|
|
22
|
-
*
|
|
23
|
-
* await morphGit.init({ repoId: 'my-project', dir: './my-project' });
|
|
24
|
-
* await morphGit.push({ dir: './my-project' });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
declare class MorphGit {
|
|
28
|
-
private readonly apiKey;
|
|
29
|
-
private readonly proxyUrl;
|
|
30
|
-
constructor(config: MorphGitConfig);
|
|
31
|
-
/**
|
|
32
|
-
* Get auth callback for isomorphic-git operations
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
private getAuthCallback;
|
|
36
|
-
/**
|
|
37
|
-
* Initialize a new repository
|
|
38
|
-
* Creates the repo in the database and in the git provider
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* await morphGit.init({
|
|
43
|
-
* repoId: 'my-project',
|
|
44
|
-
* dir: './my-project',
|
|
45
|
-
* defaultBranch: 'main'
|
|
46
|
-
* });
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
init(options: {
|
|
50
|
-
repoId: string;
|
|
51
|
-
dir: string;
|
|
52
|
-
defaultBranch?: string;
|
|
53
|
-
}): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Clone a repository from Morph repos
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* await morphGit.clone({
|
|
60
|
-
* repoId: 'my-project',
|
|
61
|
-
* dir: './my-project'
|
|
62
|
-
* });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
clone(options: CloneOptions): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Push changes to remote repository
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```ts
|
|
71
|
-
* await morphGit.push({
|
|
72
|
-
* dir: './my-project',
|
|
73
|
-
* branch: 'main' // Required: explicit branch name
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
push(options: PushOptions): Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* Pull changes from remote repository
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```ts
|
|
83
|
-
* await morphGit.pull({
|
|
84
|
-
* dir: './my-project',
|
|
85
|
-
* branch: 'main' // Required: explicit branch name
|
|
86
|
-
* });
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
pull(options: PullOptions): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Stage a file for commit
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* ```ts
|
|
95
|
-
* await morphGit.add({
|
|
96
|
-
* dir: './my-project',
|
|
97
|
-
* filepath: 'src/app.ts'
|
|
98
|
-
* });
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
add(options: AddOptions): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Remove a file from staging
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```ts
|
|
107
|
-
* await morphGit.remove({
|
|
108
|
-
* dir: './my-project',
|
|
109
|
-
* filepath: 'src/old-file.ts'
|
|
110
|
-
* });
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
remove(options: AddOptions): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Commit staged changes
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```ts
|
|
119
|
-
* await morphGit.commit({
|
|
120
|
-
* dir: './my-project',
|
|
121
|
-
* message: 'Add new feature',
|
|
122
|
-
* author: {
|
|
123
|
-
* name: 'AI Agent',
|
|
124
|
-
* email: 'ai@example.com'
|
|
125
|
-
* },
|
|
126
|
-
* chatHistory: [
|
|
127
|
-
* { role: 'user', content: 'Please add a new feature' },
|
|
128
|
-
* { role: 'assistant', content: 'I will add that feature' }
|
|
129
|
-
* ],
|
|
130
|
-
* recordingId: 'rec_123'
|
|
131
|
-
* });
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
commit(options: CommitOptions): Promise<string>;
|
|
135
|
-
/**
|
|
136
|
-
* Get status of a file
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* ```ts
|
|
140
|
-
* const status = await morphGit.status({
|
|
141
|
-
* dir: './my-project',
|
|
142
|
-
* filepath: 'src/app.ts'
|
|
143
|
-
* });
|
|
144
|
-
* console.log(status); // 'modified', '*added', etc.
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
status(options: StatusOptions): Promise<string>;
|
|
148
|
-
/**
|
|
149
|
-
* Get commit history
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```ts
|
|
153
|
-
* const commits = await morphGit.log({
|
|
154
|
-
* dir: './my-project',
|
|
155
|
-
* depth: 10
|
|
156
|
-
* });
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
log(options: LogOptions): Promise<CommitObject[]>;
|
|
160
|
-
/**
|
|
161
|
-
* Checkout a branch or commit
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```ts
|
|
165
|
-
* await morphGit.checkout({
|
|
166
|
-
* dir: './my-project',
|
|
167
|
-
* ref: 'feature-branch'
|
|
168
|
-
* });
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
checkout(options: CheckoutOptions): Promise<void>;
|
|
172
|
-
/**
|
|
173
|
-
* Create a new branch
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```ts
|
|
177
|
-
* await morphGit.branch({
|
|
178
|
-
* dir: './my-project',
|
|
179
|
-
* name: 'feature-branch',
|
|
180
|
-
* checkout: true
|
|
181
|
-
* });
|
|
182
|
-
* ```
|
|
183
|
-
*/
|
|
184
|
-
branch(options: BranchOptions): Promise<void>;
|
|
185
|
-
/**
|
|
186
|
-
* List all branches
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* ```ts
|
|
190
|
-
* const branches = await morphGit.listBranches({
|
|
191
|
-
* dir: './my-project'
|
|
192
|
-
* });
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
listBranches(options: {
|
|
196
|
-
dir: string;
|
|
197
|
-
}): Promise<string[]>;
|
|
198
|
-
/**
|
|
199
|
-
* Get the current branch name
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```ts
|
|
203
|
-
* const branch = await morphGit.currentBranch({
|
|
204
|
-
* dir: './my-project'
|
|
205
|
-
* });
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
currentBranch(options: {
|
|
209
|
-
dir: string;
|
|
210
|
-
}): Promise<string | undefined>;
|
|
211
|
-
/**
|
|
212
|
-
* Get list of changed files (similar to git diff --name-only)
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* ```ts
|
|
216
|
-
* const changes = await morphGit.statusMatrix({
|
|
217
|
-
* dir: './my-project'
|
|
218
|
-
* });
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
statusMatrix(options: {
|
|
222
|
-
dir: string;
|
|
223
|
-
}): Promise<StatusResult[]>;
|
|
224
|
-
/**
|
|
225
|
-
* Get the current commit hash
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```ts
|
|
229
|
-
* const hash = await morphGit.resolveRef({
|
|
230
|
-
* dir: './my-project',
|
|
231
|
-
* ref: 'HEAD'
|
|
232
|
-
* });
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
resolveRef(options: {
|
|
236
|
-
dir: string;
|
|
237
|
-
ref: string;
|
|
238
|
-
}): Promise<string>;
|
|
239
|
-
/**
|
|
240
|
-
* Get metadata (chat history, recording ID) attached to a commit
|
|
241
|
-
*
|
|
242
|
-
* @example
|
|
243
|
-
* ```ts
|
|
244
|
-
* const metadata = await morphGit.getCommitMetadata({
|
|
245
|
-
* dir: './my-project',
|
|
246
|
-
* commitSha: 'abc123...'
|
|
247
|
-
* });
|
|
248
|
-
*
|
|
249
|
-
* if (metadata) {
|
|
250
|
-
* console.log('Chat history:', metadata.chatHistory);
|
|
251
|
-
* console.log('Recording ID:', metadata.recordingId);
|
|
252
|
-
* }
|
|
253
|
-
* ```
|
|
254
|
-
*/
|
|
255
|
-
getCommitMetadata(options: {
|
|
256
|
-
dir: string;
|
|
257
|
-
commitSha: string;
|
|
258
|
-
}): Promise<CommitMetadata | null>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export { MorphGit };
|
package/dist/git/config.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration constants for Morph Git SDK
|
|
3
|
-
*/
|
|
4
|
-
/** Default proxy URL for Morph git operations */
|
|
5
|
-
declare const DEFAULT_PROXY_URL = "https://repos.morphllm.com";
|
|
6
|
-
/**
|
|
7
|
-
* Validate API key format
|
|
8
|
-
*/
|
|
9
|
-
declare function validateApiKey(apiKey: string): void;
|
|
10
|
-
|
|
11
|
-
export { DEFAULT_PROXY_URL, validateApiKey };
|
package/dist/git/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { MorphGit } from './client.js';
|
|
2
|
-
export { AddOptions, BranchOptions, ChatMessage, CheckoutOptions, CloneOptions, CommitMetadata, CommitObject, CommitOptions, DiffOptions, LogOptions, MorphGitConfig, PullOptions, PushOptions, StatusOptions, StatusResult } from './types.js';
|
|
3
|
-
export { default as git } from 'isomorphic-git';
|
|
4
|
-
export { default as http } from 'isomorphic-git/http/node';
|
|
5
|
-
import '../tools/utils/resilience.js';
|
package/dist/git/types.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { RetryConfig } from '../tools/utils/resilience.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Types for Morph Git SDK
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
interface MorphGitConfig {
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
proxyUrl?: string;
|
|
10
|
-
/** Retry configuration for API calls */
|
|
11
|
-
retryConfig?: RetryConfig;
|
|
12
|
-
}
|
|
13
|
-
interface CloneOptions {
|
|
14
|
-
repoId: string;
|
|
15
|
-
dir: string;
|
|
16
|
-
branch?: string;
|
|
17
|
-
depth?: number;
|
|
18
|
-
singleBranch?: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface PushOptions {
|
|
21
|
-
dir: string;
|
|
22
|
-
remote?: string;
|
|
23
|
-
branch: string;
|
|
24
|
-
}
|
|
25
|
-
interface PullOptions {
|
|
26
|
-
dir: string;
|
|
27
|
-
remote?: string;
|
|
28
|
-
branch: string;
|
|
29
|
-
}
|
|
30
|
-
interface AddOptions {
|
|
31
|
-
dir: string;
|
|
32
|
-
filepath: string;
|
|
33
|
-
}
|
|
34
|
-
interface ChatMessage {
|
|
35
|
-
role: string;
|
|
36
|
-
content: string;
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
}
|
|
39
|
-
interface CommitMetadata {
|
|
40
|
-
chatHistory?: ChatMessage[];
|
|
41
|
-
recordingId?: string;
|
|
42
|
-
}
|
|
43
|
-
interface CommitOptions {
|
|
44
|
-
dir: string;
|
|
45
|
-
message: string;
|
|
46
|
-
author?: {
|
|
47
|
-
name: string | "Morph AI Agent";
|
|
48
|
-
email: string | "ai@morphllm.com";
|
|
49
|
-
};
|
|
50
|
-
chatHistory?: ChatMessage[];
|
|
51
|
-
recordingId?: string;
|
|
52
|
-
}
|
|
53
|
-
interface StatusOptions {
|
|
54
|
-
dir: string;
|
|
55
|
-
filepath?: string;
|
|
56
|
-
}
|
|
57
|
-
interface LogOptions {
|
|
58
|
-
dir: string;
|
|
59
|
-
depth?: number;
|
|
60
|
-
ref?: string;
|
|
61
|
-
}
|
|
62
|
-
interface CheckoutOptions {
|
|
63
|
-
dir: string;
|
|
64
|
-
ref: string;
|
|
65
|
-
}
|
|
66
|
-
interface BranchOptions {
|
|
67
|
-
dir: string;
|
|
68
|
-
name: string;
|
|
69
|
-
checkout?: boolean;
|
|
70
|
-
}
|
|
71
|
-
interface DiffOptions {
|
|
72
|
-
dir: string;
|
|
73
|
-
ref1?: string;
|
|
74
|
-
ref2?: string;
|
|
75
|
-
filepath?: string;
|
|
76
|
-
}
|
|
77
|
-
interface GitUser {
|
|
78
|
-
name: string;
|
|
79
|
-
email: string;
|
|
80
|
-
}
|
|
81
|
-
interface CommitObject {
|
|
82
|
-
oid: string;
|
|
83
|
-
commit: {
|
|
84
|
-
message: string;
|
|
85
|
-
author: {
|
|
86
|
-
name: string | "Morph AI Agent";
|
|
87
|
-
email: string | "ai@morphllm.com";
|
|
88
|
-
timestamp: number;
|
|
89
|
-
};
|
|
90
|
-
committer: {
|
|
91
|
-
name: string | "Morph AI Agent";
|
|
92
|
-
email: string | "ai@morphllm.com";
|
|
93
|
-
timestamp: number;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
interface StatusResult {
|
|
98
|
-
filepath: string;
|
|
99
|
-
status: 'unmodified' | 'modified' | '*modified' | 'added' | '*added' | 'deleted' | '*deleted' | 'absent';
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type { AddOptions, BranchOptions, ChatMessage, CheckoutOptions, CloneOptions, CommitMetadata, CommitObject, CommitOptions, DiffOptions, GitUser, LogOptions, MorphGitConfig, PullOptions, PushOptions, StatusOptions, StatusResult };
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { MorphClient, MorphClientConfig } from './client.js';
|
|
2
|
-
export { FastApplyClient } from './tools/fastapply/core.js';
|
|
3
|
-
export { CodebaseSearchClient } from './tools/codebase_search/core.js';
|
|
4
|
-
export { BrowserClient } from './tools/browser/core.js';
|
|
5
|
-
export { MorphGit } from './git/client.js';
|
|
6
|
-
export { MorphGitConfig } from './git/types.js';
|
|
7
|
-
export { AnthropicRouter, GeminiRouter, OpenAIRouter } from './modelrouter/core.js';
|
|
8
|
-
export { EditFileConfig, EditFileInput, EditFileResult } from './tools/fastapply/types.js';
|
|
9
|
-
export { CodebaseSearchConfig, CodebaseSearchInput, CodebaseSearchResult } from './tools/codebase_search/types.js';
|
|
10
|
-
export { BrowserConfig, BrowserError, BrowserTaskInput, BrowserTaskInputWithSchema, BrowserTaskResult, BrowserTaskWithPromise, BrowserTaskWithPromiseAndSchema, ErrorsResponse, RecordingStatus } from './tools/browser/types.js';
|
|
11
|
-
export { ComplexityLevel, Provider, RouterConfig, RouterInput, RouterMode, RouterResult } from './modelrouter/types.js';
|
|
12
|
-
export { RetryConfig } from './tools/utils/resilience.js';
|
|
13
|
-
import 'isomorphic-git';
|
|
14
|
-
import 'isomorphic-git/http/node';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { RouterConfig, Provider, RouterInput, RouterResult } from './types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Core implementation for intelligent model routing
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
declare abstract class BaseRouter {
|
|
8
|
-
protected config: Required<Omit<RouterConfig, 'apiKey' | 'retryConfig'>> & Pick<RouterConfig, 'apiKey' | 'retryConfig'>;
|
|
9
|
-
protected provider: Provider;
|
|
10
|
-
constructor(provider: Provider, config?: RouterConfig);
|
|
11
|
-
/**
|
|
12
|
-
* Select the optimal model for a given input and mode
|
|
13
|
-
*/
|
|
14
|
-
selectModel(input: RouterInput): Promise<RouterResult>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* OpenAI model router for GPT-5 series
|
|
18
|
-
*/
|
|
19
|
-
declare class OpenAIRouter extends BaseRouter {
|
|
20
|
-
constructor(config?: RouterConfig);
|
|
21
|
-
/**
|
|
22
|
-
* Select optimal GPT-5 model
|
|
23
|
-
*
|
|
24
|
-
* @param input - User input and mode
|
|
25
|
-
* @returns Selected model name (gpt-5-mini | gpt-5-low | gpt-5-medium | gpt-5-high)
|
|
26
|
-
*/
|
|
27
|
-
selectModel(input: RouterInput): Promise<RouterResult>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Anthropic model router for Claude 4.5 series
|
|
31
|
-
*/
|
|
32
|
-
declare class AnthropicRouter extends BaseRouter {
|
|
33
|
-
constructor(config?: RouterConfig);
|
|
34
|
-
/**
|
|
35
|
-
* Select optimal Claude model
|
|
36
|
-
*
|
|
37
|
-
* @param input - User input and mode
|
|
38
|
-
* @returns Selected model name (claude-4.5-haiku | claude-4.5-sonnet)
|
|
39
|
-
*/
|
|
40
|
-
selectModel(input: RouterInput): Promise<RouterResult>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Google Gemini model router
|
|
44
|
-
*/
|
|
45
|
-
declare class GeminiRouter extends BaseRouter {
|
|
46
|
-
constructor(config?: RouterConfig);
|
|
47
|
-
/**
|
|
48
|
-
* Select optimal Gemini model
|
|
49
|
-
*
|
|
50
|
-
* @param input - User input and mode
|
|
51
|
-
* @returns Selected model name (gemini-2.5-flash | gemini-2.5-pro)
|
|
52
|
-
*/
|
|
53
|
-
selectModel(input: RouterInput): Promise<RouterResult>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { AnthropicRouter, GeminiRouter, OpenAIRouter };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model router types for intelligent model selection
|
|
3
|
-
*/
|
|
4
|
-
type ComplexityLevel = 'easy' | 'medium' | 'hard' | 'needs-info';
|
|
5
|
-
type RouterMode = 'balanced' | 'aggressive';
|
|
6
|
-
type Provider = 'openai' | 'anthropic' | 'gemini';
|
|
7
|
-
interface RouterConfig {
|
|
8
|
-
/** Morph API key (defaults to MORPH_API_KEY env var) */
|
|
9
|
-
apiKey?: string;
|
|
10
|
-
/** Router API URL (defaults to https://api.morphllm.com) */
|
|
11
|
-
apiUrl?: string;
|
|
12
|
-
/** Request timeout in milliseconds (default: 10000) */
|
|
13
|
-
timeout?: number;
|
|
14
|
-
/** Enable debug logging */
|
|
15
|
-
debug?: boolean;
|
|
16
|
-
/** Retry configuration */
|
|
17
|
-
retryConfig?: {
|
|
18
|
-
maxRetries?: number;
|
|
19
|
-
initialDelay?: number;
|
|
20
|
-
maxDelay?: number;
|
|
21
|
-
backoffMultiplier?: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
interface RouterInput {
|
|
25
|
-
/** User input or task description */
|
|
26
|
-
input: string;
|
|
27
|
-
/** Routing mode: balanced (cheaper models) or aggressive (more capable models) */
|
|
28
|
-
mode?: RouterMode;
|
|
29
|
-
}
|
|
30
|
-
interface RouterResult {
|
|
31
|
-
/** Selected model name */
|
|
32
|
-
model: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type { ComplexityLevel, Provider, RouterConfig, RouterInput, RouterMode, RouterResult };
|