@cesarus777/opencode-cgp 0.1.0 → 0.2.2
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 +7 -3
- package/dist/cli.js +1411 -0
- package/dist/core.js +424 -3
- package/dist/index.js +1087 -29
- package/dist/rpc.js +159 -0
- package/dist/tui.js +653 -82
- package/dist/types/adapter.d.ts +2 -0
- package/dist/types/chartreport.d.ts +14 -0
- package/dist/types/charts.d.ts +54 -0
- package/dist/types/core.d.ts +2 -0
- package/dist/types/family.d.ts +1 -1
- package/dist/types/history.d.ts +59 -0
- package/dist/types/historycharts.d.ts +17 -0
- package/dist/types/historyserver.d.ts +7 -0
- package/dist/types/performance.d.ts +57 -0
- package/dist/types/rpc.d.ts +78 -0
- package/dist/types/snapshot.d.ts +4 -1
- package/dist/types/snapshotserver.d.ts +3 -3
- package/dist/types/tui/chartformat.d.ts +46 -0
- package/dist/types/tui/charts.d.ts +11 -0
- package/dist/types/tui/compactformat.d.ts +3 -2
- package/dist/types/tui/contextchart.d.ts +19 -0
- package/dist/types/tui/format.d.ts +1 -0
- package/dist/types/tui/state.d.ts +1 -0
- package/dist/types/types.d.ts +11 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -41,10 +41,10 @@ Global configuration is `~/.config/opencode/opencode.jsonc` (or the OpenCode con
|
|
|
41
41
|
|
|
42
42
|
Restart/reload OpenCode and look for `context-guard: observe; diagnostics ...`. Observe mode records policy decisions and never requests compaction; OpenCode's own automatic compaction remains active. Inspect diagnostics first, then set `mode` to `enforce` to admit native compaction at runtime step boundaries. The complete [example](examples/opencode.jsonc) includes model, role, and agent policies. **Last matching rule wins**; selectors within a rule are ANDed.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Pin the exact published version in the existing entry's `package` field or use the manager. Version `0.2.2` adds live context-capacity charts, single-metric performance chart navigation, panel padding, and persistent close controls.
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
opencode plugin add @cesarus777/opencode-cgp@0.1
|
|
47
|
+
opencode plugin add @cesarus777/opencode-cgp@0.2.1
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Manage the configured target with the [official V2 CLI](https://dev.opencode.ai/v2/docs/plugins):
|
|
@@ -96,10 +96,14 @@ A provider measurement refers to its **completed request**, not the next assembl
|
|
|
96
96
|
|
|
97
97
|
## Native TUI
|
|
98
98
|
|
|
99
|
-
Open `/context-guard` or **Open Context Guard** in the command palette for current prompt occupancy, effective input capacity, trigger/headroom, measurement freshness, compaction phase and nested agent status. A native sidebar section appears where the host mounts its sidebar; the panel also works on child routes and narrow terminals. Estimates, unknown values, stale measurements and uncertain compaction remain explicit.
|
|
99
|
+
Open `/context-guard` or **Open Context Guard** in the command palette for current prompt occupancy, effective input capacity, trigger/headroom, measurement freshness, compaction phase and nested agent status. A native sidebar section appears where the host mounts its sidebar; the panel also works on child routes and narrow terminals. The main session includes a live context chart scaled to its full effective input capacity, with a horizontal compaction threshold and recent usage samples. Key values stay visible as text. Estimates, unknown values, stale measurements and uncertain compaction remain explicit.
|
|
100
100
|
|
|
101
101
|
The TUI reads bounded snapshots over public OpenCode RPC, including when telemetry is disabled. Remote clients also need a client-side package registration in `cli.json`; see [the example](examples/cli.jsonc) and [controls, installation and bounds](docs/configuration.md#native-context-guard-view). It targets the inspected 2.0.29 API. The actual local host passes wide root, child and narrow grandchild panel checks. Use **Context Guard: open panel** above a child composer, where the host hides its usual prompt and palette shortcut. tmux, Neovim and cross-machine remote validation remain open.
|
|
102
102
|
|
|
103
|
+
Per-session live TPS, average model throughput, average session throughput and observed TTFT appear in the selected session and child rows. Live TPS and TTFT use `~` to mark estimates; completed rates use provider totals. Configurable local history defaults to seven days with a 64 MiB total cap, independently of diagnostic telemetry. See [metric definitions and history exports](docs/configuration.md#live-performance-and-retained-history).
|
|
104
|
+
|
|
105
|
+
Press **c** in the Context Guard panel for retained-history terminal charts. View one metric at a time with **Left / Right**, change the time window with **[ / ]**, and select an agent instance with **Up / Down**. Press **c** to return or **q** to close the panel; controls stay visible below the scrollable content. Generate a self-contained interactive browser report with `bun run charts /absolute/history-directory --output report.html`. It includes filters, UTC timestamp tooltips, request statistics and SVG export. Installed packages expose the same command as `context-guard charts ...` (Bun required). See [chart controls and limits](docs/configuration.md#performance-charts).
|
|
106
|
+
|
|
103
107
|
## Inspect
|
|
104
108
|
|
|
105
109
|
The startup message reports a location-specific JSONL file under `$XDG_STATE_HOME/opencode-context-guard/` (default `~/.local/state/opencode-context-guard/`). A custom absolute `telemetry.path` is supported. Use a distinct file per plugin location/process.
|