@letterstory/cli 0.177.75 → 0.177.77

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/lib/cli.mjs CHANGED
@@ -90,7 +90,7 @@ import {
90
90
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
91
91
 
92
92
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
93
- export const VERSION = "0.177.75";
93
+ export const VERSION = "0.177.77";
94
94
 
95
95
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
96
96
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -2128,6 +2128,7 @@ Usage data (what signed-in people do in your own app):
2128
2128
  usage proofs [--id <id>] Read saved proof analysis
2129
2129
  usage find-proofs --since <ISO> --until <ISO> [--focus <text>] Analyze actions
2130
2130
  usage review-proof --analysis-id <id> --card-id <id> --decision approved|dismissed
2131
+ usage instrument --action <words> [--event <name>] [--owner <o> --repo <r>] PR that records an action
2131
2132
  usage discover-actions --since <ISO> --until <ISO> Event inventory from connected PostHog
2132
2133
  usage evaluate-action --since <ISO> --until <ISO> --definition <file.json>
2133
2134
  usage [--days 7|30|90] [--site <id>] [--limit <n>] People, companies and the features they use
@@ -200,7 +200,8 @@ const ARGS = {
200
200
  },
201
201
  get_repo_change_settings: {},
202
202
  list_suggested_fixes: {},
203
- list_slack_fix_targets: {},
203
+ // --query gtm: only the channels named like it (a big workspace's whole list is long).
204
+ list_slack_fix_targets: { query: "query" },
204
205
  send_slack_test_message: {},
205
206
  set_repo_change_settings: {
206
207
  default_action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
@@ -1006,8 +1007,8 @@ async function repoSuggestions(ctx) {
1006
1007
  /** `repo slack-targets`: the channels and people Send to Slack can use, with their ids. */
1007
1008
  async function repoSlackTargets(ctx) {
1008
1009
  const { client, flags, io } = ctx;
1009
- refuseUnknownFlags(ctx, {}, []);
1010
- const result = await client.callTool("list_slack_fix_targets", {});
1010
+ refuseUnknownFlags(ctx, ARGS.list_slack_fix_targets, []);
1011
+ const result = await client.callTool("list_slack_fix_targets", argsFromFlags(ARGS.list_slack_fix_targets, flags));
1011
1012
  printResult(io, flags, result, (r) =>
1012
1013
  [
1013
1014
  "Channels (repo settings --slack-channel <id>):",
@@ -44,6 +44,15 @@ export const ARGS = {
44
44
  card_id: { flag: "card-id" },
45
45
  decision: { flag: "decision" },
46
46
  },
47
+ instrument_proof_action: {
48
+ action: { flag: "action" },
49
+ event: { flag: "event" },
50
+ repo_owner: { flag: "owner" },
51
+ repo_name: { flag: "repo" },
52
+ provider: { flag: "provider" },
53
+ base_branch: { flag: "base" },
54
+ mode: { flag: "mode" },
55
+ },
47
56
  discover_action_events: { window: { value: (flags) => ({ since: flags.since, until: flags.until }) } },
48
57
  evaluate_action: {
49
58
  window: { value: (flags) => ({ since: flags.since, until: flags.until }) },
@@ -237,6 +246,16 @@ export async function cmdUsage(ctx) {
237
246
  printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
238
247
  return 0;
239
248
  }
249
+ if (ctx.positionals[0] === "instrument") {
250
+ if (!flags.action)
251
+ throw new CliError('Use --action with what the product should record ("a report is delivered").');
252
+ printResult(
253
+ io,
254
+ flags,
255
+ await client.callTool("instrument_proof_action", argsFromFlags(ARGS.instrument_proof_action, flags, []))
256
+ );
257
+ return 0;
258
+ }
240
259
  if (["discover-actions", "evaluate-action"].includes(ctx.positionals[0])) {
241
260
  const tool = ctx.positionals[0] === "discover-actions" ? "discover_action_events" : "evaluate_action";
242
261
  if (!flags.since || !flags.until) throw new CliError("Use --since and --until with ISO timestamps.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.75",
3
+ "version": "0.177.77",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",