openmatrix 0.2.28 → 0.2.29

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.
@@ -40,12 +40,16 @@ const fs = __importStar(require("fs"));
40
40
  const path = __importStar(require("path"));
41
41
  const os = __importStar(require("os"));
42
42
  exports.installSkillsCommand = new commander_1.Command('install-skills')
43
- .description('Install OpenMatrix skills to ~/.claude/commands/om/')
43
+ .description('Install OpenMatrix skills to ~/.claude/commands/om/ and ~/.matrix/skills/om/ (if MatrixCode detected)')
44
44
  .option('-f, --force', 'Force overwrite existing skills', false)
45
45
  .action((options) => {
46
46
  const skillsDir = path.join(__dirname, '..', '..', '..', 'skills');
47
47
  const claudeDir = path.join(os.homedir(), '.claude');
48
- const commandsDir = path.join(claudeDir, 'commands', 'om');
48
+ const claudeCommandsDir = path.join(claudeDir, 'commands', 'om');
49
+ // Check for MatrixCode installation
50
+ const matrixDir = path.join(os.homedir(), '.matrix');
51
+ const matrixSkillsDir = path.join(matrixDir, 'skills', 'om');
52
+ const hasMatrixCode = fs.existsSync(matrixDir);
49
53
  console.log('šŸ“¦ OpenMatrix Skills Installer\n');
50
54
  // Check if skills directory exists
51
55
  if (!fs.existsSync(skillsDir)) {
@@ -53,106 +57,124 @@ exports.installSkillsCommand = new commander_1.Command('install-skills')
53
57
  console.error(' Make sure openmatrix is installed correctly.');
54
58
  process.exit(1);
55
59
  }
56
- // Create commands directory
57
- try {
58
- if (!fs.existsSync(commandsDir)) {
59
- fs.mkdirSync(commandsDir, { recursive: true });
60
- console.log('šŸ“ Created directory:', commandsDir);
61
- }
62
- }
63
- catch (err) {
64
- console.error('āŒ Cannot create directory:', commandsDir);
65
- console.error(' Error:', err instanceof Error ? err.message : String(err));
66
- process.exit(1);
67
- }
68
- // Get skill files (excluding om.md and openmatrix.md which are handled separately)
60
+ // Define target directories
61
+ const targets = [
62
+ { name: 'Claude Code', dir: claudeCommandsDir, enabled: true },
63
+ { name: 'MatrixCode', dir: matrixSkillsDir, enabled: hasMatrixCode },
64
+ ];
65
+ // Get skill files
69
66
  const files = fs.readdirSync(skillsDir).filter(f => f.endsWith('.md') && f !== 'om.md' && f !== 'openmatrix.md');
70
67
  if (files.length === 0) {
71
68
  console.error('āŒ No skill files found in:', skillsDir);
72
69
  process.exit(1);
73
70
  }
74
71
  console.log(`šŸ“‹ Found ${files.length} skill files\n`);
75
- let installed = 0;
76
- let skipped = 0;
77
- let failed = 0;
78
- // Install skill files to ~/.claude/commands/om/
79
- files.forEach(file => {
80
- const src = path.join(skillsDir, file);
81
- const dest = path.join(commandsDir, file);
72
+ let totalInstalled = 0;
73
+ let totalSkipped = 0;
74
+ let totalFailed = 0;
75
+ // Install to each target
76
+ for (const target of targets) {
77
+ if (!target.enabled) {
78
+ console.log(`ā­ļø ${target.name}: skipped (not installed)`);
79
+ continue;
80
+ }
81
+ console.log(`\nšŸ”§ Installing to ${target.name}...`);
82
82
  try {
83
- // Check if file exists and not forcing
84
- if (fs.existsSync(dest) && !options.force) {
85
- console.log(` ā­ļø Skipped: ${file} (already exists)`);
86
- skipped++;
87
- return;
83
+ if (!fs.existsSync(target.dir)) {
84
+ fs.mkdirSync(target.dir, { recursive: true });
85
+ console.log(`šŸ“ Created directory: ${target.dir}`);
88
86
  }
89
- fs.copyFileSync(src, dest);
90
- const skillName = path.basename(file, '.md');
91
- console.log(` āœ… Installed: /om:${skillName}`);
92
- installed++;
93
87
  }
94
88
  catch (err) {
95
- console.log(` āŒ Failed: ${file} (${err instanceof Error ? err.message : String(err)})`);
96
- failed++;
89
+ console.error(`āŒ Cannot create directory: ${target.dir}`);
90
+ console.error(` Error: ${err instanceof Error ? err.message : String(err)}`);
91
+ continue;
97
92
  }
98
- });
99
- // Install default /om command to ~/.claude/commands/om.md
100
- const omSrc = path.join(skillsDir, 'om.md');
101
- const omDest = path.join(claudeDir, 'commands', 'om.md');
102
- if (fs.existsSync(omSrc)) {
103
- try {
104
- if (fs.existsSync(omDest) && !options.force) {
105
- console.log(` ā­ļø Skipped: om.md (already exists)`);
106
- skipped++;
107
- }
108
- else {
109
- fs.copyFileSync(omSrc, omDest);
110
- console.log(` āœ… Installed: /om (default entry)`);
93
+ let installed = 0;
94
+ let skipped = 0;
95
+ let failed = 0;
96
+ // Install skill files
97
+ files.forEach(file => {
98
+ const src = path.join(skillsDir, file);
99
+ const dest = path.join(target.dir, file);
100
+ try {
101
+ if (fs.existsSync(dest) && !options.force) {
102
+ skipped++;
103
+ return;
104
+ }
105
+ fs.copyFileSync(src, dest);
111
106
  installed++;
112
107
  }
113
- }
114
- catch (err) {
115
- console.log(` āŒ Failed: om.md (${err instanceof Error ? err.message : String(err)})`);
116
- failed++;
117
- }
118
- }
119
- // Install auto-detection instructions
120
- const autoSrc = path.join(skillsDir, 'openmatrix.md');
121
- const autoDest = path.join(claudeDir, 'commands', 'openmatrix.md');
122
- if (fs.existsSync(autoSrc)) {
123
- try {
124
- if (fs.existsSync(autoDest) && !options.force) {
125
- console.log(` ā­ļø Skipped: openmatrix.md (already exists)`);
126
- skipped++;
108
+ catch (err) {
109
+ console.log(` āŒ Failed: ${file} (${err instanceof Error ? err.message : String(err)})`);
110
+ failed++;
127
111
  }
128
- else {
129
- fs.copyFileSync(autoSrc, autoDest);
130
- console.log(` āœ… Installed: /om:openmatrix (auto-detection)`);
131
- installed++;
112
+ });
113
+ // Install om.md to parent directory for Claude Code
114
+ if (target.name === 'Claude Code') {
115
+ const omSrc = path.join(skillsDir, 'om.md');
116
+ const omDest = path.join(claudeDir, 'commands', 'om.md');
117
+ if (fs.existsSync(omSrc)) {
118
+ try {
119
+ if (fs.existsSync(omDest) && !options.force) {
120
+ skipped++;
121
+ }
122
+ else {
123
+ fs.copyFileSync(omSrc, omDest);
124
+ installed++;
125
+ }
126
+ }
127
+ catch (err) {
128
+ failed++;
129
+ }
130
+ }
131
+ // Install openmatrix.md (auto-detection)
132
+ const autoSrc = path.join(skillsDir, 'openmatrix.md');
133
+ const autoDest = path.join(claudeDir, 'commands', 'openmatrix.md');
134
+ if (fs.existsSync(autoSrc)) {
135
+ try {
136
+ if (fs.existsSync(autoDest) && !options.force) {
137
+ skipped++;
138
+ }
139
+ else {
140
+ fs.copyFileSync(autoSrc, autoDest);
141
+ installed++;
142
+ }
143
+ }
144
+ catch (err) {
145
+ failed++;
146
+ }
132
147
  }
133
148
  }
134
- catch (err) {
135
- console.log(` āŒ Failed: openmatrix.md (${err instanceof Error ? err.message : String(err)})`);
136
- failed++;
149
+ console.log(` āœ… Installed: ${installed}`);
150
+ console.log(` ā­ļø Skipped: ${skipped}`);
151
+ if (failed > 0) {
152
+ console.log(` āŒ Failed: ${failed}`);
137
153
  }
154
+ totalInstalled += installed;
155
+ totalSkipped += skipped;
156
+ totalFailed += failed;
138
157
  }
139
158
  console.log('\n' + '─'.repeat(50));
140
- console.log(`šŸ“Š Summary:`);
141
- console.log(` āœ… Installed: ${installed}`);
142
- console.log(` ā­ļø Skipped: ${skipped}`);
143
- console.log(` āŒ Failed: ${failed}`);
144
- console.log(`\nšŸ“ Skills: ${commandsDir}`);
145
- console.log(`šŸ“ Default: ${omDest}`);
146
- if (installed > 0) {
159
+ console.log(`šŸ“Š Total Summary:`);
160
+ console.log(` āœ… Installed: ${totalInstalled}`);
161
+ console.log(` ā­ļø Skipped: ${totalSkipped}`);
162
+ console.log(` āŒ Failed: ${totalFailed}`);
163
+ console.log('\nšŸ“ Installation locations:');
164
+ for (const target of targets) {
165
+ if (target.enabled) {
166
+ console.log(` ${target.name}: ${target.dir}`);
167
+ }
168
+ }
169
+ if (totalInstalled > 0) {
147
170
  console.log('\nšŸŽ‰ Skills installed successfully!');
148
171
  console.log(' Try: /om <your task>');
149
172
  console.log(' Or: /om:start <your task>');
150
- console.log('\nšŸ’” Auto-detection enabled!');
151
- console.log(' Type task descriptions directly:');
152
- console.log(' - "å®žēŽ°ē”Øęˆ·ē™»å½•åŠŸčƒ½" → auto invokes /om:start');
153
- console.log(' - "fix the login bug" → auto invokes /om:start');
154
173
  }
155
- if (failed > 0) {
174
+ if (hasMatrixCode) {
175
+ console.log('\nāœ… MatrixCode detected! Skills also installed to ~/.matrix/skills/om/');
176
+ }
177
+ if (totalFailed > 0) {
156
178
  process.exit(1);
157
179
  }
158
180
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmatrix",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "AI Agent task orchestration system with Claude Code Skills integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,6 +23,19 @@ const targets = [
23
23
  },
24
24
  ];
25
25
 
26
+ // Check for MatrixCode installation
27
+ // MatrixCode uses ~/.matrix/ directory for configuration
28
+ const matrixDir = path.join(os.homedir(), '.matrix');
29
+ const matrixSkillsDir = path.join(matrixDir, 'skills', 'om');
30
+
31
+ // If ~/.matrix/ exists, add MatrixCode as a target
32
+ if (fs.existsSync(matrixDir)) {
33
+ targets.push({
34
+ name: 'MatrixCode',
35
+ dir: matrixSkillsDir,
36
+ });
37
+ }
38
+
26
39
  if (!fs.existsSync(skillsDir)) {
27
40
  console.log('Skills directory not found, skipping installation.');
28
41
  process.exit(0);