@allanpk716/work-skills-setup 0.1.0

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,72 @@
1
+ 'use strict';
2
+
3
+ const execa = require('execa');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ /**
8
+ * Run Python verification script and capture output
9
+ * @returns {Promise<{success: boolean, stdout?: string, stderr?: string, exitCode?: number, error?: string}>}
10
+ */
11
+ async function runPythonVerification() {
12
+ // Build script path (relative to this module)
13
+ const scriptPath = path.join(__dirname, '../../../plugins/claude-notify/scripts/verify-installation.py');
14
+
15
+ // Check if script exists
16
+ if (!fs.existsSync(scriptPath)) {
17
+ return {
18
+ success: false,
19
+ error: 'script_not_found'
20
+ };
21
+ }
22
+
23
+ try {
24
+ const result = await execa('python', [scriptPath], {
25
+ timeout: 30000,
26
+ encoding: 'utf-8',
27
+ reject: false
28
+ });
29
+
30
+ // Handle execution failure (non-zero exit code)
31
+ if (result.failed) {
32
+ return {
33
+ success: false,
34
+ error: 'execution_failed',
35
+ stderr: result.stderr,
36
+ exitCode: result.exitCode
37
+ };
38
+ }
39
+
40
+ // Success
41
+ return {
42
+ success: true,
43
+ stdout: result.stdout,
44
+ stderr: result.stderr,
45
+ exitCode: result.exitCode
46
+ };
47
+
48
+ } catch (error) {
49
+ // Handle timeout
50
+ if (error.timedOut) {
51
+ return {
52
+ success: false,
53
+ error: 'timeout'
54
+ };
55
+ }
56
+
57
+ // Handle Python not found (ENOENT)
58
+ if (error.code === 'ENOENT') {
59
+ return {
60
+ success: false,
61
+ error: 'python_not_found'
62
+ };
63
+ }
64
+
65
+ // Re-throw unexpected errors
66
+ throw error;
67
+ }
68
+ }
69
+
70
+ module.exports = {
71
+ runPythonVerification
72
+ };
package/src/welcome.js ADDED
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ const chalk = require('chalk');
4
+ const boxen = require('boxen');
5
+ const { t } = require('./i18n/index.js');
6
+
7
+ /**
8
+ * Show welcome banner
9
+ * @param {Object} options
10
+ * @param {boolean} options.useColors - Enable/disable colors
11
+ */
12
+ function showWelcome(options = {}) {
13
+ const { useColors = true } = options;
14
+ const packageJson = require('../package.json');
15
+
16
+ // Disable colors if requested
17
+ const color = useColors ? chalk : new chalk.Instance({ level: 0 });
18
+
19
+ // Build welcome content
20
+ const title = color.bold.cyan(t('welcome.title'));
21
+ const subtitle = color.gray(t('welcome.subtitle'));
22
+ const version = color.green(`${t('welcome.version')}: v${packageJson.version}`);
23
+
24
+ const features = [
25
+ color.yellow('* ') + t('welcome.feature1'),
26
+ color.yellow('* ') + t('welcome.feature2'),
27
+ color.yellow('* ') + t('welcome.feature3')
28
+ ].join('\n ');
29
+
30
+ const content = `${title}
31
+ ${subtitle}
32
+
33
+ ${version}
34
+
35
+ ${color.white(t('welcome.features') + ':')}
36
+ ${features}`;
37
+
38
+ const box = boxen(content, {
39
+ padding: 1,
40
+ margin: 1,
41
+ borderStyle: 'round',
42
+ borderColor: useColors ? 'cyan' : 'white'
43
+ });
44
+
45
+ console.log(box);
46
+ }
47
+
48
+ module.exports = {
49
+ showWelcome
50
+ };