@kolatts/pncli 5.2.0 → 5.3.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.
package/dist/cli.js CHANGED
@@ -587,30 +587,30 @@ var BitbucketClient = class {
587
587
  );
588
588
  }
589
589
  async createPR(opts) {
590
- return this.http.bitbucket(
591
- `${API}/projects/${opts.project}/repos/${opts.repo}/pull-requests`,
592
- {
593
- method: "POST",
594
- body: {
595
- title: opts.title,
596
- description: opts.description,
597
- fromRef: {
598
- id: `refs/heads/${opts.source}`,
599
- repository: {
600
- slug: opts.repo,
601
- project: { key: opts.project }
602
- }
603
- },
604
- toRef: {
605
- id: `refs/heads/${opts.target}`,
606
- repository: {
607
- slug: opts.repo,
608
- project: { key: opts.project }
609
- }
610
- },
611
- reviewers: (opts.reviewers ?? []).map((name) => ({ user: { name } }))
590
+ const body = {
591
+ title: opts.title,
592
+ description: opts.description,
593
+ fromRef: {
594
+ id: `refs/heads/${opts.source}`,
595
+ repository: {
596
+ slug: opts.repo,
597
+ project: { key: opts.project }
598
+ }
599
+ },
600
+ toRef: {
601
+ id: `refs/heads/${opts.target}`,
602
+ repository: {
603
+ slug: opts.repo,
604
+ project: { key: opts.project }
612
605
  }
613
606
  }
607
+ };
608
+ if (opts.reviewers && opts.reviewers.length > 0) {
609
+ body.reviewers = opts.reviewers.map((name) => ({ user: { name } }));
610
+ }
611
+ return this.http.bitbucket(
612
+ `${API}/projects/${opts.project}/repos/${opts.repo}/pull-requests`,
613
+ { method: "POST", body }
614
614
  );
615
615
  }
616
616
  async updatePR(opts) {
@@ -1861,7 +1861,7 @@ function registerBitbucketCommands(program2) {
1861
1861
  const { client, project, repo } = getClient2(bb, { project: opts.project, repo: opts.repo });
1862
1862
  const config = loadConfig({ configPath: bb.optsWithGlobals().config });
1863
1863
  const target = opts.target ?? config.defaults.bitbucket?.targetBranch ?? "main";
1864
- const reviewers = opts.reviewers ? opts.reviewers.split(",").map((s) => s.trim()) : [];
1864
+ const reviewers = opts.reviewers ? opts.reviewers.split(",").map((s) => s.trim()) : void 0;
1865
1865
  const data = await client.createPR({ project, repo, title: opts.title, source: opts.source, target, description: opts.description, reviewers });
1866
1866
  success(data, "bitbucket", "create-pr", start);
1867
1867
  } catch (err) {
@@ -1885,7 +1885,7 @@ function registerBitbucketCommands(program2) {
1885
1885
  throw new PncliError("--repos must contain at least one repository slug", 1);
1886
1886
  }
1887
1887
  const title = opts.title ?? `Promote ${opts.from} to ${opts.to}`;
1888
- const reviewers = opts.reviewers ? opts.reviewers.split(",").map((s) => s.trim()) : [];
1888
+ const reviewers = opts.reviewers ? opts.reviewers.split(",").map((s) => s.trim()) : void 0;
1889
1889
  const results = [];
1890
1890
  let created = 0;
1891
1891
  let nothingToPromote = 0;
@@ -7404,6 +7404,9 @@ function installAllPlugins(m, resolvedPath, targets) {
7404
7404
  }
7405
7405
  return targets.map((t) => installMarketplaceToTarget(m, resolvedPath, pluginChoices, "all", t, { updated: true, force: true, installedOnly: false }));
7406
7406
  }
7407
+ function isBareMarketplaceSync(plugin, opts) {
7408
+ return plugin === void 0 && !opts.marketplace && !opts.force;
7409
+ }
7407
7410
  function syncMarketplacePlugins(m, targets, pluginFilter, opts) {
7408
7411
  const marketplaceName = marketplaceLabel(m);
7409
7412
  try {
@@ -7861,7 +7864,7 @@ Plugin skills always install at user scope. --agent picks the host (default: ${D
7861
7864
  fail(err, "skills", "marketplace-remove", start);
7862
7865
  }
7863
7866
  });
7864
- marketplace.command("sync").description("Pull latest marketplace content and install plugin skills (interactive picker when no plugin is given)").argument("[plugin]", 'Plugin name to install, or "all" to install every plugin (skips interactive selection)').option("--marketplace <name>", 'Marketplace name to sync, or "all" to sync every registered marketplace (skips interactive selection)').option("--agent <agent>", `Target agent host: ${AGENT_CHOICES} (default: ${DEFAULT_AGENT})`).option("--claude", "Shorthand for --agent claude-code").option("--all-agents", "Install to every supported agent host in one run").option("--force", 'Reinstall even if a marketplace has no new changes (applies to single-plugin and "all" installs alike)').option("--installed-only", "Only sync plugins that are already installed \u2014 skip plugins newly added to the marketplace").option("--no-instructions", "Do not apply the shipped AGENTS.md / CLAUDE.md to user-level instructions files").action(async (plugin, opts) => {
7867
+ marketplace.command("sync").description("With no arguments, refreshes every already-installed plugin from every marketplace (same as --marketplace all --installed-only). Pass --force, a plugin, or --marketplace to get the interactive picker instead.").argument("[plugin]", 'Plugin name to install, or "all" to install every plugin (skips interactive selection)').option("--marketplace <name>", 'Marketplace name to sync, or "all" to sync every registered marketplace (skips interactive selection)').option("--agent <agent>", `Target agent host: ${AGENT_CHOICES} (default: ${DEFAULT_AGENT})`).option("--claude", "Shorthand for --agent claude-code").option("--all-agents", "Install to every supported agent host in one run").option("--force", 'Reinstall even if a marketplace has no new changes (applies to single-plugin and "all" installs alike)').option("--installed-only", "Only sync plugins that are already installed \u2014 skip plugins newly added to the marketplace").option("--no-instructions", "Do not apply the shipped AGENTS.md / CLAUDE.md to user-level instructions files").action(async (plugin, opts) => {
7865
7868
  const start = Date.now();
7866
7869
  try {
7867
7870
  const configPath = getGlobalConfigPath();
@@ -7869,10 +7872,11 @@ Plugin skills always install at user scope. --agent picks the host (default: ${D
7869
7872
  if (allMarketplaces.length === 0) {
7870
7873
  throw new Error("No marketplaces configured. Run: pncli skills marketplace add <url>");
7871
7874
  }
7875
+ const bareSync = isBareMarketplaceSync(plugin, opts);
7872
7876
  const targets = resolveInstallTargets(opts);
7873
- const syncOpts = { force: opts.force ?? false, installedOnly: opts.installedOnly ?? false, instructions: opts.instructions !== false };
7877
+ const syncOpts = { force: opts.force ?? false, installedOnly: bareSync ? true : opts.installedOnly ?? false, instructions: opts.instructions !== false };
7874
7878
  const targetSummary = targets.length === 1 ? { target: targets[0].target } : { targets: targets.map((t) => t.target) };
7875
- if (opts.marketplace === "all") {
7879
+ if (opts.marketplace === "all" || bareSync) {
7876
7880
  const results = allMarketplaces.map((m) => syncMarketplacePlugins(m, targets, plugin ?? "all", syncOpts));
7877
7881
  success({ allMarketplaces: true, marketplaces: results, ...targetSummary }, "skills", "marketplace-sync", start);
7878
7882
  return;
@@ -12482,7 +12486,7 @@ function registerSplitioCommands(program2) {
12482
12486
  try {
12483
12487
  const http = getHttp4(program2);
12484
12488
  const data = await http.splitio(
12485
- `/internal/api/v2/workspaces/${encodeURIComponent(opts.workspace)}/environments`
12489
+ `/internal/api/v2/environments/ws/${encodeURIComponent(opts.workspace)}`
12486
12490
  );
12487
12491
  success(
12488
12492
  { count: data.objects.length, environments: data.objects },
@@ -12500,12 +12504,14 @@ function registerSplitioCommands(program2) {
12500
12504
  try {
12501
12505
  const http = getHttp4(program2);
12502
12506
  const params = {
12503
- wsId: opts.workspace,
12504
12507
  limit: parseInt(opts.limit, 10),
12505
12508
  offset: parseInt(opts.offset, 10)
12506
12509
  };
12507
12510
  if (opts.flagSet) params["flagSetName"] = opts.flagSet;
12508
- const data = await http.splitio("/internal/api/v2/splits", { params });
12511
+ const data = await http.splitio(
12512
+ `/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}`,
12513
+ { params }
12514
+ );
12509
12515
  success(
12510
12516
  { count: data.objects.length, totalCount: data.totalCount, flags: data.objects },
12511
12517
  "splitio",
@@ -12522,14 +12528,12 @@ function registerSplitioCommands(program2) {
12522
12528
  const http = getHttp4(program2);
12523
12529
  if (opts.environment) {
12524
12530
  const data = await http.splitio(
12525
- `/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
12526
- { params: { wsId: opts.workspace } }
12531
+ `/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
12527
12532
  );
12528
12533
  success(data, "splitio", "flags get", start);
12529
12534
  } else {
12530
12535
  const data = await http.splitio(
12531
- `/internal/api/v2/splits/${encodeURIComponent(opts.flag)}`,
12532
- { params: { wsId: opts.workspace } }
12536
+ `/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}`
12533
12537
  );
12534
12538
  success(data, "splitio", "flags get", start);
12535
12539
  }
@@ -12554,7 +12558,7 @@ function registerSplitioCommands(program2) {
12554
12558
  },
12555
12559
  workspace: { id: opts.workspace }
12556
12560
  };
12557
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12561
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12558
12562
  method: "POST",
12559
12563
  body
12560
12564
  });
@@ -12571,8 +12575,7 @@ function registerSplitioCommands(program2) {
12571
12575
  }
12572
12576
  const http = getHttp4(program2);
12573
12577
  const current = await http.splitio(
12574
- `/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
12575
- { params: { wsId: opts.workspace } }
12578
+ `/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
12576
12579
  );
12577
12580
  const rules = current.rules ?? [];
12578
12581
  const idx = parseInt(opts.ruleIndex, 10);
@@ -12596,7 +12599,7 @@ function registerSplitioCommands(program2) {
12596
12599
  },
12597
12600
  workspace: { id: opts.workspace }
12598
12601
  };
12599
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12602
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12600
12603
  method: "POST",
12601
12604
  body
12602
12605
  });
@@ -12610,8 +12613,7 @@ function registerSplitioCommands(program2) {
12610
12613
  try {
12611
12614
  const http = getHttp4(program2);
12612
12615
  const current = await http.splitio(
12613
- `/internal/api/v2/splits/${encodeURIComponent(opts.flag)}/environments/${encodeURIComponent(opts.environment)}`,
12614
- { params: { wsId: opts.workspace } }
12616
+ `/internal/api/v2/splits/ws/${encodeURIComponent(opts.workspace)}/name/${encodeURIComponent(opts.flag)}/environment/${encodeURIComponent(opts.environment)}`
12615
12617
  );
12616
12618
  await confirmWrite(opts, `SET_DEFAULT ${opts.treatment} on ${opts.flag} in ${opts.environment}`);
12617
12619
  const body = {
@@ -12627,7 +12629,7 @@ function registerSplitioCommands(program2) {
12627
12629
  },
12628
12630
  workspace: { id: opts.workspace }
12629
12631
  };
12630
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12632
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12631
12633
  method: "POST",
12632
12634
  body
12633
12635
  });
@@ -12649,7 +12651,7 @@ function registerSplitioCommands(program2) {
12649
12651
  split: { name: opts.flag, environment: { id: opts.environment } },
12650
12652
  workspace: { id: opts.workspace }
12651
12653
  };
12652
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12654
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12653
12655
  method: "POST",
12654
12656
  body
12655
12657
  });
@@ -12677,7 +12679,7 @@ function registerSplitioCommands(program2) {
12677
12679
  split: { name: entry.flag, environment: { id: opts.environment } },
12678
12680
  workspace: { id: opts.workspace }
12679
12681
  };
12680
- const cr = await http.splitio("/internal/api/v2/changeRequests", {
12682
+ const cr = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12681
12683
  method: "POST",
12682
12684
  body
12683
12685
  });
@@ -12706,7 +12708,7 @@ function registerSplitioCommands(program2) {
12706
12708
  split: { name: opts.flag, environment: { id: opts.environment } },
12707
12709
  workspace: { id: opts.workspace }
12708
12710
  };
12709
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12711
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12710
12712
  method: "POST",
12711
12713
  body
12712
12714
  });
@@ -12726,7 +12728,7 @@ function registerSplitioCommands(program2) {
12726
12728
  split: { name: opts.flag, environment: { id: opts.environment } },
12727
12729
  workspace: { id: opts.workspace }
12728
12730
  };
12729
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12731
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12730
12732
  method: "POST",
12731
12733
  body
12732
12734
  });
@@ -12746,7 +12748,7 @@ function registerSplitioCommands(program2) {
12746
12748
  split: { name: opts.flag },
12747
12749
  workspace: { id: opts.workspace }
12748
12750
  };
12749
- const data = await http.splitio("/internal/api/v2/changeRequests", {
12751
+ const data = await http.splitio(`/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`, {
12750
12752
  method: "POST",
12751
12753
  body
12752
12754
  });
@@ -12761,14 +12763,13 @@ function registerSplitioCommands(program2) {
12761
12763
  try {
12762
12764
  const http = getHttp4(program2);
12763
12765
  const params = {
12764
- wsId: opts.workspace,
12765
12766
  limit: parseInt(opts.limit, 10),
12766
12767
  offset: parseInt(opts.offset, 10)
12767
12768
  };
12768
12769
  if (opts.environment) params["environmentId"] = opts.environment;
12769
12770
  if (opts.status) params["status"] = opts.status;
12770
12771
  const data = await http.splitio(
12771
- "/internal/api/v2/changeRequests",
12772
+ `/internal/api/v2/changeRequests/ws/${encodeURIComponent(opts.workspace)}`,
12772
12773
  { params }
12773
12774
  );
12774
12775
  success(
@@ -13445,7 +13446,7 @@ Services:
13445
13446
  Agent skills and org plugins:
13446
13447
  pncli skills install --all-agents Bundled pncli skills into this repo, every agent host
13447
13448
  pncli skills marketplace add <git-url> --all-agents Org plugins (skills + AGENTS.md/CLAUDE.md) from a git marketplace
13448
- pncli skills marketplace sync --marketplace all Pull and refresh everything installed from marketplaces
13449
+ pncli skills marketplace sync Pull and refresh everything installed from marketplaces
13449
13450
  pncli skills marketplace manage Interactive: toggle plugins, add/remove marketplaces
13450
13451
  pncli skills --help Every install location and command
13451
13452
  `);