Skip to main content

nativemind_copilot 1.4.0 copy "nativemind_copilot: ^1.4.0" to clipboard
nativemind_copilot: ^1.4.0 copied to clipboard

The NativeMind copilot for Flutter: agent panel, decisions and spending policy, voice and attachments, protocol client, OAuth / MCP connect screens.

nativemind_copilot #

The NativeMind copilot for Flutter: an agent panel (NmCopilotPanel under NmCopilotScope with an NmCopilotController), engines (cloud providers, on-device models, hybrid), voice and attachment ports, approvals and the AI loupe. Part of the NativeMind framework.

Built on nativemind_core: about 0.9 MB of assets (test/size_test.dart checks it); the only plugin is flutter_llama (on-device models) — keep this package out of apps or editions that must not ship native model code. Extra languages: add nativemind_translations and call NmTranslations.install(). Customisation: doc/customisation.md. Upgrading from 0.x or from nativemind_widgets/ai.dart: doc/migration-1.0.md.

Install #

dependencies:
  nativemind_copilot: ^1.4.0
import 'package:nativemind_copilot/nativemind_copilot.dart';

Register NmCopilot.delegate with the app's localizations delegates.

Phone layout, continuing a conversation, localized labels (1.3.0) #

  • NmCopilotPreviewBar(onOpen: …) under the NmCopilotScope is the collapsed copilot of a phone screen. It shows the first words of the streaming reply, and onOpen opens the full NmCopilotPanel, e.g. in a sheet.
  • controller.adopt(conversationId, turns: history) continues a conversation the app already has, without sending a message.
  • Labels that depend on the language take builders with a BuildContext: NmCopilotConfig(suggestionsBuilder:, stepLabelBuilder:, strategyLabelBuilder:, memoryKeyLabelsBuilder:).
  • NmCopilotIssue.details carries the error's details, e.g. plan limit numbers, to an issue builder slot.
  • NmCopilotDecisionCard(acceptLabel:, declineLabel:) and NmCopilotChangeRow(undoKey:) are optional.

NmOAuthConsent draws the consent page of a service that lets AI apps connect by OAuth: with showPair: true the app ↔ service tiles (NmConnectPair) and the verified / where badges (NmClientBadges), «Signed in as» (account: NmConsentAccount(…)), your own block in body: (e.g. a project picker), scope rows with «required» or a switch (NmConsentScope(…, description:, required: false)), «It won't be able to» (NmConsentRequest.denied), a note, technical details and, with stickyActions: true, Deny / Allow in an NmStickyActionBar on phones. The phases granted, denied and invalidClient show the outcome (NmConsentOutcome). NmConnectedApps lists the grants with the same tile and badges, onEdit and your own actions (actionsBuilder). Texts in en, ru, th, zh, hi and ja.

Voice and attachments #

Ports with web implementations in this package (package:web, no plugins; stubs elsewhere) and fakes for tests:

Port Web implementation Default for the platform Fake
NmVoiceInput NmWebSpeechInput (SpeechRecognition / webkitSpeechRecognition, partial results), or NmServerVoiceInput over NmWebAudioRecorder (MediaRecorder, level meter via NmAudioRecorderControls) nmDefaultVoiceInput(engine) NmFakeVoiceInput
NmAudioRecorder NmWebAudioRecorder nmDefaultAudioRecorder() —
NmSpeechOutput NmWebSpeechOutput (speechSynthesis, voice for the locale) nmDefaultSpeechOutput() NmFakeSpeechOutput
NmAttachmentPicker NmWebAttachmentPicker (hidden <input type=file>, camera via capture) nmDefaultAttachmentPicker() NmFakeAttachmentPicker

The defaults return null off the web. Native implementations (Android, iOS, desktop) live in the separate package nativemind_copilot_media, so this package stays without media plugins. When the server cannot transcribe, pass onNoTranscript to NmServerVoiceInput and the recording comes back as an audio attachment draft. With attachments on, NmCopilotPanel takes files dropped on the page and pasted images on the web (NmAttachmentDropTarget, feature flag dropFiles); nmPasteDraft(images: true) reads an image from the web clipboard.

Voice assistant mode. Set NmCopilotConfig(voiceAssistant: NmVoiceAssistantConfig(enabled: true)) and the panel header gets a «Voice mode» button (feature flag voiceAssistant) with a status bar above the composer (slot NmCopilotBuilders.voiceAssistantBar). NmVoiceAssistantController runs the loop: listen → send the finished utterance (autoSend) → think → say a short version of the reply (markdown and links removed, cut at a sentence within maxSpokenChars) → listen again (relisten); silenceTimeout pauses it. While it speaks it keeps listening: a stop word («стоп», «подожди», «stop», «wait», «หยุด» …), new speech or «Stop» silences it at once — the copilot's turn is never cancelled — and new speech becomes the next message. Without a voice input the mode is unavailable; without speech output replies stay text; a refused microphone turns it off with a hint. Input and output default to the copilot's voice input and the platform defaults above.

NmCopilotConfig(
  engine: engine,
  attachments: NmAttachmentPolicy(enabled: true, picker: nmDefaultAttachmentPicker()),
  voice: NmVoiceConfig(mode: NmVoiceMode.device, input: nmDefaultVoiceInput(engine)),
  voiceAssistant: const NmVoiceAssistantConfig(enabled: true),
)

Authors #

The copilot was written with AI assistants in 2026 (SDD flows sdd-nativemind-copilot, sdd-nativemind-widgets-*); it contains no handmade code — 0 % handmade, see PROVENANCE.md. The handmade parts of the framework are in nativemind_core, nativemind_vpn, nativemind_sound, nativemind_sound_generator, nativemind_deals and nativemind_call.

License #

NativeMindNONC (see LICENSE), as the whole NativeMind framework. flutter_llama and downloaded models keep their own licenses (see NOTICE).

0
likes
140
points
483
downloads

Documentation

API reference

Publisher

verified publisherframework.nativemind.net

Weekly Downloads

The NativeMind copilot for Flutter: agent panel, decisions and spending policy, voice and attachments, protocol client, OAuth / MCP connect screens.

Repository (GitLab)

Topics

#ai #agent #copilot #chat #mcp

License

unknown (license)

Dependencies

flutter, flutter_llama, flutter_localizations, http, http_parser, intl, nativemind_core, web

More

Packages that depend on nativemind_copilot