@evandu/super-pi 0.1.104 → 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.
- package/dist/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +6 -6
- package/dist/client/assets/{index-DDkbPYLz.css → index-UiqTcZca.css} +1 -1
- package/dist/client/assets/index-tBfBUY_8.js +74 -0
- package/dist/client/index.html +2 -2
- package/dist/server/application/catalog-service.d.ts +9 -0
- package/dist/server/application/catalog-service.js +11 -0
- package/dist/server/application/provider-service.d.ts +63 -0
- package/dist/server/application/provider-service.js +136 -0
- package/dist/server/command-handler.d.ts +16 -1
- package/dist/server/command-handler.js +34 -1
- package/dist/server/index.js +13 -1
- package/dist/server/pi-session-pool.d.ts +19 -1
- package/dist/server/pi-session-pool.js +13 -1
- package/dist/server/pi-session.d.ts +10 -0
- package/dist/server/pi-session.js +11 -0
- package/dist/server/providers.d.ts +160 -0
- package/dist/server/providers.js +396 -0
- package/dist/server/runtime.d.ts +45 -0
- package/dist/server/runtime.js +38 -1
- package/dist/server/server-context.d.ts +3 -0
- package/dist/server/types.d.ts +72 -0
- package/package.json +4 -1
- package/dist/client/assets/index-mAu39Bra.js +0 -74
|
@@ -7,6 +7,7 @@ import type { ConversationService } from "./application/conversation-service.js"
|
|
|
7
7
|
import type { RunService } from "./application/run-service.js";
|
|
8
8
|
import type { ExtensionUiService } from "./application/extension-ui-service.js";
|
|
9
9
|
import type { CatalogService } from "./application/catalog-service.js";
|
|
10
|
+
import type { ProviderService } from "./application/provider-service.js";
|
|
10
11
|
import type { ExecService } from "./exec-service.js";
|
|
11
12
|
import type { ToolRegistry } from "./tool-registry.js";
|
|
12
13
|
import type { ToolRunner } from "./tool-runner.js";
|
|
@@ -49,6 +50,8 @@ export interface ServerContext {
|
|
|
49
50
|
runService: RunService;
|
|
50
51
|
extensionUiService: ExtensionUiService;
|
|
51
52
|
catalogService: CatalogService;
|
|
53
|
+
/** The providers a person added through the settings window. */
|
|
54
|
+
providerService: ProviderService;
|
|
52
55
|
execService: ExecService;
|
|
53
56
|
toolRegistry: ToolRegistry;
|
|
54
57
|
toolRunner: ToolRunner;
|
package/dist/server/types.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.1.105",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -94,6 +94,8 @@
|
|
|
94
94
|
"scripts/agent-config-regression.test.mjs",
|
|
95
95
|
"scripts/model-filter.test.mjs",
|
|
96
96
|
"scripts/settings-default-model.test.mjs",
|
|
97
|
+
"scripts/provider-registry.test.mjs",
|
|
98
|
+
"scripts/provider-pi-reads.test.mjs",
|
|
97
99
|
"scripts/active-memory.test.mjs",
|
|
98
100
|
"scripts/knowledge-base.test.mjs",
|
|
99
101
|
"scripts/tool-runner.test.mjs",
|
|
@@ -140,6 +142,7 @@
|
|
|
140
142
|
"scripts/theme-switch-state.test.mjs",
|
|
141
143
|
"scripts/settings-window-structure.test.mjs",
|
|
142
144
|
"scripts/settings-model-browser.test.mjs",
|
|
145
|
+
"scripts/provider-browser.test.mjs",
|
|
143
146
|
"scripts/file-tab-selected-contrast.test.mjs",
|
|
144
147
|
"scripts/help-window.test.mjs",
|
|
145
148
|
"scripts/composer-regression-browser.test.mjs",
|