Files
dsh-unrestricted/tsdown.config.ts
T
yexi aceb93ccd4 dsh-unrestricted: toggleable unrestricted-mode prompt fusion plugin
Fuses the unrestricted execution mode into each preset's original system
prompt at assembly time (standard/code/cordis via the system-prompt/assemble
waterfall, minimal via an agent-scoped complete persona shadow), covering
subagents, plan state, code-mode transport and structured-output delivery.
Anchored rewrites verify the installed DSH prompts before every fusion;
mismatches fall back to the stock prompt per mode and surface in the
settings card. Toggle persists in the unrestricted settings namespace.

Baseline: DSH 0.1.1-rc.1 (528c682e). docs/diff-rc.1.md itemizes every
kept/extended/inserted rule; tests replay fixtures captured from the
installed harness (tools/dump-prompts.mjs); tools/verify-live.mjs and
tools/verify-server.mjs carry the acceptance runs.
2026-08-22 14:55:29 +08:00

50 lines
1.7 KiB
TypeScript

/**
* Client-bundle build for the dsh-unrestricted browser half. Mirrors the
* artifact contract of the official UI plugin preset
* (deepseek-harness/packages/client/tsdown.client.ts) without importing it:
* a lazy-CJS factory handed to window.__ModuleLoader__.load, with only the
* shell's platform modules left external and every other dependency inlined.
* The node half (src/node.js) ships unbundled; only the browser half is built.
*/
import { defineConfig } from 'tsdown'
const ID = 'dsh-unrestricted'
/** Implicit baseline answered by the rc.8 Web shell's frozen module table. */
const EXTERNALS: readonly string[] = [
'react',
'react/jsx-runtime',
'react-dom',
'react-dom/client',
'@deepseek-ai/cordis',
'@deepseek-ai/dsh-client-ui-slots',
'@deepseek-ai/dsh-client-ui-primitives',
'@deepseek-ai/dsh-client-runtime/client',
]
export default defineConfig({
name: `${ID}/client`,
entry: { client: 'src/client/index.tsx' },
outDir: 'lib',
format: 'cjs',
platform: 'browser',
dts: false,
sourcemap: true,
clean: true,
deps: {
neverBundle: (id: string) => EXTERNALS.includes(id),
alwaysBundle: (id: string) => !EXTERNALS.includes(id),
},
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV ?? 'production'),
'import.meta.env.MODE': JSON.stringify(process.env.NODE_ENV ?? 'production'),
'import.meta.env': JSON.stringify({ MODE: process.env.NODE_ENV ?? 'production' }),
},
outputOptions: {
entryFileNames: 'client.js',
banner: `window.__ModuleLoader__.load({ id: ${JSON.stringify(ID)}, factory: (require) => {`,
footer: 'return module.exports; } });',
intro: 'var module = { exports: {} }; var exports = module.exports;',
},
})