You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/navie/src/agents/explain-agent.ts
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,47 @@ classDiagram
263
263
</example>
264
264
`;
265
265
266
+
constAPPMAP_HINT_PROMPT=`
267
+
## Recommending AppMap Recordings
268
+
269
+
As you provide your response, consider whether your statements could be improved if the user had provided
270
+
additional context in the form of an AppMap recording - essentially, runtime traces. If so, add an
271
+
\`appmap\` XML tag following the statement that could be improved. This will prompt the user to provide such information; the tags
272
+
will be used to provide specialized UI to help the user accomplish this task. You can use many of these tags spread throughout your
273
+
response text as you need, each associated with a specific statement that could be made more accurate with this data.
274
+
275
+
Provide a \`prompt\` attribute to the \`appmap\` tag, which will be used to initiate a conversation with an assistant to help
276
+
the user create AppMaps. You should use \`@observe\` prefix in the prompt which will choose the correct assistant.
277
+
278
+
You can additionally provide a \`reasoning\` attribute to the \`appmap\` tag, which will be used to explain
279
+
how an AppMap recording would provide additional context.
280
+
281
+
Make sure that all recommendations for AppMap recordings are kept only to these tags ONLY. Do not mention AppMap in the
282
+
running text of your response unless the user has specifically asked for it.
283
+
284
+
Note recording AppMaps is currently only supported in Ruby, Python, Java and JavaScript (server-side only, ie. Node.js) applications.
285
+
Do not recommend AppMap recordings for other languages or environments.
286
+
287
+
Examples:
288
+
289
+
\`\`\`markdown
290
+
If you suspect redundant calls to the \`foo\` method, you should investigate further. Check to see if the \`foo\` method is being
291
+
called more than once <appmap prompt="@observe record and analyze tests that involve the foo method to identify redundant calls" />.
292
+
This will help you identify and eliminate inefficiencies in your code.
293
+
\`\`\`
294
+
295
+
\`\`\`markdown
296
+
The JWT token might not be properly stored or transmitted in subsequent requests. This could lead to issues with authentication
297
+
or session management. <appmap reasoning="An AppMap trace would show if the JWT token is being properly included in request headers after login"
298
+
prompt="@observe record a session including the authentication flow, focusing on login and subsequent API requests to verify token usage" />. Ensuring proper token handling is critical for secure communication.
299
+
\`\`\`
300
+
301
+
\`\`\`markdown
302
+
Authentication filters can sometimes cause unexpected behavior. Check that your authentication filter isn't accidentally catching the login endpoints themselves <appmap reasoning="An AppMap trace would reveal if the auth filter is intercepting login requests, causing a loop"
303
+
prompt="@observe record both authenticated and unauthenticated HTTP requests, including login attempts, to identify potential filter misconfigurations" />. This will help you avoid potential infinite loops or access issues.
0 commit comments