@morphllm/morphsdk 0.2.56 → 0.2.58
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/anthropic-CaFUHxBW.d.ts +89 -0
- package/dist/{chunk-SALJ2K6S.js → chunk-2CASO3ZO.js} +60 -98
- package/dist/chunk-2CASO3ZO.js.map +1 -0
- package/dist/chunk-374N3GIA.js +118 -0
- package/dist/chunk-374N3GIA.js.map +1 -0
- package/dist/chunk-3IQIT6MC.js +65 -0
- package/dist/chunk-3IQIT6MC.js.map +1 -0
- package/dist/chunk-4VGOBA2J.js +57 -0
- package/dist/chunk-4VGOBA2J.js.map +1 -0
- package/dist/chunk-527P5X2E.js +98 -0
- package/dist/chunk-527P5X2E.js.map +1 -0
- package/dist/chunk-6N6ZYZYD.js +74 -0
- package/dist/chunk-6N6ZYZYD.js.map +1 -0
- package/dist/chunk-6Y5JB4JC.js +195 -0
- package/dist/chunk-6Y5JB4JC.js.map +1 -0
- package/dist/{chunk-WSSSSBWU.js → chunk-7EIHYJSG.js} +18 -18
- package/dist/chunk-7EIHYJSG.js.map +1 -0
- package/dist/{chunk-TICMYDII.js → chunk-APP75CBN.js} +33 -16
- package/dist/chunk-APP75CBN.js.map +1 -0
- package/dist/chunk-ILJ3J5IA.js +72 -0
- package/dist/chunk-ILJ3J5IA.js.map +1 -0
- package/dist/chunk-ISWL67SF.js +1 -0
- package/dist/chunk-KW7OEGZK.js +9 -0
- package/dist/chunk-KW7OEGZK.js.map +1 -0
- package/dist/chunk-Q5AHGIQO.js +205 -0
- package/dist/chunk-Q5AHGIQO.js.map +1 -0
- package/dist/{chunk-TJIUA27P.js → chunk-XT5ZO6ES.js} +9 -5
- package/dist/chunk-XT5ZO6ES.js.map +1 -0
- package/dist/{chunk-LVPVVLTI.js → chunk-YV75OQTE.js} +105 -17
- package/dist/chunk-YV75OQTE.js.map +1 -0
- package/dist/{chunk-ZJIIICRA.js → chunk-ZO4PPFCZ.js} +60 -29
- package/dist/chunk-ZO4PPFCZ.js.map +1 -0
- package/dist/{client-CFoR--IU.d.ts → client-CextMMm9.d.ts} +10 -15
- package/dist/client.cjs +698 -466
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +3 -2
- package/dist/client.js +14 -15
- package/dist/finish-kXAcUJyB.d.ts +33 -0
- package/dist/gemini-CE80Pbdy.d.ts +117 -0
- package/dist/index.cjs +711 -466
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +16 -16
- package/dist/openai-Fvpqln7F.d.ts +89 -0
- package/dist/tools/warp_grep/agent/config.cjs +8 -4
- package/dist/tools/warp_grep/agent/config.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/config.d.ts +7 -2
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/formatter.cjs +32 -15
- package/dist/tools/warp_grep/agent/formatter.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/formatter.d.ts +1 -1
- package/dist/tools/warp_grep/agent/formatter.js +1 -1
- package/dist/tools/warp_grep/agent/parser.cjs +104 -17
- package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/parser.d.ts +3 -5
- package/dist/tools/warp_grep/agent/parser.js +1 -3
- package/dist/tools/warp_grep/agent/prompt.cjs +132 -56
- package/dist/tools/warp_grep/agent/prompt.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/prompt.d.ts +1 -1
- package/dist/tools/warp_grep/agent/prompt.js +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs +466 -313
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.d.ts +1 -0
- package/dist/tools/warp_grep/agent/runner.js +6 -9
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +9 -2
- package/dist/tools/warp_grep/anthropic.cjs +656 -380
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +4 -74
- package/dist/tools/warp_grep/anthropic.js +13 -16
- package/dist/tools/warp_grep/client.cjs +1593 -0
- package/dist/tools/warp_grep/client.cjs.map +1 -0
- package/dist/tools/warp_grep/client.d.ts +87 -0
- package/dist/tools/warp_grep/client.js +26 -0
- package/dist/tools/warp_grep/gemini.cjs +1587 -0
- package/dist/tools/warp_grep/gemini.cjs.map +1 -0
- package/dist/tools/warp_grep/gemini.d.ts +7 -0
- package/dist/tools/warp_grep/gemini.js +34 -0
- package/dist/tools/warp_grep/harness.cjs +1195 -0
- package/dist/tools/warp_grep/harness.cjs.map +1 -0
- package/dist/tools/warp_grep/harness.d.ts +107 -0
- package/dist/tools/warp_grep/harness.js +68 -0
- package/dist/tools/warp_grep/harness.js.map +1 -0
- package/dist/tools/warp_grep/index.cjs +818 -466
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +11 -6
- package/dist/tools/warp_grep/index.js +43 -23
- package/dist/tools/warp_grep/openai.cjs +656 -378
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +4 -74
- package/dist/tools/warp_grep/openai.js +13 -14
- package/dist/tools/warp_grep/providers/local.cjs +66 -27
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.d.ts +4 -9
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/providers/remote.cjs +211 -0
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -0
- package/dist/tools/warp_grep/providers/remote.d.ts +67 -0
- package/dist/tools/warp_grep/providers/remote.js +9 -0
- package/dist/tools/warp_grep/providers/types.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/types.d.ts +7 -15
- package/dist/tools/warp_grep/vercel.cjs +668 -397
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +4 -51
- package/dist/tools/warp_grep/vercel.js +16 -15
- package/dist/types-a_hxdPI6.d.ts +144 -0
- package/dist/vercel-3yjvfmVB.d.ts +66 -0
- package/package.json +17 -2
- package/dist/chunk-4ZHDBKBY.js +0 -83
- package/dist/chunk-4ZHDBKBY.js.map +0 -1
- package/dist/chunk-73RQWOQC.js +0 -16
- package/dist/chunk-73RQWOQC.js.map +0 -1
- package/dist/chunk-7OQOOB3R.js +0 -1
- package/dist/chunk-EK7OQPWD.js +0 -44
- package/dist/chunk-EK7OQPWD.js.map +0 -1
- package/dist/chunk-GJURLQ3L.js +0 -77
- package/dist/chunk-GJURLQ3L.js.map +0 -1
- package/dist/chunk-HQO45BAJ.js +0 -14
- package/dist/chunk-HQO45BAJ.js.map +0 -1
- package/dist/chunk-LVPVVLTI.js.map +0 -1
- package/dist/chunk-NDZO5IPV.js +0 -121
- package/dist/chunk-NDZO5IPV.js.map +0 -1
- package/dist/chunk-QVRXBAMM.js +0 -107
- package/dist/chunk-QVRXBAMM.js.map +0 -1
- package/dist/chunk-SALJ2K6S.js.map +0 -1
- package/dist/chunk-TICMYDII.js.map +0 -1
- package/dist/chunk-TJIUA27P.js.map +0 -1
- package/dist/chunk-UIRJE422.js +0 -70
- package/dist/chunk-UIRJE422.js.map +0 -1
- package/dist/chunk-WETRQJGU.js +0 -129
- package/dist/chunk-WETRQJGU.js.map +0 -1
- package/dist/chunk-WSSSSBWU.js.map +0 -1
- package/dist/chunk-ZJIIICRA.js.map +0 -1
- package/dist/core-CpkYEi_T.d.ts +0 -158
- package/dist/tools/warp_grep/agent/grep_helpers.cjs +0 -148
- package/dist/tools/warp_grep/agent/grep_helpers.cjs.map +0 -1
- package/dist/tools/warp_grep/agent/grep_helpers.d.ts +0 -16
- package/dist/tools/warp_grep/agent/grep_helpers.js +0 -14
- package/dist/tools/warp_grep/tools/analyse.cjs +0 -40
- package/dist/tools/warp_grep/tools/analyse.cjs.map +0 -1
- package/dist/tools/warp_grep/tools/analyse.d.ts +0 -10
- package/dist/tools/warp_grep/tools/analyse.js +0 -8
- package/dist/tools/warp_grep/tools/finish.cjs +0 -69
- package/dist/tools/warp_grep/tools/finish.cjs.map +0 -1
- package/dist/tools/warp_grep/tools/finish.d.ts +0 -10
- package/dist/tools/warp_grep/tools/finish.js +0 -10
- package/dist/tools/warp_grep/tools/grep.cjs +0 -38
- package/dist/tools/warp_grep/tools/grep.cjs.map +0 -1
- package/dist/tools/warp_grep/tools/grep.d.ts +0 -8
- package/dist/tools/warp_grep/tools/grep.js +0 -15
- package/dist/tools/warp_grep/tools/grep.js.map +0 -1
- package/dist/tools/warp_grep/tools/read.cjs +0 -38
- package/dist/tools/warp_grep/tools/read.cjs.map +0 -1
- package/dist/tools/warp_grep/tools/read.d.ts +0 -9
- package/dist/tools/warp_grep/tools/read.js +0 -8
- package/dist/tools/warp_grep/tools/read.js.map +0 -1
- package/dist/tools/warp_grep/utils/format.cjs +0 -42
- package/dist/tools/warp_grep/utils/format.cjs.map +0 -1
- package/dist/tools/warp_grep/utils/format.d.ts +0 -4
- package/dist/tools/warp_grep/utils/format.js +0 -18
- package/dist/tools/warp_grep/utils/format.js.map +0 -1
- /package/dist/{chunk-7OQOOB3R.js.map → chunk-ISWL67SF.js.map} +0 -0
- /package/dist/tools/warp_grep/{agent/grep_helpers.js.map → client.js.map} +0 -0
- /package/dist/tools/warp_grep/{tools/analyse.js.map → gemini.js.map} +0 -0
- /package/dist/tools/warp_grep/{tools/finish.js.map → providers/remote.js.map} +0 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
LLMResponseParseError,
|
|
3
2
|
LLMResponseParser
|
|
4
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-YV75OQTE.js";
|
|
5
4
|
import "../../../chunk-PZ5AY32C.js";
|
|
6
5
|
export {
|
|
7
|
-
LLMResponseParseError,
|
|
8
6
|
LLMResponseParser
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=parser.js.map
|
|
@@ -24,110 +24,188 @@ __export(prompt_exports, {
|
|
|
24
24
|
getSystemPrompt: () => getSystemPrompt
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(prompt_exports);
|
|
27
|
-
var SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given
|
|
27
|
+
var SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given search_string.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### workflow
|
|
30
30
|
You have exactly 4 turns. The 4th turn MUST be a \`finish\` call. Each turn allows up to 8 parallel tool calls.
|
|
31
31
|
|
|
32
|
-
- Turn 1: Map the territory OR dive deep (based on
|
|
32
|
+
- Turn 1: Map the territory OR dive deep (based on search_string specificity)
|
|
33
33
|
- Turn 2-3: Refine based on findings
|
|
34
34
|
- Turn 4: MUST call \`finish\` with all relevant code locations
|
|
35
35
|
- You MAY call \`finish\` early if confident\u2014but never before at least 1 search turn.
|
|
36
|
+
- The user strongly prefers if you can call the finish tool early, but you must be correct
|
|
36
37
|
|
|
37
|
-
Remember, if the task feels easy to you, it is strongly desirable to call
|
|
38
|
-
</workflow>
|
|
38
|
+
Remember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
### tools
|
|
41
|
+
Tool calls use nested XML elements:
|
|
42
|
+
\`\`\`xml
|
|
43
|
+
<tool_name>
|
|
44
|
+
<parameter>value</parameter>
|
|
45
|
+
</tool_name>
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
### \`list_directory\`
|
|
49
|
+
Directory tree view. Shows structure of a path, optionally filtered by regex pattern.
|
|
50
|
+
|
|
51
|
+
Elements:
|
|
52
|
+
- \`<path>\` (required): Directory path to list (use \`.\` for repo root)
|
|
53
|
+
- \`<pattern>\` (optional): Regex to filter results
|
|
45
54
|
|
|
46
55
|
Examples:
|
|
47
56
|
\`\`\`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
<list_directory>
|
|
58
|
+
<path>src/services</path>
|
|
59
|
+
</list_directory>
|
|
60
|
+
|
|
61
|
+
<list_directory>
|
|
62
|
+
<path>lib/utils</path>
|
|
63
|
+
<pattern>.*\\.(ts|js)$</pattern>
|
|
64
|
+
</list_directory>
|
|
52
65
|
\`\`\`
|
|
53
66
|
|
|
54
|
-
### \`read
|
|
55
|
-
Read file contents.
|
|
67
|
+
### \`read\`
|
|
68
|
+
Read file contents. Supports multiple line ranges.
|
|
56
69
|
- Returns numbered lines for easy reference
|
|
57
|
-
-
|
|
70
|
+
- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.
|
|
71
|
+
|
|
72
|
+
Elements:
|
|
73
|
+
- \`<path>\` (required): File path to read
|
|
74
|
+
- \`<lines>\` (optional): Line ranges like "1-50,75-80,100-120" (omit to read entire file)
|
|
58
75
|
|
|
59
76
|
Examples:
|
|
60
77
|
\`\`\`
|
|
61
|
-
read
|
|
62
|
-
|
|
63
|
-
read
|
|
78
|
+
<read>
|
|
79
|
+
<path>src/main.py</path>
|
|
80
|
+
</read>
|
|
81
|
+
|
|
82
|
+
<read>
|
|
83
|
+
<path>src/auth.py</path>
|
|
84
|
+
<lines>1-20,45-80,150-200</lines>
|
|
85
|
+
</read>
|
|
64
86
|
\`\`\`
|
|
65
87
|
|
|
66
|
-
### \`grep
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
88
|
+
### \`grep\`
|
|
89
|
+
Search for pattern matches across files. Returns matches with 1 line of context above and below.
|
|
90
|
+
- Match lines use \`:\` separator \u2192 \`filepath:linenum:content\`
|
|
91
|
+
- Context lines use \`-\` separator \u2192 \`filepath-linenum-content\`
|
|
92
|
+
|
|
93
|
+
Elements:
|
|
94
|
+
- \`<pattern>\` (required): Search pattern (regex). Use \`(a|b)\` for OR patterns.
|
|
95
|
+
- \`<sub_dir>\` (optional): Subdirectory to search in (defaults to \`.\`)
|
|
96
|
+
- \`<glob>\` (optional): File pattern filter like \`*.py\` or \`*.{ts,tsx}\`
|
|
70
97
|
|
|
71
98
|
Examples:
|
|
72
99
|
\`\`\`
|
|
73
|
-
grep
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
grep
|
|
100
|
+
<grep>
|
|
101
|
+
<pattern>(authenticate|authorize|login)</pattern>
|
|
102
|
+
<sub_dir>src/auth/</sub_dir>
|
|
103
|
+
</grep>
|
|
104
|
+
|
|
105
|
+
<grep>
|
|
106
|
+
<pattern>class.*(Service|Controller)</pattern>
|
|
107
|
+
<glob>*.{ts,js}</glob>
|
|
108
|
+
</grep>
|
|
109
|
+
|
|
110
|
+
<grep>
|
|
111
|
+
<pattern>(DB_HOST|DATABASE_URL|connection)</pattern>
|
|
112
|
+
<glob>*.{py,yaml,env}</glob>
|
|
113
|
+
<sub_dir>lib/</sub_dir>
|
|
114
|
+
</grep>
|
|
77
115
|
\`\`\`
|
|
78
116
|
|
|
79
|
-
### \`finish
|
|
80
|
-
Submit final answer with all relevant code locations.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
117
|
+
### \`finish\`
|
|
118
|
+
Submit final answer with all relevant code locations. Uses nested \`<file>\` elements.
|
|
119
|
+
|
|
120
|
+
File elements:
|
|
121
|
+
- \`<path>\` (required): File path
|
|
122
|
+
- \`<lines>\` (optional): Line ranges like "1-50,75-80" (\`*\` for entire file)
|
|
123
|
+
|
|
124
|
+
ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.
|
|
86
125
|
|
|
87
126
|
Examples:
|
|
88
127
|
\`\`\`
|
|
89
|
-
finish
|
|
90
|
-
|
|
128
|
+
<finish>
|
|
129
|
+
<file>
|
|
130
|
+
<path>src/auth.py</path>
|
|
131
|
+
<lines>1-15,25-50,75-80</lines>
|
|
132
|
+
</file>
|
|
133
|
+
<file>
|
|
134
|
+
<path>src/models/user.py</path>
|
|
135
|
+
<lines>*</lines>
|
|
136
|
+
</file>
|
|
137
|
+
</finish>
|
|
91
138
|
\`\`\`
|
|
92
139
|
</tools>
|
|
93
140
|
|
|
94
141
|
<strategy>
|
|
95
|
-
**Before your first tool call, classify the
|
|
142
|
+
**Before your first tool call, classify the search_string:**
|
|
96
143
|
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by
|
|
100
|
-
| **Conceptual** (how does X work, where is Y handled) |
|
|
101
|
-
| **Exploratory** (find all tests, list API endpoints) |
|
|
144
|
+
| Search_string Type | Round 1 Strategy | Early Finish? |
|
|
145
|
+
|------------|------------------|---------------|
|
|
146
|
+
| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |
|
|
147
|
+
| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |
|
|
148
|
+
| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |
|
|
102
149
|
|
|
103
150
|
**Parallel call patterns:**
|
|
104
151
|
- **Shotgun grep**: Same pattern, 8 different directories\u2014fast coverage
|
|
105
152
|
- **Variant grep**: 8 pattern variations (synonyms, naming conventions)\u2014catches inconsistent codebases
|
|
106
|
-
- **Funnel**: 1
|
|
153
|
+
- **Funnel**: 1 list_directory + 7 greps\u2014orient and search simultaneously
|
|
107
154
|
- **Deep read**: 8 reads on files you already identified\u2014gather full context fast
|
|
155
|
+
|
|
156
|
+
**Tool call expectations:**
|
|
157
|
+
- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.
|
|
158
|
+
- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.
|
|
159
|
+
- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.
|
|
160
|
+
- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.
|
|
108
161
|
</strategy>
|
|
109
162
|
|
|
110
163
|
<output_format>
|
|
111
164
|
EVERY response MUST follow this exact format:
|
|
112
165
|
|
|
113
166
|
1. First, wrap your reasoning in \`<think>...</think>\` tags containing:
|
|
114
|
-
-
|
|
115
|
-
- Confidence estimate (can I finish in 1-2
|
|
116
|
-
- This
|
|
167
|
+
- Search_string classification (specific/conceptual/exploratory)
|
|
168
|
+
- Confidence estimate (can I finish in 1-2 rounds?)
|
|
169
|
+
- This round's parallel strategy
|
|
117
170
|
- What signals would let me finish early?
|
|
118
171
|
|
|
119
|
-
2. Then, output
|
|
172
|
+
2. Then, output up to 8 tool calls using nested XML elements.
|
|
120
173
|
|
|
121
174
|
Example:
|
|
122
175
|
\`\`\`
|
|
123
176
|
<think>
|
|
124
|
-
This is a specific
|
|
125
|
-
High confidence I can finish in 2
|
|
177
|
+
This is a specific search_string about authentication. I'll grep for auth-related patterns.
|
|
178
|
+
High confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root
|
|
126
179
|
Strategy: Shotgun grep across likely directories.
|
|
127
180
|
</think>
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
<
|
|
181
|
+
<grep>
|
|
182
|
+
<pattern>(authenticate|login|session)</pattern>
|
|
183
|
+
<sub_dir>src/auth/</sub_dir>
|
|
184
|
+
</grep>
|
|
185
|
+
<grep>
|
|
186
|
+
<pattern>(middleware|interceptor)</pattern>
|
|
187
|
+
<glob>*.{ts,js}</glob>
|
|
188
|
+
</grep>
|
|
189
|
+
<list_directory>
|
|
190
|
+
<path>src/auth</path>
|
|
191
|
+
</list_directory>
|
|
192
|
+
\`\`\`
|
|
193
|
+
|
|
194
|
+
Finishing example:
|
|
195
|
+
\`\`\`
|
|
196
|
+
<think>
|
|
197
|
+
I think I have a rough idea, but this is my last turn so I must call the finish tool regardless.
|
|
198
|
+
</think>
|
|
199
|
+
<finish>
|
|
200
|
+
<file>
|
|
201
|
+
<path>src/auth/login.py</path>
|
|
202
|
+
<lines>1-50</lines>
|
|
203
|
+
</file>
|
|
204
|
+
<file>
|
|
205
|
+
<path>src/middleware/session.py</path>
|
|
206
|
+
<lines>10-80</lines>
|
|
207
|
+
</file>
|
|
208
|
+
</finish>
|
|
131
209
|
\`\`\`
|
|
132
210
|
|
|
133
211
|
No commentary outside \`<think>\`. No explanations after tool calls.
|
|
@@ -140,9 +218,7 @@ When calling \`finish\`:
|
|
|
140
218
|
- Include any type definitions, interfaces, or constants used
|
|
141
219
|
- Better to over-include than leave the user missing context
|
|
142
220
|
- If unsure about boundaries, include more rather than less
|
|
143
|
-
</finishing_requirements
|
|
144
|
-
|
|
145
|
-
Begin your exploration now to find code relevant to the query.`;
|
|
221
|
+
</finishing_requirements>`;
|
|
146
222
|
function getSystemPrompt() {
|
|
147
223
|
return SYSTEM_PROMPT;
|
|
148
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../tools/warp_grep/agent/prompt.ts"],"sourcesContent":["export const SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given
|
|
1
|
+
{"version":3,"sources":["../../../../tools/warp_grep/agent/prompt.ts"],"sourcesContent":["export const SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given search_string.\n\n### workflow\nYou have exactly 4 turns. The 4th turn MUST be a \\`finish\\` call. Each turn allows up to 8 parallel tool calls.\n\n- Turn 1: Map the territory OR dive deep (based on search_string specificity)\n- Turn 2-3: Refine based on findings\n- Turn 4: MUST call \\`finish\\` with all relevant code locations\n- You MAY call \\`finish\\` early if confident—but never before at least 1 search turn.\n- The user strongly prefers if you can call the finish tool early, but you must be correct\n\nRemember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed\n\n### tools\nTool calls use nested XML elements:\n\\`\\`\\`xml\n<tool_name>\n <parameter>value</parameter>\n</tool_name>\n\\`\\`\\`\n\n### \\`list_directory\\`\nDirectory tree view. Shows structure of a path, optionally filtered by regex pattern.\n\nElements:\n- \\`<path>\\` (required): Directory path to list (use \\`.\\` for repo root)\n- \\`<pattern>\\` (optional): Regex to filter results\n\nExamples:\n\\`\\`\\`\n<list_directory>\n <path>src/services</path>\n</list_directory>\n\n<list_directory>\n <path>lib/utils</path>\n <pattern>.*\\\\.(ts|js)$</pattern>\n</list_directory>\n\\`\\`\\`\n\n### \\`read\\`\nRead file contents. Supports multiple line ranges.\n- Returns numbered lines for easy reference\n- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nElements:\n- \\`<path>\\` (required): File path to read\n- \\`<lines>\\` (optional): Line ranges like \"1-50,75-80,100-120\" (omit to read entire file)\n\nExamples:\n\\`\\`\\`\n<read>\n <path>src/main.py</path>\n</read>\n\n<read>\n <path>src/auth.py</path>\n <lines>1-20,45-80,150-200</lines>\n</read>\n\\`\\`\\`\n\n### \\`grep\\`\nSearch for pattern matches across files. Returns matches with 1 line of context above and below.\n- Match lines use \\`:\\` separator → \\`filepath:linenum:content\\`\n- Context lines use \\`-\\` separator → \\`filepath-linenum-content\\`\n\nElements:\n- \\`<pattern>\\` (required): Search pattern (regex). Use \\`(a|b)\\` for OR patterns.\n- \\`<sub_dir>\\` (optional): Subdirectory to search in (defaults to \\`.\\`)\n- \\`<glob>\\` (optional): File pattern filter like \\`*.py\\` or \\`*.{ts,tsx}\\`\n\nExamples:\n\\`\\`\\`\n<grep>\n <pattern>(authenticate|authorize|login)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n\n<grep>\n <pattern>class.*(Service|Controller)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n\n<grep>\n <pattern>(DB_HOST|DATABASE_URL|connection)</pattern>\n <glob>*.{py,yaml,env}</glob>\n <sub_dir>lib/</sub_dir>\n</grep>\n\\`\\`\\`\n\n### \\`finish\\`\nSubmit final answer with all relevant code locations. Uses nested \\`<file>\\` elements.\n\nFile elements:\n- \\`<path>\\` (required): File path\n- \\`<lines>\\` (optional): Line ranges like \"1-50,75-80\" (\\`*\\` for entire file)\n\nALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nExamples:\n\\`\\`\\`\n<finish>\n <file>\n <path>src/auth.py</path>\n <lines>1-15,25-50,75-80</lines>\n </file>\n <file>\n <path>src/models/user.py</path>\n <lines>*</lines>\n </file>\n</finish>\n\\`\\`\\`\n</tools>\n\n<strategy>\n**Before your first tool call, classify the search_string:**\n\n| Search_string Type | Round 1 Strategy | Early Finish? |\n|------------|------------------|---------------|\n| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |\n| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |\n| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |\n\n**Parallel call patterns:**\n- **Shotgun grep**: Same pattern, 8 different directories—fast coverage\n- **Variant grep**: 8 pattern variations (synonyms, naming conventions)—catches inconsistent codebases\n- **Funnel**: 1 list_directory + 7 greps—orient and search simultaneously\n- **Deep read**: 8 reads on files you already identified—gather full context fast\n\n**Tool call expectations:**\n- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.\n- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.\n- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.\n- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.\n</strategy>\n\n<output_format>\nEVERY response MUST follow this exact format:\n\n1. First, wrap your reasoning in \\`<think>...</think>\\` tags containing:\n - Search_string classification (specific/conceptual/exploratory)\n - Confidence estimate (can I finish in 1-2 rounds?)\n - This round's parallel strategy\n - What signals would let me finish early?\n\n2. Then, output up to 8 tool calls using nested XML elements.\n\nExample:\n\\`\\`\\`\n<think>\nThis is a specific search_string about authentication. I'll grep for auth-related patterns.\nHigh confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root\nStrategy: Shotgun grep across likely directories.\n</think>\n<grep>\n <pattern>(authenticate|login|session)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n<grep>\n <pattern>(middleware|interceptor)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n<list_directory>\n <path>src/auth</path>\n</list_directory>\n\\`\\`\\`\n\nFinishing example:\n\\`\\`\\`\n<think>\nI think I have a rough idea, but this is my last turn so I must call the finish tool regardless.\n</think>\n<finish>\n <file>\n <path>src/auth/login.py</path>\n <lines>1-50</lines>\n </file>\n <file>\n <path>src/middleware/session.py</path>\n <lines>10-80</lines>\n </file>\n</finish>\n\\`\\`\\`\n\nNo commentary outside \\`<think>\\`. No explanations after tool calls.\n</output_format>\n\n<finishing_requirements>\nWhen calling \\`finish\\`:\n- Include the import section (typically lines 1-20) of each file\n- Include all function/class definitions that are relevant\n- Include any type definitions, interfaces, or constants used\n- Better to over-include than leave the user missing context\n- If unsure about boundaries, include more rather than less\n</finishing_requirements>`;\n\nexport function getSystemPrompt(): string {\n return SYSTEM_PROMPT;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoMtB,SAAS,kBAA0B;AACxC,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SYSTEM_PROMPT = "You are a code search agent. Your task is to find all relevant code for a given
|
|
1
|
+
declare const SYSTEM_PROMPT = "You are a code search agent. Your task is to find all relevant code for a given search_string.\n\n### workflow\nYou have exactly 4 turns. The 4th turn MUST be a `finish` call. Each turn allows up to 8 parallel tool calls.\n\n- Turn 1: Map the territory OR dive deep (based on search_string specificity)\n- Turn 2-3: Refine based on findings\n- Turn 4: MUST call `finish` with all relevant code locations\n- You MAY call `finish` early if confident\u2014but never before at least 1 search turn.\n- The user strongly prefers if you can call the finish tool early, but you must be correct\n\nRemember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed\n\n### tools\nTool calls use nested XML elements:\n```xml\n<tool_name>\n <parameter>value</parameter>\n</tool_name>\n```\n\n### `list_directory`\nDirectory tree view. Shows structure of a path, optionally filtered by regex pattern.\n\nElements:\n- `<path>` (required): Directory path to list (use `.` for repo root)\n- `<pattern>` (optional): Regex to filter results\n\nExamples:\n```\n<list_directory>\n <path>src/services</path>\n</list_directory>\n\n<list_directory>\n <path>lib/utils</path>\n <pattern>.*\\.(ts|js)$</pattern>\n</list_directory>\n```\n\n### `read`\nRead file contents. Supports multiple line ranges.\n- Returns numbered lines for easy reference\n- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nElements:\n- `<path>` (required): File path to read\n- `<lines>` (optional): Line ranges like \"1-50,75-80,100-120\" (omit to read entire file)\n\nExamples:\n```\n<read>\n <path>src/main.py</path>\n</read>\n\n<read>\n <path>src/auth.py</path>\n <lines>1-20,45-80,150-200</lines>\n</read>\n```\n\n### `grep`\nSearch for pattern matches across files. Returns matches with 1 line of context above and below.\n- Match lines use `:` separator \u2192 `filepath:linenum:content`\n- Context lines use `-` separator \u2192 `filepath-linenum-content`\n\nElements:\n- `<pattern>` (required): Search pattern (regex). Use `(a|b)` for OR patterns.\n- `<sub_dir>` (optional): Subdirectory to search in (defaults to `.`)\n- `<glob>` (optional): File pattern filter like `*.py` or `*.{ts,tsx}`\n\nExamples:\n```\n<grep>\n <pattern>(authenticate|authorize|login)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n\n<grep>\n <pattern>class.*(Service|Controller)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n\n<grep>\n <pattern>(DB_HOST|DATABASE_URL|connection)</pattern>\n <glob>*.{py,yaml,env}</glob>\n <sub_dir>lib/</sub_dir>\n</grep>\n```\n\n### `finish`\nSubmit final answer with all relevant code locations. Uses nested `<file>` elements.\n\nFile elements:\n- `<path>` (required): File path\n- `<lines>` (optional): Line ranges like \"1-50,75-80\" (`*` for entire file)\n\nALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nExamples:\n```\n<finish>\n <file>\n <path>src/auth.py</path>\n <lines>1-15,25-50,75-80</lines>\n </file>\n <file>\n <path>src/models/user.py</path>\n <lines>*</lines>\n </file>\n</finish>\n```\n</tools>\n\n<strategy>\n**Before your first tool call, classify the search_string:**\n\n| Search_string Type | Round 1 Strategy | Early Finish? |\n|------------|------------------|---------------|\n| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |\n| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |\n| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |\n\n**Parallel call patterns:**\n- **Shotgun grep**: Same pattern, 8 different directories\u2014fast coverage\n- **Variant grep**: 8 pattern variations (synonyms, naming conventions)\u2014catches inconsistent codebases\n- **Funnel**: 1 list_directory + 7 greps\u2014orient and search simultaneously\n- **Deep read**: 8 reads on files you already identified\u2014gather full context fast\n\n**Tool call expectations:**\n- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.\n- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.\n- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.\n- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.\n</strategy>\n\n<output_format>\nEVERY response MUST follow this exact format:\n\n1. First, wrap your reasoning in `<think>...</think>` tags containing:\n - Search_string classification (specific/conceptual/exploratory)\n - Confidence estimate (can I finish in 1-2 rounds?)\n - This round's parallel strategy\n - What signals would let me finish early?\n\n2. Then, output up to 8 tool calls using nested XML elements.\n\nExample:\n```\n<think>\nThis is a specific search_string about authentication. I'll grep for auth-related patterns.\nHigh confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root\nStrategy: Shotgun grep across likely directories.\n</think>\n<grep>\n <pattern>(authenticate|login|session)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n<grep>\n <pattern>(middleware|interceptor)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n<list_directory>\n <path>src/auth</path>\n</list_directory>\n```\n\nFinishing example:\n```\n<think>\nI think I have a rough idea, but this is my last turn so I must call the finish tool regardless.\n</think>\n<finish>\n <file>\n <path>src/auth/login.py</path>\n <lines>1-50</lines>\n </file>\n <file>\n <path>src/middleware/session.py</path>\n <lines>10-80</lines>\n </file>\n</finish>\n```\n\nNo commentary outside `<think>`. No explanations after tool calls.\n</output_format>\n\n<finishing_requirements>\nWhen calling `finish`:\n- Include the import section (typically lines 1-20) of each file\n- Include all function/class definitions that are relevant\n- Include any type definitions, interfaces, or constants used\n- Better to over-include than leave the user missing context\n- If unsure about boundaries, include more rather than less\n</finishing_requirements>";
|
|
2
2
|
declare function getSystemPrompt(): string;
|
|
3
3
|
|
|
4
4
|
export { SYSTEM_PROMPT, getSystemPrompt };
|