skills-atlas-cli 0.15.0 → 0.16.1

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/bin/skills.js CHANGED
@@ -90,7 +90,10 @@ async function main() {
90
90
  if (sub !== 'update' && sub !== 'gap-analyze' && sub !== 'setup' && !process.env.SKILLS_ATLAS_SUBCALL) {
91
91
  try { require('../src/data').maybeBackgroundRefresh(); } catch { /* ignore */ }
92
92
  }
93
- if (sub !== 'telemetry' && !process.env.SKILLS_ATLAS_SUBCALL) telemetry.emit('cli_cmd', { target: sub });
93
+ if (sub !== 'telemetry' && !process.env.SKILLS_ATLAS_SUBCALL) {
94
+ telemetry.emit('cli_cmd', { target: sub });
95
+ try { require('../src/localskills').reportCreated(); } catch { /* ignore */ }
96
+ }
94
97
  try {
95
98
  await cmd(rest);
96
99
  } catch (e) {
@@ -1,20 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- // Detached sender. Reads {endpoint, client, events} from the temp file in argv[2], POSTs once
4
- // with a short timeout, then deletes the file. Fully fail-silent — telemetry must never matter.
3
+ // Detached sender. Reads {endpoint, client, events} from the temp file in argv[2], POSTs once,
4
+ // then deletes the file. Fully fail-silent — telemetry must never matter.
5
+ // In a proxied environment Node's built-in fetch (undici) IGNORES *_PROXY env, so the POST would
6
+ // silently fail; there we fall back to curl, which honors the proxy. Non-proxied → plain fetch.
5
7
  const fs = require('fs');
6
8
  const file = process.argv[2];
7
9
  const cleanup = () => { try { fs.unlinkSync(file); } catch { /* ignore */ } };
8
10
  if (!file) process.exit(0);
9
11
  let p; try { p = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { cleanup(); process.exit(0); }
10
12
  if (!p || !p.endpoint || !Array.isArray(p.events) || !p.events.length) { cleanup(); process.exit(0); }
13
+
14
+ const body = JSON.stringify({ client: p.client, events: p.events });
15
+ const proxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY ||
16
+ process.env.http_proxy || process.env.ALL_PROXY || process.env.all_proxy;
17
+
18
+ if (proxy) {
19
+ // curl picks up *_PROXY from the environment automatically; body via stdin avoids arg limits.
20
+ try {
21
+ require('child_process').spawnSync('curl', [
22
+ '-s', '--max-time', '4', '-X', 'POST', p.endpoint,
23
+ '-H', 'Content-Type: application/json', '--data-binary', '@-',
24
+ ], { input: body, stdio: ['pipe', 'ignore', 'ignore'] });
25
+ } catch { /* curl missing → drop; telemetry must never matter */ }
26
+ cleanup();
27
+ process.exit(0);
28
+ }
29
+
11
30
  try {
12
31
  const ac = new AbortController();
13
32
  const timer = setTimeout(() => ac.abort(), 2000);
14
33
  fetch(p.endpoint, {
15
34
  method: 'POST',
16
35
  headers: { 'Content-Type': 'application/json' },
17
- body: JSON.stringify({ client: p.client, events: p.events }),
36
+ body,
18
37
  signal: ac.signal,
19
38
  }).catch(() => {}).finally(() => { clearTimeout(timer); cleanup(); });
20
39
  } catch { cleanup(); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skills-atlas-cli",
3
- "version": "0.15.0",
3
+ "version": "0.16.1",
4
4
  "description": "Search, install and learn AI agent skills from the terminal — powered by the Skills Atlas catalog.",
5
5
  "bin": {
6
6
  "skills-atlas": "bin/skills.js",
@@ -183,7 +183,9 @@ module.exports = async function suggest() {
183
183
  try {
184
184
  const names = candidates.map(c => c.skill);
185
185
  require('../apstate').recordSuggested(names);
186
- require('../telemetry').emit('ap_suggest', { target: names[0] || '', detail: String(names.length) });
186
+ // Derived signals only NEVER the prompt text: how many matched + a coarse length bucket.
187
+ const plen = Math.min(2000, Math.round(prompt.length / 50) * 50);
188
+ require('../telemetry').emit('ap_suggest', { target: names[0] || '', detail: 'matched=' + names.length + ' plen=' + plen });
187
189
  } catch { /* never break the hook */ }
188
190
  writeState(file, state);
189
191
  } catch {
Binary file