@beunec/rivine 0.1.3 → 0.1.4

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/ui/App.js CHANGED
@@ -459,13 +459,14 @@ export function App({ cwd, initialMode, askForMode, oneShot }) {
459
459
  push(answer.approved ? 'system' : 'notice', answer.approved ? 'Approved.' : 'Declined.');
460
460
  resolve?.(answer);
461
461
  }, [push]);
462
+ const staticItems = useMemo(() => [{ kind: 'banner' }, ...lines.map((line) => ({ kind: 'line', line }))], [lines]);
462
463
  if (phase === 'fatal') {
463
464
  return (_jsx(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: _jsx(Text, { color: color('danger'), children: fatal }) }));
464
465
  }
465
466
  const compactBanner = terminalWidth() < WORDMARK_MIN_COLUMNS || Boolean(oneShot);
466
467
  const matches = completionsFor(input);
467
468
  const busy = phase !== 'ready';
468
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: [{ id: 'banner' }], children: (item) => _jsx(Banner, { compact: compactBanner }, item.id) }), _jsx(Static, { items: lines, children: (line) => _jsx(TranscriptLine, { line: line }, line.id) }), live ? (_jsx(Box, { paddingX: 1, children: _jsx(Text, { color: color('text'), children: live }) })) : null, shellView ? _jsx(ShellPane, { text: shellView, live: shellActive }) : null, phase === 'running' && stage ? _jsx(Activity, { stage: stage, tool: tool }) : null, phase === 'mode' ? _jsx(ModePicker, { onPick: pickMode }) : null, phase === 'approval' && approval ? (_jsx(ApprovalPrompt, { approval: approval, allowAlways: isBatchable(approval.category), onChoice: answerApproval })) : null, phase === 'question' && question ? (question.options?.length ? (_jsx(ChoicePrompt, { prompt: question.prompt, options: question.options, onPick: answerQuestion })) : (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [_jsx(Text, { color: color('accent'), bold: true, children: question.prompt }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: color('user'), children: '› ' }), _jsx(TextInput, { placeholder: "your answer", onSubmit: answerQuestion })] })] }))) : null, phase === 'hitl' && hitl ? (_jsx(ChoicePrompt, { prompt: hitl.tool ? `${hitl.tool} — ${hitl.message}` : hitl.message, options: hitl.options?.length ? hitl.options : ['Approve', 'Decline'], onPick: (value) => answerHitl(hitl.options?.length
469
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: staticItems, children: (item) => item.kind === 'banner' ? (_jsx(Banner, { compact: compactBanner }, "banner")) : (_jsx(TranscriptLine, { line: item.line }, item.line.id)) }), live ? (_jsx(Box, { paddingX: 1, children: _jsx(Text, { color: color('text'), children: live }) })) : null, shellView ? _jsx(ShellPane, { text: shellView, live: shellActive }) : null, phase === 'running' && stage ? _jsx(Activity, { stage: stage, tool: tool }) : null, phase === 'mode' ? _jsx(ModePicker, { onPick: pickMode }) : null, phase === 'approval' && approval ? (_jsx(ApprovalPrompt, { approval: approval, allowAlways: isBatchable(approval.category), onChoice: answerApproval })) : null, phase === 'question' && question ? (question.options?.length ? (_jsx(ChoicePrompt, { prompt: question.prompt, options: question.options, onPick: answerQuestion })) : (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [_jsx(Text, { color: color('accent'), bold: true, children: question.prompt }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: color('user'), children: '› ' }), _jsx(TextInput, { placeholder: "your answer", onSubmit: answerQuestion })] })] }))) : null, phase === 'hitl' && hitl ? (_jsx(ChoicePrompt, { prompt: hitl.tool ? `${hitl.tool} — ${hitl.message}` : hitl.message, options: hitl.options?.length ? hitl.options : ['Approve', 'Decline'], onPick: (value) => answerHitl(hitl.options?.length
469
470
  ? { approved: true, feedback: value }
470
471
  : { approved: value === 'Approve' }) })) : null, showHelp && phase === 'ready' ? _jsx(HelpPanel, {}) : null, phase === 'ready' && !oneShot ? (_jsxs(_Fragment, { children: [_jsxs(Box, { paddingX: 1, children: [_jsx(Text, { color: color('user'), children: '› ' }), _jsx(TextInput, { placeholder: "What should Rivine build?", onChange: setInput, onSubmit: (value) => void submit(value) })] }), _jsx(Completions, { matches: matches })] })) : null, phase === 'starting' ? _jsx(Activity, { stage: "Starting\u2026", tool: "" }) : null, _jsx(StatusBar, { info: {
471
472
  mode,
@@ -107,5 +107,5 @@ export function StatusBar({ info }) {
107
107
  const width = terminalWidth();
108
108
  const narrow = width < 76;
109
109
  const dot = info.busy ? color('warn') : color('success');
110
- return (_jsxs(Box, { paddingX: 1, children: [_jsxs(Text, { color: dot, children: [BOX.dot, " "] }), _jsx(Text, { color: color('muted'), children: describeMode(info.mode) }), info.project ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsx(Text, { color: color('muted'), children: fit(info.project, 18, true) })] })) : null, !narrow && info.cloudhandle ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsx(Text, { color: color('brand'), children: fit(info.cloudhandle, 22) }), info.bcidMasked ? _jsx(Text, { color: color('faint'), children: ` ${info.bcidMasked}` }) : null] })) : null, info.balance !== null ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsxs(Text, { color: info.balance < 10 ? color('warn') : color('muted'), children: ["$", info.balance.toFixed(2)] })] })) : null, !narrow ? _jsx(Text, { color: color('faint'), children: ' /help' }) : null] }));
110
+ return (_jsxs(Box, { paddingX: 1, children: [_jsxs(Text, { color: dot, children: [BOX.dot, " "] }), !narrow ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('brand'), bold: true, children: "Rivine" }), _jsx(Text, { color: color('faint'), children: " \u00B7 " })] })) : null, _jsx(Text, { color: color('muted'), children: describeMode(info.mode) }), info.project ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsx(Text, { color: color('muted'), children: fit(info.project, 18, true) })] })) : null, !narrow && info.cloudhandle ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsx(Text, { color: color('brand'), children: fit(info.cloudhandle, 22) }), info.bcidMasked ? _jsx(Text, { color: color('faint'), children: ` ${info.bcidMasked}` }) : null] })) : null, info.balance !== null ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: color('faint'), children: " \u00B7 " }), _jsxs(Text, { color: info.balance < 10 ? color('warn') : color('muted'), children: ["$", info.balance.toFixed(2)] })] })) : null, !narrow ? _jsx(Text, { color: color('faint'), children: ' /help' }) : null] }));
111
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beunec/rivine",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Rivine Code in your terminal — Beunec's software engineering runtime constructs, working on the files you already have open.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Beunec Technologies",