@morphllm/morphsdk 0.2.197 → 0.2.198
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-WDLDKJHT.js → chunk-3XS5P5XH.js} +2 -2
- package/dist/{chunk-2HXELZI5.js → chunk-4DNEBVGV.js} +2 -2
- package/dist/chunk-4DNEBVGV.js.map +1 -0
- package/dist/{chunk-VJD6MF3M.js → chunk-4JUIEYAH.js} +4 -4
- package/dist/{chunk-LKFZBBTD.js → chunk-5TOJD2C5.js} +1 -1
- package/dist/chunk-5TOJD2C5.js.map +1 -0
- package/dist/{chunk-2BT4UGKH.js → chunk-6XFL2NER.js} +2 -2
- package/dist/{chunk-GE5MNVT7.js → chunk-CAFREMIT.js} +2 -2
- package/dist/{chunk-WN6YLBEH.js → chunk-D2RFP6R2.js} +4 -4
- package/dist/{chunk-CZ74CRGH.js → chunk-EMURAU6J.js} +4 -6
- package/dist/chunk-EMURAU6J.js.map +1 -0
- package/dist/{chunk-UOS3XKJD.js → chunk-FESO6TDQ.js} +2 -2
- package/dist/{chunk-PQCOBN7L.js → chunk-FUYX2MNM.js} +4 -4
- package/dist/chunk-FUYX2MNM.js.map +1 -0
- package/dist/{chunk-LRHJVSSD.js → chunk-GJ42MYUU.js} +2 -2
- package/dist/{chunk-ATAKRJQZ.js → chunk-IDMKQWQG.js} +1 -36
- package/dist/chunk-IDMKQWQG.js.map +1 -0
- package/dist/{chunk-JZJY2XFQ.js → chunk-KQKLQHJF.js} +2 -2
- package/dist/{chunk-OPNTDMHH.js → chunk-LN7GNFET.js} +4 -4
- package/dist/{chunk-ZA3UJRSE.js → chunk-O5264GI4.js} +2 -2
- package/dist/{chunk-TJUZAO7T.js → chunk-PEFXG5M6.js} +2 -2
- package/dist/{chunk-W34BUTVR.js → chunk-PIIXU2H3.js} +2 -2
- package/dist/{chunk-YVKRPVOM.js → chunk-PV6EF6NG.js} +2 -2
- package/dist/{chunk-7QOGUY4A.js → chunk-QKNGVBE2.js} +4 -4
- package/dist/{chunk-JU6TCHVI.js → chunk-SKN2L5CE.js} +2 -2
- package/dist/{chunk-SVD3YRWM.js → chunk-T6TXYTKH.js} +2 -2
- package/dist/{chunk-DW6ZIVCM.js → chunk-VBZ7BG47.js} +4 -4
- package/dist/{chunk-VGCPVDFP.js → chunk-WLMPQFER.js} +2 -2
- package/dist/{chunk-WFOGTZF6.js → chunk-XH6KJJDI.js} +2 -2
- package/dist/{chunk-2XDSHAB5.js → chunk-XK3PQZW6.js} +2 -2
- package/dist/{chunk-6YZCPCAY.js → chunk-XTFRHVCW.js} +2 -2
- package/dist/{chunk-FLWBVHDC.js → chunk-YD6TNDR4.js} +5 -5
- package/dist/{chunk-4FWK3CEH.js → chunk-YHZJYCOU.js} +23 -35
- package/dist/{chunk-4FWK3CEH.js.map → chunk-YHZJYCOU.js.map} +1 -1
- package/dist/{chunk-DHGXGVHC.js → chunk-YQ2G5YLI.js} +8 -8
- package/dist/{chunk-UZA2ODNU.js → chunk-YUH3MTP3.js} +2 -2
- package/dist/{chunk-BECYWCEZ.js → chunk-ZGERT23F.js} +2 -2
- package/dist/{chunk-DNL4DMMS.js → chunk-ZQNTXHBQ.js} +2 -2
- package/dist/{chunk-EGI642TV.js → chunk-ZU5YYGBJ.js} +3 -13
- package/dist/chunk-ZU5YYGBJ.js.map +1 -0
- package/dist/{client-B3fWTCcL.d.ts → client-DCeydotn.d.ts} +0 -6
- package/dist/client.cjs +5 -246
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +1 -5
- package/dist/client.js +28 -30
- package/dist/core/client.cjs +2 -12
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +2 -2
- package/dist/core/client.js +4 -4
- package/dist/core/error.cjs +2 -12
- package/dist/core/error.cjs.map +1 -1
- package/dist/core/error.d.ts +1 -1
- package/dist/core/error.js +3 -3
- package/dist/core/index.cjs +2 -12
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +5 -5
- package/dist/core/resource.cjs.map +1 -1
- package/dist/core/resource.d.ts +1 -1
- package/dist/core/resource.js +1 -1
- package/dist/edge.cjs +2 -12
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.js +8 -8
- package/dist/index.cjs +5 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +30 -40
- package/dist/modelrouter/core.cjs +2 -12
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +6 -6
- package/dist/modelrouter/index.cjs +2 -12
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +6 -6
- package/dist/subagents/anthropic.cjs +2 -12
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.js +11 -11
- package/dist/subagents/vercel.cjs +2 -12
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.js +11 -11
- package/dist/tools/browser/anthropic.cjs +2 -12
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +8 -8
- package/dist/tools/browser/core.cjs +2 -12
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +7 -7
- package/dist/tools/browser/index.cjs +2 -12
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +10 -10
- package/dist/tools/browser/openai.cjs +2 -12
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +8 -8
- package/dist/tools/browser/profiles/core.cjs +2 -12
- package/dist/tools/browser/profiles/core.cjs.map +1 -1
- package/dist/tools/browser/profiles/core.js +3 -3
- package/dist/tools/browser/profiles/index.cjs +2 -12
- package/dist/tools/browser/profiles/index.cjs.map +1 -1
- package/dist/tools/browser/profiles/index.js +3 -3
- package/dist/tools/browser/vercel.cjs +2 -12
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +8 -8
- package/dist/tools/codebase_search/anthropic.cjs +2 -12
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +7 -7
- package/dist/tools/codebase_search/core.cjs +2 -12
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.js +6 -6
- package/dist/tools/codebase_search/index.cjs +2 -12
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.js +9 -9
- package/dist/tools/codebase_search/openai.cjs +2 -12
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +7 -7
- package/dist/tools/codebase_search/vercel.cjs +2 -12
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +7 -7
- package/dist/tools/compact/core.cjs +2 -12
- package/dist/tools/compact/core.cjs.map +1 -1
- package/dist/tools/compact/core.js +6 -6
- package/dist/tools/compact/index.cjs +2 -12
- package/dist/tools/compact/index.cjs.map +1 -1
- package/dist/tools/compact/index.js +7 -7
- package/dist/tools/fastapply/anthropic.cjs +2 -12
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +8 -8
- package/dist/tools/fastapply/apply.cjs +2 -12
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +2 -12
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.js +7 -7
- package/dist/tools/fastapply/index.cjs +2 -12
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.js +10 -10
- package/dist/tools/fastapply/openai.cjs +2 -12
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +8 -8
- package/dist/tools/fastapply/vercel.cjs +2 -12
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +8 -8
- package/dist/tools/index.cjs +2 -12
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +10 -10
- package/dist/tools/utils/resilience.cjs +2 -12
- package/dist/tools/utils/resilience.cjs.map +1 -1
- package/dist/tools/utils/resilience.js +2 -2
- package/dist/tools/warp_grep/agent/runner.cjs +2 -12
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +2 -2
- package/dist/tools/warp_grep/anthropic.cjs +2 -12
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +11 -11
- package/dist/tools/warp_grep/client.cjs +2 -12
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +10 -10
- package/dist/tools/warp_grep/gemini.cjs +2 -12
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +10 -10
- package/dist/tools/warp_grep/harness.js +2 -2
- package/dist/tools/warp_grep/index.cjs +2 -12
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +14 -14
- package/dist/tools/warp_grep/openai.cjs +2 -12
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +11 -11
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/vercel.cjs +2 -12
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +11 -11
- package/dist/tracing/core.cjs +2 -34
- package/dist/tracing/core.cjs.map +1 -1
- package/dist/tracing/core.d.ts +1 -2
- package/dist/tracing/core.js +2 -2
- package/dist/tracing/index.cjs +4 -42
- package/dist/tracing/index.cjs.map +1 -1
- package/dist/tracing/index.d.ts +0 -34
- package/dist/tracing/index.js +3 -10
- package/dist/tracing/interaction.cjs +0 -30
- package/dist/tracing/interaction.cjs.map +1 -1
- package/dist/tracing/interaction.js +1 -1
- package/dist/tracing/types.cjs.map +1 -1
- package/dist/tracing/types.d.ts +1 -27
- package/dist/version.cjs +2 -12
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -12
- package/dist/chunk-2HXELZI5.js.map +0 -1
- package/dist/chunk-ATAKRJQZ.js.map +0 -1
- package/dist/chunk-CZ74CRGH.js.map +0 -1
- package/dist/chunk-EGI642TV.js.map +0 -1
- package/dist/chunk-LKFZBBTD.js.map +0 -1
- package/dist/chunk-NKFAMQF2.js +0 -202
- package/dist/chunk-NKFAMQF2.js.map +0 -1
- package/dist/chunk-PQCOBN7L.js.map +0 -1
- package/dist/chunk-TCCZBGG5.js +0 -46
- package/dist/chunk-TCCZBGG5.js.map +0 -1
- package/dist/tools/reflex/core.cjs +0 -756
- package/dist/tools/reflex/core.cjs.map +0 -1
- package/dist/tools/reflex/core.d.ts +0 -59
- package/dist/tools/reflex/core.js +0 -16
- package/dist/tools/reflex/core.js.map +0 -1
- package/dist/tools/reflex/index.cjs +0 -756
- package/dist/tools/reflex/index.cjs.map +0 -1
- package/dist/tools/reflex/index.d.ts +0 -5
- package/dist/tools/reflex/index.js +0 -16
- package/dist/tools/reflex/index.js.map +0 -1
- package/dist/tools/reflex/types.cjs +0 -19
- package/dist/tools/reflex/types.cjs.map +0 -1
- package/dist/tools/reflex/types.d.ts +0 -171
- package/dist/tools/reflex/types.js +0 -1
- package/dist/tools/reflex/types.js.map +0 -1
- package/dist/tools/traces/core.cjs +0 -76
- package/dist/tools/traces/core.cjs.map +0 -1
- package/dist/tools/traces/core.d.ts +0 -24
- package/dist/tools/traces/core.js +0 -9
- package/dist/tools/traces/core.js.map +0 -1
- package/dist/tools/traces/index.cjs +0 -76
- package/dist/tools/traces/index.cjs.map +0 -1
- package/dist/tools/traces/index.d.ts +0 -5
- package/dist/tools/traces/index.js +0 -9
- package/dist/tools/traces/index.js.map +0 -1
- package/dist/tools/traces/types.cjs +0 -19
- package/dist/tools/traces/types.cjs.map +0 -1
- package/dist/tools/traces/types.d.ts +0 -56
- package/dist/tools/traces/types.js +0 -1
- package/dist/tools/traces/types.js.map +0 -1
- /package/dist/{chunk-WDLDKJHT.js.map → chunk-3XS5P5XH.js.map} +0 -0
- /package/dist/{chunk-VJD6MF3M.js.map → chunk-4JUIEYAH.js.map} +0 -0
- /package/dist/{chunk-2BT4UGKH.js.map → chunk-6XFL2NER.js.map} +0 -0
- /package/dist/{chunk-GE5MNVT7.js.map → chunk-CAFREMIT.js.map} +0 -0
- /package/dist/{chunk-WN6YLBEH.js.map → chunk-D2RFP6R2.js.map} +0 -0
- /package/dist/{chunk-UOS3XKJD.js.map → chunk-FESO6TDQ.js.map} +0 -0
- /package/dist/{chunk-LRHJVSSD.js.map → chunk-GJ42MYUU.js.map} +0 -0
- /package/dist/{chunk-JZJY2XFQ.js.map → chunk-KQKLQHJF.js.map} +0 -0
- /package/dist/{chunk-OPNTDMHH.js.map → chunk-LN7GNFET.js.map} +0 -0
- /package/dist/{chunk-ZA3UJRSE.js.map → chunk-O5264GI4.js.map} +0 -0
- /package/dist/{chunk-TJUZAO7T.js.map → chunk-PEFXG5M6.js.map} +0 -0
- /package/dist/{chunk-W34BUTVR.js.map → chunk-PIIXU2H3.js.map} +0 -0
- /package/dist/{chunk-YVKRPVOM.js.map → chunk-PV6EF6NG.js.map} +0 -0
- /package/dist/{chunk-7QOGUY4A.js.map → chunk-QKNGVBE2.js.map} +0 -0
- /package/dist/{chunk-JU6TCHVI.js.map → chunk-SKN2L5CE.js.map} +0 -0
- /package/dist/{chunk-SVD3YRWM.js.map → chunk-T6TXYTKH.js.map} +0 -0
- /package/dist/{chunk-DW6ZIVCM.js.map → chunk-VBZ7BG47.js.map} +0 -0
- /package/dist/{chunk-VGCPVDFP.js.map → chunk-WLMPQFER.js.map} +0 -0
- /package/dist/{chunk-WFOGTZF6.js.map → chunk-XH6KJJDI.js.map} +0 -0
- /package/dist/{chunk-2XDSHAB5.js.map → chunk-XK3PQZW6.js.map} +0 -0
- /package/dist/{chunk-6YZCPCAY.js.map → chunk-XTFRHVCW.js.map} +0 -0
- /package/dist/{chunk-FLWBVHDC.js.map → chunk-YD6TNDR4.js.map} +0 -0
- /package/dist/{chunk-DHGXGVHC.js.map → chunk-YQ2G5YLI.js.map} +0 -0
- /package/dist/{chunk-UZA2ODNU.js.map → chunk-YUH3MTP3.js.map} +0 -0
- /package/dist/{chunk-BECYWCEZ.js.map → chunk-ZGERT23F.js.map} +0 -0
- /package/dist/{chunk-DNL4DMMS.js.map → chunk-ZQNTXHBQ.js.map} +0 -0
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-F3NCFNUX.js";
|
|
24
24
|
import {
|
|
25
25
|
SDK_VERSION
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZU5YYGBJ.js";
|
|
27
27
|
|
|
28
28
|
// tools/warp_grep/agent/runner.ts
|
|
29
29
|
import OpenAI from "openai";
|
|
@@ -425,4 +425,4 @@ export {
|
|
|
425
425
|
runWarpGrepStreaming,
|
|
426
426
|
runWarpGrep
|
|
427
427
|
};
|
|
428
|
-
//# sourceMappingURL=chunk-
|
|
428
|
+
//# sourceMappingURL=chunk-3XS5P5XH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FESO6TDQ.js";
|
|
4
4
|
|
|
5
5
|
// core/error.ts
|
|
6
6
|
async function toMorphError(response) {
|
|
@@ -21,4 +21,4 @@ async function toMorphError(response) {
|
|
|
21
21
|
export {
|
|
22
22
|
toMorphError
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-4DNEBVGV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../core/error.ts"],"sourcesContent":["/**\n * Single error mapper for the SDK transport.\n *\n * Consolidates the per-tool error handling that used to live in every client\n * (compact, github, …) into one place, preserving the actionable\n * 401/429 messaging. Reuses the existing `MorphError` type so callers that\n * `instanceof MorphError` keep working.\n */\nimport { MorphError } from '../tools/utils/resilience.js';\n\ninterface ApiErrorBody {\n error?: { message?: string; code?: string; type?: string };\n message?: string;\n}\n\n/**\n * Turn a non-OK `Response` into a `MorphError`, extracting the API's error\n * message when present and marking 429/503 as retryable.\n */\nexport async function toMorphError(response: Response): Promise<MorphError> {\n let message = `Morph API request failed (${response.status})`;\n let code = 'api_error';\n\n try {\n const body = (await response.json()) as ApiErrorBody;\n message = body.error?.message ?? body.message ?? message;\n code = body.error?.code ?? body.error?.type ?? code;\n } catch {\n // Non-JSON body — keep the status-based default message.\n }\n\n if (response.status === 401) code = 'authentication_error';\n if (response.status === 429) code = 'rate_limit_exceeded';\n\n const retryable = response.status === 429 || response.status === 503;\n return new MorphError(message, code, response.status, retryable);\n}\n"],"mappings":";;;;;AAmBA,eAAsB,aAAa,UAAyC;AAC1E,MAAI,UAAU,6BAA6B,SAAS,MAAM;AAC1D,MAAI,OAAO;AAEX,MAAI;AACF,UAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,cAAU,KAAK,OAAO,WAAW,KAAK,WAAW;AACjD,WAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,QAAQ;AAAA,EACjD,QAAQ;AAAA,EAER;AAEA,MAAI,SAAS,WAAW,IAAK,QAAO;AACpC,MAAI,SAAS,WAAW,IAAK,QAAO;AAEpC,QAAM,YAAY,SAAS,WAAW,OAAO,SAAS,WAAW;AACjE,SAAO,IAAI,WAAW,SAAS,MAAM,SAAS,QAAQ,SAAS;AACjE;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FUYX2MNM.js";
|
|
4
4
|
import {
|
|
5
5
|
MorphError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FESO6TDQ.js";
|
|
7
7
|
import {
|
|
8
8
|
APIResource
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5TOJD2C5.js";
|
|
10
10
|
|
|
11
11
|
// tools/compact/core.ts
|
|
12
12
|
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
@@ -75,4 +75,4 @@ var CompactClient = class extends APIResource {
|
|
|
75
75
|
export {
|
|
76
76
|
CompactClient
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-4JUIEYAH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../core/resource.ts"],"sourcesContent":["/**\n * Base class for every API resource (FastApply, Compact, …).\n *\n * Mirrors the OpenAI SDK's `APIResource`: a resource holds nothing but a\n * reference to the transport (`MorphAPIClient`) and delegates all HTTP to it.\n * Sub-resources receive the same client by reference, so configuration and the\n * fetch/retry/auth machinery live in exactly one place.\n */\nimport type { MorphAPIClient } from './client.js';\n\nexport abstract class APIResource {\n protected _client: MorphAPIClient;\n\n constructor(client: MorphAPIClient) {\n this._client = client;\n }\n}\n"],"mappings":";AAUO,IAAe,cAAf,MAA2B;AAAA,EACtB;AAAA,EAEV,YAAY,QAAwB;AAClC,SAAK,UAAU;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-F3NCFNUX.js";
|
|
4
4
|
import {
|
|
5
5
|
SDK_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZU5YYGBJ.js";
|
|
7
7
|
|
|
8
8
|
// tools/fastapply/apply.ts
|
|
9
9
|
import { createTwoFilesPatch } from "diff";
|
|
@@ -396,4 +396,4 @@ export {
|
|
|
396
396
|
callMorphAPI,
|
|
397
397
|
applyEdit
|
|
398
398
|
};
|
|
399
|
-
//# sourceMappingURL=chunk-
|
|
399
|
+
//# sourceMappingURL=chunk-6XFL2NER.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WarpGrepClient,
|
|
3
3
|
formatResult
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQ2G5YLI.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEBASE_SEARCH_TOOL,
|
|
7
7
|
SEND_MESSAGE_TOOL,
|
|
@@ -285,4 +285,4 @@ function deduplicateContexts(contexts) {
|
|
|
285
285
|
export {
|
|
286
286
|
createExploreSubagent
|
|
287
287
|
};
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-CAFREMIT.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FastApplyAnchorIntegrityError,
|
|
3
3
|
FastApplyContextLengthError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6XFL2NER.js";
|
|
5
5
|
import {
|
|
6
6
|
MorphAPIClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FUYX2MNM.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-F3NCFNUX.js";
|
|
11
11
|
import {
|
|
12
12
|
APIResource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5TOJD2C5.js";
|
|
14
14
|
|
|
15
15
|
// tools/fastapply/core.ts
|
|
16
16
|
import { join, resolve, relative } from "path";
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
FastApplyClient,
|
|
149
149
|
executeEditFile
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-D2RFP6R2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createInteractionApi,
|
|
3
3
|
createNoopInteraction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IDMKQWQG.js";
|
|
5
5
|
import {
|
|
6
6
|
metadata
|
|
7
7
|
} from "./chunk-TLXVGE4R.js";
|
|
@@ -30,8 +30,7 @@ var MorphTracing = class {
|
|
|
30
30
|
disableBatching: config.disableBatching ?? !isProd,
|
|
31
31
|
traceContent: config.traceContent ?? true,
|
|
32
32
|
headers: config.headers,
|
|
33
|
-
debug
|
|
34
|
-
evals: config.evals
|
|
33
|
+
debug
|
|
35
34
|
};
|
|
36
35
|
if (config.disabled) {
|
|
37
36
|
log(debug, "disabled \u2014 no tracing initialized");
|
|
@@ -86,9 +85,8 @@ var MorphTracing = class {
|
|
|
86
85
|
*/
|
|
87
86
|
begin(ctx) {
|
|
88
87
|
if (!this.enabled) return createNoopInteraction(ctx);
|
|
89
|
-
const resolved = { ...ctx, evals: ctx.evals ?? this.cfg.evals };
|
|
90
88
|
const interaction = createInteractionApi(
|
|
91
|
-
|
|
89
|
+
ctx,
|
|
92
90
|
this.cfg.traceContent,
|
|
93
91
|
(eventId) => this.active.delete(eventId)
|
|
94
92
|
);
|
|
@@ -147,4 +145,4 @@ export {
|
|
|
147
145
|
MorphTracing,
|
|
148
146
|
morphTracing
|
|
149
147
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
148
|
+
//# sourceMappingURL=chunk-EMURAU6J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tracing/core.ts"],"sourcesContent":["/**\n * Morph Tracing — core initialization.\n *\n * Thin Morph layer over OpenLLMetry / Traceloop. `morphTracing()` initializes\n * Traceloop with a JSON OTLP exporter pointed at Morph's ingest endpoint\n * (`${baseUrl}/v1/traces`, `Authorization: Bearer <apiKey>`) and returns a\n * `MorphTracing` handle for interactions and tools.\n *\n * We deliberately override Traceloop's default protobuf exporter with the\n * JSON-over-HTTP exporter so the ingest service can parse plain OTLP/JSON.\n */\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport * as traceloop from '@traceloop/node-server-sdk';\n\nimport {\n createInteractionApi,\n createNoopInteraction,\n type Interaction,\n type Tracer,\n} from './interaction.js';\nimport { metadata as buildMetadata } from './otel.js';\nimport type {\n MetadataOptions,\n MorphTracingConfig,\n TraceContext,\n} from './types.js';\n\nconst DEFAULT_BASE_URL = 'https://api.morphllm.com';\n\nexport interface ResolvedConfig {\n apiKey: string;\n baseUrl: string;\n appName: string;\n disableBatching: boolean;\n traceContent: boolean;\n headers?: Record<string, string>;\n debug: boolean;\n}\n\nfunction log(debug: boolean, ...args: unknown[]): void {\n if (debug) console.log('[morph-tracing]', ...args);\n}\n\n/**\n * Handle returned by {@link morphTracing}. Create interactions with `begin()`,\n * get a non-interactive `tracer()`, and flush/shutdown the exporter.\n */\nexport class MorphTracing {\n private readonly cfg: ResolvedConfig;\n private readonly active = new Map<string, Interaction>();\n readonly enabled: boolean;\n\n constructor(config: MorphTracingConfig = {}) {\n const debug = config.debug ?? process.env.MORPH_TRACING_DEBUG === '1';\n const apiKey = config.apiKey ?? process.env.MORPH_API_KEY ?? '';\n const baseUrlRaw =\n config.baseUrl ?? process.env.MORPH_TRACES_URL ?? DEFAULT_BASE_URL;\n const baseUrl = baseUrlRaw.replace(/\\/+$/, '');\n const isProd = process.env.NODE_ENV === 'production';\n\n this.cfg = {\n apiKey,\n baseUrl,\n appName: config.appName ?? process.env.npm_package_name ?? 'morph-app',\n disableBatching: config.disableBatching ?? !isProd,\n traceContent: config.traceContent ?? true,\n headers: config.headers,\n debug,\n };\n\n if (config.disabled) {\n log(debug, 'disabled — no tracing initialized');\n this.enabled = false;\n return;\n }\n if (!apiKey) {\n console.warn(\n '[morph-tracing] No API key (set MORPH_API_KEY or pass { apiKey }). Tracing disabled.',\n );\n this.enabled = false;\n return;\n }\n\n this.enabled = true;\n if (config.useExternalOtel) {\n // Customer drives their own NodeSDK; just register config, no SDK start.\n traceloop.initialize({\n baseUrl,\n apiKey,\n appName: this.cfg.appName,\n tracingEnabled: false,\n traceContent: this.cfg.traceContent,\n silenceInitializationMessage: true,\n });\n log(debug, 'external OTEL mode — add createSpanProcessor() to your NodeSDK');\n return;\n }\n\n const exporter = new OTLPTraceExporter({\n url: `${baseUrl}/v1/traces`,\n headers: { Authorization: `Bearer ${apiKey}`, ...this.cfg.headers },\n });\n\n traceloop.initialize({\n baseUrl,\n apiKey,\n appName: this.cfg.appName,\n exporter,\n disableBatch: this.cfg.disableBatching,\n traceContent: this.cfg.traceContent,\n instrumentModules: config.instrumentModules as NonNullable<\n Parameters<typeof traceloop.initialize>[0]\n >['instrumentModules'],\n tracingEnabled: true,\n traceloopSyncEnabled: false,\n silenceInitializationMessage: !debug,\n });\n log(\n debug,\n `initialized → ${baseUrl}/v1/traces (batching ${this.cfg.disableBatching ? 'off' : 'on'})`,\n );\n }\n\n /**\n * Begin a new traced interaction (a single user turn / agent run). On a\n * disabled instance this returns an inert no-op interaction — callbacks still\n * run, but no spans are created or shipped.\n */\n begin(ctx: TraceContext & { userId: string; event?: string }): Interaction {\n if (!this.enabled) return createNoopInteraction(ctx);\n const interaction = createInteractionApi(ctx, this.cfg.traceContent, (eventId) =>\n this.active.delete(eventId),\n );\n this.active.set(interaction.getEventId()!, interaction);\n return interaction;\n }\n\n /** Look up an in-flight interaction by its eventId. */\n getActiveInteraction(eventId: string): Interaction | undefined {\n return this.active.get(eventId);\n }\n\n /**\n * Non-interactive tracer for batch jobs where you only care about\n * spans/token usage, not a user-facing interaction.\n */\n tracer(globalProperties: Record<string, string> = {}): Tracer {\n const ctx = { userId: globalProperties.userId ?? 'batch', properties: globalProperties };\n if (!this.enabled) return createNoopInteraction(ctx);\n return createInteractionApi(ctx, this.cfg.traceContent);\n }\n\n /** Build Vercel AI SDK telemetry metadata (see `@morphllm/morphsdk/tracing/otel`). */\n metadata(opts: MetadataOptions): Record<string, string> {\n return buildMetadata(opts);\n }\n\n /** Span processor for `useExternalOtel: true` integrations. */\n createSpanProcessor(\n options?: Parameters<typeof traceloop.createSpanProcessor>[0],\n ): ReturnType<typeof traceloop.createSpanProcessor> {\n // Traceloop's default exporter here is OTLP/protobuf, but Morph's ingest\n // parses OTLP/JSON only — supply the JSON exporter unless the caller\n // brings their own.\n const exporter =\n options?.exporter ??\n new OTLPTraceExporter({\n url: `${this.cfg.baseUrl}/v1/traces`,\n headers: { Authorization: `Bearer ${this.cfg.apiKey}`, ...this.cfg.headers },\n });\n return traceloop.createSpanProcessor({\n apiKey: this.cfg.apiKey,\n baseUrl: this.cfg.baseUrl,\n ...options,\n exporter,\n });\n }\n\n /** Flush any batched spans immediately. Safe to call when idle. */\n async forceFlush(): Promise<void> {\n if (!this.enabled) return;\n try {\n await traceloop.forceFlush();\n } catch (err) {\n log(this.cfg.debug, 'forceFlush error (ignored):', err);\n }\n }\n\n /** Flush and stop tracing. */\n async shutdown(): Promise<void> {\n await this.forceFlush();\n }\n}\n\n/**\n * Initialize Morph Tracing and auto-instrument supported AI SDKs.\n *\n * Requires the optional OpenTelemetry / Traceloop backends (see this module's\n * README). They install automatically with the SDK unless optional deps are\n * skipped; importing `/tracing` without them throws a module-not-found error\n * naming the missing package.\n */\nexport function morphTracing(config: MorphTracingConfig = {}): MorphTracing {\n return new MorphTracing(config);\n}\n"],"mappings":";;;;;;;;;AAWA,SAAS,yBAAyB;AAClC,YAAY,eAAe;AAe3B,IAAM,mBAAmB;AAYzB,SAAS,IAAI,UAAmB,MAAuB;AACrD,MAAI,MAAO,SAAQ,IAAI,mBAAmB,GAAG,IAAI;AACnD;AAMO,IAAM,eAAN,MAAmB;AAAA,EACP;AAAA,EACA,SAAS,oBAAI,IAAyB;AAAA,EAC9C;AAAA,EAET,YAAY,SAA6B,CAAC,GAAG;AAC3C,UAAM,QAAQ,OAAO,SAAS,QAAQ,IAAI,wBAAwB;AAClE,UAAM,SAAS,OAAO,UAAU,QAAQ,IAAI,iBAAiB;AAC7D,UAAM,aACJ,OAAO,WAAW,QAAQ,IAAI,oBAAoB;AACpD,UAAM,UAAU,WAAW,QAAQ,QAAQ,EAAE;AAC7C,UAAM,SAAS,QAAQ,IAAI,aAAa;AAExC,SAAK,MAAM;AAAA,MACT;AAAA,MACA;AAAA,MACA,SAAS,OAAO,WAAW,QAAQ,IAAI,oBAAoB;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@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZU5YYGBJ.js";
|
|
4
4
|
|
|
5
5
|
// tools/utils/resilience.ts
|
|
6
6
|
var DEFAULT_RETRY_CONFIG = {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
withTimeout,
|
|
92
92
|
MorphError
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-FESO6TDQ.js.map
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-F3NCFNUX.js";
|
|
4
4
|
import {
|
|
5
5
|
toMorphError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4DNEBVGV.js";
|
|
7
7
|
import {
|
|
8
8
|
MorphError,
|
|
9
9
|
fetchWithRetry,
|
|
10
10
|
withTimeout
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FESO6TDQ.js";
|
|
12
12
|
import {
|
|
13
13
|
SDK_VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZU5YYGBJ.js";
|
|
15
15
|
|
|
16
16
|
// core/client.ts
|
|
17
17
|
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
@@ -117,4 +117,4 @@ var MorphAPIClient = class {
|
|
|
117
117
|
export {
|
|
118
118
|
MorphAPIClient
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-FUYX2MNM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../core/client.ts"],"sourcesContent":["/**\n * MorphAPIClient — the SDK transport.\n *\n * One place owns authentication, the Morph service hosts, default headers,\n * retries, timeouts, and error mapping. Every resource (FastApply, Compact, …)\n * holds a reference to this client and delegates HTTP to it via\n * `get`/`post`/`delete`/`request`, exactly like the OpenAI SDK.\n *\n * This module is intentionally free of tool imports and Node built-ins so it\n * stays edge-safe (it is reachable from `@morphllm/morphsdk/edge` through the\n * Compact and model-router resources).\n */\nimport { fetchWithRetry, withTimeout, MorphError, type RetryConfig } from '../tools/utils/resilience.js';\nimport { logger } from '../logger.js';\nimport { SDK_VERSION } from '../version.js';\nimport { toMorphError } from './error.js';\n\n/** The Morph services the SDK talks to. */\nconst DEFAULT_BASE_URL = 'https://api.morphllm.com';\nconst DEFAULT_REPOS_URL = 'https://repos.morphllm.com';\nconst DEFAULT_BROWSER_URL = 'https://browser.morphllm.com';\nconst DEFAULT_TIMEOUT = 60_000;\n\nconst env = (name: string): string | undefined =>\n typeof process !== 'undefined' ? process.env?.[name] : undefined;\n\nconst stripTrailingSlash = (url: string): string => url.replace(/\\/+$/, '');\n\nexport interface MorphAPIClientOptions {\n /** Morph API key. Resolved against `MORPH_API_KEY` at request time if omitted. */\n apiKey?: string;\n /** Primary API host (default `https://api.morphllm.com`). */\n baseURL?: string;\n /** Code-storage host for codebase search and git (default `https://repos.morphllm.com`). */\n reposURL?: string;\n /** Browser-automation host (default `https://browser.morphllm.com`). */\n browserURL?: string;\n /** Default per-request timeout in ms (default 60s). Resources may override per call. */\n timeout?: number;\n /** Retry policy for transient failures. */\n retryConfig?: RetryConfig;\n /** Enable debug logging. */\n debug?: boolean;\n}\n\n/** Per-request options accepted by `request`/`get`/`post`/`delete`. */\nexport interface RequestOptions {\n /** JSON body; serialized with `JSON.stringify`. */\n body?: unknown;\n /** Query parameters; `undefined`/`null` values are dropped. */\n query?: Record<string, string | number | boolean | undefined | null>;\n /** Extra headers, merged over (and able to override) the defaults. */\n headers?: Record<string, string>;\n /** Override the timeout for this call. */\n timeout?: number;\n /** Hit a different host than the default (e.g. `this._client.reposURL`). */\n baseURL?: string;\n /** Return the raw `Response` of a successful (2xx) request instead of parsed JSON (for streaming). */\n stream?: boolean;\n /**\n * Return the raw `Response` without throwing on non-2xx and without parsing.\n * For resources that map errors into their own taxonomy (e.g. GitHub).\n */\n raw?: boolean;\n /** Caller-supplied abort signal. */\n signal?: AbortSignal;\n}\n\nexport class MorphAPIClient {\n /** Explicit key as provided; resolved against env at request time. */\n apiKey?: string;\n baseURL: string;\n reposURL: string;\n browserURL: string;\n /** Explicit default timeout (ms), if set. The request default is applied lazily so\n * resources can read an undefined value and supply their own fallback. */\n timeout?: number;\n retryConfig?: RetryConfig;\n debug: boolean;\n\n constructor(options: MorphAPIClientOptions = {}) {\n this.apiKey = options.apiKey;\n this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);\n this.reposURL = stripTrailingSlash(options.reposURL ?? env('MORPH_SEARCH_URL') ?? DEFAULT_REPOS_URL);\n this.browserURL = stripTrailingSlash(\n options.browserURL ?? (env('MORPH_ENVIRONMENT') === 'DEV' ? 'http://localhost:8000' : DEFAULT_BROWSER_URL),\n );\n this.timeout = options.timeout;\n this.retryConfig = options.retryConfig;\n this.debug = options.debug ?? false;\n if (this.debug) logger.enable();\n }\n\n /** The key actually used for requests: explicit, else `MORPH_API_KEY`. */\n resolveApiKey(): string | undefined {\n return this.apiKey ?? env('MORPH_API_KEY');\n }\n\n /** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */\n defaultHeaders(): Record<string, string> {\n return { 'X-Morph-SDK-Version': SDK_VERSION };\n }\n\n buildURL(path: string, baseURL?: string): string {\n if (/^https?:\\/\\//i.test(path)) return path;\n const base = stripTrailingSlash(baseURL ?? this.baseURL);\n return `${base}${path.startsWith('/') ? '' : '/'}${path}`;\n }\n\n private buildHeaders(apiKey: string, extra?: Record<string, string>): Record<string, string> {\n return {\n 'Content-Type': 'application/json',\n 'X-Morph-SDK-Version': SDK_VERSION,\n Authorization: `Bearer ${apiKey}`,\n ...extra,\n };\n }\n\n private applyQuery(url: string, query?: RequestOptions['query']): string {\n if (!query) return url;\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) params.set(key, String(value));\n }\n const qs = params.toString();\n return qs ? `${url}${url.includes('?') ? '&' : '?'}${qs}` : url;\n }\n\n async request<T>(method: string, path: string, opts: RequestOptions = {}): Promise<T> {\n const apiKey = this.resolveApiKey();\n if (!apiKey) {\n throw new MorphError(\n 'Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.',\n 'missing_api_key',\n 401,\n );\n }\n\n const url = this.applyQuery(this.buildURL(path, opts.baseURL), opts.query);\n const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;\n\n const init: RequestInit = {\n method,\n headers: this.buildHeaders(apiKey, opts.headers),\n ...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}),\n ...(opts.signal ? { signal: opts.signal } : {}),\n };\n\n logger.debug('MorphAPIClient', 'request', { method, url });\n\n const response = await withTimeout(\n fetchWithRetry(url, init, this.retryConfig ?? {}),\n timeout,\n `Morph request to ${url} timed out after ${timeout}ms`,\n );\n\n if (opts.raw) return response as unknown as T;\n if (!response.ok) throw await toMorphError(response);\n if (opts.stream) return response as unknown as T;\n if (response.status === 204) return undefined as T;\n\n const text = await response.text();\n return (text ? JSON.parse(text) : undefined) as T;\n }\n\n get<T>(path: string, opts?: RequestOptions): Promise<T> {\n return this.request<T>('GET', path, opts);\n }\n\n post<T>(path: string, opts?: RequestOptions): Promise<T> {\n return this.request<T>('POST', path, opts);\n }\n\n delete<T>(path: string, opts?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', path, opts);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAM,mBAAmB;AACzB,IAAM,oBAAoB;AAC1B,IAAM,sBAAsB;AAC5B,IAAM,kBAAkB;AAExB,IAAM,MAAM,CAAC,SACX,OAAO,YAAY,cAAc,QAAQ,MAAM,IAAI,IAAI;AAEzD,IAAM,qBAAqB,CAAC,QAAwB,IAAI,QAAQ,QAAQ,EAAE;AA0CnE,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAE1B;AAAA,EACA;AAAA,EACA;AAAA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AAmC;AACvD,WAAO,KAAK,QAAW,QAAQ,MAAM,IAAI;AAAA,EAC3C;AAAA,EAEA,OAAU,MAAc,MAAmC;AACzD,WAAO,KAAK,QAAW,UAAU,MAAM,IAAI;AAAA,EAC7C;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2HMEZZKK.js";
|
|
4
4
|
import {
|
|
5
5
|
executeBrowserTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YD6TNDR4.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
browserTool,
|
|
55
55
|
vercel_exports
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-GJ42MYUU.js.map
|
|
@@ -5,36 +5,6 @@ import {
|
|
|
5
5
|
// tracing/interaction.ts
|
|
6
6
|
import { context, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import * as traceloop from "@traceloop/node-server-sdk";
|
|
8
|
-
|
|
9
|
-
// tracing/reflex.ts
|
|
10
|
-
var REFLEX_RUN_ATTRIBUTE = "morph.reflex.run";
|
|
11
|
-
var USER_TRANSFORM = "user_message";
|
|
12
|
-
var ASSISTANT_TRANSFORM = "assistant_message";
|
|
13
|
-
function normalizeEvals(evals) {
|
|
14
|
-
if (!evals) return [];
|
|
15
|
-
const out = [];
|
|
16
|
-
const seen = /* @__PURE__ */ new Set();
|
|
17
|
-
const add = (models, transform) => {
|
|
18
|
-
if (!Array.isArray(models)) return;
|
|
19
|
-
for (const raw of models) {
|
|
20
|
-
const model = typeof raw === "string" ? raw.trim() : "";
|
|
21
|
-
if (!model) continue;
|
|
22
|
-
const key = `${model} ${transform}`;
|
|
23
|
-
if (seen.has(key)) continue;
|
|
24
|
-
seen.add(key);
|
|
25
|
-
out.push({ model, transform });
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
add(evals.user, USER_TRANSFORM);
|
|
29
|
-
add(evals.assistant, ASSISTANT_TRANSFORM);
|
|
30
|
-
return out;
|
|
31
|
-
}
|
|
32
|
-
function serializeEvals(evals) {
|
|
33
|
-
const entries = normalizeEvals(evals);
|
|
34
|
-
return entries.length ? JSON.stringify(entries) : null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// tracing/interaction.ts
|
|
38
8
|
var ASSOC = "traceloop.association.properties.";
|
|
39
9
|
var ENTITY_INPUT = "traceloop.entity.input";
|
|
40
10
|
var ENTITY_OUTPUT = "traceloop.entity.output";
|
|
@@ -69,7 +39,6 @@ function createInteractionApi(initial, traceContent, onClose) {
|
|
|
69
39
|
let input = initial.input;
|
|
70
40
|
let workflowSpan = null;
|
|
71
41
|
let finished = false;
|
|
72
|
-
const reflexRun = serializeEvals(initial.evals);
|
|
73
42
|
const withAssoc = (fn) => traceloop.withAssociationProperties(associationProps(ctx, properties), fn);
|
|
74
43
|
const workflowName = () => ctx.event ?? "interaction";
|
|
75
44
|
function ensureWorkflowSpan() {
|
|
@@ -80,7 +49,6 @@ function createInteractionApi(initial, traceContent, onClose) {
|
|
|
80
49
|
span.setAttribute(ASSOC + k, v);
|
|
81
50
|
}
|
|
82
51
|
if (traceContent && input) span.setAttribute(ENTITY_INPUT, input);
|
|
83
|
-
if (reflexRun) span.setAttribute(REFLEX_RUN_ATTRIBUTE, reflexRun);
|
|
84
52
|
workflowSpan = span;
|
|
85
53
|
return span;
|
|
86
54
|
}
|
|
@@ -240,10 +208,7 @@ function createNoopInteraction(initial) {
|
|
|
240
208
|
}
|
|
241
209
|
|
|
242
210
|
export {
|
|
243
|
-
REFLEX_RUN_ATTRIBUTE,
|
|
244
|
-
normalizeEvals,
|
|
245
|
-
serializeEvals,
|
|
246
211
|
createInteractionApi,
|
|
247
212
|
createNoopInteraction
|
|
248
213
|
};
|
|
249
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-IDMKQWQG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tracing/interaction.ts"],"sourcesContent":["/**\n * Morph Tracing — interactions, tools, and manual spans.\n *\n * An `Interaction` is one user turn / agent run. It threads association\n * properties (user_id / convo_id / event_id) onto every span created inside it —\n * including the auto-instrumented LLM spans — so a whole conversation stitches\n * together in the Morph UI. Built on Traceloop's `withTask` / `withTool` and a\n * manual tracer for already-completed tool spans.\n */\nimport { context, SpanStatusCode, trace, type Span } from '@opentelemetry/api';\nimport * as traceloop from '@traceloop/node-server-sdk';\n\nimport { metadata as buildMetadata } from './otel.js';\nimport type {\n FinishOptions,\n SpanParams,\n ToolParams,\n ToolSpan,\n TrackToolParams,\n TraceContext,\n} from './types.js';\n\n// Traceloop semantic-convention attribute keys.\nconst ASSOC = 'traceloop.association.properties.';\nconst ENTITY_INPUT = 'traceloop.entity.input';\nconst ENTITY_OUTPUT = 'traceloop.entity.output';\nconst ENTITY_NAME = 'traceloop.entity.name';\nconst SPAN_KIND = 'traceloop.span.kind';\n\nfunction uuid(): string {\n const c = (globalThis as { crypto?: { randomUUID?: () => string } }).crypto;\n if (c?.randomUUID) return c.randomUUID();\n return 'xxxxxxxxxxxx4xxxyxxx'.replace(/[xy]/g, (ch) => {\n const r = (Math.random() * 16) | 0;\n return (ch === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\nfunction asString(v: unknown): string {\n if (v == null) return '';\n return typeof v === 'string' ? v : JSON.stringify(v);\n}\n\nexport interface Interaction {\n getEventId(): string | undefined;\n setInput(input: string): void;\n setProperty(key: string, value: string): void;\n setProperties(props: Record<string, string>): void;\n /**\n * Run `fn` with this interaction's association properties active — required so\n * auto-instrumented OpenAI/Anthropic spans inherit user_id / convo_id / tags.\n */\n run<T>(fn: () => Promise<T> | T): Promise<T>;\n /** Run `fn` inside a traced task span; LLM calls within inherit attribution. */\n withSpan<T>(params: SpanParams | string, fn: () => Promise<T> | T): Promise<T>;\n /** Run `fn` inside a traced tool span. */\n withTool<T>(params: ToolParams | string, fn: () => Promise<T> | T): Promise<T>;\n /** Start a tool span you end manually. */\n startToolSpan(params: ToolParams | string): ToolSpan;\n /** Record an already-completed tool invocation. */\n trackTool(params: TrackToolParams): void;\n /** Metadata for the Vercel AI SDK `experimental_telemetry.metadata`. */\n vercelAiSdkMetadata(): Record<string, string>;\n /** End the interaction with its final output. */\n finish(opts: FinishOptions | string): Promise<void>;\n}\n\nexport type Tracer = Pick<Interaction, 'withSpan' | 'withTool' | 'startToolSpan' | 'trackTool'>;\n\n/** Build the association-property bag Traceloop propagates onto child spans. */\nfunction associationProps(\n ctx: TraceContext & { userId?: string },\n extra: Record<string, string>,\n): Record<string, string> {\n const props: Record<string, string> = { ...extra };\n if (ctx.userId) props.user_id = ctx.userId;\n if (ctx.convoId) props.convo_id = ctx.convoId;\n if (ctx.eventId) props.event_id = ctx.eventId;\n if (ctx.event) props.event_name = ctx.event;\n return props;\n}\n\nexport function createInteractionApi(\n initial: TraceContext & { userId?: string },\n traceContent: boolean,\n onClose?: (eventId: string) => void,\n): Interaction {\n const ctx: TraceContext & { userId?: string } = {\n ...initial,\n eventId: initial.eventId ?? uuid(),\n };\n const properties: Record<string, string> = { ...(initial.properties ?? {}) };\n let input = initial.input;\n let workflowSpan: Span | null = null;\n let finished = false;\n\n const withAssoc = <T>(fn: () => Promise<T> | T): Promise<T> | T =>\n traceloop.withAssociationProperties(associationProps(ctx, properties), fn);\n\n const workflowName = () => ctx.event ?? 'interaction';\n\n /** Open the interaction workflow span once; stays active until finish(). */\n function ensureWorkflowSpan(): Span {\n if (workflowSpan) return workflowSpan;\n const span = traceloop.getTraceloopTracer().startSpan(workflowName());\n span.setAttribute(SPAN_KIND, 'workflow');\n for (const [k, v] of Object.entries(associationProps(ctx, properties))) {\n span.setAttribute(ASSOC + k, v);\n }\n if (traceContent && input) span.setAttribute(ENTITY_INPUT, input);\n workflowSpan = span;\n return span;\n }\n\n /** Run fn with association props and the workflow span as the active parent. */\n function withWorkflowContext<T>(fn: () => Promise<T> | T): Promise<T> | T {\n return withAssoc(() => {\n const span = ensureWorkflowSpan();\n return context.with(trace.setSpan(context.active(), span), fn);\n });\n }\n\n /** Close the workflow span exactly once, applying final attributes. */\n function closeWorkflowSpan(apply: (span: Span) => void): void {\n if (finished) return;\n withAssoc(() => {\n const span = ensureWorkflowSpan();\n apply(span);\n span.end();\n });\n workflowSpan = null;\n finished = true;\n onClose?.(ctx.eventId!);\n }\n\n /** Record an exception + ERROR status on the workflow span, then close it. */\n function failWorkflowSpan(err: unknown): void {\n const e = err instanceof Error ? err : new Error(String(err));\n closeWorkflowSpan((span) => {\n span.recordException(e);\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n if (traceContent) span.setAttribute(ENTITY_OUTPUT, `ERROR: ${e.message}`);\n });\n }\n\n const toolName = (p: ToolParams | string) => (typeof p === 'string' ? p : p.name);\n\n function startToolSpan(params: ToolParams | string): ToolSpan {\n const name = toolName(params);\n const span: Span = traceloop.getTraceloopTracer().startSpan(name);\n span.setAttribute(SPAN_KIND, 'tool');\n span.setAttribute(ENTITY_NAME, name);\n for (const [k, v] of Object.entries(associationProps(ctx, properties))) {\n span.setAttribute(ASSOC + k, v);\n }\n if (typeof params !== 'string' && params.properties) {\n for (const [k, v] of Object.entries(params.properties)) span.setAttribute(k, v);\n }\n return {\n setInput(value: unknown) {\n if (traceContent) span.setAttribute(ENTITY_INPUT, asString(value));\n },\n setOutput(value: unknown) {\n if (traceContent) span.setAttribute(ENTITY_OUTPUT, asString(value));\n },\n setError(error: Error | string) {\n const e = typeof error === 'string' ? new Error(error) : error;\n span.recordException(e);\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n },\n end() {\n span.end();\n },\n };\n }\n\n return {\n getEventId: () => ctx.eventId,\n setInput(value: string) {\n input = value;\n },\n setProperty(key: string, value: string) {\n properties[key] = value;\n },\n setProperties(props: Record<string, string>) {\n Object.assign(properties, props);\n },\n vercelAiSdkMetadata() {\n return buildMetadata({\n userId: ctx.userId ?? 'unknown',\n convoId: ctx.convoId,\n eventName: ctx.event,\n eventId: ctx.eventId,\n properties,\n });\n },\n async run(fn) {\n try {\n return await Promise.resolve(withWorkflowContext(fn));\n } catch (err) {\n // Natively record the failure on the workflow span and ship it, so a\n // throwing interaction still lands in the trace as an errored span.\n failWorkflowSpan(err);\n throw err;\n }\n },\n withSpan(params, fn) {\n const name = typeof params === 'string' ? params : params.name;\n return Promise.resolve(withWorkflowContext(() => traceloop.withTask({ name }, fn)));\n },\n withTool(params, fn) {\n const name = toolName(params);\n const version = typeof params === 'string' ? undefined : params.version;\n return Promise.resolve(withWorkflowContext(() => traceloop.withTool({ name, version }, fn)));\n },\n startToolSpan,\n trackTool(params: TrackToolParams) {\n const span = startToolSpan({ name: params.name, properties: params.properties });\n if (params.input !== undefined) span.setInput(params.input);\n if (params.output !== undefined) span.setOutput(params.output);\n if (params.error) span.setError(params.error);\n span.end();\n },\n async finish(opts) {\n const output = typeof opts === 'string' ? opts : opts.output;\n if (typeof opts !== 'string' && opts.properties) Object.assign(properties, opts.properties);\n // No-op if run() already closed the span on error; otherwise end it now.\n // (Creates one if finish() is called alone, i.e. begin() → finish().)\n closeWorkflowSpan((span) => {\n if (traceContent) span.setAttribute(ENTITY_OUTPUT, output);\n });\n },\n };\n}\n\n/**\n * Inert Interaction for disabled instances. Preserves control flow — run() /\n * withTool() still execute their callback and rethrow errors — but never touches\n * the tracer. Required because the OTel provider is a process-wide singleton: a\n * disabled instance that created real spans would ship them through whichever\n * enabled instance registered the provider.\n */\nexport function createNoopInteraction(initial: TraceContext & { userId?: string }): Interaction {\n const ctx: TraceContext & { userId?: string } = {\n ...initial,\n eventId: initial.eventId ?? uuid(),\n };\n const properties: Record<string, string> = { ...(initial.properties ?? {}) };\n const noopToolSpan: ToolSpan = { setInput() {}, setOutput() {}, setError() {}, end() {} };\n\n return {\n getEventId: () => ctx.eventId,\n setInput() {},\n setProperty(key: string, value: string) {\n properties[key] = value;\n },\n setProperties(props: Record<string, string>) {\n Object.assign(properties, props);\n },\n vercelAiSdkMetadata() {\n return buildMetadata({\n userId: ctx.userId ?? 'unknown',\n convoId: ctx.convoId,\n eventName: ctx.event,\n eventId: ctx.eventId,\n properties,\n });\n },\n async run(fn) {\n return await fn();\n },\n async withSpan(_params, fn) {\n return await fn();\n },\n async withTool(_params, fn) {\n return await fn();\n },\n startToolSpan: () => noopToolSpan,\n trackTool() {},\n async finish() {},\n };\n}\n"],"mappings":";;;;;AASA,SAAS,SAAS,gBAAgB,aAAwB;AAC1D,YAAY,eAAe;AAa3B,IAAM,QAAQ;AACd,IAAM,eAAe;AACrB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,YAAY;AAElB,SAAS,OAAe;AACtB,QAAM,IAAK,WAA0D;AACrE,MAAI,GAAG,WAAY,QAAO,EAAE,WAAW;AACvC,SAAO,uBAAuB,QAAQ,SAAS,CAAC,OAAO;AACrD,UAAM,IAAK,KAAK,OAAO,IAAI,KAAM;AACjC,YAAQ,OAAO,MAAM,IAAK,IAAI,IAAO,GAAK,SAAS,EAAE;AAAA,EACvD,CAAC;AACH;AAEA,SAAS,SAAS,GAAoB;AACpC,MAAI,KAAK,KAAM,QAAO;AACtB,SAAO,OAAO,MAAM,WAAW,IAAI,KAAK,UAAU,CAAC;AACrD;AA6BA,SAAS,iBACP,KACA,OACwB;AACxB,QAAM,QAAgC,EAAE,GAAG,MAAM;AACjD,MAAI,IAAI,OAAQ,OAAM,UAAU,IAAI;AACpC,MAAI,IAAI,QAAS,OAAM,WAAW,IAAI;AACtC,MAAI,IAAI,QAAS,OAAM,WAAW,IAAI;AACtC,MAAI,IAAI,MAAO,OAAM,aAAa,IAAI;AACtC,SAAO;AACT;AAEO,SAAS,qBACd,SACA,cACA,SACa;AACb,QAAM,MAA0C;AAAA,IAC9C,GAAG;AAAA,IACH,SAAS,QAAQ,WAAW,KAAK;AAAA,EACnC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9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
createBrowserTool,
|
|
94
94
|
openai_exports
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-KQKLQHJF.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runRipgrep
|
|
3
|
+
} from "./chunk-TPP2UGQP.js";
|
|
1
4
|
import {
|
|
2
5
|
readAllLines
|
|
3
6
|
} from "./chunk-G2RSY56Q.js";
|
|
@@ -8,9 +11,6 @@ import {
|
|
|
8
11
|
resolveUnderRepo,
|
|
9
12
|
toRepoRelative
|
|
10
13
|
} from "./chunk-YPKNMYD4.js";
|
|
11
|
-
import {
|
|
12
|
-
runRipgrep
|
|
13
|
-
} from "./chunk-TPP2UGQP.js";
|
|
14
14
|
import {
|
|
15
15
|
AGENT_CONFIG,
|
|
16
16
|
DEFAULT_EXCLUDES
|
|
@@ -341,4 +341,4 @@ Details: ${res.stderr}` : ""}`
|
|
|
341
341
|
export {
|
|
342
342
|
LocalRipgrepProvider
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-LN7GNFET.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VBZ7BG47.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION
|
|
6
6
|
} from "./chunk-YQMPVJ2L.js";
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
getSystemPrompt,
|
|
56
56
|
vercel_default
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-O5264GI4.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
executeGitHubReadFile,
|
|
9
9
|
executeToolCall,
|
|
10
10
|
executeToolCallStreaming
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YQ2G5YLI.js";
|
|
12
12
|
|
|
13
13
|
// tools/warp_grep/vercel.ts
|
|
14
14
|
import { tool } from "ai";
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
createGitHubReadFileTool,
|
|
116
116
|
vercel_default
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-PEFXG5M6.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-2VERUKO2.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchWithRetry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FESO6TDQ.js";
|
|
16
16
|
|
|
17
17
|
// tools/browser/profiles/core.ts
|
|
18
18
|
var DEFAULT_API_URL = process.env.MORPH_ENVIRONMENT === "DEV" ? "http://localhost:8000" : "https://browser.morphllm.com";
|
|
@@ -386,4 +386,4 @@ export {
|
|
|
386
386
|
listRepos,
|
|
387
387
|
getProfileState
|
|
388
388
|
};
|
|
389
|
-
//# sourceMappingURL=chunk-
|
|
389
|
+
//# sourceMappingURL=chunk-PIIXU2H3.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeEditFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D2RFP6R2.js";
|
|
4
4
|
import {
|
|
5
5
|
EDIT_FILE_SYSTEM_PROMPT,
|
|
6
6
|
EDIT_FILE_TOOL_DESCRIPTION
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
vercel_default,
|
|
87
87
|
vercel_exports
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-PV6EF6NG.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FUYX2MNM.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-F3NCFNUX.js";
|
|
7
7
|
import {
|
|
8
8
|
MorphError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FESO6TDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
APIResource
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5TOJD2C5.js";
|
|
13
13
|
|
|
14
14
|
// modelrouter/core.ts
|
|
15
15
|
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
RawRouter,
|
|
175
175
|
RouterClassifier
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-QKNGVBE2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WarpGrepClient,
|
|
3
3
|
formatResult
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQ2G5YLI.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEBASE_SEARCH_TOOL,
|
|
7
7
|
SEND_MESSAGE_TOOL,
|
|
@@ -262,4 +262,4 @@ function deduplicateContexts(contexts) {
|
|
|
262
262
|
export {
|
|
263
263
|
createExploreSubagent
|
|
264
264
|
};
|
|
265
|
-
//# sourceMappingURL=chunk-
|
|
265
|
+
//# sourceMappingURL=chunk-SKN2L5CE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VBZ7BG47.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION,
|
|
6
6
|
CODEBASE_SEARCH_SYSTEM_PROMPT
|
|
@@ -80,4 +80,4 @@ function formatResult(result) {
|
|
|
80
80
|
export {
|
|
81
81
|
createCodebaseSearchTool
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-T6TXYTKH.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FUYX2MNM.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-F3NCFNUX.js";
|
|
7
7
|
import {
|
|
8
8
|
MorphError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FESO6TDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
APIResource
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5TOJD2C5.js";
|
|
13
13
|
|
|
14
14
|
// tools/codebase_search/core.ts
|
|
15
15
|
var DEFAULT_TIMEOUT = 3e4;
|
|
@@ -94,4 +94,4 @@ export {
|
|
|
94
94
|
CodebaseSearchClient,
|
|
95
95
|
executeCodebaseSearch
|
|
96
96
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-VBZ7BG47.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VBZ7BG47.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION,
|
|
6
6
|
CODEBASE_SEARCH_SYSTEM_PROMPT
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
getSystemPrompt,
|
|
126
126
|
openai_default
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-WLMPQFER.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-2HMEZZKK.js";
|
|
5
5
|
import {
|
|
6
6
|
executeBrowserTask
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YD6TNDR4.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
createBrowserTool,
|
|
78
78
|
anthropic_exports
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-XH6KJJDI.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
executeToolCall,
|
|
15
15
|
formatGitHubReadFileResult,
|
|
16
16
|
formatResult
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YQ2G5YLI.js";
|
|
18
18
|
|
|
19
19
|
// tools/warp_grep/anthropic.ts
|
|
20
20
|
var INPUT_SCHEMA = {
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
createGitHubSearchTool,
|
|
91
91
|
createGitHubReadFileTool
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-XK3PQZW6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeEditFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D2RFP6R2.js";
|
|
4
4
|
import {
|
|
5
5
|
EDIT_FILE_SYSTEM_PROMPT,
|
|
6
6
|
EDIT_FILE_TOOL_DESCRIPTION
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
openai_default,
|
|
92
92
|
openai_exports
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-XTFRHVCW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProfilesClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PIIXU2H3.js";
|
|
4
4
|
import {
|
|
5
5
|
buildEmbedCode,
|
|
6
6
|
buildLiveIframe,
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
} from "./chunk-YTYCHRQ2.js";
|
|
10
10
|
import {
|
|
11
11
|
MorphAPIClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FUYX2MNM.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-F3NCFNUX.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchWithRetry,
|
|
18
18
|
withTimeout
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FESO6TDQ.js";
|
|
20
20
|
import {
|
|
21
21
|
APIResource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-5TOJD2C5.js";
|
|
23
23
|
|
|
24
24
|
// tools/browser/core.ts
|
|
25
25
|
var DEFAULT_CONFIG = {
|
|
@@ -619,4 +619,4 @@ export {
|
|
|
619
619
|
getWebp,
|
|
620
620
|
checkHealth
|
|
621
621
|
};
|
|
622
|
-
//# sourceMappingURL=chunk-
|
|
622
|
+
//# sourceMappingURL=chunk-YD6TNDR4.js.map
|