@evandu/super-pi 0.1.103 → 0.1.105

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.
@@ -377,6 +377,29 @@ export type ModelOption = ModelSelection & {
377
377
  * honest answer is "the list could not be read". `fetchedAt` travels with the value so a stale
378
378
  * cache is visible rather than silent.
379
379
  */
380
+ /**
381
+ * A provider a person added through the settings window, as the BROWSER sees it.
382
+ *
383
+ * The API key is a FACT here and not a value: `hasKey` says whether one is stored, and the key
384
+ * itself never leaves the server. It is in Super Pi's own registry and in Pi's `auth.json`, both of
385
+ * them files with restrictive permissions, and in neither the state snapshot nor any event.
386
+ */
387
+ export type PublicProviderModel = {
388
+ id: string;
389
+ name: string;
390
+ reasoning: boolean;
391
+ imageInput: boolean;
392
+ contextWindow: number;
393
+ maxTokens: number;
394
+ };
395
+ export type PublicProvider = {
396
+ id: string;
397
+ name: string;
398
+ baseUrl: string;
399
+ api: string;
400
+ hasKey: boolean;
401
+ models: PublicProviderModel[];
402
+ };
380
403
  export type ModelCatalog = {
381
404
  source: "pi" | "unavailable";
382
405
  models: ModelOption[];
@@ -874,6 +897,43 @@ export type ClientCommandBody =
874
897
  type: "model.rules.set";
875
898
  rules: ModelFilterRule[];
876
899
  }
900
+ /**
901
+ * Adds a provider, or adds a model to one, or updates one.
902
+ *
903
+ * The key is OPTIONAL and its absence means "keep the stored one": the key is never shown again
904
+ * once it is saved, so an empty field is the normal state of the form for a provider that already
905
+ * has one. `clearKey` is how a person asks for it to be removed.
906
+ */
907
+ | {
908
+ type: "providers.set";
909
+ provider: {
910
+ id: string;
911
+ name?: string;
912
+ baseUrl: string;
913
+ api: string;
914
+ apiKey?: string;
915
+ clearKey?: boolean;
916
+ models: {
917
+ id: string;
918
+ name?: string;
919
+ reasoning?: boolean;
920
+ imageInput?: boolean;
921
+ contextWindow?: number;
922
+ maxTokens?: number;
923
+ supportsDeveloperRole?: boolean;
924
+ supportsReasoningEffort?: boolean;
925
+ }[];
926
+ };
927
+ }
928
+ /** Removes a provider Super Pi manages. One it does not manage is refused. */
929
+ | {
930
+ type: "providers.remove";
931
+ providerId: string;
932
+ }
933
+ /** Asks for the providers Super Pi manages. The answer carries no key. */
934
+ | {
935
+ type: "providers.fetch";
936
+ }
877
937
  /**
878
938
  * Sets the app-wide default model. `null` clears it back to "Pi's own default" - the same
879
939
  * "absence, not a frozen copy" convention the workspace defaults use, so removing the default
@@ -1330,6 +1390,18 @@ export type ServerEvent = {
1330
1390
  type: "model.catalog.all";
1331
1391
  catalog: ModelCatalog;
1332
1392
  }
1393
+ /**
1394
+ * The providers Super Pi manages. Sent when they change, and when a client connects.
1395
+ *
1396
+ * `apis` travels with them so the form's API-type list has ONE source of truth: the list of
1397
+ * adapters Pi ships is a fact about the Pi that is installed, and a copy of it in the browser
1398
+ * would be a copy that goes stale.
1399
+ */
1400
+ | {
1401
+ type: "providers.list";
1402
+ providers: PublicProvider[];
1403
+ apis: string[];
1404
+ }
1333
1405
  /**
1334
1406
  * The answer to conversation.autoRename. Carries a title OR an error and never both, because the client
1335
1407
  * has exactly two things to say about it: here is the new name, or here is why there isnt one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.103",
3
+ "version": "0.1.105",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,6 +43,8 @@
43
43
  "scripts/stream-checkpoint.test.mjs",
44
44
  "scripts/stream-transport.test.mjs",
45
45
  "scripts/pi-session.test.mjs",
46
+ "scripts/pi-model-switch.test.mjs",
47
+ "scripts/pi-thinking-levels.test.mjs",
46
48
  "scripts/diagnose-cli.test.mjs",
47
49
  "scripts/lan-access.test.mjs",
48
50
  "scripts/terminal-pty.test.mjs",
@@ -92,6 +94,8 @@
92
94
  "scripts/agent-config-regression.test.mjs",
93
95
  "scripts/model-filter.test.mjs",
94
96
  "scripts/settings-default-model.test.mjs",
97
+ "scripts/provider-registry.test.mjs",
98
+ "scripts/provider-pi-reads.test.mjs",
95
99
  "scripts/active-memory.test.mjs",
96
100
  "scripts/knowledge-base.test.mjs",
97
101
  "scripts/tool-runner.test.mjs",
@@ -138,6 +142,7 @@
138
142
  "scripts/theme-switch-state.test.mjs",
139
143
  "scripts/settings-window-structure.test.mjs",
140
144
  "scripts/settings-model-browser.test.mjs",
145
+ "scripts/provider-browser.test.mjs",
141
146
  "scripts/file-tab-selected-contrast.test.mjs",
142
147
  "scripts/help-window.test.mjs",
143
148
  "scripts/composer-regression-browser.test.mjs",