@link-assistant/router 0.0.0-stage → 1.25.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.
Files changed (159) hide show
  1. package/README.md +35 -2
  2. package/catalog.json +68422 -0
  3. package/index.d.ts +5932 -0
  4. package/index.js +224 -0
  5. package/native.d.ts +106 -0
  6. package/package.json +61 -4
  7. package/portable/policy.mjs +117 -0
  8. package/schemas/accounts-list.v1.json +323 -0
  9. package/schemas/accounts-pause.v1.json +97 -0
  10. package/schemas/accounts-policy.v1.json +214 -0
  11. package/schemas/accounts-resume.v1.json +97 -0
  12. package/schemas/auth-claude.v1.json +97 -0
  13. package/schemas/auth-clear.v1.json +97 -0
  14. package/schemas/auth-codex.v1.json +97 -0
  15. package/schemas/auth-gh.v1.json +97 -0
  16. package/schemas/auth-import.v1.json +167 -0
  17. package/schemas/auth-status.v1.json +387 -0
  18. package/schemas/cli-error.v1.json +97 -0
  19. package/schemas/clients-backup-create.v1.json +97 -0
  20. package/schemas/clients-backup-list.v1.json +234 -0
  21. package/schemas/clients-backup-restore.v1.json +97 -0
  22. package/schemas/clients-backup-verify.v1.json +125 -0
  23. package/schemas/clients-doctor.v1.json +249 -0
  24. package/schemas/clients-install.v1.json +164 -0
  25. package/schemas/clients-list.v1.json +194 -0
  26. package/schemas/clients-reinstall.v1.json +164 -0
  27. package/schemas/clients-remove.v1.json +97 -0
  28. package/schemas/clients-repair.v1.json +109 -0
  29. package/schemas/clients-reset.v1.json +113 -0
  30. package/schemas/clients-setup.v1.json +97 -0
  31. package/schemas/clients-show.v1.json +191 -0
  32. package/schemas/clients-update.v1.json +164 -0
  33. package/schemas/configure.v1.json +97 -0
  34. package/schemas/contracts.v1.json +106 -0
  35. package/schemas/data-backup.v1.json +32 -0
  36. package/schemas/deploy.v1.json +546 -0
  37. package/schemas/doctor.v1.json +324 -0
  38. package/schemas/local-deployment.v1.json +364 -0
  39. package/schemas/logs-anomalies.v1.json +112 -0
  40. package/schemas/logs-show.v1.json +127 -0
  41. package/schemas/logs-summary.v1.json +129 -0
  42. package/schemas/model-catalog.v1.json +117 -0
  43. package/schemas/models-explain.v1.json +325 -0
  44. package/schemas/preservation.v1.json +47 -0
  45. package/schemas/providers-add.v1.json +185 -0
  46. package/schemas/providers-import.v1.json +97 -0
  47. package/schemas/providers-list.v1.json +182 -0
  48. package/schemas/providers-remove.v1.json +97 -0
  49. package/schemas/providers-show.v1.json +179 -0
  50. package/schemas/serve.v1.json +97 -0
  51. package/schemas/server-claim.v1.json +97 -0
  52. package/schemas/server-reap.v1.json +97 -0
  53. package/schemas/server-remove.v1.json +97 -0
  54. package/schemas/server-start.v1.json +97 -0
  55. package/schemas/server-status.v1.json +197 -0
  56. package/schemas/server-stop.v1.json +97 -0
  57. package/schemas/server-use.v1.json +97 -0
  58. package/schemas/staging.v1.json +47 -0
  59. package/schemas/tls-ca.v1.json +97 -0
  60. package/schemas/tls-generate.v1.json +97 -0
  61. package/schemas/tokens-expire.v1.json +97 -0
  62. package/schemas/tokens-import.v1.json +192 -0
  63. package/schemas/tokens-issue.v1.json +94 -0
  64. package/schemas/tokens-list.v1.json +272 -0
  65. package/schemas/tokens-recover-admin.v1.json +116 -0
  66. package/schemas/tokens-revoke.v1.json +97 -0
  67. package/schemas/tokens-rotate.v1.json +94 -0
  68. package/schemas/tokens-show.v1.json +269 -0
  69. package/schemas/tunnel-down.v1.json +97 -0
  70. package/schemas/tunnel-status.v1.json +165 -0
  71. package/schemas/tunnel-up.v1.json +97 -0
  72. package/schemas/usage.v1.json +621 -0
  73. package/schemas/verification.v1.json +254 -0
  74. package/schemas/verify.v1.json +338 -0
  75. package/schemas/version.v1.json +103 -0
  76. package/schemas/with.v1.json +105 -0
  77. package/src/accounts.mjs +233 -0
  78. package/src/activitypub.mjs +23 -0
  79. package/src/admin-assets.mjs +16 -0
  80. package/src/admin.mjs +108 -0
  81. package/src/affinities.mjs +180 -0
  82. package/src/affinity-schema-descriptor.mjs +2 -0
  83. package/src/affinity-schema.mjs +185 -0
  84. package/src/assets/admin/assets/app.js +1 -0
  85. package/src/assets/admin/assets/react.js +9 -0
  86. package/src/assets/admin/assets/rolldown-runtime.js +1 -0
  87. package/src/assets/admin/assets/ui-vendor.js +3 -0
  88. package/src/assets/admin/index.html +16 -0
  89. package/src/auth-service.mjs +149 -0
  90. package/src/claude-process-session.mjs +26 -0
  91. package/src/cli-output.mjs +21 -0
  92. package/src/cli.mjs +84 -0
  93. package/src/client-ca.mjs +8 -0
  94. package/src/client-catalog.mjs +52 -0
  95. package/src/client-codex-catalog.mjs +18 -0
  96. package/src/client-configure.mjs +72 -0
  97. package/src/client-files.mjs +82 -0
  98. package/src/client-global-repair.mjs +19 -0
  99. package/src/client-global-state.mjs +19 -0
  100. package/src/client-global.mjs +43 -0
  101. package/src/client-json.mjs +54 -0
  102. package/src/client-launch-plan.mjs +28 -0
  103. package/src/client-launch.mjs +35 -0
  104. package/src/client-persistent.mjs +66 -0
  105. package/src/client-process-profile.mjs +52 -0
  106. package/src/client-process-settings.mjs +36 -0
  107. package/src/client-process.mjs +44 -0
  108. package/src/client-profile-backup.mjs +29 -0
  109. package/src/client-remote-health.mjs +7 -0
  110. package/src/client-remote.mjs +55 -0
  111. package/src/client-run-credential.mjs +38 -0
  112. package/src/client-setup.mjs +97 -0
  113. package/src/client-status.mjs +102 -0
  114. package/src/client-toml-cst.mjs +71 -0
  115. package/src/client-transaction.mjs +48 -0
  116. package/src/codex-login.mjs +121 -0
  117. package/src/codex-loopback-transport.mjs +34 -0
  118. package/src/codex-loopback.mjs +60 -0
  119. package/src/config.mjs +198 -0
  120. package/src/core.mjs +198 -0
  121. package/src/credential-operations.mjs +119 -0
  122. package/src/doublets.mjs +157 -0
  123. package/src/emergency-auth.mjs +91 -0
  124. package/src/file-lock.mjs +107 -0
  125. package/src/gemini-protocol.mjs +133 -0
  126. package/src/geolocation.mjs +46 -0
  127. package/src/git-proxy.mjs +52 -0
  128. package/src/github-proxy.mjs +74 -0
  129. package/src/http-management.mjs +36 -0
  130. package/src/http-route-contract.mjs +479 -0
  131. package/src/index.mjs +4 -0
  132. package/src/local-router-discovery.mjs +31 -0
  133. package/src/managed-server.mjs +411 -0
  134. package/src/management-access.mjs +76 -0
  135. package/src/native-service.mjs +392 -0
  136. package/src/oauth.mjs +547 -0
  137. package/src/operation-input.mjs +20 -0
  138. package/src/operations.mjs +378 -0
  139. package/src/protocols.mjs +229 -0
  140. package/src/provider-manifest.mjs +46 -0
  141. package/src/provider-provision.mjs +24 -0
  142. package/src/remote-operations.mjs +166 -0
  143. package/src/request-log.mjs +99 -0
  144. package/src/resources.mjs +290 -0
  145. package/src/response-contracts.mjs +147 -0
  146. package/src/responses.mjs +103 -0
  147. package/src/routing.mjs +40 -0
  148. package/src/sensitive-data-sse.mjs +121 -0
  149. package/src/sensitive-data.mjs +254 -0
  150. package/src/server.mjs +552 -0
  151. package/src/storage.mjs +367 -0
  152. package/src/streams.mjs +232 -0
  153. package/src/token-import.mjs +68 -0
  154. package/src/token-reservation.mjs +8 -0
  155. package/src/tokens.mjs +172 -0
  156. package/src/usage.mjs +54 -0
  157. package/src/websocket-relay.mjs +131 -0
  158. package/testing.d.ts +7 -0
  159. package/testing.js +57 -0
@@ -0,0 +1,387 @@
1
+ {
2
+ "$defs": {
3
+ "AuthStatusReport": {
4
+ "additionalProperties": false,
5
+ "properties": {
6
+ "api_key_providers": {
7
+ "items": {
8
+ "$ref": "#/$defs/AuthStatusReport_RedactedProviderRecord"
9
+ },
10
+ "type": "array"
11
+ },
12
+ "credentials": {
13
+ "items": {
14
+ "$ref": "#/$defs/AuthStatusReport_CredentialAcceptanceReport"
15
+ },
16
+ "type": "array"
17
+ },
18
+ "output": {
19
+ "items": {
20
+ "type": "string"
21
+ },
22
+ "type": "array"
23
+ },
24
+ "server": {
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ]
29
+ },
30
+ "sources": {
31
+ "items": {
32
+ "$ref": "#/$defs/AuthStatusReport_SourceReport"
33
+ },
34
+ "type": "array"
35
+ }
36
+ },
37
+ "required": [
38
+ "credentials",
39
+ "sources",
40
+ "api_key_providers",
41
+ "output"
42
+ ],
43
+ "title": "AuthStatusReport",
44
+ "type": "object"
45
+ },
46
+ "AuthStatusReport_CredentialAcceptanceReport": {
47
+ "additionalProperties": false,
48
+ "description": "One provider's accepted state and exact local credential root.",
49
+ "properties": {
50
+ "detail": {
51
+ "type": [
52
+ "string",
53
+ "null"
54
+ ]
55
+ },
56
+ "home": {
57
+ "type": "string"
58
+ },
59
+ "provider": {
60
+ "$ref": "#/$defs/AuthStatusReport_SubscriptionProvider"
61
+ },
62
+ "state": {
63
+ "$ref": "#/$defs/AuthStatusReport_CredentialAcceptanceState"
64
+ }
65
+ },
66
+ "required": [
67
+ "provider",
68
+ "home",
69
+ "state"
70
+ ],
71
+ "type": "object"
72
+ },
73
+ "AuthStatusReport_CredentialAcceptanceState": {
74
+ "description": "Stable provider-verified credential state used by CLI and management APIs.",
75
+ "enum": [
76
+ "usable",
77
+ "rejected",
78
+ "unverified",
79
+ "refresh-failed",
80
+ "absent"
81
+ ],
82
+ "type": "string"
83
+ },
84
+ "AuthStatusReport_CredentialSource": {
85
+ "description": "How a deployment holds one provider's credential.",
86
+ "oneOf": [
87
+ {
88
+ "additionalProperties": false,
89
+ "description": "Nothing is installed for this provider.",
90
+ "properties": {
91
+ "kind": {
92
+ "const": "absent",
93
+ "type": "string"
94
+ }
95
+ },
96
+ "required": [
97
+ "kind"
98
+ ],
99
+ "type": "object"
100
+ },
101
+ {
102
+ "additionalProperties": false,
103
+ "description": "Router's own credential file, which Router alone rotates.\n\nThe ordinary case for a credential obtained by `auth claude` here: there\nis no second holder, so there is no chain to share.",
104
+ "properties": {
105
+ "kind": {
106
+ "const": "owned",
107
+ "type": "string"
108
+ }
109
+ },
110
+ "required": [
111
+ "kind"
112
+ ],
113
+ "type": "object"
114
+ },
115
+ {
116
+ "additionalProperties": false,
117
+ "description": "A reference to a vendor client's file that both processes advance.\n\nOne chain, one refresher: whichever process refreshes writes the\nsuccessor where the other will read it.",
118
+ "properties": {
119
+ "kind": {
120
+ "const": "followed",
121
+ "type": "string"
122
+ },
123
+ "present": {
124
+ "description": "Whether that file is currently readable.\n\nA followed home that has been removed must be named as such: falling\nback to a stale copy is what makes a deployment drift into\n`invalid_grant` while the CLI beside it stays healthy.",
125
+ "type": "boolean"
126
+ },
127
+ "source": {
128
+ "description": "The vendor file being followed.",
129
+ "type": "string"
130
+ }
131
+ },
132
+ "required": [
133
+ "kind",
134
+ "source",
135
+ "present"
136
+ ],
137
+ "type": "object"
138
+ },
139
+ {
140
+ "additionalProperties": false,
141
+ "description": "A credential owned elsewhere that Router must not rotate.\n\nMarked `refresh_owner: external` without identifying a writable source,\nso Router can read it but must never spend the refresh token.",
142
+ "properties": {
143
+ "kind": {
144
+ "const": "externally-owned",
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": [
149
+ "kind"
150
+ ],
151
+ "type": "object"
152
+ }
153
+ ]
154
+ },
155
+ "AuthStatusReport_ProviderKind": {
156
+ "description": "Supported persisted provider kinds.",
157
+ "oneOf": [
158
+ {
159
+ "const": "openai-compatible",
160
+ "description": "Generic OpenAI-compatible upstream such as `LiteLLM`.",
161
+ "type": "string"
162
+ },
163
+ {
164
+ "const": "lefine",
165
+ "description": "Lefine `OpenAI` Chat Completions API with live catalog validation.",
166
+ "type": "string"
167
+ },
168
+ {
169
+ "const": "zai-coding-plan",
170
+ "description": "Personal z.ai GLM Coding Plan with client/subscriber policy gates.",
171
+ "type": "string"
172
+ }
173
+ ]
174
+ },
175
+ "AuthStatusReport_RedactedProviderRecord": {
176
+ "additionalProperties": false,
177
+ "description": "Provider record shape safe to print or return over the API.",
178
+ "properties": {
179
+ "api_key_env": {
180
+ "type": [
181
+ "string",
182
+ "null"
183
+ ]
184
+ },
185
+ "base_url": {
186
+ "type": "string"
187
+ },
188
+ "default_model": {
189
+ "type": [
190
+ "string",
191
+ "null"
192
+ ]
193
+ },
194
+ "enabled": {
195
+ "type": "boolean"
196
+ },
197
+ "has_encrypted_api_key": {
198
+ "type": "boolean"
199
+ },
200
+ "intermediary_risk_acknowledged": {
201
+ "type": "boolean"
202
+ },
203
+ "kind": {
204
+ "$ref": "#/$defs/AuthStatusReport_ProviderKind"
205
+ },
206
+ "models": {
207
+ "items": {
208
+ "type": "string"
209
+ },
210
+ "type": "array"
211
+ },
212
+ "name": {
213
+ "type": "string"
214
+ },
215
+ "subscriber_id": {
216
+ "type": [
217
+ "string",
218
+ "null"
219
+ ]
220
+ },
221
+ "supported_clients": {
222
+ "items": {
223
+ "type": "string"
224
+ },
225
+ "type": "array"
226
+ },
227
+ "unsupported_clients": {
228
+ "items": {
229
+ "type": "string"
230
+ },
231
+ "type": "array"
232
+ }
233
+ },
234
+ "required": [
235
+ "name",
236
+ "kind",
237
+ "base_url",
238
+ "models",
239
+ "supported_clients",
240
+ "has_encrypted_api_key",
241
+ "enabled",
242
+ "intermediary_risk_acknowledged",
243
+ "unsupported_clients"
244
+ ],
245
+ "type": "object"
246
+ },
247
+ "AuthStatusReport_SourceReport": {
248
+ "additionalProperties": false,
249
+ "description": "One provider's holding, for `auth status`.",
250
+ "properties": {
251
+ "provider": {
252
+ "$ref": "#/$defs/AuthStatusReport_SubscriptionProvider"
253
+ },
254
+ "source": {
255
+ "$ref": "#/$defs/AuthStatusReport_CredentialSource"
256
+ }
257
+ },
258
+ "required": [
259
+ "provider",
260
+ "source"
261
+ ],
262
+ "type": "object"
263
+ },
264
+ "AuthStatusReport_SubscriptionProvider": {
265
+ "description": "A subscription-backed upstream that authenticates with vendor OAuth tokens.",
266
+ "oneOf": [
267
+ {
268
+ "const": "claude",
269
+ "description": "Anthropic Claude (Pro/Max) via Claude Code \u2014 `~/.claude`.",
270
+ "type": "string"
271
+ },
272
+ {
273
+ "const": "codex",
274
+ "description": "`OpenAI` Codex / `ChatGPT` subscription via the Codex CLI \u2014 `~/.codex`.",
275
+ "type": "string"
276
+ },
277
+ {
278
+ "const": "gemini",
279
+ "description": "Google Gemini Code Assist via the Gemini CLI \u2014 `~/.gemini`.",
280
+ "type": "string"
281
+ },
282
+ {
283
+ "const": "qwen",
284
+ "description": "Alibaba Qwen via the qwen-code CLI \u2014 `~/.qwen`.",
285
+ "type": "string"
286
+ }
287
+ ]
288
+ }
289
+ },
290
+ "$id": "link-assistant-router/auth-status/v1",
291
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
292
+ "additionalProperties": false,
293
+ "allOf": [
294
+ {
295
+ "else": {
296
+ "properties": {
297
+ "exit_code": {
298
+ "minimum": 1,
299
+ "type": "integer"
300
+ }
301
+ }
302
+ },
303
+ "if": {
304
+ "properties": {
305
+ "success": {
306
+ "const": true
307
+ }
308
+ }
309
+ },
310
+ "then": {
311
+ "properties": {
312
+ "exit_code": {
313
+ "const": 0
314
+ }
315
+ }
316
+ }
317
+ }
318
+ ],
319
+ "properties": {
320
+ "data": {
321
+ "anyOf": [
322
+ {
323
+ "additionalProperties": false,
324
+ "properties": {
325
+ "output": {
326
+ "items": {
327
+ "type": "string"
328
+ },
329
+ "type": "array"
330
+ }
331
+ },
332
+ "required": [
333
+ "output"
334
+ ],
335
+ "type": "object"
336
+ },
337
+ {
338
+ "additionalProperties": false,
339
+ "properties": {
340
+ "output": {
341
+ "items": {
342
+ "type": "string"
343
+ },
344
+ "type": "array"
345
+ }
346
+ },
347
+ "required": [
348
+ "output"
349
+ ],
350
+ "type": "object"
351
+ },
352
+ {
353
+ "$ref": "#/$defs/AuthStatusReport"
354
+ }
355
+ ]
356
+ },
357
+ "diagnostics": {
358
+ "items": {
359
+ "type": "string"
360
+ },
361
+ "type": "array"
362
+ },
363
+ "exit_code": {
364
+ "maximum": 255,
365
+ "minimum": 0,
366
+ "type": "integer"
367
+ },
368
+ "operation": {
369
+ "const": "auth.status"
370
+ },
371
+ "schema": {
372
+ "const": "link-assistant-router/auth-status/v1"
373
+ },
374
+ "success": {
375
+ "type": "boolean"
376
+ }
377
+ },
378
+ "required": [
379
+ "schema",
380
+ "operation",
381
+ "success",
382
+ "exit_code",
383
+ "data",
384
+ "diagnostics"
385
+ ],
386
+ "type": "object"
387
+ }
@@ -0,0 +1,97 @@
1
+ {
2
+ "$defs": {},
3
+ "$id": "link-assistant-router/cli-error/v1",
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "additionalProperties": false,
6
+ "allOf": [
7
+ {
8
+ "else": {
9
+ "properties": {
10
+ "exit_code": {
11
+ "minimum": 1,
12
+ "type": "integer"
13
+ }
14
+ }
15
+ },
16
+ "if": {
17
+ "properties": {
18
+ "success": {
19
+ "const": true
20
+ }
21
+ }
22
+ },
23
+ "then": {
24
+ "properties": {
25
+ "exit_code": {
26
+ "const": 0
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ],
32
+ "properties": {
33
+ "data": {
34
+ "anyOf": [
35
+ {
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "output": {
39
+ "items": {
40
+ "type": "string"
41
+ },
42
+ "type": "array"
43
+ }
44
+ },
45
+ "required": [
46
+ "output"
47
+ ],
48
+ "type": "object"
49
+ },
50
+ {
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "output": {
54
+ "items": {
55
+ "type": "string"
56
+ },
57
+ "type": "array"
58
+ }
59
+ },
60
+ "required": [
61
+ "output"
62
+ ],
63
+ "type": "object"
64
+ }
65
+ ]
66
+ },
67
+ "diagnostics": {
68
+ "items": {
69
+ "type": "string"
70
+ },
71
+ "type": "array"
72
+ },
73
+ "exit_code": {
74
+ "maximum": 255,
75
+ "minimum": 0,
76
+ "type": "integer"
77
+ },
78
+ "operation": {
79
+ "const": "cli-error"
80
+ },
81
+ "schema": {
82
+ "const": "link-assistant-router/cli-error/v1"
83
+ },
84
+ "success": {
85
+ "type": "boolean"
86
+ }
87
+ },
88
+ "required": [
89
+ "schema",
90
+ "operation",
91
+ "success",
92
+ "exit_code",
93
+ "data",
94
+ "diagnostics"
95
+ ],
96
+ "type": "object"
97
+ }
@@ -0,0 +1,97 @@
1
+ {
2
+ "$defs": {},
3
+ "$id": "link-assistant-router/clients-backup-create/v1",
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "additionalProperties": false,
6
+ "allOf": [
7
+ {
8
+ "else": {
9
+ "properties": {
10
+ "exit_code": {
11
+ "minimum": 1,
12
+ "type": "integer"
13
+ }
14
+ }
15
+ },
16
+ "if": {
17
+ "properties": {
18
+ "success": {
19
+ "const": true
20
+ }
21
+ }
22
+ },
23
+ "then": {
24
+ "properties": {
25
+ "exit_code": {
26
+ "const": 0
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ],
32
+ "properties": {
33
+ "data": {
34
+ "anyOf": [
35
+ {
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "output": {
39
+ "items": {
40
+ "type": "string"
41
+ },
42
+ "type": "array"
43
+ }
44
+ },
45
+ "required": [
46
+ "output"
47
+ ],
48
+ "type": "object"
49
+ },
50
+ {
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "output": {
54
+ "items": {
55
+ "type": "string"
56
+ },
57
+ "type": "array"
58
+ }
59
+ },
60
+ "required": [
61
+ "output"
62
+ ],
63
+ "type": "object"
64
+ }
65
+ ]
66
+ },
67
+ "diagnostics": {
68
+ "items": {
69
+ "type": "string"
70
+ },
71
+ "type": "array"
72
+ },
73
+ "exit_code": {
74
+ "maximum": 255,
75
+ "minimum": 0,
76
+ "type": "integer"
77
+ },
78
+ "operation": {
79
+ "const": "clients.backup.create"
80
+ },
81
+ "schema": {
82
+ "const": "link-assistant-router/clients-backup-create/v1"
83
+ },
84
+ "success": {
85
+ "type": "boolean"
86
+ }
87
+ },
88
+ "required": [
89
+ "schema",
90
+ "operation",
91
+ "success",
92
+ "exit_code",
93
+ "data",
94
+ "diagnostics"
95
+ ],
96
+ "type": "object"
97
+ }