plugins 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/dist/index.js +42 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -700,7 +700,41 @@ function deriveMarketplaceName(source) {
700
700
  return parts[parts.length - 1] ?? "plugins";
701
701
  }
702
702
 
703
+ // lib/telemetry.ts
704
+ var TELEMETRY_URL = "https://plugins-telemetry.labs.vercel.dev/t";
705
+ var cliVersion = null;
706
+ function isCI() {
707
+ return !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.CIRCLECI || process.env.TRAVIS || process.env.BUILDKITE || process.env.JENKINS_URL || process.env.TEAMCITY_VERSION);
708
+ }
709
+ function isEnabled() {
710
+ return !process.env.DISABLE_TELEMETRY && !process.env.DO_NOT_TRACK;
711
+ }
712
+ function setVersion(version) {
713
+ cliVersion = version;
714
+ }
715
+ function track(data) {
716
+ if (!isEnabled()) return;
717
+ try {
718
+ const params = new URLSearchParams();
719
+ if (cliVersion) {
720
+ params.set("v", cliVersion);
721
+ }
722
+ if (isCI()) {
723
+ params.set("ci", "1");
724
+ }
725
+ for (const [key, value] of Object.entries(data)) {
726
+ if (value !== void 0 && value !== null) {
727
+ params.set(key, String(value));
728
+ }
729
+ }
730
+ fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {
731
+ });
732
+ } catch {
733
+ }
734
+ }
735
+
703
736
  // index.ts
737
+ setVersion("1.0.1");
704
738
  var { values, positionals } = parseArgs({
705
739
  args: process.argv.slice(2),
706
740
  options: {
@@ -850,6 +884,14 @@ async function cmdInstall(source, opts) {
850
884
  for (const target of installTargets) {
851
885
  await installPlugins(plugins, target, scope, repoPath, source);
852
886
  }
887
+ track({
888
+ event: "install",
889
+ source,
890
+ plugins: plugins.map((p) => p.name).join(","),
891
+ pluginCount: String(plugins.length),
892
+ targets: installTargets.map((t) => t.id).join(","),
893
+ scope
894
+ });
853
895
  barEmpty();
854
896
  stepDone(c.green("Done.") + " Restart your agent tools to load the plugins.");
855
897
  footer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugins",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Install open-plugin format plugins into agent tools",
5
5
  "type": "module",
6
6
  "bin": {