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.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { Text } from '../../ink.js';
|
|
import type { Tools } from '../../Tool.js';
|
|
import { findToolByName } from '../../Tool.js';
|
|
import type { ToolActivity } from '../../tasks/LocalAgentTask/LocalAgentTask.js';
|
|
import type { ThemeName } from '../../utils/theme.js';
|
|
export function renderToolActivity(activity: ToolActivity, tools: Tools, theme: ThemeName): React.ReactNode {
|
|
const tool = findToolByName(tools, activity.toolName);
|
|
if (!tool) {
|
|
return activity.toolName;
|
|
}
|
|
try {
|
|
const parsed = tool.inputSchema.safeParse(activity.input);
|
|
const parsedInput = parsed.success ? parsed.data : {};
|
|
const userFacingName = tool.userFacingName(parsedInput);
|
|
if (!userFacingName) {
|
|
return activity.toolName;
|
|
}
|
|
const toolArgs = tool.renderToolUseMessage(parsedInput, {
|
|
theme,
|
|
verbose: false
|
|
});
|
|
if (toolArgs) {
|
|
return <Text>
|
|
{userFacingName}({toolArgs})
|
|
</Text>;
|
|
}
|
|
return userFacingName;
|
|
} catch {
|
|
return activity.toolName;
|
|
}
|
|
}
|