pi-requesty-discover 1.0.1 → 1.0.3

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