@evandu/super-pi 0.1.124 → 0.1.125

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 (32) hide show
  1. package/dist/.super-pi-check-inputs.json +2 -2
  2. package/dist/client/.super-pi-client-sources.json +6 -6
  3. package/dist/client/assets/{CodeMirrorEditor-bNGSS1rQ.js → CodeMirrorEditor-CK5tZxIo.js} +2 -2
  4. package/dist/client/assets/{dist-Bf28S0tQ.js → dist-5O-klFrP.js} +1 -1
  5. package/dist/client/assets/{dist-Bea-jKEE.js → dist-B8X48E9G.js} +1 -1
  6. package/dist/client/assets/{dist-BwJvT1Pb.js → dist-BC3_yB3K.js} +1 -1
  7. package/dist/client/assets/{dist-BkzoxIX4.js → dist-BDAJ6COK.js} +1 -1
  8. package/dist/client/assets/{dist-BZ-HTc7j.js → dist-BDULvJIt.js} +1 -1
  9. package/dist/client/assets/{dist-BZB9Z8C-.js → dist-BR5dccfj.js} +1 -1
  10. package/dist/client/assets/{dist-C1W6z7MQ.js → dist-BbK-QOz1.js} +1 -1
  11. package/dist/client/assets/{dist-D8wvXcz3.js → dist-Ck1wVFJ1.js} +1 -1
  12. package/dist/client/assets/{dist-DXsLC1J6.js → dist-CrnIVt5K.js} +1 -1
  13. package/dist/client/assets/{dist-D_E1E9X4.js → dist-D87R6Wol.js} +1 -1
  14. package/dist/client/assets/{dist-Boojk5ek.js → dist-D90mwiSm.js} +1 -1
  15. package/dist/client/assets/{dist-C1MR_bG_.js → dist-D9IZ5pHN.js} +1 -1
  16. package/dist/client/assets/{dist-DAs0bmNx.js → dist-DIa1uLNH.js} +1 -1
  17. package/dist/client/assets/{dist-BdNKDCbA.js → dist-DR8q7BI-.js} +1 -1
  18. package/dist/client/assets/{dist-BuO7_0WE.js → dist-Did2mkbm.js} +1 -1
  19. package/dist/client/assets/{dist-BNFxxYvs.js → dist-DsObObmI.js} +1 -1
  20. package/dist/client/assets/{dist-D-1R5iHi.js → dist-DsY1TPps.js} +1 -1
  21. package/dist/client/assets/{dist-U-IA_cdZ.js → dist-MYmiV3U3.js} +1 -1
  22. package/dist/client/assets/{dist-CROgPs2p.js → dist-Om17wCc8.js} +1 -1
  23. package/dist/client/assets/{dist-RFhXNQyY.js → dist-fEUHAgwX.js} +1 -1
  24. package/dist/client/assets/{dist-CwC6b2Cl.js → dist-nSf0tcKa.js} +1 -1
  25. package/dist/client/assets/{dist-CIxJmM-_.js → dist-r_bnlg1k.js} +1 -1
  26. package/dist/client/assets/{index-4kjGwKOr.css → index-CBPWeTvl.css} +1 -1
  27. package/dist/client/assets/{index-LL00oFAG.js → index-qTPZ6eno.js} +39 -39
  28. package/dist/client/index.html +2 -2
  29. package/dist/server/providers.d.ts +12 -7
  30. package/dist/server/providers.js +6 -0
  31. package/dist/server/types.d.ts +5 -0
  32. package/package.json +1 -1
@@ -8,8 +8,8 @@
8
8
  <link rel="alternate icon" href="/favicon.ico" />
9
9
  <link rel="apple-touch-icon" href="/favicon.svg" />
10
10
  <title>Super Pi</title>
11
- <script type="module" crossorigin src="/assets/index-LL00oFAG.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-4kjGwKOr.css">
11
+ <script type="module" crossorigin src="/assets/index-qTPZ6eno.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-CBPWeTvl.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -65,14 +65,19 @@ export type ProviderDefinition = {
65
65
  hasAuthKey?: boolean;
66
66
  models: ProviderModelDefinition[];
67
67
  /**
68
- * TRUE when the provider is one of PI'S OWN - a built-in such as `kimi-coding` - rather than one
69
- * written into `models.json`.
68
+ * The key is written into `models.json` itself rather than into `auth.json`.
70
69
  *
71
- * WHY THE PANEL CARES. A built-in provider has no entry in `models.json` to edit: its models live
72
- * in Pi's own catalogue and the only thing a person has configured for it is the CREDENTIAL in
73
- * `auth.json`. So a built-in can be turned off (the credential goes) but it has no address and no
74
- * model list of its own to show, and saying so is the difference between a panel that describes
75
- * reality and one that pretends a built-in is a custom provider with an empty address.
70
+ * Pi's own documentation leads with it (`"apiKey": "$MY_KEY"`), and it is the only way to point a
71
+ * provider at a key that lives in the environment. It matters here because such a provider IS
72
+ * offered by Pi when the variable is set - so the panel must not tell the person it has no
73
+ * credential, and must not warn that Pi will not offer it.
74
+ */
75
+ keyInModelsJson?: boolean;
76
+ /**
77
+ * TRUE when the provider is one of Pi's own, with no entry in `models.json`.
78
+ *
79
+ * Its models come from Pi itself and the only thing a person has configured for it is the
80
+ * credential, so it can be switched off but has no address to edit.
76
81
  */
77
82
  builtin?: boolean;
78
83
  /**
@@ -320,6 +320,11 @@ export class ProviderRegistry {
320
320
  // this file, and reporting "no key" for a provider Pi is happily using is a lie the panel
321
321
  // would then show next to a working model.
322
322
  hasAuthKey: Boolean(piAuth[pId] || backup?.apiKey),
323
+ // A KEY WRITTEN IN models.json IS A CREDENTIAL TOO, and it is the one Pi's own docs lead
324
+ // with (`"apiKey": "$MY_KEY"`). Without this, such a provider is reported as having no
325
+ // credential - and the panel then says "Pi will not offer it", which is wrong exactly when
326
+ // the environment variable is set and Pi is offering it right now.
327
+ ...(typeof rec.apiKey === "string" && rec.apiKey ? { keyInModelsJson: true } : {}),
323
328
  models,
324
329
  });
325
330
  }
@@ -535,6 +540,7 @@ export function publicProviders(providers) {
535
540
  baseUrl: provider.baseUrl,
536
541
  api: provider.api,
537
542
  hasKey: Boolean(provider.apiKey || provider.hasAuthKey),
543
+ ...(provider.keyInModelsJson ? { keyInModelsJson: true } : {}),
538
544
  ...(provider.builtin ? { builtin: true } : {}),
539
545
  ...(provider.disabled ? { disabled: true } : {}),
540
546
  models: provider.models.map(model => ({
@@ -405,6 +405,11 @@ export type PublicProvider = {
405
405
  baseUrl: string;
406
406
  api: string;
407
407
  hasKey: boolean;
408
+ /**
409
+ * TRUE when the key lives in `models.json` itself (Pi's `"apiKey": "$MY_KEY"` form) rather than
410
+ * in `auth.json`. It is a credential all the same, so the panel must not report it as missing.
411
+ */
412
+ keyInModelsJson?: boolean;
408
413
  /**
409
414
  * TRUE when the provider is one of Pi's own, with no entry in `models.json`.
410
415
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.124",
3
+ "version": "0.1.125",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",