@deerdesign/deertools 1.2.11 → 1.2.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deerdesign/deertools",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -156,6 +156,67 @@ async function cmdSkillInstall(target, flags, out, err) {
156
156
  };
157
157
  writeLock(lock);
158
158
  out(`✓ Zaktualizowano ${LOCK_FILE} (wersja ${versionData.version}).`);
159
+
160
+ // Podsumowanie możliwości skilla dla użytkownika i Agenta AI
161
+ printSkillSummary(skill, versionData, out);
162
+ }
163
+
164
+ function extractCapabilities(content, summary = '') {
165
+ const text = String(content || '');
166
+ const lines = text.split('\n');
167
+ const bullets = [];
168
+ let inWhen = false;
169
+
170
+ for (let i = 0; i < lines.length; i++) {
171
+ const line = lines[i].trim();
172
+ if (/^##\s+(Kiedy używać|Możliwości|Zastosowanie|Co potrafi)/i.test(line)) {
173
+ inWhen = true;
174
+ continue;
175
+ }
176
+ if (inWhen) {
177
+ if (/^##\s+/.test(line)) break;
178
+ if (line.startsWith('- ') || line.startsWith('* ') || /^\d+\.\s+/.test(line)) {
179
+ const clean = line.replace(/^[-*]\s+|\d+\.\s+/, '').replace(/\.$/, '').trim();
180
+ if (clean.length > 5 && !clean.toLowerCase().startsWith('nie używaj')) {
181
+ bullets.push(clean);
182
+ }
183
+ }
184
+ }
185
+ }
186
+
187
+ const desc = summary || (text.match(/description:\s*["']?([^"'\n]+)/i)?.[1]) || '';
188
+ return { desc, bullets: bullets.slice(0, 4) };
189
+ }
190
+
191
+ function printSkillSummary(skill, versionData, out) {
192
+ const { desc, bullets } = extractCapabilities(versionData.skill_md_content, skill.summary);
193
+ const manifest = versionData.files_manifest || [];
194
+
195
+ out('\n\x1b[36m┌─────────────────────────────────────────────────────────────────────────────┐\x1b[0m');
196
+ out(`\x1b[36m│\x1b[0m \x1b[1m🚀 NOWA UMIEJĘTNOŚĆ AGENTA: ${skill.full_slug || skill.slug} (v${versionData.version})\x1b[0m`);
197
+ out('\x1b[36m├─────────────────────────────────────────────────────────────────────────────┤\x1b[0m');
198
+
199
+ if (desc) {
200
+ const shortDesc = desc.length > 180 ? `${desc.slice(0, 177)}...` : desc;
201
+ out(`\x1b[36m│\x1b[0m \x1b[33mOpis roli:\x1b[0m ${shortDesc}`);
202
+ }
203
+
204
+ if (bullets.length > 0) {
205
+ out(`\x1b[36m│\x1b[0m \x1b[32mCo potrafi ten skill (Kiedy używać):\x1b[0m`);
206
+ for (const b of bullets) {
207
+ out(`\x1b[36m│\x1b[0m • ${b}`);
208
+ }
209
+ }
210
+
211
+ if (manifest.length > 0) {
212
+ const fileList = manifest.map((f) => path.basename(f.path)).slice(0, 5).join(' · ');
213
+ const more = manifest.length > 5 ? ` (+${manifest.length - 5} więcej)` : '';
214
+ out(`\x1b[36m│\x1b[0m \x1b[34mDołączone referencje w paczce (${manifest.length} plików):\x1b[0m ${fileList}${more}`);
215
+ }
216
+
217
+ out('\x1b[36m├─────────────────────────────────────────────────────────────────────────────┤\x1b[0m');
218
+ out('\x1b[36m│\x1b[0m \x1b[90m💡 Informacja dla Agenta AI: Twój asystent może natychmiast korzystać z tych reguł.\x1b[0m');
219
+ out('\x1b[36m└─────────────────────────────────────────────────────────────────────────────┘\x1b[0m\n');
159
220
  }
160
221
 
161
222
  async function cmdSkillPush(dir, flags, out, err) {