Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- v0.9.0
workflow_dispatch:
inputs:
target:
Expand Down
5 changes: 5 additions & 0 deletions build/dsh-desktop.patch.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Connection owns the authenticated HTTP channels used by Desktop plugins.
# Harness 0.1.5 resolves webServer through the Connection provider context.
- id: connection
inject: [webRuntime, webServer]

# Keep the stock directory-picker (auto) row active: the native backend
# serves ctx.directoryPicker, so host-side consumers (host.pickDirectory,
# plugins reading the seam) work unmodified. The client surface keeps its
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified packages/ppt-bundles/dsh-ppt-0.1.1-rc.2-desktop-20260906.tgz
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/ppt-runtime/adapter/lib/client.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions packages/ppt-runtime/artifacts.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"core": {
"file": "dsh-ppt-0.1.1-rc.2-desktop-20260906.tgz",
"sha256": "5d1c1451792474389f55f09db2e1bdfa70cf430384d21ec3ccd55eaea0d8c8ff",
"integrity": "sha512-SyZs2qWMNRY+XTHmz02cjgQzFKWG73escGM4frfgKhuJlb0/ErjiBoi6YcQOIlw4R4/M1qTVkd8vdNxWvDilQw=="
"sha256": "6be6339a6d824ffd652618a23d3762cb3ec4625dfa3af384890741312ce2cd52",
"integrity": "sha512-E7jVIghGS57HUo/EAMEGttXu2/dSKR0PH/eiAztDNq+OD2mijB+AHbKvNHgMcJjkeyDVKNTbBCMx7YJkOGtyNQ=="
},
"adapter": {
"file": "dsh-ppt-composer-0.1.1-rc.2-desktop-20260906.tgz",
"sha256": "c2fd6fc38f733cc87d8b78be002622b5f680e01d1e96549a3aaa44b2cff6024a",
"integrity": "sha512-aTVlZhBsBuShgmnUbW95cx0Y5k2UXg6Sm6X04OMu2JMZ/vGpivt5L4paA8+8Jvcn2rG69/g+HBFzEtnjy1D8Fg=="
"sha256": "ca3da66b999fe611fa820a09654630f4685eabce2512070d5b3e4521401c5c62",
"integrity": "sha512-dGhvXN8Iz8bFhieraMGl9ls9yQ+4bVhSwi+vr8kACScm2X63QkoOg1yctlkytMyWbaDtKHvUrzlOq/L5nsf62w=="
}
}
2 changes: 1 addition & 1 deletion packages/ppt-runtime/core/lib/client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/build-ppt-runtime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ try {
if (check.errorCount)
throw Error(definition.id + ': ' + stdout);
checks.push({ id: definition.id, ...check });
{
if (!process.argv.includes('--reuse-previews')) {
const pngDir = scratch + '/' + definition.id;
await run(process.execPath, [root + '/core/lib/bin.js', 'screenshot', dir + '/source', '-o', pngDir, '--scale', '1.3333333333', '--json']);
const pngs = JSON.parse(await fs.readFile(pngDir + '/index.json', 'utf8')).pages.map(p => p.file);
Expand Down
62 changes: 62 additions & 0 deletions scripts/verify-desktop-routes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import assert from 'node:assert/strict'
import { spawn } from 'node:child_process'
import { createServer } from 'node:http'
import { mkdtemp, rm, access } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const root = fileURLToPath(new URL('..', import.meta.url))
const home = await mkdtemp(path.join(tmpdir(), 'dsh-desktop-routes-'))
const portServer = createServer()
await new Promise(resolve => portServer.listen(0, '127.0.0.1', resolve))
const port = portServer.address().port
await new Promise(resolve => portServer.close(resolve))
const base = `http://127.0.0.1:${port}`
const child = spawn(path.join(root, 'node_modules/node/bin', process.platform === 'win32' ? 'node.exe' : 'node'), [path.join(root, 'build/harness-node-entry.mjs'),
path.join(root, 'node_modules/@deepseek-ai/dsh/lib/bin.js'), 'web', '--patch', path.join(root, 'build/dsh-desktop.patch.yml'), '--no-open', '--host', '127.0.0.1', '--port', String(port)],
{ cwd: root, env: { ...process.env, DSH_HOME: home, NO_COLOR: '1', DSH_TELEMETRY_DISABLED: '1' }, stdio: ['ignore', 'pipe', 'pipe'] })
let output = ''
try {
const url = await new Promise((resolve, reject) => {
const timer = setTimeout(() => reject(new Error('Desktop Host startup timed out')), 45_000)
const scan = chunk => { output += chunk; const match = /dsh web:\s*(\S+)/.exec(output); if (match) { clearTimeout(timer); resolve(match[1]) } }
child.stdout.on('data', scan); child.stderr.on('data', scan)
child.once('exit', code => { clearTimeout(timer); reject(new Error(`Desktop Host exited ${code}`)) })
})
const response = await fetch(url, { redirect: 'manual' })
const cookie = response.headers.getSetCookie().map(value => value.split(';')[0]).join('; ')
assert.ok(cookie)
const rpc = async (channel, method, payload) => {
const result = await fetch(`${base}${channel}/${method}`, { method: 'POST', headers: { Cookie: cookie, 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'client-request', rpcId: 'route-smoke', method, payload }) })
assert.equal(result.status, 200, `${channel}/${method}`)
const message = await result.json(); assert.equal(message.result.ok, true); assert.equal(message.result.value.status, 'ok')
return message.result.value.data
}
const sessionId = 'desktop-route-smoke'
assert.equal((await fetch(`${base}/dsh-ppt/state`, { method: 'POST' })).status, 401)
assert.equal((await rpc('/dsh-ppt', 'state', { sessionId })).templates.length, 16)
await rpc('/dsh-ppt', 'presentation/mode', { sessionId, mode: 'ppt' })
assert.equal((await rpc('/dsh-ppt', 'state', { sessionId })).presentationMode, 'ppt')
const present = async name => access(path.join(root, 'packages', name)).then(() => true, () => false)
if (await present('dsh-office')) {
for (const mode of ['word', 'excel']) {
assert.equal((await rpc('/dsh-office', 'mode', { sessionId, mode })).mode, mode)
const state = await rpc('/dsh-ppt', 'state', { sessionId }); assert.equal(state.documentMode, mode); assert.equal(state.presentationMode, undefined)
}
assert.equal((await rpc('/dsh-office', 'state', { sessionId })).templates.length, 6)
assert.ok((await rpc('/dsh-office', 'template/preview', { sessionId, templateId: 'equity-research', page: 1 })).image.startsWith('data:image/webp;base64,'))
}
for (const [plugin, endpoint] of [['dsh-image-generation', 'image-generation.settings'], ['dsh-desktop-enterprise', 'enterprise.state']]) {
if (!(await present(plugin))) continue
assert.equal((await fetch(`${base}/api/${endpoint}`)).status, 401)
const result = await fetch(`${base}/api/${endpoint}`, { headers: { Cookie: cookie } }); assert.equal(result.status, 200); assert.ok(await result.json())
}
console.log('PASS: actual Desktop entry, authenticated PPT RPC and installed feature routes')
} catch (error) {
console.error(output.replace(/([?&]token=)[^\s"']+/g, '$1[REDACTED]')); throw error
} finally {
if (child.exitCode === null) { const stopped = new Promise(resolve => child.once('exit', resolve)); child.kill('SIGTERM'); await stopped }
await rm(home, { recursive: true, force: true })
}
8 changes: 8 additions & 0 deletions test/desktop-routes.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { execFile } from 'node:child_process'
import { promisify } from 'node:util'
import { expect, it } from 'vitest'
it('serves authenticated plugin RPC through the actual Desktop composition', async () => {
const { stdout } = await promisify(execFile)(process.execPath, ['scripts/verify-desktop-routes.mjs'],
{ cwd: new URL('..', import.meta.url), timeout: 55000, maxBuffer: 1024 * 1024 })
expect(stdout).toContain('PASS: actual Desktop entry')
}, 60000)
2 changes: 1 addition & 1 deletion test/ppt-validation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ afterAll(async () => { if (packageRoot) await rm(packageRoot, { recursive: true,
afterEach(async () => { for (const dir of cleanups.splice(0)) await rm(dir, { recursive: true, force: true }) })

async function fixture({ broken = true, malformed = false } = {}) {
const root = await mkdtemp(path.join(os.tmpdir(), 'ppt-validation-'))
const root = await realpath(await mkdtemp(path.join(os.tmpdir(), 'ppt-validation-')))
cleanups.push(root)
const workspace = path.join(root, 'workspace')
const project = path.join(workspace, 'deck')
Expand Down
Loading