action-log-scan

command
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

action-log-scan

Paginate through an agent's server-side action log (get_action_log) and report the distinct event_types seen, with per-type counts, the owning category, and an example summary — handy for discovering the full event vocabulary the server emits (the log has 30-day retention).

The tool persists every entry it pulls to a per-agent JSONL store, so later runs fetch only records newer than the highest stored id and then report the cumulative picture across everything captured so far.

Usage

# First run: full pull into data/agents/craftsman-1/action_log.jsonl, then report
action-log-scan --agent=craftsman-1

# Later runs: fetch only newer entries, report the cumulative store
action-log-scan --agent=craftsman-1

# Force a complete re-page (backfills any gaps in the store)
action-log-scan --agent=craftsman-1 --full

# Group the output by category
action-log-scan --agent=craftsman-1 --sort=category

# Only one category (incremental stop is disabled when a filter is set)
action-log-scan --agent=craftsman-1 --category=combat

# Exact event_type (e.g. a faction's production-run history)
action-log-scan --agent=craftsman-1 --event-type=faction.production_cycle

# A faction's log (kept in its own store file)
action-log-scan --agent=craftsman-1 --faction-id=<id>

# Machine-readable output
action-log-scan --agent=craftsman-1 --json

# One-off scan that neither reads nor writes the store
action-log-scan --agent=craftsman-1 --no-store --max-pages=4

Flags

Flag Default Description
--agent (required) Agent ID for authentication
--category (all) Category filter (combat, trading, ship, crafting, faction, mission, skill, salvage, storage, other)
--event-type (none) Exact event_type filter (e.g. faction.production_cycle)
--faction-id (none) Scan a faction's log instead of the personal log (separate store file)
--page-size 100 Entries per page (max 100)
--max-pages 0 Stop after N pages (0 = all pages until has_more is false)
--sort count Output order: count (desc), name (event_type), category
--json false Emit per-type stats as JSON instead of a table
--store (per-agent default) Path to the JSONL entry store (data/agents/<agent>/action_log[.<faction>].jsonl)
--full false Re-page the entire log instead of stopping at the newest stored id (backfills gaps)
--no-store false Don't read or write the store (one-off scan of this run only)
--transport ws Transport: ws (WebSocket) or mcp (MCP HTTP)
--debug false Enable debug logging

Persistent store

  • Default path: data/agents/<agent>/action_log.jsonl (one JSON object per line; gitignored). A --faction-id scan uses action_log.<faction>.jsonl.
  • Incremental by default: entries come back newest-first, so the scan stops as soon as it reaches an id already in the store. The first run with an empty store therefore pulls everything; subsequent runs are cheap.
  • --full disables the early-stop and re-pages the whole log, appending any entries the store was missing (already-stored ids are skipped — no duplicates).
  • The early-stop is disabled automatically when --category/--event-type is set, since a filtered query no longer bounds the older matching records by the store's newest id. New matching entries are still appended.
  • The final report (table or --json) is computed over the whole store, not just this run; each type's example/last_seen come from its newest entry, first_seen from its oldest.

Notes

  • Progress lines go to stderr; the final table / JSON goes to stdout, so action-log-scan ... > out.txt captures just the report.
  • The game server tends to close the WS connection after each query, so the tool reconnects + re-logs in before every page (and retries a page once on a mid-call drop). A full first scan of a few thousand entries takes a couple of minutes; incremental runs are near-instant.

Documentation

Overview

action-log-scan paginates through an agent's server-side action log (get_action_log) and reports the distinct event_types seen, with per-type counts, the owning category, and an example summary.

It maintains a per-agent JSONL store of every entry it has pulled. On later runs it fetches only records newer than the highest stored id (entries come back newest-first, so it stops paging as soon as it reaches a known id), then reports the cumulative picture across the whole store. Pass --full to re-page the entire log (backfilling any gaps), or --no-store to skip persistence entirely.

Usage:

action-log-scan --agent=craftsman-1                 # incremental pull + report
action-log-scan --agent=craftsman-1 --full          # full re-scan
action-log-scan --agent=craftsman-1 --category=combat
action-log-scan --agent=craftsman-1 --sort=name --json
action-log-scan --agent=craftsman-1 --faction-id=<id>   # faction log (separate store)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL