feat: unify execution and add workspace file imports

Remove Ask/Execute modes and general product tool approvals so requests use the selected runtime, enabled capabilities, and execution account permissions. Migrate retired application metadata while preserving user content.

Retire the Results page while retaining conversation images and stored artifacts. Add local and remote workspace file imports, timestamps and sorting, improve image discovery and saving, and refine workspace navigation and supervision responsiveness. Include the accompanying web-search changes, tests, probes, and product documentation.

Remote imports require an updated Agent. Existing artifacts are not automatically copied into project directories. Validation evidence and outstanding failures remain documented in feature progress files; no full test suite or real-model calls were rerun for this commit.

Release note: Run requests without switching work modes, import files into a selected local or remote workspace folder, sort workspace files by date, and keep using conversation images after removal of the Results page.
This commit is contained in:
mesalogo
2026-10-04 20:02:59 +08:00
parent 0cd5da33f4
commit 56ebd40bd8
374 changed files with 7075 additions and 6224 deletions
-34
View File
@@ -1,46 +1,16 @@
import { createHash } from 'node:crypto'
// Official dsh-mcp-client 0.1.7-rc.2 naming contract; its helper is private.
export function nativeDshMcpToolName(serverName: string, rawName: string): string {
const joined = `mcp__${serverName}__${rawName}`
const normalized = joined.replace(/[^A-Za-z0-9_-]/gu, '_')
if (joined === normalized && normalized.length <= 64) return joined
const hash = createHash('sha256').update(`${serverName}\0${rawName}`).digest('hex').slice(0, 12)
return `${normalized.slice(0, 51)}_${hash}`
}
export type NativeDshMcpServer = {
serverName: string
readOnlyTools?: string[]
} & (
| { transport: 'stdio'; command: string; args?: string[]; env?: Record<string, string>; cwd?: string }
| { transport: 'streamable-http'; url: string; headers?: Record<string, string> }
)
// Loaded by the official Cordis loader, outside Electron and its ASAR bundle.
// The launch mode applies to every session, including delegated agents.
export const nativeDshWebPolicySource = `
export const name = 'goodbuddy-native-mode';
export function apply(ctx, config) {
const allowed = new Set(['read', 'skill', ...config.readOnlyTools]);
ctx.on('tools/execute', (exec, next) => {
if (config.workMode === 'ask' && !allowed.has(exec.name)) {
throw new Error('GoodBuddy Ask mode does not allow tool: ' + exec.name);
}
return next();
});
}
`
export function nativeDshWebPatch(options: {
model: string
api: string
baseURL: string
workMode: 'ask' | 'execute'
policyPath: string
skillDirectories: string[]
mcpServers: NativeDshMcpServer[]
readOnlyTools: string[]
}): unknown[] {
return [
{
@@ -54,11 +24,8 @@ export function nativeDshWebPatch(options: {
{ id: 'agent-default-model', config: { provider: 'goodbuddy', model: options.model } },
{ id: 'sandbox-policy', config: { mode: 'danger-full-access' } },
{ id: 'approval', config: { policy: 'never' } },
// The launch mode owns permissions. Native Plan remains a planning aid.
{ id: 'ui-permission', disabled: true },
{ insert: [
{ id: 'goodbuddy-native-mode', name: options.policyPath,
config: { workMode: options.workMode, readOnlyTools: options.readOnlyTools } },
...(options.skillDirectories.length ? [{
id: 'goodbuddy-skills', name: '@deepseek-ai/dsh-skill-filesystem',
config: { providerName: 'goodbuddy', includeDefaultRoots: false,
@@ -66,7 +33,6 @@ export function nativeDshWebPatch(options: {
}] : []),
...options.mcpServers.map((server, index) => {
const config = { ...server, failOnStartupError: true }
delete config.readOnlyTools
return { id: `goodbuddy-mcp-${index}`, name: '@deepseek-ai/dsh-mcp-client', config }
})
] }