The app mode AI chat system prompt had hand-written datatable API docs that were missing methods (fetchOneScalar, execute, query). This adds datatable-specific extraction to generate.py so the prompt stays in sync with the actual TypeScript and Python client APIs. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
// Auto-generated by generate.py - DO NOT EDIT
|
|
// Re-export all prompts
|
|
export * from './prompts';
|
|
|
|
import * as prompts from './prompts';
|
|
|
|
// Languages that use the TypeScript SDK
|
|
const TS_SDK_LANGUAGES = ['bun', 'deno', 'nativets', 'bunnative'];
|
|
|
|
// Languages that use the Python SDK
|
|
const PY_SDK_LANGUAGES = ['python3'];
|
|
|
|
// Helper to combine prompts for scripts
|
|
export function getScriptPrompt(language: string): string {
|
|
const langKey = `LANG_${language.toUpperCase()}` as keyof typeof prompts;
|
|
const langPrompt = (prompts as Record<string, string>)[langKey] || '';
|
|
|
|
// Determine which SDK to include based on language
|
|
let sdkPrompt = '';
|
|
if (TS_SDK_LANGUAGES.includes(language)) {
|
|
sdkPrompt = prompts.SDK_TYPESCRIPT;
|
|
} else if (PY_SDK_LANGUAGES.includes(language)) {
|
|
sdkPrompt = prompts.SDK_PYTHON;
|
|
}
|
|
|
|
return [
|
|
prompts.SCRIPT_BASE,
|
|
langPrompt,
|
|
sdkPrompt
|
|
].filter(Boolean).join('\n\n');
|
|
}
|
|
|
|
// Helper to combine prompts for flows
|
|
export function getFlowPrompt(): string {
|
|
return [
|
|
prompts.FLOW_BASE,
|
|
prompts.OPENFLOW_SCHEMA
|
|
].filter(Boolean).join('\n\n');
|
|
}
|
|
|
|
// Helper to get datatable SDK reference for app mode
|
|
export function getDatatableSdkReference(): string {
|
|
return [
|
|
prompts.DATATABLE_SDK_TYPESCRIPT,
|
|
prompts.DATATABLE_SDK_PYTHON
|
|
].filter(Boolean).join('\n\n');
|
|
}
|