@steerable/agent-shell-web 0.6.24 → 0.6.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/package.json +4 -4
- package/src/brand.ts +8 -0
- package/src/components/AgentSidebar.tsx +2 -23
- package/src/components/BrandLockup.tsx +24 -0
- package/vite.base.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steerable/agent-shell-web",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Steerable framework — product-neutral renderer SPA source for @steerable/agent-shell (React + Vite). Consumed by product web entry points via the `@/` alias (anchored at this package's src/) and the createProductViteConfig factory. Published as a source package (src/), plus the compiled vite.base config factory (vite.base.js + .d.ts) for Node-side config loading.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"react-router-dom": "^6.30.0",
|
|
47
47
|
"rehype-raw": "^7.0.0",
|
|
48
48
|
"remark-gfm": "^4.0.1",
|
|
49
|
-
"@steerable/agent-ui": "0.6.
|
|
50
|
-
"@steerable/agent-protocol": "0.6.
|
|
49
|
+
"@steerable/agent-ui": "0.6.25",
|
|
50
|
+
"@steerable/agent-protocol": "0.6.25"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@tailwindcss/vite": "^4.3.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "^5.8.3",
|
|
61
61
|
"vite": "^5.4.21",
|
|
62
62
|
"vitest": "^3.2.4",
|
|
63
|
-
"@steerable/pack-sdk": "0.6.
|
|
63
|
+
"@steerable/pack-sdk": "0.6.25"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"gen": "echo agent-shell-web",
|
package/src/brand.ts
CHANGED
|
@@ -15,6 +15,14 @@ export const LOCAL_ASSISTANT_AGENT_ID = 'local-assistant';
|
|
|
15
15
|
|
|
16
16
|
export const BRAND_NAME: string = import.meta.env.VITE_BRAND_NAME ?? 'Steerable Shell';
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* 品牌锁头标题。产品/包可在 brand.title 注入;空字符串表示不配标题,
|
|
20
|
+
* 侧栏只按原比例显示 logo。未 define 时回落 displayName,避免旧
|
|
21
|
+
* vite.base.js 漏注入时露出壳默认名。
|
|
22
|
+
*/
|
|
23
|
+
export const BRAND_TITLE: string =
|
|
24
|
+
import.meta.env.VITE_BRAND_TITLE ?? import.meta.env.VITE_BRAND_NAME ?? 'Steerable Shell';
|
|
25
|
+
|
|
18
26
|
/** shell 默认 logo(中性通用图标);包品牌 logo 由包 web 模块注册覆盖。 */
|
|
19
27
|
let brandLogoUrl: string = shellLogoUrl;
|
|
20
28
|
|
|
@@ -120,13 +120,7 @@ import {
|
|
|
120
120
|
import type { UseChatsAndAgentsResult } from '@/hooks/useChatsAndAgents';
|
|
121
121
|
import type { PackChatSlotContribution } from '@/packs/registry';
|
|
122
122
|
import type { RightPanelState } from '@/layouts/AgentLayout';
|
|
123
|
-
|
|
124
|
-
// /favicon.png 输出,dev 模式下 dev server 提供根路径所以能加载,但打包成
|
|
125
|
-
// Electron 后渲染进程走 file:// 协议,/favicon.png 会被解析成文件系统根目录
|
|
126
|
-
// 下的 favicon.png(必然 404)。改成模块导入后,Vite 会把图片放到 dist/assets
|
|
127
|
-
// 下并发出 base-relative URL,配合 vite.config.ts 的 `base: './'` 在两种模式
|
|
128
|
-
// 下都能正确加载。
|
|
129
|
-
import { getBrandLogoUrl, BRAND_NAME } from '@/brand';
|
|
123
|
+
import { BrandLockup } from '@/components/BrandLockup';
|
|
130
124
|
|
|
131
125
|
const DEFAULT_DOT_COLOR = '#7c3aed';
|
|
132
126
|
|
|
@@ -627,22 +621,7 @@ export function AgentSidebar({
|
|
|
627
621
|
<div className="flex h-full w-full flex-col border-r border-agent-border/60 bg-agent-muted/70 backdrop-blur-md">
|
|
628
622
|
{/* ───── Brand + actions ───── */}
|
|
629
623
|
<div className="flex h-12 flex-shrink-0 items-center justify-between px-3">
|
|
630
|
-
<
|
|
631
|
-
{/*
|
|
632
|
-
品牌 logo —— src 用 module-imported asset,不要写 /favicon.png(见
|
|
633
|
-
文件顶部 import 的注释)。shell 默认是中性通用图标;产品品牌
|
|
634
|
-
logo 由激活包的 web 模块在注册时注入(getBrandLogoUrl)。
|
|
635
|
-
*/}
|
|
636
|
-
<img
|
|
637
|
-
src={getBrandLogoUrl()}
|
|
638
|
-
alt={BRAND_NAME}
|
|
639
|
-
className="h-6 w-6 flex-shrink-0 select-none"
|
|
640
|
-
draggable={false}
|
|
641
|
-
/>
|
|
642
|
-
<span className="truncate text-sm font-semibold tracking-tight text-agent-foreground">
|
|
643
|
-
{BRAND_NAME}
|
|
644
|
-
</span>
|
|
645
|
-
</div>
|
|
624
|
+
<BrandLockup />
|
|
646
625
|
<div className="flex items-center gap-1">
|
|
647
626
|
<button
|
|
648
627
|
type="button"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BRAND_NAME, BRAND_TITLE, getBrandLogoUrl } from '@/brand';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 侧栏品牌锁头。配了 brand.title 就 logo + 标题;没配标题则只显示 logo,
|
|
5
|
+
* 并按原图宽高比缩放(一体字标不要压成方图)。
|
|
6
|
+
*/
|
|
7
|
+
export function BrandLockup() {
|
|
8
|
+
const title = BRAND_TITLE.trim();
|
|
9
|
+
return (
|
|
10
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
11
|
+
<img
|
|
12
|
+
src={getBrandLogoUrl()}
|
|
13
|
+
alt={title || BRAND_NAME}
|
|
14
|
+
className="h-6 w-auto max-w-[10rem] flex-shrink-0 select-none object-contain object-left"
|
|
15
|
+
draggable={false}
|
|
16
|
+
/>
|
|
17
|
+
{title ? (
|
|
18
|
+
<span className="truncate text-sm font-semibold tracking-tight text-agent-foreground">
|
|
19
|
+
{title}
|
|
20
|
+
</span>
|
|
21
|
+
) : null}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
package/vite.base.js
CHANGED
|
@@ -50,6 +50,7 @@ export function createProductViteConfig(options) {
|
|
|
50
50
|
// logo 不走 define——资产必须静态 import 才进 bundle,由包 web 模块
|
|
51
51
|
// 在注册时经 setBrandLogoUrl 注入(本包 src/brand.ts)。
|
|
52
52
|
'import.meta.env.VITE_BRAND_NAME': JSON.stringify(brand?.displayName ?? 'Steerable Shell'),
|
|
53
|
+
'import.meta.env.VITE_BRAND_TITLE': JSON.stringify(brand?.title ?? ''),
|
|
53
54
|
'import.meta.env.VITE_BRAND_TAGLINE': JSON.stringify(brand?.tagline ?? '一款本地桌面 AI 伙伴'),
|
|
54
55
|
'import.meta.env.VITE_DEFAULT_AGENT_ID': JSON.stringify(brand?.defaultAgentId ?? 'local-assistant'),
|
|
55
56
|
},
|