ronds_ai 0.1.13 → 0.1.14

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.
@@ -1,130 +1,130 @@
1
- const readline = require('readline');
2
-
3
- const TOOL_CHOICES = ['claude', 'codex', 'cursor'];
4
- const SCOPE_CHOICES = ['project', 'global'];
5
-
6
- function normalizeCsvInput(raw) {
7
- return String(raw || '')
8
- .split(',')
9
- .map((item) => item.trim().toLowerCase())
10
- .filter(Boolean);
11
- }
12
-
13
- function normalizeChoiceInput(raw) {
14
- const values = normalizeCsvInput(raw);
15
- if (values.length === 0) {
16
- return [];
17
- }
18
-
19
- return values.flatMap((value) => {
20
- if (/^\d+$/.test(value)) {
21
- const index = Number(value) - 1;
22
- return TOOL_CHOICES[index] ? [TOOL_CHOICES[index]] : [];
23
- }
24
-
25
- return [value];
26
- });
27
- }
28
-
29
- async function promptForTools() {
30
- const rl = readline.createInterface({
31
- input: process.stdin,
32
- output: process.stdout,
33
- });
34
-
35
- try {
36
- process.stderr.write([
37
- 'Select tools to install:',
38
- ' 1. claude',
39
- ' 2. codex',
40
- ' 3. cursor',
41
- 'Enter comma-separated names or numbers:',
42
- ].join('\n'));
43
- process.stderr.write('\n');
44
-
45
- const answer = await new Promise((resolve) => {
46
- rl.question('> ', resolve);
47
- });
48
- return normalizeChoiceInput(answer);
49
- } finally {
50
- rl.close();
51
- }
52
- }
53
-
54
- async function promptForScope() {
55
- const rl = readline.createInterface({
56
- input: process.stdin,
57
- output: process.stdout,
58
- });
59
-
60
- try {
61
- process.stderr.write([
62
- 'Select install scope:',
63
- ' 1. project',
64
- ' 2. global',
65
- 'Enter project or global:',
66
- ].join('\n'));
67
- process.stderr.write('\n');
68
-
69
- const answer = String(await new Promise((resolve) => {
70
- rl.question('> ', resolve);
71
- })).trim().toLowerCase();
72
- if (answer === '1') {
73
- return 'project';
74
- }
75
- if (answer === '2') {
76
- return 'global';
77
- }
78
- return answer;
79
- } finally {
80
- rl.close();
81
- }
82
- }
83
-
84
- async function promptYesNo(message) {
85
- const rl = readline.createInterface({
86
- input: process.stdin,
87
- output: process.stdout,
88
- });
89
-
90
- try {
91
- process.stderr.write(`${message} [y/N]\n`);
92
- const answer = String(await new Promise((resolve) => {
93
- rl.question('> ', resolve);
94
- })).trim().toLowerCase();
95
- return answer === 'y' || answer === 'yes';
96
- } finally {
97
- rl.close();
98
- }
99
- }
100
-
101
- async function promptForText(message, defaultValue = '') {
102
- const rl = readline.createInterface({
103
- input: process.stdin,
104
- output: process.stdout,
105
- });
106
-
107
- try {
108
- process.stderr.write(`${message}\n`);
109
- if (defaultValue) {
110
- process.stderr.write(`Current value: ${defaultValue}\n`);
111
- }
112
- const answer = await new Promise((resolve) => {
113
- rl.question('> ', resolve);
114
- });
115
- return String(answer).trim();
116
- } finally {
117
- rl.close();
118
- }
119
- }
120
-
121
- module.exports = {
122
- SCOPE_CHOICES,
123
- TOOL_CHOICES,
124
- normalizeChoiceInput,
125
- normalizeCsvInput,
126
- promptForScope,
127
- promptForText,
128
- promptForTools,
129
- promptYesNo,
130
- };
1
+ const readline = require('readline');
2
+
3
+ const TOOL_CHOICES = ['claude', 'codex', 'cursor'];
4
+ const SCOPE_CHOICES = ['project', 'global'];
5
+
6
+ function normalizeCsvInput(raw) {
7
+ return String(raw || '')
8
+ .split(',')
9
+ .map((item) => item.trim().toLowerCase())
10
+ .filter(Boolean);
11
+ }
12
+
13
+ function normalizeChoiceInput(raw) {
14
+ const values = normalizeCsvInput(raw);
15
+ if (values.length === 0) {
16
+ return [];
17
+ }
18
+
19
+ return values.flatMap((value) => {
20
+ if (/^\d+$/.test(value)) {
21
+ const index = Number(value) - 1;
22
+ return TOOL_CHOICES[index] ? [TOOL_CHOICES[index]] : [];
23
+ }
24
+
25
+ return [value];
26
+ });
27
+ }
28
+
29
+ async function promptForTools() {
30
+ const rl = readline.createInterface({
31
+ input: process.stdin,
32
+ output: process.stdout,
33
+ });
34
+
35
+ try {
36
+ process.stderr.write([
37
+ 'Select tools to install:',
38
+ ' 1. claude',
39
+ ' 2. codex',
40
+ ' 3. cursor',
41
+ 'Enter comma-separated names or numbers:',
42
+ ].join('\n'));
43
+ process.stderr.write('\n');
44
+
45
+ const answer = await new Promise((resolve) => {
46
+ rl.question('> ', resolve);
47
+ });
48
+ return normalizeChoiceInput(answer);
49
+ } finally {
50
+ rl.close();
51
+ }
52
+ }
53
+
54
+ async function promptForScope() {
55
+ const rl = readline.createInterface({
56
+ input: process.stdin,
57
+ output: process.stdout,
58
+ });
59
+
60
+ try {
61
+ process.stderr.write([
62
+ 'Select install scope:',
63
+ ' 1. project',
64
+ ' 2. global',
65
+ 'Enter project or global:',
66
+ ].join('\n'));
67
+ process.stderr.write('\n');
68
+
69
+ const answer = String(await new Promise((resolve) => {
70
+ rl.question('> ', resolve);
71
+ })).trim().toLowerCase();
72
+ if (answer === '1') {
73
+ return 'project';
74
+ }
75
+ if (answer === '2') {
76
+ return 'global';
77
+ }
78
+ return answer;
79
+ } finally {
80
+ rl.close();
81
+ }
82
+ }
83
+
84
+ async function promptYesNo(message) {
85
+ const rl = readline.createInterface({
86
+ input: process.stdin,
87
+ output: process.stdout,
88
+ });
89
+
90
+ try {
91
+ process.stderr.write(`${message} [y/N]\n`);
92
+ const answer = String(await new Promise((resolve) => {
93
+ rl.question('> ', resolve);
94
+ })).trim().toLowerCase();
95
+ return answer === 'y' || answer === 'yes';
96
+ } finally {
97
+ rl.close();
98
+ }
99
+ }
100
+
101
+ async function promptForText(message, defaultValue = '') {
102
+ const rl = readline.createInterface({
103
+ input: process.stdin,
104
+ output: process.stdout,
105
+ });
106
+
107
+ try {
108
+ process.stderr.write(`${message}\n`);
109
+ if (defaultValue) {
110
+ process.stderr.write(`Current value: ${defaultValue}\n`);
111
+ }
112
+ const answer = await new Promise((resolve) => {
113
+ rl.question('> ', resolve);
114
+ });
115
+ return String(answer).trim();
116
+ } finally {
117
+ rl.close();
118
+ }
119
+ }
120
+
121
+ module.exports = {
122
+ SCOPE_CHOICES,
123
+ TOOL_CHOICES,
124
+ normalizeChoiceInput,
125
+ normalizeCsvInput,
126
+ promptForScope,
127
+ promptForText,
128
+ promptForTools,
129
+ promptYesNo,
130
+ };
@@ -1,81 +1,81 @@
1
- const os = require('os');
2
- const path = require('path');
3
- const { SCOPE_CHOICES, TOOL_CHOICES, normalizeCsvInput } = require('./skills_prompt');
4
-
5
- function normalizeTools(rawTools) {
6
- const values = Array.isArray(rawTools)
7
- ? rawTools.flatMap((item) => normalizeCsvInput(item))
8
- : normalizeCsvInput(rawTools);
9
- const unique = [];
10
-
11
- for (const tool of values) {
12
- if (!TOOL_CHOICES.includes(tool)) {
13
- throw new Error(`Unsupported skills tool: ${tool}`);
14
- }
15
-
16
- if (!unique.includes(tool)) {
17
- unique.push(tool);
18
- }
19
- }
20
-
21
- return unique;
22
- }
23
-
24
- function normalizeScope(rawScope) {
25
- const scope = String(rawScope || '').trim().toLowerCase();
26
- if (!scope) {
27
- return '';
28
- }
29
-
30
- if (!SCOPE_CHOICES.includes(scope)) {
31
- throw new Error(`Unsupported skills scope: ${rawScope}`);
32
- }
33
-
34
- return scope;
35
- }
36
-
37
- function resolveToolBaseDir(tool, scope, projectDir) {
38
- const baseDir = scope === 'global' ? os.homedir() : path.resolve(projectDir || process.cwd());
39
-
40
- if (tool === 'claude') {
41
- return path.join(baseDir, '.claude', 'skills');
42
- }
43
-
44
- if (tool === 'codex' || tool === 'cursor') {
45
- return path.join(baseDir, '.agents', 'skills');
46
- }
47
-
48
- throw new Error(`Unsupported skills tool: ${tool}`);
49
- }
50
-
51
- function buildInstallTargets(tools, scope, projectDir, skillName) {
52
- const deduped = new Map();
53
-
54
- for (const tool of tools) {
55
- const baseDir = resolveToolBaseDir(tool, scope, projectDir);
56
- const destination = path.join(baseDir, skillName);
57
- const existing = deduped.get(destination);
58
-
59
- if (existing) {
60
- existing.tools.push(tool);
61
- continue;
62
- }
63
-
64
- deduped.set(destination, {
65
- tool,
66
- tools: [tool],
67
- scope,
68
- baseDir,
69
- destination,
70
- });
71
- }
72
-
73
- return Array.from(deduped.values());
74
- }
75
-
76
- module.exports = {
77
- buildInstallTargets,
78
- normalizeScope,
79
- normalizeTools,
80
- resolveToolBaseDir,
81
- };
1
+ const os = require('os');
2
+ const path = require('path');
3
+ const { SCOPE_CHOICES, TOOL_CHOICES, normalizeCsvInput } = require('./skills_prompt');
4
+
5
+ function normalizeTools(rawTools) {
6
+ const values = Array.isArray(rawTools)
7
+ ? rawTools.flatMap((item) => normalizeCsvInput(item))
8
+ : normalizeCsvInput(rawTools);
9
+ const unique = [];
10
+
11
+ for (const tool of values) {
12
+ if (!TOOL_CHOICES.includes(tool)) {
13
+ throw new Error(`Unsupported skills tool: ${tool}`);
14
+ }
15
+
16
+ if (!unique.includes(tool)) {
17
+ unique.push(tool);
18
+ }
19
+ }
20
+
21
+ return unique;
22
+ }
23
+
24
+ function normalizeScope(rawScope) {
25
+ const scope = String(rawScope || '').trim().toLowerCase();
26
+ if (!scope) {
27
+ return '';
28
+ }
29
+
30
+ if (!SCOPE_CHOICES.includes(scope)) {
31
+ throw new Error(`Unsupported skills scope: ${rawScope}`);
32
+ }
33
+
34
+ return scope;
35
+ }
36
+
37
+ function resolveToolBaseDir(tool, scope, projectDir) {
38
+ const baseDir = scope === 'global' ? os.homedir() : path.resolve(projectDir || process.cwd());
39
+
40
+ if (tool === 'claude') {
41
+ return path.join(baseDir, '.claude', 'skills');
42
+ }
43
+
44
+ if (tool === 'codex' || tool === 'cursor') {
45
+ return path.join(baseDir, '.agents', 'skills');
46
+ }
47
+
48
+ throw new Error(`Unsupported skills tool: ${tool}`);
49
+ }
50
+
51
+ function buildInstallTargets(tools, scope, projectDir, skillName) {
52
+ const deduped = new Map();
53
+
54
+ for (const tool of tools) {
55
+ const baseDir = resolveToolBaseDir(tool, scope, projectDir);
56
+ const destination = path.join(baseDir, skillName);
57
+ const existing = deduped.get(destination);
58
+
59
+ if (existing) {
60
+ existing.tools.push(tool);
61
+ continue;
62
+ }
63
+
64
+ deduped.set(destination, {
65
+ tool,
66
+ tools: [tool],
67
+ scope,
68
+ baseDir,
69
+ destination,
70
+ });
71
+ }
72
+
73
+ return Array.from(deduped.values());
74
+ }
75
+
76
+ module.exports = {
77
+ buildInstallTargets,
78
+ normalizeScope,
79
+ normalizeTools,
80
+ resolveToolBaseDir,
81
+ };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
- {
2
- "name": "ronds_ai",
3
- "version": "0.1.13",
4
- "description": "CLI for reporting AI code edit events.",
5
- "bin": {
6
- "ronds_ai": "bin/ronds_ai.js"
7
- },
8
- "files": [
9
- "bin",
10
- "lib"
11
- ],
12
- "engines": {
13
- "node": ">=16"
14
- },
15
- "license": "MIT"
16
- }
1
+ {
2
+ "name": "ronds_ai",
3
+ "version": "0.1.14",
4
+ "description": "CLI for reporting AI code edit events.",
5
+ "bin": {
6
+ "ronds_ai": "bin/ronds_ai.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "lib"
11
+ ],
12
+ "engines": {
13
+ "node": ">=16"
14
+ },
15
+ "license": "MIT"
16
+ }