@misterhuydo/sentinel 1.2.2 → 1.2.4

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/.cairn/.hint-lock CHANGED
@@ -1 +1 @@
1
- 2026-03-23T09:25:27.661Z
1
+ 2026-03-23T09:57:32.803Z
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-23T09:42:32.547Z",
3
- "checkpoint_at": "2026-03-23T09:42:32.548Z",
2
+ "message": "Auto-checkpoint at 2026-03-23T09:50:06.054Z",
3
+ "checkpoint_at": "2026-03-23T09:50:06.055Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -368,6 +368,14 @@ _TOOLS = [
368
368
  "description": "Max matching lines to return per source (default 30)",
369
369
  "default": 30,
370
370
  },
371
+ "tail": {
372
+ "type": "integer",
373
+ "description": (
374
+ "Number of log lines to fetch from the server before grepping (default: config value, typically 500). "
375
+ "Increase when the user asks for a longer time window — e.g. 'yesterday up to now' → use 5000-10000. "
376
+ "Higher values take longer but cover more history."
377
+ ),
378
+ },
371
379
  },
372
380
  "required": ["query"],
373
381
  },
@@ -1084,6 +1092,7 @@ async def _run_tool(name: str, inputs: dict, cfg_loader, store, slack_client=Non
1084
1092
  query = inputs.get("query", "")
1085
1093
  source = inputs.get("source", "").lower()
1086
1094
  max_matches = int(inputs.get("max_matches", 30))
1095
+ tail_override = inputs.get("tail")
1087
1096
 
1088
1097
  # ── Live fetch path: SSH to servers and grep in real time ──────────────
1089
1098
  script = Path(__file__).resolve().parent.parent / "scripts" / "fetch_log.sh"
@@ -1095,6 +1104,8 @@ async def _run_tool(name: str, inputs: dict, cfg_loader, store, slack_client=Non
1095
1104
  for props in props_files:
1096
1105
  env = os.environ.copy()
1097
1106
  env["GREP_FILTER"] = query
1107
+ if tail_override:
1108
+ env["TAIL"] = str(tail_override)
1098
1109
  try:
1099
1110
  r = subprocess.run(
1100
1111
  ["bash", str(script), str(props)],
@@ -1115,6 +1126,11 @@ async def _run_tool(name: str, inputs: dict, cfg_loader, store, slack_client=Non
1115
1126
  "mode": "live",
1116
1127
  "total_matches": total,
1117
1128
  "results": live_results,
1129
+ "note": (
1130
+ "Results already include a per-source breakdown. "
1131
+ "Do NOT call search_logs again with a source filter to 'refine' — "
1132
+ "use these results directly."
1133
+ ) if total > 0 else None,
1118
1134
  })
1119
1135
 
1120
1136
  # ── Fallback: search locally-cached log files ──────────────────────────
@@ -1157,9 +1173,8 @@ async def _run_tool(name: str, inputs: dict, cfg_loader, store, slack_client=Non
1157
1173
  }
1158
1174
  if files_searched == 0:
1159
1175
  result["warning"] = (
1160
- "No cached log files found for this source filter. "
1161
- "This means the source name was not recognised not that there are no log entries. "
1162
- "Try search_logs without a source filter to search all sources."
1176
+ "Source name not recognised in cached files this is a lookup failure, not 'no results'. "
1177
+ "If you already have results from a broader search_logs call, use those. Stop retrying."
1163
1178
  )
1164
1179
  return json.dumps(result)
1165
1180