Files
windmill/system_prompts/auto-generated/index.ts
caddc3f4ad feat: let AI harnesses solve tasks with code, then save and reuse it (#12472)
* feat: let AI harnesses solve tasks with code, then save and reuse it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* fix: page code mode searches locally and name the job in the chat's run result

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* chore: point the EE ref at the code_mode feature usage registration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* fix: follow the search cursor and match words in any script

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* fix: count only test_run_code runs and save only their previews

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* refactor: drop save_preview and keep code mode programs with write_script

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* docs: trim code mode guidance and cover it with ai_evals cases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* fix: show the staged name of drafts found by a list_workspace_items search

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvufUfjaH7aRMxVWTue

* chore: update ee-repo-ref to 6e6a9f3ed1e3023da46dc6f6af8f465abb5da001

This commit updates the EE repository reference after PR #988 was merged in windmill-ee-private.

Previous ee-repo-ref: 82008bd50305789174eb50ed06d9c12b25b74d9e

New ee-repo-ref: 6e6a9f3ed1e3023da46dc6f6af8f465abb5da001

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-11-17 11:01:37 +01:00

156 lines
4.5 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'];
// Languages that use the TypeScript Workflow-as-Code SDK
const WAC_TS_SDK_LANGUAGES = ['bun'];
// Languages that use the Python Workflow-as-Code SDK
const WAC_PY_SDK_LANGUAGES = PY_SDK_LANGUAGES;
// 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 for resource & variable authoring
export function getResourcePrompt(): string {
return [
prompts.RESOURCES_BASE
].filter(Boolean).join('\n\n');
}
// Helper for AI agent authoring
export function getAgentPrompt(): string {
return [
prompts.AGENT_BASE
].filter(Boolean).join('\n\n');
}
// Helper for raw app authoring (chat consumers). Inline backend runnables are
// ordinary Windmill jobs, so the reference has to carry the SDK the runnable
// calls — without it an agent invents client functions and hand-rolls HTTP.
// Only one SDK is returned: both would double an already large tool result.
export function getRawAppPrompt(language?: string): string {
const sdkPrompt = PY_SDK_LANGUAGES.includes(language ?? '')
? prompts.SDK_PYTHON
: prompts.SDK_TYPESCRIPT;
return [
prompts.RAW_APP_BASE,
sdkPrompt
].filter(Boolean).join('\n\n');
}
// Helper for data pipeline authoring (chat consumers)
export function getPipelinePrompt(): string {
return [
prompts.PIPELINE_BASE
].filter(Boolean).join('\n\n');
}
// Helper for rich results: tables, charts and the other shapes a return value renders as
export function getDisplayPrompt(): string {
return [
prompts.DISPLAY_RESULTS_BASE,
prompts.DISPLAY_CATALOG
].filter(Boolean).join('\n\n');
}
// Helper for answering a task with code run as a preview, then saved and reused
export function getCodeModePrompt(): string {
return [
prompts.CODE_MODE_BASE
].filter(Boolean).join('\n\n');
}
// Helper for data table schema changes, migrations and permissions (chat consumers)
export function getDatatablePrompt(): string {
return [
prompts.DATATABLE_BASE
].filter(Boolean).join('\n\n');
}
// Helper for the workspace settings document (chat consumers)
export function getWorkspaceSettingsPrompt(): string {
return [
prompts.WORKSPACE_SETTINGS_BASE
].filter(Boolean).join('\n\n');
}
// Helper to get the datatable SQL SDK reference (wmill.datatable()).
// Pass a language to get only that SDK; omit it to get both.
export function getDatatableSdkReference(language?: string): string {
if (language == null) {
return [
prompts.DATATABLE_SDK_TYPESCRIPT,
prompts.DATATABLE_SDK_PYTHON
].filter(Boolean).join('\n\n');
}
if (TS_SDK_LANGUAGES.includes(language)) {
return prompts.DATATABLE_SDK_TYPESCRIPT;
}
if (PY_SDK_LANGUAGES.includes(language)) {
return prompts.DATATABLE_SDK_PYTHON;
}
// Unknown language: return both rather than nothing.
return [
prompts.DATATABLE_SDK_TYPESCRIPT,
prompts.DATATABLE_SDK_PYTHON
].filter(Boolean).join('\n\n');
}
// Helper to combine prompts for Workflow-as-Code scripts
export function getWorkflowAsCodePrompt(language?: string): string {
let sdkPrompt = '';
if (language == null) {
sdkPrompt = [
prompts.WAC_SDK_TYPESCRIPT,
prompts.WAC_SDK_PYTHON
].filter(Boolean).join('\n\n');
} else if (WAC_TS_SDK_LANGUAGES.includes(language)) {
sdkPrompt = prompts.WAC_SDK_TYPESCRIPT;
} else if (WAC_PY_SDK_LANGUAGES.includes(language)) {
sdkPrompt = prompts.WAC_SDK_PYTHON;
} else {
return '';
}
return [
prompts.WORKFLOW_AS_CODE_BASE,
sdkPrompt
].filter(Boolean).join('\n\n');
}