diff --git a/crates/goose-cli/src/session/mod.rs b/crates/goose-cli/src/session/mod.rs index 49c9d50ec497..45e4acf06093 100644 --- a/crates/goose-cli/src/session/mod.rs +++ b/crates/goose-cli/src/session/mod.rs @@ -655,6 +655,8 @@ impl CliSession { prefill.as_deref(), ) { Ok((message, true)) => { + editor.add_history_entry(message.as_str())?; + history.save(editor); self.handle_message_input(&message, history, editor).await?; } Ok((_, false)) => {} diff --git a/crates/goose/src/acp/server/tools.rs b/crates/goose/src/acp/server/tools.rs index 654a2b36afbc..380ab12b1a8a 100644 --- a/crates/goose/src/acp/server/tools.rs +++ b/crates/goose/src/acp/server/tools.rs @@ -13,9 +13,11 @@ impl GooseAcpAgent { let session_id = &req.session_id; let agent = self.get_session_agent(&req.session_id).await?; let goose_mode = agent.goose_mode().await; - // Read from the global static manager so REST-based confirmToolAction approvals - // (which update PermissionManager::instance()) are reflected here immediately. - let permission_manager = crate::config::PermissionManager::instance(); + let permission_manager = self.permission_manager(); + // REST-based confirmToolAction approvals still update the global manager when + // the desktop UI is not using ACP chat, so read both managers until that path + // is fully migrated. + let global_permission_manager = crate::config::PermissionManager::instance(); let mut tools: Vec = agent .list_tools(session_id, req.extension_name) @@ -24,9 +26,15 @@ impl GooseAcpAgent { .map(|tool| { let permission = permission_manager .get_user_permission(&tool.name) + .or_else(|| global_permission_manager.get_user_permission(&tool.name)) .or_else(|| { if goose_mode == GooseMode::SmartApprove { - permission_manager.get_smart_approve_permission(&tool.name) + permission_manager + .get_smart_approve_permission(&tool.name) + .or_else(|| { + global_permission_manager + .get_smart_approve_permission(&tool.name) + }) } else if goose_mode == GooseMode::Approve { Some(PermissionLevel::AskBefore) } else { diff --git a/documentation/docs/guides/context-engineering/hooks.md b/documentation/docs/guides/context-engineering/hooks.md index fb45b73f48ae..e4670ee0c126 100644 --- a/documentation/docs/guides/context-engineering/hooks.md +++ b/documentation/docs/guides/context-engineering/hooks.md @@ -151,7 +151,18 @@ The matcher is a regular expression matched against the most relevant string for ## Hook Payload -When a hook runs, goose writes a JSON payload to the command's stdin. The payload always includes the event name and session ID, and may include fields such as the tool name, tool input, user message, last assistant message, or working directory. +When a hook runs, goose writes a JSON payload to the command's stdin. Every payload includes the event name and session ID. The remaining fields are only present when they apply to the event, so a hook should treat them as optional. + +| Field | Description | +|---|---| +| `event` | Name of the event that fired, such as `PostToolUse` or `UserPromptSubmit`. | +| `session_id` | ID of the current goose session. | +| `matcher_context` | String the rule's `matcher` is tested against (for example, the tool name on tool events or the prompt text on `UserPromptSubmit`). | +| `tool_name` | Name of the tool, on tool events. | +| `tool_input` | Input arguments passed to the tool, on tool events. | +| `message` | Prompt text the user submitted, on `UserPromptSubmit`. | +| `last_assistant_message` | Final assistant text for the turn, on `Stop` when there is assistant output. | +| `working_dir` | Working directory of the session, on tool events. | Example payload for a tool event: @@ -166,6 +177,17 @@ Example payload for a tool event: } ``` +Example payload for a prompt event, where the submitted prompt is in `message`: + +```json +{ + "event": "UserPromptSubmit", + "session_id": "abc-123", + "matcher_context": "summarize this file", + "message": "summarize this file" +} +``` + Example payload for a `Stop` event after an assistant reply: ```json diff --git a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx index ec1534aa5d3b..952824ea342c 100644 --- a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx +++ b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx @@ -26,7 +26,7 @@ const i18n = defineMessages({ appearanceTitle: { id: 'settings.appearance.title', defaultMessage: 'Appearance' }, appearanceDesc: { id: 'settings.appearance.description', - defaultMessage: "Configure how ApeMind Agent appears on your system", + defaultMessage: 'Configure how ApeMind Agent appears on your system', }, notifications: { id: 'settings.notifications.title', defaultMessage: 'Notifications' }, notificationsDesc: { @@ -41,22 +41,24 @@ const i18n = defineMessages({ }, taskNotificationsDesc: { id: 'settings.notifications.task.description', - defaultMessage: "Notify when ApeMind Agent finishes a task while the window is in the background", + defaultMessage: + 'Notify when ApeMind Agent finishes a task while the window is in the background', }, menuBarIcon: { id: 'settings.menuBarIcon.title', defaultMessage: 'Menu bar icon' }, menuBarIconDesc: { id: 'settings.menuBarIcon.description', - defaultMessage: "Show ApeMind Agent in the menu bar", + defaultMessage: 'Show ApeMind Agent in the menu bar', }, dockIcon: { id: 'settings.dockIcon.title', defaultMessage: 'Dock icon' }, dockIconDesc: { id: 'settings.dockIcon.description', - defaultMessage: "Show ApeMind Agent in the dock", + defaultMessage: 'Show ApeMind Agent in the dock', }, preventSleep: { id: 'settings.preventSleep.title', defaultMessage: 'Prevent Sleep' }, preventSleepDesc: { id: 'settings.preventSleep.description', - defaultMessage: "Keep your computer awake while ApeMind Agent is running a task (screen can still lock)", + defaultMessage: + 'Keep your computer awake while ApeMind Agent is running a task (screen can still lock)', }, costTracking: { id: 'settings.costTracking.title', defaultMessage: 'Cost Tracking' }, costTrackingDesc: { @@ -66,12 +68,12 @@ const i18n = defineMessages({ themeTitle: { id: 'settings.theme.title', defaultMessage: 'Theme' }, themeDesc: { id: 'settings.theme.description', - defaultMessage: "Customize the look and feel of ApeMind Agent", + defaultMessage: 'Customize the look and feel of ApeMind Agent', }, languageTitle: { id: 'settings.language.title', defaultMessage: 'Language' }, languageDesc: { id: 'settings.language.description', - defaultMessage: 'Choose the display language for goose', + defaultMessage: 'Choose the display language for ApeMind Agent', }, languageSystem: { id: 'settings.language.systemDefault', defaultMessage: 'System Default' }, languageEnglish: { id: 'settings.language.english', defaultMessage: 'English' }, @@ -85,10 +87,21 @@ const i18n = defineMessages({ languageJapanese: { id: 'settings.language.japanese', defaultMessage: 'Japanese' }, languageSpanish: { id: 'settings.language.spanish', defaultMessage: 'Spanish' }, languageKorean: { id: 'settings.language.korean', defaultMessage: 'Korean' }, + languageFrench: { id: 'settings.language.french', defaultMessage: 'French' }, + languageGerman: { id: 'settings.language.german', defaultMessage: 'German' }, + languageItalian: { id: 'settings.language.italian', defaultMessage: 'Italian' }, + languagePortuguese: { id: 'settings.language.portuguese', defaultMessage: 'Portuguese' }, + languageIndonesian: { id: 'settings.language.indonesian', defaultMessage: 'Indonesian' }, + languageMalay: { id: 'settings.language.malay', defaultMessage: 'Malay' }, + languageVietnamese: { id: 'settings.language.vietnamese', defaultMessage: 'Vietnamese' }, + languageChineseTraditional: { + id: 'settings.language.zhTW', + defaultMessage: 'Chinese (Traditional)', + }, helpTitle: { id: 'settings.help.title', defaultMessage: 'Help & feedback' }, helpDesc: { id: 'settings.help.description', - defaultMessage: "Help us improve ApeMind Agent by reporting issues or requesting new features", + defaultMessage: 'Help us improve ApeMind Agent by reporting issues or requesting new features', }, reportBug: { id: 'settings.help.reportBug', defaultMessage: 'Report a Bug' }, requestFeature: { id: 'settings.help.requestFeature', defaultMessage: 'Request a Feature' }, @@ -96,7 +109,7 @@ const i18n = defineMessages({ updatesTitle: { id: 'settings.updates.title', defaultMessage: 'Updates' }, updatesDesc: { id: 'settings.updates.description', - defaultMessage: "Check for and install updates to keep ApeMind Agent running at its best", + defaultMessage: 'Check for and install updates to keep ApeMind Agent running at its best', }, notificationsModalTitle: { id: 'settings.notifications.modal.title', @@ -116,7 +129,7 @@ const i18n = defineMessages({ }, notificationsMacStep3: { id: 'settings.notifications.modal.macStep3', - defaultMessage: "Find and select ApeMind Agent in the application list", + defaultMessage: 'Find and select ApeMind Agent in the application list', }, notificationsMacStep4: { id: 'settings.notifications.modal.macStep4', @@ -136,7 +149,7 @@ const i18n = defineMessages({ }, notificationsWinStep3: { id: 'settings.notifications.modal.winStep3', - defaultMessage: "Find and select ApeMind Agent in the application list", + defaultMessage: 'Find and select ApeMind Agent in the application list', }, notificationsWinStep4: { id: 'settings.notifications.modal.winStep4', @@ -149,12 +162,20 @@ const LANGUAGE_OPTIONS: Array<{ value: LanguageSetting; message: keyof typeof i1 { value: 'system', message: 'languageSystem' }, { value: 'en', message: 'languageEnglish' }, { value: 'es', message: 'languageSpanish' }, + { value: 'fr', message: 'languageFrench' }, + { value: 'de', message: 'languageGerman' }, + { value: 'it', message: 'languageItalian' }, + { value: 'pt', message: 'languagePortuguese' }, + { value: 'id', message: 'languageIndonesian' }, + { value: 'ms', message: 'languageMalay' }, + { value: 'vi', message: 'languageVietnamese' }, { value: 'hi', message: 'languageHindi' }, { value: 'ja', message: 'languageJapanese' }, { value: 'ko', message: 'languageKorean' }, { value: 'ru', message: 'languageRussian' }, { value: 'tr', message: 'languageTurkish' }, { value: 'zh-CN', message: 'languageChineseSimplified' }, + { value: 'zh-TW', message: 'languageChineseTraditional' }, ]; interface AppSettingsSectionProps { diff --git a/ui/desktop/src/components/ui/Diagnostics.tsx b/ui/desktop/src/components/ui/Diagnostics.tsx index 90f68b335311..723bd1a47e41 100644 --- a/ui/desktop/src/components/ui/Diagnostics.tsx +++ b/ui/desktop/src/components/ui/Diagnostics.tsx @@ -208,7 +208,9 @@ Add any other context about the problem here.
-

{intl.formatMessage(i18n.reportProblem)}

+

+ {intl.formatMessage(i18n.reportProblem)} +

{intl.formatMessage(i18n.description)}

@@ -221,9 +223,7 @@ Add any other context about the problem here.

Warning: {intl.formatMessage(i18n.sensitiveWarning)}

-

- {intl.formatMessage(i18n.attachHint)} -

+

{intl.formatMessage(i18n.attachHint)}

@@ -242,7 +242,9 @@ Add any other context about the problem here. disabled={isDownloading || isFilingBug} > - {isDownloading ? intl.formatMessage(i18n.downloading) : intl.formatMessage(i18n.download)} + {isDownloading + ? intl.formatMessage(i18n.downloading) + : intl.formatMessage(i18n.download)}