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>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import React from 'react';
|
|
import { MessageResponse } from '../../components/MessageResponse.js';
|
|
import { Text } from '../../ink.js';
|
|
import { truncate } from '../../utils/format.js';
|
|
import type { CreateOutput } from './CronCreateTool.js';
|
|
import type { DeleteOutput } from './CronDeleteTool.js';
|
|
import type { ListOutput } from './CronListTool.js';
|
|
|
|
// --- CronCreate -------------------------------------------------------------
|
|
|
|
export function renderCreateToolUseMessage(input: Partial<{
|
|
cron: string;
|
|
prompt: string;
|
|
}>): React.ReactNode {
|
|
return `${input.cron ?? ''}${input.prompt ? `: ${truncate(input.prompt, 60, true)}` : ''}`;
|
|
}
|
|
export function renderCreateResultMessage(output: CreateOutput): React.ReactNode {
|
|
return <MessageResponse>
|
|
<Text>
|
|
Scheduled <Text bold>{output.id}</Text>{' '}
|
|
<Text dimColor>({output.humanSchedule})</Text>
|
|
</Text>
|
|
</MessageResponse>;
|
|
}
|
|
|
|
// --- CronDelete -------------------------------------------------------------
|
|
|
|
export function renderDeleteToolUseMessage(input: Partial<{
|
|
id: string;
|
|
}>): React.ReactNode {
|
|
return input.id ?? '';
|
|
}
|
|
export function renderDeleteResultMessage(output: DeleteOutput): React.ReactNode {
|
|
return <MessageResponse>
|
|
<Text>
|
|
Cancelled <Text bold>{output.id}</Text>
|
|
</Text>
|
|
</MessageResponse>;
|
|
}
|
|
|
|
// --- CronList ---------------------------------------------------------------
|
|
|
|
export function renderListToolUseMessage(): React.ReactNode {
|
|
return '';
|
|
}
|
|
export function renderListResultMessage(output: ListOutput): React.ReactNode {
|
|
if (output.jobs.length === 0) {
|
|
return <MessageResponse>
|
|
<Text dimColor>No scheduled jobs</Text>
|
|
</MessageResponse>;
|
|
}
|
|
return <MessageResponse>
|
|
{output.jobs.map(j => <Text key={j.id}>
|
|
<Text bold>{j.id}</Text> <Text dimColor>{j.humanSchedule}</Text>
|
|
</Text>)}
|
|
</MessageResponse>;
|
|
}
|
|
|
|
// --- Shared -----------------------------------------------------------------
|