Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ae2e3d3
[feat] desktop: add a bundled application and project sidebar
FayeSpica Nov 18, 2026
b58ae36
[ci] desktop: attach verified DMG to draft releases
FayeSpica Nov 18, 2026
5ec4d34
[fix] desktop: register terminal commands without overwriting files
FayeSpica Nov 18, 2026
61ced83
[ci] desktop: build and verify a Windows x64 installer
FayeSpica Nov 18, 2026
79f71d1
[fix] desktop: use UTF-8 for bundled CLI output
FayeSpica Nov 18, 2026
633df20
[ci] desktop: use the latest macOS runner
FayeSpica Nov 18, 2026
e2bf259
[fix] desktop: wait for onboarding during installer smoke tests
FayeSpica Nov 18, 2026
e0d0a0d
[test] desktop: verify Host shutdown before reopening
FayeSpica Nov 18, 2026
908d73c
[fix] desktop: wait for Host cleanup before Electron exits
FayeSpica Nov 18, 2026
8b609e0
[feat] desktop: allow choosing the Windows install directory
FayeSpica Nov 18, 2026
bf1bcce
[fix] ci: write portable Windows release checksums
FayeSpica Nov 18, 2026
c9e0310
[feat] desktop: share project navigation across macOS and Windows
FayeSpica Nov 18, 2026
edd6a85
[fix] desktop: reserve space for Windows caption controls [skip ci]
FayeSpica Nov 18, 2026
24eea37
[fix] desktop: keep one Python runtime in the Windows package
FayeSpica Nov 18, 2026
5b90cdf
[fix] desktop: isolate releases and repair window behavior
FayeSpica Nov 18, 2026
53a34e5
[ci] desktop: run packaging only for releases
FayeSpica Nov 18, 2026
b4099ea
[fix] assistant: keep composer controls on one row
FayeSpica Nov 18, 2026
b02f3dc
[fix] desktop: keep chat clear of the top bar
FayeSpica Nov 18, 2026
c09baa7
[bugfix] desktop: cancel stale canvas subscriptions
FayeSpica Nov 18, 2026
abf0833
[bugfix] desktop: keep canvas visible during project switches
FayeSpica Nov 18, 2026
4dde851
[bugfix] desktop: keep project sidebar stable during switches
FayeSpica Nov 18, 2026
4b8119b
[bugfix] canvas: decode embedded example images locally
FayeSpica Nov 18, 2026
4b1869e
[bugfix] desktop: synchronize fullscreen and await project recovery
FayeSpica Nov 18, 2026
dd7fd6e
[bugfix] desktop: preserve macOS test package signatures
FayeSpica Nov 19, 2026
710bf82
[merge] sync desktop branch with upstream main
FayeSpica Nov 19, 2026
92dd486
[bugfix] canvas: localize default project and assistant labels
FayeSpica Nov 19, 2026
7a2dd60
[docs] desktop: explain the desktop architecture
FayeSpica Nov 19, 2026
77c88b2
[bugfix] Download example canvases through the local Host
FayeSpica Nov 19, 2026
834df85
[test] Fix isolated example canvas and H3 browser checks
FayeSpica Nov 19, 2026
4600006
Merge branch 'main' of github.com:ThinkFlowLab/OpenDirector into desk…
FayeSpica Nov 19, 2026
cc3edc9
Merge branch 'main' of github.com:ThinkFlowLab/OpenDirector into desk…
FayeSpica Nov 19, 2026
d3adb70
[bugfix] Restore route and docs after conflict resolution
FayeSpica Nov 19, 2026
2935f47
[bugfix] desktop: stream uploads and fix image annotations
FayeSpica Nov 19, 2026
92e24cb
[test] Focus desktop window before checking sidebar search
FayeSpica Nov 19, 2026
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
212 changes: 212 additions & 0 deletions .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
name: Desktop release

on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
tag:
description: Existing release tag (for example, v0.1.4)
required: true
type: string

permissions:
contents: read

concurrency:
group: desktop-release-${{ inputs.tag || github.ref_name }}
cancel-in-progress: false

env:
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}

jobs:
macos:
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: refs/tags/${{ env.RELEASE_TAG }}
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .nvmrc
- name: Check release version and architecture
run: |
version=$(node -p 'require("./apps/desktop/package.json").version')
if [[ "$GITHUB_REPOSITORY" == "ThinkFlowLab/OpenDirector" ]]; then
test "$RELEASE_TAG" = "v$version"
else
[[ "$RELEASE_TAG" = "v$version" || "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-desktop-test\.[0-9]+$ && "${RELEASE_TAG%-desktop-test.*}" = "v$version" ]]
fi
echo "DESKTOP_VERSION=$version" >> "$GITHUB_ENV"
test "$(uname -m)" = arm64
- name: Prepare build tools
run: |
brew install uv
media="$RUNNER_TEMP/desktop-media"
mkdir -p "$media"
for tool in ffmpeg ffprobe; do
curl --fail --silent --show-error --location --retry 3 \
"https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/b6.1.2-rc.1/${tool}-darwin-arm64" \
--output "$media/$tool"
chmod +x "$media/$tool"
"$media/$tool" -version
done
echo "OPENDIRECTOR_FFMPEG_DIR=$media" >> "$GITHUB_ENV"
- name: Build desktop application
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
run: |
npm ci --prefix apps/desktop
npm run prepare:runtime --prefix apps/desktop
npm run pack --prefix apps/desktop
app="apps/desktop/build/mac-arm64/OpenDirector.app"
codesign --force --deep --sign - "$app"
codesign --verify --deep --strict "$app"
- name: Build and smoke-test DMG
run: |
staging="$RUNNER_TEMP/desktop-dmg"
mount="$RUNNER_TEMP/desktop-mount"
mkdir -p "$staging" "$mount" release-assets
ditto apps/desktop/build/mac-arm64/OpenDirector.app "$staging/OpenDirector.app"
ln -s /Applications "$staging/Applications"
dmg="OpenDirector-v${DESKTOP_VERSION}-mac-arm64-adhoc.dmg"
hdiutil create -volname OpenDirector -srcfolder "$staging" -format UDZO "release-assets/$dmg"
hdiutil attach "release-assets/$dmg" -readonly -nobrowse -mountpoint "$mount"
trap 'hdiutil detach "$mount"' EXIT
installed=$(mktemp -d "$RUNNER_TEMP/desktop-install.XXXXXX")/OpenDirector.app
ditto "$mount/OpenDirector.app" "$installed"
codesign --verify --deep --strict "$installed"
node apps/desktop/scripts/smoke.mjs "$installed/Contents/MacOS/OpenDirector"
codesign --verify --deep --strict "$installed"
cd release-assets
shasum -a 256 "$dmg" > "${dmg}.sha256"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: desktop-dmg
path: release-assets/
compression-level: 0
if-no-files-found: error

windows:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: refs/tags/${{ env.RELEASE_TAG }}
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .nvmrc
- name: Check release version and architecture
run: |
$version = node -p 'require("./apps/desktop/package.json").version'
$tagPattern = '^v' + [regex]::Escape($version) + '$'
if ($env:GITHUB_REPOSITORY -ne 'ThinkFlowLab/OpenDirector') {
$tagPattern = '^v' + [regex]::Escape($version) + '(-desktop-test\.[0-9]+)?$'
}
if ($env:RELEASE_TAG -cnotmatch $tagPattern -or (node -p process.arch) -ne 'x64') {
throw 'Expected a matching release tag and Windows x64'
}
"DESKTOP_VERSION=$version" >> $env:GITHUB_ENV
- name: Prepare build tools
run: |
choco install uv --yes --no-progress
if ($LASTEXITCODE -ne 0) { throw 'uv installation failed' }
$media = Join-Path $env:RUNNER_TEMP 'desktop-media'
New-Item -ItemType Directory -Path $media | Out-Null
foreach ($tool in 'ffmpeg', 'ffprobe') {
curl.exe --fail --silent --show-error --location --retry 3 `
"https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/b6.1.2-rc.1/${tool}-win32-x64" `
--output (Join-Path $media "$tool.exe")
if ($LASTEXITCODE -ne 0) { throw "Failed to download $tool" }
}
"OPENDIRECTOR_FFMPEG_DIR=$media" >> $env:GITHUB_ENV
- name: Build Windows installer
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
run: |
npm ci --prefix apps/desktop
if ($LASTEXITCODE -ne 0) { throw 'Desktop dependency installation failed' }
npm run prepare:runtime --prefix apps/desktop
if ($LASTEXITCODE -ne 0) { throw 'Runtime preparation failed' }
npm run pack:windows --prefix apps/desktop
if ($LASTEXITCODE -ne 0) { throw 'Windows packaging failed' }
- name: Smoke-test installed application
run: |
$name = "OpenDirector-v$env:DESKTOP_VERSION-win-x64-unsigned.exe"
$installer = Get-Item "apps/desktop/build/$name"
$install = Join-Path $env:RUNNER_TEMP 'OpenDirector'
$setup = Start-Process -FilePath $installer.FullName -ArgumentList "/S /D=$install" -Wait -PassThru
if ($setup.ExitCode -ne 0) { throw "Installer failed: $($setup.ExitCode)" }
node apps/desktop/scripts/smoke.mjs (Join-Path $install 'OpenDirector.exe')
if ($LASTEXITCODE -ne 0) { throw 'Installed application smoke test failed' }
$uninstaller = Get-Item (Join-Path $install 'Uninstall OpenDirector.exe')
$removal = Start-Process -FilePath $uninstaller.FullName -ArgumentList '/S' -Wait -PassThru
if ($removal.ExitCode -ne 0 -or (Test-Path (Join-Path $install 'OpenDirector.exe'))) {
throw 'Uninstall failed'
}
New-Item -ItemType Directory -Path release-assets | Out-Null
Copy-Item $installer.FullName release-assets
$hash = (Get-FileHash -Algorithm SHA256 $installer.FullName).Hash.ToLowerInvariant()
[IO.File]::WriteAllText((Join-Path (Get-Location) "release-assets/$name.sha256"), "$hash $name`n")
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: desktop-windows
path: release-assets/
compression-level: 0
if-no-files-found: error

prepare-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Find or create draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
draft=$(gh api --paginate "repos/$GH_REPO/releases" \
--jq ".[] | select(.tag_name == \"$RELEASE_TAG\") | .draft")
case "$draft" in
true) ;;
'') gh release create "$RELEASE_TAG" --verify-tag --draft --generate-notes ;;
*) echo "::error::Release $RELEASE_TAG is already published"; exit 1 ;;
esac

release-macos:
needs: [prepare-release, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: desktop-dmg
path: release-assets
- name: Attach verified installer to draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "$RELEASE_TAG" release-assets/* --clobber

release-windows:
needs: [prepare-release, windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: desktop-windows
path: release-assets
- name: Attach verified installer to draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "$RELEASE_TAG" release-assets/* --clobber
21 changes: 21 additions & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Desktop checks
on:
pull_request:
paths:
- 'apps/desktop/**'
- 'apps/api/src/opendirector_api/desktop.py'
- 'tests/test_desktop_host.py'
- '.github/workflows/desktop.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .nvmrc
- run: npm ci --ignore-scripts --prefix apps/desktop
- run: npm test --prefix apps/desktop
3 changes: 2 additions & 1 deletion .github/workflows/release-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ jobs:
curl --fail --silent -H 'X-OpenDirector-Request: 1' "$CREATION_API_URL/api/voice-test-health"
curl --silent --fail "$CREATION_WEB_URL/" >/dev/null
node tests/browser/voice_library.mjs
- name: Assistant auxiliary panels
- name: Assistant bilingual defaults and auxiliary panels
if: always() && steps.install.outcome == 'success' && matrix.journey == 'assistant'
timeout-minutes: 5
env:
Expand All @@ -288,6 +288,7 @@ jobs:
done
curl --fail --silent -H 'X-OpenDirector-Request: 1' "$CREATION_API_URL/api/creation-test-health"
curl --silent --fail "$CREATION_WEB_URL/" >/dev/null
node tests/browser/bilingual_defaults.mjs
node tests/browser/assistant_auxiliary_panels.mjs
- name: Print isolated service logs on failure
if: failure()
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,5 @@ __pycache__/

/build/
/packages/core/src/opendirector/_bundled/
/apps/desktop/runtime/
/apps/desktop/build/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include package.json package-lock.json index.html tsconfig.json vite.config.ts .
recursive-include src *
recursive-include packages/core/src *.py
recursive-include apps/api/src *.py
include apps/api/src/opendirector_api/example-canvases.json
recursive-include packages/agent/skills *
prune packages/core/src/opendirector/_bundled
prune node_modules
Expand Down
18 changes: 10 additions & 8 deletions apps/api/src/opendirector_api/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def update(self, project_id: UUID, session: str | None = None, *, draft: Draft |
value['messages'].append(begin)
value['messages'].append({'id': str(uuid5(UUID(begin['id']), 'assistant')),
'role': 'assistant', 'text': '', 'status': 'streaming',
**{key: begin[key] for key in ('model', 'runtime') if key in begin}})
**{key: begin[key] for key in ('model', 'modelIsCliDefault', 'runtime') if key in begin}})
value.update(draft='', draftContent=None, assets=[], skills=[])
changed = True
if finish is not None:
Expand All @@ -169,9 +169,9 @@ def list(self, project_id: UUID) -> dict:
current['conversationId'] = current.get('conversationId') or str(uuid5(project_id, 'assistant'))
return {'activeId': current['conversationId'], 'items': [
{'id': item['conversationId'],
'title': next((message['text'].strip().split('\n')[0][:48] or '素材对话'
'title': next((message['text'].strip().split('\n')[0][:48] or None
for message in item['messages'] if message['role'] == 'user'),
(item.get('draft') or '').strip().split('\n')[0][:48] or '新会话'),
(item.get('draft') or '').strip().split('\n')[0][:48] or None),
'messageCount': len(item['messages']),
'hasDraft': bool((item.get('draft') or '').strip() or item.get('assets') or item.get('skills'))}
for item in [current, *current.get('archivedConversations', [])]]}
Expand Down Expand Up @@ -245,7 +245,7 @@ async def follow(self):
await self.changed.wait()


def agent_routes(projects, generation, configs, provider=None) -> APIRouter:
def agent_routes(projects, generation, configs, provider=None, *, active=None) -> APIRouter:
router = APIRouter(prefix='/api/creation/projects/{project_id}/assistant')
conversations = Conversations(projects)
runtimes = AgentRuntimes(projects, generation, configs, provider)
Expand Down Expand Up @@ -282,7 +282,8 @@ def turn_jobs(project_id: UUID, turn_id: UUID):
errorDetails=job.errorDetails, asset=job.asset, adopted=job.adopted)
for job in jobs]

active: dict[UUID, tuple[UUID, asyncio.Task, RunEvents]] = {}
if active is None:
active = {}
admission: dict[UUID, asyncio.Lock] = {}

@router.get('')
Expand Down Expand Up @@ -394,7 +395,8 @@ async def turn(project_id: UUID, value: Turn, x_opendirector_session: UUID = Hea
for asset_id in value.assets:
if str(asset_id) not in assets:
raise ProjectError('引用素材不属于当前工程。', 409)
model = config['modelId'] if config else (value.runtimeModel or 'CLI 默认模型')
model = config['modelId'] if config else value.runtimeModel
model_is_cli_default = spec.modelSource == 'cli' and not model
model_selections = dict(value.modelSelections)
model_names = {row['id']: row['modelId'] for row in configs.list()}
preferences = {kind: {'modelConfigId': model_id, 'modelName': model_names.get(model_id)}
Expand All @@ -417,7 +419,7 @@ async def produce() -> None:
for asset in (assets[str(key)] for key in value.assets)],
'skills': value.skills, 'runtime': value.runtime, 'runtimeModel': value.runtimeModel,
'modelSelections': dict(value.modelSelections),
'model': model, 'status': 'complete'}
'model': model, 'modelIsCliDefault': model_is_cli_default, 'status': 'complete'}
saved = await asyncio.to_thread(conversations.update, project_id, session, begin=user,
conversation_id=value.conversationId, before_begin=validate_connection)
accepted = True
Expand Down Expand Up @@ -493,7 +495,7 @@ async def produce() -> None:
activity['status'] = 'interrupted'
saved = await asyncio.to_thread(conversations.update, project_id, finish={
'id': str(uuid5(value.id, 'assistant')), 'role': 'assistant', 'text': text, 'status': status,
'model': model,
'model': model, 'modelIsCliDefault': model_is_cli_default,
'runtime': value.runtime, 'thinking': value.thinking, 'tools': activities,
'sources': list(sources.values()),
**({'plan': plan} if plan is not None else {})}, conversation_id=value.conversationId)
Expand Down
Loading
Loading