@getrift/rift 0.1.0-beta.14 → 0.1.0-beta.16

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 (66) hide show
  1. package/dist/src/capture/auto-capture.d.ts.map +1 -1
  2. package/dist/src/capture/auto-capture.js +56 -5
  3. package/dist/src/capture/auto-capture.js.map +1 -1
  4. package/dist/src/capture/observability.d.ts +36 -0
  5. package/dist/src/capture/observability.d.ts.map +1 -1
  6. package/dist/src/capture/observability.js +42 -4
  7. package/dist/src/capture/observability.js.map +1 -1
  8. package/dist/src/capture/recover-quarantine.d.ts +28 -0
  9. package/dist/src/capture/recover-quarantine.d.ts.map +1 -1
  10. package/dist/src/capture/recover-quarantine.js +43 -0
  11. package/dist/src/capture/recover-quarantine.js.map +1 -1
  12. package/dist/src/cli/commands/capture-recover.d.ts +28 -0
  13. package/dist/src/cli/commands/capture-recover.d.ts.map +1 -1
  14. package/dist/src/cli/commands/capture-recover.js +109 -52
  15. package/dist/src/cli/commands/capture-recover.js.map +1 -1
  16. package/dist/src/cli/commands/capture.d.ts.map +1 -1
  17. package/dist/src/cli/commands/capture.js +25 -0
  18. package/dist/src/cli/commands/capture.js.map +1 -1
  19. package/dist/src/cli/commands/doctor.d.ts.map +1 -1
  20. package/dist/src/cli/commands/doctor.js +60 -1
  21. package/dist/src/cli/commands/doctor.js.map +1 -1
  22. package/dist/src/cli/commands/onboard.d.ts.map +1 -1
  23. package/dist/src/cli/commands/onboard.js +34 -1
  24. package/dist/src/cli/commands/onboard.js.map +1 -1
  25. package/dist/src/cli/status/friend-header.d.ts.map +1 -1
  26. package/dist/src/cli/status/friend-header.js +75 -13
  27. package/dist/src/cli/status/friend-header.js.map +1 -1
  28. package/dist/src/diagnostics/doctor.d.ts +1 -1
  29. package/dist/src/diagnostics/doctor.d.ts.map +1 -1
  30. package/dist/src/diagnostics/doctor.js +42 -10
  31. package/dist/src/diagnostics/doctor.js.map +1 -1
  32. package/dist/src/diagnostics/repair-prompt.d.ts.map +1 -1
  33. package/dist/src/diagnostics/repair-prompt.js +17 -1
  34. package/dist/src/diagnostics/repair-prompt.js.map +1 -1
  35. package/dist/src/main.js +2 -0
  36. package/dist/src/main.js.map +1 -1
  37. package/dist/src/retrieval/context-pack.d.ts +6 -0
  38. package/dist/src/retrieval/context-pack.d.ts.map +1 -1
  39. package/dist/src/retrieval/context-pack.js +1 -0
  40. package/dist/src/retrieval/context-pack.js.map +1 -1
  41. package/dist/src/retrieval/current-truth.d.ts +36 -2
  42. package/dist/src/retrieval/current-truth.d.ts.map +1 -1
  43. package/dist/src/retrieval/current-truth.js +48 -29
  44. package/dist/src/retrieval/current-truth.js.map +1 -1
  45. package/dist/src/retrieval/report-demotion.d.ts +30 -0
  46. package/dist/src/retrieval/report-demotion.d.ts.map +1 -0
  47. package/dist/src/retrieval/report-demotion.js +107 -0
  48. package/dist/src/retrieval/report-demotion.js.map +1 -0
  49. package/dist/src/server/app.d.ts.map +1 -1
  50. package/dist/src/server/app.js +8 -2
  51. package/dist/src/server/app.js.map +1 -1
  52. package/dist/src/server/routes/context.d.ts +1 -1
  53. package/dist/src/server/routes/context.d.ts.map +1 -1
  54. package/dist/src/server/routes/context.js +2 -1
  55. package/dist/src/server/routes/context.js.map +1 -1
  56. package/dist/src/server/routes/friend-status.d.ts +34 -0
  57. package/dist/src/server/routes/friend-status.d.ts.map +1 -1
  58. package/dist/src/server/routes/friend-status.js +15 -2
  59. package/dist/src/server/routes/friend-status.js.map +1 -1
  60. package/dist/src/server/routes/search.d.ts +1 -1
  61. package/dist/src/server/routes/search.d.ts.map +1 -1
  62. package/dist/src/server/routes/search.js +14 -1
  63. package/dist/src/server/routes/search.js.map +1 -1
  64. package/operator/swiftbar/render-menu.py +47 -10
  65. package/operator/swiftbar/rift.10s.sh +5 -0
  66. package/package.json +1 -1
@@ -286,6 +286,40 @@ def has_voyage_issue(doctor):
286
286
  )
287
287
 
288
288
 
289
+ # Warning kinds whose repair a non-technical user may want an AI to walk them
290
+ # through. An explicit allowlist, not a blacklist: most warnings either carry
291
+ # their own one-click action (update_available, mcp_not_installed) or have no
292
+ # action at all (capture_daemon_stale's nextAction is literally "Nothing to
293
+ # do") — offering "Copy fix prompt" for those would promise a fix that isn't
294
+ # needed. Add a kind here only once `rift doctor --copy-prompt` produces a
295
+ # genuinely useful repair prompt for it.
296
+ REPAIRABLE_WARNINGS = {"capture_quarantined"}
297
+
298
+
299
+ def has_repairable_warning(doctor):
300
+ """A warning whose repair the user may want an AI to walk them through."""
301
+ if not isinstance(doctor, dict):
302
+ return False
303
+ return any(
304
+ i.get("severity") == "warning" and i.get("kind") in REPAIRABLE_WARNINGS
305
+ for i in (doctor.get("issues") or [])
306
+ )
307
+
308
+
309
+ def copy_prompt_actions():
310
+ """The 'Copy fix prompt for Claude/Codex' menu rows (no embedded prompt)."""
311
+ out = []
312
+ for label, target in (("Claude", "claude"), ("Codex", "codex")):
313
+ action = rift_action(
314
+ f"Copy fix prompt for {label}",
315
+ ["doctor", "--copy-prompt", f"--target={target}"],
316
+ terminal=False,
317
+ )
318
+ if action:
319
+ out.append(action)
320
+ return out
321
+
322
+
289
323
  def render_advisories(doctor):
290
324
  """Warning-level issues that aren't already shown as client rows."""
291
325
  rows = []
@@ -307,28 +341,27 @@ def render_advisories(doctor):
307
341
  return rows
308
342
 
309
343
 
310
- def render_footer_actions(broken, doctor_ok):
344
+ def render_footer_actions(broken, doctor_ok, offer_copy_prompt=False):
311
345
  """Common Rift-owned actions. Order differs by state per the plan.
312
346
 
313
347
  `doctor_ok` gates the doctor-powered actions (`Copy fix prompt …` and
314
348
  `Troubleshooting`): they appear only when the CLI actually produced a
315
349
  report, never merely because the rift binary resolved.
350
+
351
+ `offer_copy_prompt` extends the AI repair prompt to the non-broken
352
+ (warning) state: a warning with a repair action (e.g. large sessions
353
+ parked) gets the same one-click Claude/Codex help a broken state does.
316
354
  """
317
355
  lines = ["---"]
318
356
  if broken:
319
357
  if doctor_ok:
320
- for label, target in (("Claude", "claude"), ("Codex", "codex")):
321
- action = rift_action(
322
- f"Copy fix prompt for {label}",
323
- ["doctor", "--copy-prompt", f"--target={target}"],
324
- terminal=False,
325
- )
326
- if action:
327
- lines.append(action)
358
+ lines += copy_prompt_actions()
328
359
  logs = open_action("Open logs", env("RIFT_LOG_DIR"))
329
360
  if logs:
330
361
  lines.append(logs)
331
362
  else:
363
+ if doctor_ok and offer_copy_prompt:
364
+ lines += copy_prompt_actions()
332
365
  cap = rift_action("Capture now", ["capture"], terminal=False, refresh=True)
333
366
  if cap:
334
367
  lines.append(cap)
@@ -427,7 +460,11 @@ def render(doctor, status, mcp, health, now):
427
460
  lines.append("Heads up:")
428
461
  lines += advisories
429
462
 
430
- lines += render_footer_actions(broken=False, doctor_ok=has_doctor_report(doctor))
463
+ lines += render_footer_actions(
464
+ broken=False,
465
+ doctor_ok=has_doctor_report(doctor),
466
+ offer_copy_prompt=has_repairable_warning(doctor),
467
+ )
431
468
  return lines
432
469
 
433
470
 
@@ -50,6 +50,11 @@ RENDERER="$SCRIPT_DIR/render-menu.py"
50
50
  # to pass as node's first arg.
51
51
  # - NODE_BIN: an absolute node binary, so actions don't depend on PATH.
52
52
  RIFT_BIN="${RIFT_BIN:-}"
53
+ # REPO_ROOT only resolves to anything in a dev checkout; default it to empty
54
+ # so the dev-only candidate below is a harmless no-op under `set -u` on
55
+ # packaged (npm) installs, where it is never set. (Without this, the whole
56
+ # candidate list fails to expand and the plugin crashes on every tick.)
57
+ REPO_ROOT="${REPO_ROOT:-}"
53
58
  if [[ -z "$RIFT_BIN" ]]; then
54
59
  for candidate in \
55
60
  "/opt/homebrew/bin/rift" \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getrift/rift",
3
- "version": "0.1.0-beta.14",
3
+ "version": "0.1.0-beta.16",
4
4
  "description": "Local-first personal memory + reasoning infrastructure with an MCP interface.",
5
5
  "homepage": "https://getrift.dev",
6
6
  "license": "UNLICENSED",