@staff0rd/assist 0.659.0 → 0.660.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/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.659.0",
9
+ version: "0.660.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -562,6 +562,21 @@ function stripLegacyConfigKeys(config) {
562
562
  import { z as z3 } from "zod";
563
563
 
564
564
  // src/shared/adviceFragmentNames.ts
565
+ var adviceFragmentTitles = {
566
+ "assist-global": "Using assist",
567
+ "backlog-ids": "Backlog item IDs",
568
+ "backlog-prs": "Backlog items, PRs, and commits",
569
+ "code-comments": "Commenting code",
570
+ "drafting-messages": "Drafting messages to send on the user's behalf",
571
+ "editing-files": "Editing files",
572
+ "filename-convention": "Naming files after their export",
573
+ "jira-context": "Fetching Jira context",
574
+ "jira-smart-links": "Editing Jira issues with Smart Links",
575
+ markdown: "Writing markdown",
576
+ refactor: "Renaming and extracting TypeScript",
577
+ "settings-json": "Editing claude/settings.json",
578
+ verify: "Verifying a change"
579
+ };
565
580
  var adviceFragmentNames = [
566
581
  "assist-global",
567
582
  "backlog-ids",
@@ -2101,10 +2116,10 @@ function reportVerifyProblems(problems, success) {
2101
2116
  }
2102
2117
 
2103
2118
  // src/commands/verify/adviceFragments.ts
2119
+ var titles = adviceFragmentTitles;
2104
2120
  function adviceFragments() {
2105
- const shipped = new Set(
2106
- loadAdviceFragments().map((fragment) => fragment.name)
2107
- );
2121
+ const fragments = loadAdviceFragments();
2122
+ const shipped = new Set(fragments.map((fragment) => fragment.name));
2108
2123
  const declared = new Set(adviceFragmentNames);
2109
2124
  reportVerifyProblems(
2110
2125
  [
@@ -2115,9 +2130,15 @@ function adviceFragments() {
2115
2130
  verifySection(
2116
2131
  "Listed in adviceFragmentNames but no longer shipped in claude/advice (remove them)",
2117
2132
  [...declared].filter((name) => !shipped.has(name))
2133
+ ),
2134
+ verifySection(
2135
+ "adviceFragmentTitles disagrees with the fragment's own title (the config picker shows these, so they must match)",
2136
+ fragments.filter((fragment) => titles[fragment.name] !== fragment.title).map(
2137
+ (fragment) => `${fragment.name}: "${titles[fragment.name] ?? ""}" should be "${fragment.title}"`
2138
+ )
2118
2139
  )
2119
2140
  ],
2120
- `All ${shipped.size} advice fragments are named in adviceFragmentNames.`
2141
+ `All ${shipped.size} advice fragments are named and titled in adviceFragmentNames.`
2121
2142
  );
2122
2143
  }
2123
2144
 
@@ -2842,6 +2863,33 @@ function configHelp(command, entries, preamble) {
2842
2863
  );
2843
2864
  }
2844
2865
 
2866
+ // src/shared/configEnumDescriptions.ts
2867
+ var byKey = {
2868
+ "advice.include": adviceFragmentTitles,
2869
+ "advice.exclude": adviceFragmentTitles
2870
+ };
2871
+ function configEnumDescriptions(key) {
2872
+ return byKey[key];
2873
+ }
2874
+
2875
+ // src/shared/formatConfigPath.ts
2876
+ var RECORD_ENTRY_TOKEN = "*";
2877
+ function segmentText(segment) {
2878
+ if (segment.kind === "key") return segment.name;
2879
+ if (segment.kind === "entry") return RECORD_ENTRY_TOKEN;
2880
+ if (segment.kind === "index") return `[${segment.index}]`;
2881
+ return "[]";
2882
+ }
2883
+ function formatConfigPath(path91) {
2884
+ let text18 = "";
2885
+ for (const segment of path91) {
2886
+ const dotted = segment.kind === "key" || segment.kind === "entry";
2887
+ const rendered = segmentText(segment);
2888
+ text18 += dotted && text18 ? `.${rendered}` : rendered;
2889
+ }
2890
+ return text18;
2891
+ }
2892
+
2845
2893
  // src/shared/unwrapSchemaNode.ts
2846
2894
  var WRAPPER_TYPES = /* @__PURE__ */ new Set([
2847
2895
  "optional",
@@ -2911,7 +2959,9 @@ function scalarArrayItemType(node) {
2911
2959
  function scalarListNode(inner, base, item) {
2912
2960
  const itemType = scalarArrayItemType(inner);
2913
2961
  if (!itemType || item.kind !== "scalar") return void 0;
2914
- return { ...base, kind: "scalarList", itemType, item };
2962
+ const descriptions = configEnumDescriptions(formatConfigPath(base.path));
2963
+ const described = descriptions && item.enumValues ? { ...item, enumDescriptions: descriptions } : item;
2964
+ return { ...base, kind: "scalarList", itemType, item: described };
2915
2965
  }
2916
2966
  function objectListNode(base, item) {
2917
2967
  if (item.kind !== "object" && item.kind !== "unionOfObjects")
@@ -2995,24 +3045,6 @@ function describeConfigNode(schema2) {
2995
3045
  return build(schema2, []);
2996
3046
  }
2997
3047
 
2998
- // src/shared/formatConfigPath.ts
2999
- var RECORD_ENTRY_TOKEN = "*";
3000
- function segmentText(segment) {
3001
- if (segment.kind === "key") return segment.name;
3002
- if (segment.kind === "entry") return RECORD_ENTRY_TOKEN;
3003
- if (segment.kind === "index") return `[${segment.index}]`;
3004
- return "[]";
3005
- }
3006
- function formatConfigPath(path91) {
3007
- let text18 = "";
3008
- for (const segment of path91) {
3009
- const dotted = segment.kind === "key" || segment.kind === "entry";
3010
- const rendered = segmentText(segment);
3011
- text18 += dotted && text18 ? `.${rendered}` : rendered;
3012
- }
3013
- return text18;
3014
- }
3015
-
3016
3048
  // src/shared/describeConfigLeaves.ts
3017
3049
  function leafType(node) {
3018
3050
  switch (node.kind) {
@@ -5133,7 +5165,9 @@ function renderLineChart({
5133
5165
  seriesTitle,
5134
5166
  labels,
5135
5167
  values,
5136
- wholeNumbersOnly = false
5168
+ wholeNumbersOnly = false,
5169
+ minY,
5170
+ maxY
5137
5171
  }) {
5138
5172
  const input = keyboardInput();
5139
5173
  const screen = blessed.screen({
@@ -5148,7 +5182,9 @@ function renderLineChart({
5148
5182
  legend: { width: Math.max(12, seriesTitle.length + 2) },
5149
5183
  xLabelPadding: 3,
5150
5184
  xPadding: 5,
5151
- wholeNumbersOnly
5185
+ wholeNumbersOnly,
5186
+ minY,
5187
+ maxY
5152
5188
  });
5153
5189
  line.setData([
5154
5190
  {
@@ -5373,8 +5409,11 @@ function explainAdvice(context, fragments = loadAdviceFragments()) {
5373
5409
  const width = Math.max(
5374
5410
  ...decisions.map((decision) => decision.fragment.name.length)
5375
5411
  );
5412
+ const titleWidth = Math.max(
5413
+ ...decisions.map((decision) => decision.fragment.title.length)
5414
+ );
5376
5415
  return decisions.map(
5377
- ({ fragment, included, reason: reason4 }) => `${included ? chalk28.green("\u2713") : chalk28.dim("\u2717")} ${fragment.name.padEnd(width)} ${reason4}`
5416
+ ({ fragment, included, reason: reason4 }) => `${included ? chalk28.green("\u2713") : chalk28.dim("\u2717")} ${fragment.name.padEnd(width)} ${chalk28.dim(fragment.title.padEnd(titleWidth))} ${reason4}`
5378
5417
  ).join("\n");
5379
5418
  }
5380
5419
 
@@ -6410,6 +6449,19 @@ function registerBackup(program2) {
6410
6449
  configHelp(backupCommand, backupConfigHelp);
6411
6450
  }
6412
6451
 
6452
+ // src/commands/chart/chartYRange.ts
6453
+ var toCentsWithoutFloatError = (value) => Number((value * 100).toFixed(6));
6454
+ function chartYRange(values) {
6455
+ const min = Math.min(...values);
6456
+ const max = Math.max(...values);
6457
+ const span = max - min;
6458
+ const pad2 = span === 0 ? Math.max(Math.abs(max) * 0.1, 1) : span * 0.2;
6459
+ return {
6460
+ minY: Math.floor(toCentsWithoutFloatError(min - pad2)) / 100,
6461
+ maxY: Math.ceil(toCentsWithoutFloatError(max + pad2)) / 100
6462
+ };
6463
+ }
6464
+
6413
6465
  // src/commands/chart/parseChartSeries.ts
6414
6466
  function parseChartSeries(lines2) {
6415
6467
  const points = [];
@@ -6460,12 +6512,14 @@ async function chart(options2) {
6460
6512
  return;
6461
6513
  }
6462
6514
  const title = options2.title ?? "Chart";
6515
+ const values = points.map((p) => p.value);
6463
6516
  renderLineChart({
6464
6517
  title,
6465
6518
  label: title,
6466
6519
  seriesTitle: title,
6467
6520
  labels: points.map((p) => p.label),
6468
- values: points.map((p) => p.value)
6521
+ values,
6522
+ ...chartYRange(values)
6469
6523
  });
6470
6524
  }
6471
6525
 
@@ -11505,10 +11559,10 @@ function configEntryNode(root, key) {
11505
11559
  }
11506
11560
 
11507
11561
  // src/commands/config/configHelpForKey.ts
11508
- var byKey;
11562
+ var byKey2;
11509
11563
  function configHelpForKey(key) {
11510
- byKey ??= new Map(configHelpEntries.map((entry) => [entry.key, entry]));
11511
- return byKey.get(key);
11564
+ byKey2 ??= new Map(configHelpEntries.map((entry) => [entry.key, entry]));
11565
+ return byKey2.get(key);
11512
11566
  }
11513
11567
 
11514
11568
  // src/commands/config/isGlobalOnlyConfigKey.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.659.0",
3
+ "version": "0.660.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {