@signal4/s4 2.6.0 → 2.7.0
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/README.md +33 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +317 -175
- package/dist/cli.js.map +1 -1
- package/dist/cli_args.d.ts +24 -0
- package/dist/cli_args.d.ts.map +1 -0
- package/dist/cli_args.js +130 -0
- package/dist/cli_args.js.map +1 -0
- package/dist/client.d.ts +80 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +128 -24
- package/dist/client.js.map +1 -1
- package/dist/format.d.ts +81 -2
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +209 -47
- package/dist/format.js.map +1 -1
- package/dist/handler_types.d.ts +10 -0
- package/dist/handler_types.d.ts.map +1 -1
- package/dist/handler_types.js +25 -0
- package/dist/handler_types.js.map +1 -1
- package/dist/handlers/ads.js +4 -4
- package/dist/handlers/ads.js.map +1 -1
- package/dist/handlers/analyze.d.ts.map +1 -1
- package/dist/handlers/analyze.js +22 -6
- package/dist/handlers/analyze.js.map +1 -1
- package/dist/handlers/bookmarks.js +2 -2
- package/dist/handlers/bookmarks.js.map +1 -1
- package/dist/handlers/claim_detail.js +2 -2
- package/dist/handlers/claim_detail.js.map +1 -1
- package/dist/handlers/claims.d.ts.map +1 -1
- package/dist/handlers/claims.js +81 -26
- package/dist/handlers/claims.js.map +1 -1
- package/dist/handlers/count.d.ts +7 -0
- package/dist/handlers/count.d.ts.map +1 -0
- package/dist/handlers/count.js +146 -0
- package/dist/handlers/count.js.map +1 -0
- package/dist/handlers/explore.d.ts.map +1 -1
- package/dist/handlers/explore.js +53 -14
- package/dist/handlers/explore.js.map +1 -1
- package/dist/handlers/registry.d.ts.map +1 -1
- package/dist/handlers/registry.js +5 -1
- package/dist/handlers/registry.js.map +1 -1
- package/dist/handlers/reports.d.ts +1 -0
- package/dist/handlers/reports.d.ts.map +1 -1
- package/dist/handlers/reports.js +47 -11
- package/dist/handlers/reports.js.map +1 -1
- package/dist/handlers/search.d.ts.map +1 -1
- package/dist/handlers/search.js +70 -22
- package/dist/handlers/search.js.map +1 -1
- package/dist/handlers/timeline.d.ts.map +1 -1
- package/dist/handlers/timeline.js +14 -8
- package/dist/handlers/timeline.js.map +1 -1
- package/dist/http.js +25 -3
- package/dist/http.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/provenance.d.ts +29 -2
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +63 -4
- package/dist/provenance.js.map +1 -1
- package/dist/server_core.d.ts +8 -1
- package/dist/server_core.d.ts.map +1 -1
- package/dist/server_core.js +90 -8
- package/dist/server_core.js.map +1 -1
- package/dist/speed.d.ts +40 -0
- package/dist/speed.d.ts.map +1 -0
- package/dist/speed.js +196 -0
- package/dist/speed.js.map +1 -0
- package/dist/surface.d.ts +7 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +18 -0
- package/dist/surface.js.map +1 -0
- package/dist/types.d.ts +155 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -26,6 +26,38 @@ This package contains three surfaces backed by one HTTP client:
|
|
|
26
26
|
| CLI | `npx @signal4/s4 search ...` | `client.ts` | `handlers/` → text |
|
|
27
27
|
| MCP server | `s4 --mcp` | `client.ts` | `handlers/` → text |
|
|
28
28
|
|
|
29
|
+
## CLI quick start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
s4 collections # what you can scope to (omit --collection = whole corpus)
|
|
33
|
+
s4 search immigration policy -n 10 # unquoted multi-word topic; -n / -k / --limit = number of results
|
|
34
|
+
s4 search --keyword "border wall" -s "Tucker Carlson" --since 2024-06
|
|
35
|
+
s4 search tariffs --collection anglosphere --days 800 -o tariffs.md
|
|
36
|
+
s4 timeline tariffs --since 2023 -g quarter # day | week | month | quarter | year (calendar buckets)
|
|
37
|
+
s4 count tariffs --since 2025 --by month # segments · episodes · channels per month, no cap
|
|
38
|
+
s4 count "carbon tax" -m keyword --collection Canadian --by channel # exact; rank shows by what they said
|
|
39
|
+
s4 count "carbon tax" --vs "carbon pricing" --since 2024 --by quarter # several topics side by side
|
|
40
|
+
s4 count "Strong Borders Act" -m keyword --by episode --order date -n 100 # every matching episode, newest first
|
|
41
|
+
s4 segment 42314442 # full text of a quote (seg:ID from search)
|
|
42
|
+
s4 --version
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Flags: `-n/-k/--limit` results · `--offset` skip · `-s` speaker · `-c` channel · `-d/--days` · `-m` mode ·
|
|
46
|
+
`-o/--out` file · `--since/--until` (or `--start/--end`; `2023`, `2023-06`, `2023-06-15`; on search, claims, timeline, trend, the claims-analysis commands, top-claims, top-channels, top-speakers) · `--collection` (every corpus command) · `--json`.
|
|
47
|
+
`--days` has no ceiling on search, claims, timeline and count; report commands cap at 365.
|
|
48
|
+
`count` groups with `--by` (day · week · month · quarter · year · channel · episode · language · country · platform · collection · lean);
|
|
49
|
+
keyword counts are exact, semantic counts are estimates at similarity ≥0.35, and every language is counted unless `--language` names some. Errors go to stderr with exit 1.
|
|
50
|
+
|
|
51
|
+
## Speed
|
|
52
|
+
|
|
53
|
+
Every MCP tool description and every `s4 <command> --help` starts with how long the call takes at
|
|
54
|
+
default settings: **instant** (<0.5s), **fast** (0.5–2.5s) or **slow** (>2.5s). Search, counts,
|
|
55
|
+
timelines and trends also say how that grows with the window, e.g.
|
|
56
|
+
`[fast ~1.5–2.5s; 12 months ~3–6.5s, all time ~5–11s]`. When a call is expected to take a while,
|
|
57
|
+
the MCP server sends a progress notice with the estimate as it starts (to clients that pass a
|
|
58
|
+
`progressToken`), and the CLI prints it to stderr. Answers that took longer than 2.5s end with
|
|
59
|
+
`Took Ns`. The numbers live in `src/speed.ts`, measured against the live API (signal4#292, #296).
|
|
60
|
+
|
|
29
61
|
## TypeScript Client
|
|
30
62
|
|
|
31
63
|
For applications that need typed access to the Signal4 API (frontends, agents, pipelines, scripts):
|
|
@@ -80,6 +112,7 @@ The client reads from environment variables:
|
|
|
80
112
|
- `searchClaims(params)` — Search extracted claims with stance and observation counts
|
|
81
113
|
- `detectTrend(params)` — Compare recent vs baseline mention volume
|
|
82
114
|
- `getTimeline(params)` — Topic mention volume over time
|
|
115
|
+
- `getCollections()` — Collections a key can scope to
|
|
83
116
|
|
|
84
117
|
**Entities**
|
|
85
118
|
- `searchSpeakers(query, limit?)` — Autocomplete speaker search
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,6EAA6E;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAgnD7E,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmG1C"}
|