proagents 1.6.12 → 1.6.15
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/.proagents/.cursorrules +16 -2
- package/.proagents/.learning/global/common-patterns.template.json +60 -0
- package/.proagents/.learning/global/user-preferences.template.json +78 -0
- package/.proagents/.windsurfrules +16 -2
- package/.proagents/AGENTS.md +55 -0
- package/.proagents/AI_INSTRUCTIONS.md +1252 -53
- package/.proagents/ANTIGRAVITY.md +16 -2
- package/.proagents/BOLT.md +16 -2
- package/.proagents/CHATGPT.md +16 -2
- package/.proagents/CLAUDE.md +16 -2
- package/.proagents/GEMINI.md +16 -2
- package/.proagents/GROQ.md +16 -2
- package/.proagents/KIRO.md +16 -2
- package/.proagents/LOVABLE.md +16 -2
- package/.proagents/PROAGENTS.md +52 -26
- package/.proagents/REPLIT.md +16 -2
- package/.proagents/active-features/_index.template.json +75 -0
- package/.proagents/changelog/_recent.template.md +51 -0
- package/.proagents/docs/command-details.md +985 -82
- package/.proagents/worklog/_context.md +31 -1
- package/.proagents/worklog/_context.template.md +82 -0
- package/.proagents/worklog/ai-stats.json +19 -0
- package/.proagents/worklog/ai-stats.template.json +54 -0
- package/README.md +85 -1
- package/bin/proagents.js +132 -1
- package/lib/commands/ai.js +103 -11
- package/lib/commands/changelog.js +389 -0
- package/lib/commands/completion.js +413 -0
- package/lib/commands/config.js +248 -0
- package/lib/commands/doctor.js +222 -25
- package/lib/commands/help.js +22 -2
- package/lib/commands/init.js +171 -2
- package/lib/commands/open.js +188 -0
- package/lib/commands/release.js +1007 -0
- package/lib/commands/restore.js +150 -0
- package/lib/commands/stats.js +320 -0
- package/lib/commands/uninstall.js +98 -4
- package/lib/commands/upgrade.js +102 -10
- package/lib/commands/version.js +140 -0
- package/package.json +1 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
|
|
6
|
+
// File shortcuts mapping
|
|
7
|
+
const FILE_SHORTCUTS = {
|
|
8
|
+
// Main config
|
|
9
|
+
'config': 'proagents.config.yaml',
|
|
10
|
+
'cfg': 'proagents.config.yaml',
|
|
11
|
+
|
|
12
|
+
// Changelog files
|
|
13
|
+
'changelog': '.proagents/changelog/_recent.md',
|
|
14
|
+
'changes': '.proagents/changelog/_recent.md',
|
|
15
|
+
'recent': '.proagents/changelog/_recent.md',
|
|
16
|
+
|
|
17
|
+
// Activity and logs
|
|
18
|
+
'activity': '.proagents/activity.log',
|
|
19
|
+
'log': '.proagents/activity.log',
|
|
20
|
+
'logs': '.proagents/activity.log',
|
|
21
|
+
|
|
22
|
+
// Context and worklog
|
|
23
|
+
'context': '.proagents/worklog/_context.md',
|
|
24
|
+
'ctx': '.proagents/worklog/_context.md',
|
|
25
|
+
'worklog': '.proagents/worklog/',
|
|
26
|
+
|
|
27
|
+
// AI instructions
|
|
28
|
+
'instructions': '.proagents/AI_INSTRUCTIONS.md',
|
|
29
|
+
'ai': '.proagents/AI_INSTRUCTIONS.md',
|
|
30
|
+
|
|
31
|
+
// Learning and feedback
|
|
32
|
+
'feedback': '.proagents/feedback.md',
|
|
33
|
+
'errors': '.proagents/errors.md',
|
|
34
|
+
'decisions': '.proagents/decisions.md',
|
|
35
|
+
|
|
36
|
+
// Watchlist
|
|
37
|
+
'watchlist': '.proagents/watchlist.yaml',
|
|
38
|
+
'watch': '.proagents/watchlist.yaml',
|
|
39
|
+
|
|
40
|
+
// Handoff
|
|
41
|
+
'handoff': '.proagents/handoff.md',
|
|
42
|
+
|
|
43
|
+
// Features
|
|
44
|
+
'features': '.proagents/active-features/',
|
|
45
|
+
|
|
46
|
+
// Standards and rules
|
|
47
|
+
'standards': '.proagents/config/standards/',
|
|
48
|
+
'rules': '.proagents/config/rules/',
|
|
49
|
+
'integrations': '.proagents/config/integrations/',
|
|
50
|
+
|
|
51
|
+
// Quick reference
|
|
52
|
+
'commands': '.proagents/PROAGENTS.md',
|
|
53
|
+
'help': '.proagents/PROAGENTS.md',
|
|
54
|
+
'workflow': '.proagents/WORKFLOW.md',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get the editor command based on environment
|
|
59
|
+
*/
|
|
60
|
+
function getEditorCommand() {
|
|
61
|
+
// Check for common environment variables
|
|
62
|
+
const editor = process.env.EDITOR || process.env.VISUAL;
|
|
63
|
+
if (editor) return editor;
|
|
64
|
+
|
|
65
|
+
// Platform-specific defaults
|
|
66
|
+
const platform = process.platform;
|
|
67
|
+
if (platform === 'darwin') {
|
|
68
|
+
// macOS - try code, then open
|
|
69
|
+
try {
|
|
70
|
+
execSync('which code', { stdio: 'ignore' });
|
|
71
|
+
return 'code';
|
|
72
|
+
} catch {
|
|
73
|
+
return 'open';
|
|
74
|
+
}
|
|
75
|
+
} else if (platform === 'win32') {
|
|
76
|
+
return 'notepad';
|
|
77
|
+
} else {
|
|
78
|
+
// Linux - try code, vim, nano
|
|
79
|
+
try {
|
|
80
|
+
execSync('which code', { stdio: 'ignore' });
|
|
81
|
+
return 'code';
|
|
82
|
+
} catch {
|
|
83
|
+
try {
|
|
84
|
+
execSync('which vim', { stdio: 'ignore' });
|
|
85
|
+
return 'vim';
|
|
86
|
+
} catch {
|
|
87
|
+
return 'nano';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Open a file or directory in the default editor
|
|
95
|
+
*/
|
|
96
|
+
function openInEditor(path) {
|
|
97
|
+
const editor = getEditorCommand();
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
if (editor === 'open') {
|
|
101
|
+
// macOS open command
|
|
102
|
+
execSync(`open "${path}"`, { stdio: 'inherit' });
|
|
103
|
+
} else if (editor === 'code') {
|
|
104
|
+
// VS Code
|
|
105
|
+
execSync(`code "${path}"`, { stdio: 'inherit' });
|
|
106
|
+
} else {
|
|
107
|
+
// Other editors
|
|
108
|
+
execSync(`${editor} "${path}"`, { stdio: 'inherit' });
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
} catch (error) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Command: proagents open <shortcut|path>
|
|
118
|
+
* Open ProAgents files quickly
|
|
119
|
+
*/
|
|
120
|
+
export function openCommand(target, options = {}) {
|
|
121
|
+
const targetDir = process.cwd();
|
|
122
|
+
|
|
123
|
+
// If no target, show available shortcuts
|
|
124
|
+
if (!target) {
|
|
125
|
+
console.log(chalk.bold('\nProAgents Open - Quick File Access'));
|
|
126
|
+
console.log(chalk.gray('══════════════════════════════════════════════════════════\n'));
|
|
127
|
+
|
|
128
|
+
console.log(chalk.cyan('Usage:'));
|
|
129
|
+
console.log(chalk.white(' proagents open <shortcut>'));
|
|
130
|
+
console.log(chalk.white(' proagents open <file-path>\n'));
|
|
131
|
+
|
|
132
|
+
console.log(chalk.cyan('Shortcuts:'));
|
|
133
|
+
console.log(chalk.gray('─────────────────────────────────────────────────'));
|
|
134
|
+
|
|
135
|
+
const categories = {
|
|
136
|
+
'Configuration': ['config', 'watchlist', 'standards', 'rules'],
|
|
137
|
+
'Changelog & Logs': ['changelog', 'activity', 'context'],
|
|
138
|
+
'AI & Workflow': ['instructions', 'commands', 'workflow'],
|
|
139
|
+
'Learning': ['feedback', 'errors', 'decisions'],
|
|
140
|
+
'Collaboration': ['handoff', 'features', 'worklog'],
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
for (const [category, shortcuts] of Object.entries(categories)) {
|
|
144
|
+
console.log(chalk.yellow(`\n ${category}:`));
|
|
145
|
+
for (const shortcut of shortcuts) {
|
|
146
|
+
const path = FILE_SHORTCUTS[shortcut];
|
|
147
|
+
if (path) {
|
|
148
|
+
const exists = existsSync(join(targetDir, path));
|
|
149
|
+
const status = exists ? chalk.green('✓') : chalk.gray('○');
|
|
150
|
+
console.log(` ${status} ${chalk.white(shortcut.padEnd(15))} → ${chalk.gray(path)}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
console.log(chalk.gray('\n─────────────────────────────────────────────────'));
|
|
156
|
+
console.log(chalk.gray('Legend: ') + chalk.green('✓ exists ') + chalk.gray('○ not created yet\n'));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Check if target is a shortcut
|
|
161
|
+
let filePath = FILE_SHORTCUTS[target.toLowerCase()];
|
|
162
|
+
|
|
163
|
+
if (filePath) {
|
|
164
|
+
filePath = join(targetDir, filePath);
|
|
165
|
+
} else {
|
|
166
|
+
// Treat as direct path
|
|
167
|
+
filePath = target.startsWith('/') ? target : join(targetDir, target);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Check if file/directory exists
|
|
171
|
+
if (!existsSync(filePath)) {
|
|
172
|
+
console.log(chalk.red(`\nFile not found: ${filePath}`));
|
|
173
|
+
console.log(chalk.gray('Run "proagents open" to see available shortcuts.\n'));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Open the file
|
|
178
|
+
console.log(chalk.cyan(`\nOpening: ${filePath}`));
|
|
179
|
+
|
|
180
|
+
const success = openInEditor(filePath);
|
|
181
|
+
|
|
182
|
+
if (success) {
|
|
183
|
+
console.log(chalk.green('✓ Opened in editor\n'));
|
|
184
|
+
} else {
|
|
185
|
+
console.log(chalk.yellow(`\nCould not open automatically.`));
|
|
186
|
+
console.log(chalk.gray(`Path: ${filePath}\n`));
|
|
187
|
+
}
|
|
188
|
+
}
|