From a2c2eaa1425c6879300cff4e08fd2fb80f2d4b34 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Tue, 10 Mar 2026 06:05:12 -0600 Subject: [PATCH] Add --stream flag to sol call journal search Exposes the existing stream filter (already supported in schema, indexer, query layer, tool layer, and web API) on the CLI surface. Stream value is shown in result metadata when present. Closes VPE request req_43est4h5. Co-Authored-By: Claude Opus 4.6 --- think/tools/call.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/think/tools/call.py b/think/tools/call.py index f7677b1f9..91beb7b00 100644 --- a/think/tools/call.py +++ b/think/tools/call.py @@ -10,6 +10,7 @@ optimized for terminal use. Mounted by ``think.call`` as ``sol call journal ...``. """ +import json import sys from pathlib import Path @@ -30,6 +31,11 @@ from think.facets import ( from think.indexer.journal import get_events as get_events_impl from think.indexer.journal import search_counts as search_counts_impl from think.indexer.journal import search_journal as search_journal_impl +from think.importers.utils import ( + build_import_info, + get_import_details, + list_import_timestamps, +) from think.utils import ( get_journal, iter_segments, @@ -58,6 +64,9 @@ def search( ), facet: str | None = typer.Option(None, "--facet", "-f", help="Filter by facet."), agent: str | None = typer.Option(None, "--agent", "-a", help="Filter by agent."), + stream: str | None = typer.Option( + None, "--stream", help="Filter by stream (e.g. import.ics, archon)." + ), ) -> None: """Search the journal index.""" kwargs = {} @@ -71,6 +80,8 @@ def search( kwargs["facet"] = facet if agent is not None: kwargs["agent"] = agent + if stream is not None: + kwargs["stream"] = stream total, results = search_journal_impl(query, limit, offset, **kwargs) @@ -97,7 +108,8 @@ def search( # Results for r in results: meta = r["metadata"] - typer.echo(f"\n--- {meta['day']} | {meta['facet']} | {meta['agent']} ---") + stream_tag = f" | {meta['stream']}" if meta.get("stream") else "" + typer.echo(f"\n--- {meta['day']} | {meta['facet']} | {meta['agent']}{stream_tag} ---") typer.echo(r["text"].strip()) -- 2.51.2