@tritard/waterbrother 0.14.6 → 0.14.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/product.js +18 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.14.6",
3
+ "version": "0.14.7",
4
4
  "description": "Waterbrother: Grok-powered coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/product.js CHANGED
@@ -244,8 +244,24 @@ export function buildProductContext(product) {
244
244
 
245
245
  export function detectProductRequest(text) {
246
246
  const lower = text.toLowerCase().trim();
247
- return /^(i want|build me|make me|create|i need|can you build|help me build|let's build|let me build|we need|build an?|build the|build my|make an?|make the|make my|create an?|create the|create my)\b/.test(lower)
248
- && /\b(app|site|website|page|platform|tool|dashboard|store|shop|blog|portfolio|saas|api|bot|game|landing|marketplace|tracker|manager)\b/.test(lower);
247
+ // Product nouns if any of these appear, it might be a product request
248
+ const hasProductNoun = /\b(app|site|website|webpage|page|platform|tool|dashboard|store|shop|blog|portfolio|saas|api|bot|game|landing|marketplace|tracker|manager|clone|replica|copy|prototype|mvp|startup|service|system|portal|hub|forum|board|social|network|directory|aggregator|widget|extension|plugin)\b/.test(lower);
249
+ if (!hasProductNoun) return false;
250
+
251
+ // Negative gate — existing-code modification patterns are NOT product requests
252
+ const isCodeWork = /\b(add .* to the|fix the|update the|refactor the|remove the|debug the|migrate the|patch the)\b/.test(lower);
253
+ if (isCodeWork) return false;
254
+
255
+ // Creation intent — broad matching for any phrasing that implies building
256
+ const hasCreationIntent = /\b(build|make|create|want|need|give me|get me|set up|spin up|scaffold|generate|design|develop|code|ship|launch|deploy|start|oneshot|one-shot|whip up|throw together|put together|cook up|bang out|knock out|draft|mock up|prototype|wireframe)\b/.test(lower);
257
+ if (hasCreationIntent) return true;
258
+
259
+ // Imperative with product noun — "a 4chan clone", "simple todo app"
260
+ // If it's short (< 10 words) and has a product noun, assume creation
261
+ const words = lower.split(/\s+/);
262
+ if (words.length <= 8 && hasProductNoun && !lower.endsWith("?")) return true;
263
+
264
+ return false;
249
265
  }
250
266
 
251
267
  export function parseProductIntent(text) {