pi-gigachat-models 0.2.1 → 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anton Kholodkov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,7 +6,7 @@ GigaChat provider (models and chat completions) for [pi](https://pi.dev). The pa
6
6
  Authorization-key login (`/login gigachat`), live model discovery, SSE token
7
7
  streaming and function calling.
8
8
 
9
- **Published to npm:** `npm install pi-gigachat-models`
9
+ **Install in Pi:** `pi install npm:pi-gigachat-models`
10
10
 
11
11
  The wire protocol follows the public GigaChat OpenAPI description:
12
12
  <https://developers.sber.ru/docs/files/openapi/gigachat/api.yml>
@@ -14,13 +14,12 @@ The wire protocol follows the public GigaChat OpenAPI description:
14
14
  ## Install
15
15
 
16
16
  ```bash
17
- # Install from npm (published)
18
- npm install pi-gigachat-models
19
-
20
- # Or with pi
21
17
  pi install npm:pi-gigachat-models
22
18
  ```
23
19
 
20
+ Requires Node.js >=22.19.0 and Pi. TypeScript sources are loaded directly by Pi;
21
+ no build step is required.
22
+
24
23
  ## Sign in
25
24
 
26
25
  ```bash
@@ -173,6 +172,26 @@ Layout:
173
172
  | `src/stream.ts` | `streamSimple` implementation and event emission |
174
173
  | `certs/` | Bundled Russian Trusted Root CA and Sub CA (public certificates) |
175
174
 
175
+ ## Publishing
176
+
177
+ Run these commands from the repository root:
178
+
179
+ ```bash
180
+ npm login --registry=https://registry.npmjs.org/
181
+ npm run prepublishOnly # typecheck, lint and tests
182
+ npm pack --dry-run # inspect files before publishing
183
+ npm publish # repeats checks via prepublishOnly
184
+ ```
185
+
186
+ The published package includes `src/`, `certs/`, `README.md` and `LICENSE`.
187
+ Pi loads `src/index.ts` through the `pi.extensions` manifest; no `dist/` is
188
+ needed. The `pi-package` keyword enables discovery in the
189
+ [Pi package catalog](https://pi.dev/packages) after npm indexing.
190
+
191
+ For subsequent releases, increment `version` in `package.json` before publishing;
192
+ npm does not allow overwriting an existing version. Do not include credentials
193
+ or private keys in the package. The bundled CA certificates are public.
194
+
176
195
  ## Troubleshooting
177
196
 
178
197
  - **`401 Unauthorized` during login** — the value is probably the client secret
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-gigachat-models",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "GigaChat provider for pi: Authorization-key login, streaming chat completions and function calling",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,7 +24,8 @@
24
24
  "typecheck": "tsc -p tsconfig.json",
25
25
  "test": "node --test test/*.test.ts",
26
26
  "coverage": "node --experimental-test-coverage --test test/*.test.ts",
27
- "lint": "eslint src test"
27
+ "lint": "eslint src test",
28
+ "prepublishOnly": "npm run typecheck && npm run lint && npm test"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "@earendil-works/pi-ai": "*",
@@ -42,15 +43,19 @@
42
43
  "dependencies": {
43
44
  "undici": "^8.12.4"
44
45
  },
45
- "main": "eslint.config.js",
46
- "directories": {
47
- "test": "test"
46
+ "main": "./src/index.ts",
47
+ "engines": {
48
+ "node": ">=22.19.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
48
53
  },
49
54
  "repository": {
50
55
  "type": "git",
51
56
  "url": "git+https://github.com/khanton/pi-gigachat-models.git"
52
57
  },
53
- "author": "",
58
+ "author": "Anton Kholodkov <khanton@yandex.ru>",
54
59
  "bugs": {
55
60
  "url": "https://github.com/khanton/pi-gigachat-models/issues"
56
61
  },
package/eslint.config.js DELETED
@@ -1,15 +0,0 @@
1
- import js from "@eslint/js";
2
- import tseslint from "typescript-eslint";
3
-
4
- export default tseslint.config(
5
- { ignores: ["node_modules/**"] },
6
- js.configs.recommended,
7
- ...tseslint.configs.recommended,
8
- {
9
- files: ["src/**/*.ts", "test/**/*.ts"],
10
- rules: {
11
- "no-unused-vars": "off",
12
- "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
13
- },
14
- },
15
- );