pi-requesty-discover 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +95 -0
  2. package/package.json +12 -3
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # pi-requesty-discover
2
+
3
+ This extension helps you discover currently available models in requesty.ai for your Pi Coding Agent.
4
+
5
+ This is a fork of [pi-requesty](https://github.com/requestyai/pi-requesty) with additional features:
6
+
7
+ * Use `REQUESTY_API_KEY` from the environment
8
+ * Health-check available models and write a log about them
9
+ * Provide a dry-run mode that does not change anything
10
+
11
+ ## When and why use it
12
+
13
+ Use this extension if
14
+
15
+ * you are on Requesty.ai
16
+ * you are limited to certain models by a company policy (for instance, for data residency/protection reasons)
17
+ * you don’t want to handcraft your own curated list of models constantly
18
+ * you want to health check the list to complain about non-working models via a dry-run
19
+
20
+ ## Recommended Installation from GitHub repo
21
+
22
+ ```bash
23
+ pi install git:github.com/enolive/pi-requesty-discover
24
+ ```
25
+
26
+ ## Install locally
27
+
28
+ Check out the code from the official code repository `https://github.com/enolive/pi-requesty-discover`, and then:
29
+
30
+ ```bash
31
+ pi install ./pi-requesty-discover
32
+ ```
33
+
34
+ To run once without installing:
35
+
36
+ ```bash
37
+ pi -e ./pi-requesty-discover
38
+ ```
39
+
40
+ ## Configuration
41
+
42
+ The extension reads the `requesty-export` provider from `~/.pi/agent/models.json`.
43
+ You can override the provider id with the `REQUESTY_PROVIDER_ID` variable.
44
+
45
+ Example:
46
+
47
+ ```json
48
+ {
49
+ "providers": {
50
+ "requesty-export": {
51
+ "name": "Requesty",
52
+ "baseUrl": "https://router.requesty.ai/v1",
53
+ "apiKey": "rqsty-sk-...",
54
+ "api": "openai-completions",
55
+ "models": []
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ **❗ IMPORTANT**\
62
+ The `apiKey` from `models.json` is not used by this extension.
63
+ It may contain Pi-specific environment-variable substitution that the extension cannot reliably resolve.
64
+ Set `REQUESTY_API_KEY` instead. This variable is required.
65
+
66
+ **❗ IMPORTANT**\
67
+ Health checks are designed to use only a few tokens, but they still make real Requesty API calls and may consume credits.
68
+
69
+ On startup, the extension fetches `<baseUrl>/models` using `REQUESTY_API_KEY` as the bearer token and registers discovered and healthy models with Pi.
70
+
71
+ ### Environment variables
72
+
73
+ | Name | Required | Type | Default | Meaning |
74
+ | --- | --- | --- | --- | --- |
75
+ | `REQUESTY_API_KEY` | yes | `string` | | Requesty API key used for model discovery and health checks. |
76
+ | `REQUESTY_PROVIDER_ID` | no | `string` | `requesty-export` | The id of the provider. |
77
+ | `REQUESTY_HEALTH_CHECK_MODE` | no | `off`, `basic`, `full` | `full` | The health-check mode. |
78
+ | `PI_CODING_AGENT_DIR` | no | `string` | `~/.pi/agent` | pi configuration directory |
79
+
80
+ ## Command
81
+
82
+ Inside Pi:
83
+
84
+ ```text
85
+ /requesty-discover
86
+ ```
87
+
88
+ The command fetches Requesty models using `~/.pi/agent/models.json` and writes the discovered model IDs back to the same file.
89
+ Run `/reload` after syncing.
90
+
91
+ ```text
92
+ /requesty-discover --dry-run
93
+ ```
94
+
95
+ This will not overwrite the `models.json` file, but will do everything else, including the health checks.
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "pi-requesty-discover",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Discover available Requesty models for the Pi Coding Agent",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/enolive/pi-requesty-discover.git"
8
+ },
9
+ "homepage": "https://github.com/enolive/pi-requesty-discover",
10
+ "bugs": {
11
+ "url": "https://github.com/enolive/pi-requesty-discover/issues"
12
+ },
5
13
  "type": "module",
6
14
  "main": "src/index.ts",
7
15
  "keywords": [
@@ -24,7 +32,8 @@
24
32
  "test:unit": "vitest run src",
25
33
  "test:unit:coverage": "vitest run src --coverage",
26
34
  "test:integration": "vitest run test/integration.test.ts",
27
- "test:watch": "vitest"
35
+ "test:watch": "vitest",
36
+ "prepack": "downdoc README.adoc"
28
37
  },
29
38
  "license": "MIT",
30
39
  "peerDependencies": {
@@ -35,12 +44,12 @@
35
44
  "./index.ts"
36
45
  ]
37
46
  },
38
-
39
47
  "devDependencies": {
40
48
  "@eslint/js": "^10.0.1",
41
49
  "@types/node": "^26.1.0",
42
50
  "@vitest/coverage-v8": "^4.1.9",
43
51
  "agnix": "^0.37.0",
52
+ "downdoc": "^1.1.0-stable",
44
53
  "eslint": "^10.6.0",
45
54
  "globals": "^17.7.0",
46
55
  "jiti": "^2.7.0",