@tritard/waterbrother 0.16.38 → 0.16.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.16.38",
3
+ "version": "0.16.39",
4
4
  "description": "Waterbrother: bring-your-own-model coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
@@ -259,32 +259,33 @@ export function resolveLocalConceptQuestion(text = "", manifest = {}) {
259
259
  const asksWhatIs = /^(what('| i)?s|what is|tell me about|explain)\b/.test(lower) || /\bwhat is\b/.test(lower);
260
260
  const asksHowToUseRoundtable = mentionsRoundtable && /\b(how do i|how to|add to|join|use|set up|enable|create)\b/.test(lower);
261
261
  const sourcesFor = (...keys) => keys.map((key) => manifest.sourceHints?.[key]).filter(Boolean);
262
+ const withSources = (lines, sources = []) => [
263
+ ...lines,
264
+ ...(sources.length ? [`sources: ${sources.join(", ")}`] : [])
265
+ ].join("\n");
262
266
  if (mentionsRoundtable && asksWhatIs) {
263
267
  const sources = sourcesFor("roundtableDocs", "sharedState", "roundtable");
264
- return [
268
+ return withSources([
265
269
  "Roundtable is Waterbrother’s shared-project collaboration model.",
266
- "It ties one project to one shared room with explicit room modes, member roles, operator lock, tasks, invites, and shared runtime selection.",
267
- `sources: ${sources.join(", ")}`
268
- ].join("\n");
270
+ "It ties one project to one shared room with explicit room modes, member roles, operator lock, tasks, invites, and shared runtime selection."
271
+ ], sources);
269
272
  }
270
273
 
271
274
  if (asksHowToUseRoundtable) {
272
275
  const sources = sourcesFor("roundtableDocs", "sharedState", "roundtable");
273
- return [
276
+ return withSources([
274
277
  "To add to Roundtable, first enable shared-project mode in the repo with `waterbrother project share`.",
275
278
  "Then use `waterbrother room invite <member-id> [owner|editor|observer]` to create member invites, `waterbrother room tasks` / `waterbrother room task add <text>` to work the shared backlog, and `waterbrother room mode <chat|plan|execute>` plus `waterbrother room claim` when you want one operator to execute.",
276
- "In Telegram, the equivalent shared-room commands are `/room`, `/invite`, `/tasks`, `/task add`, `/mode`, `/claim`, and `/accept-invite`.",
277
- `sources: ${sources.join(", ")}`
278
- ].join("\n");
279
+ "In Telegram, the equivalent shared-room commands are `/room`, `/invite`, `/tasks`, `/task add`, `/mode`, `/claim`, and `/accept-invite`."
280
+ ], sources);
279
281
  }
280
282
 
281
283
  if ((/\bshared project\b/.test(lower) || /\bshared room\b/.test(lower) || /\broom mode\b/.test(lower)) && asksWhatIs) {
282
284
  const sources = sourcesFor("sharedState", "roundtableDocs", "roundtable");
283
- return [
285
+ return withSources([
284
286
  "A shared project links the current repo to one collaboration room with explicit member roles, room mode, operator lock, tasks, invites, and shared runtime state.",
285
- `Current room mode: ${manifest.sharedRoom?.roomMode || "chat"}. Shared enabled: ${manifest.sharedRoom?.enabled ? "yes" : "no"}.`,
286
- `sources: ${sources.join(", ")}`
287
- ].join("\n");
287
+ `Current room mode: ${manifest.sharedRoom?.roomMode || "chat"}. Shared enabled: ${manifest.sharedRoom?.enabled ? "yes" : "no"}.`
288
+ ], sources);
288
289
  }
289
290
 
290
291
  if ((/\bwhat can you do\b/.test(lower) || /\bcapabilities\b/.test(lower) || /\bwhat do you support\b/.test(lower))) {
@@ -301,47 +302,42 @@ export function resolveLocalConceptQuestion(text = "", manifest = {}) {
301
302
 
302
303
  if (/\btelegram\b/.test(lower) && asksWhatIs) {
303
304
  const sources = sourcesFor("telegramDocs", "sharedState");
304
- return [
305
+ return withSources([
305
306
  "Telegram is Waterbrother’s first live messaging adapter.",
306
- "It supports pairing, live TUI bridging, shared-room commands, task operations, and room execution gating.",
307
- `sources: ${sources.join(", ")}`
308
- ].join("\n");
307
+ "It supports pairing, live TUI bridging, shared-room commands, task operations, and room execution gating."
308
+ ], sources);
309
309
  }
310
310
 
311
311
  if ((/\bgateway\b/.test(lower) || /\bmessaging gateway\b/.test(lower)) && asksWhatIs) {
312
312
  const sources = sourcesFor("telegramDocs", "sharedState");
313
- return [
313
+ return withSources([
314
314
  "The gateway is Waterbrother’s channel runtime for messaging surfaces like Telegram.",
315
- "It handles pairing, routing, live TUI bridging, remote sessions, shared-room commands, and delivery state.",
316
- `sources: ${sources.join(", ")}`
317
- ].join("\n");
315
+ "It handles pairing, routing, live TUI bridging, remote sessions, shared-room commands, and delivery state."
316
+ ], sources);
318
317
  }
319
318
 
320
319
  if ((/\bruntime profile\b/.test(lower) || /\bruntime profiles\b/.test(lower)) && asksWhatIs) {
321
320
  const sources = sourcesFor("readme", "sharedState");
322
- return [
321
+ return withSources([
323
322
  "Runtime profiles are saved Waterbrother provider/model/runtime configurations.",
324
- "A shared room can also pin a room-level runtime profile that Telegram execution inherits when present.",
325
- `sources: ${sources.join(", ")}`
326
- ].join("\n");
323
+ "A shared room can also pin a room-level runtime profile that Telegram execution inherits when present."
324
+ ], sources);
327
325
  }
328
326
 
329
327
  if ((/\bapproval\b/.test(lower) || /\bapprovals\b/.test(lower)) && asksWhatIs) {
330
328
  const sources = sourcesFor("readme", "telegramDocs");
331
- return [
329
+ return withSources([
332
330
  "Approvals are Waterbrother’s safety gate for risky actions and scope changes.",
333
- "Local TUI runs can use the normal approval flow, while Telegram fallback runs still use approval=never when no live TUI host is attached.",
334
- `sources: ${sources.join(", ")}`
335
- ].join("\n");
331
+ "Local TUI runs can use the normal approval flow, while Telegram fallback runs still use approval=never when no live TUI host is attached."
332
+ ], sources);
336
333
  }
337
334
 
338
335
  if ((/\bsession\b/.test(lower) || /\bsessions\b/.test(lower)) && asksWhatIs) {
339
336
  const sources = sourcesFor("readme", "sharedState");
340
- return [
337
+ return withSources([
341
338
  "Sessions are Waterbrother’s persisted work threads.",
342
- "They store cwd, runtime state, messages, and can be resumed locally or through Telegram-linked remote control.",
343
- `sources: ${sources.join(", ")}`
344
- ].join("\n");
339
+ "They store cwd, runtime state, messages, and can be resumed locally or through Telegram-linked remote control."
340
+ ], sources);
345
341
  }
346
342
 
347
343
  return null;