multi-agents-cli 1.1.77 → 1.1.78

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/init.js CHANGED
@@ -62,7 +62,7 @@ const {
62
62
  } = require('./lib/summary');
63
63
 
64
64
  const { StepMachine, BACK, CONTINUE, RESTART, runQuestions } = require('./lib/steps');
65
- const { buildStepDefs } = require('./lib/questions-flow');
65
+ const { buildStepDefs, fwValue } = require('./lib/questions-flow');
66
66
 
67
67
  // ── Prompts ───────────────────────────────────────────────────────────────────
68
68
 
@@ -390,7 +390,7 @@ const main = async () => {
390
390
  const clientStyle = answers.clientStyle || null;
391
391
  const useIntegratedBackend = answers.useIntegratedBackend || false;
392
392
  const backendFwObj = answers.backendFwObj || null;
393
- const backendFw = backendFwObj ? backendFwObj.value : null;
393
+ const backendFw = backendFwObj ? fwValue(backendFwObj) : null;
394
394
  const backendLang = backendFwObj ? backendFwObj.language : null;
395
395
  const backendOrm = answers.backendOrm || null;
396
396
  const backendAuth = answers.backendAuth || null;
@@ -410,12 +410,12 @@ const main = async () => {
410
410
 
411
411
  console.log(`\n${bold('Review your configuration:')}\n`);
412
412
  summaryLine('Project', projectName);
413
- summaryLine('Client framework', clientFw.value);
413
+ summaryLine('Client framework', fwValue(clientFw));
414
414
  summaryLine('Client language', clientLang);
415
415
  summaryLine('State management', clientState);
416
416
  summaryLine('UI library', clientUi);
417
417
  summaryLine('Styling', clientStyle);
418
- summaryLine('Backend type', backendType === 'integrated' ? `${clientFw.value} integrated` : backendFw || '(skipped)');
418
+ summaryLine('Backend type', backendType === 'integrated' ? `${fwValue(clientFw)} integrated` : backendFw || '(skipped)');
419
419
  if (backendType !== 'integrated') {
420
420
  summaryLine('Backend language', backendLang);
421
421
  summaryLine('ORM', backendOrm);
@@ -494,7 +494,7 @@ const main = async () => {
494
494
 
495
495
  writeConfig(path.join(ROOT, 'client', 'CLAUDE.md'), {
496
496
  PROJECT_NAME: projectName,
497
- FRAMEWORK: clientFw.value,
497
+ FRAMEWORK: fwValue(clientFw),
498
498
  FRAMEWORK_VERSION: clientFwVersion || '',
499
499
  LANGUAGE: clientLang,
500
500
  STATE: clientState,
@@ -508,7 +508,7 @@ const main = async () => {
508
508
  const scaffoldConfig = {
509
509
  projectName,
510
510
  client: {
511
- framework: clientFw.value,
511
+ framework: fwValue(clientFw),
512
512
  frameworkVersion: clientFwVersion || '',
513
513
  language: clientLang,
514
514
  state: clientState,
@@ -574,7 +574,7 @@ const main = async () => {
574
574
  linuxPaths: ideChoice.linux?.paths || [],
575
575
  },
576
576
  client: {
577
- framework: clientFw.value,
577
+ framework: fwValue(clientFw),
578
578
  language: clientLang,
579
579
  state: clientState,
580
580
  uiLibrary: clientUi,
@@ -637,10 +637,10 @@ const main = async () => {
637
637
  // ── BUILD_STATE.md ────────────────────────────────────────────────────────────
638
638
 
639
639
  const backendDisplay = backendType === 'integrated'
640
- ? `${clientFw.value} integrated (API routes/SSR)`
640
+ ? `${fwValue(clientFw)} integrated (API routes/SSR)`
641
641
  : backendFw || 'Not configured';
642
642
 
643
- const clientStack = [clientFw.value, clientLang, clientStyle, clientUi, clientState].filter(Boolean).join(' + ');
643
+ const clientStack = [fwValue(clientFw), clientLang, clientStyle, clientUi, clientState].filter(Boolean).join(' + ');
644
644
  const backendStack = backendType === 'separate'
645
645
  ? [backendFw, backendLang, backendOrm, backendAuth].filter(Boolean).join(' + ')
646
646
  : backendDisplay;
@@ -668,7 +668,7 @@ Backend : ${backendStack}
668
668
 
669
669
  ## Backend State
670
670
  ${backendType === 'integrated'
671
- ? `Type: ${clientFw.value} integrated backend (API routes / SSR)
671
+ ? `Type: ${fwValue(clientFw)} integrated backend (API routes / SSR)
672
672
  - [ ] API routes - server-side endpoints
673
673
  - [ ] Auth - authentication strategy
674
674
  - [ ] DB - data layer if needed`
@@ -16,6 +16,8 @@ const { buildIDEOptions, verifyIDE, detectTerminal } = require('./detect');
16
16
  // Each def: { name: string, run: async (machine, answers) => value | BACK | RESTART }
17
17
  // Conditional steps return their skip-value immediately when not applicable.
18
18
 
19
+ const fwValue = (fw) => fw && typeof fw === 'object' ? fw.value : (typeof fw === 'string' && fw.length > 0 ? fw : '__custom__');
20
+
19
21
  const buildStepDefs = (IDE_CANDIDATES) => [
20
22
 
21
23
  // ── Step 0: Client framework ────────────────────────────────────────────────
@@ -34,7 +36,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
34
36
  run: async (machine, answers) => {
35
37
  stepHeader(2, 12);
36
38
  const fw = answers.clientFw;
37
- const versions = await fetchLatestVersions(fw.value) || FRAMEWORK_VERSION_FALLBACK[fw.value] || [];
39
+ const versions = await fetchLatestVersions(fwValue(fw)) || FRAMEWORK_VERSION_FALLBACK[fwValue(fw)] || [];
38
40
  if (!versions.length) return null; // skip silently
39
41
 
40
42
  console.log(dim(' Fetching latest versions...'));
@@ -42,7 +44,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
42
44
  label: i === 0 ? `v${v} ${dim('(latest)')}` : `v${v}`,
43
45
  value: v,
44
46
  }));
45
- const label = fw.value === 'Vite+React' ? '* Vite version:' : `* ${fw.value} version:`;
47
+ const label = fwValue(fw) === 'Vite+React' ? '* Vite version:' : `* ${fwValue(fw)} version:`;
46
48
  const navOpts = machine.navOptions(1, false);
47
49
  const idx = await arrowSelect(label, [
48
50
  ...versionChoices,
@@ -60,7 +62,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
60
62
  name: 'clientState',
61
63
  run: async (machine, answers) => {
62
64
  stepHeader(3, 12);
63
- const opts = STATE_OPTIONS[answers.clientFw.value] || [];
65
+ const opts = STATE_OPTIONS[fwValue(answers.clientFw)] || [];
64
66
  return await selectOptional('State management:', opts, machine, 2, answers, BLOCKS.CLIENT);
65
67
  },
66
68
  },
@@ -70,7 +72,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
70
72
  name: 'clientUi',
71
73
  run: async (machine, answers) => {
72
74
  stepHeader(4, 12);
73
- const opts = UI_OPTIONS[answers.clientFw.value] || [];
75
+ const opts = UI_OPTIONS[fwValue(answers.clientFw)] || [];
74
76
  return await selectOptional('UI library:', opts, machine, 3, answers, BLOCKS.CLIENT);
75
77
  },
76
78
  },
@@ -90,13 +92,13 @@ const buildStepDefs = (IDE_CANDIDATES) => [
90
92
  run: async (machine, answers) => {
91
93
  stepHeader(6, 12);
92
94
  const fw = answers.clientFw;
93
- if (!fw.integratedBackend) return false; // skip — not applicable
95
+ if (!fw || !fw.integratedBackend) return false; // skip — not applicable
94
96
 
95
97
  separator();
96
98
  console.log(`\n${bold(blue('Backend configuration'))}`);
97
- console.log(dim(` ${fw.value} supports server-side rendering and API routes.\n`));
98
- const confirmed = await arrowConfirm(`Use integrated backend (${fw.value} API routes/SSR) instead of a separate backend?`);
99
- if (confirmed) console.log(dim(`\n Using ${fw.value} integrated backend. No separate backend needed.\n`));
99
+ console.log(dim(` ${fwValue(fw)} supports server-side rendering and API routes.\n`));
100
+ const confirmed = await arrowConfirm(`Use integrated backend (${fwValue(fw)} API routes/SSR) instead of a separate backend?`);
101
+ if (confirmed) console.log(dim(`\n Using ${fwValue(fw)} integrated backend. No separate backend needed.\n`));
100
102
  return confirmed;
101
103
  },
102
104
  },
@@ -133,7 +135,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
133
135
  const fwObj = answers.backendFwObj;
134
136
  if (!fwObj) return null; // skip — no backend selected
135
137
 
136
- const versions = await fetchLatestVersions(fwObj.value) || FRAMEWORK_VERSION_FALLBACK[fwObj.value] || [];
138
+ const versions = await fetchLatestVersions(fwValue(fwObj)) || FRAMEWORK_VERSION_FALLBACK[fwValue(fwObj)] || [];
137
139
  if (!versions.length) return null;
138
140
 
139
141
  const vChoices = versions.map((v, i) => ({
@@ -141,7 +143,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
141
143
  value: v,
142
144
  }));
143
145
  const navOpts = machine.navOptions(7, false);
144
- const idx = await arrowSelect(`* ${fwObj.value} version:`, [
146
+ const idx = await arrowSelect(`* ${fwValue(fwObj)} version:`, [
145
147
  ...vChoices,
146
148
  ...navOpts.map(n => ({ label: n.label })),
147
149
  ]);
@@ -170,7 +172,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
170
172
  const { backendFwObj, backendDb } = answers;
171
173
  if (!backendFwObj || !backendDb) return null;
172
174
  const byDb = ORM_OPTIONS_BY_DB[backendDb] || [];
173
- const byFw = ORM_OPTIONS[backendFwObj.value] || [];
175
+ const byFw = ORM_OPTIONS[fwValue(backendFwObj)] || [];
174
176
  const ormChoices = byDb.length && byFw.length ? byDb.filter(o => byFw.includes(o)) : byDb.length ? byDb : byFw;
175
177
  return await selectOptional('ORM / query layer:', ormChoices, machine, 9, answers, BLOCKS.BACKEND);
176
178
  },
@@ -183,7 +185,7 @@ const buildStepDefs = (IDE_CANDIDATES) => [
183
185
  stepHeader(11, 12);
184
186
  const { backendFwObj } = answers;
185
187
  if (!backendFwObj) return null;
186
- return await selectOptional('Auth strategy:', AUTH_OPTIONS[backendFwObj.value] || [], machine, 10, answers, BLOCKS.BACKEND);
188
+ return await selectOptional('Auth strategy:', AUTH_OPTIONS[fwValue(backendFwObj)] || [], machine, 10, answers, BLOCKS.BACKEND);
187
189
  },
188
190
  },
189
191
 
@@ -238,4 +240,4 @@ const buildStepDefs = (IDE_CANDIDATES) => [
238
240
 
239
241
  // ── Exports ───────────────────────────────────────────────────────────────────
240
242
 
241
- module.exports = { buildStepDefs };
243
+ module.exports = { buildStepDefs, fwValue };
package/lib/ui.js CHANGED
@@ -131,7 +131,7 @@ const NONE_LABEL = '→ None of these - I\'ll specify my own';
131
131
  const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, isOptional, block = null) => {
132
132
  let typed = '';
133
133
  while (!typed) {
134
- const _res = await prompts({ type: 'text', name: 'value', message: block ? `Type a ${block} framework:` : 'Type your own value:' }, { onCancel: () => process.exit(0) });
134
+ const _res = await prompts({ type: 'text', name: 'value', message: prompt.replace(':', '').replace('*', '').trim() + ':' }, { onCancel: () => process.exit(0) });
135
135
  typed = (_res.value || '').trim();
136
136
  if (!typed && isOptional) return null;
137
137
  if (!typed) console.log(dim(' Please enter a value.'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.77",
3
+ "version": "1.1.78",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",