Files
goodbuddy/src/shared/goodbuddy-config-tools.ts
T
mesalogo 9836a4cc9d
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
fix: keep question order and streamline contextual help
Keep interactive questions and answered cards at their original position in
conversation history, including remote reception, recovery, and reopening.
Preserve legacy history placement without a database migration.

Move supplementary guidance into shared accessible contextual-help popovers
across pages and settings. Add keyboard, modal, accessibility, and Electron
regressions, plus bounded opt-in live canvas-analysis validation.

Remove unused Agent, Runtime, and in-memory graph-search helpers, obsolete
mocks and browser copy; reuse the existing package-size formatter. Keep
production execution paths, protocol schemas, and released data migrations.

Validation: targeted cleanup tests, typecheck, lint, shared Linux Host
attach/read/re-attach, and added help/Electron checks passed. Final full-suite
verification passed 4,858 tests with 67 skipped and zero failures (412 files
passed, 9 skipped). Focused help checks passed 54 tests, including Electron
style comparisons and Chromium accessibility descriptions. Details and
validation boundaries are recorded in feature docs.

Release note: 修复交互式问答在回答后排到后续输出末尾的问题,重新打开会话仍保留提问位置。页面和设置中的补充说明改为标题或字段旁的按需帮助,支持鼠标与键盘操作。
2026-09-20 01:26:36 +08:00

85 lines
3.2 KiB
TypeScript

import { z } from 'zod'
import {
goodbuddyConfigApplyInputSchema,
goodbuddyConfigApplyOutputSchema,
goodbuddyConfigCapabilitiesInputSchema,
goodbuddyConfigCapabilitiesOutputSchema,
goodbuddyConfigGetInputSchema,
goodbuddyConfigGetOutputSchema,
goodbuddyConfigPlanInputSchema,
goodbuddyConfigPlanOutputSchema
} from './goodbuddy-config-contracts'
export type GoodBuddyConfigToolDefinition = {
name: string
title: string
description: string
summary: string
access: 'read' | 'write'
inputSchema: z.ZodType
outputSchema: z.ZodType
}
export const goodbuddyConfigToolCatalog = {
capabilities: {
name: 'goodbuddy_config_capabilities',
title: 'Discover GoodBuddy configuration capabilities',
description:
'List supported secret-free configuration operations, examples, risk levels, and reload effects. This tool does not read or change settings.',
summary: 'Discover supported configuration operations and examples.',
access: 'read',
inputSchema: goodbuddyConfigCapabilitiesInputSchema,
outputSchema: goodbuddyConfigCapabilitiesOutputSchema
},
get: {
name: 'goodbuddy_config_get',
title: 'Read sanitized GoodBuddy settings',
description:
'Read public application preferences, Skill summaries, and redacted MCP summaries for this request. Credentials and connection details are never returned.',
summary: 'Read sanitized application, Skill, and MCP settings.',
access: 'read',
inputSchema: goodbuddyConfigGetInputSchema,
outputSchema: goodbuddyConfigGetOutputSchema
},
plan: {
name: 'goodbuddy_config_plan',
title: 'Plan GoodBuddy configuration changes',
description:
'Validate and normalize a bounded sequence of strongly typed changes without applying it. The returned plan is scoped to this request and expires.',
summary: 'Validate configuration changes and inspect their effects.',
access: 'read',
inputSchema: goodbuddyConfigPlanInputSchema,
outputSchema: goodbuddyConfigPlanOutputSchema
},
apply: {
name: 'goodbuddy_config_apply',
title: 'Apply an approved GoodBuddy configuration plan',
description:
'Apply a previously planned request-scoped change after GoodBuddy approval controls authorize it. Raw operations and secrets are not accepted. If a later operation fails, the result reports partial application and the remaining operations are not attempted.',
summary: 'Apply one approved request-scoped configuration plan.',
access: 'write',
inputSchema: goodbuddyConfigApplyInputSchema,
outputSchema: goodbuddyConfigApplyOutputSchema
}
} as const satisfies Record<
'capabilities' | 'get' | 'plan' | 'apply',
GoodBuddyConfigToolDefinition
>
export const goodbuddyConfigTools = [
goodbuddyConfigToolCatalog.capabilities,
goodbuddyConfigToolCatalog.get,
goodbuddyConfigToolCatalog.plan,
goodbuddyConfigToolCatalog.apply
] as const satisfies readonly GoodBuddyConfigToolDefinition[]
export type GoodBuddyConfigToolName =
(typeof goodbuddyConfigTools)[number]['name']
export const goodbuddyConfigToolByName = new Map<
GoodBuddyConfigToolName,
(typeof goodbuddyConfigTools)[number]
>(
goodbuddyConfigTools.map((tool) => [tool.name, tool])
)