Inline base64 source maps had been checked into tracked src files. This strips those comments from the repository without changing runtime behavior or adding ongoing guardrails, per the requested one-time cleanup scope. Constraint: Keep this change limited to tracked source cleanup only Rejected: Add CI/source verification guard | user requested one-time cleanup only Confidence: high Scope-risk: narrow Reversibility: clean Directive: If these directives reappear, fix the producing transform instead of reintroducing repo-side cleanup code Tested: rg -n "sourceMappingURL" ., bun run smoke, bun run verify:privacy, bun run test:provider, npm run test:provider-recommendation Not-tested: bun run typecheck (repository has many pre-existing unrelated failures) Co-authored-by: anandh8x <test@example.com>
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { feature } from 'bun:bundle';
|
|
import { spawnSync } from 'child_process';
|
|
import sample from 'lodash-es/sample.js';
|
|
import * as React from 'react';
|
|
import { ExitFlow } from '../../components/ExitFlow.js';
|
|
import type { LocalJSXCommandOnDone } from '../../types/command.js';
|
|
import { isBgSession } from '../../utils/concurrentSessions.js';
|
|
import { gracefulShutdown } from '../../utils/gracefulShutdown.js';
|
|
import { getCurrentWorktreeSession } from '../../utils/worktree.js';
|
|
const GOODBYE_MESSAGES = ['Goodbye!', 'See ya!', 'Bye!', 'Catch you later!'];
|
|
function getRandomGoodbyeMessage(): string {
|
|
return sample(GOODBYE_MESSAGES) ?? 'Goodbye!';
|
|
}
|
|
export async function call(onDone: LocalJSXCommandOnDone): Promise<React.ReactNode> {
|
|
// Inside a `claude --bg` tmux session: detach instead of kill. The REPL
|
|
// keeps running; `claude attach` can reconnect. Covers /exit, /quit,
|
|
// ctrl+c, ctrl+d — all funnel through here via REPL's handleExit.
|
|
if (feature('BG_SESSIONS') && isBgSession()) {
|
|
onDone();
|
|
spawnSync('tmux', ['detach-client'], {
|
|
stdio: 'ignore'
|
|
});
|
|
return null;
|
|
}
|
|
const showWorktree = getCurrentWorktreeSession() !== null;
|
|
if (showWorktree) {
|
|
return <ExitFlow showWorktree={showWorktree} onDone={onDone} onCancel={() => onDone()} />;
|
|
}
|
|
onDone(getRandomGoodbyeMessage());
|
|
await gracefulShutdown(0, 'prompt_input_exit');
|
|
return null;
|
|
}
|