@llmnative/runner 0.0.0-stage → 1.0.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/LICENSE +201 -0
- package/README.md +89 -2
- package/bin/runner.mjs +88 -0
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +183 -0
- package/dist/client.mjs.map +1 -0
- package/dist/setup.js +3 -0
- package/dist/setup.js.map +1 -0
- package/dist/setup.mjs +84 -0
- package/dist/setup.mjs.map +1 -0
- package/dist/steps.js +2 -0
- package/dist/steps.js.map +1 -0
- package/dist/steps.mjs +98 -0
- package/dist/steps.mjs.map +1 -0
- package/dist/types/client/index.d.ts +249 -0
- package/dist/types/setup/index.d.ts +50 -0
- package/dist/types/setup/steps.d.ts +68 -0
- package/dist/types/ui/InstallGuide.d.ts +18 -0
- package/dist/types/ui/RunnerAccounts.d.ts +13 -0
- package/dist/types/ui/RunnerConsole.d.ts +10 -0
- package/dist/types/ui/RunnersSettings.d.ts +64 -0
- package/dist/types/ui/index.d.ts +5 -0
- package/dist/types/ui/texts.d.ts +348 -0
- package/dist/ui.js +4 -0
- package/dist/ui.js.map +1 -0
- package/dist/ui.mjs +1369 -0
- package/dist/ui.mjs.map +1 -0
- package/install/compose.yaml +33 -0
- package/install/coolify.yaml +16 -0
- package/install/install.sh +161 -0
- package/llms.txt +17 -0
- package/openapi/v1.yaml +188 -0
- package/package.json +100 -4
package/openapi/v1.yaml
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: LLMNative Runner API
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: |
|
|
6
|
+
Claude Code and opencode on your own VPS, for many tenants, with accounts per person.
|
|
7
|
+
Every route but /health and /v1/pair takes `Authorization: Bearer <key>`:
|
|
8
|
+
the admin token of the machine, a platform key (`rk_platform_…`, from pairing) or a project key of a tenant (`rk_…`).
|
|
9
|
+
A platform key (or the admin token) names the tenant with `X-Runner-Tenant`. The person a request is for is
|
|
10
|
+
`X-Runner-User` (with the permission `act-as-user` for a project key). Errors are `{ "error": "<code>" }`.
|
|
11
|
+
servers:
|
|
12
|
+
- url: https://runner.example.com
|
|
13
|
+
components:
|
|
14
|
+
securitySchemes:
|
|
15
|
+
bearer: { type: http, scheme: bearer }
|
|
16
|
+
parameters:
|
|
17
|
+
tenant: { name: X-Runner-Tenant, in: header, required: false, schema: { type: string, pattern: '^[a-z0-9][a-z0-9-]{0,62}$' } }
|
|
18
|
+
user: { name: X-Runner-User, in: header, required: false, schema: { type: string, pattern: '^[A-Za-z0-9_.@-]{1,128}$' } }
|
|
19
|
+
schemas:
|
|
20
|
+
Error:
|
|
21
|
+
type: object
|
|
22
|
+
properties:
|
|
23
|
+
error: { type: string, examples: [bad token, expired, forbidden, no-tenant, no-provider, no-credit, busy, failed, timeout] }
|
|
24
|
+
until: { type: string, format: date-time, description: 'For no-credit: when an account may have credit again.' }
|
|
25
|
+
required: [error]
|
|
26
|
+
Account:
|
|
27
|
+
type: object
|
|
28
|
+
properties:
|
|
29
|
+
provider: { type: string, enum: [claude-code, opencode-go, opencode] }
|
|
30
|
+
id: { type: string }
|
|
31
|
+
label: { type: string }
|
|
32
|
+
at: { type: string, format: date-time }
|
|
33
|
+
scope: { type: string, enum: [user, tenant] }
|
|
34
|
+
noCreditUntil: { type: string, format: date-time }
|
|
35
|
+
required: [provider, id, at, scope]
|
|
36
|
+
Tenant:
|
|
37
|
+
type: object
|
|
38
|
+
properties: { id: { type: string }, name: { type: string }, createdAt: { type: string, format: date-time }, usersWithAccounts: { type: integer } }
|
|
39
|
+
Key:
|
|
40
|
+
type: object
|
|
41
|
+
properties:
|
|
42
|
+
id: { type: string }
|
|
43
|
+
kind: { type: string, enum: [platform, project] }
|
|
44
|
+
tenant: { type: string }
|
|
45
|
+
name: { type: string }
|
|
46
|
+
permissions: { type: array, items: { type: string, enum: [complete, chat, 'chat:tools', accounts, 'accounts:tenant', act-as-user, keys] } }
|
|
47
|
+
createdAt: { type: string, format: date-time }
|
|
48
|
+
expiresAt: { type: [string, 'null'], format: date-time }
|
|
49
|
+
ChatEvent:
|
|
50
|
+
description: One line of the NDJSON reply of a chat.
|
|
51
|
+
oneOf:
|
|
52
|
+
- { type: object, properties: { type: { const: text }, text: { type: string } } }
|
|
53
|
+
- { type: object, properties: { type: { const: reasoning }, text: { type: string } } }
|
|
54
|
+
- { type: object, properties: { type: { const: step }, id: { type: string }, label: { type: string }, status: { enum: [running, done] } } }
|
|
55
|
+
- { type: object, properties: { type: { const: tool-call }, id: { type: string }, name: { type: string }, input: { type: object } } }
|
|
56
|
+
- { type: object, properties: { type: { const: done } } }
|
|
57
|
+
- { type: object, properties: { type: { const: error }, message: { type: string, description: 'no-credit:<date> when every account ran out' } } }
|
|
58
|
+
- { type: object, properties: { type: { const: ping } }, description: every 15 seconds while the harness works }
|
|
59
|
+
security:
|
|
60
|
+
- bearer: []
|
|
61
|
+
paths:
|
|
62
|
+
/health:
|
|
63
|
+
get:
|
|
64
|
+
security: []
|
|
65
|
+
summary: Alive, version, how busy (numbers only)
|
|
66
|
+
responses: { '200': { description: OK } }
|
|
67
|
+
/v1/pair:
|
|
68
|
+
post:
|
|
69
|
+
security: []
|
|
70
|
+
summary: A pairing code (printed by the installer) gives a platform key, shown once
|
|
71
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { code: { type: string }, name: { type: string } }, required: [code] } } } }
|
|
72
|
+
responses:
|
|
73
|
+
'200': { description: The key, content: { application/json: { schema: { type: object, properties: { key: { type: string }, record: { $ref: '#/components/schemas/Key' }, version: { type: string } } } } } }
|
|
74
|
+
'401': { description: bad code }
|
|
75
|
+
'429': { description: locked after too many wrong codes }
|
|
76
|
+
/v1/admin/pairing:
|
|
77
|
+
post:
|
|
78
|
+
summary: (admin token) A new pairing code, valid 15 minutes and once
|
|
79
|
+
responses: { '201': { description: '{ code, expiresAt }' } }
|
|
80
|
+
/v1/platform/status:
|
|
81
|
+
get:
|
|
82
|
+
summary: (platform) Version, load, machine, tenants
|
|
83
|
+
responses: { '200': { description: OK } }
|
|
84
|
+
/v1/platform/tenants:
|
|
85
|
+
get:
|
|
86
|
+
summary: (platform) The tenants
|
|
87
|
+
responses: { '200': { description: '{ tenants: Tenant[] }' } }
|
|
88
|
+
post:
|
|
89
|
+
summary: (platform) A tenant, with its first project key unless key is false
|
|
90
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { id: { type: string }, name: { type: string }, key: { type: boolean }, keyPermissions: { type: array, items: { type: string } } }, required: [id] } } } }
|
|
91
|
+
responses: { '201': { description: '{ tenant, key?, keyRecord? }' }, '409': { description: exists } }
|
|
92
|
+
/v1/platform/tenants/{tenant}:
|
|
93
|
+
delete:
|
|
94
|
+
summary: (platform) Removes a tenant, its keys and chats
|
|
95
|
+
parameters: [{ name: tenant, in: path, required: true, schema: { type: string } }]
|
|
96
|
+
responses: { '200': { description: '{ removed: true }' } }
|
|
97
|
+
/v1/platform/tenants/{tenant}/keys:
|
|
98
|
+
get:
|
|
99
|
+
summary: (platform) The project keys of a tenant
|
|
100
|
+
parameters: [{ name: tenant, in: path, required: true, schema: { type: string } }]
|
|
101
|
+
responses: { '200': { description: '{ keys: Key[] }' } }
|
|
102
|
+
post:
|
|
103
|
+
summary: (platform) A project key, shown once
|
|
104
|
+
parameters: [{ name: tenant, in: path, required: true, schema: { type: string } }]
|
|
105
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { name: { type: string }, permissions: { type: array, items: { type: string } }, expiresAt: { type: [string, 'null'] } } } } } }
|
|
106
|
+
responses: { '201': { description: '{ key, record }' } }
|
|
107
|
+
/v1/platform/tenants/{tenant}/keys/{key}:
|
|
108
|
+
delete:
|
|
109
|
+
summary: (platform) Revokes a project key
|
|
110
|
+
parameters: [{ name: tenant, in: path, required: true, schema: { type: string } }, { name: key, in: path, required: true, schema: { type: string } }]
|
|
111
|
+
responses: { '200': { description: '{ removed: true }' } }
|
|
112
|
+
/v1/info:
|
|
113
|
+
get:
|
|
114
|
+
summary: What the runner offers, and the permissions of the key
|
|
115
|
+
responses: { '200': { description: OK } }
|
|
116
|
+
/v1/accounts:
|
|
117
|
+
get:
|
|
118
|
+
summary: The accounts of the person (accounts), or of the tenant without a person (accounts:tenant)
|
|
119
|
+
parameters: [{ $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
120
|
+
responses: { '200': { description: '{ scope, accounts: Account[] }' } }
|
|
121
|
+
/v1/accounts/claude-code/login:
|
|
122
|
+
post:
|
|
123
|
+
summary: Starts the sign-in of a Claude subscription; returns the page of Anthropic
|
|
124
|
+
parameters: [{ $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
125
|
+
responses: { '200': { description: '{ url }' }, '409': { description: 'busy | no-link' } }
|
|
126
|
+
/v1/accounts/claude-code/login/code:
|
|
127
|
+
post:
|
|
128
|
+
summary: The code Anthropic showed; the token stays on the runner
|
|
129
|
+
parameters: [{ $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
130
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { code: { type: string }, label: { type: string } }, required: [code] } } } }
|
|
131
|
+
responses: { '200': { description: '{ connected, account }' }, '409': { description: 'refused | no-session | no-token' } }
|
|
132
|
+
/v1/accounts/{provider}:
|
|
133
|
+
post:
|
|
134
|
+
summary: A key (opencode-go, opencode), or a token made with claude setup-token (claude-code)
|
|
135
|
+
parameters: [{ name: provider, in: path, required: true, schema: { enum: [claude-code, opencode-go, opencode] } }, { $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
136
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { key: { type: string }, token: { type: string }, label: { type: string } } } } } }
|
|
137
|
+
responses: { '201': { description: '{ account }' } }
|
|
138
|
+
/v1/accounts/{provider}/{id}:
|
|
139
|
+
delete:
|
|
140
|
+
summary: Disconnects an account (its secret deleted)
|
|
141
|
+
parameters: [{ name: provider, in: path, required: true, schema: { type: string } }, { name: id, in: path, required: true, schema: { type: string } }]
|
|
142
|
+
responses: { '200': { description: '{ removed: true }' } }
|
|
143
|
+
/v1/accounts/order:
|
|
144
|
+
put:
|
|
145
|
+
summary: The order of the accounts of a provider
|
|
146
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { provider: { type: string }, ids: { type: array, items: { type: string } } } } } } }
|
|
147
|
+
responses: { '200': { description: '{ accounts }' } }
|
|
148
|
+
/v1/models:
|
|
149
|
+
get:
|
|
150
|
+
summary: What can run now for the person (their accounts, then the tenant's)
|
|
151
|
+
parameters: [{ $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
152
|
+
responses: { '200': { description: '{ providers: [{ id, models, accounts, available, yours, tenant }] }' } }
|
|
153
|
+
/v1/complete:
|
|
154
|
+
post:
|
|
155
|
+
summary: (complete) One answer, no tools
|
|
156
|
+
parameters: [{ $ref: '#/components/parameters/tenant' }, { $ref: '#/components/parameters/user' }]
|
|
157
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { provider: { enum: [claude-code, opencode-go] }, model: { type: string }, prompt: { type: string, maxLength: 200000 }, effort: { enum: [low, medium, high, xhigh, max] } }, required: [provider, model, prompt] } } } }
|
|
158
|
+
responses:
|
|
159
|
+
'200': { description: '{ text, usage? }' }
|
|
160
|
+
'409': { description: 'no-provider | no-credit (with until)', content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } } }
|
|
161
|
+
'429': { description: busy }
|
|
162
|
+
/v1/chats:
|
|
163
|
+
post:
|
|
164
|
+
summary: (chat) A chat of the person; tools need chat:tools
|
|
165
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { id: { type: string, pattern: '^[a-f0-9]{8}$' }, tools: { type: array } }, required: [id] } } } }
|
|
166
|
+
responses: { '201': { description: '{ id }' }, '429': { description: busy } }
|
|
167
|
+
/v1/chats/{id}/messages:
|
|
168
|
+
post:
|
|
169
|
+
summary: (chat) A message; the reply as NDJSON lines (ChatEvent)
|
|
170
|
+
parameters: [{ name: id, in: path, required: true, schema: { type: string } }]
|
|
171
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { text: { type: string }, model: { type: object, properties: { provider: { type: string }, model: { type: string }, variant: { type: string }, effort: { type: string } } }, attachments: { type: array } }, required: [text, model] } } } }
|
|
172
|
+
responses: { '200': { description: NDJSON, content: { application/x-ndjson: { schema: { $ref: '#/components/schemas/ChatEvent' } } } } }
|
|
173
|
+
/v1/chats/{id}/calls/{call}:
|
|
174
|
+
post:
|
|
175
|
+
summary: (chat) What the client gave for a call of one of its tools
|
|
176
|
+
parameters: [{ name: id, in: path, required: true, schema: { type: string } }, { name: call, in: path, required: true, schema: { type: string } }]
|
|
177
|
+
requestBody: { content: { application/json: { schema: { type: object, properties: { result: {}, isError: { type: boolean } } } } } }
|
|
178
|
+
responses: { '200': { description: '{ answered }' } }
|
|
179
|
+
/v1/chats/{id}/stop:
|
|
180
|
+
post:
|
|
181
|
+
summary: (chat) Stops the reply being written
|
|
182
|
+
parameters: [{ name: id, in: path, required: true, schema: { type: string } }]
|
|
183
|
+
responses: { '200': { description: '{ stopped }' } }
|
|
184
|
+
/v1/chats/{id}:
|
|
185
|
+
delete:
|
|
186
|
+
summary: (chat) Closes a chat (its container removed)
|
|
187
|
+
parameters: [{ name: id, in: path, required: true, schema: { type: string } }]
|
|
188
|
+
responses: { '200': { description: '{ closed }' } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/runner",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "LLMNative Runner: Claude Code and opencode on your own VPS, for many tenants, with subscriptions per person. Client, management UI and installer of the runner.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./client": {
|
|
8
|
+
"types": "./dist/types/client/index.d.ts",
|
|
9
|
+
"import": "./dist/client.mjs",
|
|
10
|
+
"require": "./dist/client.js"
|
|
11
|
+
},
|
|
12
|
+
"./ui": {
|
|
13
|
+
"types": "./dist/types/ui/index.d.ts",
|
|
14
|
+
"import": "./dist/ui.mjs",
|
|
15
|
+
"require": "./dist/ui.js"
|
|
16
|
+
},
|
|
17
|
+
"./setup": {
|
|
18
|
+
"types": "./dist/types/setup/index.d.ts",
|
|
19
|
+
"import": "./dist/setup.mjs",
|
|
20
|
+
"require": "./dist/setup.js"
|
|
21
|
+
},
|
|
22
|
+
"./steps": {
|
|
23
|
+
"types": "./dist/types/setup/steps.d.ts",
|
|
24
|
+
"import": "./dist/steps.mjs",
|
|
25
|
+
"require": "./dist/steps.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"llmnative-runner": "bin/runner.mjs"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/*.mjs",
|
|
33
|
+
"dist/*.js",
|
|
34
|
+
"dist/*.map",
|
|
35
|
+
"dist/types",
|
|
36
|
+
"bin",
|
|
37
|
+
"install",
|
|
38
|
+
"openapi",
|
|
39
|
+
"llms.txt"
|
|
40
|
+
],
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
44
|
+
"build:console": "vite build -c vite.console.config.mts",
|
|
45
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.server.json",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:watch": "vitest",
|
|
48
|
+
"console:dev": "vite -c vite.console.config.mts",
|
|
49
|
+
"prepublishOnly": "npm run build"
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/sherpadvisorylab/llmnative-runner.git"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/sherpadvisorylab/llmnative-runner/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/sherpadvisorylab/llmnative-runner#readme",
|
|
59
|
+
"keywords": ["llmnative", "runner", "claude-code", "opencode", "vps", "self-hosted", "ai"],
|
|
60
|
+
"author": "wolfgan",
|
|
61
|
+
"license": "Apache-2.0",
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=24.18.0 <25"
|
|
64
|
+
},
|
|
65
|
+
"packageManager": "npm@11.11.0",
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@llmnative/react": "^3.2.0",
|
|
68
|
+
"react": "^19.2.0",
|
|
69
|
+
"react-dom": "^19.2.0"
|
|
70
|
+
},
|
|
71
|
+
"peerDependenciesMeta": {
|
|
72
|
+
"@llmnative/react": { "optional": true },
|
|
73
|
+
"react": { "optional": true },
|
|
74
|
+
"react-dom": { "optional": true }
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"ssh2": "^1.16.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@llmnative/react": "^3.2.0",
|
|
81
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
82
|
+
"@supabase/supabase-js": "^2.119.0",
|
|
83
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
84
|
+
"@testing-library/react": "^16.3.3",
|
|
85
|
+
"@types/node": "^24.0.0",
|
|
86
|
+
"@types/react": "^19.3.0",
|
|
87
|
+
"@types/react-dom": "^19.3.0",
|
|
88
|
+
"@types/ssh2": "^1.15.0",
|
|
89
|
+
"firebase": "^12.19.0",
|
|
90
|
+
"happy-dom": "^20.14.5",
|
|
91
|
+
"lucide-react": "^1.52.0",
|
|
92
|
+
"react": "^19.3.0",
|
|
93
|
+
"react-dom": "^19.3.0",
|
|
94
|
+
"react-router-dom": "^7.18.4",
|
|
95
|
+
"typescript": "^7.0.2",
|
|
96
|
+
"vite": "^8.3.2",
|
|
97
|
+
"vitest": "^5.0.3"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
}
|
|
102
|
+
}
|