pi-cliproxyapi-provider 0.1.0 → 0.2.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 CHANGED
@@ -95,10 +95,12 @@ export CLIPROXYAPI_API_KEY=your-key
95
95
  ## Commands
96
96
 
97
97
  ```text
98
- /cliproxyapi config # interactive setup
99
- /cliproxyapi status # show config, cache ages, and enrichment counts
100
- /cliproxyapi refresh # refresh caches, then run /reload
101
- /cliproxyapi aliases # show unmatched model IDs for metadata aliases
98
+ /cliproxyapi config # interactive setup
99
+ /cliproxyapi status # show snapshots, capabilities, and enrichment counts
100
+ /cliproxyapi refresh # refresh models and metadata, then update pi immediately
101
+ /cliproxyapi refresh models # refresh CLIProxyAPI availability only
102
+ /cliproxyapi refresh metadata # refresh models.dev metadata only
103
+ /cliproxyapi aliases # show unmatched model IDs for metadata aliases
102
104
  ```
103
105
 
104
106
  ## Metadata aliases
@@ -127,20 +129,28 @@ Project config only reads `modelAliases`; other fields are ignored.
127
129
  }
128
130
  ```
129
131
 
130
- ## Caches
132
+ ## Snapshots and startup
131
133
 
132
134
  ```text
133
- CPA /v1/models cache: 1 hour
134
- models.dev cache: 1 day
135
+ CPA /v1/models: local snapshot at startup, then a background refresh
136
+ models.dev metadata: persistent local snapshot, refreshed manually
135
137
  ```
136
138
 
137
- Caches live under:
139
+ Snapshots live under:
138
140
 
139
141
  ```text
140
142
  ~/.cache/pi-cliproxyapi-provider/
141
143
  ```
142
144
 
143
- Startup does not fetch `models.dev`. It uses a fresh local `models.dev` cache when present, otherwise it uses `data/models-dev-fallback.json`. Run `/cliproxyapi refresh` to update both the CPA model cache and the `models.dev` metadata cache.
145
+ Startup registers the provider immediately from the last-known-good local snapshots. It then refreshes CLIProxyAPI availability in the background with a short timeout and updates the provider dynamically if the model list changed. On a first run, Pi registers a placeholder until background discovery succeeds. Startup never fetches `models.dev`; it uses the persistent local metadata snapshot or `data/models-dev-fallback.json` when no snapshot exists.
146
+
147
+ Manual refreshes update the running provider immediately; `/reload` is not required. Failed refreshes retain the last-known-good data independently for each source.
148
+
149
+ A scheduled GitHub Actions workflow checks the bundled fallback catalog daily. When it changes, the workflow validates the package, bumps the patch version, commits the update, and publishes the new version to npm. Maintainers can also update the catalog locally with:
150
+
151
+ ```bash
152
+ npm run update:models-dev
153
+ ```
144
154
 
145
155
  ## Test
146
156
 
@@ -150,4 +160,4 @@ npm test
150
160
 
151
161
  ## Release
152
162
 
153
- Releases are published to npm when a matching `v*` tag is pushed. See [RELEASING.md](RELEASING.md) for npm authentication, first-release steps, versioning, verification, and troubleshooting.
163
+ Releases are published to npm when a matching `v*` tag is pushed. Changed daily models.dev catalogs also produce automatic patch releases. See [RELEASING.md](RELEASING.md) for authentication, versioning, verification, and troubleshooting.