Add Pi.dev AI assistant UI: per-device chat + scheduled AI tasks - #56
Add Pi.dev AI assistant UI: per-device chat + scheduled AI tasks#56teknoprep wants to merge 46 commits into
Conversation
9313031 to
e1a6556
Compare
- 'Pi.dev' agent action opens a per-device chat window (PiChat.vue) - AI settings tab in Core Settings (providers, models, default, toggles) - Role permissions: Use AI, auto-approve, allowed-models multiselect - AI History tab: unified log (Chat / Task / Bulk) with a Source column - AI Tasks tab: run Now (one-shot) or Scheduled (interval/daily/weekly/ monthly), run now, live trace, master-detail run history; company aggregate - Tools -> Bulk AI Command: target All/Client/Site/Agents or dynamic Filter rules (agent picker shows faded client/site, type to filter); Now or Scheduled; target preview lists the matched online devices Pairs with the backend Pi.dev AI assistant feature.
e1a6556 to
e308d8c
Compare
Multi-machine mode: - PiChat toolbar gains a Multi-machine button opening a setup dialog: one row per machine (filterable agent picker grouped by client/site) plus a free-text role prompt describing what each machine is (e.g. 'primary Proxmox node', 'Proxmox Backup Server'); +/- row controls, 2-8 machines, duplicate selection rejected - /pichat/multi route (selection base64-encoded in ?m=) creates the session via POST /agents/pi/multisession/; in an existing multi chat the button re-opens the dialog to adjust the machine set - api/agents.js: createPiMultiSession, runPiMultiChat, encode/decode helpers AI History tab: - double-click a row triggers its default action (Continue for chats, View for task/bulk runs) - summary column ellipsis-capped (420px) with full-text hover tooltip; single-line rows + explicit overflow-x so the horizontal scrollbar is reliably available in narrow panes; pointer cursor on rows
|
Pushed Multi-machine chat UI
AI History tab UX
No email UI needed — users simply ask the assistant to email results and approve the gated action (see the backend PR). |
- Approval requests are now queued instead of overwriting a single slot: a parallel/multi-machine turn raises several approval_requests; the old single-slot UI dropped all but the last, hanging the un-shown tool calls forever. Show them one at a time with an (N pending) count and an 'Approve all' button. - AI History 'Continue' resumes multi-machine chats with their full machine set (via /pichat/multi) instead of falling back to the primary machine only; multi chats are badged 'Chat (multi)'.
|
Follow-up
|
…ety cap - Roles: 'Allow write (mutating) actions' checkbox (read-only sessions); PiChat shows a read-only badge when the session can't mutate - Bulk AI filter builder: grouped AND/OR sections (per-group + top-level ALL/ANY selectors, wider for readability), add/remove group & condition; new 'Installed software (name)' filter field - Safety: preview shows online match count vs the hard cap; when a target exceeds the cap the banner turns red and Save/Run are disabled - Kill switch: per-command Stop button + toolbar Emergency stop - AI History: double-click row to open, reliable vertical/horizontal scroll, fully scrollable run/verdict (alert) viewer
|
Pushed |
- Bulk AI Commands: 'View results' opens a computers-left / results-right viewer (last run per computer with client/site + full transcript); double-click a row to edit - Target preview: per-machine exclude checkboxes (untick to exclude even if matched); shows 'will run on N (X excluded of Y matched)' - api/core.ts: fetchBulkAICommandResults
|
Pushed |
- Global Settings 'Pi.dev AI' tab: Helpdesk/Ticketing section below providers & models - policy prompt box + helpdesk.js code box, with a 'Use AI to Help Create These' assistant dialog that drafts both. - Bulk AI command: combined end-of-batch report instructions field. - 'By' (created/edited) column on AI tasks & bulk commands. - Client/Site 'AI History' review dialog (from the dashboard tree) aggregating chats + task/bulk runs across every machine, with a Machine column.
7b25dd3 to
3770c2a
Compare
…audit filter, manage-all-AI-tasks role toggle, overview delete, scope-aware AI history - PiChat history now reconstructs the full command window (tool calls + output) when reopening a past session, not just typed text - AuditManager: 'AI Assistant Session' filter option - RolesForm: 'Manage/delete all AI tasks & bulk commands (any owner)' permission - AITasksOverview: delete button (permission-enforced server-side) - AI History folded into a single scope-aware tab (agent/site/client); retire AIHistoryScope popup - AISettings: 'only alert when a ticket can't be filed' toggle - AgentView: make the agent page its own scroll region
- aiPromptAssist() API client (POST /core/ai/prompt-assist/) - 'Help me write this with AI' assistant dialog in the AI Task Prompt Builder (AITasksTab) and the Bulk AI Command Builder (BulkAICommands); the latter also drafts the combined-report instruction. Apply-to-prompt / apply-to-report actions.
- getDeviceNotes/saveDeviceNotes API clients (/core/ai/device-note/) - 'Device Memory (AI notes)' editor in AIHistoryTab (agent scope): view/edit the durable notes Pi injects into its context on every run on the device
…ope limiter, triage policy prompt (all editable on the fly, helpdesk-agnostic)
…per -> blank page)
…er email) + Scheduled Actions admin page
…cket / Running a command / Searching the web...')
…to-action) instead of raw JSON Domains and client lists are now edited as friendly chip inputs + toggles in Global Settings; the raw JSON is tucked into an Advanced expansion. Makes the module configurable per-deployment without hand-editing JSON.
…WebSocket); createDecisionSession
…stomer email); remove dead AIDecision.vue + dead API fns
… an 'AI Created' section (per device), with cancel
…shed off-screen below the full-height tasks table
… table (AI badge + truncated action + details/cancel dialog); drop the separate table
…t, see what the AI did, open the chat, auto-resolve
…ionable / needs-input / triaged / est. hrs saved) + status filter
…and wraps the subject so the full text shows
…ored) alongside the AI Status
…s scroll wedging after changing pages); header/metrics/filter/pagination stay pinned
…Actions.vue (+route); superseded by the Ticket Console + AI Tasks 'AI Created' section
…er + labels/colors for reconciled terminal statuses
…dit every tracked ticket's triage pass + bonus for auto-closed clean alerts) so it no longer decreases as tickets move to terminal states
…ow) reachable from Tools menu and the Ticket Console; Procedures settings section (enable, mining enable, interval, backfill, mining prompt) in AI Settings; core API bindings
…stacked labels above auto-growing multi-line fields, better alignment, readable text, source tickets as chips
…stats + streaming log); edit-dialog prev/next + Accept/Delete for fast review
…er at a time (heartbeat pauses while dialog open), auto-scroll only when already at bottom, reserve the current-company line
…een sort+filter order (via filteredSortedRows) instead of raw fetch order
… more fragmented categories)
…wn (headings, bold, lists, code) instead of raw text - shared renderMarkdown util (DOMPurify-sanitized) wired into the Task/Bulk prompt builders and the helpdesk setup assistant
…in template + returned) - ReferenceError blanked the whole AI Tasks tab; add the import
…controls - "Check capabilities" panel: lists every helpdesk operation with its capability class and the PROVENANCE of that class (declared in the integration / guessed from a conventional name / unclassified), plus per-surface counts. An operation left unclassified is denied once enforcement is on, and that was previously invisible until it blocked a working feature. - api: helpdeskCaps(). - Also carries the model-catalog refresh fix (the run's returned timestamp is now applied, so the caption updates immediately), AI runtime update controls, and daily report settings.
…oping
Scheduled Reports panel (new AIReportSchedules.vue): add, edit, delete and send-now
any number of reports, each with its own type, cadence (daily / weekdays / weekly /
monthly), data window (24h / 48h / 72h / 7d / 14d / 30d / custom hours), recipients,
options and extra prompt instructions. Replaces the two fixed report blocks, which
are removed.
Chat window:
* Auto-approve is now a remembered per-user preference and the server reports the
state in the ready frame, so a refresh or a second window no longer silently
turns it off while the toggle still reads on
* labels say what read-only actually scopes: 'Read-only (devices)'. Ticket work -
replying, noting, closing - is not a device change and is never gated by it
api: report-schedule CRUD + the auto-approve preference.
96fdcc4 to
8d5fc0b
Compare
Summary
Frontend for the Pi.dev AI assistant (pairs with the tacticalrmm backend PR of the same name).
📖 Full feature documentation (rendered): https://github.com/teknoprep/tacticalrmm/blob/feature/pi-ai-assistant/PI_AI_ASSISTANT.md
🔗 Backend PR: amidaware/tacticalrmm#2509
What's included
PiChat.vue) with live model switching and streamed tool/command output.api/core.tsandapi/agents.js.Note: branch is based on release 0.101.59; only the assistant changes are included (13 files).