Skip to content

Commit 81135f8

Browse files
committed
fix: Rename agent.js to agent.mjs for ES module support
- Changed agent.js to agent.mjs so Node.js automatically treats it as ES module - Removed --input-type=module flag (not needed with .mjs extension) - Updated workflow, tests, and documentation to reference agent.mjs - Fixes ERR_INPUT_TYPE_NOT_ALLOWED error in GitHub Actions
1 parent e300738 commit 81135f8

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/aicode-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
GITHUB_RUN_ID: ${{ github.run_id }}
5353
TASK: ${{ github.event.client_payload.task }}
5454
REQUESTER: ${{ github.event.client_payload.requester }}
55-
run: node --input-type=module .github/agent/agent.js
55+
run: node .github/agent/agent.mjs
5656
continue-on-error: true
5757

5858
- name: Notify Slack on agent failure

docs/AI_CODE_AGENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ All components of the AI Code Agent have been successfully implemented and teste
1616
- Sends Slack notifications on success/failure
1717

1818
### 2. AI Agent Script
19-
**File:** `.github/agent/agent.js`
19+
**File:** `.github/agent/agent.mjs`
2020
- ES module using OpenAI GPT-4 API
2121
- Reads `.cursorrules` for project context
2222
- Generates unified git diffs
@@ -66,7 +66,7 @@ All components of the AI Code Agent have been successfully implemented and teste
6666
GitHub Actions Workflow
6767
✔ should have aicode-agent.yml workflow file
6868
Agent Script
69-
✔ should have agent.js script
69+
✔ should have agent.mjs script
7070
Configuration
7171
✔ should have githubToken and slackWebhookUrl in config example
7272
Documentation
@@ -155,7 +155,7 @@ GitHub API (repository_dispatch)
155155
156156
GitHub Actions (aicode-agent.yml)
157157
158-
AI Agent (agent.js) → OpenAI GPT-4
158+
AI Agent (agent.mjs) → Claude/OpenAI/Gemini
159159
160160
Apply Patch → Run Tests
161161

test/aicode-agent.test.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('AI Code Agent Integration', function() {
3636
expect(content).to.include('types: [aicode]');
3737

3838
// Check it runs the agent (supports multiple providers now)
39-
expect(content).to.include('node --input-type=module .github/agent/agent.js');
39+
expect(content).to.include('node .github/agent/agent.mjs');
4040

4141
// Check it runs tests
4242
expect(content).to.include('npm test');
@@ -47,8 +47,8 @@ describe('AI Code Agent Integration', function() {
4747
});
4848

4949
describe('Agent Script', function() {
50-
it('should have agent.js script', function() {
51-
const agentPath = path.join(process.cwd(), '.github', 'agent', 'agent.js');
50+
it('should have agent.mjs script', function() {
51+
const agentPath = path.join(process.cwd(), '.github', 'agent', 'agent.mjs');
5252
expect(fs.existsSync(agentPath)).to.be.true;
5353

5454
const content = fs.readFileSync(agentPath, 'utf8');

0 commit comments

Comments
 (0)