specrails-hub 1.20.1 → 1.20.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-hub",
3
- "version": "1.20.1",
3
+ "version": "1.20.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -272,6 +272,23 @@ class SetupManager {
272
272
  }
273
273
  if (provider)
274
274
  this._projectProviders.set(projectId, provider);
275
+ const resolvedProvider = provider ?? this._projectProviders.get(projectId);
276
+ if (resolvedProvider === 'codex') {
277
+ // Codex doesn't support --resume. Build a continuation prompt that
278
+ // includes the original setup instructions so the new exec run can
279
+ // pick up where the previous one left off.
280
+ const setupMdPath = (0, path_1.join)(projectPath, SPECRAILS_DIR, 'commands', 'setup.md');
281
+ let setupContent = '';
282
+ try {
283
+ setupContent = (0, fs_1.readFileSync)(setupMdPath, 'utf-8');
284
+ }
285
+ catch { /* will fall back to just the user message */ }
286
+ const prompt = setupContent
287
+ ? `${setupContent}\n\n---\nIMPORTANT: This is a continuation of a previous setup run. Check which artifacts already exist in the project before regenerating anything. The user responded to your question with:\n\n${userMessage}`
288
+ : userMessage;
289
+ this._spawnSetup(projectId, projectPath, ['-p', prompt], resolvedProvider);
290
+ return;
291
+ }
275
292
  const args = [
276
293
  '--resume', sessionId,
277
294
  '--dangerously-skip-permissions',
@@ -339,6 +356,13 @@ class SetupManager {
339
356
  // Start periodic filesystem polling for checkpoint detection
340
357
  this._startFilesystemPoll(projectId, projectPath);
341
358
  let capturedSessionId = null;
359
+ // Codex has no session concept (no stream-json `result` event). Generate a
360
+ // synthetic session ID so the wizard can enable its chat input and the
361
+ // setup/message endpoint accepts follow-up messages.
362
+ if (isCodex) {
363
+ capturedSessionId = `codex-${projectId}-${Date.now()}`;
364
+ this._onSessionCaptured?.(projectId, capturedSessionId);
365
+ }
342
366
  const stdoutReader = (0, readline_1.createInterface)({ input: child.stdout, crlfDelay: Infinity });
343
367
  const stderrReader = (0, readline_1.createInterface)({ input: child.stderr, crlfDelay: Infinity });
344
368
  stdoutReader.on('line', (line) => {