specpilot 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/fixtures/allFields.d.ts +3 -0
- package/dist/__tests__/fixtures/allFields.d.ts.map +1 -0
- package/dist/__tests__/fixtures/allFields.js +31 -0
- package/dist/__tests__/fixtures/allFields.js.map +1 -0
- package/dist/commands/add-specs.d.ts.map +1 -1
- package/dist/commands/add-specs.js +1 -3
- package/dist/commands/add-specs.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/refine.d.ts.map +1 -1
- package/dist/commands/refine.js +1 -3
- package/dist/commands/refine.js.map +1 -1
- package/dist/core/agentConfig.d.ts +9 -0
- package/dist/core/agentConfig.d.ts.map +1 -0
- package/dist/{utils/agentConfigGenerator.js → core/agentConfig.js} +29 -44
- package/dist/core/agentConfig.js.map +1 -0
- package/dist/core/chatFlow.d.ts +420 -0
- package/dist/core/chatFlow.d.ts.map +1 -0
- package/dist/core/chatFlow.js +1107 -0
- package/dist/core/chatFlow.js.map +1 -0
- package/dist/core/ideConfig.d.ts +35 -0
- package/dist/core/ideConfig.d.ts.map +1 -0
- package/dist/core/ideConfig.js +287 -0
- package/dist/core/ideConfig.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/render.d.ts +73 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +99 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/slashCommands.d.ts +23 -0
- package/dist/core/slashCommands.d.ts.map +1 -0
- package/dist/core/slashCommands.js +524 -0
- package/dist/core/slashCommands.js.map +1 -0
- package/dist/core/specFiles.d.ts +18 -0
- package/dist/core/specFiles.d.ts.map +1 -0
- package/dist/{utils/specFileGenerator.js → core/specFiles.js} +228 -157
- package/dist/core/specFiles.js.map +1 -0
- package/dist/core/templateEngine.d.ts +69 -0
- package/dist/core/templateEngine.d.ts.map +1 -0
- package/dist/{utils → core}/templateEngine.js +123 -10
- package/dist/core/templateEngine.js.map +1 -0
- package/dist/utils/addSpecsQuestions.d.ts +2 -1
- package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
- package/dist/utils/addSpecsQuestions.js +2 -1
- package/dist/utils/addSpecsQuestions.js.map +1 -1
- package/dist/utils/ideConfigGenerator.d.ts +5 -29
- package/dist/utils/ideConfigGenerator.d.ts.map +1 -1
- package/dist/utils/ideConfigGenerator.js +9 -282
- package/dist/utils/ideConfigGenerator.js.map +1 -1
- package/dist/utils/initQuestions.d.ts +2 -1
- package/dist/utils/initQuestions.d.ts.map +1 -1
- package/dist/utils/initQuestions.js +2 -1
- package/dist/utils/initQuestions.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +3 -17
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +8 -514
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specGenerator.d.ts +11 -46
- package/dist/utils/specGenerator.d.ts.map +1 -1
- package/dist/utils/specGenerator.js +30 -63
- package/dist/utils/specGenerator.js.map +1 -1
- package/dist/utils/specServer.d.ts +5 -1
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +46 -11
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specSetup.d.ts +21 -4
- package/dist/utils/specSetup.d.ts.map +1 -1
- package/dist/utils/specSetup.js +116 -24
- package/dist/utils/specSetup.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.css +43 -2
- package/ui/app.js +201 -45
- package/ui/index.html +11 -2
- package/ui/route.js +54 -5
- package/dist/utils/agentConfigGenerator.d.ts +0 -17
- package/dist/utils/agentConfigGenerator.d.ts.map +0 -1
- package/dist/utils/agentConfigGenerator.js.map +0 -1
- package/dist/utils/specFileGenerator.d.ts +0 -30
- package/dist/utils/specFileGenerator.d.ts.map +0 -1
- package/dist/utils/specFileGenerator.js.map +0 -1
- package/dist/utils/templateEngine.d.ts +0 -35
- package/dist/utils/templateEngine.d.ts.map +0 -1
- package/dist/utils/templateEngine.js.map +0 -1
package/ui/app.js
CHANGED
|
@@ -78,7 +78,7 @@ function go(v,keep,sub){
|
|
|
78
78
|
$$('.content>.view').forEach(e=>e.classList.toggle('on',e.id==='v-'+(v==='new'||v==='setup'?'chat':v))); // one chat section for both flows (BL-PM-004)
|
|
79
79
|
syncNav();
|
|
80
80
|
$('#title').textContent=v==='file'?(TITLES[sub]||sub):v==='setup'?projectLabel(DATA.projects[PROJECT]):v==='new'?'New project':VIEWS[v];
|
|
81
|
-
$('#chatSub').hidden=!(v==='new'||v==='setup');if(v!=='new'&&v!=='setup'){$('#chatRestart').hidden=$('#chatClose').hidden=true;chat=null;}
|
|
81
|
+
$('#chatSub').hidden=!(v==='new'||v==='setup');if(v!=='new'&&v!=='setup'){$('#chatRestart').hidden=$('#chatClose').hidden=$('#chatSetups').hidden=true;chat=null;}
|
|
82
82
|
$('#modeSeg').hidden=v!=='board';
|
|
83
83
|
setNav(false);closeInsp();
|
|
84
84
|
if(v!=='file'||sub!==fileNoteFor)clearFileNote();
|
|
@@ -300,7 +300,7 @@ document.addEventListener('keydown',e=>{
|
|
|
300
300
|
const mod=e.metaKey||e.ctrlKey;const inField=/INPUT|SELECT|TEXTAREA/.test(e.target.tagName);
|
|
301
301
|
if(mod&&e.key.toLowerCase()==='k'){e.preventDefault();palVeil.classList.contains('open')?closePal():openPal();return}
|
|
302
302
|
if(mod&&/^[1-9]$/.test(e.key)){e.preventDefault();const n=NAV[+e.key-1];if(n)go(n[0],false,n[1]);return}
|
|
303
|
-
if(e.key==='Escape'){hideTip();closeInsp();closePal();closeSheet();if(chat&&chat.st.editing&&!chatBusy){chat.st.editing=null;drawChat();}setNav(false);return}
|
|
303
|
+
if(e.key==='Escape'){hideTip();closeInsp();closePal();closeSheet();if(chat&&chat.st.editing&&!chatBusy){chat.st.editing=null;comp=null;drawChat();}setNav(false);return}
|
|
304
304
|
if(inField||mod||e.altKey)return;
|
|
305
305
|
if(e.key==='h'&&TOKEN&&!openVeil.classList.contains('open')){go('home');return;}
|
|
306
306
|
if(/^[1-9]$/.test(e.key)){const n=NAV[+e.key-1];if(n)go(n[0],false,n[1]);}
|
|
@@ -382,38 +382,74 @@ async function getQuestions(url){
|
|
|
382
382
|
try{const r=await fetch(url,{cache:'no-store'});if(r.ok)return await r.json();return r.status===404?null:{error:(await r.json().catch(()=>({}))).error||'HTTP '+r.status};}
|
|
383
383
|
catch(e){return {error:'The server did not answer.'};}
|
|
384
384
|
}
|
|
385
|
-
/* The page's own question of a new project; every other one is the server's. */
|
|
385
|
+
/* The page's own question of a new project; every other one is the server's or the chat core's. */
|
|
386
386
|
const PARENT_Q={key:'parent',message:'Parent folder',label:'Folder',required:true,chat:"Nice, {name}. Where should it live? I'll create {name}/ inside this folder.",placeholder:'~/dev'};
|
|
387
|
-
const
|
|
388
|
-
|
|
387
|
+
const CC=window.SpecPilotChat; // the chat core (BL-PM-004b): src/core/chatFlow.ts, served as /assets/chat-core.js
|
|
388
|
+
/* Saved setups (BL-PM-004b): every setup the chat has started, kept in this browser under sp-setups. */
|
|
389
|
+
let storeOk=true,setups=[];
|
|
390
|
+
try{setups=setupsLoad(localStorage.getItem(SETUPS_KEY));}catch(e){storeOk=false;}
|
|
391
|
+
function storeSetups(){try{localStorage.setItem(SETUPS_KEY,JSON.stringify(setups));}catch(e){storeOk=false;}}
|
|
392
|
+
function saveSetup(st){if(!st.started)return;st.updatedAt=Date.now();setups=setupsPut(setups,setupRecord(st));storeSetups();}
|
|
393
|
+
function dropSetup(id){setups=setupsRemove(setups,id);storeSetups();}
|
|
394
|
+
const freshSetup=(kind,root,id)=>({id:id||(kind==='setup'?'s:'+root:'n'+Date.now().toString(36)+Math.random().toString(36).slice(2,6)),kind,root,answers:{},editing:null,started:false,seeded:{},preview:{done:false,changed:false},finished:false});
|
|
395
|
+
const restoreSetup=e=>({...JSON.parse(JSON.stringify(e)),editing:null});
|
|
396
|
+
const live={}; // the setups open in this page, by id
|
|
397
|
+
let curNew=null; // the new-project setup #new shows
|
|
398
|
+
let chat=null,chatBusy=false,comp=null;
|
|
389
399
|
/* Shown by go(): the chat for a new project, or for the project without .specs/. */
|
|
390
400
|
async function renderChat(isNew){
|
|
391
|
-
const pj=PROJECT,
|
|
392
|
-
$('#intro').hidden=$('#thread').hidden=$('#composer').hidden=note.hidden=true;$('#chatRestart').hidden=$('#chatClose').hidden=true;
|
|
393
|
-
chat=null;
|
|
401
|
+
const pj=PROJECT,note=$('#chatNote');
|
|
402
|
+
$('#intro').hidden=$('#thread').hidden=$('#composer').hidden=note.hidden=true;$('#chatRestart').hidden=$('#chatClose').hidden=$('#chatSetups').hidden=true;$('#cbody').hidden=true;
|
|
403
|
+
chat=null;comp=null;
|
|
394
404
|
if(!TOKEN){note.textContent='Started with --read-only, so nothing can be set up here.';note.hidden=false;return;}
|
|
395
405
|
const q=await getQuestions(isNew?'/api/projects/new':'/api/setup?project='+pj);
|
|
396
406
|
if(PROJECT!==pj||curView!==(isNew?'new':'setup'))return;
|
|
397
407
|
if(!q)return; // 404: not a folder named on the command line, so nothing to set up
|
|
398
408
|
if(q.error){note.textContent=q.error;note.hidden=false;return;}
|
|
399
|
-
|
|
409
|
+
let st;
|
|
410
|
+
if(isNew){
|
|
411
|
+
if(!curNew||!live[curNew]){const rec=curNew&&setups.find(e=>e.id===curNew);st=rec?restoreSetup(rec):freshSetup('new');curNew=st.id;live[st.id]=st;}
|
|
412
|
+
st=live[curNew];
|
|
413
|
+
}else{
|
|
414
|
+
const root=DATA.projects[pj].root,id='s:'+root,rec=setups.find(e=>e.id===id);
|
|
415
|
+
st=live[id]||(live[id]=rec?restoreSetup(rec):freshSetup('setup',root));
|
|
416
|
+
}
|
|
417
|
+
chat={id:st.id,isNew,project:pj,q,st};
|
|
418
|
+
$('#cbody').hidden=false;
|
|
400
419
|
drawChat();
|
|
401
420
|
}
|
|
402
|
-
|
|
421
|
+
/* The questions to ask now: the server's (the CLI's) through flowQuestions(), placed and completed by the chat core. */
|
|
422
|
+
function chatAsk(){
|
|
423
|
+
const st=chat.st,first=chat.isNew?[{...PARENT_Q,step:chat.q.steps[0]}]:[];
|
|
424
|
+
return CC.chatQuestions([...first,...chat.q.questions],flowQuestions(chat.q,st.answers,first),st.answers,chat.isNew?'new':'setup',chat.q.files.outside);
|
|
425
|
+
}
|
|
403
426
|
/* What fills {name} and {language} in the bot lines. */
|
|
404
427
|
function chatCtx(){
|
|
405
428
|
const a=chat.st.answers,lq=chat.q.questions.find(x=>x.key==='language'),c=lq&&lq.choices.find(x=>x.value===a.language);
|
|
406
429
|
return {name:chat.isNew?a.name:projectLabel(DATA.projects[chat.project]),language:c?c.name:(chat.q.detected?chat.q.detected.language:'')};
|
|
407
430
|
}
|
|
431
|
+
/* The list of saved setups beside the thread. */
|
|
432
|
+
function drawSetups(){
|
|
433
|
+
const el=$('#setupList');
|
|
434
|
+
if(!storeOk){el.innerHTML='<p class="note">Setups cannot be saved in this browser.</p>';return;}
|
|
435
|
+
const served=root=>DATA.projects.findIndex(p=>p.root===root);
|
|
436
|
+
el.innerHTML=setups.length?setups.map(e=>{
|
|
437
|
+
const off=e.kind==='setup'&&served(e.root)<0,t=setupTitle(e);
|
|
438
|
+
return `<div class="srow2${chat&&chat.st.id===e.id?' cur':''}"><button type="button" class="go" data-setup="${esc(e.id)}"${off?' disabled':''}><span class="t" translate="no">${esc(t)}</span><span class="d">${esc(off?`Open ${e.root} to resume`:`${setupStatus(e)} · ${when(new Date(e.updatedAt).toISOString())}`)}</span></button><button type="button" class="rm" data-rm-setup="${esc(e.id)}" aria-label="Remove ${esc(t)}">Remove</button></div>`;
|
|
439
|
+
}).join(''):'<p class="note">No saved setups yet.</p>';
|
|
440
|
+
}
|
|
408
441
|
function drawChat(){
|
|
409
442
|
const st=chat.st,isNew=chat.isNew,ctx=chatCtx();
|
|
410
|
-
$('#chatRestart').hidden=!st.started;$('#chatClose').hidden=!isNew;
|
|
443
|
+
$('#chatRestart').hidden=!st.started;$('#chatClose').hidden=!isNew;$('#chatSetups').hidden=false;
|
|
411
444
|
$('#title').textContent=isNew?(st.answers.name||'New project'):projectLabel(DATA.projects[chat.project]);
|
|
445
|
+
drawSetups();
|
|
412
446
|
if(!st.started){ // the intro
|
|
413
447
|
$('#intro').hidden=false;$('#thread').hidden=$('#composer').hidden=true;$('#chatSub').textContent='';$('#barI').style.width='0';$('#v-chat .bar').setAttribute('aria-valuenow','0');
|
|
414
448
|
const mono=t=>`<span class="mono" translate="no">${esc(t)}</span>`;
|
|
415
|
-
$('#
|
|
449
|
+
$('#introH').textContent=isNew?"Hey, I'm SpecPilot 👋":"Hey, I'm SpecPilot";
|
|
450
|
+
$('#introText').innerHTML=isNew?'I turn your project requirements into a complete, structured spec suite - requirements, architecture, tests - and keep it in sync as you build.'
|
|
416
451
|
:`There is no ${mono('.specs/')} folder in ${mono(DATA.projects[chat.project].root)} yet. I'll ask the same questions as ${mono('specpilot add-specs')}, one at a time, then write it and the files for your AI IDE. Existing files are never changed.`;
|
|
452
|
+
$('#introText2').hidden=!isNew;$('#introText2').innerHTML=`I write your ${mono('.specs/')} folder, filled in from your answers, plus the files that keep your AI IDE following it.`;
|
|
417
453
|
const det=$('#introDetected');det.hidden=!(chat.q.detected);det.textContent=chat.q.detected?chat.q.detected.line:'';
|
|
418
454
|
$('#nameLbl').hidden=$('#nameIn').parentElement.hidden=!isNew;$('#setupStart').hidden=isNew;$('#nameErr').textContent='';
|
|
419
455
|
if(isNew){$('#nameIn').value=st.answers.name||'';$('#nameGo').disabled=!$('#nameIn').value.trim();}
|
|
@@ -421,50 +457,123 @@ function drawChat(){
|
|
|
421
457
|
return;
|
|
422
458
|
}
|
|
423
459
|
$('#intro').hidden=true;$('#thread').hidden=$('#composer').hidden=false;
|
|
424
|
-
const list=
|
|
460
|
+
const list=chatAsk(),cur=nextQuestion(list,st.answers,st.editing),steps=[...new Set(list.map(x=>x.step))],done=list.filter(x=>answered(x,st.answers)).length;
|
|
461
|
+
if(st.finished!==!cur){st.finished=!cur;saveSetup(st);drawSetups();}
|
|
425
462
|
const bar=$('#v-chat .bar'),pct=Math.round(done/list.length*100);$('#barI').style.width=pct+'%';bar.setAttribute('aria-valuenow',pct);
|
|
426
463
|
$('#chatSub').textContent=cur?`Step ${steps.indexOf(cur.step)+1} of ${steps.length} · ${cur.step}`:'Review';
|
|
427
464
|
let html=threadRows(chat.q,list,st.answers,cur,ctx,isNew).map(r=>
|
|
428
465
|
r.kind==='divider'?`<div class="divider"><span>${esc(r.text)}</span></div>`
|
|
429
|
-
:r.kind==='
|
|
466
|
+
:r.kind==='note'?`<p class="cnote">${esc(r.text)}</p>`
|
|
467
|
+
:r.kind==='bot'?`<div class="bot"><svg class="logo" aria-hidden="true" focusable="false"><use href="#logo"/></svg><div class="msg">${esc(r.text)}${r.cli?`<span class="cli" translate="no">${esc(r.cli)}</span>`:''}${r.caption?`<span class="cap" translate="no">${esc(r.caption)}</span>`:''}</div></div>`
|
|
430
468
|
:`<div class="me${r.skipped?' skipped':''}"><button type="button" class="b${r.mono?' mono':''}" data-k="${esc(r.key)}" aria-label="Your answer: ${esc(r.text)}. Edit">${esc(r.text)}</button><span class="ed" aria-hidden="true">✎ tap to edit</span></div>`).join('');
|
|
431
469
|
if(!cur){
|
|
432
|
-
const files=previewFiles(chat.q,st.answers);
|
|
433
|
-
html+=`<div class="recap"><svg class="logo" aria-hidden="true" focusable="false"><use href="#logo"/></svg><div class="card">That's everything I need. Here's a quick recap:<div class="pen">✎ Click any answer to change it. You come straight back here.</div><div class="grid">${recapCards(list,st.answers).map(c=>`<div class="rc"><div class="t">${esc(c.title)}</div>${c.rows.map(r=>`<button type="button" class="l" data-k="${esc(r.key)}"><span>${esc(r.label)}</span><span translate="no">${esc(r.value)}</span></button>`).join('')}</div>`).join('')}</div
|
|
470
|
+
const files=previewFiles(chat.q,st.answers),pv=st.preview,again=pv.done&&pv.changed;
|
|
471
|
+
html+=`<div class="recap"><svg class="logo" aria-hidden="true" focusable="false"><use href="#logo"/></svg><div class="card">That's everything I need. Here's a quick recap:<div class="pen">✎ Click any answer to change it. You come straight back here.</div><div class="grid">${recapCards(list,st.answers).map(c=>`<div class="rc"><div class="t">${esc(c.title)}</div>${c.rows.map(r=>`<button type="button" class="l" data-k="${esc(r.key)}"><span>${esc(r.label)}</span><span translate="no">${esc(r.value)}</span></button>`).join('')}</div>`).join('')}</div>${again?'<p class="chg">Answers changed since the last preview. Preview again to see the new files.</p>':''}<details id="pv"><summary>${again?'Preview again':'Preview files'} (${files.length})</summary><ul translate="no" id="pvList">${files.map(f=>`<li>${esc(f.path)}${f.kept?' <span class="kept">Already here, will be kept</span>':''}</li>`).join('')}</ul></details><button type="button" class="btn pri" id="chatCreate">${isNew?'Create Project':'Create .specs/'}</button><p class="err" id="chatErr" role="alert"></p></div></div>`;
|
|
434
472
|
}
|
|
435
473
|
$('#msgs').innerHTML=html;
|
|
474
|
+
const pvEl=$('#pv');if(pvEl)pvEl.addEventListener('toggle',()=>{if(pvEl.open)loadPreview();});
|
|
436
475
|
drawComposer(cur);
|
|
437
476
|
const th=$('#thread');th.scrollTop=th.scrollHeight;
|
|
438
477
|
}
|
|
478
|
+
/* The request body of a create or a preview: the CLI's answers, the optional fields and the folded context answers. */
|
|
479
|
+
function chatBody(){
|
|
480
|
+
const asked=chatAsk(),st=chat.st;
|
|
481
|
+
const body={...flowBody(asked.filter(x=>!x.core),st.answers),...CC.requestFields(asked,st.answers,chat.isNew?'new':'setup')};
|
|
482
|
+
if(chat.isNew)body.name=st.answers.name;
|
|
483
|
+
return body;
|
|
484
|
+
}
|
|
485
|
+
/* The recap's preview: POST /api/preview with the create body, each file then shown as render() gives it. */
|
|
486
|
+
async function loadPreview(){
|
|
487
|
+
const c=chat,body=chatBody(),list=$('#pvList');if(!list)return;
|
|
488
|
+
if(c.isNew)delete body.parent;
|
|
489
|
+
let r,res={};
|
|
490
|
+
try{r=await fetch(c.isNew?'/api/preview':'/api/preview?project='+c.project,{method:'POST',cache:'no-store',headers:{'Content-Type':'application/json','X-SpecPilot-Token':TOKEN},body:JSON.stringify(body)});res=await r.json().catch(()=>({}));}
|
|
491
|
+
catch(e){r=null;}
|
|
492
|
+
if(chat!==c||!$('#pvList'))return;
|
|
493
|
+
if(!r||r.status!==200){$('#pvList').insertAdjacentHTML('beforebegin',`<p class="err">${esc(r?res.error||`The preview could not be made (HTTP ${r.status}).`:'The server did not answer.')}</p>`);return;}
|
|
494
|
+
const kept=new Set(res.kept||[]);
|
|
495
|
+
$('#pvList').outerHTML=`<div class="pvl" id="pvList" translate="no">${res.files.map(f=>`<details class="pf"><summary>${esc(f.path)}${kept.has(f.path)?' <span class="kept">Already here, will be kept</span>':''}</summary>${kept.has(f.path)?'':/\.md$/.test(f.path)?`<div class="md">${md(f.content)}</div>`:`<pre>${esc(f.content)}</pre>`}</details>`).join('')}</div>`;
|
|
496
|
+
if(c.st.preview.changed||!c.st.preview.done){c.st.preview={done:true,changed:false};saveSetup(c.st);}
|
|
497
|
+
const chg=$('#msgs .chg');if(chg)chg.remove();const sum=$('#pv summary');if(sum)sum.textContent=`Preview files (${res.files.length})`;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* ---- the composer: one state per shown question (`comp`), drawn from the question and redrawn on every change */
|
|
501
|
+
const isMulti=t=>t==='multi'||t==='grouped-multi'||t==='platform-grid';
|
|
502
|
+
function initComp(cur){
|
|
503
|
+
const a=chat.st.answers,stored=cur.answered?a[cur.key]:undefined,seed=stored===undefined?cur.seed:stored;
|
|
504
|
+
const c={key:cur.key,tab:null,custom:'',showCustom:false};
|
|
505
|
+
if(cur.type==='categorized')c.v=JSON.parse(JSON.stringify(seed||{}));
|
|
506
|
+
else if(isMulti(cur.type))c.v=Array.isArray(seed)?[...seed]:[];
|
|
507
|
+
else if(cur.type==='text'||cur.type==='tabbed-chips')c.v=typeof stored==='string'&&stored!==cur.todo?stored:'';
|
|
508
|
+
else{c.v=typeof seed==='string'?seed:'';const ids=compOptions(cur).map(o=>o.id);if(cur.custom&&c.v&&!ids.includes(c.v)){c.custom=c.v;c.showCustom=true;c.v='';}}
|
|
509
|
+
const opts=compOptions(cur),sel=Array.isArray(c.v)?c.v:[c.v];
|
|
510
|
+
const withSel=opts.find(o=>o.group&&sel.includes(o.id))||opts.find(o=>o.group&&o.badge==='recommended')||opts.find(o=>o.group);
|
|
511
|
+
c.tab=cur.type==='categorized'?(cur.categories[0]&&cur.categories[0].id):withSel?withSel.group:null;
|
|
512
|
+
if(cur.type==='platform-grid'){const tabs=CC.platformGridGroups(a.projectCategory||null,c.v);c.tab=tabs.find(t=>c.v.some(id=>CC.PLATFORM_GROUPS.find(g=>g.group===t).items.some(i=>i.id===id)))||tabs[0];}
|
|
513
|
+
return c;
|
|
514
|
+
}
|
|
515
|
+
const compOptions=cur=>cur.core?(cur.options||[]):choiceOptions(cur);
|
|
439
516
|
function drawComposer(cur){
|
|
440
517
|
const st=chat.st,c=$('#comp'),editing=!!st.editing;
|
|
441
|
-
if(!cur){c.innerHTML=`<div class="act"><span class="hint">All answered. Review above, then ${chat.isNew?'Create Project':'Create .specs/'}.</span></div>`;return;}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
518
|
+
if(!cur){comp=null;c.innerHTML=`<div class="act"><span class="hint">All answered. Review above, then ${chat.isNew?'Create Project':'Create .specs/'}.</span></div>`;return;}
|
|
519
|
+
if(!comp||comp.key!==cur.key)comp=initComp(cur);
|
|
520
|
+
const label=esc(cur.message||cur.chat||cur.label),k=comp,acts=(extra,ok)=>`<div class="act"><span class="hint">${editing?'Changing an earlier answer':''}</span><span class="err" id="compErr" role="alert"></span>${editing?'<button type="button" class="btn" id="chatCancel">Cancel</button>':''}${extra||''}<button type="submit" class="btn pri" id="chatGo"${ok?'':' disabled'}>${isMulti(cur.type)&&k.v.length?`Continue (${k.v.length+(k.custom.trim()?1:0)})`:'Continue'}</button></div>`;
|
|
521
|
+
const skip=cur.required?'':'<button type="button" class="btn" id="chatSkip">Skip</button>';
|
|
522
|
+
const other=cur.custom?`<button type="button" class="chip other" id="chatOther" aria-pressed="${k.showCustom}"><b>${cur.type==='grouped-multi'?'Add custom user type':'Other: ___'}</b></button>`:'';
|
|
523
|
+
const customIn=k.showCustom?`<div class="crow"><input type="text" id="chatCustom" maxlength="100" placeholder="Type your own" aria-label="Your own answer" value="${esc(k.custom)}"></div>`:'';
|
|
524
|
+
const note=cur.note?`<p class="cnote">${esc(cur.note)}</p>`:'';
|
|
525
|
+
let h='';
|
|
526
|
+
if(cur.type==='text'){
|
|
527
|
+
const max=cur.key==='parent'?4096:cur.key==='handle'?39:cur.key==='nonGoals'?870:1000;
|
|
528
|
+
h=`<div class="crow"><input type="text" id="chatIn" class="${cur.key==='parent'||cur.key==='handle'?'mono':''}" placeholder="${esc(cur.placeholder||'')}" aria-label="${label}" aria-describedby="compErr" maxlength="${max}"${cur.required?' aria-required="true"':''} value="${esc(k.v)}"></div>`
|
|
529
|
+
+acts((cur.todo?'<button type="button" class="btn" id="chatTodo">Not sure - skip for now</button>':'')+skip,true);
|
|
530
|
+
}else if(cur.type==='tabbed-chips'){
|
|
531
|
+
const groups=[...new Set(cur.options.map(o=>o.group))],tab=k.tab||groups[0];
|
|
532
|
+
h=`<p class="lbl">Pick a starter project type from below</p>${tabsHtml(groups.map(g=>({id:g,label:g})),tab)}<div class="chips" role="group" aria-label="${label}">${cur.options.filter(o=>o.group===tab).map(o=>optionHtml(o,k.v===o.id)).join('')}</div><p class="lbl">Or describe your project idea in plain words below</p><div class="crow"><input type="text" id="chatIn" placeholder="${esc(cur.placeholder||'')}" aria-label="${label}" aria-describedby="compErr" maxlength="1000" aria-required="true" value="${esc(k.v)}"></div>`+acts('',true);
|
|
533
|
+
}else if(cur.type==='platform-grid'){
|
|
534
|
+
const tabs=CC.platformGridGroups(st.answers.projectCategory||null,k.v),tab=tabs.includes(k.tab)?k.tab:tabs[0],g=CC.PLATFORM_GROUPS.find(x=>x.group===tab);
|
|
535
|
+
const line=CC.bundleLine(k.v);
|
|
536
|
+
h=tabsHtml(tabs.map(t=>{const grp=CC.PLATFORM_GROUPS.find(x=>x.group===t);return {id:t,label:`${grp.emoji} ${t}`,count:k.v.filter(id=>grp.items.some(i=>i.id===id)).length};}),tab)
|
|
537
|
+
+`<div class="chips grid2" role="group" aria-label="${label}">${g?g.items.map(i=>optionHtml({id:i.id,label:i.label,emoji:i.emoji,description:`[${i.lang}]`},k.v.includes(i.id))).join(''):''}</div>${line?`<p class="cnote">${esc(line)}</p>`:''}`+acts('',k.v.length>0);
|
|
538
|
+
}else if(cur.type==='categorized'){
|
|
539
|
+
const cats=cur.categories,tab=cats.some(x=>x.id===k.tab)?k.tab:cats[0]&&cats[0].id,cat=cats.find(x=>x.id===tab);
|
|
540
|
+
h=tabsHtml(cats.map(x=>({id:x.id,label:`${x.emoji} ${x.label}`,count:(k.v[x.id]||[]).length})),tab)
|
|
541
|
+
+`<div class="chips" role="group" aria-label="${label}">${cat?cat.options.map(o=>optionHtml({id:o,label:o,emoji:o==='None'?'➖':''},(k.v[cat.id]||[]).includes(o))).join(''):''}</div>`+acts('<button type="button" class="btn" id="chatNone">None of these apply →</button>',true);
|
|
448
542
|
}else{
|
|
449
|
-
|
|
450
|
-
|
|
543
|
+
const opts=compOptions(cur),sel=isMulti(cur.type)?k.v:[k.v],extra=isMulti(cur.type)?k.v.filter(v=>!opts.some(o=>o.id===v)).map(v=>({id:v,label:v})):[];
|
|
544
|
+
const grouped=cur.type!=='grouped-multi'&&opts.some(o=>o.group),groups=[...new Set(opts.filter(o=>o.group).map(o=>o.group))],tab=groups.includes(k.tab)?k.tab:groups[0];
|
|
545
|
+
let body;
|
|
546
|
+
if(cur.type==='grouped-multi')body=groups.map(g=>`<p class="lbl">${esc(g)}</p><div class="chips">${opts.filter(o=>o.group===g).map(o=>optionHtml(o,sel.includes(o.id))).join('')}</div>`).join('')
|
|
547
|
+
+`<div class="chips">${[...opts.filter(o=>!o.group),...extra].map(o=>optionHtml(o,sel.includes(o.id))).join('')}${other}</div>`;
|
|
548
|
+
else body=(grouped?tabsHtml(groups.map(g=>({id:g,label:g,count:opts.filter(o=>o.group===g&&sel.includes(o.id)).length})),tab):'')
|
|
549
|
+
+`<div class="chips${cur.type==='cards'||opts.some(o=>o.description)?' grid2':''}" role="group" aria-label="${label}">${opts.filter(o=>!grouped||o.group===tab).map(o=>optionHtml(o,sel.includes(o.id))).join('')}</div>`
|
|
550
|
+
+`<div class="chips">${(grouped?opts.filter(o=>!o.group):[]).concat(extra).map(o=>optionHtml(o,sel.includes(o.id))).join('')}${other}</div>`;
|
|
551
|
+
const any=isMulti(cur.type)?k.v.length>0||!!k.custom.trim():!!k.v||!!(k.showCustom&&k.custom.trim());
|
|
552
|
+
h=note+body+customIn+acts(isMulti(cur.type)?'':skip,any||isMulti(cur.type)&&!cur.required);
|
|
451
553
|
}
|
|
554
|
+
c.innerHTML=h;
|
|
452
555
|
}
|
|
453
|
-
/* An answer: stored,
|
|
556
|
+
/* An answer: stored, stale seeds replaced, the preview marked out of date, the setup saved, and the chat moves on. */
|
|
454
557
|
function chatAnswer(cur,value){
|
|
455
|
-
|
|
558
|
+
const st=chat.st;
|
|
559
|
+
Object.assign(st.answers,cur.core?CC.answerPatch(cur.key,value,st.answers):{[cur.key]:value});
|
|
560
|
+
if(cur.seed!==undefined&&JSON.stringify(value)===JSON.stringify(cur.seed))st.seeded[cur.key]=value;else delete st.seeded[cur.key];
|
|
561
|
+
const r=CC.reseed(chatAsk(),st.answers,st.seeded);st.answers=r.answers;st.seeded=r.seeded;
|
|
562
|
+
if(st.preview.done)st.preview.changed=true;
|
|
563
|
+
st.editing=null;comp=null;saveSetup(st);drawChat();
|
|
456
564
|
}
|
|
457
565
|
function chatEdit(key){
|
|
458
566
|
if(chatBusy)return;
|
|
567
|
+
comp=null;
|
|
459
568
|
if(key==='name'){chat.st.started=false;drawChat();return;}
|
|
460
569
|
chat.st.editing=key;drawChat();
|
|
461
570
|
}
|
|
462
571
|
/* The same POST the forms sent: /api/setup for a folder without .specs/, /api/projects/new for a new project. */
|
|
463
572
|
async function chatCreate(){
|
|
464
573
|
if(chatBusy)return;
|
|
465
|
-
const c=chat,
|
|
574
|
+
const c=chat,root=DATA.projects[c.project].root,btn=$('#chatCreate'),err=$('#chatErr');
|
|
466
575
|
chatBusy=true;btn.disabled=true;err.textContent='';
|
|
467
|
-
const body=
|
|
576
|
+
const body=chatBody();
|
|
468
577
|
let r,res={};
|
|
469
578
|
try{
|
|
470
579
|
r=await fetch(c.isNew?'/api/projects/new':'/api/setup?project='+c.project,{method:'POST',cache:'no-store',headers:{'Content-Type':'application/json','X-SpecPilot-Token':TOKEN},body:JSON.stringify(body)});
|
|
@@ -474,16 +583,17 @@ async function chatCreate(){
|
|
|
474
583
|
if(chat!==c)return; // the view changed meanwhile
|
|
475
584
|
btn.disabled=false;
|
|
476
585
|
if(!r){err.textContent=c.isNew?'The server did not answer.':'The server did not answer. Nothing was set up.';return;}
|
|
586
|
+
const done=()=>{dropSetup(c.st.id);delete live[c.st.id];if(curNew===c.st.id)curNew=null;};
|
|
477
587
|
if(c.isNew){
|
|
478
588
|
const o=openOutcome(r.status,res,true);
|
|
479
|
-
if(o.project===null){err.textContent=o.toast;return;}
|
|
480
|
-
if(r.status===200)
|
|
589
|
+
if(o.project===null){err.textContent=r.status===413?'The answers are too long to send. Shorten the longest ones and try again.':o.toast;return;}
|
|
590
|
+
if(r.status===200)done();
|
|
481
591
|
await showOutcome(o);
|
|
482
592
|
if(r.status===200)noteCreated(res);
|
|
483
593
|
return;
|
|
484
594
|
}
|
|
485
595
|
if(r.status!==200&&!(r.status===409&&res.specs)){err.textContent=res.error||`Nothing was set up (HTTP ${r.status}).`;return;}
|
|
486
|
-
|
|
596
|
+
done();
|
|
487
597
|
if(PROJECT!==c.project)return;
|
|
488
598
|
await apply(res.specs,null);
|
|
489
599
|
if(r.status!==200){toast(res.error||`Nothing was set up (HTTP ${r.status}).`);return;}
|
|
@@ -498,30 +608,76 @@ $('#introForm').onsubmit=e=>{
|
|
|
498
608
|
if(problem){$('#nameErr').textContent=problem;$('#nameIn').focus();return;}
|
|
499
609
|
chat.st.answers.name=v;
|
|
500
610
|
}
|
|
501
|
-
chat.st.started=true;chat.st.editing=null;drawChat();
|
|
611
|
+
chat.st.started=true;chat.st.editing=null;saveSetup(chat.st);drawChat();
|
|
502
612
|
};
|
|
503
613
|
$('#nameIn').addEventListener('input',()=>{$('#nameGo').disabled=!$('#nameIn').value.trim();$('#nameErr').textContent='';});
|
|
504
614
|
$('#setupStart').onclick=()=>$('#introForm').requestSubmit();
|
|
615
|
+
const curQuestion=()=>chat&&nextQuestion(chatAsk(),chat.st.answers,chat.st.editing);
|
|
505
616
|
$('#comp').onsubmit=e=>{
|
|
506
|
-
e.preventDefault();if(!chat||chatBusy)return;
|
|
507
|
-
const cur=
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
617
|
+
e.preventDefault();if(!chat||chatBusy||!comp)return;
|
|
618
|
+
const cur=curQuestion();if(!cur||cur.key!==comp.key)return;
|
|
619
|
+
const fail=m=>{$('#compErr').textContent=m;const i=$('#chatIn');if(i){i.setAttribute('aria-invalid','true');i.focus();}};
|
|
620
|
+
if(cur.type==='text'||cur.type==='tabbed-chips'){
|
|
621
|
+
const v=$('#chatIn').value,problem=answerError(cur,v);
|
|
622
|
+
if(problem)return fail(problem);
|
|
623
|
+
return chatAnswer(cur,v.trim());
|
|
624
|
+
}
|
|
625
|
+
const custom=comp.custom.trim();
|
|
626
|
+
if(cur.type==='categorized')return chatAnswer(cur,comp.v);
|
|
627
|
+
if(isMulti(cur.type)){
|
|
628
|
+
const v=custom&&!comp.v.includes(custom)?[...comp.v,custom]:comp.v;
|
|
629
|
+
if(cur.required&&!v.length)return;
|
|
630
|
+
return chatAnswer(cur,v);
|
|
631
|
+
}
|
|
632
|
+
const v=comp.showCustom&&custom?custom:comp.v;
|
|
633
|
+
if(v)chatAnswer(cur,v);
|
|
512
634
|
};
|
|
513
635
|
$('#comp').addEventListener('click',e=>{
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
636
|
+
if(!chat||!comp)return;
|
|
637
|
+
const cur=curQuestion();if(!cur)return;
|
|
638
|
+
const t=e.target.closest('button');if(!t)return;
|
|
639
|
+
const redraw=sel=>{drawComposer(cur);const el=sel&&$(`#comp ${sel}`);if(el)el.focus();};
|
|
640
|
+
if(t.dataset.tab!==undefined){comp.tab=t.dataset.tab;return redraw(`.tab[data-tab="${CSS.escape(t.dataset.tab)}"]`);}
|
|
641
|
+
if(t.id==='chatOther'){comp.showCustom=!comp.showCustom;if(!isMulti(cur.type)&&comp.showCustom)comp.v='';return redraw(comp.showCustom?'#chatCustom':'#chatOther');}
|
|
642
|
+
if(t.id==='chatSkip'){if(!cur.required)chatAnswer(cur,isMulti(cur.type)?[]:'');return;}
|
|
643
|
+
if(t.id==='chatTodo'){chatAnswer(cur,cur.todo);return;}
|
|
644
|
+
if(t.id==='chatNone'){chatAnswer(cur,CC.noneOfThese(comp.v,CC.visibleCategories(chat.st.answers.projectCategory||null,CC.hasMobilePlatform(chat.st.answers.platforms||[]))));return;}
|
|
645
|
+
if(t.id==='chatCancel'){const k=chat.st.editing;chat.st.editing=null;comp=null;drawChat();const b=$(`#msgs [data-k="${k}"]`);if(b)b.focus();return;}
|
|
646
|
+
const v=t.dataset.v;if(v===undefined)return;
|
|
647
|
+
if(cur.type==='tabbed-chips'){comp.v=v;$('#chatIn').value=v;}
|
|
648
|
+
else if(cur.type==='platform-grid')comp.v=CC.togglePlatform(comp.v,v);
|
|
649
|
+
else if(cur.type==='categorized')comp.v=CC.toggleIntegration(comp.v,comp.tab||cur.categories[0].id,v);
|
|
650
|
+
else if(isMulti(cur.type))comp.v=comp.v.includes(v)?comp.v.filter(x=>x!==v):[...comp.v,v];
|
|
651
|
+
else{comp.v=v;comp.showCustom=false;}
|
|
652
|
+
redraw(`.chip[data-v="${CSS.escape(v)}"]`);
|
|
653
|
+
});
|
|
654
|
+
$('#comp').addEventListener('input',e=>{
|
|
655
|
+
if(!comp)return;
|
|
656
|
+
if(e.target.id==='chatIn'){$('#compErr').textContent='';e.target.removeAttribute('aria-invalid');comp.v=e.target.value;}
|
|
657
|
+
if(e.target.id==='chatCustom'){comp.custom=e.target.value;const go=$('#chatGo');if(go&&comp.custom.trim())go.disabled=false;}
|
|
518
658
|
});
|
|
519
|
-
$('#comp').addEventListener('input',e=>{if(e.target.id==='chatIn'){$('#compErr').textContent='';e.target.removeAttribute('aria-invalid');}});
|
|
520
659
|
$('#msgs').addEventListener('click',e=>{
|
|
521
660
|
if(e.target.id==='chatCreate'){chatCreate();return;}
|
|
522
661
|
const b=e.target.closest('[data-k]');if(b)chatEdit(b.dataset.k);
|
|
523
662
|
});
|
|
524
|
-
$('#
|
|
663
|
+
$('#setupList').addEventListener('click',e=>{
|
|
664
|
+
if(chatBusy)return;
|
|
665
|
+
const rm=e.target.closest('[data-rm-setup]');
|
|
666
|
+
if(rm){
|
|
667
|
+
if(!confirm('Remove this setup?'))return;
|
|
668
|
+
const id=rm.dataset.rmSetup;dropSetup(id);delete live[id];
|
|
669
|
+
if(chat&&chat.st.id===id){if(curNew===id)curNew=null;renderChat(chat.isNew);}else drawSetups();
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const b=e.target.closest('[data-setup]');if(!b)return;
|
|
673
|
+
const s=setups.find(x=>x.id===b.dataset.setup);if(!s)return;
|
|
674
|
+
$('#cbody').classList.remove('lst');
|
|
675
|
+
if(s.kind==='new'){curNew=s.id;if(curView==='new')renderChat(true);else go('new');return;}
|
|
676
|
+
const i=DATA.projects.findIndex(p=>p.root===s.root);if(i>=0)location.hash='#'+i+'/board';
|
|
677
|
+
});
|
|
678
|
+
$('#setupNew').onclick=()=>{if(chatBusy)return;curNew=null;$('#cbody').classList.remove('lst');if(curView==='new')renderChat(true);else go('new');};
|
|
679
|
+
$('#chatSetups').onclick=()=>$('#cbody').classList.toggle('lst');
|
|
680
|
+
$('#chatRestart').onclick=()=>{if(!chat||chatBusy)return;dropSetup(chat.st.id);chat.st=live[chat.st.id]=freshSetup(chat.st.kind,chat.st.root,chat.st.id);comp=null;drawChat();};
|
|
525
681
|
$('#chatClose').onclick=()=>{if(!chatBusy)go('home');};
|
|
526
682
|
|
|
527
683
|
/* ---------------- live reload (BL-052) ----------------
|
package/ui/index.html
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<link rel="stylesheet" href="/assets/app.css">
|
|
11
11
|
<script src="/assets/md.js" defer></script>
|
|
12
12
|
<script src="/assets/route.js" defer></script>
|
|
13
|
+
<script src="/assets/chat-core.js" defer></script>
|
|
13
14
|
<script src="/assets/app.js" defer></script>
|
|
14
15
|
</head>
|
|
15
16
|
<body>
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
<div><h1 id="title">Tasks</h1><div class="sub"><span id="subName" translate="no"></span><span class="mono" id="subPath" translate="no"></span><span id="chatSub" aria-live="polite" hidden></span></div></div>
|
|
112
113
|
<div class="right">
|
|
113
114
|
<div class="seg" id="modeSeg"><button class="on" data-m="list">List</button><button data-m="board">Board</button></div>
|
|
114
|
-
<button type="button" class="btn" id="chatRestart" hidden>Start over</button><button type="button" class="btn" id="chatClose" hidden>Close</button>
|
|
115
|
+
<button type="button" class="btn" id="chatSetups" hidden aria-controls="setups">Setups</button><button type="button" class="btn" id="chatRestart" hidden>Start over</button><button type="button" class="btn" id="chatClose" hidden>Close</button>
|
|
115
116
|
</div>
|
|
116
117
|
</div>
|
|
117
118
|
<div class="content" id="content" tabindex="-1">
|
|
@@ -161,9 +162,15 @@
|
|
|
161
162
|
<section class="view chat" id="v-chat">
|
|
162
163
|
<div class="bar" role="progressbar" aria-label="Setup progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i id="barI"></i></div>
|
|
163
164
|
<p class="note" id="chatNote" hidden></p>
|
|
165
|
+
<div class="cbody" id="cbody" hidden>
|
|
166
|
+
<aside class="setups" id="setups" aria-label="Saved setups">
|
|
167
|
+
<div class="sh"><span>Setups</span><button type="button" class="btn sm" id="setupNew">New setup</button></div>
|
|
168
|
+
<div id="setupList"></div>
|
|
169
|
+
</aside>
|
|
170
|
+
<div class="cmain">
|
|
164
171
|
<section class="intro" id="intro" hidden>
|
|
165
172
|
<svg class="big" aria-hidden="true" focusable="false"><use href="#logo"/></svg>
|
|
166
|
-
<div><h2>Hey, I'm SpecPilot</h2><p id="introText"></p><p class="note" id="introDetected" hidden translate="no"></p></div>
|
|
173
|
+
<div><h2 id="introH">Hey, I'm SpecPilot</h2><p id="introText"></p><p id="introText2" hidden></p><p class="note" id="introDetected" hidden translate="no"></p></div>
|
|
167
174
|
<div class="fine">Runs on this machine. Nothing leaves it.</div>
|
|
168
175
|
<form class="start" id="introForm" autocomplete="off">
|
|
169
176
|
<div class="lbl" id="nameLbl">Name your project to start</div>
|
|
@@ -174,6 +181,8 @@
|
|
|
174
181
|
</section>
|
|
175
182
|
<section class="thread" id="thread" hidden><div class="col" id="msgs"></div></section>
|
|
176
183
|
<section class="composer" id="composer" hidden><form class="col" id="comp" autocomplete="off"></form></section>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
177
186
|
</section>
|
|
178
187
|
|
|
179
188
|
<!-- FILE: any .specs/ file, rendered as written -->
|
package/ui/route.js
CHANGED
|
@@ -116,6 +116,7 @@ function flowValue(qu,answers){
|
|
|
116
116
|
/* Whether a question has been answered: its key is there and, for a choice, the answer is one of the
|
|
117
117
|
choices now offered (a framework kept from another language is asked again). An empty optional answer counts. */
|
|
118
118
|
function answered(qu,answers){
|
|
119
|
+
if(typeof qu.answered==='boolean')return qu.answered; // a question from the chat core (BL-PM-004b) knows
|
|
119
120
|
if(!(qu.key in answers))return false;
|
|
120
121
|
return !qu.choices||qu.choices.some(c=>c.value===answers[qu.key]);
|
|
121
122
|
}
|
|
@@ -161,22 +162,29 @@ function chatText(qu,ctx){return String(qu.chat||'').replace(/\{name\}/g,ctx.nam
|
|
|
161
162
|
/* The answer as a bubble or a recap row shows it: the choice's own text up to its " — " part (the chips
|
|
162
163
|
keep the whole), the typed text, or Skipped. */
|
|
163
164
|
function answerText(qu,answers){
|
|
165
|
+
if(typeof qu.text==='string')return qu.text; // the chat core's own (BL-PM-004b)
|
|
164
166
|
const v=answers[qu.key];
|
|
165
167
|
if(qu.choices){const c=qu.choices.find(x=>x.value===v);return c?c.name.split(' — ')[0]:'';}
|
|
166
168
|
return String(v===undefined?'':v).trim()||'Skipped';
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
/* The thread up to the current question: the name bubble (a new project only: `named`), a divider per step,
|
|
170
|
-
|
|
172
|
+
the skip notes before a question (BL-PM-004b), a bot row per asked question (with its file caption) and an
|
|
173
|
+
answer row per answered one, then the note after it; after the last answer a Review divider. */
|
|
171
174
|
function threadRows(q,list,answers,cur,ctx,named){
|
|
172
175
|
const steps=[...new Set(list.map(x=>x.step))],rows=[];
|
|
173
176
|
if(named)rows.push({kind:'user',key:'name',text:ctx.name,mono:true,skipped:false});
|
|
174
177
|
let last=null;
|
|
175
178
|
for(const qu of list){
|
|
176
179
|
if(qu.step!==last){rows.push({kind:'divider',text:`Step ${steps.indexOf(qu.step)+1} · ${qu.step}`});last=qu.step;}
|
|
177
|
-
rows.push({kind:'
|
|
180
|
+
for(const n of qu.notesBefore||[])rows.push({kind:'note',text:n});
|
|
181
|
+
rows.push({kind:'bot',key:qu.key,text:chatText(qu,ctx),cli:qu.message,caption:qu.caption||''});
|
|
178
182
|
if(cur&&qu.key===cur.key)break;
|
|
179
|
-
if(answered(qu,answers))
|
|
183
|
+
if(answered(qu,answers)){
|
|
184
|
+
const text=answerText(qu,answers);
|
|
185
|
+
rows.push({kind:'user',key:qu.key,text,mono:qu.key==='parent'||qu.key==='handle',skipped:text==='Skipped'||text==='None'&&!qu.choices});
|
|
186
|
+
if(qu.noteAfter)rows.push({kind:'note',text:qu.noteAfter});
|
|
187
|
+
}
|
|
180
188
|
}
|
|
181
189
|
if(!cur)rows.push({kind:'divider',text:'Review'});
|
|
182
190
|
return rows;
|
|
@@ -203,7 +211,48 @@ function previewFiles(q,answers){
|
|
|
203
211
|
return [...(q.files.specs[pick('apiParadigm')]||[]),...(q.files.outside[ide]||[])].map(path=>({path,kept:keep.includes(path)}));
|
|
204
212
|
}
|
|
205
213
|
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
/* ---- the full chat (BL-PM-004b): one renderer for every option, tabs, and the saved setups ---- */
|
|
215
|
+
|
|
216
|
+
/* One option as a chip, or a card when it has a description: emoji, label, a Recommended or Check this badge,
|
|
217
|
+
the description and a warning line. `pressed` is its state; `data-v` its value. */
|
|
218
|
+
function optionHtml(o,pressed){
|
|
219
|
+
const badge=o.badge==='recommended'?'<span class="bdg">Recommended</span>':o.badge==='flagged'?'<span class="bdg fl">Check this</span>':'';
|
|
220
|
+
return `<button type="button" class="chip${o.description?' card':''}${o.todo?' todo':''}" aria-pressed="${!!pressed}" data-v="${esc(o.id)}"><b>${o.emoji?`<span class="em" aria-hidden="true">${esc(o.emoji)}</span>`:''}${esc(o.label)}${badge}</b>${o.description?`<small>${esc(o.description)}</small>`:''}${o.warning?`<small class="wn">⚠ ${esc(o.warning)}</small>`:''}</button>`;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* A tab strip: `tabs` as [{id, label, count}], the active one selected. */
|
|
224
|
+
function tabsHtml(tabs,active){
|
|
225
|
+
return `<div class="ctabs" role="tablist">${tabs.map(t=>`<button type="button" role="tab" class="tab" aria-selected="${t.id===active}" data-tab="${esc(t.id)}">${esc(t.label)}${t.count?` <span class="cnt">${t.count}</span>`:''}</button>`).join('')}</div>`;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* A CLI question's choices as options: the text up to " — " as the label, the rest as the description,
|
|
229
|
+
with the chat core's badges. */
|
|
230
|
+
function choiceOptions(qu){
|
|
231
|
+
return (qu.choices||[]).map(c=>{const [label,description]=c.name.split(' — ');return {id:c.value,label,description,badge:qu.badges&&qu.badges[c.value]};});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Saved setups (REQ-002.H.28), kept by the page in localStorage under sp-setups: the list as stored, newest first. */
|
|
235
|
+
const SETUPS_KEY='sp-setups',MAX_SETUPS=50;
|
|
236
|
+
function setupsLoad(raw){
|
|
237
|
+
let v;try{v=JSON.parse(raw||'[]');}catch(e){return [];}
|
|
238
|
+
if(!Array.isArray(v))return [];
|
|
239
|
+
return v.filter(e=>e&&typeof e==='object'&&typeof e.id==='string'&&(e.kind==='new'||e.kind==='setup')&&e.answers&&typeof e.answers==='object')
|
|
240
|
+
.sort((a,b)=>(b.updatedAt||0)-(a.updatedAt||0));
|
|
241
|
+
}
|
|
242
|
+
/* The list with `entry` saved (replaced by id, else added), newest first, at most 50. */
|
|
243
|
+
function setupsPut(list,entry){return [entry,...list.filter(e=>e.id!==entry.id)].sort((a,b)=>(b.updatedAt||0)-(a.updatedAt||0)).slice(0,MAX_SETUPS);}
|
|
244
|
+
function setupsRemove(list,id){return list.filter(e=>e.id!==id);}
|
|
245
|
+
/* What is stored for a setup: never the token, only what the chat needs to resume. */
|
|
246
|
+
function setupRecord(st){
|
|
247
|
+
return {id:st.id,kind:st.kind,root:st.root,name:st.kind==='new'?String(st.answers.name||''):st.name||'',answers:st.answers,editing:null,started:!!st.started,
|
|
248
|
+
seeded:st.seeded||{},updatedAt:st.updatedAt||0,finished:!!st.finished,preview:st.preview||{done:false,changed:false}};
|
|
249
|
+
}
|
|
250
|
+
/* A row of the list: its title, `In progress` or `Ready to create`. */
|
|
251
|
+
function setupTitle(e){return e.kind==='setup'?(e.name||String(e.root||'').split(/[/\\]/).filter(Boolean).pop()||'Untitled setup'):(e.name||'Untitled setup');}
|
|
252
|
+
function setupStatus(e){return e.finished?'Ready to create':'In progress';}
|
|
253
|
+
|
|
254
|
+
const api={resolveRoute,goneHtml,when,recentHtml,openOutcome,reloadView,repoNameFromUrl,projectLabel,
|
|
255
|
+
projectNameError,handleError,HANDLE_PATTERN,flowValue,answered,flowQuestions,nextQuestion,answerError,chatText,answerText,threadRows,recapCards,flowBody,previewFiles,
|
|
256
|
+
optionHtml,tabsHtml,choiceOptions,SETUPS_KEY,setupsLoad,setupsPut,setupsRemove,setupRecord,setupTitle,setupStatus};
|
|
208
257
|
if(typeof module==='object'&&module.exports)module.exports=api;else Object.assign(root,api);
|
|
209
258
|
})(this);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TemplateEngine, TemplateContext } from './templateEngine';
|
|
2
|
-
/**
|
|
3
|
-
* Generates AI agent configuration files:
|
|
4
|
-
* - Claude Code Skills (.claude/skills/specpilot-project/SKILL.md)
|
|
5
|
-
* - Codex Instructions (CODEX_INSTRUCTIONS.md at project root)
|
|
6
|
-
*/
|
|
7
|
-
export declare class AgentConfigGenerator {
|
|
8
|
-
private templateEngine;
|
|
9
|
-
constructor(templateEngine: TemplateEngine);
|
|
10
|
-
/** Entry point — routes to the correct agent config generator. Returns the kept (existing) file, else []. */
|
|
11
|
-
generate(projectDir: string, context: TemplateContext, agent: string): Promise<string[]>;
|
|
12
|
-
/** The files `generate()` writes for this agent, project-relative (BL-055). */
|
|
13
|
-
targets(agent: string): string[];
|
|
14
|
-
private generateClaudeCodeSkills;
|
|
15
|
-
private generateCodexInstructions;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=agentConfigGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agentConfigGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/agentConfigGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASnE;;;;GAIG;AACH,qBAAa,o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;;;;;;;;;;;;;;;;;CAiJ7B,CAAC;QAEE,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAClF,OAAO,IAAA,6BAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF;AA9QD,oDA8QC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TemplateEngine, TemplateContext } from './templateEngine';
|
|
2
|
-
export declare class SpecFileGenerator {
|
|
3
|
-
private templateEngine;
|
|
4
|
-
constructor(templateEngine: TemplateEngine);
|
|
5
|
-
private NEW_PROJECT_README;
|
|
6
|
-
private EXISTING_PROJECT_README;
|
|
7
|
-
/** Generate all spec files into the pre-created specs directory. */
|
|
8
|
-
generateAll(specsDir: string, context: TemplateContext): Promise<{
|
|
9
|
-
onboardingPrompt: string;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* The files `generateAll()` writes for an API paradigm, relative to the specs folder, in the order
|
|
13
|
-
* it writes them (BL-PM-004): read from the table the writes use, and pinned to the output by a test.
|
|
14
|
-
*/
|
|
15
|
-
targets(apiParadigm: string): string[];
|
|
16
|
-
private generateReadmeMd;
|
|
17
|
-
private generateProjectYaml;
|
|
18
|
-
private generateArchitectureMd;
|
|
19
|
-
private generateRequirementsMd;
|
|
20
|
-
private generateApiYaml;
|
|
21
|
-
private generateTasksMd;
|
|
22
|
-
private generateRoadmapMd;
|
|
23
|
-
private generateContextMd;
|
|
24
|
-
private generatePromptsMd;
|
|
25
|
-
private generateOnboardingMd;
|
|
26
|
-
private generateTestsMd;
|
|
27
|
-
private generateThreatModelMd;
|
|
28
|
-
private generateSecurityDecisionsMd;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=specFileGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specFileGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/specFileGenerator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