pi-requesty-discover 1.0.5 → 1.0.6
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/CONTRIBUTING.adoc +35 -0
- package/package.json +6 -5
- package/src/env.ts +2 -8
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
= Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing.
|
|
4
|
+
|
|
5
|
+
== Useful scripts
|
|
6
|
+
|
|
7
|
+
These will also be run in the CI/CD pipeline.
|
|
8
|
+
Make sure to run them beforehand to get faster feedback
|
|
9
|
+
about the overall quality.
|
|
10
|
+
|
|
11
|
+
[source,bash]
|
|
12
|
+
----
|
|
13
|
+
# install all dependencies
|
|
14
|
+
npm install
|
|
15
|
+
|
|
16
|
+
# linting and format checking all-in-one
|
|
17
|
+
npm run check
|
|
18
|
+
|
|
19
|
+
# run all the tests
|
|
20
|
+
npm test
|
|
21
|
+
----
|
|
22
|
+
|
|
23
|
+
Use `npm run format` to fix formatting.
|
|
24
|
+
|
|
25
|
+
Refer to additional scripts in link:package.json[].
|
|
26
|
+
|
|
27
|
+
Please keep changes focused and include tests or docs when behavior changes.
|
|
28
|
+
|
|
29
|
+
Notes:
|
|
30
|
+
|
|
31
|
+
* The package is loaded directly from TypeScript; do not add a build step casually.
|
|
32
|
+
* Keep implementation in `src/`; root `index.ts` is just the package entrypoint.
|
|
33
|
+
* Edit `README.adoc` if necessary.
|
|
34
|
+
* See `AGENTS.md` for detailed repository conventions.
|
|
35
|
+
* I am pretty good at identifying AI slop 😁.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-requesty-discover",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Discover available Requesty models for the Pi Coding Agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,12 +22,13 @@
|
|
|
22
22
|
"models"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"agent-lint
|
|
26
|
-
"
|
|
27
|
-
"format": "prettier --
|
|
25
|
+
"check": "npm run agent-lint && npm run format:check && npm run typecheck && npm run lint",
|
|
26
|
+
"agent-lint": "agnix . -v --strict",
|
|
27
|
+
"format:check": "prettier --check .",
|
|
28
|
+
"format": "prettier --write .",
|
|
28
29
|
"typecheck": "tsc --noEmit",
|
|
29
30
|
"lint": "eslint .",
|
|
30
|
-
"release": "npm version patch && git push --follow-tags",
|
|
31
|
+
"release": "read -p 'Release a new version? [y/N] ' ok && [ \"$ok\" = \"y\" ] && npm version patch && git push --follow-tags",
|
|
31
32
|
"test": "vitest run",
|
|
32
33
|
"test:unit": "vitest run src",
|
|
33
34
|
"test:unit:coverage": "vitest run src --coverage",
|
package/src/env.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import os from 'node:os'
|
|
2
1
|
import path from 'node:path'
|
|
3
2
|
import process from 'node:process'
|
|
4
3
|
import { prettifyError, z } from 'zod'
|
|
4
|
+
import { getAgentDir } from '@earendil-works/pi-coding-agent'
|
|
5
5
|
|
|
6
6
|
const HealthCheckModeSchema = z.enum(['off', 'basic', 'full']).default('full')
|
|
7
7
|
|
|
@@ -15,10 +15,6 @@ export type Env = {
|
|
|
15
15
|
|
|
16
16
|
export function getEnv(): Env {
|
|
17
17
|
const envVars = process.env
|
|
18
|
-
const configuredAgentPath = envVars.PI_CODING_AGENT_DIR
|
|
19
|
-
const defaultAgentPath = path.join(os.homedir(), '.pi', 'agent')
|
|
20
|
-
const agentPath = configuredAgentPath || defaultAgentPath
|
|
21
|
-
|
|
22
18
|
const result = HealthCheckModeSchema.safeParse(envVars.REQUESTY_HEALTH_CHECK_MODE)
|
|
23
19
|
if (!result.success) {
|
|
24
20
|
throw new Error(prettifyError(result.error))
|
|
@@ -28,7 +24,7 @@ export function getEnv(): Env {
|
|
|
28
24
|
if (!apiKey) {
|
|
29
25
|
throw new Error(`apiKey must be set via REQUESTY_API_KEY env var`)
|
|
30
26
|
}
|
|
31
|
-
|
|
27
|
+
const agentPath = getAgentDir()
|
|
32
28
|
return {
|
|
33
29
|
models_json_path: path.join(agentPath, 'models.json'),
|
|
34
30
|
health_check_log_path: path.join(agentPath, 'requesty-health-check.log'),
|
|
@@ -37,5 +33,3 @@ export function getEnv(): Env {
|
|
|
37
33
|
health_check_mode: result.data,
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
export default getEnv
|