@everydaydevops/opencode-typescript-linting 1.0.0 → 1.0.2
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/README.md +10 -2
- package/install.js +50 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -19,14 +19,22 @@ npm install -g opencode-ai
|
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
|
-
Install the agent globally
|
|
22
|
+
Install the agent globally:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install @everydaydevops/opencode-typescript-linting
|
|
25
|
+
npm install -g @everydaydevops/opencode-typescript-linting
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
The postinstall script will automatically copy the agent configuration to `~/.config/opencode/agent/typescript-linting.md`.
|
|
29
29
|
|
|
30
|
+
Install the agent just in a project:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @everydaydevops/opencode-typescript-linting
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The postinstall script will automatically copy the agent configuration to `.opencode/agent/typescript-linting.md`.
|
|
37
|
+
|
|
30
38
|
## Usage
|
|
31
39
|
|
|
32
40
|
Once installed, the `typescript-linting` subagent is available in any OpenCode session.
|
package/install.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const agentName = 'typescript-linting.md';
|
|
8
|
+
const sourceFile = path.join(__dirname, 'agent', agentName);
|
|
9
|
+
|
|
10
|
+
// Determine if this is a global installation
|
|
11
|
+
// npm sets npm_config_global=true when installing globally
|
|
12
|
+
const isGlobalInstall = process.env.npm_config_global === 'true';
|
|
13
|
+
|
|
14
|
+
// Determine the target directory based on installation type
|
|
15
|
+
let targetDir;
|
|
16
|
+
if (isGlobalInstall) {
|
|
17
|
+
// Global install: use ~/.config/opencode/agent
|
|
18
|
+
targetDir = path.join(os.homedir(), '.config', 'opencode', 'agent');
|
|
19
|
+
} else {
|
|
20
|
+
// Local install: use .opencode/ in the project directory
|
|
21
|
+
// npm_config_local_prefix points to the project root during npm install
|
|
22
|
+
const projectRoot = process.env.npm_config_local_prefix || process.cwd();
|
|
23
|
+
targetDir = path.join(projectRoot, '.opencode');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Create the directory if it doesn't exist
|
|
27
|
+
if (!fs.existsSync(targetDir)) {
|
|
28
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const targetFile = path.join(targetDir, agentName);
|
|
32
|
+
|
|
33
|
+
// Copy the agent file
|
|
34
|
+
try {
|
|
35
|
+
fs.copyFileSync(sourceFile, targetFile);
|
|
36
|
+
console.log('TypeScript Linting agent installed successfully!');
|
|
37
|
+
console.log(` Installed to: ${targetFile}`);
|
|
38
|
+
console.log(` Installation type: ${isGlobalInstall ? 'global' : 'local'}`);
|
|
39
|
+
console.log('\nUsage:');
|
|
40
|
+
console.log(' Run "opencode" in any TypeScript project');
|
|
41
|
+
console.log(' The typescript-linting subagent will be available');
|
|
42
|
+
console.log(
|
|
43
|
+
' Primary agents can invoke it automatically for linting setup tasks'
|
|
44
|
+
);
|
|
45
|
+
console.log('\nManual invocation:');
|
|
46
|
+
console.log(' @typescript-linting help me set up linting for this project');
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Failed to install TypeScript Linting agent:', error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everydaydevops/opencode-typescript-linting",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OpenCode agent for implementing TypeScript linting and code formatting following Everyday DevOps best practices",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"url": "https://github.com/everydaydevopsio/opencode-typescript-linting-agent/issues"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
|
+
"install.js",
|
|
25
26
|
"agent/",
|
|
26
27
|
"README.md",
|
|
27
28
|
"LICENSE"
|