instar 1.2.13 → 1.2.15
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/commands/setup-wizard/codex-driver.d.ts.map +1 -1
- package/dist/commands/setup-wizard/codex-driver.js +274 -51
- package/dist/commands/setup-wizard/codex-driver.js.map +1 -1
- package/dist/commands/setup-wizard/state-machine.d.ts +26 -0
- package/dist/commands/setup-wizard/state-machine.d.ts.map +1 -1
- package/dist/commands/setup-wizard/state-machine.js +53 -10
- package/dist/commands/setup-wizard/state-machine.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.2.14.md +79 -0
- package/upgrades/1.2.15.md +87 -0
- package/upgrades/side-effects/fix-wizard-telegram-native.md +112 -0
- package/upgrades/side-effects/fix-wizard-validation.md +98 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-driver.d.ts","sourceRoot":"","sources":["../../../src/commands/setup-wizard/codex-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"codex-driver.d.ts","sourceRoot":"","sources":["../../../src/commands/setup-wizard/codex-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiBH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAilBD;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC/E"}
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
* conversational behavior is no longer expected here — Codex is
|
|
18
18
|
* driving the browser, that's its strength).
|
|
19
19
|
*/
|
|
20
|
-
import { execFileSync,
|
|
20
|
+
import { execFileSync, spawnSync } from 'node:child_process';
|
|
21
|
+
import fs from 'node:fs';
|
|
21
22
|
import path from 'node:path';
|
|
22
23
|
import readline from 'node:readline';
|
|
23
24
|
import pc from 'picocolors';
|
|
24
|
-
import { buildFreshProjectInstall, INITIAL_STATE, } from './state-machine.js';
|
|
25
|
+
import { buildFreshProjectInstall, INITIAL_STATE, resolveChoice, } from './state-machine.js';
|
|
25
26
|
import { WIZARD_CODEX_MODEL } from './model-constants.js';
|
|
26
27
|
/**
|
|
27
28
|
* Per-state narrative-prompt builders. Each returns the EXACT text we
|
|
@@ -112,13 +113,46 @@ const FALLBACK_NARRATIVES = {
|
|
|
112
113
|
autonomy: 'A starting point — you can change this anytime.',
|
|
113
114
|
messaging: 'Messaging is the interface you\'ll use day-to-day.',
|
|
114
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* Spinner state for the composing indicator. Animates a single line
|
|
118
|
+
* during the codex narrative call so the user sees feedback instead
|
|
119
|
+
* of a silent terminal. Cleared (via carriage-return + spaces)
|
|
120
|
+
* before the narrative paragraph is printed.
|
|
121
|
+
*/
|
|
122
|
+
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
123
|
+
function startSpinner(label) {
|
|
124
|
+
let i = 0;
|
|
125
|
+
const tty = process.stdout.isTTY;
|
|
126
|
+
if (!tty) {
|
|
127
|
+
process.stdout.write(` ${label}\n`);
|
|
128
|
+
return { stop: () => { } };
|
|
129
|
+
}
|
|
130
|
+
const render = () => {
|
|
131
|
+
process.stdout.write(`\r ${pc.cyan(SPINNER_FRAMES[i % SPINNER_FRAMES.length])} ${pc.dim(label)}`);
|
|
132
|
+
i++;
|
|
133
|
+
};
|
|
134
|
+
render();
|
|
135
|
+
const handle = setInterval(render, 100);
|
|
136
|
+
return {
|
|
137
|
+
stop: () => {
|
|
138
|
+
clearInterval(handle);
|
|
139
|
+
// Clear the spinner line so the narrative paragraph renders cleanly.
|
|
140
|
+
process.stdout.write(`\r${' '.repeat(label.length + 6)}\r`);
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
115
144
|
/**
|
|
116
145
|
* Run `codex exec` for one narrative-generation turn. Returns the
|
|
117
146
|
* text body of Codex's response (stdout), or null on failure /
|
|
118
147
|
* timeout. Bounded to a short per-turn timeout so a flaky network
|
|
119
148
|
* doesn't stall the wizard.
|
|
149
|
+
*
|
|
150
|
+
* Shows a spinner while the call is running so the user sees
|
|
151
|
+
* visible feedback during the latency window (avoids the
|
|
152
|
+
* "is-it-frozen?" reflex that triggers buffered-Enter bugs).
|
|
120
153
|
*/
|
|
121
154
|
function runCodexNarrative(codexPath, prompt, options) {
|
|
155
|
+
const spinner = startSpinner('composing…');
|
|
122
156
|
try {
|
|
123
157
|
const result = spawnSync(codexPath, [
|
|
124
158
|
'exec',
|
|
@@ -153,6 +187,9 @@ function runCodexNarrative(codexPath, prompt, options) {
|
|
|
153
187
|
catch {
|
|
154
188
|
return null;
|
|
155
189
|
}
|
|
190
|
+
finally {
|
|
191
|
+
spinner.stop();
|
|
192
|
+
}
|
|
156
193
|
}
|
|
157
194
|
/**
|
|
158
195
|
* Prompt the user with readline. Returns the trimmed answer (may be
|
|
@@ -169,10 +206,23 @@ async function askUser(promptText) {
|
|
|
169
206
|
}
|
|
170
207
|
/**
|
|
171
208
|
* Render a state to the user: narrative paragraph (LLM-generated) +
|
|
172
|
-
* structural prompt (verbatim). Then read the answer
|
|
209
|
+
* structural prompt (verbatim). Then read the answer, validating it
|
|
210
|
+
* against the state's `validate` function. On invalid input, prints
|
|
211
|
+
* the validator's friendly retry message and re-asks WITHOUT
|
|
212
|
+
* regenerating the narrative paragraph (cheap loop, no extra codex
|
|
213
|
+
* exec calls). Returns the first answer that passes validation.
|
|
214
|
+
*
|
|
215
|
+
* This is the structural answer to the buffered-Enter bug from
|
|
216
|
+
* v1.2.13 — the user could press Enter during the silent codex
|
|
217
|
+
* narrative window, that Enter would buffer in stdin, and the next
|
|
218
|
+
* readline would consume it as an empty answer to a required field
|
|
219
|
+
* (silently defaulting agent-name to "agent"). With validate +
|
|
220
|
+
* retry-loop, an empty submission to a required field surfaces a
|
|
221
|
+
* friendly reprompt instead of accepting the default.
|
|
173
222
|
*/
|
|
174
223
|
async function renderNarrativeState(state, answers, options) {
|
|
175
|
-
// Generate narrative
|
|
224
|
+
// Generate narrative once per state entry (re-asks on validation
|
|
225
|
+
// failure skip this and just re-print the question).
|
|
176
226
|
let narrative = null;
|
|
177
227
|
if (options.enableNarrative !== false) {
|
|
178
228
|
const prompt = narrativeFor(state.id, answers, { projectDir: options.projectDir });
|
|
@@ -193,7 +243,50 @@ async function renderNarrativeState(state, answers, options) {
|
|
|
193
243
|
: '';
|
|
194
244
|
if (placeholderHint)
|
|
195
245
|
console.log(placeholderHint);
|
|
196
|
-
|
|
246
|
+
// Retry loop: at most 5 attempts so a wedged input doesn't trap
|
|
247
|
+
// the wizard forever. After 5 invalid attempts we let the answer
|
|
248
|
+
// through; the state machine's `next` function still has its own
|
|
249
|
+
// resolveChoice fallback so the wizard doesn't crash.
|
|
250
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
251
|
+
const answer = await askUser(' > ');
|
|
252
|
+
if (!state.validate) {
|
|
253
|
+
echoChoice(state, answer);
|
|
254
|
+
return answer;
|
|
255
|
+
}
|
|
256
|
+
const validationMsg = state.validate(answer);
|
|
257
|
+
if (validationMsg === null) {
|
|
258
|
+
echoChoice(state, answer);
|
|
259
|
+
return answer;
|
|
260
|
+
}
|
|
261
|
+
console.log();
|
|
262
|
+
console.log(pc.yellow(` ${validationMsg}`));
|
|
263
|
+
console.log();
|
|
264
|
+
}
|
|
265
|
+
// Last-resort: take whatever was last typed even if invalid. The
|
|
266
|
+
// state machine's `next` should still produce a usable transition.
|
|
267
|
+
const answer = await askUser(' > ');
|
|
268
|
+
echoChoice(state, answer);
|
|
269
|
+
return answer;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* For choice prompts, echo the resolved label back to the user as a
|
|
273
|
+
* confirmation line ("→ Proactive"). For text prompts, no-op — the
|
|
274
|
+
* answer is the answer.
|
|
275
|
+
*
|
|
276
|
+
* This closes the v1.2.14 confusion where typing "Proactive" or
|
|
277
|
+
* "Telegram" got correctly interpreted by resolveChoice but the
|
|
278
|
+
* wizard never showed the user what selection it understood.
|
|
279
|
+
*/
|
|
280
|
+
function echoChoice(state, answer) {
|
|
281
|
+
if (state.input.kind !== 'choice')
|
|
282
|
+
return;
|
|
283
|
+
const matched = resolveChoice(answer, state.input.choices);
|
|
284
|
+
if (!matched)
|
|
285
|
+
return;
|
|
286
|
+
const choice = state.input.choices.find((c) => c.value === matched);
|
|
287
|
+
if (!choice)
|
|
288
|
+
return;
|
|
289
|
+
console.log(pc.dim(` → ${choice.label}`));
|
|
197
290
|
}
|
|
198
291
|
/**
|
|
199
292
|
* Execute an action state — calls the appropriate instar CLI command
|
|
@@ -220,10 +313,13 @@ async function runAction(action, answers, options) {
|
|
|
220
313
|
return {};
|
|
221
314
|
}
|
|
222
315
|
case 'add-user': {
|
|
223
|
-
const id = (answers.userName || 'user').toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
316
|
+
const id = (answers.userName || 'user').toLowerCase().replace(/[^a-z0-9]/g, '') || 'user';
|
|
224
317
|
const name = answers.userName || 'User';
|
|
225
318
|
try {
|
|
226
|
-
|
|
319
|
+
// `instar user add` reads project from cwd — does NOT accept
|
|
320
|
+
// -d/--dir (pre-fix passed it and the CLI errored "unknown
|
|
321
|
+
// option '-d'"). Set cwd on the spawn instead.
|
|
322
|
+
execFileSync('npx', ['instar', 'user', 'add', '--id', id, '--name', name], { stdio: 'inherit', cwd: options.projectDir });
|
|
227
323
|
}
|
|
228
324
|
catch {
|
|
229
325
|
// non-fatal
|
|
@@ -232,7 +328,8 @@ async function runAction(action, answers, options) {
|
|
|
232
328
|
}
|
|
233
329
|
case 'start-server': {
|
|
234
330
|
try {
|
|
235
|
-
|
|
331
|
+
// server start accepts -d, but pass cwd too for consistency.
|
|
332
|
+
execFileSync('npx', ['instar', 'server', 'start', '-d', options.projectDir], { stdio: 'inherit', cwd: options.projectDir });
|
|
236
333
|
return { serverStarted: true };
|
|
237
334
|
}
|
|
238
335
|
catch {
|
|
@@ -241,7 +338,7 @@ async function runAction(action, answers, options) {
|
|
|
241
338
|
}
|
|
242
339
|
case 'install-autostart': {
|
|
243
340
|
try {
|
|
244
|
-
execFileSync('npx', ['instar', 'autostart', 'install', '-d', options.projectDir], { stdio: 'inherit' });
|
|
341
|
+
execFileSync('npx', ['instar', 'autostart', 'install', '-d', options.projectDir], { stdio: 'inherit', cwd: options.projectDir });
|
|
245
342
|
}
|
|
246
343
|
catch {
|
|
247
344
|
// non-fatal
|
|
@@ -273,51 +370,177 @@ async function runAction(action, answers, options) {
|
|
|
273
370
|
}
|
|
274
371
|
}
|
|
275
372
|
/**
|
|
276
|
-
* Telegram setup —
|
|
277
|
-
*
|
|
278
|
-
*
|
|
373
|
+
* Telegram setup — instar-native flow.
|
|
374
|
+
*
|
|
375
|
+
* Previously this spawned `codex exec` and asked it to walk the user
|
|
376
|
+
* through BotFather. But `codex exec` is non-interactive (single-turn,
|
|
377
|
+
* stdin already consumed by the prompt), so it couldn't wait for the
|
|
378
|
+
* user to paste a token. The spawned session printed manual
|
|
379
|
+
* instructions, ended, and the wizard recorded "telegramConfigured:
|
|
380
|
+
* true" without anything actually configured.
|
|
381
|
+
*
|
|
382
|
+
* The fix: drive the entire Telegram setup from instar with readline +
|
|
383
|
+
* the Telegram Bot API. No LLM session is involved. We:
|
|
384
|
+
*
|
|
385
|
+
* 1. Print clear BotFather instructions.
|
|
386
|
+
* 2. Prompt the user for the bot token, validate via getMe.
|
|
387
|
+
* 3. Prompt the user to add the bot to a group and send a message,
|
|
388
|
+
* then call getUpdates to extract the chat ID.
|
|
389
|
+
* 4. Write the token + chat ID into .instar/config.json's messaging[].
|
|
390
|
+
*
|
|
391
|
+
* Failure modes (network down, user can't paste, etc.) gracefully
|
|
392
|
+
* skip with a clear "you can finish setup later" pointer, but never
|
|
393
|
+
* silently mark the channel as configured when it isn't.
|
|
279
394
|
*/
|
|
280
395
|
async function runTelegramSetup(options) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
396
|
+
console.log();
|
|
397
|
+
console.log(pc.bold(' Telegram setup'));
|
|
398
|
+
console.log(pc.dim(' This takes about 2 minutes. I\'ll walk you through each step.'));
|
|
399
|
+
console.log();
|
|
400
|
+
console.log(pc.bold(' Step 1 of 3 — Create a bot'));
|
|
401
|
+
console.log(' • Open https://web.telegram.org/a/ in your browser');
|
|
402
|
+
console.log(' • Search for @BotFather and start a chat');
|
|
403
|
+
console.log(' • Send /newbot and follow the prompts:');
|
|
404
|
+
console.log(' – Display name (e.g. "Instar Codey")');
|
|
405
|
+
console.log(' – Username (must end with "bot", e.g. "instar_codey_bot")');
|
|
406
|
+
console.log(' • BotFather will reply with a token like 1234567890:AAH...');
|
|
407
|
+
console.log();
|
|
408
|
+
let token = '';
|
|
409
|
+
let botUsername = '';
|
|
410
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
411
|
+
const input = (await askUser(' Paste the bot token here: ')).trim();
|
|
412
|
+
if (!input) {
|
|
413
|
+
console.log(pc.yellow(' That looked blank — paste the token from BotFather (the long string).'));
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
console.log(pc.dim(' Verifying token with Telegram…'));
|
|
417
|
+
const verified = await telegramGetMe(input);
|
|
418
|
+
if (!verified.ok) {
|
|
419
|
+
console.log(pc.yellow(` Telegram rejected that token: ${verified.error}. Try pasting it again.`));
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
token = input;
|
|
423
|
+
botUsername = verified.username;
|
|
424
|
+
console.log(pc.green(` ✓ Bot verified: @${botUsername}`));
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
if (!token) {
|
|
428
|
+
console.log(pc.yellow(' Skipping Telegram for now. You can finish setup by chatting your agent later.'));
|
|
429
|
+
return { telegramConfigured: false };
|
|
430
|
+
}
|
|
431
|
+
console.log();
|
|
432
|
+
console.log(pc.bold(' Step 2 of 3 — Connect a chat'));
|
|
433
|
+
console.log(` • In Telegram, create a new group (or open an existing one)`);
|
|
434
|
+
console.log(` • Add @${botUsername} as a member`);
|
|
435
|
+
console.log(' • Send any message in the group ("hi" works)');
|
|
436
|
+
console.log();
|
|
437
|
+
await askUser(' Press Enter once you\'ve done that > ');
|
|
438
|
+
let chatId = '';
|
|
439
|
+
let chatName = '';
|
|
440
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
441
|
+
console.log(pc.dim(' Fetching the chat ID from Telegram…'));
|
|
442
|
+
const updates = await telegramGetUpdates(token);
|
|
443
|
+
if (!updates.ok) {
|
|
444
|
+
console.log(pc.yellow(` Couldn't reach Telegram: ${updates.error}.`));
|
|
445
|
+
const retry = (await askUser(' Press Enter to try again, type "skip" to skip > ')).toLowerCase().trim();
|
|
446
|
+
if (retry === 'skip')
|
|
447
|
+
break;
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
// Prefer group/supergroup chats. Fall back to most recent chat
|
|
451
|
+
// of any type — that's still useful (private DM with the bot
|
|
452
|
+
// works too).
|
|
453
|
+
const groupHit = updates.chats.find((c) => c.type === 'group' || c.type === 'supergroup');
|
|
454
|
+
const hit = groupHit ?? updates.chats[updates.chats.length - 1];
|
|
455
|
+
if (hit) {
|
|
456
|
+
chatId = hit.id;
|
|
457
|
+
chatName = hit.name;
|
|
458
|
+
console.log(pc.green(` ✓ Chat found: "${chatName}" (id ${chatId})`));
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
console.log(pc.yellow(' No recent messages found yet. Make sure you sent a message in the group AFTER adding the bot.'));
|
|
462
|
+
const retry = (await askUser(' Press Enter to try again, type "skip" to skip > ')).toLowerCase().trim();
|
|
463
|
+
if (retry === 'skip')
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
if (!chatId) {
|
|
467
|
+
console.log(pc.yellow(' Skipping chat-ID detection. Your bot token is saved; you can add the chat ID later.'));
|
|
468
|
+
// Still save the token — partial config is better than none.
|
|
469
|
+
writeTelegramConfig(options.projectDir, { token, chatId: '' });
|
|
470
|
+
return { telegramConfigured: false };
|
|
471
|
+
}
|
|
472
|
+
console.log();
|
|
473
|
+
console.log(pc.bold(' Step 3 of 3 — Saving config'));
|
|
474
|
+
const written = writeTelegramConfig(options.projectDir, { token, chatId });
|
|
475
|
+
if (!written) {
|
|
476
|
+
console.log(pc.red(' Couldn\'t write to .instar/config.json. Your bot is created but not wired up yet.'));
|
|
477
|
+
return { telegramConfigured: false };
|
|
478
|
+
}
|
|
479
|
+
console.log(pc.green(' ✓ Telegram is set up.'));
|
|
480
|
+
console.log(pc.dim(` Your agent will message you in "${chatName}" once the server starts.`));
|
|
481
|
+
return { telegramConfigured: true };
|
|
482
|
+
}
|
|
483
|
+
async function telegramGetMe(token) {
|
|
484
|
+
try {
|
|
485
|
+
const url = `https://api.telegram.org/bot${encodeURIComponent(token)}/getMe`;
|
|
486
|
+
const res = await fetch(url);
|
|
487
|
+
const data = (await res.json());
|
|
488
|
+
if (!data.ok)
|
|
489
|
+
return { ok: false, username: '', error: data.description || 'invalid token' };
|
|
490
|
+
return { ok: true, username: data.result?.username || 'unknown', error: '' };
|
|
491
|
+
}
|
|
492
|
+
catch (err) {
|
|
493
|
+
return { ok: false, username: '', error: err instanceof Error ? err.message : String(err) };
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
async function telegramGetUpdates(token) {
|
|
497
|
+
try {
|
|
498
|
+
const url = `https://api.telegram.org/bot${encodeURIComponent(token)}/getUpdates`;
|
|
499
|
+
const res = await fetch(url);
|
|
500
|
+
const data = (await res.json());
|
|
501
|
+
if (!data.ok)
|
|
502
|
+
return { ok: false, chats: [], error: data.description || 'getUpdates failed' };
|
|
503
|
+
const chats = (data.result || [])
|
|
504
|
+
.map((u) => u.message?.chat)
|
|
505
|
+
.filter((c) => !!c && typeof c.id === 'number')
|
|
506
|
+
.map((c) => ({
|
|
507
|
+
id: String(c.id),
|
|
508
|
+
type: c.type || 'private',
|
|
509
|
+
name: c.title || c.first_name || c.username || `chat ${c.id}`,
|
|
510
|
+
}));
|
|
511
|
+
return { ok: true, chats, error: '' };
|
|
512
|
+
}
|
|
513
|
+
catch (err) {
|
|
514
|
+
return { ok: false, chats: [], error: err instanceof Error ? err.message : String(err) };
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Persist a Telegram messaging entry into .instar/config.json's
|
|
519
|
+
* messaging[]. Replaces any existing telegram entry. Returns true on
|
|
520
|
+
* success.
|
|
521
|
+
*/
|
|
522
|
+
function writeTelegramConfig(projectDir, params) {
|
|
523
|
+
const configPath = path.join(projectDir, '.instar', 'config.json');
|
|
524
|
+
try {
|
|
525
|
+
const raw = fs.readFileSync(configPath, 'utf-8');
|
|
526
|
+
const config = JSON.parse(raw);
|
|
527
|
+
config.messaging = (config.messaging || []).filter((m) => m.type !== 'telegram');
|
|
528
|
+
config.messaging.push({
|
|
529
|
+
type: 'telegram',
|
|
530
|
+
enabled: true,
|
|
531
|
+
config: {
|
|
532
|
+
token: params.token,
|
|
533
|
+
chatId: params.chatId,
|
|
534
|
+
pollIntervalMs: 2000,
|
|
535
|
+
stallTimeoutMinutes: 5,
|
|
536
|
+
},
|
|
317
537
|
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
538
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
539
|
+
return true;
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
321
544
|
}
|
|
322
545
|
/**
|
|
323
546
|
* Entry point — runs the wizard from the initial state to completion.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-driver.js","sourceRoot":"","sources":["../../../src/commands/setup-wizard/codex-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,aAAa,GAKd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAc1D;;;;;GAKG;AACH,MAAM,iBAAiB,GAA8E;IACnG,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;;6DAEqC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC;;;;;;;;CAQzF,CAAC,IAAI,EAAE;IAEN,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;CAetB,CAAC,IAAI,EAAE;IAEN,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;qDAC8B,CAAC,CAAC,SAAS;;;;;;;CAO/D,CAAC,IAAI,EAAE;IAEN,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;8BACQ,CAAC,CAAC,SAAS;OAClC,CAAC,CAAC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AM,EAAE,OAAO,CAAC,CAAC;QAC/D,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,SAAS,GAAG,MAAM,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -53,6 +53,7 @@ export interface NarrativeState {
|
|
|
53
53
|
input: {
|
|
54
54
|
kind: 'text';
|
|
55
55
|
placeholder?: string;
|
|
56
|
+
required?: boolean;
|
|
56
57
|
} | {
|
|
57
58
|
kind: 'choice';
|
|
58
59
|
choices: Array<{
|
|
@@ -60,6 +61,16 @@ export interface NarrativeState {
|
|
|
60
61
|
label: string;
|
|
61
62
|
}>;
|
|
62
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* Validate the user's raw answer BEFORE the driver routes it through
|
|
66
|
+
* `next`. Return `null` to accept; return a friendly message to
|
|
67
|
+
* surface to the user and re-render the same state. This is how
|
|
68
|
+
* the wizard catches buffered-Enter empty submissions on required
|
|
69
|
+
* fields and unmatched choice inputs — surfaces an "I think
|
|
70
|
+
* something slipped through, try again" reprompt instead of
|
|
71
|
+
* silently defaulting.
|
|
72
|
+
*/
|
|
73
|
+
validate?: (answer: string) => string | null;
|
|
63
74
|
/** Where to go next based on the user's answer. Driver invokes this. */
|
|
64
75
|
next: (answer: string, answers: WizardAnswers) => {
|
|
65
76
|
state: string;
|
|
@@ -92,6 +103,21 @@ export declare function resolveChoice(answer: string, choices: Array<{
|
|
|
92
103
|
value: string;
|
|
93
104
|
label: string;
|
|
94
105
|
}>): string | null;
|
|
106
|
+
/**
|
|
107
|
+
* Standard validator: require non-empty trimmed text. Surfaces a
|
|
108
|
+
* friendly reprompt when the user submits whitespace-only (the
|
|
109
|
+
* classic buffered-Enter problem).
|
|
110
|
+
*/
|
|
111
|
+
export declare function requireNonEmpty(fieldLabel: string): (answer: string) => string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Standard validator for a choice prompt: surfaces a friendly retry
|
|
114
|
+
* when the user's input matches none of the offered choices (by
|
|
115
|
+
* number, value, or label prefix).
|
|
116
|
+
*/
|
|
117
|
+
export declare function requireChoice(choices: Array<{
|
|
118
|
+
value: string;
|
|
119
|
+
label: string;
|
|
120
|
+
}>): (answer: string) => string | null;
|
|
95
121
|
/**
|
|
96
122
|
* Build the wizard state machine for a fresh project-bound install
|
|
97
123
|
* (the most common entry point — and the one observed broken in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-machine.d.ts","sourceRoot":"","sources":["../../../src/commands/setup-wizard/state-machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,UAAU,GACV,wBAAwB,GACxB,wBAAwB,GACxB,qBAAqB,GACrB,eAAe,GACf,cAAc,GACd,mBAAmB,GACnB,eAAe,CAAC;AAEpB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GAAG,uBAAuB,GAAG,QAAQ,GAAG,UAAU,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E,MAAM,EACd,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/C,MAAM,GAAG,IAAI,CAYf;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAOrF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/C,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAOnC;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAwOtE;AAED,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
|
@@ -39,6 +39,32 @@ export function resolveChoice(answer, choices) {
|
|
|
39
39
|
}
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Standard validator: require non-empty trimmed text. Surfaces a
|
|
44
|
+
* friendly reprompt when the user submits whitespace-only (the
|
|
45
|
+
* classic buffered-Enter problem).
|
|
46
|
+
*/
|
|
47
|
+
export function requireNonEmpty(fieldLabel) {
|
|
48
|
+
return (answer) => {
|
|
49
|
+
if (answer.trim().length === 0) {
|
|
50
|
+
return `That looked blank — did an extra Enter slip through? Try typing a ${fieldLabel}.`;
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Standard validator for a choice prompt: surfaces a friendly retry
|
|
57
|
+
* when the user's input matches none of the offered choices (by
|
|
58
|
+
* number, value, or label prefix).
|
|
59
|
+
*/
|
|
60
|
+
export function requireChoice(choices) {
|
|
61
|
+
return (answer) => {
|
|
62
|
+
if (resolveChoice(answer, choices) === null) {
|
|
63
|
+
return `I didn't recognize that — try typing one of the numbers (1-${choices.length}) or the option name.`;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
42
68
|
/**
|
|
43
69
|
* Build the wizard state machine for a fresh project-bound install
|
|
44
70
|
* (the most common entry point — and the one observed broken in the
|
|
@@ -67,11 +93,15 @@ export function buildFreshProjectInstall() {
|
|
|
67
93
|
{ value: 'no', label: 'Not right now' },
|
|
68
94
|
],
|
|
69
95
|
},
|
|
96
|
+
validate: requireChoice([
|
|
97
|
+
{ value: 'yes', label: 'Yes, let\'s go' },
|
|
98
|
+
{ value: 'no', label: 'Not right now' },
|
|
99
|
+
]),
|
|
70
100
|
next: (answer) => {
|
|
71
101
|
const choice = resolveChoice(answer, [
|
|
72
102
|
{ value: 'yes', label: 'Yes, let\'s go' },
|
|
73
103
|
{ value: 'no', label: 'Not right now' },
|
|
74
|
-
])
|
|
104
|
+
]); // validator guarantees non-null here
|
|
75
105
|
return choice === 'no'
|
|
76
106
|
? { state: 'declined', updates: {} }
|
|
77
107
|
: { state: 'agent-name', updates: {} };
|
|
@@ -82,10 +112,11 @@ export function buildFreshProjectInstall() {
|
|
|
82
112
|
kind: 'narrative-then-prompt',
|
|
83
113
|
narrativeContext: 'agent-name',
|
|
84
114
|
prompt: 'What would you like to call your agent? (a single word works best)',
|
|
85
|
-
input: { kind: 'text', placeholder: 'e.g. echo, scout, codey' },
|
|
115
|
+
input: { kind: 'text', placeholder: 'e.g. echo, scout, codey', required: true },
|
|
116
|
+
validate: requireNonEmpty('name'),
|
|
86
117
|
next: (answer) => ({
|
|
87
118
|
state: 'agent-role',
|
|
88
|
-
updates: { agentName: answer.trim()
|
|
119
|
+
updates: { agentName: answer.trim() },
|
|
89
120
|
}),
|
|
90
121
|
},
|
|
91
122
|
'agent-role': {
|
|
@@ -93,10 +124,11 @@ export function buildFreshProjectInstall() {
|
|
|
93
124
|
kind: 'narrative-then-prompt',
|
|
94
125
|
narrativeContext: 'agent-role',
|
|
95
126
|
prompt: 'In one sentence, what should this agent focus on? (you can change this anytime)',
|
|
96
|
-
input: { kind: 'text', placeholder: 'e.g. coding assistant for this project' },
|
|
127
|
+
input: { kind: 'text', placeholder: 'e.g. coding assistant for this project', required: true },
|
|
128
|
+
validate: requireNonEmpty('focus or purpose'),
|
|
97
129
|
next: (answer) => ({
|
|
98
130
|
state: 'user-name',
|
|
99
|
-
updates: { agentRole: answer.trim()
|
|
131
|
+
updates: { agentRole: answer.trim() },
|
|
100
132
|
}),
|
|
101
133
|
},
|
|
102
134
|
'user-name': {
|
|
@@ -104,10 +136,11 @@ export function buildFreshProjectInstall() {
|
|
|
104
136
|
kind: 'narrative-then-prompt',
|
|
105
137
|
narrativeContext: 'user-name',
|
|
106
138
|
prompt: 'And what should the agent call you?',
|
|
107
|
-
input: { kind: 'text', placeholder: 'your first name is fine' },
|
|
139
|
+
input: { kind: 'text', placeholder: 'your first name is fine', required: true },
|
|
140
|
+
validate: requireNonEmpty('name'),
|
|
108
141
|
next: (answer) => ({
|
|
109
142
|
state: 'autonomy',
|
|
110
|
-
updates: { userName: answer.trim()
|
|
143
|
+
updates: { userName: answer.trim() },
|
|
111
144
|
}),
|
|
112
145
|
},
|
|
113
146
|
autonomy: {
|
|
@@ -127,13 +160,18 @@ export function buildFreshProjectInstall() {
|
|
|
127
160
|
{ value: 'autonomous', label: 'Autonomous' },
|
|
128
161
|
],
|
|
129
162
|
},
|
|
163
|
+
validate: requireChoice([
|
|
164
|
+
{ value: 'guided', label: 'Guided' },
|
|
165
|
+
{ value: 'proactive', label: 'Proactive' },
|
|
166
|
+
{ value: 'autonomous', label: 'Autonomous' },
|
|
167
|
+
]),
|
|
130
168
|
next: (answer) => {
|
|
131
169
|
const a = resolveChoice(answer, [
|
|
132
170
|
{ value: 'guided', label: 'Guided' },
|
|
133
171
|
{ value: 'proactive', label: 'Proactive' },
|
|
134
172
|
{ value: 'autonomous', label: 'Autonomous' },
|
|
135
173
|
]);
|
|
136
|
-
return { state: 'do-init', updates: { autonomy: a
|
|
174
|
+
return { state: 'do-init', updates: { autonomy: a } };
|
|
137
175
|
},
|
|
138
176
|
},
|
|
139
177
|
'do-init': {
|
|
@@ -167,14 +205,19 @@ export function buildFreshProjectInstall() {
|
|
|
167
205
|
{ value: 'skip', label: 'Skip' },
|
|
168
206
|
],
|
|
169
207
|
},
|
|
208
|
+
validate: requireChoice([
|
|
209
|
+
{ value: 'telegram', label: 'Telegram' },
|
|
210
|
+
{ value: 'whatsapp', label: 'WhatsApp' },
|
|
211
|
+
{ value: 'slack', label: 'Slack' },
|
|
212
|
+
{ value: 'skip', label: 'Skip' },
|
|
213
|
+
]),
|
|
170
214
|
next: (answer) => {
|
|
171
|
-
const
|
|
215
|
+
const messaging = resolveChoice(answer, [
|
|
172
216
|
{ value: 'telegram', label: 'Telegram' },
|
|
173
217
|
{ value: 'whatsapp', label: 'WhatsApp' },
|
|
174
218
|
{ value: 'slack', label: 'Slack' },
|
|
175
219
|
{ value: 'skip', label: 'Skip' },
|
|
176
220
|
]);
|
|
177
|
-
const messaging = m ?? 'skip';
|
|
178
221
|
if (messaging === 'telegram')
|
|
179
222
|
return { state: 'do-telegram', updates: { messaging } };
|
|
180
223
|
if (messaging === 'whatsapp')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-machine.js","sourceRoot":"","sources":["../../../src/commands/setup-wizard/state-machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"state-machine.js","sourceRoot":"","sources":["../../../src/commands/setup-wizard/state-machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqFH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAc,EACd,OAAgD;IAEhD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,CAAC,OAA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,CAAC,sBAAsB;SACnC;QAED,sBAAsB,EAAE;YACtB,EAAE,EAAE,sBAAsB;YAC1B,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,6BAA6B,EAAE;YACjF,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAkB;SAC/B;QAED,kBAAkB,EAAE;YAClB,EAAE,EAAE,kBAAkB;YACtB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,kCAAkC,EAAE;YAClF,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU;SACvB;QAED,QAAQ,EAAE;YACR,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,UAAU;YAChB,QAAQ,EACN,0EAA0E;gBAC1E,0EAA0E;gBAC1E,yBAAyB;gBACzB,IAAI;gBACJ,2EAA2E;gBAC3E,qEAAqE;gBACrE,sEAAsE;gBACtE,iEAAiE;SACpE;QAED,QAAQ,EAAE;YACR,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,UAAU;YAChB,QAAQ,EACN,iFAAiF;SACpF;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-05-
|
|
5
|
-
"instarVersion": "1.2.
|
|
4
|
+
"generatedAt": "2026-05-22T00:06:03.820Z",
|
|
5
|
+
"instarVersion": "1.2.15",
|
|
6
6
|
"entryCount": 191,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Upgrade Guide — v1.2.14 (wizard validation + composing indicator)
|
|
2
|
+
|
|
3
|
+
<!-- bump: patch -->
|
|
4
|
+
<!-- patch = bug fixes, refactors, test additions, doc updates -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
**Fix: the wizard now catches buffered-Enter and surfaces a visible
|
|
9
|
+
indicator during Codex narrative calls.**
|
|
10
|
+
|
|
11
|
+
End-to-end testing v1.2.13 on a real Codex install surfaced a UX
|
|
12
|
+
failure. The user typed an answer and pressed Enter, then — because
|
|
13
|
+
the next Codex-narrative call took several seconds with no visible
|
|
14
|
+
feedback — pressed Enter again thinking the terminal was frozen. The
|
|
15
|
+
extra Enter buffered in stdin, was consumed by the next prompt as
|
|
16
|
+
an empty submission, and the wizard silently defaulted the agent's
|
|
17
|
+
name to "agent". The user ended up with an agent that had a generic
|
|
18
|
+
identity they never picked.
|
|
19
|
+
|
|
20
|
+
Two structural fixes, both in `src/commands/setup-wizard/`:
|
|
21
|
+
|
|
22
|
+
1. **Per-state validators** on the state machine. Each
|
|
23
|
+
narrative-then-prompt state can now declare a `validate` function
|
|
24
|
+
that rejects invalid input and surfaces a friendly retry message
|
|
25
|
+
without re-generating the Codex narrative paragraph (cheap loop,
|
|
26
|
+
no extra LLM calls). Reusable validators:
|
|
27
|
+
- `requireNonEmpty(fieldLabel)`: rejects whitespace-only
|
|
28
|
+
submissions on required text fields with an explicit
|
|
29
|
+
"did an extra Enter slip through?" nudge.
|
|
30
|
+
- `requireChoice(choices)`: rejects unmatched input on choice
|
|
31
|
+
prompts with a "try one of these numbers" nudge.
|
|
32
|
+
|
|
33
|
+
Wired on every narrative state in the fresh-project-install
|
|
34
|
+
graph. Bounded at 5 retry attempts to prevent infinite loops
|
|
35
|
+
on wedged input.
|
|
36
|
+
|
|
37
|
+
2. **Composing spinner** during codex narrative calls. A braille
|
|
38
|
+
spinner ("⠋ composing…") animates on a single line while
|
|
39
|
+
`codex exec` runs; clears cleanly when the paragraph arrives.
|
|
40
|
+
On non-TTY (CI, piped output) it prints "composing…" once and
|
|
41
|
+
stops. Eliminates the silent-dead-air window that triggered
|
|
42
|
+
buffered-Enter in the first place.
|
|
43
|
+
|
|
44
|
+
The silent-default fallback that accepted empty agent-name as
|
|
45
|
+
"agent" is removed. With validators upstream, the state machine
|
|
46
|
+
only ever sees valid input.
|
|
47
|
+
|
|
48
|
+
Spec: `specs/dev-infrastructure/wizard-validation.md`.
|
|
49
|
+
ELI16: `specs/dev-infrastructure/wizard-validation.eli16.md`.
|
|
50
|
+
Side-effects review: `upgrades/side-effects/fix-wizard-validation.md`.
|
|
51
|
+
|
|
52
|
+
## What to Tell Your User
|
|
53
|
+
|
|
54
|
+
The setup wizard now shows a spinner while it's thinking, so you
|
|
55
|
+
can tell the system is working during the longer steps. If you
|
|
56
|
+
accidentally press Enter twice (which is easy to do during the
|
|
57
|
+
think pauses), the wizard will catch it and re-ask the question
|
|
58
|
+
instead of silently moving on with a blank answer.
|
|
59
|
+
|
|
60
|
+
## Summary of New Capabilities
|
|
61
|
+
|
|
62
|
+
No new capabilities. UX hardening on top of v1.2.13's hybrid wizard.
|
|
63
|
+
|
|
64
|
+
## Evidence
|
|
65
|
+
|
|
66
|
+
Reproduction prior to fix: v1.2.13 install on `instar-codey` with
|
|
67
|
+
Codex CLI. User entered "1" + Enter at welcome, then pressed Enter
|
|
68
|
+
again during the silent codex-narrative call. The second Enter was
|
|
69
|
+
consumed by the agent-name prompt as an empty submission;
|
|
70
|
+
agentName defaulted to "agent"; wizard proceeded with the generic
|
|
71
|
+
identity.
|
|
72
|
+
|
|
73
|
+
After fix:
|
|
74
|
+
- 14 new state-machine unit tests cover the two validator helpers
|
|
75
|
+
and the per-state validator wiring (welcome, agent-name,
|
|
76
|
+
agent-role, user-name, autonomy, messaging).
|
|
77
|
+
- Existing 12 state-graph tests still pass.
|
|
78
|
+
- Existing 5 dispatch canary tests still pass.
|
|
79
|
+
- Manual end-to-end re-test pending on publish.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Upgrade Guide — v1.2.15 (Telegram-native wizard + UX fixes)
|
|
2
|
+
|
|
3
|
+
<!-- bump: patch -->
|
|
4
|
+
<!-- patch = bug fixes, refactors, test additions, doc updates -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
**Fix: three real-user UX bugs from the v1.2.14 Codex install test.**
|
|
9
|
+
|
|
10
|
+
End-to-end testing on instar-codey caught three issues, all in the
|
|
11
|
+
hybrid wizard's Codex path:
|
|
12
|
+
|
|
13
|
+
1. **`instar user add -d ...` errored** with "unknown option '-d'".
|
|
14
|
+
The user-profile creation step silently failed. Fix: drop the
|
|
15
|
+
`-d` flag and set `cwd: options.projectDir` on the spawn. Same
|
|
16
|
+
prophylactic edit applied to the server-start and
|
|
17
|
+
autostart-install actions.
|
|
18
|
+
|
|
19
|
+
2. **Choice prompts silently accepted text input** ("Proactive",
|
|
20
|
+
"Telegram") without echoing what got picked. The interpreter
|
|
21
|
+
worked correctly via `resolveChoice`, but the user had no
|
|
22
|
+
visual confirmation. Fix: new `echoChoice` helper called from
|
|
23
|
+
the validator retry loop prints `→ {label}` after the answer
|
|
24
|
+
is accepted.
|
|
25
|
+
|
|
26
|
+
3. **Telegram setup silently failed** because it spawned a
|
|
27
|
+
`codex exec` session that couldn't actually wait for the user
|
|
28
|
+
to paste a bot token. Codex printed manual BotFather
|
|
29
|
+
instructions, ended successfully, and the wizard recorded
|
|
30
|
+
"Telegram is configured!" without anything being configured.
|
|
31
|
+
Fix: complete rewrite of the Telegram action as an instar-
|
|
32
|
+
native readline + Telegram Bot API flow. No LLM session in the
|
|
33
|
+
loop. Three steps:
|
|
34
|
+
|
|
35
|
+
- **Step 1 of 3**: print BotFather instructions, prompt for
|
|
36
|
+
token, validate via `GET /bot<TOKEN>/getMe`. Up to 5 retries
|
|
37
|
+
on invalid tokens; "skip" exits without marking configured.
|
|
38
|
+
- **Step 2 of 3**: prompt user to add bot to a group + send
|
|
39
|
+
a message, then call `GET /bot<TOKEN>/getUpdates` to auto-
|
|
40
|
+
discover the chat ID. Up to 4 retries.
|
|
41
|
+
- **Step 3 of 3**: write `{ type: 'telegram', enabled: true,
|
|
42
|
+
config: { token, chatId, pollIntervalMs, stallTimeoutMinutes
|
|
43
|
+
} }` to `.instar/config.json`'s messaging array, replacing
|
|
44
|
+
any existing telegram entry.
|
|
45
|
+
|
|
46
|
+
The action NEVER returns `telegramConfigured: true` unless the
|
|
47
|
+
config write actually succeeds — closing the silent-success
|
|
48
|
+
class of failure.
|
|
49
|
+
|
|
50
|
+
Spec: `specs/dev-infrastructure/wizard-telegram-native.md`.
|
|
51
|
+
ELI16: `specs/dev-infrastructure/wizard-telegram-native.eli16.md`.
|
|
52
|
+
Side-effects review: `upgrades/side-effects/fix-wizard-telegram-native.md`.
|
|
53
|
+
|
|
54
|
+
## What to Tell Your User
|
|
55
|
+
|
|
56
|
+
The wizard's Telegram setup now works end-to-end on any host — no
|
|
57
|
+
browser automation dependency, no LLM session involved. You'll see
|
|
58
|
+
clear instructions, paste your bot token, add the bot to a group,
|
|
59
|
+
press Enter, and the wizard writes everything for you. If anything
|
|
60
|
+
fails along the way, it'll tell you exactly what happened and how
|
|
61
|
+
to finish setup later by chatting your agent.
|
|
62
|
+
|
|
63
|
+
## Summary of New Capabilities
|
|
64
|
+
|
|
65
|
+
No new capabilities. Three UX hardening fixes on top of v1.2.14.
|
|
66
|
+
|
|
67
|
+
## Evidence
|
|
68
|
+
|
|
69
|
+
Reproduction prior to fix: v1.2.14 install on `instar-codey` (real
|
|
70
|
+
Codex install, ChatGPT-subscription auth):
|
|
71
|
+
- user-add action printed `error: unknown option '-d'`.
|
|
72
|
+
- Autonomy choice "Proactive" was accepted with no echo.
|
|
73
|
+
- Messaging choice "Telegram" was accepted with no echo.
|
|
74
|
+
- Telegram action spawned Codex; Codex printed manual BotFather
|
|
75
|
+
instructions; wizard immediately marked Telegram configured;
|
|
76
|
+
config.json's `messaging` array was empty.
|
|
77
|
+
|
|
78
|
+
After fix:
|
|
79
|
+
- 6 new unit tests cover the Telegram-native flow shape, the
|
|
80
|
+
add-user cwd fix, and the choice echo helper.
|
|
81
|
+
- Existing 26 state-machine tests still pass.
|
|
82
|
+
- Existing 5 dispatch canary tests still pass (updated to
|
|
83
|
+
reflect that the driver now has 1 codex exec spawn instead of 2,
|
|
84
|
+
since the Telegram one was replaced).
|
|
85
|
+
- Total: 37 wizard-related tests, all green.
|
|
86
|
+
- Manual end-to-end re-test on Codex install path pending on
|
|
87
|
+
publish.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Side-effects review — Telegram-native wizard + add-user cwd + choice echo
|
|
2
|
+
|
|
3
|
+
Per L6. Seven dimensions.
|
|
4
|
+
|
|
5
|
+
## 1. Over-block / under-block
|
|
6
|
+
|
|
7
|
+
Before: UNDER on three counts.
|
|
8
|
+
- `add-user` action passed `-d` to a CLI that doesn't accept it →
|
|
9
|
+
silent profile-creation failure.
|
|
10
|
+
- Choice prompts silently accepted text input without echoing what
|
|
11
|
+
got resolved → user couldn't tell whether their input was
|
|
12
|
+
understood.
|
|
13
|
+
- Telegram action spawned `codex exec` (non-interactive) and then
|
|
14
|
+
marked the channel configured even though no token was captured.
|
|
15
|
+
|
|
16
|
+
After: precisely targeted.
|
|
17
|
+
- `add-user` uses cwd consistently with how `instar user add`
|
|
18
|
+
actually resolves project context.
|
|
19
|
+
- Choice prompts echo `→ {label}` after validation passes (no-op for
|
|
20
|
+
text prompts).
|
|
21
|
+
- Telegram action is instar-native readline + Telegram Bot API; only
|
|
22
|
+
marks the channel configured when the config write succeeds.
|
|
23
|
+
|
|
24
|
+
No over-block: the Claude wizard path is untouched, WhatsApp + Slack
|
|
25
|
+
flows are unchanged, the state machine's flow is unchanged.
|
|
26
|
+
|
|
27
|
+
## 2. Level-of-abstraction fit
|
|
28
|
+
|
|
29
|
+
Three small, scoped changes inside the existing codex-driver module:
|
|
30
|
+
|
|
31
|
+
- One spawn-options edit on the `add-user` action (drop `-d`, add
|
|
32
|
+
cwd). Same pattern applied prophylactically to `start-server`
|
|
33
|
+
and `install-autostart` for consistency.
|
|
34
|
+
- One helper function `echoChoice(state, answer)` called from the
|
|
35
|
+
existing `renderNarrativeState` retry loop. Pure render concern,
|
|
36
|
+
no state-machine API change.
|
|
37
|
+
- `runTelegramSetup` rewritten as a 100-line instar-native flow
|
|
38
|
+
plus three small private helpers (`telegramGetMe`,
|
|
39
|
+
`telegramGetUpdates`, `writeTelegramConfig`). Replaces a 50-line
|
|
40
|
+
codex-spawn helper. Net code size grew by ~150 LOC for a more
|
|
41
|
+
reliable result.
|
|
42
|
+
|
|
43
|
+
No new module, no new abstraction. The driver remains the single
|
|
44
|
+
home for codex-cli wizard implementation.
|
|
45
|
+
|
|
46
|
+
## 3. Signal vs Authority compliance
|
|
47
|
+
|
|
48
|
+
- The Telegram API's `getMe` response is the AUTHORITY for "is this
|
|
49
|
+
a valid bot token." Pre-fix, the wizard never validated.
|
|
50
|
+
- The Telegram API's `getUpdates` response is the AUTHORITY for
|
|
51
|
+
"what chat IDs has this bot seen." We extract from there rather
|
|
52
|
+
than inventing.
|
|
53
|
+
- The wizard's `choice` resolver remains the AUTHORITY for "what
|
|
54
|
+
did the user mean by their text input." Echo just surfaces the
|
|
55
|
+
AUTHORITY's decision to the user.
|
|
56
|
+
- The `add-user` cwd change makes process-directory the SIGNAL the
|
|
57
|
+
CLI was always reading; the prior `-d` flag was a wrong-signal
|
|
58
|
+
attempt that the CLI rejected outright.
|
|
59
|
+
|
|
60
|
+
## 4. Interactions with adjacent systems
|
|
61
|
+
|
|
62
|
+
- **State machine `setup-telegram-agentic` action**: name unchanged
|
|
63
|
+
(still describes the user-visible intent). Implementation moved
|
|
64
|
+
from codex-spawn to instar-native. Downstream consumers
|
|
65
|
+
(`send-greeting` action, future Telegram-dependent steps) see the
|
|
66
|
+
same `{ telegramConfigured: boolean }` return shape.
|
|
67
|
+
- **`writeTelegramConfig`**: writes the exact messaging schema the
|
|
68
|
+
agent server already consumes (`type/enabled/config.token/chatId/
|
|
69
|
+
pollIntervalMs/stallTimeoutMinutes`). No change to consumers.
|
|
70
|
+
- **`renderNarrativeState`**: gains one `echoChoice(state, answer)`
|
|
71
|
+
call after the validator accepts. Wraps the existing return path,
|
|
72
|
+
doesn't change it.
|
|
73
|
+
- **`add-user` action**: cwd change is invisible to the CLI; same
|
|
74
|
+
outcome via the correct flag set.
|
|
75
|
+
- **Existing v1.2.14 validators + spinner**: untouched.
|
|
76
|
+
- **Claude wizard path**: untouched.
|
|
77
|
+
|
|
78
|
+
## 5. Rollback cost
|
|
79
|
+
|
|
80
|
+
Low-medium. `runTelegramSetup` is fully replaced (not patched), so
|
|
81
|
+
revert restores the broken codex-spawn version. The other two fixes
|
|
82
|
+
are small enough to revert independently if needed.
|
|
83
|
+
|
|
84
|
+
## 6. Backwards compatibility / drift surface
|
|
85
|
+
|
|
86
|
+
Fully backwards-compatible.
|
|
87
|
+
|
|
88
|
+
- Codex-runtime users: get a working Telegram setup. Previously
|
|
89
|
+
got broken silent-success.
|
|
90
|
+
- Claude-runtime users: zero change.
|
|
91
|
+
- Existing `instar add telegram` CLI command (the post-setup
|
|
92
|
+
fallback): unchanged. If the wizard skips Telegram, the user can
|
|
93
|
+
still run `instar add telegram` later — and the `writeTelegram
|
|
94
|
+
Config` helper writes the EXACT same schema, so the two flows
|
|
95
|
+
produce identical config.
|
|
96
|
+
- No config schema change. No agent-installed-files change. No
|
|
97
|
+
`PostUpdateMigrator` work.
|
|
98
|
+
|
|
99
|
+
## 7. Authorization / Trust posture
|
|
100
|
+
|
|
101
|
+
No new authority. `fetch` calls to api.telegram.org happen with the
|
|
102
|
+
user's bot token (which they paste into the wizard). The wizard
|
|
103
|
+
runs in-process, same trust level as everything else in setup.
|
|
104
|
+
|
|
105
|
+
## Outcome
|
|
106
|
+
|
|
107
|
+
Ship. Closes three real-user bugs surfaced on the v1.2.14 install
|
|
108
|
+
test. Replaces the broken codex-spawn Telegram setup with an
|
|
109
|
+
instar-native flow that's robust across all environments
|
|
110
|
+
(Playwright available or not, Codex behavior aside). Echo and
|
|
111
|
+
add-user fixes are small companions that round out the v1.2.15
|
|
112
|
+
delivery.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Side-effects review — Wizard input validation + spinner
|
|
2
|
+
|
|
3
|
+
Per L6. Seven dimensions.
|
|
4
|
+
|
|
5
|
+
## 1. Over-block / under-block
|
|
6
|
+
|
|
7
|
+
Before: UNDER. The v1.2.13 hybrid wizard accepted empty submissions
|
|
8
|
+
on required identity fields with a silent fallback default
|
|
9
|
+
(agentName: 'agent'). Combined with the invisible-latency window on
|
|
10
|
+
codex-narrative calls, this produced the buffered-Enter bug Justin
|
|
11
|
+
hit on his first real Codex install — agent named "agent" without
|
|
12
|
+
the user ever typing a name.
|
|
13
|
+
|
|
14
|
+
After: precisely targeted. Validators enforce non-empty input on
|
|
15
|
+
required text fields and reject unmatched input on choice prompts.
|
|
16
|
+
Spinner during codex calls eliminates the silent-dead-air window
|
|
17
|
+
that triggers buffered-Enter in the first place. No over-block:
|
|
18
|
+
optional/derived fields keep their defaults; the validation
|
|
19
|
+
machinery only kicks in for fields the wizard explicitly marks as
|
|
20
|
+
required.
|
|
21
|
+
|
|
22
|
+
## 2. Level-of-abstraction fit
|
|
23
|
+
|
|
24
|
+
The `validate?` field is an optional addition to the existing
|
|
25
|
+
`NarrativeState` interface. Two reusable validators
|
|
26
|
+
(`requireNonEmpty`, `requireChoice`) live alongside the state
|
|
27
|
+
graph in `state-machine.ts`. The driver's `renderNarrativeState`
|
|
28
|
+
adds a bounded retry loop around `askUser`. The spinner is a
|
|
29
|
+
single utility function with a `{stop}` handle pattern.
|
|
30
|
+
|
|
31
|
+
No new module, no new abstraction layer. The state machine's API
|
|
32
|
+
grew by exactly one optional field.
|
|
33
|
+
|
|
34
|
+
## 3. Signal vs Authority compliance
|
|
35
|
+
|
|
36
|
+
- The validator's return value is the AUTHORITY for "is this
|
|
37
|
+
answer accepted." The driver respects it without second-guessing.
|
|
38
|
+
- The user's input remains the SIGNAL; the validator transforms
|
|
39
|
+
invalid SIGNALs into "retry with this hint" rather than silently
|
|
40
|
+
defaulting.
|
|
41
|
+
- The spinner is purely visual feedback — no authority, no signal.
|
|
42
|
+
|
|
43
|
+
## 4. Interactions with adjacent systems
|
|
44
|
+
|
|
45
|
+
- **State machine `next` functions**: simplified. The pre-fix code
|
|
46
|
+
on agent-name etc. was `answer.trim() || 'agent'`; post-fix is
|
|
47
|
+
`answer.trim()`. The validator ensures `next` only sees non-empty
|
|
48
|
+
trimmed input.
|
|
49
|
+
- **Codex driver dispatch in setup.ts**: unchanged. setup.ts still
|
|
50
|
+
routes codex-cli installs through `runCodexWizard`.
|
|
51
|
+
- **runCodexNarrative**: now wraps its spawnSync in a spinner
|
|
52
|
+
start/stop. Spinner is a no-op on non-TTY (CI, piped output) so
|
|
53
|
+
test environments aren't affected.
|
|
54
|
+
- **Existing canary test** (`tests/unit/setup-codex-model-canary.test.ts`):
|
|
55
|
+
unchanged. Asserts the same dispatch contract; the validator
|
|
56
|
+
additions don't touch the dispatch shape.
|
|
57
|
+
- **State-machine unit tests**: expanded from 12 to 26 cases.
|
|
58
|
+
Added validator-specific tests (requireNonEmpty, requireChoice,
|
|
59
|
+
per-state validator wiring).
|
|
60
|
+
- **Claude wizard path**: completely unaffected. Validators live on
|
|
61
|
+
the state-machine API, but the Claude path doesn't go through
|
|
62
|
+
the state machine — it spawns the existing /setup-wizard
|
|
63
|
+
slash-command directly.
|
|
64
|
+
|
|
65
|
+
## 5. Rollback cost
|
|
66
|
+
|
|
67
|
+
Low. New optional `validate` field on NarrativeState; new
|
|
68
|
+
validators; new spinner helper; one retry loop in the driver.
|
|
69
|
+
`git revert` restores v1.2.13 (with the buffered-Enter bug).
|
|
70
|
+
|
|
71
|
+
## 6. Backwards compatibility / drift surface
|
|
72
|
+
|
|
73
|
+
Fully backwards-compatible.
|
|
74
|
+
|
|
75
|
+
- States without a `validate` function skip validation entirely
|
|
76
|
+
and accept the answer immediately. No existing state is broken
|
|
77
|
+
by the addition.
|
|
78
|
+
- Validators are pure functions with stable contracts. Drift
|
|
79
|
+
surface: validator messages. If a message text needs to change,
|
|
80
|
+
update the validator's return value — visible in PR diff.
|
|
81
|
+
- No config schema change. No agent-installed-files change. No
|
|
82
|
+
PostUpdateMigrator work.
|
|
83
|
+
|
|
84
|
+
## 7. Authorization / Trust posture
|
|
85
|
+
|
|
86
|
+
No new authority. The validator is run inside the same wizard
|
|
87
|
+
process with the same user. No new privilege, no new sandbox, no
|
|
88
|
+
new auth.
|
|
89
|
+
|
|
90
|
+
## Outcome
|
|
91
|
+
|
|
92
|
+
Ship. Closes the broken-on-buffered-Enter UX hole that the
|
|
93
|
+
instar-codey real-user test surfaced. Structural validation +
|
|
94
|
+
visible composing indicator together address the failure-mode
|
|
95
|
+
chain (silent latency → user reflex → buffered Enter → empty
|
|
96
|
+
submission accepted). Validator extensibility lands cleanly on
|
|
97
|
+
the existing state-machine API. 26 unit tests cover the
|
|
98
|
+
validators + wiring.
|