@polka-codes/core 0.9.24 → 0.9.25
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/_tsup-dts-rollup.d.ts +4 -4
- package/dist/index.js +39 -23
- package/package.json +1 -1
|
@@ -774,7 +774,7 @@ export declare const default_alias_3: {
|
|
|
774
774
|
export declare const default_alias_4: {
|
|
775
775
|
readonly name: "reviewDiff";
|
|
776
776
|
readonly description: "Reviews a git diff";
|
|
777
|
-
readonly prompt: "\n# Code Review Prompt\n\nYou are a senior software engineer reviewing code changes.\n\n## Critical Instructions\n**ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.\n\n## Viewing Changes\n- **
|
|
777
|
+
readonly prompt: "\n# Code Review Prompt\n\nYou are a senior software engineer reviewing code changes.\n\n## Critical Instructions\n- **ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.\n- **ONLY run git_diff on files that are reviewable source/config files** per the \"File Selection for git_diff\" rules below. Do not pass excluded files to git_diff.\n\n## File Selection for git_diff\nUse <file_status> to decide which files to diff. Include only files likely to contain human-authored source or meaningful configuration.\n\nInclude (run git_diff):\n- Application/source code\n- UI/templates/assets code\n- Infra/config that affects behavior\n\nExclude (do NOT run git_diff; do not review):\n- Lockfiles\n- Generated/build artifacts & deps\n- Test artifacts/snapshots\n- Data and fixtures\n- Binary/media/minified/maps\n\n## Viewing Changes\n- For each included file, **use git_diff** to inspect the actual code changes:\n - **Pull request:** use the provided commit range for the git_diff tool with contextLines: 5 and includeLineNumbers: true, but only surface and review the included files.\n - **Local changes:** diff staged or unstaged included files using git_diff with contextLines: 5 and includeLineNumbers: true.\n- The diff will include line number annotations: [Line N] for additions and [Line N removed] for deletions.\n- You may receive:\n - <pr_title>\n - <pr_description>\n - <commit_messages>\n- A <review_instructions> tag tells you the focus of the review.\n- Use <file_status> to understand which files were modified, added, deleted, or renamed and to apply the inclusion/exclusion rules above.\n\n## Line Number Reporting\n- Use the line numbers from the annotations in the diff output.\n- For additions: use the number from the [Line N] annotation after the + line.\n- For deletions: use the number from the [Line N removed] annotation after the - line.\n- For modifications: report the line number of the new/current code (from [Line N]).\n- Report single lines as \"N\" and ranges as \"N-M\".\n\n## Review Guidelines\nFocus exclusively on the changed lines (+ additions, - deletions, modified lines):\n- **Specific issues:** Point to exact problems in the changed code with accurate line references from the annotations.\n- **Actionable fixes:** Provide concrete solutions, not vague suggestions.\n- **Clear reasoning:** Explain why each issue matters and how to fix it.\n- **Avoid generic advice** unless directly tied to a specific problem visible in the diff.\n\n## What NOT to review\n- Files excluded by the \"File Selection for git_diff\" rules (do not diff or comment on them).\n- Existing unchanged code.\n- Overall project structure/architecture unless directly impacted by the changes.\n- Missing features or functionality not part of this diff.\n\n## Output Format\nDo not include praise or positive feedback.\nOnly include reviews for actual issues found in the changed code.\n\nReturn your review as a JSON object inside a ```json block, wrapped like:\n<tool_attempt_completion>\n<tool_parameter_result>\n```json\n{\n \"overview\": \"Summary of specific issues found in the diff changes, 'No issues found', or 'No reviewable changes' if all modified files were excluded.\",\n \"specificReviews\": [\n {\n \"file\": \"path/filename.ext\",\n \"lines\": \"N or N-M\",\n \"review\": \"Specific issue with the changed code and exact actionable fix.\"\n }\n ]\n}\n```\n</tool_parameter_result>\n</tool_attempt_completion>\n";
|
|
778
778
|
readonly formatInput: (params: Input_2) => string;
|
|
779
779
|
readonly parseOutput: (output: string) => Output_2;
|
|
780
780
|
readonly agent: (options: SharedAgentOptions) => AnalyzerAgent;
|
|
@@ -787,7 +787,7 @@ export declare const default_alias_5: {
|
|
|
787
787
|
readonly parameters: z.ZodObject<{
|
|
788
788
|
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
789
789
|
commitRange: z.ZodOptional<z.ZodString>;
|
|
790
|
-
file: z.
|
|
790
|
+
file: z.ZodString;
|
|
791
791
|
contextLines: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
792
792
|
includeLineNumbers: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
793
793
|
}, z.core.$strip>;
|
|
@@ -799,7 +799,7 @@ export declare const default_alias_5: {
|
|
|
799
799
|
parameters: z.ZodObject<{
|
|
800
800
|
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
801
801
|
commitRange: z.ZodOptional<z.ZodString>;
|
|
802
|
-
file: z.
|
|
802
|
+
file: z.ZodString;
|
|
803
803
|
contextLines: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
804
804
|
includeLineNumbers: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
805
805
|
}, z.core.$strip>;
|
|
@@ -1545,7 +1545,7 @@ export declare const toolInfo: {
|
|
|
1545
1545
|
readonly parameters: z.ZodObject<{
|
|
1546
1546
|
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1547
1547
|
commitRange: z.ZodOptional<z.ZodString>;
|
|
1548
|
-
file: z.
|
|
1548
|
+
file: z.ZodString;
|
|
1549
1549
|
contextLines: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
1550
1550
|
includeLineNumbers: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1551
1551
|
}, z.core.$strip>;
|
package/dist/index.js
CHANGED
|
@@ -3733,7 +3733,7 @@ var toolInfo15 = {
|
|
|
3733
3733
|
return val;
|
|
3734
3734
|
}, z17.boolean().optional().default(false)).describe("Get staged changes instead of unstaged changes."),
|
|
3735
3735
|
commitRange: z17.string().optional().describe('The commit range to get the diff for (e.g., "main...HEAD").'),
|
|
3736
|
-
file: z17.string().
|
|
3736
|
+
file: z17.string().describe("Get the diff for a specific file."),
|
|
3737
3737
|
contextLines: z17.coerce.number().optional().default(5).describe("Number of context lines to include around changes."),
|
|
3738
3738
|
includeLineNumbers: z17.preprocess((val) => {
|
|
3739
3739
|
if (typeof val === "string") {
|
|
@@ -3828,42 +3828,58 @@ var prompt5 = `
|
|
|
3828
3828
|
You are a senior software engineer reviewing code changes.
|
|
3829
3829
|
|
|
3830
3830
|
## Critical Instructions
|
|
3831
|
-
**ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.
|
|
3831
|
+
- **ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.
|
|
3832
|
+
- **ONLY run git_diff on files that are reviewable source/config files** per the "File Selection for git_diff" rules below. Do not pass excluded files to git_diff.
|
|
3833
|
+
|
|
3834
|
+
## File Selection for git_diff
|
|
3835
|
+
Use <file_status> to decide which files to diff. Include only files likely to contain human-authored source or meaningful configuration.
|
|
3836
|
+
|
|
3837
|
+
Include (run git_diff):
|
|
3838
|
+
- Application/source code
|
|
3839
|
+
- UI/templates/assets code
|
|
3840
|
+
- Infra/config that affects behavior
|
|
3841
|
+
|
|
3842
|
+
Exclude (do NOT run git_diff; do not review):
|
|
3843
|
+
- Lockfiles
|
|
3844
|
+
- Generated/build artifacts & deps
|
|
3845
|
+
- Test artifacts/snapshots
|
|
3846
|
+
- Data and fixtures
|
|
3847
|
+
- Binary/media/minified/maps
|
|
3832
3848
|
|
|
3833
3849
|
## Viewing Changes
|
|
3834
|
-
- **
|
|
3835
|
-
- **Pull request
|
|
3836
|
-
- **Local changes
|
|
3837
|
-
- The diff will include line number annotations: [Line N] for additions and [Line N removed] for deletions
|
|
3838
|
-
-
|
|
3850
|
+
- For each included file, **use git_diff** to inspect the actual code changes:
|
|
3851
|
+
- **Pull request:** use the provided commit range for the git_diff tool with contextLines: 5 and includeLineNumbers: true, but only surface and review the included files.
|
|
3852
|
+
- **Local changes:** diff staged or unstaged included files using git_diff with contextLines: 5 and includeLineNumbers: true.
|
|
3853
|
+
- The diff will include line number annotations: [Line N] for additions and [Line N removed] for deletions.
|
|
3854
|
+
- You may receive:
|
|
3839
3855
|
- <pr_title>
|
|
3840
3856
|
- <pr_description>
|
|
3841
3857
|
- <commit_messages>
|
|
3842
3858
|
- A <review_instructions> tag tells you the focus of the review.
|
|
3843
|
-
-
|
|
3859
|
+
- Use <file_status> to understand which files were modified, added, deleted, or renamed and to apply the inclusion/exclusion rules above.
|
|
3844
3860
|
|
|
3845
3861
|
## Line Number Reporting
|
|
3846
|
-
-
|
|
3847
|
-
- For additions:
|
|
3848
|
-
- For deletions:
|
|
3849
|
-
- For modifications:
|
|
3850
|
-
- Report single lines as "N" and ranges as "N-M"
|
|
3862
|
+
- Use the line numbers from the annotations in the diff output.
|
|
3863
|
+
- For additions: use the number from the [Line N] annotation after the + line.
|
|
3864
|
+
- For deletions: use the number from the [Line N removed] annotation after the - line.
|
|
3865
|
+
- For modifications: report the line number of the new/current code (from [Line N]).
|
|
3866
|
+
- Report single lines as "N" and ranges as "N-M".
|
|
3851
3867
|
|
|
3852
3868
|
## Review Guidelines
|
|
3853
3869
|
Focus exclusively on the changed lines (+ additions, - deletions, modified lines):
|
|
3854
|
-
- **Specific issues
|
|
3855
|
-
- **Actionable fixes
|
|
3856
|
-
- **Clear reasoning
|
|
3857
|
-
- **Avoid generic advice
|
|
3870
|
+
- **Specific issues:** Point to exact problems in the changed code with accurate line references from the annotations.
|
|
3871
|
+
- **Actionable fixes:** Provide concrete solutions, not vague suggestions.
|
|
3872
|
+
- **Clear reasoning:** Explain why each issue matters and how to fix it.
|
|
3873
|
+
- **Avoid generic advice** unless directly tied to a specific problem visible in the diff.
|
|
3858
3874
|
|
|
3859
3875
|
## What NOT to review
|
|
3860
|
-
-
|
|
3861
|
-
-
|
|
3862
|
-
-
|
|
3863
|
-
- Missing features or functionality not part of this diff
|
|
3876
|
+
- Files excluded by the "File Selection for git_diff" rules (do not diff or comment on them).
|
|
3877
|
+
- Existing unchanged code.
|
|
3878
|
+
- Overall project structure/architecture unless directly impacted by the changes.
|
|
3879
|
+
- Missing features or functionality not part of this diff.
|
|
3864
3880
|
|
|
3865
3881
|
## Output Format
|
|
3866
|
-
Do
|
|
3882
|
+
Do not include praise or positive feedback.
|
|
3867
3883
|
Only include reviews for actual issues found in the changed code.
|
|
3868
3884
|
|
|
3869
3885
|
Return your review as a JSON object inside a \`\`\`json block, wrapped like:
|
|
@@ -3871,7 +3887,7 @@ Return your review as a JSON object inside a \`\`\`json block, wrapped like:
|
|
|
3871
3887
|
<tool_parameter_result>
|
|
3872
3888
|
\`\`\`json
|
|
3873
3889
|
{
|
|
3874
|
-
"overview": "Summary of specific issues found in the diff changes,
|
|
3890
|
+
"overview": "Summary of specific issues found in the diff changes, 'No issues found', or 'No reviewable changes' if all modified files were excluded.",
|
|
3875
3891
|
"specificReviews": [
|
|
3876
3892
|
{
|
|
3877
3893
|
"file": "path/filename.ext",
|