Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ npx @deepseek-ai/dsh plugin --profile web add file:%CD%/integrations/deepseek-ha

需要 Codex Desktop、系统托盘或懒得留源码时,再下 [Windows 安装包](https://github.com/starsstreaming/beautiCode/releases/latest)。

运行
然后自己启动

```text
beautiCode-Setup-1.0.1-win-x64.exe
```sh
dsh web
# 未把 dsh 装到 PATH 时:
npx @deepseek-ai/dsh web
```

安装包自带 Node.js,不需要另外安装 Node.js、npm 或 pnpm。安装结束时会自动写入 DSH 插件。若你改过安装目录,以安装文件夹里的 `集成说明.txt` 为准。
Expand Down
29 changes: 27 additions & 2 deletions apps/tray/session-host.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* POST /discover {}
* POST /shutdown {}
*/
import fs from "node:fs";
import http from "node:http";
import process from "node:process";
import path from "node:path";
Expand Down Expand Up @@ -118,6 +119,25 @@ if (portArg) {
sessionOpts.autoDiscover = false;
}
if (dataRoot) sessionOpts.dataRoot = path.resolve(dataRoot);
const bundledGalleryHi = path.join(
repoRoot,
"assets",
"themes",
"internal-beyond",
"bg-canvas-4k.png",
);
const bundledGalleryLo = path.join(
repoRoot,
"assets",
"themes",
"internal-beyond",
"bg-canvas.png",
);
if (fs.existsSync(bundledGalleryHi)) {
sessionOpts.bundledGalleryImagePath = bundledGalleryHi;
} else if (fs.existsSync(bundledGalleryLo)) {
sessionOpts.bundledGalleryImagePath = bundledGalleryLo;
}

const SessionClass = hostKind === "dsh" ? adapter.DshSession : adapter.BeautiSession;
const session = new SessionClass(sessionOpts);
Expand Down Expand Up @@ -172,6 +192,7 @@ function publicTheme(theme) {
name: theme.name,
type: theme.type,
savedAt: theme.savedAt,
...(theme.bundled ? { bundled: true } : {}),
...(typeof theme.videoPositionSec === "number"
? { videoPositionSec: theme.videoPositionSec }
: {}),
Expand Down Expand Up @@ -287,10 +308,14 @@ const server = http.createServer(
send(res, 400, { ok: false, error: "必须提供 imagePath。" });
return;
}
const result = await session.apply({
const imageInput = {
type: "image",
imagePath: path.resolve(body.imagePath),
});
};
if (body.effects && typeof body.effects === "object") {
imageInput.effects = body.effects;
}
const result = await session.apply(imageInput);
send(res, result.ok ? 200 : 422, result);
return;
}
Expand Down
11 changes: 7 additions & 4 deletions apps/tray/start-tray.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1936,15 +1936,13 @@ function Rebuild-BcTrayMenu {
})
[void]$savedMenu.DropDownItems.Add($item)
}
[void]$savedMenu.DropDownItems.Add(
(New-Object System.Windows.Forms.ToolStripSeparator)
)
$deleteMenu = New-Object System.Windows.Forms.ToolStripMenuItem
$deleteMenu.Text = $L.DeleteTheme
foreach ($theme in $themes) {
$deleteId = [string]$theme.id
$deleteName = [string]$theme.name
if (-not $deleteId) { continue }
if ($theme.bundled -eq $true) { continue }
$deleteItem = New-Object System.Windows.Forms.ToolStripMenuItem
$deleteItem.Text = $deleteName
$deleteItem.Tag = $deleteId
Expand Down Expand Up @@ -1973,7 +1971,12 @@ function Rebuild-BcTrayMenu {
})
[void]$deleteMenu.DropDownItems.Add($deleteItem)
}
[void]$savedMenu.DropDownItems.Add($deleteMenu)
if ($deleteMenu.DropDownItems.Count -gt 0) {
[void]$savedMenu.DropDownItems.Add(
(New-Object System.Windows.Forms.ToolStripSeparator)
)
[void]$savedMenu.DropDownItems.Add($deleteMenu)
}
}
} catch {
$empty = New-Object System.Windows.Forms.ToolStripMenuItem
Expand Down
9 changes: 9 additions & 0 deletions assets/themes/internal-beyond/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Internal / Infernal atmosphere assets

`bg-internal.jpg`, `bg-infernal.jpg`, `bg-canvas.png`, and the local
`bg-canvas-4k.png` (Real-ESRGAN 4x then 3840×2160) are visual materials
from [Internal Beyond](https://github.com/Sui-IB/InternalBeyond) by Sui.

They remain under that project's CC BY-NC-SA 4.0 terms for visual assets.
BeautiCode ships them as bundled workspace themes for local, non-commercial use.
The project name, logo, and character identity are not licensed here.
Binary file added assets/themes/internal-beyond/bg-canvas-4k.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/internal-beyond/bg-canvas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/internal-beyond/bg-infernal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/internal-beyond/bg-internal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion integrations/deepseek-harness/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@

beautiCode **不启动** DeepSeek Harness。请先自己运行 `dsh web`。

安装包和托盘会把插件写入你的 DSH profile,不需要 pnpm。源码环境也可以手动(`dsh plugin add` 需要 pnpm):
推荐在仓库根目录一键写入插件(不需要 pnpm):

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-dsh-plugin.ps1
npx @deepseek-ai/dsh web
```

也可以手动(`dsh plugin add` 需要 pnpm):

```sh
dsh plugin --profile web add file:%CD%/integrations/deepseek-harness
Expand Down
51 changes: 44 additions & 7 deletions integrations/deepseek-harness/agent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
stripPathQuotes,
} from "./control-client.mjs";
import { resolveApplyBackend, stopInProcessSession } from "./host-apply.mjs";
import { ATMOSPHERE_PRESETS, effectsForPreset, presetImagePath } from "./presets.mjs";

const APPLY_TIMEOUT_MS = 180_000;
const QUICK_TIMEOUT_MS = 15_000;
Expand Down Expand Up @@ -98,30 +99,66 @@ export function createBeauticodeActions(dataRootOrOptions) {
}

return {
async applyImage(imagePath, signal) {
async applyImage(imagePath, signal, options) {
const inspected = await inspectLocalMedia(imagePath);
if (!inspected.ok) fail(inspected.error);
if (inspected.kind !== "image") {
fail("beauticode_apply_image 只接受图片文件。");
}
const effects = effectsForPreset(options?.effects?.preset) || options?.effects || null;
const input = { type: "image", imagePath: inspected.path };
if (effects) input.effects = effects;
const resolved = await backend();
if (resolved.kind === "tray") {
const body = { imagePath: inspected.path };
if (effects) body.effects = effects;
return unwrapApply(
await request({
method: "POST",
path: "/apply/image",
body: { imagePath: inspected.path },
body,
signal,
}),
"image",
"已将图片设为背景。",
);
}
return unwrapApply(
await resolved.session.apply({ type: "image", imagePath: inspected.path }),
"image",
"已将图片设为背景。",
);
return unwrapApply(await resolved.session.apply(input), "image", "已将图片设为背景。");
},

async applyPreset(id, signal) {
const preset = ATMOSPHERE_PRESETS[id];
const imagePath = presetImagePath(id);
if (!preset || !imagePath) fail("未找到内置主题文件。");
const result = await this.applyImage(imagePath, signal, {
effects: effectsForPreset(id),
});
try {
await this.setTone(preset.tone, signal);
} catch {
/* tone is best-effort; the wallpaper still applied */
}
return {
...result,
atmosphere: id,
message: `已应用 ${preset.name} 活壁纸。`,
};
},

async setTone(tone, signal) {
const resolved = await backend();
const result =
resolved.kind === "tray"
? await request({
method: "POST",
path: "/mode/tone",
body: { tone },
signal,
timeoutMs: QUICK_TIMEOUT_MS,
})
: await resolved.session.setBackgroundTone(tone);
if (result.ok === false) fail(result.error || "无法切换背景色调。");
return { ok: true, tone: result.tone ?? tone };
},

async applyVideo(input, signal) {
Expand Down
Loading
Loading