Skip to content

Commit 23df546

Browse files
committed
Update Cargo.lock with new dependencies: adler2 v2.0.1, crc32fast v1.5.0, flate2 v1.1.9, miniz_oxide v0.8.9, simd-adler32 v0.3.8, ureq v2.12.1, webpki-roots v0.26.11. Add related dependency entries and update existing ones.
1 parent f408ab5 commit 23df546

19 files changed

Lines changed: 1549 additions & 198 deletions

Cargo.lock

Lines changed: 72 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/commands/ai.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,11 @@ Key points:
128128
- `seq_*` tool definitions injected into new sessions
129129
- tool-name normalization (`seq_open_app`, `seq.open_app`, `seq:open-app`)
130130
- request correlation IDs (`request_id`, `run_id`, `tool_call_id`)
131+
- Event transport is SSE-first (`/sse`) with automatic fallback to polling (`/events`) if SSE is unavailable.
132+
- Optional Maple telemetry export can dual-write runtime traces to local + hosted ingest endpoints when `SEQ_EVERRUNS_MAPLE_*` env vars are configured.
131133
- Existing Flow features remain unchanged (`f seq-rpc`, session resume/copy/context flows).
132134

133135
Setup and validation details are documented in:
134136

135137
- `docs/everruns-seq-bridge-integration.md`
138+
- `docs/everruns-maple-runbook.md`

docs/commands/domains.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ f domains --engine native doctor
6969
- myflow-specific setup: `docs/myflow-localhost-runbook.md`.
7070
- Lifecycle integration: configure `[lifecycle.domains]` and use `f up` / `f down`.
7171

72+
### macOS no-docker bind to :80
73+
74+
If native startup fails with `Permission denied` on `127.0.0.1:80`, install launchd socket mode once:
75+
76+
```bash
77+
cd ~/code/flow
78+
sudo ./tools/domainsd-cpp/install-macos-launchd.sh
79+
```
80+
81+
Then run:
82+
83+
```bash
84+
f domains --engine native up
85+
```
86+
87+
This keeps routing fully native and avoids Docker overhead while still using port `80`.
88+
7289
### Native tuning envs
7390

7491
You can tune the native daemon at startup via environment variables:

docs/commands/down.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ f down
1919
- If `[lifecycle.domains]` is configured, optional teardown is applied:
2020
- `remove_on_down = true` -> removes configured host route
2121
- `stop_proxy_on_down = true` -> stops shared local domains proxy
22+
- On macOS launchd-managed native domains, stopping native proxy is handled by:
23+
- `sudo ./tools/domainsd-cpp/uninstall-macos-launchd.sh`
2224

2325
If neither a down task nor lifecycle domain teardown is configured, command fails with guidance.
2426

docs/everruns-maple-runbook.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Everruns + Maple Runbook
2+
3+
This is the fastest path to use the new Everruns telemetry export now.
4+
5+
It sends `f ai everruns` traces to:
6+
7+
- local Maple (dev visualization)
8+
- hosted Maple (shared/history visualization)
9+
10+
## What gets exported
11+
12+
When enabled, Flow exports:
13+
14+
- `everruns.tool_call` spans for each `seq_*` tool execution
15+
- runtime spans such as:
16+
- `everruns.tool_call_requested`
17+
- `everruns.output_message_completed`
18+
- `everruns.turn_failed`
19+
20+
## Prerequisites
21+
22+
1. `seqd` is running and reachable at your socket (`/tmp/seqd.sock` by default).
23+
2. Everruns API is reachable (`http://127.0.0.1:9300/api` by default).
24+
3. You have Maple ingest keys for local and/or hosted endpoint.
25+
26+
## 1) Configure env (now)
27+
28+
From `~/code/flow`, set the endpoints + keys:
29+
30+
```bash
31+
f env set SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT=http://ingest.maple.localhost/v1/traces
32+
f env set SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEY=maple_pk_local_xxx
33+
f env set SEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT=https://ingest.1focus.ai/v1/traces
34+
f env set SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEY=maple_pk_hosted_xxx
35+
```
36+
37+
Optional tuning:
38+
39+
```bash
40+
f env set SEQ_EVERRUNS_MAPLE_QUEUE_CAPACITY=4096
41+
f env set SEQ_EVERRUNS_MAPLE_MAX_BATCH_SIZE=128
42+
f env set SEQ_EVERRUNS_MAPLE_FLUSH_INTERVAL_MS=50
43+
f env set SEQ_EVERRUNS_MAPLE_CONNECT_TIMEOUT_MS=400
44+
f env set SEQ_EVERRUNS_MAPLE_REQUEST_TIMEOUT_MS=800
45+
```
46+
47+
For optimized mirror (remote ClickHouse + durable local spool), also set:
48+
49+
```bash
50+
f env set SEQ_CH_MODE=mirror
51+
f env set SEQ_CH_MEM_PATH=~/repos/ClickHouse/ClickHouse/user_files/seq_mem.jsonl
52+
f env set SEQ_CH_LOG_PATH=~/repos/ClickHouse/ClickHouse/user_files/seq_trace.jsonl
53+
```
54+
55+
## 2) Run with env injected
56+
57+
Use `f env run` so runtime sees configured values:
58+
59+
```bash
60+
f env run -- f ai everruns "open Safari and take a screenshot"
61+
```
62+
63+
If you already export envs another way, this also works:
64+
65+
```bash
66+
f ai everruns "open Safari and take a screenshot"
67+
```
68+
69+
On startup, if telemetry is enabled, Flow prints:
70+
71+
`maple dual-ingest telemetry enabled`
72+
73+
## 3) Verify in Maple
74+
75+
In Maple (local and hosted), filter by:
76+
77+
- `service.name = seq-everruns-bridge`
78+
79+
Look for span names:
80+
81+
- `everruns.tool_call`
82+
- `everruns.tool_call_requested`
83+
- `everruns.output_message_completed`
84+
85+
## Troubleshooting
86+
87+
1. Error: `invalid SEQ_EVERRUNS_MAPLE_* configuration`
88+
- You set only endpoint or only key for local/hosted pair.
89+
- Fix by setting both or removing both for that pair.
90+
2. Everruns command works but no spans in Maple
91+
- Confirm ingest endpoint includes `/v1/traces`.
92+
- Confirm ingest key is valid for that endpoint.
93+
- Confirm you ran through `f env run -- ...` (or equivalent env injection).
94+
3. Temporary Maple outage
95+
- Tool execution continues.
96+
- Export is best-effort and non-blocking.

docs/everruns-seq-bridge-integration.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ Flow still owns and keeps unchanged:
2626
- Flow config/env resolution for Everruns (`[everruns]`, `FLOW_EVERRUNS_*`)
2727
- `f seq-rpc` command and other AI session commands
2828

29+
Flow now additionally supports Maple dual-ingest telemetry export from the Everruns runtime
30+
when `SEQ_EVERRUNS_MAPLE_*` env vars are set.
31+
32+
Runtime path is now SSE-first for lower latency:
33+
34+
- primary: `GET /v1/sessions/{id}/sse` (push events, reconnect with `since_id`)
35+
- fallback: `GET /v1/sessions/{id}/events` polling when SSE endpoint is unavailable
36+
2937
## No-Overlap Contract
3038

3139
This integration is intentionally scoped to avoid feature overlap:
@@ -34,6 +42,26 @@ This integration is intentionally scoped to avoid feature overlap:
3442
- Flow does not add a second Everruns runtime.
3543
- Existing `f ai claude` / `f ai codex` / `f seq-rpc` behavior remains unchanged.
3644

45+
## Maple Dual Ingest (Local + Hosted)
46+
47+
When enabled, Flow emits:
48+
49+
- tool call spans (`everruns.tool_call`)
50+
- runtime event spans (`everruns.tool_call_requested`, `everruns.output_message_completed`, etc.)
51+
52+
using `seq_everruns_bridge::maple::MapleTraceExporter` and non-blocking background batching.
53+
54+
Required env keys:
55+
56+
- `SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT` (example: `http://ingest.maple.localhost/v1/traces`)
57+
- `SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEY`
58+
- `SEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT` (example: `https://ingest.1focus.ai/v1/traces`)
59+
- `SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEY`
60+
61+
Operational setup/run instructions:
62+
63+
- `docs/everruns-maple-runbook.md`
64+
3765
## Dependency Setup
3866

3967
Current local setup in `Cargo.toml`:
@@ -67,6 +95,7 @@ cargo check
6795
cargo run --release --bin f -- ai everruns --help
6896
rg "bridge_tool_definitions|parse_tool_call_requested|bridge_build_request" src/ai_everruns.rs
6997
rg "map_seq_operation|seq_client_tool_definitions" src/ai_everruns.rs
98+
rg "MapleTraceExporter|MapleSpan::for_runtime_event" src/ai_everruns.rs
7099
```
71100

72101
End-to-end smoke (requires local Everruns + seqd):
@@ -79,7 +108,9 @@ Expected evidence of integration:
79108

80109
- successful compile with shared bridge dependency
81110
- bridge call-sites present in Flow Everruns runtime
111+
- Maple exporter call-sites present (tool + runtime spans)
82112
- no duplicated tool catalog/mapping in `src/ai_everruns.rs`
113+
- SSE-first event consumption active in `src/ai_everruns.rs`
83114

84115
## When To Keep It / When To Revert
85116

docs/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ High-signal docs for the Codex/Claude workflow:
2727
- [`myflow-localhost-runbook.md`](myflow-localhost-runbook.md): exact commands to run `~/code/myflow` on `myflow.localhost` and use in-app `/processes` and `/logs` views.
2828
- [`seq-agent-rpc-contract.md`](seq-agent-rpc-contract.md): hard interface contract for agent OS actions through `seq_client -> seqd` RPC v1.
2929
- [`everruns-seq-bridge-integration.md`](everruns-seq-bridge-integration.md): why/how `f ai everruns` now reuses Seq's shared Everruns bridge to avoid duplicate tool mapping logic.
30+
- [`everruns-maple-runbook.md`](everruns-maple-runbook.md): exact commands to enable Everruns -> Maple dual-ingest and verify spans in local + hosted Maple.
3031
- [`ascii-commit-visualization-pipeline.md`](ascii-commit-visualization-pipeline.md): end-to-end pipeline for commit analysis -> Flow API -> `box-of-rain` ASCII/SVG diagrams in myflow.
3132
- [`features.md`](features.md): practical command flows and examples.
3233
- [`moonbit-ai-tasks-implementation.md`](moonbit-ai-tasks-implementation.md): complete inventory of the task-centric MoonBit AI task runtime and Flow-local `.ai/tasks` pack.

0 commit comments

Comments
 (0)