feat(agent): v4.11.1 - branche entrées IA sur le FlowDeck Agent (Ask AI, AI meeting note, bouton flottant)
This commit is contained in:
@@ -289,6 +289,7 @@
|
||||
updatedAt:'{{ page.get("updated_at", "") }}',
|
||||
fmt:{open:false,top:0,left:0,idx:-1},
|
||||
shareOpen:false,moreOpen:false,gsMoreOpen:false,accessMenuOpen:false,exportOpen:false,
|
||||
aiBusy:false,
|
||||
moveOpen:false,moveWorkspaces:[],moveLoading:false,
|
||||
activityOpen:false,pageCreated:'{{ page.get("created_at", "") }}',
|
||||
shareTab:'share',favorited:false,
|
||||
@@ -391,6 +392,36 @@
|
||||
addAfter(idx,type){return this.addAt(idx+1,type);},
|
||||
removeBlock(idx){this.sync();if(this.blocks.length<=1){this.blocks[0]=this.mkB('paragraph','');}else{this.blocks.splice(idx,1);}const fi=Math.min(idx,this.blocks.length-1);this.render();this.dirty=true;this.autoSave();setTimeout(()=>{const el=this.getEl(this.blocks[fi]?.id);if(el){el.focus();ce(el);}},60);},
|
||||
|
||||
// ── v4.11.1: Inline AI — "Ask AI" & "AI meeting note" (Get started) ──
|
||||
// Wire the contextual get-started actions into the FlowDeck Agent
|
||||
// (Notion-style inline generation). The reply is streamed in the agent
|
||||
// panel and inserted into this page via window.__fdInsertAI.
|
||||
askAI(){
|
||||
const title=(this.pageTitle||'Sans titre').trim();
|
||||
this.aiRun('Rédige le contenu de la page FlowDeck intitulée « '+title+' ». Fournis un texte structuré et directement utilisable : paragraphes et, si utile, des listes à puces. Sépare chaque paragraphe par une ligne vide. Ne précède pas le texte de commentaires.');
|
||||
},
|
||||
meetingNote(){
|
||||
this.aiRun('Crée le squelette d\'une « AI meeting note » FlowDeck : une ligne d\'en-tête avec la date et les participants, puis les sections « Résumé », « Décisions » et « Action items » avec des exemples réalistes. Sépare chaque bloc/paragraphe par une ligne vide.');
|
||||
},
|
||||
aiRun(prompt){
|
||||
const self=this;
|
||||
if(self.aiBusy) return;
|
||||
if(!(window.fdAgent && window.fdAgent.ask)){ self.showToast('Agent IA indisponible — configurez-le dans Paramètres → Agent & IA'); return; }
|
||||
self.aiBusy=true;
|
||||
window.__fdInsertAI = function(content){ window.__fdInsertAI=null; self.aiBusy=false; self.applyAIBlocks(content); };
|
||||
self.showToast('FlowDeck Agent : génération en cours…');
|
||||
window.fdAgent.ask(prompt);
|
||||
},
|
||||
applyAIBlocks(text){
|
||||
const lines=(text||'').split(/\r?\n/).map(function(s){return s.trim();}).filter(Boolean);
|
||||
if(!lines.length) return;
|
||||
this.sync();
|
||||
const startEmpty=this.blocks.length===1 && this.blocks[0].type==='paragraph' && !(this.blocks[0].content||'').trim();
|
||||
const nb=lines.map(l=>this.mkB('paragraph',l));
|
||||
this.blocks = startEmpty ? nb : this.blocks.concat(nb);
|
||||
this.dirty=true; this.autoSave(); this.render();
|
||||
},
|
||||
|
||||
toggleFavorite(){
|
||||
const csrf=document.cookie.match(/csrf_token=([^;]+)/);
|
||||
const m=this.favorited?'DELETE':'POST';
|
||||
|
||||
Reference in New Issue
Block a user