@llmnative/runner 0.0.0-stage → 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 (76) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +95 -2
  3. package/bin/runner.mjs +99 -0
  4. package/bin/setup-server.mjs +160 -0
  5. package/bin/ssh-keys.mjs +15 -0
  6. package/dist/client.js +3 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/client.mjs +183 -0
  9. package/dist/client.mjs.map +1 -0
  10. package/dist/setup-app/assets/NetworkCanvasImpl-DIYuzg6x-CVEzQpWc.js +7 -0
  11. package/dist/setup-app/assets/dist-9W_fpPLL.js +11 -0
  12. package/dist/setup-app/assets/index-BAksVWhQ.js +32 -0
  13. package/dist/setup-app/assets/index-CmPc3Q2I.css +2 -0
  14. package/dist/setup-app/assets/index.es-DFOx5a43.js +1 -0
  15. package/dist/setup-app/assets/index.esm-7HxyOcz9.js +9 -0
  16. package/dist/setup-app/assets/index.esm-Bo_uP467.js +1 -0
  17. package/dist/setup-app/assets/index.esm-D6oehhSQ.js +1 -0
  18. package/dist/setup-app/assets/index.esm-D983b7TD.js +1 -0
  19. package/dist/setup-app/assets/index.esm-H_whZvB-.js +4 -0
  20. package/dist/setup-app/assets/index.esm-NAFJB7JL.js +31 -0
  21. package/dist/setup-app/assets/lucide-react-DpJIOtaQ.js +1 -0
  22. package/dist/setup-app/assets/prism-BjaHQ1lq.js +2 -0
  23. package/dist/setup-app/assets/prism-bash-D6zCJ74D.js +1 -0
  24. package/dist/setup-app/assets/prism-c-04YixN25.js +1 -0
  25. package/dist/setup-app/assets/prism-clike-DapgWyxx.js +1 -0
  26. package/dist/setup-app/assets/prism-cpp-C-lJbC-6.js +1 -0
  27. package/dist/setup-app/assets/prism-csharp-XPn2bw0d.js +1 -0
  28. package/dist/setup-app/assets/prism-css-CPgOzxXp.js +1 -0
  29. package/dist/setup-app/assets/prism-docker-DkT6yOFj.js +1 -0
  30. package/dist/setup-app/assets/prism-git-BZB8f0uj.js +1 -0
  31. package/dist/setup-app/assets/prism-go-C_8qAH5n.js +1 -0
  32. package/dist/setup-app/assets/prism-graphql-XjvHrdQl.js +1 -0
  33. package/dist/setup-app/assets/prism-ini-BESK3y0r.js +1 -0
  34. package/dist/setup-app/assets/prism-java-6wtusvIl.js +1 -0
  35. package/dist/setup-app/assets/prism-javascript-BnO-swvr.js +1 -0
  36. package/dist/setup-app/assets/prism-json-Dp_-W-Hv.js +1 -0
  37. package/dist/setup-app/assets/prism-jsx-D-D0NWtC.js +1 -0
  38. package/dist/setup-app/assets/prism-markup-Cp04rIa1.js +1 -0
  39. package/dist/setup-app/assets/prism-php-Co4fM40K.js +1 -0
  40. package/dist/setup-app/assets/prism-powershell-Cvud8pPk.js +1 -0
  41. package/dist/setup-app/assets/prism-python-CfiSVtM6.js +1 -0
  42. package/dist/setup-app/assets/prism-ruby-Cb5nlQRI.js +1 -0
  43. package/dist/setup-app/assets/prism-sql-CYhVDMEE.js +1 -0
  44. package/dist/setup-app/assets/prism-tsx-p6J2Kc_4.js +1 -0
  45. package/dist/setup-app/assets/prism-typescript-BMqONzxf.js +1 -0
  46. package/dist/setup-app/assets/prism-yaml-C0JHu8gr.js +1 -0
  47. package/dist/setup-app/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  48. package/dist/setup-app/assets/style-DLioOiRN.css +1 -0
  49. package/dist/setup-app/index.html +15 -0
  50. package/dist/setup.js +3 -0
  51. package/dist/setup.js.map +1 -0
  52. package/dist/setup.mjs +104 -0
  53. package/dist/setup.mjs.map +1 -0
  54. package/dist/steps.js +2 -0
  55. package/dist/steps.js.map +1 -0
  56. package/dist/steps.mjs +98 -0
  57. package/dist/steps.mjs.map +1 -0
  58. package/dist/types/client/index.d.ts +249 -0
  59. package/dist/types/setup/index.d.ts +58 -0
  60. package/dist/types/setup/steps.d.ts +68 -0
  61. package/dist/types/ui/InstallGuide.d.ts +18 -0
  62. package/dist/types/ui/RunnerAccounts.d.ts +13 -0
  63. package/dist/types/ui/RunnerConsole.d.ts +10 -0
  64. package/dist/types/ui/RunnersSettings.d.ts +66 -0
  65. package/dist/types/ui/index.d.ts +5 -0
  66. package/dist/types/ui/texts.d.ts +354 -0
  67. package/dist/ui.js +4 -0
  68. package/dist/ui.js.map +1 -0
  69. package/dist/ui.mjs +1385 -0
  70. package/dist/ui.mjs.map +1 -0
  71. package/install/compose.yaml +50 -0
  72. package/install/coolify.yaml +16 -0
  73. package/install/install.sh +206 -0
  74. package/llms.txt +17 -0
  75. package/openapi/v1.yaml +188 -0
  76. package/package.json +116 -4
@@ -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,118 @@
1
1
  {
2
2
  "name": "@llmnative/runner",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.2",
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
+ "dist/setup-app",
37
+ "bin",
38
+ "install",
39
+ "openapi",
40
+ "llms.txt"
41
+ ],
42
+ "sideEffects": false,
43
+ "scripts": {
44
+ "build": "vite build && vite build -c vite.setup.config.mts && tsc -p tsconfig.build.json",
45
+ "build:console": "vite build -c vite.console.config.mts",
46
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.server.json",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
49
+ "console:dev": "vite -c vite.console.config.mts",
50
+ "prepublishOnly": "npm run build",
51
+ "setup:dev": "vite -c vite.setup.config.mts"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/sherpadvisorylab/llmnative-runner.git"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/sherpadvisorylab/llmnative-runner/issues"
59
+ },
60
+ "homepage": "https://github.com/sherpadvisorylab/llmnative-runner#readme",
61
+ "keywords": [
62
+ "llmnative",
63
+ "runner",
64
+ "claude-code",
65
+ "opencode",
66
+ "vps",
67
+ "self-hosted",
68
+ "ai"
69
+ ],
70
+ "author": "wolfgan",
71
+ "license": "Apache-2.0",
72
+ "engines": {
73
+ "node": ">=24.18.0 <25"
74
+ },
75
+ "packageManager": "npm@11.11.0",
76
+ "peerDependencies": {
77
+ "@llmnative/react": "^3.2.0",
78
+ "react": "^19.2.0",
79
+ "react-dom": "^19.2.0"
80
+ },
81
+ "peerDependenciesMeta": {
82
+ "@llmnative/react": {
83
+ "optional": true
84
+ },
85
+ "react": {
86
+ "optional": true
87
+ },
88
+ "react-dom": {
89
+ "optional": true
90
+ }
91
+ },
92
+ "dependencies": {
93
+ "ssh2": "^1.16.0"
94
+ },
95
+ "devDependencies": {
96
+ "@llmnative/react": "^3.2.0",
97
+ "@phosphor-icons/react": "^2.1.10",
98
+ "@supabase/supabase-js": "^2.119.0",
99
+ "@testing-library/jest-dom": "^7.0.1",
100
+ "@testing-library/react": "^16.3.3",
101
+ "@types/node": "^24.0.0",
102
+ "@types/react": "^19.3.0",
103
+ "@types/react-dom": "^19.3.0",
104
+ "@types/ssh2": "^1.15.0",
105
+ "firebase": "^12.19.0",
106
+ "happy-dom": "^20.14.5",
107
+ "lucide-react": "^1.52.0",
108
+ "react": "^19.3.0",
109
+ "react-dom": "^19.3.0",
110
+ "react-router-dom": "^7.18.4",
111
+ "typescript": "^7.0.2",
112
+ "vite": "^8.3.2",
113
+ "vitest": "^5.0.3"
114
+ },
115
+ "publishConfig": {
116
+ "access": "public"
117
+ }
118
+ }