tools-cc 1.0.8 → 1.0.10
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/CHANGELOG.md +19 -0
- package/CHANGELOG_en.md +19 -0
- package/README.md +31 -5
- package/README_en.md +31 -5
- package/dist/commands/help.js +18 -1
- package/dist/commands/template.d.ts +3 -1
- package/dist/commands/template.js +38 -6
- package/dist/commands/use.js +11 -1
- package/dist/core/manifest.js +10 -1
- package/dist/core/project.js +27 -1
- package/dist/index.js +3 -2
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.js +4 -2
- package/dist/utils/parsePath.d.ts +1 -1
- package/dist/utils/parsePath.js +5 -3
- package/package.json +1 -1
- package/src/commands/help.ts +18 -1
- package/src/commands/template.ts +202 -160
- package/src/commands/use.ts +11 -1
- package/src/core/manifest.ts +67 -57
- package/src/core/project.ts +304 -276
- package/src/index.ts +254 -253
- package/src/types/config.ts +116 -112
- package/src/utils/parsePath.ts +6 -4
- package/tests/commands/use.test.ts +12 -6
- package/tests/core/project.test.ts +324 -316
- package/tests/types/config.test.ts +44 -16
- package/tests/utils/parsePath.test.ts +18 -9
|
@@ -15,7 +15,8 @@ describe('SourceSelection', () => {
|
|
|
15
15
|
const valid: SourceSelection = {
|
|
16
16
|
skills: ['skill1'],
|
|
17
17
|
commands: ['cmd1'],
|
|
18
|
-
agents: ['agent1']
|
|
18
|
+
agents: ['agent1'],
|
|
19
|
+
rules: []
|
|
19
20
|
};
|
|
20
21
|
expect(isSourceSelection(valid)).toBe(true);
|
|
21
22
|
});
|
|
@@ -24,7 +25,8 @@ describe('SourceSelection', () => {
|
|
|
24
25
|
const empty: SourceSelection = {
|
|
25
26
|
skills: [],
|
|
26
27
|
commands: [],
|
|
27
|
-
agents: []
|
|
28
|
+
agents: [],
|
|
29
|
+
rules: []
|
|
28
30
|
};
|
|
29
31
|
expect(isSourceSelection(empty)).toBe(true);
|
|
30
32
|
});
|
|
@@ -33,7 +35,8 @@ describe('SourceSelection', () => {
|
|
|
33
35
|
const wildcard: SourceSelection = {
|
|
34
36
|
skills: ['*'],
|
|
35
37
|
commands: ['*'],
|
|
36
|
-
agents: ['*']
|
|
38
|
+
agents: ['*'],
|
|
39
|
+
rules: ['*']
|
|
37
40
|
};
|
|
38
41
|
expect(isSourceSelection(wildcard)).toBe(true);
|
|
39
42
|
});
|
|
@@ -55,7 +58,8 @@ describe('SourceSelection', () => {
|
|
|
55
58
|
it('should return false for object missing skills', () => {
|
|
56
59
|
const invalid = {
|
|
57
60
|
commands: ['cmd1'],
|
|
58
|
-
agents: ['agent1']
|
|
61
|
+
agents: ['agent1'],
|
|
62
|
+
rules: []
|
|
59
63
|
};
|
|
60
64
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
61
65
|
});
|
|
@@ -63,7 +67,8 @@ describe('SourceSelection', () => {
|
|
|
63
67
|
it('should return false for object missing commands', () => {
|
|
64
68
|
const invalid = {
|
|
65
69
|
skills: ['skill1'],
|
|
66
|
-
agents: ['agent1']
|
|
70
|
+
agents: ['agent1'],
|
|
71
|
+
rules: []
|
|
67
72
|
};
|
|
68
73
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
69
74
|
});
|
|
@@ -71,7 +76,17 @@ describe('SourceSelection', () => {
|
|
|
71
76
|
it('should return false for object missing agents', () => {
|
|
72
77
|
const invalid = {
|
|
73
78
|
skills: ['skill1'],
|
|
74
|
-
commands: ['cmd1']
|
|
79
|
+
commands: ['cmd1'],
|
|
80
|
+
rules: []
|
|
81
|
+
};
|
|
82
|
+
expect(isSourceSelection(invalid)).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should return false for object missing rules', () => {
|
|
86
|
+
const invalid = {
|
|
87
|
+
skills: ['skill1'],
|
|
88
|
+
commands: ['cmd1'],
|
|
89
|
+
agents: ['agent1']
|
|
75
90
|
};
|
|
76
91
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
77
92
|
});
|
|
@@ -80,7 +95,8 @@ describe('SourceSelection', () => {
|
|
|
80
95
|
const invalid = {
|
|
81
96
|
skills: 'not-array',
|
|
82
97
|
commands: ['cmd1'],
|
|
83
|
-
agents: ['agent1']
|
|
98
|
+
agents: ['agent1'],
|
|
99
|
+
rules: []
|
|
84
100
|
};
|
|
85
101
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
86
102
|
});
|
|
@@ -89,7 +105,8 @@ describe('SourceSelection', () => {
|
|
|
89
105
|
const invalid = {
|
|
90
106
|
skills: ['skill1'],
|
|
91
107
|
commands: 123,
|
|
92
|
-
agents: ['agent1']
|
|
108
|
+
agents: ['agent1'],
|
|
109
|
+
rules: []
|
|
93
110
|
};
|
|
94
111
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
95
112
|
});
|
|
@@ -98,7 +115,18 @@ describe('SourceSelection', () => {
|
|
|
98
115
|
const invalid = {
|
|
99
116
|
skills: ['skill1'],
|
|
100
117
|
commands: ['cmd1'],
|
|
101
|
-
agents: null
|
|
118
|
+
agents: null,
|
|
119
|
+
rules: []
|
|
120
|
+
};
|
|
121
|
+
expect(isSourceSelection(invalid)).toBe(false);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should return false for object with non-array rules', () => {
|
|
125
|
+
const invalid = {
|
|
126
|
+
skills: ['skill1'],
|
|
127
|
+
commands: ['cmd1'],
|
|
128
|
+
agents: ['agent1'],
|
|
129
|
+
rules: 'not-array'
|
|
102
130
|
};
|
|
103
131
|
expect(isSourceSelection(invalid)).toBe(false);
|
|
104
132
|
});
|
|
@@ -116,8 +144,8 @@ describe('normalizeProjectConfig', () => {
|
|
|
116
144
|
const result = normalizeProjectConfig(legacy);
|
|
117
145
|
|
|
118
146
|
expect(result.sources).toEqual({
|
|
119
|
-
source1: { skills: ['*'], commands: ['*'], agents: ['*'] },
|
|
120
|
-
source2: { skills: ['*'], commands: ['*'], agents: ['*'] }
|
|
147
|
+
source1: { skills: ['*'], commands: ['*'], agents: ['*'], rules: ['*'] },
|
|
148
|
+
source2: { skills: ['*'], commands: ['*'], agents: ['*'], rules: ['*'] }
|
|
121
149
|
});
|
|
122
150
|
expect(result.links).toEqual(['iflow', 'claude']);
|
|
123
151
|
});
|
|
@@ -150,7 +178,7 @@ describe('normalizeProjectConfig', () => {
|
|
|
150
178
|
it('should return ProjectConfig as-is when already in new format', () => {
|
|
151
179
|
const newConfig: ProjectConfig = {
|
|
152
180
|
sources: {
|
|
153
|
-
source1: { skills: ['skill1'], commands: ['cmd1'], agents: ['agent1'] }
|
|
181
|
+
source1: { skills: ['skill1'], commands: ['cmd1'], agents: ['agent1'], rules: [] }
|
|
154
182
|
},
|
|
155
183
|
links: ['iflow']
|
|
156
184
|
};
|
|
@@ -163,7 +191,7 @@ describe('normalizeProjectConfig', () => {
|
|
|
163
191
|
it('should handle partial selection in new format', () => {
|
|
164
192
|
const newConfig: ProjectConfig = {
|
|
165
193
|
sources: {
|
|
166
|
-
source1: { skills: ['skill1', 'skill2'], commands: [], agents: ['*'] }
|
|
194
|
+
source1: { skills: ['skill1', 'skill2'], commands: [], agents: ['*'], rules: ['rule1'] }
|
|
167
195
|
},
|
|
168
196
|
links: ['claude']
|
|
169
197
|
};
|
|
@@ -176,8 +204,8 @@ describe('normalizeProjectConfig', () => {
|
|
|
176
204
|
it('should handle multiple sources with different selections', () => {
|
|
177
205
|
const newConfig: ProjectConfig = {
|
|
178
206
|
sources: {
|
|
179
|
-
source1: { skills: ['*'], commands: ['*'], agents: ['*'] },
|
|
180
|
-
source2: { skills: ['skill-a'], commands: [], agents: ['agent-x'] }
|
|
207
|
+
source1: { skills: ['*'], commands: ['*'], agents: ['*'], rules: ['*'] },
|
|
208
|
+
source2: { skills: ['skill-a'], commands: [], agents: ['agent-x'], rules: [] }
|
|
181
209
|
},
|
|
182
210
|
links: ['iflow', 'opencode']
|
|
183
211
|
};
|
|
@@ -197,7 +225,7 @@ describe('ExportConfig', () => {
|
|
|
197
225
|
type: 'project',
|
|
198
226
|
config: {
|
|
199
227
|
sources: {
|
|
200
|
-
source1: { skills: ['*'], commands: ['*'], agents: ['*'] }
|
|
228
|
+
source1: { skills: ['*'], commands: ['*'], agents: ['*'], rules: ['*'] }
|
|
201
229
|
},
|
|
202
230
|
links: ['iflow']
|
|
203
231
|
},
|
|
@@ -119,7 +119,8 @@ describe('buildSelectionFromPaths', () => {
|
|
|
119
119
|
'my-skills': {
|
|
120
120
|
skills: ['a-skill'],
|
|
121
121
|
commands: [],
|
|
122
|
-
agents: []
|
|
122
|
+
agents: [],
|
|
123
|
+
rules: []
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
});
|
|
@@ -132,7 +133,8 @@ describe('buildSelectionFromPaths', () => {
|
|
|
132
133
|
'my-skills': {
|
|
133
134
|
skills: ['a', 'b'],
|
|
134
135
|
commands: [],
|
|
135
|
-
agents: []
|
|
136
|
+
agents: [],
|
|
137
|
+
rules: []
|
|
136
138
|
}
|
|
137
139
|
});
|
|
138
140
|
});
|
|
@@ -149,7 +151,8 @@ describe('buildSelectionFromPaths', () => {
|
|
|
149
151
|
'my-skills': {
|
|
150
152
|
skills: ['a', 'b'],
|
|
151
153
|
commands: ['test'],
|
|
152
|
-
agents: []
|
|
154
|
+
agents: [],
|
|
155
|
+
rules: []
|
|
153
156
|
}
|
|
154
157
|
});
|
|
155
158
|
});
|
|
@@ -166,12 +169,14 @@ describe('buildSelectionFromPaths', () => {
|
|
|
166
169
|
'source-a': {
|
|
167
170
|
skills: ['skill1'],
|
|
168
171
|
commands: [],
|
|
169
|
-
agents: []
|
|
172
|
+
agents: [],
|
|
173
|
+
rules: []
|
|
170
174
|
},
|
|
171
175
|
'source-b': {
|
|
172
176
|
skills: [],
|
|
173
177
|
commands: ['cmd1'],
|
|
174
|
-
agents: ['agent1']
|
|
178
|
+
agents: ['agent1'],
|
|
179
|
+
rules: []
|
|
175
180
|
}
|
|
176
181
|
});
|
|
177
182
|
});
|
|
@@ -184,7 +189,8 @@ describe('buildSelectionFromPaths', () => {
|
|
|
184
189
|
'my-skills': {
|
|
185
190
|
skills: ['*'],
|
|
186
191
|
commands: ['*'],
|
|
187
|
-
agents: ['*']
|
|
192
|
+
agents: ['*'],
|
|
193
|
+
rules: ['*']
|
|
188
194
|
}
|
|
189
195
|
});
|
|
190
196
|
});
|
|
@@ -201,12 +207,14 @@ describe('buildSelectionFromPaths', () => {
|
|
|
201
207
|
'source-a': {
|
|
202
208
|
skills: ['*'],
|
|
203
209
|
commands: ['*'],
|
|
204
|
-
agents: ['*']
|
|
210
|
+
agents: ['*'],
|
|
211
|
+
rules: ['*']
|
|
205
212
|
},
|
|
206
213
|
'source-b': {
|
|
207
214
|
skills: ['skill1'],
|
|
208
215
|
commands: ['cmd1'],
|
|
209
|
-
agents: []
|
|
216
|
+
agents: [],
|
|
217
|
+
rules: []
|
|
210
218
|
}
|
|
211
219
|
});
|
|
212
220
|
});
|
|
@@ -228,7 +236,8 @@ describe('buildSelectionFromPaths', () => {
|
|
|
228
236
|
'my-skills': {
|
|
229
237
|
skills: ['a', 'b'],
|
|
230
238
|
commands: [],
|
|
231
|
-
agents: []
|
|
239
|
+
agents: [],
|
|
240
|
+
rules: []
|
|
232
241
|
}
|
|
233
242
|
});
|
|
234
243
|
});
|