@hasna/prompts 0.3.17 → 0.3.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"qol.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/qol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwX1D"}
1
+ {"version":3,"file":"qol.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/qol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsX1D"}
package/dist/cli/index.js CHANGED
@@ -13653,7 +13653,7 @@ function registerQolCommands(program2) {
13653
13653
  handleError(program2, e);
13654
13654
  }
13655
13655
  });
13656
- program2.command("tag <id> [ops...]").description("Patch tags: +foo adds, -bar removes. Or --set foo,bar replaces all tags.").option("--set <tags>", "Replace all tags (comma-separated)").action((id, ops, opts) => {
13656
+ program2.command("tag <id>").description("Patch tags on a prompt. Use --add/--remove, or --set to replace all.").option("-a, --add <tags>", "Comma-separated tags to add").option("-r, --remove <tags>", "Comma-separated tags to remove").option("--set <tags>", "Replace all tags (comma-separated)").action((id, opts) => {
13657
13657
  try {
13658
13658
  const prompt = getPrompt(id);
13659
13659
  if (!prompt)
@@ -13664,19 +13664,16 @@ function registerQolCommands(program2) {
13664
13664
  tags = opts.set.split(",").map((t) => t.trim()).filter(Boolean);
13665
13665
  } else {
13666
13666
  tags = [...p.tags];
13667
- for (const op of ops) {
13668
- if (op.startsWith("+")) {
13669
- const tag = op.slice(1);
13670
- if (!tags.includes(tag))
13671
- tags.push(tag);
13672
- } else if (op.startsWith("-")) {
13673
- const tag = op.slice(1);
13674
- tags = tags.filter((t) => t !== tag);
13675
- } else {
13676
- if (!tags.includes(op))
13677
- tags.push(op);
13667
+ if (opts.add) {
13668
+ for (const t of opts.add.split(",").map((x) => x.trim()).filter(Boolean)) {
13669
+ if (!tags.includes(t))
13670
+ tags.push(t);
13678
13671
  }
13679
13672
  }
13673
+ if (opts.remove) {
13674
+ const toRemove = opts.remove.split(",").map((x) => x.trim());
13675
+ tags = tags.filter((t) => !toRemove.includes(t));
13676
+ }
13680
13677
  }
13681
13678
  updatePrompt(p.id, { tags });
13682
13679
  if (isJson(program2))
@@ -13869,7 +13866,7 @@ function registerQolCommands(program2) {
13869
13866
  handleError(program2, e);
13870
13867
  }
13871
13868
  });
13872
- program2.command("bulk-tag [ops...] [ids...]").description("Patch tags on multiple prompts. Leading ops start with + or -, rest are IDs. Or pipe IDs via stdin.").helpOption("-h, --help").addHelpText("after", `
13869
+ program2.command("bulk-tag [args...]").description("Patch tags on multiple prompts. Args starting with +/- are tag ops; rest are IDs. Pipe IDs via stdin too.").addHelpText("after", `
13873
13870
  Examples:
13874
13871
  prompts bulk-tag +foo -bar PRMT-00001 PRMT-00002
13875
13872
  echo "PRMT-00001" | prompts bulk-tag +reviewed`).action(async (args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/prompts",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "description": "Reusable prompt library for AI agents — CLI + MCP server + REST API + web dashboard",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",