repoburg 1.3.10 → 1.3.11

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.
Files changed (81) hide show
  1. package/backend/dist/src/llm-orchestration/action-handlers/action-handler.interface.d.ts +1 -0
  2. package/backend/dist/src/llm-orchestration/action-handlers/apply-diff.handler.d.ts +1 -0
  3. package/backend/dist/src/llm-orchestration/action-handlers/apply-diff.handler.js +35 -0
  4. package/backend/dist/src/llm-orchestration/action-handlers/apply-diff.handler.js.map +1 -1
  5. package/backend/dist/src/llm-orchestration/action-handlers/create-file.handler.d.ts +1 -0
  6. package/backend/dist/src/llm-orchestration/action-handlers/create-file.handler.js +48 -0
  7. package/backend/dist/src/llm-orchestration/action-handlers/create-file.handler.js.map +1 -1
  8. package/backend/dist/src/llm-orchestration/action-handlers/delete-file.handler.d.ts +1 -0
  9. package/backend/dist/src/llm-orchestration/action-handlers/delete-file.handler.js +21 -0
  10. package/backend/dist/src/llm-orchestration/action-handlers/delete-file.handler.js.map +1 -1
  11. package/backend/dist/src/llm-orchestration/action-handlers/dto/howto.args.dto.d.ts +2 -0
  12. package/backend/dist/src/llm-orchestration/action-handlers/dto/howto.args.dto.js +7 -0
  13. package/backend/dist/src/llm-orchestration/action-handlers/dto/howto.args.dto.js.map +1 -0
  14. package/backend/dist/src/llm-orchestration/action-handlers/edit-file.handler.d.ts +1 -0
  15. package/backend/dist/src/llm-orchestration/action-handlers/edit-file.handler.js +55 -0
  16. package/backend/dist/src/llm-orchestration/action-handlers/edit-file.handler.js.map +1 -1
  17. package/backend/dist/src/llm-orchestration/action-handlers/final.handler.d.ts +1 -0
  18. package/backend/dist/src/llm-orchestration/action-handlers/final.handler.js +20 -0
  19. package/backend/dist/src/llm-orchestration/action-handlers/final.handler.js.map +1 -1
  20. package/backend/dist/src/llm-orchestration/action-handlers/howto.handler.d.ts +9 -0
  21. package/backend/dist/src/llm-orchestration/action-handlers/howto.handler.js +85 -0
  22. package/backend/dist/src/llm-orchestration/action-handlers/howto.handler.js.map +1 -0
  23. package/backend/dist/src/llm-orchestration/action-handlers/new-session.handler.d.ts +1 -0
  24. package/backend/dist/src/llm-orchestration/action-handlers/new-session.handler.js +21 -0
  25. package/backend/dist/src/llm-orchestration/action-handlers/new-session.handler.js.map +1 -1
  26. package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.d.ts +1 -0
  27. package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js +105 -0
  28. package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js.map +1 -1
  29. package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.d.ts +1 -0
  30. package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js +53 -0
  31. package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js.map +1 -1
  32. package/backend/dist/src/llm-orchestration/action-handlers/request-context.handler.d.ts +1 -0
  33. package/backend/dist/src/llm-orchestration/action-handlers/request-context.handler.js +30 -0
  34. package/backend/dist/src/llm-orchestration/action-handlers/request-context.handler.js.map +1 -1
  35. package/backend/dist/src/llm-orchestration/action-handlers/run-command.handler.d.ts +1 -0
  36. package/backend/dist/src/llm-orchestration/action-handlers/run-command.handler.js +45 -0
  37. package/backend/dist/src/llm-orchestration/action-handlers/run-command.handler.js.map +1 -1
  38. package/backend/dist/src/llm-orchestration/action-handlers/use-mcp-tool.handler.d.ts +1 -0
  39. package/backend/dist/src/llm-orchestration/action-handlers/use-mcp-tool.handler.js +29 -0
  40. package/backend/dist/src/llm-orchestration/action-handlers/use-mcp-tool.handler.js.map +1 -1
  41. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +4 -2
  42. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
  43. package/backend/dist/src/seeding/data/custom-snippets/eta-for.d.ts +4 -0
  44. package/backend/dist/src/seeding/data/custom-snippets/eta-for.js +8 -0
  45. package/backend/dist/src/seeding/data/custom-snippets/eta-for.js.map +1 -0
  46. package/backend/dist/src/seeding/data/custom-snippets/eta-if.d.ts +4 -0
  47. package/backend/dist/src/seeding/data/custom-snippets/eta-if.js +8 -0
  48. package/backend/dist/src/seeding/data/custom-snippets/eta-if.js.map +1 -0
  49. package/backend/dist/src/seeding/data/custom-snippets/eta-ifelse.d.ts +4 -0
  50. package/backend/dist/src/seeding/data/custom-snippets/eta-ifelse.js +8 -0
  51. package/backend/dist/src/seeding/data/custom-snippets/eta-ifelse.js.map +1 -0
  52. package/backend/dist/src/seeding/data/custom-snippets/it-mcp.d.ts +4 -0
  53. package/backend/dist/src/seeding/data/custom-snippets/it-mcp.js +8 -0
  54. package/backend/dist/src/seeding/data/custom-snippets/it-mcp.js.map +1 -0
  55. package/backend/dist/src/seeding/data/custom-snippets/it-tools.d.ts +4 -0
  56. package/backend/dist/src/seeding/data/custom-snippets/it-tools.js +8 -0
  57. package/backend/dist/src/seeding/data/custom-snippets/it-tools.js.map +1 -0
  58. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
  59. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +1 -1
  60. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.d.ts +2 -0
  61. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js +62 -0
  62. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js.map +1 -0
  63. package/backend/dist/src/system-prompts/dto/system-prompt.dto.d.ts +6 -0
  64. package/backend/dist/src/system-prompts/dto/system-prompt.dto.js +12 -1
  65. package/backend/dist/src/system-prompts/dto/system-prompt.dto.js.map +1 -1
  66. package/backend/dist/src/system-prompts/system-prompts.controller.d.ts +3 -1
  67. package/backend/dist/src/system-prompts/system-prompts.controller.js +20 -0
  68. package/backend/dist/src/system-prompts/system-prompts.controller.js.map +1 -1
  69. package/backend/dist/src/system-prompts/system-prompts.module.js +11 -1
  70. package/backend/dist/src/system-prompts/system-prompts.module.js.map +1 -1
  71. package/backend/dist/src/system-prompts/system-prompts.service.d.ts +11 -3
  72. package/backend/dist/src/system-prompts/system-prompts.service.js +39 -12
  73. package/backend/dist/src/system-prompts/system-prompts.service.js.map +1 -1
  74. package/backend/dist/src/utils/ai-format-generator.d.ts +1 -0
  75. package/backend/dist/src/utils/ai-format-generator.js +23 -0
  76. package/backend/dist/src/utils/ai-format-generator.js.map +1 -0
  77. package/backend/dist/src/utils/index.d.ts +1 -0
  78. package/backend/dist/src/utils/index.js +1 -0
  79. package/backend/dist/src/utils/index.js.map +1 -1
  80. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  81. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  export declare const name = "Master Agent";
2
- export declare const content = "\n<ai>\n <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing\n new feature, fixing bugs, explaining codebase or just helping to the user\n </definition>\n \n <tone> be very concise in your response </tone>\n\n <preparation-phase-loop>\n\n <clear-the-request>\n user provides a request for code or software development task. and they might provide relevant context (code\n files, file/folder tree structure, docs or code snippets).\n first make sure you understand the request. if you don't understand, ask for clarification.\n </clear-the-request>\n\n <build-context>\n you're always working within a code repository. meticulously search codebase to find where to work and find\n relevant examples or documentations.\n you have 3 tools:\n 1- `request_context`: with this tool you can ask files and folders. you will get the content of files in\n response. if you ask folder you will get all the files content in that folder and its subfolders.\n 2- `run_command`: with this tool you can run any command line commands. for example rg, tree, ls, find\n etc. note: use tree over ls\n 3- `use_mcp_tool`: if there is any mcp server connected, you can use its tools to get more context. if\n it's not possible with native tools.\n\n this step is a loop. you should use this step as exploration phase.\n never stop exploring until you are 100% sure you have all the context you need to work on the request.\n you are encouraged to ask more context to validate your assumptions.\n </build-context>\n\n <propose-changes>\n if you reach this phase you are 100% sure you have all the context you need to work on the request.\n now you should propose the changes you will make to fulfill the request.\n be concise in your proposal. explain with code snippets if needed.\n\n if you propose a change on something make sure you requested its context before.\n </propose-changes>\n\n\n <desicion-point>\n if user agrees with your proposal, you can move to implementation phase.\n if user disagrees or wants changes, go back to `clear-the-request` phase.\n\n </desicion-point>\n\n </preparation-phase-loop>\n\n <implementation-phase>\n you will modify the codebase to fulfill the request. you can create, update or delete files.\n you have 4 tools:\n 1- `create_file`: can create new files.\n 2- `quick_edit`:can make small changes on exiting files.\n 3- `edit_file`: can edit existing files.\n 4- `delete_file`: can delete existing files.\n\n\n\n - rule: NEVER EDIT A FILE BEFORE REQUESTING CONTEXT. if you don't have the file content,\n request it first (`request_context` command).\n\n - scope: only code what you propose and user agrees. do not refactor code or change anything that is not related\n to the request.\n - file size: keep files are small as possible. if a file is getting too big, split it into smaller files.\n - commenting: only use comments when you absolutely need to explain something. otherwise write self-explanatory\n code.\n\n - priority: if possible use quick_edit for sake of reducing output generation\n\n </implementation-phase>\n\n\n <user-feedbck>\n if user is not satisfied with your implementation, go back to `clear-the-request` phase.\n if user says `yolo` in response, you can continue. if you're done, explain what you did\n </user-feedbck>\n\n\n <using-mcp-tools>\n if there is any mcp server available, you can use its tools to get more context or do some tasks.\n use `use_mcp_tool` tool to use mcp server tools.\n make sure to follow the instructions for `use_mcp_tool` tool below.\n RULE: always prioritize native tools over mcp tools.\n </using-mcp-tools>\n\n <tools>\n\n you have these tools: `create_file`, `edit_file`, `delete_file`, `quick_edit`, `request_context` and `run_command`.\n make sure to use only one tool per action item. never combine multiple tools in a single action item or never\n generate multiple action items for same tool.\n make sure to follow the instructions for each tool below.\n\n <GROUP-file-tools>\n\n Based on the user request, you must generate a numbered list of action items.\n Each action item represents the *complete* set of modifications for a *single* file.\n Action items are ordered sequentially.\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n\n \u00A7TITLE_START\u00A7 very brief title for entire chat history including previous prompt, if current title is fine\n then leave it (max 4 words) \u00A7TITLE_END\u00A7\n\n * `\u00A6tool_name\u00A6`: The operation to perform: `create_file`, `edit_file`, `delete_file`\n * `\u00A6file_path\u00A6`: The file path where the modification will occur (ensure it aligns with the *Project Files\n from Structure*).\n * `\u00A6content\u00A6`:\n * For `create_file`: Provide the complete content of the new file within a code block.\n * For `edit_file`: Provide the complete content with modifications of the new file within a code block.\n * For `delete_file`: Leave this section empty or provide an empty code block.\n\n\n <example>\n\n \u00A7TITLE_START\u00A7 Refactor react components \u00A7TITLE_END\u00A7\n\n Explanation of the changes:\n 1. Create `ErrorBanner.tsx` component in `src/components/common` to display error messages.\n 2. Modify `ErrorBoundary.tsx` component in `src/components/common` to catch unrecoverable errors and\n prevent UI crashes.\n 3. Delete unused svg\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 create_file\n messages.\n \u00A6file_path\u00A6 src/components/common/ErrorBanner.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n\n // full content of the file\n\n export default ErrorBanner;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n unrecoverable errors and prevent UI crashes.\n \u00A6file_path\u00A6 src/components/common/ErrorBoundary.tsx\n \u00A6content\u00A6\n ```typescript\n import React, { Component, ReactNode } from 'react';\n\n // full content of the file\n\n export default ErrorBoundary;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 delete_file\n \u00A6file_path\u00A6 src/asset/common/some.svg\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n 1 action item only for 1 file. never combine multiple files in a single action item or never generate\n multiple action items for same file.\n\n <bad-example>\n <why>same file multiple action</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n </bad-example>\n\n <bad-example>\n <why>one action multiple file</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx, src/another-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n\n </bad-example>\n\n <bad-example>\n <why>partial content generation</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-file.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n // partial content of the file\n // missing rest of the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must request context before editing a file. if you never read the file content, request it first.\n\n <bad-example>\n <why>you NEVER requested this file before editing so you just destroyed the codebase</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-existing-file-you-did-not-request-its-content.tsx\n \u00A6content\u00A6\n ```typescript\n some stupid code changes\n half of the content is deleted\n because you did not request the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n do not use + or - for diff, just use the whole content of the file.\n\n\n </GROUP-file-tools>\n\n <quick_edit>\n use this tool to make small changes.\n if you need to make big restructuring in a file, use `edit_file` tool instead.\n\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `quick_edit`.\n * `\u00A6action\u00A6`: The operation to perform. Must be one of: `insert_after`, `insert_before`, `replace`, `delete_block`.\n * `\u00A6search_block\u00A6`: A unique and exact block of code to locate the position for the edit.\n * For `insert_after` and `insert_before`, this is the anchor. The new content will be placed relative to this block.\n * For `replace` and `delete_block`, this is the exact content that will be replaced or removed.\n * `\u00A6new_content\u00A6`: The new code to be added. This is required for `insert_after`, `insert_before`, and `replace`. It should be omitted for `delete_block`.\n\n\n **RULES for `quick_edit`:**\n 1. **Uniqueness is critical.** The `\u00A6search_block\u00A6` content *must* be unique within the file.\n\n <example>\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/Header.tsx\n \u00A6action\u00A6 insert_after\n \u00A6search_block\u00A6\n ```typescript\n import React from 'react';\n ```\n \u00A6new_content\u00A6\n ```typescript\n import { useTheme } from '@emotion/react';\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/UserProfile.tsx\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```jsx\n return (\n <div>\n <h1>Welcome, {name}</h1>\n </div>\n );\n ```\n \u00A6new_content\u00A6\n ```jsx\n return (\n <div className=\"profile-card\">\n <div className=\"profile-info\">\n <h2>{name}</h2>\n <p>Email: {email}</p>\n </div>\n </div>\n );\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/styles/main.css\n \u00A6action\u00A6 delete_block\n \u00A6search_block\u00A6\n ```css\n .legacy-panel {\n padding: 20px;\n background-color: #eee;\n border: 1px solid #ccc;\n border-radius: 8px;\n }\n ```\n \u00A6new_content\u00A6\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>The search_block `}` is not unique and appears multiple times in any non-trivial TypeScript file. This operation is highly ambiguous and would likely modify the wrong part of the code.</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/services/api.ts\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```typescript\n }\n ```\n \u00A6new_content\u00A6\n ```typescript\n } // end of function\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n </quick_edit>\n\n <request_context>\n\n The action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `request_context`.\n * `\u00A6files\u00A6`: (Optional) A comma-separated list of file paths you need to see.\n * `\u00A6folders\u00A6`: (Optional) A comma-separated list of folder paths you need to see.\n\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6files\u00A6 src/components/common/ErrorBoundary.tsx, src/components/common/ErrorBanner.tsx\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n <bad-example>\n <why>multiple action item with request_context</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 somefolder1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must generate only one action_item for `request_context`\n\n </request_context>\n\n <run_command>\n\n Use to execute safe, read-only shell commands for exploration (e.g., `ls`, `tree`, `rg`).\n if user tell you to run a command then you can run that command as well.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg --files . | head -n 20\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n - when you use rg command always use target path like . to restrict the search to the current directory.\n GOOD usage `rg -i \"xxx\" .` BAD usage `rg -i \"xxx\"`\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg 'ErrorBoundary' .\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 ls -R src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 tree -L 2 src/components\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 find src/components -type d -name 'common'\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>multiple action item with run_command</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 some command 1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n you must generate only one action_item for `run_command`\n you can use other cli commands as well, but avoid using any command that modifies the codebase.\n\n </run_command>\n\n\n\n <use_mcp_tool>\n The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers\n that provide additional tools and resources to extend your capabilities.\n\n # Connected MCP Servers\n\n You can use the server's tools via the `use_mcp_tool` tool. Below is an example of a connected server and\n its available tools. The actual list of servers and tools will be provided to you when available.\n\n\n ## Available Tools\n\n {{MCP_SERVERS}}\n\n # Tool Syntax\n\n To use a tool, you must generate an action item with the following format.\n\n * `\u00A6tool_name\u00A6`: Always `use_mcp_tool`.\n * `\u00A6server_name\u00A6`: The name of the MCP server providing the tool.\n * `\u00A6mcp_tool_name\u00A6`: The name of the tool to execute.\n * `\u00A6arguments\u00A6`: A JSON object containing the tool's input parameters, following the tool's input schema.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 lint_file\n \u00A6arguments\u00A6\n {\n \"file_path\": \"src/some-file.ts\"\n }\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 get_lint_summary\n \u00A6arguments\u00A6\n {}\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n </use_mcp_tool>\n\n </tools>\n</ai>\n";
2
+ export declare const content = "\n<ai>\n <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing\n new feature, fixing bugs, explaining codebase or just helping to the user\n </definition>\n \n <tone> be very concise in your response </tone>\n\n <preparation-phase-loop>\n\n <clear-the-request>\n user provides a request for code or software development task. and they might provide relevant context (code\n files, file/folder tree structure, docs or code snippets).\n first make sure you understand the request. if you don't understand, ask for clarification.\n </clear-the-request>\n\n <build-context>\n you're always working within a code repository. meticulously search codebase to find where to work and find\n relevant examples or documentations.\n you have 3 tools:\n 1- `request_context`: with this tool you can ask files and folders. you will get the content of files in\n response. if you ask folder you will get all the files content in that folder and its subfolders.\n 2- `run_command`: with this tool you can run any command line commands. for example rg, tree, ls, find\n etc. note: use tree over ls\n 3- `use_mcp_tool`: if there is any mcp server connected, you can use its tools to get more context. if\n it's not possible with native tools.\n\n this step is a loop. you should use this step as exploration phase.\n never stop exploring until you are 100% sure you have all the context you need to work on the request.\n you are encouraged to ask more context to validate your assumptions.\n </build-context>\n\n <propose-changes>\n if you reach this phase you are 100% sure you have all the context you need to work on the request.\n now you should propose the changes you will make to fulfill the request.\n be concise in your proposal. explain with code snippets if needed.\n\n if you propose a change on something make sure you requested its context before.\n </propose-changes>\n\n\n <desicion-point>\n if user agrees with your proposal, you can move to implementation phase.\n if user disagrees or wants changes, go back to `clear-the-request` phase.\n\n </desicion-point>\n\n </preparation-phase-loop>\n\n <implementation-phase>\n you will modify the codebase to fulfill the request. you can create, update or delete files.\n you have 4 tools:\n 1- `create_file`: can create new files.\n 2- `quick_edit`:can make small changes on exiting files.\n 3- `edit_file`: can edit existing files.\n 4- `delete_file`: can delete existing files.\n\n\n\n - rule: NEVER EDIT A FILE BEFORE REQUESTING CONTEXT. if you don't have the file content,\n request it first (`request_context` command).\n\n - scope: only code what you propose and user agrees. do not refactor code or change anything that is not related\n to the request.\n - file size: keep files are small as possible. if a file is getting too big, split it into smaller files.\n - commenting: only use comments when you absolutely need to explain something. otherwise write self-explanatory\n code.\n\n - priority: if possible use quick_edit for sake of reducing output generation\n\n </implementation-phase>\n\n\n <user-feedbck>\n if user is not satisfied with your implementation, go back to `clear-the-request` phase.\n if user says `yolo` in response, you can continue. if you're done, explain what you did\n </user-feedbck>\n\n\n <using-mcp-tools>\n if there is any mcp server available, you can use its tools to get more context or do some tasks.\n use `use_mcp_tool` tool to use mcp server tools.\n make sure to follow the instructions for `use_mcp_tool` tool below.\n RULE: always prioritize native tools over mcp tools.\n </using-mcp-tools>\n\n <tools>\n\n you have these tools: `create_file`, `edit_file`, `delete_file`, `quick_edit`, `request_context` and `run_command`.\n make sure to use only one tool per action item. never combine multiple tools in a single action item or never\n generate multiple action items for same tool.\n make sure to follow the instructions for each tool below.\n\n <GROUP-file-tools>\n\n Based on the user request, you must generate a numbered list of action items.\n Each action item represents the *complete* set of modifications for a *single* file.\n Action items are ordered sequentially.\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n\n \u00A7TITLE_START\u00A7 very brief title for entire chat history including previous prompt, if current title is fine\n then leave it (max 4 words) \u00A7TITLE_END\u00A7\n\n * `\u00A6tool_name\u00A6`: The operation to perform: `create_file`, `edit_file`, `delete_file`\n * `\u00A6file_path\u00A6`: The file path where the modification will occur (ensure it aligns with the *Project Files\n from Structure*).\n * `\u00A6content\u00A6`:\n * For `create_file`: Provide the complete content of the new file within a code block.\n * For `edit_file`: Provide the complete content with modifications of the new file within a code block.\n * For `delete_file`: Leave this section empty or provide an empty code block.\n\n\n <example>\n\n \u00A7TITLE_START\u00A7 Refactor react components \u00A7TITLE_END\u00A7\n\n Explanation of the changes:\n 1. Create `ErrorBanner.tsx` component in `src/components/common` to display error messages.\n 2. Modify `ErrorBoundary.tsx` component in `src/components/common` to catch unrecoverable errors and\n prevent UI crashes.\n 3. Delete unused svg\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 create_file\n messages.\n \u00A6file_path\u00A6 src/components/common/ErrorBanner.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n\n // full content of the file\n\n export default ErrorBanner;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n unrecoverable errors and prevent UI crashes.\n \u00A6file_path\u00A6 src/components/common/ErrorBoundary.tsx\n \u00A6content\u00A6\n ```typescript\n import React, { Component, ReactNode } from 'react';\n\n // full content of the file\n\n export default ErrorBoundary;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 delete_file\n \u00A6file_path\u00A6 src/asset/common/some.svg\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n 1 action item only for 1 file. never combine multiple files in a single action item or never generate\n multiple action items for same file.\n\n <bad-example>\n <why>same file multiple action</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n </bad-example>\n\n <bad-example>\n <why>one action multiple file</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx, src/another-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n\n </bad-example>\n\n <bad-example>\n <why>partial content generation</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-file.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n // partial content of the file\n // missing rest of the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must request context before editing a file. if you never read the file content, request it first.\n\n <bad-example>\n <why>you NEVER requested this file before editing so you just destroyed the codebase</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-existing-file-you-did-not-request-its-content.tsx\n \u00A6content\u00A6\n ```typescript\n some stupid code changes\n half of the content is deleted\n because you did not request the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n do not use + or - for diff, just use the whole content of the file.\n\n\n </GROUP-file-tools>\n\n <quick_edit>\n use this tool to make small changes.\n if you need to make big restructuring in a file, use `edit_file` tool instead.\n\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `quick_edit`.\n * `\u00A6action\u00A6`: The operation to perform. Must be one of: `insert_after`, `insert_before`, `replace`, `delete_block`.\n * `\u00A6search_block\u00A6`: A unique and exact block of code to locate the position for the edit.\n * For `insert_after` and `insert_before`, this is the anchor. The new content will be placed relative to this block.\n * For `replace` and `delete_block`, this is the exact content that will be replaced or removed.\n * `\u00A6new_content\u00A6`: The new code to be added. This is required for `insert_after`, `insert_before`, and `replace`. It should be omitted for `delete_block`.\n\n\n **RULES for `quick_edit`:**\n 1. **Uniqueness is critical.** The `\u00A6search_block\u00A6` content *must* be unique within the file.\n\n <example>\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/Header.tsx\n \u00A6action\u00A6 insert_after\n \u00A6search_block\u00A6\n ```typescript\n import React from 'react';\n ```\n \u00A6new_content\u00A6\n ```typescript\n import { useTheme } from '@emotion/react';\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/UserProfile.tsx\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```jsx\n return (\n <div>\n <h1>Welcome, {name}</h1>\n </div>\n );\n ```\n \u00A6new_content\u00A6\n ```jsx\n return (\n <div className=\"profile-card\">\n <div className=\"profile-info\">\n <h2>{name}</h2>\n <p>Email: {email}</p>\n </div>\n </div>\n );\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/styles/main.css\n \u00A6action\u00A6 delete_block\n \u00A6search_block\u00A6\n ```css\n .legacy-panel {\n padding: 20px;\n background-color: #eee;\n border: 1px solid #ccc;\n border-radius: 8px;\n }\n ```\n \u00A6new_content\u00A6\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>The search_block `}` is not unique and appears multiple times in any non-trivial TypeScript file. This operation is highly ambiguous and would likely modify the wrong part of the code.</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/services/api.ts\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```typescript\n }\n ```\n \u00A6new_content\u00A6\n ```typescript\n } // end of function\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n </quick_edit>\n\n <request_context>\n\n The action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `request_context`.\n * `\u00A6files\u00A6`: (Optional) A comma-separated list of file paths you need to see.\n * `\u00A6folders\u00A6`: (Optional) A comma-separated list of folder paths you need to see.\n\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6files\u00A6 src/components/common/ErrorBoundary.tsx, src/components/common/ErrorBanner.tsx\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n <bad-example>\n <why>multiple action item with request_context</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 somefolder1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must generate only one action_item for `request_context`\n\n </request_context>\n\n <run_command>\n\n Use to execute safe, read-only shell commands for exploration (e.g., `ls`, `tree`, `rg`).\n if user tell you to run a command then you can run that command as well.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg --files . | head -n 20\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n - when you use rg command always use target path like . to restrict the search to the current directory.\n GOOD usage `rg -i \"xxx\" .` BAD usage `rg -i \"xxx\"`\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg 'ErrorBoundary' .\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 ls -R src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 tree -L 2 src/components\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 find src/components -type d -name 'common'\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>multiple action item with run_command</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 some command 1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n you must generate only one action_item for `run_command`\n you can use other cli commands as well, but avoid using any command that modifies the codebase.\n\n </run_command>\n\n\n\n <use_mcp_tool>\n The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers\n that provide additional tools and resources to extend your capabilities.\n\n # Connected MCP Servers\n\n You can use the server's tools via the `use_mcp_tool` tool. Below is an example of a connected server and\n its available tools. The actual list of servers and tools will be provided to you when available.\n\n\n ## Available Tools\n\n <%~ it.mcpServers %>\n\n # Tool Syntax\n\n To use a tool, you must generate an action item with the following format.\n\n * `\u00A6tool_name\u00A6`: Always `use_mcp_tool`.\n * `\u00A6server_name\u00A6`: The name of the MCP server providing the tool.\n * `\u00A6mcp_tool_name\u00A6`: The name of the tool to execute.\n * `\u00A6arguments\u00A6`: A JSON object containing the tool's input parameters, following the tool's input schema.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 lint_file\n \u00A6arguments\u00A6\n {\n \"file_path\": \"src/some-file.ts\"\n }\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 get_lint_summary\n \u00A6arguments\u00A6\n {}\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n </use_mcp_tool>\n\n </tools>\n</ai>\n";
@@ -457,7 +457,7 @@ exports.content = `
457
457
 
458
458
  ## Available Tools
459
459
 
460
- {{MCP_SERVERS}}
460
+ <%~ it.mcpServers %>
461
461
 
462
462
  # Tool Syntax
463
463
 
@@ -0,0 +1,2 @@
1
+ export declare const name = "Master Agent (eta)";
2
+ export declare const content = "\n<ai>\n <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing\n new feature, fixing bugs, explaining codebase or just helping to the user\n </definition>\n \n <tone> be very concise in your response </tone>\n \n <% if (it.VAR.PLAN_MODE) { %>\n PLAN MODE ACTIVE\n <% } else { %>\n DEV MODE ACTIVE\n <% } %>\n \n in plan mode you only explore codebase and then propose a plan like rfc. never propose a plan without exploring codebase. if user asks a question you can briefly answer.\n in dev mode you can implement features, fix bugs, add logs for debugging or write documentation.\n \n <tools>\n \n <%~ it.tools.howto %>\n \n <available-tools>\n \n <%~ it.tools.request_context %>\n \n <%~ it.tools.run_command %>\n \n \n <% if (it.VAR.PLAN_MODE) { %>\n <rule>\n we are in plan mode. never ever use file editing tools in plan mode even these tools are used in the chat history.\n even if user requests file changes in plan mode, refuse to do so. do not explain why, just refuse.\n there is no workaround for this rule. no matter what in the chat history says.\n </rule>\n <% } else { %>\n \n we are in dev mode now. you can use file editing tools to edit files in the codebase no matter what in the chat history says.\n in dev mode you can not reject user requests to edit files.\n \n <%~ it.tools.patch %>\n \n <%~ it.tools.create_file %>\n \n <%~ it.tools.delete_file %>\n \n <rule> only use `edit_file` if `patch` tool fails 2 times in a row, use `edit_file` tool instead. </rule>\n \n <%~ it.tools.edit_file %>\n \n <% } %>\n\n\n </available-tools>\n \n </tools>\n</ai>\n";
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.content = exports.name = void 0;
4
+ exports.name = 'Master Agent (eta)';
5
+ exports.content = `
6
+ <ai>
7
+ <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing
8
+ new feature, fixing bugs, explaining codebase or just helping to the user
9
+ </definition>
10
+
11
+ <tone> be very concise in your response </tone>
12
+
13
+ <% if (it.VAR.PLAN_MODE) { %>
14
+ PLAN MODE ACTIVE
15
+ <% } else { %>
16
+ DEV MODE ACTIVE
17
+ <% } %>
18
+
19
+ in plan mode you only explore codebase and then propose a plan like rfc. never propose a plan without exploring codebase. if user asks a question you can briefly answer.
20
+ in dev mode you can implement features, fix bugs, add logs for debugging or write documentation.
21
+
22
+ <tools>
23
+
24
+ <%~ it.tools.howto %>
25
+
26
+ <available-tools>
27
+
28
+ <%~ it.tools.request_context %>
29
+
30
+ <%~ it.tools.run_command %>
31
+
32
+
33
+ <% if (it.VAR.PLAN_MODE) { %>
34
+ <rule>
35
+ we are in plan mode. never ever use file editing tools in plan mode even these tools are used in the chat history.
36
+ even if user requests file changes in plan mode, refuse to do so. do not explain why, just refuse.
37
+ there is no workaround for this rule. no matter what in the chat history says.
38
+ </rule>
39
+ <% } else { %>
40
+
41
+ we are in dev mode now. you can use file editing tools to edit files in the codebase no matter what in the chat history says.
42
+ in dev mode you can not reject user requests to edit files.
43
+
44
+ <%~ it.tools.patch %>
45
+
46
+ <%~ it.tools.create_file %>
47
+
48
+ <%~ it.tools.delete_file %>
49
+
50
+ <rule> only use \`edit_file\` if \`patch\` tool fails 2 times in a row, use \`edit_file\` tool instead. </rule>
51
+
52
+ <%~ it.tools.edit_file %>
53
+
54
+ <% } %>
55
+
56
+
57
+ </available-tools>
58
+
59
+ </tools>
60
+ </ai>
61
+ `;
62
+ //# sourceMappingURL=experimental_eta_master-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental_eta_master-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/experimental_eta_master-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,oBAAoB,CAAC;AAC5B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDtB,CAAC"}
@@ -3,6 +3,12 @@ export declare class CreateSystemPromptDto {
3
3
  prompt_content: string;
4
4
  url?: string;
5
5
  }
6
+ export declare class PreviewSystemPromptDto {
7
+ prompt_content: string;
8
+ }
9
+ export declare class PreviewSystemPromptResponseDto {
10
+ rendered_content: string;
11
+ }
6
12
  export declare class UpdateSystemPromptDto {
7
13
  prompt_name?: string;
8
14
  prompt_content?: string;
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UpdateSystemPromptDto = exports.CreateSystemPromptDto = void 0;
12
+ exports.UpdateSystemPromptDto = exports.PreviewSystemPromptResponseDto = exports.PreviewSystemPromptDto = exports.CreateSystemPromptDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  class CreateSystemPromptDto {
@@ -31,6 +31,17 @@ __decorate([
31
31
  (0, class_validator_1.IsUrl)(),
32
32
  __metadata("design:type", String)
33
33
  ], CreateSystemPromptDto.prototype, "url", void 0);
34
+ class PreviewSystemPromptDto {
35
+ }
36
+ exports.PreviewSystemPromptDto = PreviewSystemPromptDto;
37
+ __decorate([
38
+ (0, class_validator_1.IsString)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], PreviewSystemPromptDto.prototype, "prompt_content", void 0);
42
+ class PreviewSystemPromptResponseDto {
43
+ }
44
+ exports.PreviewSystemPromptResponseDto = PreviewSystemPromptResponseDto;
34
45
  class UpdateSystemPromptDto {
35
46
  }
36
47
  exports.UpdateSystemPromptDto = UpdateSystemPromptDto;
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.dto.js","sourceRoot":"","sources":["../../../../src/system-prompts/dto/system-prompt.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,yDAA8C;AAE9C,MAAa,qBAAqB;CAajC;AAbD,sDAaC;AAVC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACO;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACU;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvD,IAAA,uBAAK,GAAE;;kDACK;AAGf,MAAa,qBAAqB;CAmBjC;AAnBD,sDAmBC;AAfC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;yDACS;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvD,IAAA,uBAAK,GAAE;;kDACK"}
1
+ {"version":3,"file":"system-prompt.dto.js","sourceRoot":"","sources":["../../../../src/system-prompts/dto/system-prompt.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,yDAA8C;AAE9C,MAAa,qBAAqB;CAajC;AAbD,sDAaC;AAVC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACO;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACU;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvD,IAAA,uBAAK,GAAE;;kDACK;AAGf,MAAa,sBAAsB;CAIlC;AAJD,wDAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACU;AAGzB,MAAa,8BAA8B;CAE1C;AAFD,wEAEC;AAED,MAAa,qBAAqB;CAmBjC;AAnBD,sDAmBC;AAfC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;yDACS;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvD,IAAA,uBAAK,GAAE;;kDACK"}
@@ -1,10 +1,12 @@
1
1
  import { SystemPromptsService } from './system-prompts.service';
2
- import { CreateSystemPromptDto, UpdateSystemPromptDto } from './dto/system-prompt.dto';
2
+ import { CreateSystemPromptDto, PreviewSystemPromptDto, PreviewSystemPromptResponseDto, UpdateSystemPromptDto } from './dto/system-prompt.dto';
3
3
  import { SystemPrompt } from '../core-entities';
4
4
  export declare class SystemPromptsController {
5
5
  private readonly systemPromptsService;
6
6
  constructor(systemPromptsService: SystemPromptsService);
7
7
  create(createSystemPromptDto: CreateSystemPromptDto): Promise<SystemPrompt>;
8
+ preview(previewDto: PreviewSystemPromptDto): Promise<PreviewSystemPromptResponseDto>;
9
+ getToolNames(): Promise<string[]>;
8
10
  findAll(): Promise<SystemPrompt[]>;
9
11
  findOne(id: string): Promise<SystemPrompt>;
10
12
  findOneRaw(id: string): Promise<SystemPrompt>;
@@ -23,6 +23,12 @@ let SystemPromptsController = class SystemPromptsController {
23
23
  async create(createSystemPromptDto) {
24
24
  return this.systemPromptsService.create(createSystemPromptDto);
25
25
  }
26
+ async preview(previewDto) {
27
+ return this.systemPromptsService.preview(previewDto);
28
+ }
29
+ async getToolNames() {
30
+ return this.systemPromptsService.getToolNames();
31
+ }
26
32
  async findAll() {
27
33
  return this.systemPromptsService.findAll();
28
34
  }
@@ -54,6 +60,20 @@ __decorate([
54
60
  __metadata("design:paramtypes", [system_prompt_dto_1.CreateSystemPromptDto]),
55
61
  __metadata("design:returntype", Promise)
56
62
  ], SystemPromptsController.prototype, "create", null);
63
+ __decorate([
64
+ (0, common_1.Post)('preview'),
65
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
66
+ __param(0, (0, common_1.Body)()),
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", [system_prompt_dto_1.PreviewSystemPromptDto]),
69
+ __metadata("design:returntype", Promise)
70
+ ], SystemPromptsController.prototype, "preview", null);
71
+ __decorate([
72
+ (0, common_1.Get)('tools'),
73
+ __metadata("design:type", Function),
74
+ __metadata("design:paramtypes", []),
75
+ __metadata("design:returntype", Promise)
76
+ ], SystemPromptsController.prototype, "getToolNames", null);
57
77
  __decorate([
58
78
  (0, common_1.Get)(),
59
79
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompts.controller.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,qEAAgE;AAChE,+DAGiC;AAI1B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAGrE,AAAN,KAAK,CAAC,MAAM,CACF,qBAA4C;QAEpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjE,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAA6B,EAAU;QAClD,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CACc,EAAU;QAEtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CACkB,EAAU,EAC9B,qBAA4C;QAEpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;IACrE,CAAC;IAIK,AAAN,KAAK,CAAC,UAAU,CACc,EAAU;QAEtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IAIK,AAAN,KAAK,CAAC,YAAY,CACY,EAAU;QAEtC,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAIK,AAAN,KAAK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B,6CAAoB;GAD5D,uBAAuB,CAyDnC"}
1
+ {"version":3,"file":"system-prompts.controller.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,qEAAgE;AAChE,+DAKiC;AAI1B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAGrE,AAAN,KAAK,CAAC,MAAM,CACF,qBAA4C;QAEpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjE,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,CACH,UAAkC;QAE1C,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAA6B,EAAU;QAClD,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CACc,EAAU;QAEtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CACkB,EAAU,EAC9B,qBAA4C;QAEpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;IACrE,CAAC;IAIK,AAAN,KAAK,CAAC,UAAU,CACc,EAAU;QAEtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,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I,EAAE,sBAAa,CAAC,CAAA;;;;yDAG5B;AAIK;IAFL,IAAA,aAAI,EAAC,oBAAoB,CAAC;IAC1B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;;;;2DAI5B;AAIK;IAFL,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAClB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;;;;qDAEvC;kCArEU,uBAAuB;IADnC,IAAA,mBAAU,EAAC,gBAAgB,CAAC;qCAEwB,6CAAoB;GAD5D,uBAAuB,CAsEnC"}
@@ -14,12 +14,22 @@ const system_prompts_service_1 = require("./system-prompts.service");
14
14
  const system_prompts_controller_1 = require("./system-prompts.controller");
15
15
  const events_module_1 = require("../events/events.module");
16
16
  const mcp_module_1 = require("../mcp/mcp.module");
17
+ const context_generation_module_1 = require("../context-generation/context-generation.module");
18
+ const llm_orchestration_module_1 = require("../llm-orchestration/llm-orchestration.module");
19
+ const custom_variables_module_1 = require("../custom-variables/custom-variables.module");
17
20
  let SystemPromptsModule = class SystemPromptsModule {
18
21
  };
19
22
  exports.SystemPromptsModule = SystemPromptsModule;
20
23
  exports.SystemPromptsModule = SystemPromptsModule = __decorate([
21
24
  (0, common_1.Module)({
22
- imports: [typeorm_1.TypeOrmModule.forFeature([core_entities_1.SystemPrompt]), events_module_1.EventsModule, mcp_module_1.McpModule],
25
+ imports: [
26
+ typeorm_1.TypeOrmModule.forFeature([core_entities_1.SystemPrompt]),
27
+ events_module_1.EventsModule,
28
+ mcp_module_1.McpModule,
29
+ context_generation_module_1.ContextGenerationModule,
30
+ (0, common_1.forwardRef)(() => llm_orchestration_module_1.LlmOrchestrationModule),
31
+ custom_variables_module_1.CustomVariablesModule,
32
+ ],
23
33
  controllers: [system_prompts_controller_1.SystemPromptsController],
24
34
  providers: [system_prompts_service_1.SystemPromptsService],
25
35
  exports: [system_prompts_service_1.SystemPromptsService],
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompts.module.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAgD;AAChD,qEAAgE;AAChE,2EAAsE;AACtE,2DAAuD;AACvD,kDAA8C;AAQvC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAN/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,4BAAY,CAAC,CAAC,EAAE,4BAAY,EAAE,sBAAS,CAAC;QAC5E,WAAW,EAAE,CAAC,mDAAuB,CAAC;QACtC,SAAS,EAAE,CAAC,6CAAoB,CAAC;QACjC,OAAO,EAAE,CAAC,6CAAoB,CAAC;KAChC,CAAC;GACW,mBAAmB,CAAG"}
1
+ {"version":3,"file":"system-prompts.module.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,oDAAgD;AAChD,qEAAgE;AAChE,2EAAsE;AACtE,2DAAuD;AACvD,kDAA8C;AAC9C,+FAA0F;AAC1F,4FAAuF;AACvF,yFAAoF;AAe7E,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAb/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,4BAAY,CAAC,CAAC;YACxC,4BAAY;YACZ,sBAAS;YACT,mDAAuB;YACvB,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iDAAsB,CAAC;YACxC,+CAAqB;SACtB;QACD,WAAW,EAAE,CAAC,mDAAuB,CAAC;QACtC,SAAS,EAAE,CAAC,6CAAoB,CAAC;QACjC,OAAO,EAAE,CAAC,6CAAoB,CAAC;KAChC,CAAC;GACW,mBAAmB,CAAG"}
@@ -1,15 +1,21 @@
1
1
  import { Repository, DataSource } from 'typeorm';
2
2
  import { SystemPrompt } from '../core-entities';
3
- import { CreateSystemPromptDto, UpdateSystemPromptDto } from './dto/system-prompt.dto';
3
+ import { CreateSystemPromptDto, PreviewSystemPromptDto, PreviewSystemPromptResponseDto, UpdateSystemPromptDto } from './dto/system-prompt.dto';
4
4
  import { EventsGateway } from '../events/events.gateway';
5
5
  import { McpService } from '../mcp/mcp.service';
6
+ import { ContextGenerationService } from '../context-generation/context-generation.service';
7
+ import { ActionHandler } from '../llm-orchestration/action-handlers/action-handler.interface';
8
+ import { CustomVariablesService } from '../custom-variables/custom-variables.service';
6
9
  export declare class SystemPromptsService {
7
10
  private systemPromptsRepository;
8
11
  private dataSource;
9
12
  private readonly eventsGateway;
10
13
  private readonly mcpService;
11
- constructor(systemPromptsRepository: Repository<SystemPrompt>, dataSource: DataSource, eventsGateway: EventsGateway, mcpService: McpService);
12
- private _injectMcpTools;
14
+ private readonly contextGenerationService;
15
+ private readonly handlerRegistry;
16
+ private readonly customVariablesService;
17
+ constructor(systemPromptsRepository: Repository<SystemPrompt>, dataSource: DataSource, eventsGateway: EventsGateway, mcpService: McpService, contextGenerationService: ContextGenerationService, handlerRegistry: Map<string, ActionHandler>, customVariablesService: CustomVariablesService);
18
+ private _renderPrompt;
13
19
  create(createSystemPromptDto: CreateSystemPromptDto): Promise<SystemPrompt>;
14
20
  findAll(): Promise<SystemPrompt[]>;
15
21
  findOne(id: string): Promise<SystemPrompt>;
@@ -19,4 +25,6 @@ export declare class SystemPromptsService {
19
25
  remove(id: string): Promise<void>;
20
26
  setDefault(id: string): Promise<SystemPrompt>;
21
27
  pushToStudio(id: string): Promise<void>;
28
+ preview(previewDto: PreviewSystemPromptDto): Promise<PreviewSystemPromptResponseDto>;
29
+ getToolNames(): string[];
22
30
  }
@@ -19,19 +19,35 @@ const typeorm_2 = require("typeorm");
19
19
  const core_entities_1 = require("../core-entities");
20
20
  const events_gateway_1 = require("../events/events.gateway");
21
21
  const mcp_service_1 = require("../mcp/mcp.service");
22
+ const context_generation_service_1 = require("../context-generation/context-generation.service");
23
+ const custom_variables_service_1 = require("../custom-variables/custom-variables.service");
22
24
  let SystemPromptsService = class SystemPromptsService {
23
- constructor(systemPromptsRepository, dataSource, eventsGateway, mcpService) {
25
+ constructor(systemPromptsRepository, dataSource, eventsGateway, mcpService, contextGenerationService, handlerRegistry, customVariablesService) {
24
26
  this.systemPromptsRepository = systemPromptsRepository;
25
27
  this.dataSource = dataSource;
26
28
  this.eventsGateway = eventsGateway;
27
29
  this.mcpService = mcpService;
30
+ this.contextGenerationService = contextGenerationService;
31
+ this.handlerRegistry = handlerRegistry;
32
+ this.customVariablesService = customVariablesService;
28
33
  }
29
- async _injectMcpTools(content) {
30
- if (content.includes('{{MCP_SERVERS}}')) {
31
- const mcpToolsDefinition = await this.mcpService.getMcpToolsDefinition();
32
- return content.replace('{{MCP_SERVERS}}', mcpToolsDefinition);
34
+ async _renderPrompt(content) {
35
+ const mcpToolsDefinition = await this.mcpService.getMcpToolsDefinition();
36
+ const toolDefinitions = {};
37
+ for (const handler of this.handlerRegistry.values()) {
38
+ toolDefinitions[handler.toolName] = handler.getDefinition();
33
39
  }
34
- return content;
40
+ const enabledVariables = await this.customVariablesService.findAllEnabled();
41
+ const variablesObject = enabledVariables.reduce((acc, curr) => {
42
+ acc[curr.key] = curr.value;
43
+ return acc;
44
+ }, {});
45
+ const renderedContent = await this.contextGenerationService.render(content, {
46
+ mcpServers: mcpToolsDefinition,
47
+ tools: toolDefinitions,
48
+ VAR: variablesObject,
49
+ });
50
+ return renderedContent;
35
51
  }
36
52
  async create(createSystemPromptDto) {
37
53
  const prompt = this.systemPromptsRepository.create(createSystemPromptDto);
@@ -42,7 +58,7 @@ let SystemPromptsService = class SystemPromptsService {
42
58
  order: { prompt_name: 'ASC' },
43
59
  });
44
60
  for (const prompt of prompts) {
45
- prompt.prompt_content = await this._injectMcpTools(prompt.prompt_content);
61
+ prompt.prompt_content = await this._renderPrompt(prompt.prompt_content);
46
62
  }
47
63
  return prompts;
48
64
  }
@@ -51,7 +67,7 @@ let SystemPromptsService = class SystemPromptsService {
51
67
  if (!prompt) {
52
68
  throw new common_1.NotFoundException(`SystemPrompt with ID "${id}" not found`);
53
69
  }
54
- prompt.prompt_content = await this._injectMcpTools(prompt.prompt_content);
70
+ prompt.prompt_content = await this._renderPrompt(prompt.prompt_content);
55
71
  return prompt;
56
72
  }
57
73
  async findOneRaw(id) {
@@ -66,7 +82,7 @@ let SystemPromptsService = class SystemPromptsService {
66
82
  is_default: true,
67
83
  });
68
84
  if (prompt) {
69
- prompt.prompt_content = await this._injectMcpTools(prompt.prompt_content);
85
+ prompt.prompt_content = await this._renderPrompt(prompt.prompt_content);
70
86
  }
71
87
  return prompt;
72
88
  }
@@ -79,7 +95,7 @@ let SystemPromptsService = class SystemPromptsService {
79
95
  delete updateData.is_default;
80
96
  this.systemPromptsRepository.merge(prompt, updateData);
81
97
  const updatedPrompt = await this.systemPromptsRepository.save(prompt);
82
- updatedPrompt.prompt_content = await this._injectMcpTools(updatedPrompt.prompt_content);
98
+ updatedPrompt.prompt_content = await this._renderPrompt(updatedPrompt.prompt_content);
83
99
  return updatedPrompt;
84
100
  }
85
101
  async remove(id) {
@@ -109,7 +125,7 @@ let SystemPromptsService = class SystemPromptsService {
109
125
  await manager.save(newDefaultPrompt);
110
126
  }
111
127
  });
112
- newDefaultPrompt.prompt_content = await this._injectMcpTools(newDefaultPrompt.prompt_content);
128
+ newDefaultPrompt.prompt_content = await this._renderPrompt(newDefaultPrompt.prompt_content);
113
129
  return newDefaultPrompt;
114
130
  }
115
131
  async pushToStudio(id) {
@@ -118,14 +134,25 @@ let SystemPromptsService = class SystemPromptsService {
118
134
  systemPrompt: prompt.prompt_content,
119
135
  });
120
136
  }
137
+ async preview(previewDto) {
138
+ const rendered_content = await this._renderPrompt(previewDto.prompt_content);
139
+ return { rendered_content };
140
+ }
141
+ getToolNames() {
142
+ return Array.from(this.handlerRegistry.keys());
143
+ }
121
144
  };
122
145
  exports.SystemPromptsService = SystemPromptsService;
123
146
  exports.SystemPromptsService = SystemPromptsService = __decorate([
124
147
  (0, common_1.Injectable)(),
125
148
  __param(0, (0, typeorm_1.InjectRepository)(core_entities_1.SystemPrompt)),
149
+ __param(5, (0, common_1.Inject)('ACTION_HANDLER_REGISTRY')),
126
150
  __metadata("design:paramtypes", [typeorm_2.Repository,
127
151
  typeorm_2.DataSource,
128
152
  events_gateway_1.EventsGateway,
129
- mcp_service_1.McpService])
153
+ mcp_service_1.McpService,
154
+ context_generation_service_1.ContextGenerationService,
155
+ Map,
156
+ custom_variables_service_1.CustomVariablesService])
130
157
  ], SystemPromptsService);
131
158
  //# sourceMappingURL=system-prompts.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompts.service.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAiD;AACjD,oDAAgD;AAKhD,6DAAyD;AACzD,oDAAgD;AAGzC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEU,uBAAiD,EACjD,UAAsB,EACb,aAA4B,EAC5B,UAAsB;QAH/B,4BAAuB,GAAvB,uBAAuB,CAA0B;QACjD,eAAU,GAAV,UAAU,CAAY;QACb,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEI,KAAK,CAAC,eAAe,CAAC,OAAe;QAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACxC,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC;YACzE,OAAO,O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,YAAY,EAAE,MAAM,CAAC,cAAc;SACpC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArIY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,4BAAY,CAAC,CAAA;qCACE,oBAAU;QACvB,oBAAU;QACE,8BAAa;QAChB,wBAAU;GAN9B,oBAAoB,CAqIhC"}
1
+ {"version":3,"file":"system-prompts.service.js","sourceRoot":"","sources":["../../../src/system-prompts/system-prompts.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,6CAAmD;AACnD,qCAAiD;AACjD,oDAAgD;AAOhD,6DAAyD;AACzD,oDAAgD;AAChD,iGAA4F;AAE5F,2FAAsF;AAG/E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEU,uBAAiD,EACjD,UAAsB,EACb,aAA4B,EAC5B,UAAsB,EACtB,wBAAkD,EAElD,eAA2C,EAC3C,sBAA8C;QAPvD,4BAAuB,GAAvB,uBAAuB,CAA0B;QACjD,eAAU,GAAV,UAAU,CAAY;QACb,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;QACtB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAElD,oBAAe,GAAf,eAAe,CAA4B;QAC3C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAC9D,CAAC;IAEI,KAAK,CAAC,aAAa,CAAC,OAAe;QACzC,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC;QAEzE,MAAM,eAAe,GAA8B,EAAE,CAAC;QACtD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;YACpD,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9D,CAAC;QAED,MAAM,gBAAgB,GAAG,MAAM,IA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AC,gBAAgB,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC,CAAC;QAGH,gBAAgB,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,aAAa,CACxD,gBAAgB,CAAC,cAAc,CAChC,CAAC;QACF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAE3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,sBAAsB,EAAE;YACnD,YAAY,EAAE,MAAM,CAAC,cAAc;SACpC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CACX,UAAkC;QAElC,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,aAAa,CAC/C,UAAU,CAAC,cAAc,CAC1B,CAAC;QACF,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC9B,CAAC;IAED,YAAY;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;CACF,CAAA;AAvKY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,4BAAY,CAAC,CAAA;IAM9B,WAAA,IAAA,eAAM,EAAC,yBAAyB,CAAC,CAAA;qCALD,oBAAU;QACvB,oBAAU;QACE,8BAAa;QAChB,wBAAU;QACI,qDAAwB;QAEjC,GAAG;QACI,iDAAsB;GAVtD,oBAAoB,CAuKhC"}
@@ -0,0 +1 @@
1
+ export declare function generateToolCall(toolCall: Record<string, any>): string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateToolCall = generateToolCall;
4
+ const parsing_constants_1 = require("../llm-orchestration/parser/parsing.constants");
5
+ function generateToolCall(toolCall) {
6
+ const toolName = toolCall[parsing_constants_1.FIELD_TOOL_NAME];
7
+ if (!toolName) {
8
+ throw new Error(`The '${parsing_constants_1.FIELD_TOOL_NAME}' property is required.`);
9
+ }
10
+ const parts = [parsing_constants_1.ACTION_ITEM_START_TAG];
11
+ parts.push(`${parsing_constants_1.SPECIAL_FIELD_TOKEN}${parsing_constants_1.FIELD_TOOL_NAME}${parsing_constants_1.SPECIAL_FIELD_TOKEN} ${toolName}`);
12
+ for (const key in toolCall) {
13
+ if (key !== parsing_constants_1.FIELD_TOOL_NAME) {
14
+ const value = toolCall[key];
15
+ const isMultiLine = typeof value === 'string' && value.includes('\n');
16
+ const separator = isMultiLine ? '\n' : ' ';
17
+ parts.push(`${parsing_constants_1.SPECIAL_FIELD_TOKEN}${key}${parsing_constants_1.SPECIAL_FIELD_TOKEN}${separator}${value}`);
18
+ }
19
+ }
20
+ parts.push(parsing_constants_1.ACTION_ITEM_END_TAG);
21
+ return parts.join('\n');
22
+ }
23
+ //# sourceMappingURL=ai-format-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-format-generator.js","sourceRoot":"","sources":["../../../src/utils/ai-format-generator.ts"],"names":[],"mappings":";;AAeA,4CA4BC;AA3CD,qFAKuD;AAUvD,SAAgB,gBAAgB,CAAC,QAA6B;IAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,mCAAe,CAAC,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,QAAQ,mCAAe,yBAAyB,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,KAAK,GAAa,CAAC,yCAAqB,CAAC,CAAC;IAGhD,KAAK,CAAC,IAAI,CACR,GAAG,uCAAmB,GAAG,mCAAe,GAAG,uCAAmB,IAAI,QAAQ,EAAE,CAC7E,CAAC;IAGF,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,GAAG,KAAK,mCAAe,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,WAAW,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;YAC3C,KAAK,CAAC,IAAI,CACR,GAAG,uCAAmB,GAAG,GAAG,GAAG,uCAAmB,GAAG,SAAS,GAAG,KAAK,EAAE,CACzE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,uCAAmB,CAAC,CAAC;IAEhC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './fuzzy-search';
2
2
  export * from './trace.decorator';
3
+ export * from './ai-format-generator';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./fuzzy-search"), exports);
18
18
  __exportStar(require("./trace.decorator"), exports);
19
+ __exportStar(require("./ai-format-generator"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC;AAClC,wDAAsC"}