@volter-ai-dev/supercode-ui 0.1.24 → 0.1.25
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 +3 -1
- package/components.mjs +22 -0
- package/index.d.ts +1 -0
- package/logo.d.ts +1 -1
- package/logo.mjs +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
Conversation,
|
|
60
60
|
SessionList,
|
|
61
61
|
} from '@volter-ai-dev/supercode-ui/preact';
|
|
62
|
-
import { HarnessLogo } from '@volter-ai-dev/supercode-ui/preact/logo';
|
|
62
|
+
import { HarnessLogo, harnessLogoDataUrl } from '@volter-ai-dev/supercode-ui/preact/logo';
|
|
63
63
|
import { groupConversation } from '@volter-ai-dev/supercode-ui/core';
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -70,6 +70,8 @@ formatters, and intent constructors live at `supercode-ui/core` and have no DOM
|
|
|
70
70
|
For genuine partial delivery, the `preact/logo`, `preact/icon`, `preact/conversation`, `preact/sessions`,
|
|
71
71
|
`preact/composer`, and `preact/messenger` subpaths are independently tree-shaken artifacts; taking
|
|
72
72
|
the logo does not pull in Markdown, the messenger, or session-list code.
|
|
73
|
+
`harnessLogoDataUrl(id)` gives non-Preact launchers the same self-contained canonical SVG; it
|
|
74
|
+
returns `null` for an unknown harness rather than inventing a fallback identity.
|
|
73
75
|
|
|
74
76
|
## Bind directly to the headless controller
|
|
75
77
|
|
package/components.mjs
CHANGED
|
@@ -1952,6 +1952,27 @@ var LOGOS = {
|
|
|
1952
1952
|
function hasHarnessLogo(id) {
|
|
1953
1953
|
return Object.hasOwn(LOGOS, id);
|
|
1954
1954
|
}
|
|
1955
|
+
var LOGO_CHROME = {
|
|
1956
|
+
codex: { background: "#f7f7f5", color: "#111" },
|
|
1957
|
+
gemini: { background: "#f7f7f5", color: "#6e79dc" },
|
|
1958
|
+
goose: { background: "#f7f7f5", color: "#101010" },
|
|
1959
|
+
pi: { background: "#efefeb", color: "#111" },
|
|
1960
|
+
supercode: { background: "#111923", color: "#f7f7f5" }
|
|
1961
|
+
};
|
|
1962
|
+
function escapeSvgAttribute(value) {
|
|
1963
|
+
return String(value).replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
|
|
1964
|
+
}
|
|
1965
|
+
function harnessLogoDataUrl(id) {
|
|
1966
|
+
const logo = LOGOS[id];
|
|
1967
|
+
if (!logo) return null;
|
|
1968
|
+
const chrome = LOGO_CHROME[id] ?? { background: "#111", color: id === "claude-code" ? "#d97757" : "#f7f7f5" };
|
|
1969
|
+
const glyph = logo.paths.map(([tag, attributes]) => {
|
|
1970
|
+
const serialized = Object.entries(attributes).map(([name, value]) => `${name}="${escapeSvgAttribute(value)}"`).join(" ");
|
|
1971
|
+
return `<${tag} ${serialized}/>`;
|
|
1972
|
+
}).join("");
|
|
1973
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="19" fill="${chrome.background}" stroke="#383a42"/><svg x="7" y="7" width="26" height="26" viewBox="${logo.viewBox}" color="${chrome.color}" fill="currentColor" preserveAspectRatio="xMidYMid meet">${glyph}</svg></svg>`;
|
|
1974
|
+
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
1975
|
+
}
|
|
1955
1976
|
function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
1956
1977
|
const logo = LOGOS[id];
|
|
1957
1978
|
useEffect5(() => {
|
|
@@ -2535,5 +2556,6 @@ export {
|
|
|
2535
2556
|
ToolRow,
|
|
2536
2557
|
TranscriptEntry,
|
|
2537
2558
|
UiIcon,
|
|
2559
|
+
harnessLogoDataUrl,
|
|
2538
2560
|
hasHarnessLogo
|
|
2539
2561
|
};
|
package/index.d.ts
CHANGED
|
@@ -363,6 +363,7 @@ export function HarnessLogo(props: { id: HarnessId; activity?: SessionActivity;
|
|
|
363
363
|
export type UiIconName = 'attach' | 'back' | 'check' | 'chevron' | 'close' | 'copy' | 'down' | 'menu' | 'plus' | 'search' | 'send' | 'stop';
|
|
364
364
|
export function UiIcon(props: { name: UiIconName; size?: number; class?: string }): VNode | null;
|
|
365
365
|
export function hasHarnessLogo(id: string): boolean;
|
|
366
|
+
export function harnessLogoDataUrl(id: string): string | null;
|
|
366
367
|
export function ImageViewer(props: { items: TranscriptImage[]; index: number; adapter?: Pick<UiAdapter, 'copyText' | 'resolveImage'>; onChange(index: number): void; onClose(): void }): VNode | null;
|
|
367
368
|
export function MessageImages(props: { items?: TranscriptImage[]; adapter?: Pick<UiAdapter, 'copyText' | 'resolveImage'> }): VNode | null;
|
|
368
369
|
export function LoadingStatus(props: { state: SupercodeUiState; compact?: boolean }): VNode;
|
package/logo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { HarnessId, SessionActivity } from './index.js';
|
|
2
|
-
export { HarnessLogo, hasHarnessLogo } from './index.js';
|
|
2
|
+
export { HarnessLogo, harnessLogoDataUrl, hasHarnessLogo } from './index.js';
|
package/logo.mjs
CHANGED
|
@@ -48,6 +48,27 @@ var LOGOS = {
|
|
|
48
48
|
function hasHarnessLogo(id) {
|
|
49
49
|
return Object.hasOwn(LOGOS, id);
|
|
50
50
|
}
|
|
51
|
+
var LOGO_CHROME = {
|
|
52
|
+
codex: { background: "#f7f7f5", color: "#111" },
|
|
53
|
+
gemini: { background: "#f7f7f5", color: "#6e79dc" },
|
|
54
|
+
goose: { background: "#f7f7f5", color: "#101010" },
|
|
55
|
+
pi: { background: "#efefeb", color: "#111" },
|
|
56
|
+
supercode: { background: "#111923", color: "#f7f7f5" }
|
|
57
|
+
};
|
|
58
|
+
function escapeSvgAttribute(value) {
|
|
59
|
+
return String(value).replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
|
|
60
|
+
}
|
|
61
|
+
function harnessLogoDataUrl(id) {
|
|
62
|
+
const logo = LOGOS[id];
|
|
63
|
+
if (!logo) return null;
|
|
64
|
+
const chrome = LOGO_CHROME[id] ?? { background: "#111", color: id === "claude-code" ? "#d97757" : "#f7f7f5" };
|
|
65
|
+
const glyph = logo.paths.map(([tag, attributes]) => {
|
|
66
|
+
const serialized = Object.entries(attributes).map(([name, value]) => `${name}="${escapeSvgAttribute(value)}"`).join(" ");
|
|
67
|
+
return `<${tag} ${serialized}/>`;
|
|
68
|
+
}).join("");
|
|
69
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="19" fill="${chrome.background}" stroke="#383a42"/><svg x="7" y="7" width="26" height="26" viewBox="${logo.viewBox}" color="${chrome.color}" fill="currentColor" preserveAspectRatio="xMidYMid meet">${glyph}</svg></svg>`;
|
|
70
|
+
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
71
|
+
}
|
|
51
72
|
function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
52
73
|
const logo = LOGOS[id];
|
|
53
74
|
useEffect(() => {
|
|
@@ -61,5 +82,6 @@ function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
|
61
82
|
}
|
|
62
83
|
export {
|
|
63
84
|
HarnessLogo,
|
|
85
|
+
harnessLogoDataUrl,
|
|
64
86
|
hasHarnessLogo
|
|
65
87
|
};
|