@arcteninc/core 0.0.139 → 0.0.141

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.
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Wrapper for cli-sync.ts
4
+ * Handles TypeScript execution via tsx
5
+ */
6
+
7
+ const { spawn, execSync } = require('child_process');
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+
11
+ const scriptPath = path.join(__dirname, 'cli-sync.ts');
12
+
13
+ // Check if script exists
14
+ if (!fs.existsSync(scriptPath)) {
15
+ console.error('❌ cli-sync.ts not found');
16
+ process.exit(1);
17
+ }
18
+
19
+ // Try tsx first (most reliable for TypeScript)
20
+ function tryTsx() {
21
+ try {
22
+ execSync('npx tsx --version', { stdio: 'ignore' });
23
+ return true;
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ // Try bun
30
+ function tryBun() {
31
+ try {
32
+ execSync('bun --version', { stdio: 'ignore' });
33
+ return true;
34
+ } catch {
35
+ return false;
36
+ }
37
+ }
38
+
39
+ let runner, args;
40
+
41
+ if (tryTsx()) {
42
+ runner = 'npx';
43
+ args = ['tsx', scriptPath, ...process.argv.slice(2)];
44
+ } else if (tryBun()) {
45
+ runner = 'bun';
46
+ args = [scriptPath, ...process.argv.slice(2)];
47
+ } else {
48
+ console.error('❌ No TypeScript runner found.');
49
+ console.error('');
50
+ console.error('Install one of:');
51
+ console.error(' npm install -g tsx');
52
+ console.error(' OR install Bun: https://bun.sh');
53
+ process.exit(1);
54
+ }
55
+
56
+ const child = spawn(runner, args, {
57
+ stdio: 'inherit',
58
+ cwd: process.cwd(),
59
+ shell: true
60
+ });
61
+
62
+ child.on('error', (error) => {
63
+ console.error('❌ Failed to run sync:', error.message);
64
+ process.exit(1);
65
+ });
66
+
67
+ child.on('exit', (code) => {
68
+ process.exit(code || 0);
69
+ });