@polka-codes/core 0.8.19 → 0.8.20

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 (2) hide show
  1. package/dist/index.js +6 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1042,7 +1042,7 @@ var getArray = (args, name, defaultValue) => {
1042
1042
 
1043
1043
  // src/tools/utils/replaceInFile.ts
1044
1044
  var replaceInFile = async (fileContent, diff) => {
1045
- const blockPattern = /<<<<<+ SEARCH\s*\r?\n([\s\S]*?)\r?\n=======[ \t]*\r?\n([\s\S]*?)\r?\n?>>>>>+ REPLACE/g;
1045
+ const blockPattern = /<<<<<+ SEARCH>?\s*\r?\n([\s\S]*?)\r?\n=======[ \t]*\r?\n([\s\S]*?)\r?\n?>>>>>+ REPLACE/g;
1046
1046
  const blocks = [];
1047
1047
  for (let match = blockPattern.exec(diff); match !== null; match = blockPattern.exec(diff)) {
1048
1048
  blocks.push({ search: match[1], replace: match[2] });
@@ -2674,18 +2674,14 @@ ${tools.map((tool) => {
2674
2674
  }).join("")}
2675
2675
  # Tool Use Guidelines
2676
2676
 
2677
- 1. **Outline Your Thought Process**
2678
- - Before using a tool, wrap your reasoning inside \`<thinking>\` tags. Be concise\u2014just enough to clarify your plan and the rationale behind selecting a specific tool.
2679
- 2. **Wait for Feedback**
2677
+ 1. **Wait for Feedback**
2680
2678
  - After using a tool, wait for the user's response indicating success/failure or any output logs. Do not assume the result of a tool without explicit confirmation.
2681
- 3. **Error Handling**
2679
+ 2. **Error Handling**
2682
2680
  - If a tool fails or produces an unexpected result, analyze the error, decide on an alternative approach or tool, and proceed carefully.
2683
- 4. **Avoid Repetition**
2681
+ 3. **Avoid Repetition**
2684
2682
  - Do not quote or repeat previous commands or prompts verbatim. Move the conversation forward by focusing on the latest required action.
2685
- 5. **No Unnecessary Re-invocations**
2686
- - Only invoke the same tool again if a genuine need arises (e.g., different parameters or updated context).
2687
- 6. **Tool Call Limit**
2688
- - Do not make more than 5 tool calls in a single message.`;
2683
+ 4. **Tool Call Limit**
2684
+ - It is **STRIGHTLY FORBIDDEN** to make more than 5 tool calls in a single message.`;
2689
2685
  };
2690
2686
  var agentsPrompt = (agents, name) => `
2691
2687
  ====
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/core",
3
- "version": "0.8.19",
3
+ "version": "0.8.20",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",