@gang-of-beads/pi-web-plugin-api 0.1.0-alpha.2 → 0.1.0-alpha.3
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/README.md +1 -1
- package/dist/plugin-api.d.ts +4 -2
- package/dist/shared/apiTypes.d.ts +10 -0
- package/dist/shared/pluginApiTypes.d.ts +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Bundle runtime imports into each plugin half: PI WEB loads plugin modules as the
|
|
|
28
28
|
|
|
29
29
|
## Compatibility
|
|
30
30
|
|
|
31
|
-
`0.1.0-alpha.
|
|
31
|
+
`0.1.0-alpha.3` contains the declarations shipped by PI WEB `2.202610.12`: `ThemeTokens` accepts the shape and typography tokens (`--pi-font-*`, `--pi-radius-*`) and the message colour tokens (`--pi-msg-*`), a theme contribution can name the theme that replaces it (`replacedBy`), and the config types carry the shared theme. Browser plugins declare `apiVersion: 2`; server plugins declare `apiVersion: 1`. The existing `@gang-of-beads/pi-web/plugin-api` and `@gang-of-beads/pi-web/server-plugin-api` entry points remain available.
|
|
32
32
|
|
|
33
33
|
This is an alpha release. Host-internal members marked unstable are not a supported third-party contract.
|
|
34
34
|
|
package/dist/plugin-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
|
2
|
-
import type { FileSuggestion, ForegroundToken, PluginListModel, PluginReadFailure, LegacyThemeToken, SemanticSurfaceToken, ShapeTypographyToken, TerminalCommandRun, TerminalInfo, DeleteWorkspaceFileResponse, FileContentResponse, FileTreeResponse, JsonValue, MachineKind, MoveWorkspaceFileOptions, MoveWorkspaceFileResponse, PiWebStatusResponse, TerminalCommandRunHandle, WorkspaceProviderMetadata, WorkspaceRemovalPresentation, WorkspaceUploadBatchProgress, WorkspaceUploadCancelHandle, WriteWorkspaceFileOptions, WriteWorkspaceFileResponse, MachineConnection } from "./shared/pluginApiTypes.js";
|
|
2
|
+
import type { FileSuggestion, ForegroundToken, MessageRoleToken, PluginListModel, PluginReadFailure, LegacyThemeToken, SemanticSurfaceToken, ShapeTypographyToken, TerminalCommandRun, TerminalInfo, DeleteWorkspaceFileResponse, FileContentResponse, FileTreeResponse, JsonValue, MachineKind, MoveWorkspaceFileOptions, MoveWorkspaceFileResponse, PiWebStatusResponse, TerminalCommandRunHandle, WorkspaceProviderMetadata, WorkspaceRemovalPresentation, WorkspaceUploadBatchProgress, WorkspaceUploadCancelHandle, WriteWorkspaceFileOptions, WriteWorkspaceFileResponse, MachineConnection } from "./shared/pluginApiTypes.js";
|
|
3
3
|
export type { ThemeToken } from "./shared/pluginApiTypes.js";
|
|
4
4
|
export type { FileSuggestion, LegacyThemeToken, SemanticSurfaceToken, TerminalInfo, FileContentMediaType, FileContentResponse, FileTreeEntry, FileTreeResponse, JsonObject, JsonPrimitive, JsonValue, MachineConnection, MachineKind, PiWebComponentStatus, PiWebDockerMode, PluginListAction, PluginListGroup, PluginListModel, PluginListRead, PluginListRow, PluginListStatus, PluginListTone, PluginListWords, PluginReadFailure, PiWebInstallationInfo, PiWebInstallationKind, PiWebPackageManager, PiWebReleaseStatus, PiWebServiceComponent, PiWebStatusMessage, PiWebStatusResponse, PiWebStatusSeverity, PiWebVersionResponse, TerminalCommandRun, TerminalCommandRunHandle, TerminalCommandRunStatus, WorkspaceProviderCapabilities, WorkspaceProviderMetadata, WorkspaceRemovalPresentation, WorkspaceFileUploadProgress, WorkspaceUploadBatchFileProgress, WorkspaceUploadBatchProgress, WorkspaceUploadCancelHandle, WriteWorkspaceFileOptions, WriteWorkspaceFileResponse, DeleteWorkspaceFileResponse, MoveWorkspaceFileOptions, MoveWorkspaceFileResponse, } from "./shared/pluginApiTypes.js";
|
|
5
5
|
export { CORE_STATUS_FLAGS } from "./shared/machineStatus.js";
|
|
@@ -903,9 +903,11 @@ export interface WorkspaceLabelContribution {
|
|
|
903
903
|
items: (context: WorkspaceLabelContext) => WorkspaceLabelItem[];
|
|
904
904
|
}
|
|
905
905
|
export type ThemeColorScheme = "dark" | "light";
|
|
906
|
-
export type ThemeTokens = Record<LegacyThemeToken, string> & Partial<Record<SemanticSurfaceToken | ForegroundToken | ShapeTypographyToken, string>>;
|
|
906
|
+
export type ThemeTokens = Record<LegacyThemeToken, string> & Partial<Record<SemanticSurfaceToken | ForegroundToken | ShapeTypographyToken | MessageRoleToken, string>>;
|
|
907
907
|
export interface ThemeContribution {
|
|
908
908
|
id: LocalContributionId;
|
|
909
|
+
/** Prefer this available concrete theme; tokens remain the fallback for other hosts. */
|
|
910
|
+
replacedBy?: QualifiedContributionId;
|
|
909
911
|
name: string;
|
|
910
912
|
description?: string;
|
|
911
913
|
order?: number;
|
|
@@ -100,6 +100,11 @@ export interface PiWebListTilesConfig {
|
|
|
100
100
|
phone?: ListTilesPerRow;
|
|
101
101
|
desktop?: ListTilesPerRow;
|
|
102
102
|
}
|
|
103
|
+
/** One theme choice, as a browser keeps it locally: a qualified theme id and whether it follows the system. */
|
|
104
|
+
export interface PiWebSharedThemeConfig {
|
|
105
|
+
themeId: `${string}:${string}`;
|
|
106
|
+
auto: boolean;
|
|
107
|
+
}
|
|
103
108
|
export interface PiWebConfigValues {
|
|
104
109
|
host?: string;
|
|
105
110
|
port?: number;
|
|
@@ -122,6 +127,11 @@ export interface PiWebConfigValues {
|
|
|
122
127
|
updateCommand?: string;
|
|
123
128
|
/** Tiles per row in the Navigate lists, per layout; see PiWebListTilesConfig. */
|
|
124
129
|
listTiles?: PiWebListTilesConfig;
|
|
130
|
+
/**
|
|
131
|
+
* The theme every browser of this PI WEB shares (owner, 2026-10-16); absent, each browser keeps
|
|
132
|
+
* its own. Written only through `PUT /api/config/theme`, so a general config save keeps it.
|
|
133
|
+
*/
|
|
134
|
+
theme?: PiWebSharedThemeConfig;
|
|
125
135
|
/**
|
|
126
136
|
* When true, PI WEB appends environment facts to session system prompts:
|
|
127
137
|
* the pi-web session nesting every session runs in, plus container facts in
|
|
@@ -214,13 +214,20 @@ export interface PiWebStatusResponse extends PiWebVersionResponse {
|
|
|
214
214
|
*/
|
|
215
215
|
/**
|
|
216
216
|
* Shape and typography stops a theme may pin. Optional by design: a theme
|
|
217
|
-
* that omits them inherits the core's current shape -
|
|
218
|
-
*
|
|
219
|
-
* its rounded sans rendering. Radii follow the published scale; there is no
|
|
217
|
+
* that omits them inherits the core's current shape - the rounded sans
|
|
218
|
+
* Material scale - so a flat or mono theme MUST set these to keep its look. Radii follow the published scale; there is no
|
|
220
219
|
* density or border-width token yet.
|
|
221
220
|
*/
|
|
222
221
|
export type ShapeTypographyToken = "--pi-font-ui" | "--pi-font-display" | "--pi-font-mono" | "--pi-radius-xs" | "--pi-radius-sm" | "--pi-radius-md" | "--pi-radius-lg" | "--pi-radius-xl";
|
|
223
|
-
export type ThemeToken = LegacyThemeToken | SemanticSurfaceToken | ForegroundToken | ShapeTypographyToken;
|
|
222
|
+
export type ThemeToken = LegacyThemeToken | SemanticSurfaceToken | ForegroundToken | ShapeTypographyToken | MessageRoleToken;
|
|
223
|
+
/**
|
|
224
|
+
* Conversation message colours by who wrote the message. Optional: a theme that omits one gets it
|
|
225
|
+
* derived from its own tokens when it is applied (user from the selection colour and accent border,
|
|
226
|
+
* assistant from the surface, system from the purple family), so packs written before these tokens
|
|
227
|
+
* keep their user and assistant look and still get a system message that reads apart from the
|
|
228
|
+
* assistant's (owner, 2026-10-16).
|
|
229
|
+
*/
|
|
230
|
+
export type MessageRoleToken = "--pi-msg-user-bg" | "--pi-msg-user-border" | "--pi-msg-user-header-bg" | "--pi-msg-assistant-bg" | "--pi-msg-assistant-border" | "--pi-msg-assistant-header-bg" | "--pi-msg-system-bg" | "--pi-msg-system-border" | "--pi-msg-system-header-bg";
|
|
224
231
|
/**
|
|
225
232
|
* Foregrounds a theme may name for a filled surface it owns. Optional by
|
|
226
233
|
* design: a theme that omits one keeps the previous fallback, which is why
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gang-of-beads/pi-web-plugin-api",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"description": "Lightweight PI WEB browser and server plugin contracts, with TypeScript declarations and public runtime helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Gang of Beads",
|