specpilot 2.13.0 → 2.15.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/README.md +27 -22
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/backfill.d.ts.map +1 -1
- package/dist/commands/backfill.js +24 -13
- package/dist/commands/backfill.js.map +1 -1
- package/dist/commands/serve.d.ts +3 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +75 -4
- package/dist/commands/serve.js.map +1 -1
- package/dist/core/agentConfig.d.ts +10 -0
- package/dist/core/agentConfig.d.ts.map +1 -1
- package/dist/core/agentConfig.js +47 -3
- package/dist/core/agentConfig.js.map +1 -1
- package/dist/core/chatFlow.js +2 -2
- package/dist/core/chatFlow.js.map +1 -1
- package/dist/core/slashCommands.d.ts.map +1 -1
- package/dist/core/slashCommands.js +25 -16
- package/dist/core/slashCommands.js.map +1 -1
- package/dist/core/specFiles.js +3 -0
- package/dist/core/specFiles.js.map +1 -1
- package/dist/core/templateEngine.d.ts +5 -0
- package/dist/core/templateEngine.d.ts.map +1 -1
- package/dist/core/templateEngine.js +13 -1
- package/dist/core/templateEngine.js.map +1 -1
- package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
- package/dist/utils/addSpecsQuestions.js +2 -0
- package/dist/utils/addSpecsQuestions.js.map +1 -1
- package/dist/utils/folderPicker.d.ts +28 -0
- package/dist/utils/folderPicker.d.ts.map +1 -0
- package/dist/utils/folderPicker.js +96 -0
- package/dist/utils/folderPicker.js.map +1 -0
- package/dist/utils/mcpLocal.d.ts +10 -0
- package/dist/utils/mcpLocal.d.ts.map +1 -1
- package/dist/utils/mcpLocal.js +61 -2
- package/dist/utils/mcpLocal.js.map +1 -1
- package/dist/utils/projectDetector.d.ts +11 -0
- package/dist/utils/projectDetector.d.ts.map +1 -1
- package/dist/utils/projectDetector.js +86 -0
- package/dist/utils/projectDetector.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +21 -0
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +166 -0
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specArchiver.d.ts.map +1 -1
- package/dist/utils/specArchiver.js +2 -1
- package/dist/utils/specArchiver.js.map +1 -1
- package/dist/utils/specBackfiller.d.ts +9 -3
- package/dist/utils/specBackfiller.d.ts.map +1 -1
- package/dist/utils/specBackfiller.js +52 -48
- package/dist/utils/specBackfiller.js.map +1 -1
- package/dist/utils/specServer.d.ts +12 -7
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +263 -123
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specSetup.d.ts +21 -23
- package/dist/utils/specSetup.d.ts.map +1 -1
- package/dist/utils/specSetup.js +69 -57
- package/dist/utils/specSetup.js.map +1 -1
- package/dist/utils/specValidator.d.ts.map +1 -1
- package/dist/utils/specValidator.js +4 -1
- package/dist/utils/specValidator.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.css +43 -109
- package/ui/app.js +155 -305
- package/ui/index.html +25 -29
- package/ui/route.js +3 -101
- package/dist/__tests__/fixtures/allFields.d.ts +0 -3
- package/dist/__tests__/fixtures/allFields.d.ts.map +0 -1
- package/dist/__tests__/fixtures/allFields.js +0 -31
- package/dist/__tests__/fixtures/allFields.js.map +0 -1
package/ui/index.html
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
<link rel="stylesheet" href="/assets/app.css">
|
|
12
12
|
<script src="/assets/md.js" defer></script>
|
|
13
13
|
<script src="/assets/route.js" defer></script>
|
|
14
|
-
<script src="/assets/chat-core.js" defer></script>
|
|
15
14
|
<script src="/assets/app.js" defer></script>
|
|
16
15
|
</head>
|
|
17
16
|
<body>
|
|
@@ -68,6 +67,7 @@
|
|
|
68
67
|
<symbol id="i-chev" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
|
|
69
68
|
<symbol id="i-arrow" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></symbol>
|
|
70
69
|
<symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12l5 5L20 7"/></symbol>
|
|
70
|
+
<symbol id="i-power" viewBox="0 0 24 24"><path d="M12 3v9M6.3 6.3a8 8 0 1 0 11.4 0"/></symbol>
|
|
71
71
|
</defs></svg>
|
|
72
72
|
|
|
73
73
|
<a class="skip" href="#content">Skip to Content</a>
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
<button class="tile act" id="addBtn" aria-label="Add a project" data-tip="Add a project" hidden><svg aria-hidden="true" focusable="false"><use href="#i-plus"/></svg></button>
|
|
81
81
|
<div class="rfoot">
|
|
82
82
|
<button class="tile ghost" id="themeBtn" aria-label="Switch between light and dark" data-tip="Light / dark"><svg aria-hidden="true" focusable="false"><use href="#i-sun"/></svg></button>
|
|
83
|
+
<button class="tile ghost" id="quitBtn" aria-label="Quit SpecPilot" data-tip="Quit SpecPilot" hidden><svg aria-hidden="true" focusable="false"><use href="#i-power"/></svg></button>
|
|
83
84
|
</div>
|
|
84
85
|
</nav>
|
|
85
86
|
<aside class="src" id="src">
|
|
@@ -113,13 +114,12 @@
|
|
|
113
114
|
<main class="pane">
|
|
114
115
|
<div class="tb">
|
|
115
116
|
<button class="ib menu" id="menuBtn" aria-label="Show sidebar"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-menu"/></svg></button>
|
|
116
|
-
<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="
|
|
117
|
+
<div><h1 id="title">Tasks</h1><div class="sub"><span id="subName" translate="no"></span><span class="mono" id="subPath" translate="no"></span><span class="mono" id="crumb" translate="no" hidden></span></div></div>
|
|
117
118
|
<div class="right">
|
|
118
119
|
<div class="seg" id="modeSeg"><button class="on" data-m="list">List</button><button data-m="board">Board</button></div>
|
|
119
120
|
<a class="ib" id="editorBtn" hidden aria-label="Open in VS Code" title="Open in VS Code"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-ext"/></svg></a>
|
|
120
121
|
<div class="idewrap" id="ideWrap" hidden><button type="button" class="ib" id="ideBtn" aria-haspopup="menu" aria-expanded="false" aria-controls="ideMenu" aria-label="Open in AI IDE" title="Open in AI IDE"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-spark"/></svg></button><div class="idemenu" id="ideMenu" role="menu" aria-label="Open in AI IDE" hidden></div></div>
|
|
121
122
|
<button type="button" class="btn line sm" id="newTask" hidden><svg class="ico ico-13" aria-hidden="true" focusable="false"><use href="#i-plus"/></svg>New Task</button>
|
|
122
|
-
<button type="button" class="btn" id="chatRestart" hidden>Start over</button><button type="button" class="btn" id="chatClose" hidden>Close</button>
|
|
123
123
|
</div>
|
|
124
124
|
</div>
|
|
125
125
|
<div class="content" id="content" tabindex="-1">
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
</div>
|
|
136
136
|
<div class="gl benefits"><div class="box">
|
|
137
137
|
<div class="row"><span class="ic2"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-folder"/></svg></span><div class="body"><div class="ttl">Files are the truth</div><div class="det">Every view is read from <span class="mono" translate="no">.specs/</span> and git. Every action writes a file you could have edited by hand.</div></div></div>
|
|
138
|
-
<div class="row"><span class="ic2"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-shield"/></svg></span><div class="body"><div class="ttl">Nothing leaves this machine</div><div class="det">Runs on localhost, no account, no telemetry. No <span class="mono" translate="no">.specs/</span> yet?
|
|
138
|
+
<div class="row"><span class="ic2"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-shield"/></svg></span><div class="body"><div class="ttl">Nothing leaves this machine</div><div class="det">Runs on localhost, no account, no telemetry. No <span class="mono" translate="no">.specs/</span> yet? Your AI IDE writes one for you.</div></div></div>
|
|
139
139
|
</div></div>
|
|
140
140
|
<div class="gl recents"><div class="gh">Recent projects <span class="cnt" id="homePath" translate="no"></span></div><div class="box" id="homeBox"></div></div>
|
|
141
|
-
<!-- BL-PM-007:
|
|
141
|
+
<!-- BL-PM-007: unless specpilot serve --no-mcp (BL-105) -->
|
|
142
142
|
<div class="gl" id="homeMcp" hidden><div class="gh">Connect Your AI IDE <span class="cnt">optional, one line</span></div><div class="box"><div class="mcp"><code class="v" id="mcpLine" translate="no"></code><button type="button" class="btn sm" id="mcpCopy">Copy</button></div></div><p class="note" id="mcpNote"></p></div>
|
|
143
143
|
<div class="fine"><i aria-hidden="true"></i><span>Server running on <span class="mono" id="homeAddr" translate="no"></span> · <span id="homeVer" translate="no"></span></span></div>
|
|
144
144
|
</section>
|
|
@@ -166,33 +166,29 @@
|
|
|
166
166
|
<div id="secBody"></div>
|
|
167
167
|
</section>
|
|
168
168
|
|
|
169
|
-
<!-- SETUP
|
|
170
|
-
|
|
171
|
-
<section class="view
|
|
172
|
-
<
|
|
173
|
-
<p class="note" id="
|
|
174
|
-
<div class="
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<
|
|
180
|
-
<
|
|
181
|
-
<div class="lbl" id="nameLbl">Name your project to start</div>
|
|
182
|
-
<div class="row"><input class="cfield mono" id="nameIn" name="project-name" type="text" placeholder="e.g. parcel-track" spellcheck="false" maxlength="214" aria-labelledby="nameLbl" aria-describedby="nameErr"><button type="submit" class="send" id="nameGo" aria-label="Start">→</button></div>
|
|
183
|
-
<div class="err" id="nameErr" role="alert"></div>
|
|
184
|
-
<button type="button" class="btn pri" id="setupStart" hidden>Start Guided Setup</button>
|
|
185
|
-
</form>
|
|
186
|
-
</section>
|
|
187
|
-
<section class="thread" id="thread" hidden><div class="col" id="msgs"></div></section>
|
|
188
|
-
<section class="composer" id="composer" hidden><form class="col" id="comp" autocomplete="off"></form></section>
|
|
189
|
-
</div>
|
|
169
|
+
<!-- SETUP (BL-103): a project without .specs/ (Open, Clone, a folder named on the command line) and #new.
|
|
170
|
+
The user's AI IDE does the setup over MCP; this view says how, and nothing on it writes a spec. -->
|
|
171
|
+
<section class="view setupv" id="v-setup">
|
|
172
|
+
<p class="lead" id="suLead"></p>
|
|
173
|
+
<p class="note" id="suNote" hidden></p>
|
|
174
|
+
<div class="gl" id="suNew" hidden>
|
|
175
|
+
<div class="fields">
|
|
176
|
+
<div class="f"><label for="suName">Project name</label><input id="suName" name="project-name" type="text" spellcheck="false" maxlength="214" placeholder="my-project" aria-describedby="suErr"></div>
|
|
177
|
+
<div class="f"><label for="suParent">Parent folder</label><div class="in"><input id="suParent" name="parent-folder" type="text" spellcheck="false" maxlength="4096" placeholder="~/dev" aria-describedby="suErr"><button type="button" class="btn" id="suBrowse">Browse…</button></div></div>
|
|
178
|
+
</div>
|
|
179
|
+
<p class="err" id="suErr" role="alert"></p>
|
|
180
|
+
<p class="note">Nothing is created yet. The folder is made by your IDE in step 3, only at this path.</p>
|
|
190
181
|
</div>
|
|
182
|
+
<div class="warnbox" id="suOff" hidden><span aria-hidden="true">!</span><span>This server was started with <span class="mono" translate="no">--no-mcp</span>, so your IDE cannot reach it. Restart with <span class="mono" translate="no">specpilot serve</span> and come back here.</span></div>
|
|
183
|
+
<div class="gl step" id="suConnect"><div class="gh"><span class="n">1</span>Connect your AI IDE<span class="st" id="suStatus" role="status"></span></div><div class="box pre" id="suConfigBox"><pre id="suConfig" translate="no"></pre><button type="button" class="btn sm" id="suConfigCopy">Copy</button></div><p class="note" id="suMcpNote"></p></div>
|
|
184
|
+
<div class="gl step" id="suTell"><div class="gh"><span class="n">2</span>Tell it what to do</div><div class="box line"><code id="suPrompt" translate="no"></code><button type="button" class="btn sm" id="suPromptCopy">Copy</button></div></div>
|
|
185
|
+
<div class="gl step" id="suProgress"><div class="gh"><span class="n">3</span>Progress</div><p class="note">Updates by itself as your IDE calls the server. Nothing here to click.</p>
|
|
186
|
+
<ol class="steps"><li class="wait"><i aria-hidden="true"></i>Read the code</li><li class="wait"><i aria-hidden="true"></i>Answer the questions</li><li class="wait"><i aria-hidden="true"></i>Write the files</li><li class="wait"><i aria-hidden="true"></i>Validate</li></ol></div>
|
|
187
|
+
<p class="note sufoot" id="suFoot"></p>
|
|
191
188
|
</section>
|
|
192
189
|
|
|
193
190
|
<!-- FILE: any .specs/ file, rendered as written -->
|
|
194
191
|
<section class="view" id="v-file">
|
|
195
|
-
<div class="gl" id="fileNote" hidden></div>
|
|
196
192
|
<div class="gl" id="fmBox"></div>
|
|
197
193
|
<div class="md doc" id="fileBody"></div>
|
|
198
194
|
</section>
|
|
@@ -227,14 +223,14 @@
|
|
|
227
223
|
<form class="sb" id="openForm" autocomplete="off">
|
|
228
224
|
<div class="tabs" id="openTabs" role="tablist" aria-labelledby="openTitle"><button type="button" class="on" role="tab" id="tabFolder" data-t="folder" aria-controls="paneFolder" aria-selected="true">Folder</button><button type="button" role="tab" id="tabClone" data-t="clone" aria-controls="paneClone" aria-selected="false" tabindex="-1">Clone</button></div>
|
|
229
225
|
<div class="pane" id="paneFolder" role="tabpanel" aria-labelledby="tabFolder">
|
|
230
|
-
<div class="gl"><div class="box"><div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-folder"/></svg><input id="pathIn" name="folder-path" type="text" spellcheck="false" aria-label="Folder path" placeholder="/path/to/project or ~/project"></div></div></div>
|
|
226
|
+
<div class="gl"><div class="box"><div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-folder"/></svg><input id="pathIn" name="folder-path" type="text" spellcheck="false" aria-label="Folder path" placeholder="/path/to/project or ~/project"><button type="button" class="btn" id="browseBtn">Browse…</button></div></div></div>
|
|
231
227
|
<div class="gl"><div class="gh">Recent projects <span class="cnt" id="recentPath" translate="no"></span></div><div class="box" id="recentBox"></div></div>
|
|
232
228
|
</div>
|
|
233
229
|
<div class="pane" id="paneClone" role="tabpanel" aria-labelledby="tabClone" hidden>
|
|
234
230
|
<p class="note">Runs git clone on this machine, then opens the folder. Submodules are not cloned.</p>
|
|
235
231
|
<div class="gl"><div class="box">
|
|
236
232
|
<div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-git"/></svg><input id="cloneIn" name="repo-url" type="text" inputmode="url" spellcheck="false" aria-label="Repository URL" placeholder="https://github.com/owner/repo.git or git@github.com:owner/repo.git" maxlength="2048"></div>
|
|
237
|
-
<div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-folder"/></svg><input id="cloneParentIn" name="clone-parent" type="text" spellcheck="false" aria-label="Parent folder" placeholder="/path/to/folder or ~/folder"></div>
|
|
233
|
+
<div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-folder"/></svg><input id="cloneParentIn" name="clone-parent" type="text" spellcheck="false" aria-label="Parent folder" placeholder="/path/to/folder or ~/folder"><button type="button" class="btn" id="cloneBrowseBtn">Browse…</button></div>
|
|
238
234
|
<div class="field"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-plus"/></svg><input id="cloneNameIn" name="clone-name" type="text" spellcheck="false" aria-label="Folder name" placeholder="the repository's name" maxlength="214"></div>
|
|
239
235
|
</div></div>
|
|
240
236
|
</div>
|
package/ui/route.js
CHANGED
|
@@ -127,7 +127,8 @@ function cloneProgress(data){
|
|
|
127
127
|
segment of its root), never the whole path, which stays in the tooltip and the sub-line. */
|
|
128
128
|
function projectLabel(p){return p.name!==null&&p.name!==undefined?p.name:String(p.root).split(/[/\\]/).filter(Boolean).pop()||p.root;}
|
|
129
129
|
|
|
130
|
-
/* ---- the
|
|
130
|
+
/* ---- the question rules: the name and handle rules (init, the server, the Setup view), and the CLI's question
|
|
131
|
+
list as the chat core takes it (BL-PM-004; since BL-103 read on the server, for the setup tools of BL-104) ---- */
|
|
131
132
|
|
|
132
133
|
/* What is wrong with a project name, in `specpilot init`'s words (`hint` is the terminal's extra line), or
|
|
133
134
|
null. The one copy of the rule: init and the server load it from here, the page checks with it. */
|
|
@@ -180,71 +181,6 @@ function flowQuestions(q,answers,first){
|
|
|
180
181
|
return out.sort((a,b)=>(a.order??-1)-(b.order??-1));
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
/* The question the composer shows: the one being edited, else the first asked question without an answer,
|
|
184
|
-
else null, which means the recap. */
|
|
185
|
-
function nextQuestion(list,answers,editing){
|
|
186
|
-
if(editing){const qu=list.find(x=>x.key===editing);if(qu)return qu;}
|
|
187
|
-
return list.find(x=>!answered(x,answers))||null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* What Continue shows under the answer, or null: a required text left empty, a project name or a handle
|
|
191
|
-
the server would refuse (its own message; never the terminal's hint). */
|
|
192
|
-
function answerError(qu,value){
|
|
193
|
-
const v=String(value).trim();
|
|
194
|
-
if(qu.choices)return null;
|
|
195
|
-
if(!v)return qu.required?'This one is required.':null;
|
|
196
|
-
if(qu.key==='name'){const e=projectNameError(v);return e?e.message+'.':null;}
|
|
197
|
-
return qu.key==='handle'?handleError(v):null;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/* The bot bubble's line: `chat` with `{name}` and `{language}` filled. `ctx` is {name, language}: the project
|
|
201
|
-
name (the folder's label in guided setup) and the language choice's text, or the detected language. */
|
|
202
|
-
function chatText(qu,ctx){return String(qu.chat||'').replace(/\{name\}/g,ctx.name||'').replace(/\{language\}/g,ctx.language||'');}
|
|
203
|
-
|
|
204
|
-
/* The answer as a bubble or a recap row shows it: the choice's own text up to its " — " part (the chips
|
|
205
|
-
keep the whole), the typed text, or Skipped. */
|
|
206
|
-
function answerText(qu,answers){
|
|
207
|
-
if(typeof qu.text==='string')return qu.text; // the chat core's own (BL-PM-004b)
|
|
208
|
-
const v=answers[qu.key];
|
|
209
|
-
if(qu.choices){const c=qu.choices.find(x=>x.value===v);return c?c.name.split(' — ')[0]:'';}
|
|
210
|
-
return String(v===undefined?'':v).trim()||'Skipped';
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* The thread up to the current question: the name bubble (a new project only: `named`), a divider per step,
|
|
214
|
-
the skip notes before a question (BL-PM-004b), a bot row per asked question (with its file caption) and an
|
|
215
|
-
answer row per answered one, then the note after it; after the last answer a Review divider. */
|
|
216
|
-
function threadRows(q,list,answers,cur,ctx,named,det){
|
|
217
|
-
const facts=step=>det&&det.rows?det.rows.filter(f=>f.step===step):[],marked=k=>!!det&&(det.keys||[]).includes(k);
|
|
218
|
-
const steps=[...new Set(list.map(x=>x.step))],rows=[];
|
|
219
|
-
if(named)rows.push({kind:'user',key:'name',text:ctx.name,mono:true,skipped:false});
|
|
220
|
-
let last=null;
|
|
221
|
-
for(const qu of list){
|
|
222
|
-
if(qu.step!==last){
|
|
223
|
-
rows.push({kind:'divider',text:`Step ${steps.indexOf(qu.step)+1} · ${qu.step}`});last=qu.step;
|
|
224
|
-
// what the detector found for this step: answered, never asked, not editable (BL-PM-016)
|
|
225
|
-
for(const f of facts(qu.step))rows.push({kind:'user',key:null,text:`${f.label}: ${f.value}`,mono:false,skipped:false,detected:true});
|
|
226
|
-
}
|
|
227
|
-
for(const n of qu.notesBefore||[])rows.push({kind:'note',text:n});
|
|
228
|
-
rows.push({kind:'bot',key:qu.key,text:chatText(qu,ctx),cli:qu.message,caption:qu.caption||''});
|
|
229
|
-
if(cur&&qu.key===cur.key)break;
|
|
230
|
-
if(answered(qu,answers)){
|
|
231
|
-
const text=answerText(qu,answers);
|
|
232
|
-
rows.push({kind:'user',key:qu.key,text,mono:qu.key==='parent'||qu.key==='handle',skipped:text==='Skipped'||text==='None'&&!qu.choices,...(marked(qu.key)?{detected:true}:{})});
|
|
233
|
-
if(qu.noteAfter)rows.push({kind:'note',text:qu.noteAfter});
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if(!cur)rows.push({kind:'divider',text:'Review'});
|
|
237
|
-
return rows;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/* The recap: one card per step in use, the detector's rows first (no key: not editable), then one row per asked question. */
|
|
241
|
-
function recapCards(list,answers,det){
|
|
242
|
-
const steps=[...new Set(list.map(x=>x.step))],keys=det&&det.keys||[];
|
|
243
|
-
return steps.map(step=>({title:step,rows:[
|
|
244
|
-
...(det&&det.rows||[]).filter(f=>f.step===step).map(f=>({key:null,label:f.label,value:f.value,detected:true})),
|
|
245
|
-
...list.filter(x=>x.step===step).map(qu=>({key:qu.key,label:qu.label,value:answerText(qu,answers),...(keys.includes(qu.key)?{detected:true}:{})}))]}));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
184
|
/* The POST body: the answer of every question asked, text trimmed. */
|
|
249
185
|
function flowBody(list,answers){
|
|
250
186
|
const body={};
|
|
@@ -252,46 +188,12 @@ function flowBody(list,answers){
|
|
|
252
188
|
return body;
|
|
253
189
|
}
|
|
254
190
|
|
|
255
|
-
/* The files that will be written for the answers so far: .specs/ for the API paradigm, then the files
|
|
256
|
-
outside it for the IDE; `kept` marks one that is already in the folder (guided setup's `keep`). */
|
|
257
|
-
function previewFiles(q,answers){
|
|
258
|
-
const pick=k=>{const x=q.questions.find(y=>y.key===k);return x?flowValue(x,answers):undefined;};
|
|
259
|
-
const ide=pick('ide'),keep=q.keep&&q.keep[ide]||[];
|
|
260
|
-
return [...(q.files.specs[pick('apiParadigm')]||[]),...(q.files.outside[ide]||[])].map(path=>({path,kept:keep.includes(path)}));
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/* ---- the full chat (BL-PM-004b): one renderer for every option, and tabs ---- */
|
|
264
|
-
|
|
265
|
-
/* One option as a chip, or a card when it has a description: emoji, label, a Recommended or Check this badge,
|
|
266
|
-
the description and a warning line. `pressed` is its state; `data-v` its value. */
|
|
267
|
-
function optionHtml(o,pressed){
|
|
268
|
-
const badge=o.badge==='recommended'?'<span class="bdg">Recommended</span>':o.badge==='flagged'?'<span class="bdg fl">Check this</span>':'';
|
|
269
|
-
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>`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/* A tab strip: `tabs` as [{id, label, count}], the active one selected. */
|
|
273
|
-
function tabsHtml(tabs,active){
|
|
274
|
-
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>`;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/* A CLI question's choices as options: the text up to " — " as the label, the rest as the description,
|
|
278
|
-
with the chat core's badges. */
|
|
279
|
-
function choiceOptions(qu){
|
|
280
|
-
return (qu.choices||[]).map(c=>{const [label,description]=c.name.split(' — ');return {id:c.value,label,description,badge:qu.badges&&qu.badges[c.value]};});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/* Guided setup's answers the detector fills in (REQ-002.H.35): the platforms, from direct evidence only. */
|
|
284
|
-
function seededAnswers(detected){return detected&&detected.platform?{platforms:[detected.platform]}:{};}
|
|
285
|
-
/* The keys whose answer is still the one the detector filled in: they show `detected`. */
|
|
286
|
-
function detectedKeys(seed,answers){return Object.keys(seed||{}).filter(k=>JSON.stringify(answers[k])===JSON.stringify(seed[k]));}
|
|
287
|
-
|
|
288
191
|
/* The one line an IDE's MCP settings take (BL-PM-007); serve.ts prints the same line. */
|
|
289
192
|
function mcpConfigLine(host,token){
|
|
290
193
|
return JSON.stringify({mcpServers:{'specpilot-local':{type:'http',url:`http://${host}/mcp`,headers:{'X-SpecPilot-Token':token}}}});
|
|
291
194
|
}
|
|
292
195
|
|
|
293
196
|
const api={mcpConfigLine,resolveRoute,goneHtml,when,editorUrl,cursorPromptUrl,onboardingPrompt,recentHtml,openOutcome,reloadView,repoNameFromUrl,CLONE_STAGES,cloneStatus,cloneProgress,projectLabel,
|
|
294
|
-
projectNameError,handleError,HANDLE_PATTERN,flowValue,answered,flowQuestions,
|
|
295
|
-
optionHtml,tabsHtml,choiceOptions,seededAnswers,detectedKeys};
|
|
197
|
+
projectNameError,handleError,HANDLE_PATTERN,flowValue,answered,flowQuestions,flowBody};
|
|
296
198
|
if(typeof module==='object'&&module.exports)module.exports=api;else Object.assign(root,api);
|
|
297
199
|
})(this);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allFields.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/allFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,cAAc,CAwB/C,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALL_FIELDS = void 0;
|
|
4
|
-
// Every optional template field set (REQ-002.I.4): the input of BL-032's phase 2 recording (specCore.test.ts),
|
|
5
|
-
// and of the route test that pins a setup with these answers to it (BL-PM-004b).
|
|
6
|
-
exports.ALL_FIELDS = {
|
|
7
|
-
platforms: ['iOS Native', 'Node.js / Express'],
|
|
8
|
-
accessControl: 'Role-based (admin, agent, customer)',
|
|
9
|
-
specialConsiderations: ['Accessibility (WCAG)', 'i18n'],
|
|
10
|
-
accessibilityNotes: 'Screen reader support and right-to-left layout.',
|
|
11
|
-
systemPattern: 'Modular monolith',
|
|
12
|
-
activeUsers: '1,000 - 10,000',
|
|
13
|
-
teamSize: '2-5 devs',
|
|
14
|
-
deploymentTargets: ['AWS', 'Vercel'],
|
|
15
|
-
localDatabases: ['SQLite'],
|
|
16
|
-
dataSyncStrategy: 'Last write wins',
|
|
17
|
-
integrations: { payments: ['Stripe'], ai: ['OpenAI', 'Anthropic'] },
|
|
18
|
-
otherApis: 'Twilio for SMS',
|
|
19
|
-
apiResponseTime: '< 200 ms (p95)',
|
|
20
|
-
availability: '99.9%',
|
|
21
|
-
databases: ['PostgreSQL', 'Redis'],
|
|
22
|
-
authStrategy: 'Clerk',
|
|
23
|
-
realtimeTypes: ['WebSockets'],
|
|
24
|
-
compliance: ['GDPR', 'SOC 2'],
|
|
25
|
-
cicd: ['GitHub Actions'],
|
|
26
|
-
securityConcerns: ['Rate limiting', 'Audit logging'],
|
|
27
|
-
buildTimeline: '3 months',
|
|
28
|
-
constraintDescription: 'Must run on the existing Postgres cluster.',
|
|
29
|
-
testingStrategy: ['Unit', 'E2E'],
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=allFields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allFields.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/allFields.ts"],"names":[],"mappings":";;;AAEA,+GAA+G;AAC/G,iFAAiF;AACpE,QAAA,UAAU,GAA6B;IAClD,SAAS,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC9C,aAAa,EAAE,qCAAqC;IACpD,qBAAqB,EAAE,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACvD,kBAAkB,EAAE,iDAAiD;IACrE,aAAa,EAAE,kBAAkB;IACjC,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,UAAU;IACpB,iBAAiB,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IACpC,cAAc,EAAE,CAAC,QAAQ,CAAC;IAC1B,gBAAgB,EAAE,iBAAiB;IACnC,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE;IACnE,SAAS,EAAE,gBAAgB;IAC3B,eAAe,EAAE,gBAAgB;IACjC,YAAY,EAAE,OAAO;IACrB,SAAS,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC;IAClC,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7B,IAAI,EAAE,CAAC,gBAAgB,CAAC;IACxB,gBAAgB,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IACpD,aAAa,EAAE,UAAU;IACzB,qBAAqB,EAAE,4CAA4C;IACnE,eAAe,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;CACjC,CAAC"}
|