s9n-devops-agent 2.0.18-dev.0 → 2.0.18-dev.11
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 +94 -143
- package/bin/cs-devops-agent +16 -20
- package/docs/RELEASE_NOTES.md +15 -0
- package/package.json +1 -1
- package/scripts/deploy-local.sh +100 -0
- package/src/agent-chat.js +299 -36
- package/src/credentials-manager.js +28 -6
- package/src/cs-devops-agent-worker.js +446 -87
- package/src/kora-skills.json +47 -0
- package/src/session-coordinator.js +499 -70
- package/src/setup-cs-devops-agent.js +298 -44
- package/src/ui-utils.js +1 -1
- package/start-devops-session.sh +4 -27
package/README.md
CHANGED
|
@@ -1,201 +1,152 @@
|
|
|
1
1
|
# DevOps Agent - AI-Powered Git Workflow Automation
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Now with Kora 🤖 - Your Smart DevOps Assistant**
|
|
4
|
+
|
|
5
|
+
DevOps Agent acts as a bridge between human developers and AI coding assistants. It manages git operations, prevents multi-agent conflicts, ensures architectural compliance, and now talks to you to streamline your workflow.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/s9n-devops-agent)
|
|
6
8
|
[](https://opensource.org/licenses/MIT)
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
🤖 **Works with Any AI Assistant** - Claude, Cursor, GitHub Copilot, Cline
|
|
11
|
-
🔄 **Automatic Git Operations** - Watches changes, commits with proper messages, pushes automatically
|
|
12
|
-
🛡️ **Multi-Agent Coordination** - Prevents multiple AIs from editing the same files simultaneously
|
|
13
|
-
🌲 **Smart Branch Management** - Hierarchical structure: session → daily → weekly → main
|
|
14
|
-
📋 **House Rules System** - Teaches AI agents your project conventions and testing requirements
|
|
15
|
-
|
|
16
|
-
## Quick Start (2 Minutes)
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install
|
|
20
|
-
npm install -g s9n-devops-agent
|
|
21
|
-
|
|
22
|
-
# Learn (recommended for first-time users)
|
|
23
|
-
s9n-devops-agent tutorial
|
|
24
|
-
|
|
25
|
-
# Setup
|
|
26
|
-
s9n-devops-agent setup
|
|
27
|
-
|
|
28
|
-
# Start working
|
|
29
|
-
s9n-devops-agent start
|
|
30
|
-
```
|
|
10
|
+
---
|
|
31
11
|
|
|
32
|
-
##
|
|
12
|
+
## 🚀 New in v2.0: Smart Features
|
|
33
13
|
|
|
34
|
-
|
|
14
|
+
### 🤖 Meet Kora
|
|
15
|
+
Kora is a conversational AI assistant built into the DevOps Agent. She knows your project's **House Rules**, understands your **Architecture Contracts**, and can manage your development sessions.
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
4. **Session closes** → Merges to daily branch, then to main
|
|
17
|
+
- **Ask Questions:** "What are the rules for API endpoints?"
|
|
18
|
+
- **Start Work:** "Start a new session to fix the login bug."
|
|
19
|
+
- **Check Status:** "Are there any open sessions?"
|
|
40
20
|
|
|
41
|
-
###
|
|
21
|
+
### 📜 Contract Automation
|
|
22
|
+
Ensure your code matches your architecture. The agent now includes tools to:
|
|
23
|
+
- **Validate Compliance:** Checks if your code implements the defined contracts (API, DB, Features).
|
|
24
|
+
- **Auto-Generate Contracts:** Reverse-engineer documentation from existing code.
|
|
25
|
+
- **Test:** Run `npm run test:contracts` to verify compliance in CI/CD.
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **Own branch** auto-named based on task
|
|
46
|
-
- **File locks** prevent conflicts with other agents
|
|
47
|
-
- **Auto-monitoring** commits and pushes automatically
|
|
27
|
+
### 🧠 AI-Powered Commits
|
|
28
|
+
The agent analyzes your staged changes and generates semantic, conventional commit messages that adhere to your specific House Rules.
|
|
48
29
|
|
|
49
|
-
|
|
30
|
+
---
|
|
50
31
|
|
|
51
|
-
|
|
52
|
-
**What:** Watches your workspace and commits changes automatically
|
|
53
|
-
**Why:** AI can't run git commands, so we do it for them
|
|
54
|
-
**How:** AI writes commit message to special file, agent reads and commits
|
|
32
|
+
## 📦 Installation
|
|
55
33
|
|
|
56
|
-
###
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
### Stable Version
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g s9n-devops-agent
|
|
37
|
+
```
|
|
60
38
|
|
|
61
|
-
###
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
### Development Version (Latest Features)
|
|
40
|
+
To access Kora and the latest smart features:
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g s9n-devops-agent@dev
|
|
43
|
+
```
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
**What:** Instructions for AI assistants in `docs/houserules.md`
|
|
68
|
-
**Why:** Consistent behavior across agents, follows your conventions
|
|
69
|
-
**How:** Markdown file that AI reads first, auto-updated by agent
|
|
45
|
+
---
|
|
70
46
|
|
|
71
|
-
##
|
|
47
|
+
## ⚡ Quick Start
|
|
72
48
|
|
|
49
|
+
### 1. Setup
|
|
50
|
+
Run the setup wizard to configure your environment and API keys.
|
|
73
51
|
```bash
|
|
74
|
-
|
|
75
|
-
s9n-devops-agent tutorial # Interactive learning (start here!)
|
|
76
|
-
s9n-devops-agent setup # First-time configuration
|
|
77
|
-
s9n-devops-agent help-topics # Browse comprehensive help
|
|
78
|
-
|
|
79
|
-
# Session Management
|
|
80
|
-
s9n-devops-agent start # Create/resume session
|
|
81
|
-
s9n-devops-agent list # Show all sessions
|
|
82
|
-
s9n-devops-agent close # Close active session
|
|
83
|
-
|
|
84
|
-
# Advanced
|
|
85
|
-
s9n-devops-agent create --task api --agent claude # Create specific session
|
|
86
|
-
s9n-devops-agent cleanup # Clean up stale sessions
|
|
52
|
+
s9n-devops-agent setup
|
|
87
53
|
```
|
|
54
|
+
> **Note:** You will be prompted for a `GROQ_API_KEY` to enable Kora and AI features.
|
|
88
55
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### Single AI Agent
|
|
56
|
+
### 2. Talk to Kora
|
|
57
|
+
Start the conversational interface to manage your work.
|
|
92
58
|
```bash
|
|
93
|
-
s9n-devops-agent
|
|
94
|
-
# Copy instructions to Claude/Cursor
|
|
95
|
-
# AI works, agent commits automatically
|
|
96
|
-
s9n-devops-agent close # Merge and cleanup
|
|
59
|
+
s9n-devops-agent chat
|
|
97
60
|
```
|
|
98
61
|
|
|
99
|
-
###
|
|
62
|
+
### 3. Start a Session (Classic Mode)
|
|
63
|
+
If you prefer the CLI menu:
|
|
100
64
|
```bash
|
|
101
|
-
|
|
102
|
-
|
|
65
|
+
s9n-devops-agent start
|
|
66
|
+
```
|
|
103
67
|
|
|
104
|
-
|
|
105
|
-
s9n-devops-agent create --task ui --agent cursor
|
|
68
|
+
---
|
|
106
69
|
|
|
107
|
-
|
|
108
|
-
```
|
|
70
|
+
## 🛠️ Core Features
|
|
109
71
|
|
|
110
|
-
|
|
72
|
+
### 🔄 Auto-Commit System
|
|
73
|
+
- **Watches** your workspace in real-time.
|
|
74
|
+
- **Commits** changes automatically when your AI assistant saves files.
|
|
75
|
+
- **Pushes** to the remote repository.
|
|
111
76
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
✅ **Framework Agnostic** - Works with any codebase, any language
|
|
116
|
-
✅ **Git Platform Agnostic** - GitHub, GitLab, Bitbucket, self-hosted
|
|
77
|
+
### 🛡️ Multi-Agent Coordination
|
|
78
|
+
- **File Locking:** Prevents multiple agents (or humans) from editing the same files simultaneously.
|
|
79
|
+
- **Worktrees:** Each session gets an isolated git worktree, keeping your main branch clean.
|
|
117
80
|
|
|
118
|
-
|
|
81
|
+
### 🌲 Smart Branch Management
|
|
82
|
+
- **Hierarchy:** `session/task` → `daily/date` → `main`.
|
|
83
|
+
- **Auto-Merge:** Sessions automatically merge into daily branches, which roll over to main.
|
|
84
|
+
- **Base Branch Selection:** Choose any branch (main, develop, etc.) as the starting point for your session worktree.
|
|
119
85
|
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
86
|
+
### 📋 House Rules System
|
|
87
|
+
- **Context Injection:** AI agents read `docs/houserules.md` to understand your coding conventions.
|
|
88
|
+
- **Enforcement:** The agent checks commits against these rules.
|
|
123
89
|
|
|
124
|
-
|
|
90
|
+
---
|
|
125
91
|
|
|
126
|
-
📖
|
|
127
|
-
- [Interactive Tutorial](docs/V2_IMPLEMENTATION_GUIDE.md) - Learn by doing
|
|
128
|
-
- [Installation Guide](docs/INSTALLATION_GUIDE.md) - Detailed setup
|
|
92
|
+
## 📖 Usage Guide
|
|
129
93
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- [Multi-Agent Setup](docs/multi-agent-guide.md) - Working with multiple AIs
|
|
134
|
-
- [House Rules](docs/houserules-guide.md) - Teaching AI your conventions
|
|
94
|
+
### Using Kora (Chat)
|
|
95
|
+
```bash
|
|
96
|
+
$ s9n-devops-agent chat
|
|
135
97
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- [Session Management](docs/SESSION_MANAGEMENT.md) - Advanced workflows
|
|
98
|
+
🤖 Kora - Smart DevOps Assistant
|
|
99
|
+
Powered by Groq (llama-3.3-70b-versatile)
|
|
100
|
+
============================================================
|
|
140
101
|
|
|
141
|
-
|
|
102
|
+
Kora > Hi! I'm Kora. How can I help you today?
|
|
142
103
|
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
s9n-devops-agent list --all # Check closed sessions
|
|
146
|
-
```
|
|
104
|
+
You > Start a session for user auth
|
|
147
105
|
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Check commit message file exists and has content
|
|
151
|
-
ls -la .devops-commit-*.msg
|
|
152
|
-
# Enable debug mode
|
|
153
|
-
AC_DEBUG=true s9n-devops-agent start
|
|
106
|
+
Kora > Starting new session for: user-auth...
|
|
154
107
|
```
|
|
155
108
|
|
|
156
|
-
|
|
109
|
+
### Managing Sessions
|
|
157
110
|
```bash
|
|
158
|
-
|
|
159
|
-
s9n-devops-agent
|
|
160
|
-
```
|
|
111
|
+
# List all active sessions
|
|
112
|
+
s9n-devops-agent list
|
|
161
113
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
114
|
+
# Close the current session (merge and cleanup)
|
|
115
|
+
s9n-devops-agent close
|
|
116
|
+
```
|
|
165
117
|
|
|
118
|
+
### Contract Testing
|
|
119
|
+
Run these tests to ensure your code complies with `House_Rules_Contracts/`:
|
|
166
120
|
```bash
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
# Auto-push (default: true)
|
|
171
|
-
export AC_PUSH=true
|
|
121
|
+
npm run test:contracts
|
|
122
|
+
```
|
|
172
123
|
|
|
173
|
-
|
|
174
|
-
export AC_DEBUG=true
|
|
124
|
+
---
|
|
175
125
|
|
|
176
|
-
|
|
177
|
-
export AC_TZ="America/New_York"
|
|
178
|
-
```
|
|
126
|
+
## ⚙️ Configuration
|
|
179
127
|
|
|
180
|
-
|
|
128
|
+
The setup wizard (`s9n-devops-agent setup`) creates a `.env` file in your project root.
|
|
181
129
|
|
|
182
|
-
|
|
130
|
+
| Variable | Description |
|
|
131
|
+
|----------|-------------|
|
|
132
|
+
| `GROQ_API_KEY` | **Required** for Kora and AI commits. Get one at [console.groq.com](https://console.groq.com). |
|
|
133
|
+
| `AC_BRANCH_PREFIX` | Prefix for branch names (e.g., `dev_abc_`). |
|
|
134
|
+
| `AC_PUSH` | `true` to auto-push commits, `false` for local only. |
|
|
135
|
+
| `AC_DEBUG` | `true` for verbose logging. |
|
|
183
136
|
|
|
184
|
-
|
|
137
|
+
---
|
|
185
138
|
|
|
186
|
-
##
|
|
139
|
+
## 📚 Documentation
|
|
140
|
+
- [Installation Guide](docs/INSTALLATION_GUIDE.md)
|
|
141
|
+
- [Testing Guide](TESTING_GUIDE.md)
|
|
142
|
+
- [House Rules Guide](docs/houserules-guide.md)
|
|
143
|
+
- [Contract Automation](scripts/contract-automation/README.md)
|
|
187
144
|
|
|
188
|
-
|
|
145
|
+
---
|
|
189
146
|
|
|
190
147
|
## Support
|
|
191
|
-
|
|
192
148
|
- 🐛 [Report Issues](https://github.com/SecondBrainAICo/CS_DevOpsAgent/issues)
|
|
193
|
-
- 💬 [Discussions](https://github.com/SecondBrainAICo/CS_DevOpsAgent/discussions)
|
|
194
149
|
- 📦 [npm Package](https://www.npmjs.com/package/s9n-devops-agent)
|
|
195
|
-
- 📖 [Documentation](https://github.com/SecondBrainAICo/CS_DevOpsAgent/wiki)
|
|
196
150
|
|
|
197
151
|
---
|
|
198
|
-
|
|
199
152
|
**Built with ❤️ by [SecondBrain Labs](https://secondbrain.ai)**
|
|
200
|
-
|
|
201
|
-
*Making AI-powered development safe, efficient, and conflict-free.*
|
package/bin/cs-devops-agent
CHANGED
|
@@ -54,21 +54,11 @@ function runShellScript(scriptPath, scriptArgs = []) {
|
|
|
54
54
|
switch(command) {
|
|
55
55
|
case 'start':
|
|
56
56
|
case 'session':
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} else {
|
|
63
|
-
// Unix/Mac: use bash script
|
|
64
|
-
const sessionScript = join(rootDir, 'start-devops-session.sh');
|
|
65
|
-
if (fs.existsSync(sessionScript)) {
|
|
66
|
-
runShellScript(sessionScript, args.slice(1));
|
|
67
|
-
} else {
|
|
68
|
-
console.error('Session script not found. Please ensure the package is properly installed.');
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
57
|
+
case 'chat':
|
|
58
|
+
// Unified entry point: Run Kora (Smart Assistant)
|
|
59
|
+
// Kora handles session creation and management conversationally
|
|
60
|
+
console.log('Starting Kora (Smart DevOps Assistant)...');
|
|
61
|
+
runScript(join(rootDir, 'src', 'agent-chat.js'), args.slice(1));
|
|
72
62
|
break;
|
|
73
63
|
|
|
74
64
|
case 'worker':
|
|
@@ -101,6 +91,11 @@ switch(command) {
|
|
|
101
91
|
runScript(join(rootDir, 'src', 'session-coordinator.js'), ['create', ...args.slice(1)]);
|
|
102
92
|
break;
|
|
103
93
|
|
|
94
|
+
case 'resume':
|
|
95
|
+
// Resume existing session
|
|
96
|
+
runScript(join(rootDir, 'src', 'session-coordinator.js'), ['resume', ...args.slice(1)]);
|
|
97
|
+
break;
|
|
98
|
+
|
|
104
99
|
case 'close':
|
|
105
100
|
// Close session
|
|
106
101
|
runScript(join(rootDir, 'src', 'close-session.js'), args.slice(1));
|
|
@@ -118,7 +113,7 @@ switch(command) {
|
|
|
118
113
|
break;
|
|
119
114
|
|
|
120
115
|
case 'chat':
|
|
121
|
-
// Run the chat agent
|
|
116
|
+
// Run the chat agent (kept for backward compatibility, now same as start)
|
|
122
117
|
runScript(join(rootDir, 'src', 'agent-chat.js'), args.slice(1));
|
|
123
118
|
break;
|
|
124
119
|
|
|
@@ -207,11 +202,12 @@ For more information, visit: https://github.com/SecondBrainAICo/CS_DevOpsAgent
|
|
|
207
202
|
break;
|
|
208
203
|
|
|
209
204
|
default:
|
|
210
|
-
// Default to
|
|
211
|
-
// This
|
|
205
|
+
// Default to Kora (Smart Assistant) if no command provided
|
|
206
|
+
// This provides the unified experience
|
|
212
207
|
if (!command || !command.startsWith('-')) {
|
|
213
|
-
console.log('Starting Kora Smart Assistant...');
|
|
214
|
-
|
|
208
|
+
console.log('Starting Kora (Smart DevOps Assistant)...');
|
|
209
|
+
// Pass all args to agent-chat
|
|
210
|
+
runScript(join(rootDir, 'src', 'agent-chat.js'), args);
|
|
215
211
|
} else {
|
|
216
212
|
// Show help for flags like -h, --help, or unknown flags
|
|
217
213
|
console.log(`\nCS_DevOpsAgent - Intelligent Git Automation System`);
|
package/docs/RELEASE_NOTES.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Release Notes - s9n-devops-agent v2.0.18-dev.3
|
|
2
|
+
|
|
3
|
+
## 🚀 Enhancements
|
|
4
|
+
- **Base Branch Selection**: You can now select a base branch (e.g., main, develop) when starting a session, allowing for cleaner feature branching from stable points.
|
|
5
|
+
- **Enhanced Setup Wizard**:
|
|
6
|
+
- Finds and merges contract files from subdirectories.
|
|
7
|
+
- Ensures versioning strategy is configured.
|
|
8
|
+
- Persists credentials in user home directory to survive package updates.
|
|
9
|
+
|
|
10
|
+
## 🐛 Fixes
|
|
11
|
+
- **Update Logic**: Fixed update checker to respect dev versions.
|
|
12
|
+
- **Credentials**: Fixed issue where API keys were lost during updates.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
1
16
|
# Release Notes - s9n-devops-agent v2.0.11-dev.0
|
|
2
17
|
|
|
3
18
|
## 🐛 Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "s9n-devops-agent",
|
|
3
|
-
"version": "2.0.18-dev.
|
|
3
|
+
"version": "2.0.18-dev.11",
|
|
4
4
|
"description": "CS_DevOpsAgent - Intelligent Git Automation System with multi-agent support and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cs-devops-agent-worker.js",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Deploy DevOpsAgent locally to a target directory
|
|
4
|
+
# Usage: ./scripts/deploy-local.sh <target_directory>
|
|
5
|
+
|
|
6
|
+
TARGET_DIR="$1"
|
|
7
|
+
|
|
8
|
+
if [ -z "$TARGET_DIR" ]; then
|
|
9
|
+
echo "Usage: $0 <target_directory>"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
if [ ! -d "$TARGET_DIR" ]; then
|
|
14
|
+
echo "Error: Target directory $TARGET_DIR does not exist"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
SOURCE_DIR="$(pwd)"
|
|
19
|
+
DEST_DIR="$TARGET_DIR/DevOpsAgent"
|
|
20
|
+
|
|
21
|
+
echo "Deploying DevOpsAgent to $DEST_DIR..."
|
|
22
|
+
|
|
23
|
+
# Create destination directory
|
|
24
|
+
mkdir -p "$DEST_DIR"
|
|
25
|
+
|
|
26
|
+
# Copy files
|
|
27
|
+
echo "Copying files..."
|
|
28
|
+
rsync -av --exclude 'node_modules' \
|
|
29
|
+
--exclude '.git' \
|
|
30
|
+
--exclude '.DS_Store' \
|
|
31
|
+
--exclude 'local_deploy' \
|
|
32
|
+
--exclude 'coverage' \
|
|
33
|
+
--exclude 'test_cases' \
|
|
34
|
+
"$SOURCE_DIR/" "$DEST_DIR/"
|
|
35
|
+
|
|
36
|
+
# Install dependencies in the target
|
|
37
|
+
echo "Installing dependencies in $DEST_DIR..."
|
|
38
|
+
cd "$DEST_DIR"
|
|
39
|
+
npm install --production --silent
|
|
40
|
+
cd "$SOURCE_DIR"
|
|
41
|
+
|
|
42
|
+
# Create universal runner script
|
|
43
|
+
RUNNER="$TARGET_DIR/devops"
|
|
44
|
+
LOG_FILE="$TARGET_DIR/devops-agent.log"
|
|
45
|
+
|
|
46
|
+
echo "Creating 'devops' CLI wrapper..."
|
|
47
|
+
|
|
48
|
+
cat > "$RUNNER" << EOF
|
|
49
|
+
#!/bin/bash
|
|
50
|
+
|
|
51
|
+
# DevOps Agent CLI Wrapper
|
|
52
|
+
# Supports all standard commands: start, chat, setup, worker, etc.
|
|
53
|
+
|
|
54
|
+
DIR="\$(cd "\$(dirname "\$0")" && pwd)"
|
|
55
|
+
AGENT_DIR="\$DIR/DevOpsAgent"
|
|
56
|
+
LOG_FILE="\$DIR/devops-agent.log"
|
|
57
|
+
|
|
58
|
+
# Ensure executable permissions
|
|
59
|
+
chmod +x "\$AGENT_DIR/bin/cs-devops-agent"
|
|
60
|
+
|
|
61
|
+
# If first arg is 'worker' or 'background', run in background
|
|
62
|
+
if [ "\$1" == "background" ]; then
|
|
63
|
+
echo "Starting worker in background..."
|
|
64
|
+
echo "--- Worker Start: \$(date) ---" >> "\$LOG_FILE"
|
|
65
|
+
export AC_DEBUG="true"
|
|
66
|
+
node "\$AGENT_DIR/src/cs-devops-agent-worker.js" >> "\$LOG_FILE" 2>&1 &
|
|
67
|
+
echo "Worker PID: \$!"
|
|
68
|
+
echo "Logs: \$LOG_FILE"
|
|
69
|
+
exit 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# Otherwise run interactive CLI
|
|
73
|
+
node "\$AGENT_DIR/bin/cs-devops-agent" "\$@"
|
|
74
|
+
EOF
|
|
75
|
+
|
|
76
|
+
chmod +x "$RUNNER"
|
|
77
|
+
|
|
78
|
+
# Add to gitignore in target
|
|
79
|
+
GITIGNORE="$TARGET_DIR/.gitignore"
|
|
80
|
+
if [ -f "$GITIGNORE" ]; then
|
|
81
|
+
if ! grep -q "DevOpsAgent/" "$GITIGNORE"; then
|
|
82
|
+
echo "" >> "$GITIGNORE"
|
|
83
|
+
echo "# DevOps Agent" >> "$GITIGNORE"
|
|
84
|
+
echo "DevOpsAgent/" >> "$GITIGNORE"
|
|
85
|
+
echo "devops-agent.log" >> "$GITIGNORE"
|
|
86
|
+
echo "devops" >> "$GITIGNORE"
|
|
87
|
+
echo "Added DevOpsAgent files to .gitignore"
|
|
88
|
+
fi
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
echo "Deployment complete!"
|
|
92
|
+
echo "Use the './devops' script to interact with the agent:"
|
|
93
|
+
echo ""
|
|
94
|
+
echo " ./devops setup # Run first-time setup"
|
|
95
|
+
echo " ./devops chat # Chat with Kora"
|
|
96
|
+
echo " ./devops start # Start session manager (Interactive)"
|
|
97
|
+
echo " ./devops background # Run worker silently"
|
|
98
|
+
echo " ./devops --help # See all commands"
|
|
99
|
+
echo ""
|
|
100
|
+
echo "Logs location: '$LOG_FILE'"
|