Files
paseo/packages/app/src/utils/provider-command-templates.ts
T
Mohamed Boudra 223c8d7d0b feat: sortable workspace tabs, tab context menus, and terminal auto-create removal
- Add drag-and-drop tab reordering with persistent tab order
- Add right-click context menu with copy agent ID, copy resume command, close to right
- Switch workspace route encoding from percent-encoding to base64url
- Remove terminal auto-creation on directory listing (explicit create only)
- Add swipe gestures on terminal emulator for mobile sidebar navigation
- Highlight active workspace row in sidebar
2026-03-02 15:59:13 +07:00

41 lines
963 B
TypeScript

export type ProviderCommandId = "resume";
/**
* Declarative command templates for provider-native CLIs.
*
* Note: these are NOT Paseo agent IDs. They take provider-native session IDs.
* Example placeholders:
* - {sessionId}
*/
export const PROVIDER_COMMAND_TEMPLATES: Record<
string,
Partial<Record<ProviderCommandId, string>>
> = {
codex: {
resume: "codex resume {sessionId}",
},
claude: {
resume: "claude --resume {sessionId}",
},
};
function renderTemplate(
template: string,
vars: Record<string, string>
): string {
return template.replace(/\{(\w+)\}/g, (_match, key: string) => vars[key] ?? "");
}
export function buildProviderCommand(input: {
provider: string;
id: ProviderCommandId;
sessionId: string;
}): string | null {
const template = PROVIDER_COMMAND_TEMPLATES[input.provider]?.[input.id] ?? null;
if (!template) {
return null;
}
return renderTemplate(template, { sessionId: input.sessionId });
}