ftown-bridge 0.30.0 → 0.30.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.
@@ -26,7 +26,8 @@ not on PATH, use `~/.ftown/ftown quota`. `--models` only affects table mode.
26
26
  A first run takes several seconds. It launches hidden local CLIs to read their
27
27
  usage and model lists. Later runs reuse the cache below and are fast. It makes
28
28
  no model turns. The numbers describe the owner's subscription plans (5-hour
29
- and weekly windows), not API spend.
29
+ and weekly windows, plus a monthly window when a provider reports one), not
30
+ API spend.
30
31
 
31
32
  ## Cache
32
33
 
@@ -36,12 +37,11 @@ serves for 5 minutes; a non-`ok` row (including a timed-out fetch) serves
36
37
  for at most 30 seconds, so a failing provider is retried soon without
37
38
  hammering it. One provider's failure never evicts another provider's entry.
38
39
  A cached row keeps its original `observedAt` and reports `source: "cached"`;
39
- table mode shows the age, for example `cached 3m ago`. The JSON shape is
40
- unchanged: no field was added, so read `source` and `observedAt` to tell a
41
- cached row and its age. Concurrent callers share one live fetch through a
42
- lock file next to the cache; a dead lock holder is taken over, never a
43
- deadlock. Use `--fresh` to bypass the cache for every provider, fetch live
44
- and refresh the cached rows.
40
+ table mode shows the age, for example `cached 3m ago`. The cache adds no field
41
+ of its own, so read `source` and `observedAt` to tell a cached row and its age.
42
+ Concurrent callers share one live fetch through a lock file next to the cache;
43
+ a dead lock holder is taken over, never a deadlock. Use `--fresh` to bypass
44
+ the cache for every provider, fetch live and refresh the cached rows.
45
45
 
46
46
  ## Decision procedure
47
47
 
@@ -82,14 +82,14 @@ Each pick carries its provider's `availability`. The same values appear in `rout
82
82
  - `low`: `leftPercent` below 15 in the binding (tightest) window, or `runway`
83
83
  below 0.5 when `runway` is not null. Use only for small tasks, when guidance
84
84
  allows it, or when nothing `available` fits.
85
- - `exhausted`: `leftPercent` 1 or less. Never use it before `resetsAt`.
85
+ - `exhausted`: `leftPercent` 1 or less, or the binding window has `limited: true`. Never use it before `resetsAt`.
86
86
  - `unknown`: no usable numbers. It is not proof of empty or full quota. It ranks
87
87
  below `low` and above `exhausted`; use it as a fallback after `available` and
88
88
  `low`, and say so.
89
89
 
90
90
  If a window resets within 10 minutes it is reported as `available` with `leftPercent`
91
- 100 and `runway` null, even if `usedPercent` was high. `routing[]` is ordered best
92
- first as available, then low, then unknown, then exhausted.
91
+ 100 and `runway` null, even if `usedPercent` was high or `limited` is true. `routing[]`
92
+ is ordered best first as available, then low, then unknown, then exhausted.
93
93
 
94
94
  `leftPercent` is percent left in the binding (tightest) window. `windows[].usedPercent`
95
95
  in `providers` is percent used. Do not mix them up.
@@ -132,10 +132,14 @@ the harness documents it. Omit `--model` to take the harness default.
132
132
  `error`): read its `message`. Its routing is `unknown`. For `auth`, tell the
133
133
  user what to fix. A `models` entry with status other than `ok` has an empty
134
134
  `models` list, so its picks are `checked: false`.
135
- - opencode may expose no plan usage at all, so when it reports no windows its
136
- availability will be `unknown`. That is expected when it happens. Judge it by
137
- `pricing` (`free` models are safe to use) and by the owner's guidance, not by
138
- quota.
135
+ - opencode Go usage is experimental. It comes from the CLI's undocumented local
136
+ route `GET /api/experimental/usage/limits`. `rolling` is the short window
137
+ (`five_hour`), `weekly` is `weekly`, and `monthly` is `monthly`. `limited: true`
138
+ makes that window `exhausted` until it resets. No `go` block means there is no
139
+ Go subscription (`no_data`, routing `unknown`), not an error. A missing route,
140
+ a non-JSON body, or an unexpected shape is an error that names the opencode
141
+ version. Console budgets are not mapped. When usage is `unknown`, judge opencode
142
+ by `pricing` (`free` models are safe to use) and by the owner's guidance.
139
143
 
140
144
  ## JSON field reference
141
145
 
@@ -143,7 +147,7 @@ the harness documents it. Omit `--model` to take the harness default.
143
147
  |---|---|
144
148
  | `generatedAt` | ISO time of the report |
145
149
  | `providers[]` | raw readings: `provider`, `status`, `plan`, `windows[]`, `source`, `observedAt`, `message`, optional `scopedLimits[]` |
146
- | `providers[].windows[]` | `kind` (`five_hour`/`weekly`), `usedPercent` (used, may be null), `resetsAt`, `windowMinutes`, `note` |
150
+ | `providers[].windows[]` | `kind` (`five_hour`/`weekly`/`monthly`), `usedPercent` (used, may be null), `resetsAt`, `windowMinutes`, `note`, optional `limited` |
147
151
  | `scopedLimits[]` | partial limit: `scope` (e.g. a model family), `kind`, `usedPercent`, `resetsAt` |
148
152
  | `routing[]` | per provider, best first: `provider`, `availability`, `leftPercent`, `bindingWindow`, `resetsAt`, `resetsInMinutes`, `runway` (1 = on pace, >1 spare, <1 will run out early, null when length or reset unknown), `reason` |
149
153
  | `models[]` | per provider: `provider`, `status` (`ok`/`unavailable`/`error`; empty `models` unless `ok`), `models[]`, `source` (`live`/`cached`), `observedAt`, `message`, `modelFlag`, `effortFlag` |
@@ -539,8 +539,11 @@ Run `npx ftown@<version> setup`, using the
539
539
  version in the bridge readiness hint. This works before the installed alias
540
540
  exists and installs the `ftown` command, compatible
541
541
  launchers, `~/.ftown/notify.sh`, and updates the unified skill
542
- under `~/.ftown/skills/ftown/` (linked into ~/.agents/skills and
543
- ~/.claude/skills).
542
+ under `~/.ftown/skills/ftown/` (linked into ~/.agents/skills,
543
+ ~/.claude/skills, and the OpenCode skills directory:
544
+ `$OPENCODE_CONFIG_DIR/skills`, otherwise `$XDG_CONFIG_HOME/opencode/skills`
545
+ or `~/.config/opencode/skills`). `ftown setup --repair` restores a missing
546
+ OpenCode link. Ordinary starts only check it.
544
547
 
545
548
  An unpaired `ftown start` prints a `/pair` link and a 6-digit code: open the link on a device with the
546
549
  account passkey and type the code. A computer removed from the account resets its own identity, keeps its