ask-pro 0.1.51 → 0.1.53

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/README.md CHANGED
@@ -71,7 +71,8 @@ Ask for a recoverable repo consult:
71
71
  ask-pro --no-temporary --prompt-file question.md --files src --files tests
72
72
  ```
73
73
 
74
- ask-pro selects `Latest` with `Pro` intelligence. It has no repo or conversation
74
+ ask-pro selects `Latest` when available, otherwise the highest numbered available
75
+ GPT model, with `Pro` intelligence. It has no repo or conversation
75
76
  context unless you provide it, so keep the prompt and file bundle focused.
76
77
 
77
78
  Request generated files only when needed; treat them as data and never execute
@@ -269,7 +269,7 @@ function buildModelSelectionExpression(targetModel, strategy) {
269
269
  return { status: 'already-selected', label };
270
270
  }
271
271
  const buttonMatchesTarget = () => {
272
- // The numbered pill cannot prove that the rolling Latest option is selected.
272
+ // The composer pill cannot prove that the newest available model is selected.
273
273
  if (normalizedTarget === 'latest') return false;
274
274
  const normalizedLabel = normalize(getButtonLabel());
275
275
  if (!normalizedLabel) return false;
@@ -446,14 +446,24 @@ function buildModelSelectionExpression(targetModel, strategy) {
446
446
  testid.toLowerCase().includes('submenu') ||
447
447
  option.getAttribute('data-has-submenu') !== null ||
448
448
  option.getAttribute('aria-haspopup') === 'menu';
449
- const baseScore = scoreOption(normalizedText, testid);
449
+ if (normalizedTarget === 'latest') {
450
+ const rect = option.getBoundingClientRect();
451
+ if (isSubmenu || rect.width <= 0 || rect.height <= 0 ||
452
+ option.getAttribute('aria-disabled') === 'true' || option.hasAttribute('disabled')) continue;
453
+ }
454
+ // Read the raw label: normalization removes decimal separators.
455
+ const modelVersion = normalizedTarget === 'latest'
456
+ ? text.trim().match(/^gpt[-\\s]+(\\d+(?:\\.\\d+)*)(?![.\\d])/i)?.[1] ?? ''
457
+ : '';
458
+ const baseScore = modelVersion ? 500 : scoreOption(normalizedText, testid);
450
459
  if (baseScore <= 0) {
451
460
  continue;
452
461
  }
453
462
  const score = baseScore + (isSubmenu ? 0 : 1);
454
463
  const label = getOptionLabel(option);
455
- if (!bestMatch || score > bestMatch.score) {
456
- bestMatch = { node: option, label, score, testid, normalizedText, isSubmenu };
464
+ if (!bestMatch || score > bestMatch.score ||
465
+ (score === bestMatch.score && modelVersion.localeCompare(bestMatch.modelVersion, 'en', { numeric: true }) > 0)) {
466
+ bestMatch = { node: option, label, score, testid, normalizedText, isSubmenu, modelVersion };
457
467
  }
458
468
  }
459
469
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ask-pro",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "Browser-backed ChatGPT Pro escalation for hard engineering questions.",
5
5
  "keywords": [
6
6
  "agents",
@@ -58,7 +58,8 @@ When invoked:
58
58
  `harvest` command when that is the next action.
59
59
  8. Treat the answer as advisory; turn it into your own plan before editing code.
60
60
 
61
- `ask-pro` selects `Latest`, then `Pro` intelligence. Do not require a
61
+ `ask-pro` selects `Latest` when available, otherwise the highest numbered available
62
+ GPT model, then `Pro` intelligence. Do not require a
62
63
  different dated model label or a separate thinking-effort control in the prompt
63
64
  or workflow.
64
65