@timefly/opencode-plugin 0.2.8 → 0.2.9

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.
Files changed (3) hide show
  1. package/README.md +13 -15
  2. package/dist/cli.js +0 -0
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -104,26 +104,24 @@ OpenCode plugins run inside the OpenCode process. There is no built-in TimeFly U
104
104
 
105
105
  ## How sync works
106
106
 
107
- Unlike the VS Code extension (which syncs on a timer every ~2 minutes), the OpenCode plugin syncs **on every event** — there is no background interval.
107
+ The SDK batches OpenCode events before sending them to TimeFly. This keeps VPS load predictable as usage grows.
108
108
 
109
- ### Timing when does data leave your machine?
109
+ | Setting | Default | Behavior |
110
+ |---------|---------|----------|
111
+ | Debounce | 5s | Flush pending events 5 seconds after the last event in a burst |
112
+ | Max batch | 50 events | Flush immediately when the in-memory buffer is full |
113
+ | Immediate flush | `session_end` | Session totals are sent right away |
110
114
 
111
- | Trigger | What happens |
112
- |---------|----------------|
113
- | LLM request (`chat.params`) | Immediate sync attempt |
114
- | Assistant turn completes | Immediate sync attempt |
115
- | Tool call / result | Immediate sync attempt |
116
- | Session start / end | Immediate sync attempt |
117
- | Next event after failure | Retries queued events first, then sends new ones |
115
+ Typical flow during a coding session:
118
116
 
119
- **Typical flow during a coding session:**
117
+ 1. You send a prompt → `llm_request` is queued
118
+ 2. Model responds → `turn_complete`, tool events, etc. join the same batch
119
+ 3. After ~5s idle (or 50 events), one gzip `POST /ai/sync` sends the batch
120
+ 4. `session_end` flushes immediately so session totals are not delayed
120
121
 
121
- 1. You send a prompt `llm_request` syncs (~instant)
122
- 2. Model responds → `turn_complete` + `llm_response` sync (~instant when turn finishes)
123
- 3. Agent runs tools → each `tool_call` / `tool_result` syncs
124
- 4. Session goes idle → `session_end` with session totals syncs
122
+ Compared with the old per-event sync model, one active agent turn usually produces **1–2 HTTP requests** instead of **10–15+**.
125
123
 
126
- So sync frequency = **how active OpenCode is**, not a fixed cron. A busy session with 10 tool calls and 3 LLM turns can produce 20+ HTTP requests in a few minutes.
124
+ Unlike the VS Code extension (timer every ~2 minutes), OpenCode still syncs in near real time just batched within each active burst.
127
125
 
128
126
  ### What each sync request does
129
127
 
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timefly/opencode-plugin",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "TimeFly telemetry plugin for OpenCode — sessions, tokens, models, and tools",
5
5
  "type": "module",
6
6
  "bin": "./dist/cli.js",
@@ -50,14 +50,14 @@
50
50
  },
51
51
  "license": "MIT",
52
52
  "dependencies": {
53
- "@timefly/ai-sdk": "^0.2.1"
53
+ "@timefly/ai-sdk": "^0.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@opencode-ai/plugin": ">=1.0.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@opencode-ai/plugin": "^1.17.7",
60
- "@timefly/ai-sdk": "0.2.1",
60
+ "@timefly/ai-sdk": "workspace:*",
61
61
  "@types/bun": "^1.3.14",
62
62
  "@types/node": "^22.15.21",
63
63
  "typescript": "^5.9.3"