@bndynet/dsh-my-brand 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +83 -2
- package/cordis.patch.yml +6 -0
- package/icon.svg +9 -0
- package/lib/client.js +134 -0
- package/lib/index.js +5 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +62 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bndynet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @bndynet/dsh-my-brand
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A DSH bundle that gives the Web client the **Harness** identity:
|
|
4
|
+
|
|
5
|
+
| Surface | Result |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Sidebar brand row | Harness colour mark + `Harness` wordmark |
|
|
8
|
+
| Collapsed sidebar rail | Harness colour mark |
|
|
9
|
+
| Empty-session hero | Harness colour mark before the headline |
|
|
10
|
+
| Home headline | `Harness` (the `预览版` / `Preview` badge stays) |
|
|
11
|
+
| Browser tab icon | Harness colour mark |
|
|
12
|
+
|
|
13
|
+
The mark, wordmark and headline are replaced for every UI language. The
|
|
14
|
+
document title, the installable-app (PWA) icons and the home whale decoration
|
|
15
|
+
from the official brand plugin are intentionally left alone.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- DSH **0.2.2-rc.5** Web client (the bundle pins this in `engines.dsh`)
|
|
20
|
+
- Node.js **>= 24.9.0**
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
From npm (after the package is published):
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
dsh plugin add @bndynet/dsh-my-brand
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
or in the Web UI: **Plugins** → **Add plugin** → `@bndynet/dsh-my-brand`
|
|
31
|
+
→ **Enable now**. A packed tarball works the same way by absolute path.
|
|
32
|
+
|
|
33
|
+
The bundle inserts one row, `my-brand`, and takes effect after a page
|
|
34
|
+
refresh. No build step runs on install; `lib/` is plain ESM.
|
|
35
|
+
|
|
36
|
+
## Publish (owner)
|
|
37
|
+
|
|
38
|
+
Releases go through GitHub Actions (`.github/workflows/publish.yml`), which
|
|
39
|
+
reuses the `bndynet/gh.flows` npm workflow:
|
|
40
|
+
|
|
41
|
+
- publishing a GitHub Release publishes the `package.json` version to `latest`;
|
|
42
|
+
- a manual run only tests unless **publish_enabled** is checked, and
|
|
43
|
+
**publish-version** can bump major/minor/patch and push the `vX.Y.Z` tag.
|
|
44
|
+
|
|
45
|
+
Before the first run, register the workflow as an npm Trusted Publisher in the
|
|
46
|
+
package settings on npmjs.com: repository `bndynet/dsh-my-brand`, workflow
|
|
47
|
+
`publish.yml`, environment empty. OIDC needs no `NPM_TOKEN` and adds a
|
|
48
|
+
provenance attestation, which relies on the `repository` field in
|
|
49
|
+
`package.json`.
|
|
50
|
+
|
|
51
|
+
There is no build step and no dependencies: `lib/` ships as-is and `npm test`
|
|
52
|
+
(`test/smoke.mjs`) is the only check. `npm pack` remains useful locally to
|
|
53
|
+
inspect the tarball; the `.tgz` is a pack artifact and is gitignored.
|
|
54
|
+
|
|
55
|
+
A directory install (`pnpm add <dir>`) links the checkout, so the folder must
|
|
56
|
+
stay in place; an npm or tarball install copies the package into the profile.
|
|
57
|
+
Keep `engines.dsh` in step with the DSH release you verified.
|
|
58
|
+
|
|
59
|
+
## How it works
|
|
60
|
+
|
|
61
|
+
`lib/index.js` is the empty Host half that keeps the Loader row. The Web
|
|
62
|
+
module in `lib/client.js`:
|
|
63
|
+
|
|
64
|
+
- registers `sidebar.brand.mark`, `sidebar.brand.name` and
|
|
65
|
+
`conversation.hero.brand.mark` at priority `-1000`, which shadows the shipped
|
|
66
|
+
occupants (a single slot rejects a second registration at the same priority);
|
|
67
|
+
- injects one stylesheet rule that swaps the home headline for `Harness`;
|
|
68
|
+
- repoints the tab icon at an inline copy of the mark and restores the original
|
|
69
|
+
`href` values on unload.
|
|
70
|
+
|
|
71
|
+
## Notes and limitations
|
|
72
|
+
|
|
73
|
+
- Web client only; the terminal/Desktop shells are unaffected.
|
|
74
|
+
- The headline rule targets the hero's `titleGroup` markup and the tab icon is
|
|
75
|
+
replaced at runtime, so both are checked against the pinned DSH version.
|
|
76
|
+
Bump `engines.dsh` only after re-verifying.
|
|
77
|
+
- PWA manifest icons stay the DSH artwork because they are served statically,
|
|
78
|
+
not part of the client DOM.
|
|
79
|
+
- Uninstall or disable the bundle to return to the stock identity; nothing is
|
|
80
|
+
written outside the profile.
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">Harness</title>
|
|
3
|
+
<rect width="128" height="128" rx="28" fill="#151517"/>
|
|
4
|
+
<g transform="translate(24 39.95) scale(3.3333)">
|
|
5
|
+
<path fill="#d33e32" d="M0 0h14.43v4.79H0z"/>
|
|
6
|
+
<path fill="#4d7fbd" d="M0 9.64h4.79v4.79H0z"/>
|
|
7
|
+
<path fill="#65b34b" d="M19.21 0H24v14.43H9.64V9.64h9.57z"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web client half of the Harness branding bundle.
|
|
3
|
+
*
|
|
4
|
+
* Occupies the app-level brand slots and decorations:
|
|
5
|
+
* - `sidebar.brand.mark` — the colour mark in the expanded row and rail
|
|
6
|
+
* - `sidebar.brand.name` — the `Harness` wordmark beside it
|
|
7
|
+
* - `conversation.hero.brand.mark` — the mark before the home headline
|
|
8
|
+
*
|
|
9
|
+
* The shipped occupants register at priority 0, so a lower priority shadows
|
|
10
|
+
* them (`lowest renders`); registering at the same priority would throw for a
|
|
11
|
+
* single slot. The home headline itself is owned text rather than a slot, so a
|
|
12
|
+
* small generated-content rule in the injected stylesheet replaces it, and the
|
|
13
|
+
* tab icon is re-pointed at an inline copy of the mark.
|
|
14
|
+
*/
|
|
15
|
+
window.__ModuleLoader__.load({
|
|
16
|
+
id: '@bndynet/dsh-my-brand',
|
|
17
|
+
factory(require) {
|
|
18
|
+
const React = require('react')
|
|
19
|
+
const h = React.createElement
|
|
20
|
+
|
|
21
|
+
const PACKAGE = '@bndynet/dsh-my-brand'
|
|
22
|
+
const PRIORITY = -1000
|
|
23
|
+
|
|
24
|
+
/** The mark artwork: 24 × 14.43 units, the same paths as the logo lockup. */
|
|
25
|
+
const MARK_PATHS = [
|
|
26
|
+
{ key: 'red', fill: '#d33e32', d: 'M0 0h14.43v4.79H0z' },
|
|
27
|
+
{ key: 'blue', fill: '#4d7fbd', d: 'M0 9.64h4.79v4.79H0z' },
|
|
28
|
+
{ key: 'green', fill: '#65b34b', d: 'M19.21 0H24v14.43H9.64V9.64h9.57z' },
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
/** Keep the mark vertically centred inside its square slot box. */
|
|
32
|
+
const MARK_OFFSET = 'translate(0 4.785)'
|
|
33
|
+
|
|
34
|
+
function markPaths() {
|
|
35
|
+
return MARK_PATHS.map((path) => h('path', { key: path.key, fill: path.fill, d: path.d }))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function HarnessMark({ size = 24, className }) {
|
|
39
|
+
return h(
|
|
40
|
+
'svg',
|
|
41
|
+
{
|
|
42
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
43
|
+
width: size,
|
|
44
|
+
height: size,
|
|
45
|
+
viewBox: '0 0 24 24',
|
|
46
|
+
className,
|
|
47
|
+
'aria-hidden': 'true',
|
|
48
|
+
focusable: 'false',
|
|
49
|
+
style: { display: 'block', flex: 'none' },
|
|
50
|
+
},
|
|
51
|
+
h('g', { transform: MARK_OFFSET }, markPaths()),
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function HarnessName() {
|
|
56
|
+
return h('span', { style: { letterSpacing: 0, whiteSpace: 'nowrap' } }, 'Harness')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const FAVICON_SVG = [
|
|
60
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">',
|
|
61
|
+
`<g transform="${MARK_OFFSET}">`,
|
|
62
|
+
'<path fill="#d33e32" d="M0 0h14.43v4.79H0z"/>',
|
|
63
|
+
'<path fill="#4d7fbd" d="M0 9.64h4.79v4.79H0z"/>',
|
|
64
|
+
'<path fill="#65b34b" d="M19.21 0H24v14.43H9.64V9.64h9.57z"/>',
|
|
65
|
+
'</g></svg>',
|
|
66
|
+
].join('')
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The home headline is rendered from the conversation package's own text,
|
|
70
|
+
* with no slot to occupy; replace it with the brand name for every locale.
|
|
71
|
+
*/
|
|
72
|
+
const STYLES = [
|
|
73
|
+
'/* @bndynet/dsh-my-brand */',
|
|
74
|
+
'[class*="titleGroup"] > span:first-child { display: none !important; }',
|
|
75
|
+
'[class*="titleGroup"]::before { content: "Harness"; }',
|
|
76
|
+
].join('\n')
|
|
77
|
+
|
|
78
|
+
/** Install the headline stylesheet; returns its disposal. */
|
|
79
|
+
function installStyles() {
|
|
80
|
+
const tag = document.createElement('style')
|
|
81
|
+
tag.dataset.plugin = PACKAGE
|
|
82
|
+
tag.dataset.pluginCss = `${PACKAGE}/brand.css`
|
|
83
|
+
tag.textContent = STYLES
|
|
84
|
+
document.head.appendChild(tag)
|
|
85
|
+
return () => {
|
|
86
|
+
tag.remove()
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Point the browser tab icon at the mark; returns its restoration. */
|
|
91
|
+
function installFavicon() {
|
|
92
|
+
const href = `data:image/svg+xml,${encodeURIComponent(FAVICON_SVG)}`
|
|
93
|
+
const links = Array.from(document.querySelectorAll('link[rel~="icon"]'))
|
|
94
|
+
const previous = links.map((link) => [link, link.getAttribute('href')])
|
|
95
|
+
const created = []
|
|
96
|
+
if (links.length === 0) {
|
|
97
|
+
const link = document.createElement('link')
|
|
98
|
+
link.setAttribute('rel', 'icon')
|
|
99
|
+
link.setAttribute('type', 'image/svg+xml')
|
|
100
|
+
link.setAttribute('href', href)
|
|
101
|
+
document.head.appendChild(link)
|
|
102
|
+
created.push(link)
|
|
103
|
+
} else {
|
|
104
|
+
for (const link of links) link.setAttribute('href', href)
|
|
105
|
+
}
|
|
106
|
+
return () => {
|
|
107
|
+
for (const [link, hrefBefore] of previous) {
|
|
108
|
+
if (hrefBefore === null) link.removeAttribute('href')
|
|
109
|
+
else link.setAttribute('href', hrefBefore)
|
|
110
|
+
}
|
|
111
|
+
for (const link of created) link.remove()
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function apply(ctx) {
|
|
116
|
+
ctx.slots.inject('sidebar.brand.mark', () => ctx.slots.inject('sidebar.brand.name', function* () {
|
|
117
|
+
yield ctx.slots.register({ name: 'sidebar.brand.mark', priority: PRIORITY }, HarnessMark)
|
|
118
|
+
yield ctx.slots.register({ name: 'sidebar.brand.name', priority: PRIORITY }, HarnessName)
|
|
119
|
+
}))
|
|
120
|
+
|
|
121
|
+
ctx.slots.inject('conversation.hero.brand.mark', () => ctx.slots.register(
|
|
122
|
+
{ name: 'conversation.hero.brand.mark', priority: PRIORITY },
|
|
123
|
+
HarnessMark,
|
|
124
|
+
))
|
|
125
|
+
|
|
126
|
+
if (typeof document !== 'undefined') {
|
|
127
|
+
ctx.effect(installStyles)
|
|
128
|
+
ctx.effect(installFavicon)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return { inject: ['slots'], apply }
|
|
133
|
+
},
|
|
134
|
+
})
|
package/lib/index.js
ADDED
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Harness branding",
|
|
4
|
+
"description": "Replaces the DeepSeek Harness mark, wordmark and home headline with the Harness logo, and points the browser tab icon at the Harness mark. Web client only; the document title and installable-app icons are unchanged."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bndynet/dsh-my-brand",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Harness branding for the DSH Web client: logo mark, wordmark, home headline and browser icon.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/bndynet/dsh-my-brand.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/bndynet/dsh-my-brand#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/bndynet/dsh-my-brand/issues"
|
|
12
|
+
},
|
|
13
|
+
"author": "Bendy Zhang <zb@bndy.net>",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./lib/index.js",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./lib/index.js",
|
|
18
|
+
"./client": "./lib/client.js",
|
|
19
|
+
"./locale/*.json": "./locale/*.json",
|
|
20
|
+
"./icon": "./icon.svg",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"lib",
|
|
25
|
+
"cordis.patch.yml",
|
|
26
|
+
"locale",
|
|
27
|
+
"icon.svg",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=24.9.0",
|
|
33
|
+
"dsh": "0.2.2-rc.5"
|
|
34
|
+
},
|
|
35
|
+
"dsh": {
|
|
36
|
+
"bundle": {
|
|
37
|
+
"patch": "./cordis.patch.yml"
|
|
38
|
+
},
|
|
39
|
+
"client": {
|
|
40
|
+
"platform": "web",
|
|
41
|
+
"immediately": true,
|
|
42
|
+
"inject": [
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
44
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"dsh-plugin",
|
|
51
|
+
"deepseek-harness",
|
|
52
|
+
"brand",
|
|
53
|
+
"logo"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"test": "node test/smoke.mjs",
|
|
57
|
+
"prepack": "npm test"
|
|
58
|
+
},
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public",
|
|
62
|
+
"registry": "https://registry.npmjs.org"
|
|
63
|
+
}
|
|
64
|
+
}
|