recoder-code 1.0.113
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/.babelrc +4 -0
- package/.claude/commands/commit-push-pr.md +19 -0
- package/.claude/commands/dedupe.md +38 -0
- package/.devcontainer/Dockerfile +91 -0
- package/.devcontainer/devcontainer.json +57 -0
- package/.devcontainer/init-firewall.sh +137 -0
- package/.gitattributes +2 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +188 -0
- package/.github/ISSUE_TEMPLATE/config.yml +17 -0
- package/.github/ISSUE_TEMPLATE/documentation.yml +117 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +132 -0
- package/.github/ISSUE_TEMPLATE/model_behavior.yml +220 -0
- package/.github/workflows/auto-close-duplicates.yml +31 -0
- package/.github/workflows/backfill-duplicate-comments.yml +44 -0
- package/.github/workflows/claude-dedupe-issues.yml +80 -0
- package/.github/workflows/claude-issue-triage.yml +106 -0
- package/.github/workflows/claude.yml +37 -0
- package/.github/workflows/issue-opened-dispatch.yml +28 -0
- package/.github/workflows/lock-closed-issues.yml +92 -0
- package/.github/workflows/log-issue-events.yml +40 -0
- package/CHANGELOG.md +646 -0
- package/KILO.md +1273 -0
- package/LICENSE.md +21 -0
- package/README.md +176 -0
- package/SECURITY.md +12 -0
- package/Script/run_devcontainer_claude_code.ps1 +152 -0
- package/api/githubApi.ts +144 -0
- package/babel.config.js +7 -0
- package/cli/.gitkeep +0 -0
- package/cli/auto-close-duplicates.ts +5 -0
- package/cli/configure.js +33 -0
- package/cli/list-models.js +48 -0
- package/cli/run.js +61 -0
- package/cli/set-api-key.js +26 -0
- package/config.json +4 -0
- package/demo.gif +0 -0
- package/examples/gpt-3.5-turbo.js +38 -0
- package/examples/gpt-4.js +38 -0
- package/examples/hooks/bash_command_validator_example.py +83 -0
- package/index.d.ts +3 -0
- package/index.js +62 -0
- package/jest.config.js +6 -0
- package/openapi.yaml +61 -0
- package/package.json +47 -0
- package/scripts/backfill-duplicate-comments.ts +213 -0
- package/tests/api-githubApi.test.ts +30 -0
- package/tests/auto-close-duplicates.test.ts +145 -0
- package/tests/cli-configure.test.ts +88 -0
- package/tests/cli-list-models.test.ts +44 -0
- package/tests/cli-run.test.ts +97 -0
- package/tests/cli-set-api-key.test.ts +54 -0
- package/tests/cli-validate-api-key.test.ts +52 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
name: "Lock Stale Issues"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
# 8am Pacific = 1pm UTC (2pm UTC during DST)
|
|
6
|
+
- cron: "0 14 * * *"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
issues: write
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: lock-threads
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lock-closed-issues:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Lock closed issues after 7 days of inactivity
|
|
20
|
+
uses: actions/github-script@v7
|
|
21
|
+
with:
|
|
22
|
+
script: |
|
|
23
|
+
const sevenDaysAgo = new Date();
|
|
24
|
+
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
25
|
+
|
|
26
|
+
const lockComment = `This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.`;
|
|
27
|
+
|
|
28
|
+
let page = 1;
|
|
29
|
+
let hasMore = true;
|
|
30
|
+
let totalLocked = 0;
|
|
31
|
+
|
|
32
|
+
while (hasMore) {
|
|
33
|
+
// Get closed issues (pagination)
|
|
34
|
+
const { data: issues } = await github.rest.issues.listForRepo({
|
|
35
|
+
owner: context.repo.owner,
|
|
36
|
+
repo: context.repo.repo,
|
|
37
|
+
state: 'closed',
|
|
38
|
+
sort: 'updated',
|
|
39
|
+
direction: 'asc',
|
|
40
|
+
per_page: 100,
|
|
41
|
+
page: page
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (issues.length === 0) {
|
|
45
|
+
hasMore = false;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
for (const issue of issues) {
|
|
50
|
+
// Skip if already locked
|
|
51
|
+
if (issue.locked) continue;
|
|
52
|
+
|
|
53
|
+
// Skip pull requests
|
|
54
|
+
if (issue.pull_request) continue;
|
|
55
|
+
|
|
56
|
+
// Check if updated more than 7 days ago
|
|
57
|
+
const updatedAt = new Date(issue.updated_at);
|
|
58
|
+
if (updatedAt > sevenDaysAgo) {
|
|
59
|
+
// Since issues are sorted by updated_at ascending,
|
|
60
|
+
// once we hit a recent issue, all remaining will be recent too
|
|
61
|
+
hasMore = false;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
// Add comment before locking
|
|
67
|
+
await github.rest.issues.createComment({
|
|
68
|
+
owner: context.repo.owner,
|
|
69
|
+
repo: context.repo.repo,
|
|
70
|
+
issue_number: issue.number,
|
|
71
|
+
body: lockComment
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Lock the issue
|
|
75
|
+
await github.rest.issues.lock({
|
|
76
|
+
owner: context.repo.owner,
|
|
77
|
+
repo: context.repo.repo,
|
|
78
|
+
issue_number: issue.number,
|
|
79
|
+
lock_reason: 'resolved'
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
totalLocked++;
|
|
83
|
+
console.log(`Locked issue #${issue.number}: ${issue.title}`);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error(`Failed to lock issue #${issue.number}: ${error.message}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
page++;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log(`Total issues locked: ${totalLocked}`);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Log Issue Events to Statsig
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types: [opened, closed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
log-to-statsig:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
issues: read
|
|
12
|
+
steps:
|
|
13
|
+
- name: Log issue creation to Statsig
|
|
14
|
+
env:
|
|
15
|
+
STATSIG_API_KEY: ${{ secrets.STATSIG_API_KEY }}
|
|
16
|
+
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
17
|
+
REPO: ${{ github.repository }}
|
|
18
|
+
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
19
|
+
AUTHOR: ${{ github.event.issue.user.login }}
|
|
20
|
+
CREATED_AT: ${{ github.event.issue.created_at }}
|
|
21
|
+
run: |
|
|
22
|
+
# All values are now safely passed via environment variables
|
|
23
|
+
# No direct templating in the shell script to prevent injection attacks
|
|
24
|
+
|
|
25
|
+
curl -X POST "https://events.statsigapi.net/v1/log_event" \
|
|
26
|
+
-H "Content-Type: application/json" \
|
|
27
|
+
-H "statsig-api-key: $STATSIG_API_KEY" \
|
|
28
|
+
-d '{
|
|
29
|
+
"events": [{
|
|
30
|
+
"eventName": "github_issue_created",
|
|
31
|
+
"metadata": {
|
|
32
|
+
"issue_number": "'"$ISSUE_NUMBER"'",
|
|
33
|
+
"repository": "'"$REPO"'",
|
|
34
|
+
"title": "'"$(echo "$ISSUE_TITLE" | sed "s/\"/\\\\\"/g")"'",
|
|
35
|
+
"author": "'"$AUTHOR"'",
|
|
36
|
+
"created_at": "'"$CREATED_AT"'"
|
|
37
|
+
},
|
|
38
|
+
"time": '"$(date +%s)000"'
|
|
39
|
+
}]
|
|
40
|
+
}'
|