@morphllm/morphsdk 0.2.81 → 0.2.82
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-NTTQJM6O.js → chunk-24EYSWME.js} +2 -2
- package/dist/{chunk-OFMDENAQ.js → chunk-3ONNAQZU.js} +2 -2
- package/dist/{chunk-4NI25AKV.js → chunk-4KMBU6T3.js} +2 -2
- package/dist/{chunk-XT5ZO6ES.js → chunk-5PNMAWLC.js} +8 -2
- package/dist/chunk-5PNMAWLC.js.map +1 -0
- package/dist/{chunk-X6A64F2F.js → chunk-EK5ZEOI3.js} +5 -5
- package/dist/{chunk-4VMIPD4G.js → chunk-FJKPMMNQ.js} +8 -6
- package/dist/chunk-FJKPMMNQ.js.map +1 -0
- package/dist/{chunk-467MCW5R.js → chunk-P2O5JKE5.js} +2 -2
- package/dist/{chunk-PHJQ4N3T.js → chunk-PUGSTXLO.js} +2 -2
- package/dist/{chunk-B3UC7UVA.js → chunk-WIAYUEJK.js} +7 -5
- package/dist/chunk-WIAYUEJK.js.map +1 -0
- package/dist/{chunk-Z2HDXUH7.js → chunk-ZLJAODDJ.js} +2 -2
- package/dist/{client-CSINf0lQ.d.ts → client-CsO9LifG.d.ts} +1 -1
- package/dist/client.cjs +15 -5
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +10 -10
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/dist/tools/warp_grep/agent/config.cjs +7 -1
- package/dist/tools/warp_grep/agent/config.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/config.d.ts +1 -0
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs +11 -3
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +3 -3
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +2 -0
- package/dist/tools/warp_grep/anthropic.cjs +13 -4
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +1 -1
- package/dist/tools/warp_grep/anthropic.js +7 -7
- package/dist/tools/warp_grep/client.cjs +15 -5
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.d.ts +1 -1
- package/dist/tools/warp_grep/client.js +6 -6
- package/dist/tools/warp_grep/gemini.cjs +13 -4
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +1 -1
- package/dist/tools/warp_grep/gemini.js +6 -6
- package/dist/tools/warp_grep/harness.cjs +7 -1
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +3 -3
- package/dist/tools/warp_grep/index.cjs +15 -5
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +1 -1
- package/dist/tools/warp_grep/index.js +6 -6
- package/dist/tools/warp_grep/openai.cjs +13 -4
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +1 -1
- package/dist/tools/warp_grep/openai.js +7 -7
- package/dist/tools/warp_grep/providers/local.cjs +7 -1
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/providers/remote.cjs +7 -1
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.d.ts +1 -1
- package/dist/tools/warp_grep/providers/remote.js +2 -2
- package/dist/tools/warp_grep/vercel.cjs +13 -4
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.js +7 -7
- package/dist/{types-CnvVDM63.d.ts → types-Cv4LpqVl.d.ts} +2 -0
- package/package.json +1 -1
- package/dist/chunk-4VMIPD4G.js.map +0 -1
- package/dist/chunk-B3UC7UVA.js.map +0 -1
- package/dist/chunk-XT5ZO6ES.js.map +0 -1
- /package/dist/{chunk-NTTQJM6O.js.map → chunk-24EYSWME.js.map} +0 -0
- /package/dist/{chunk-OFMDENAQ.js.map → chunk-3ONNAQZU.js.map} +0 -0
- /package/dist/{chunk-4NI25AKV.js.map → chunk-4KMBU6T3.js.map} +0 -0
- /package/dist/{chunk-X6A64F2F.js.map → chunk-EK5ZEOI3.js.map} +0 -0
- /package/dist/{chunk-467MCW5R.js.map → chunk-P2O5JKE5.js.map} +0 -0
- /package/dist/{chunk-PHJQ4N3T.js.map → chunk-PUGSTXLO.js.map} +0 -0
- /package/dist/{chunk-Z2HDXUH7.js.map → chunk-ZLJAODDJ.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tool } from '@anthropic-ai/sdk/resources/messages';
|
|
2
2
|
export { formatResult } from './client.js';
|
|
3
3
|
export { getSystemPrompt } from './agent/prompt.js';
|
|
4
|
-
import { d as WarpGrepToolConfig, b as WarpGrepResult } from '../../types-
|
|
4
|
+
import { d as WarpGrepToolConfig, b as WarpGrepResult } from '../../types-Cv4LpqVl.js';
|
|
5
5
|
import './providers/types.js';
|
|
6
6
|
import '../utils/resilience.js';
|
|
7
7
|
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
createWarpGrepTool,
|
|
3
3
|
execute,
|
|
4
4
|
warpGrepTool
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-ZLJAODDJ.js";
|
|
6
6
|
import "../../chunk-KW7OEGZK.js";
|
|
7
7
|
import {
|
|
8
8
|
formatResult
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-FJKPMMNQ.js";
|
|
10
|
+
import "../../chunk-WIAYUEJK.js";
|
|
11
|
+
import "../../chunk-PUGSTXLO.js";
|
|
12
|
+
import "../../chunk-P2O5JKE5.js";
|
|
13
13
|
import "../../chunk-APP75CBN.js";
|
|
14
14
|
import "../../chunk-5QRN3JNB.js";
|
|
15
15
|
import {
|
|
16
16
|
getSystemPrompt
|
|
17
17
|
} from "../../chunk-FMLHRJDF.js";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-4KMBU6T3.js";
|
|
19
19
|
import "../../chunk-G2RSY56Q.js";
|
|
20
20
|
import "../../chunk-YPKNMYD4.js";
|
|
21
21
|
import "../../chunk-TPP2UGQP.js";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-5PNMAWLC.js";
|
|
23
23
|
import "../../chunk-4VWJFZVS.js";
|
|
24
24
|
import "../../chunk-PZ5AY32C.js";
|
|
25
25
|
export {
|
|
@@ -38,9 +38,15 @@ __export(client_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(client_exports);
|
|
39
39
|
|
|
40
40
|
// tools/warp_grep/agent/config.ts
|
|
41
|
+
var parseEnvTimeout = (envValue, defaultMs) => {
|
|
42
|
+
if (!envValue) return defaultMs;
|
|
43
|
+
const parsed = parseInt(envValue, 10);
|
|
44
|
+
return isNaN(parsed) || parsed <= 0 ? defaultMs : parsed;
|
|
45
|
+
};
|
|
41
46
|
var AGENT_CONFIG = {
|
|
42
47
|
MAX_TURNS: 4,
|
|
43
|
-
|
|
48
|
+
/** Default timeout for model calls. Can be overridden via MORPH_WARP_GREP_TIMEOUT env var (in ms) */
|
|
49
|
+
TIMEOUT_MS: parseEnvTimeout(process.env.MORPH_WARP_GREP_TIMEOUT, 3e4),
|
|
44
50
|
MAX_CONTEXT_CHARS: 54e4,
|
|
45
51
|
MAX_OUTPUT_LINES: 200,
|
|
46
52
|
MAX_READ_LINES: 800,
|
|
@@ -982,7 +988,8 @@ async function callModel(messages, model, options = {}) {
|
|
|
982
988
|
},
|
|
983
989
|
options.retryConfig
|
|
984
990
|
);
|
|
985
|
-
const
|
|
991
|
+
const timeoutMs = options.timeout ?? AGENT_CONFIG.TIMEOUT_MS;
|
|
992
|
+
const resp = await withTimeout(fetchPromise, timeoutMs, "morph-warp-grep request timed out");
|
|
986
993
|
if (!resp.ok) {
|
|
987
994
|
if (resp.status === 404) {
|
|
988
995
|
throw new Error(
|
|
@@ -1016,7 +1023,8 @@ async function runWarpGrep(config) {
|
|
|
1016
1023
|
const assistantContent = await callModel(messages, model, {
|
|
1017
1024
|
morphApiKey: config.morphApiKey,
|
|
1018
1025
|
morphApiUrl: config.morphApiUrl,
|
|
1019
|
-
retryConfig: config.retryConfig
|
|
1026
|
+
retryConfig: config.retryConfig,
|
|
1027
|
+
timeout: config.timeout
|
|
1020
1028
|
}).catch((e) => {
|
|
1021
1029
|
errors.push({ message: e instanceof Error ? e.message : String(e) });
|
|
1022
1030
|
return "";
|
|
@@ -1747,7 +1755,8 @@ var WarpGrepClient = class {
|
|
|
1747
1755
|
debug: input.debug ?? this.config.debug,
|
|
1748
1756
|
morphApiKey: this.config.morphApiKey,
|
|
1749
1757
|
morphApiUrl: this.config.morphApiUrl,
|
|
1750
|
-
retryConfig: this.config.retryConfig
|
|
1758
|
+
retryConfig: this.config.retryConfig,
|
|
1759
|
+
timeout: this.config.timeout
|
|
1751
1760
|
}
|
|
1752
1761
|
);
|
|
1753
1762
|
}
|
|
@@ -1768,7 +1777,8 @@ async function executeToolCall(input, config) {
|
|
|
1768
1777
|
debug: config.debug ?? false,
|
|
1769
1778
|
morphApiKey: config.morphApiKey,
|
|
1770
1779
|
morphApiUrl: config.morphApiUrl,
|
|
1771
|
-
retryConfig: config.retryConfig
|
|
1780
|
+
retryConfig: config.retryConfig,
|
|
1781
|
+
timeout: config.timeout
|
|
1772
1782
|
});
|
|
1773
1783
|
const finish = result.finish;
|
|
1774
1784
|
if (result.terminationReason !== "completed" || !finish?.metadata) {
|