Skip to content

Comments

Momose#1408

Open
KatoShion wants to merge 29 commits intovercel:mainfrom
momoren1919-ship-it:momose
Open

Momose#1408
KatoShion wants to merge 29 commits intovercel:mainfrom
momoren1919-ship-it:momose

Conversation

@KatoShion
Copy link

No description provided.

momoren1919-ship-it and others added 22 commits January 22, 2026 14:49
Introduces a dedicated Dify workflow chat mode at /dify, using rule_ver5.md as a system prompt. Updates API, schema, and prompt logic to support systemPromptId and disables tool usage in Dify mode. Refactors chat and input components to support custom paths and placeholders. Adds related documentation and rulebook.
Persist generated Dify DSL YAML blocks produced in Dify chat mode. The chat POST handler now detects when systemPromptId is "dify-rule-ver5", extracts the last assistant message's fenced YAML block, heuristically infers workflow name and mode, and calls saveDifyWorkflowDsl (errors are swallowed so chat flow won't fail).

Database changes: adds a new DifyWorkflowDsl table schema, a migration (0009_dify_workflow_dsl.sql), and updates the migrations journal. The queries layer includes saveDifyWorkflowDsl which computes the next version and inserts a record.

Docs: implementation guide updated to mention automatic DSL saving and how to verify entries in the DB. Note: migration must be applied (pnpm db:migrate) for DSL auto-save to work.
Introduce an AI_PROVIDER_MODE (gateway|direct) to allow using either Vercel AI Gateway (default) or direct provider API keys (OpenAI/Anthropic/Google). Add env examples and README/docs updates to document new env vars (AI_PROVIDER_MODE, OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, AI_DEFAULT_MODEL, AI_TITLE_MODEL, AI_ARTIFACT_MODEL).

Implement direct provider support in lib/ai/providers.ts: validate mode, require provider keys, map provider/model IDs to the appropriate SDKs, pick sensible defaults for utility models, and route reasoning/title/artifact model selection accordingly. Add new error handling for provider config issues via ChatSDKError and a new error surface. Update lib/errors.ts to include provider_config and a user-facing message.

Adjust tests (lib/ai/models.test.ts) to match the updated finishReason shape returned by the mock models. Also add provider SDK dependencies in package.json.
Introduce AI_DIFY_MODEL env var to allow pinning the model used for /dify DSL generation. Wire the variable through .env.example, README and implementation guide. Route and UI changes: resolve a single chat model in app/(chat)/api/chat/route.ts so reasoning/tool selection and model calls respect the pinned model; pass fixedChatModelId to Chat in app/dify/page.tsx and app/dify/chat/[id]/page.tsx and use it to initialize the current model; hide the model selector and disable model switching in components/chat.tsx and components/multimodal-input.tsx when a fixed model is set. Misc: update docs to mention the new option and adjust progress notes.
Remove the detailed "Direct mode" configuration block from README.md and replace it with a concise reference to the AI SDK and supported providers (OpenAI, Anthropic, Cohere, etc.). This simplifies the documentation by directing users to the AI SDK docs for configuring direct LLM providers instead of listing environment variable setup and optional model settings inline.
Persist extracted DSL to timestamped files under dsl/, add Zod validation logging and return a detailed bad_request error on schema failures, and include fs/path imports. Expand accepted file media types to include image/webp and image/gif. Update chat header to detect mobile via window resize (remove usehooks-ts) and track isMobile state. Refactor multimodal input to trim text, allow attachments-only sends (prevent empty submissions), always render the compact model selector (remove showModelSelector prop), and simplify memo equality. Add two generated DSL workflow YAML files under dsl/.
Introduce a Bash-based CLI for managing Dify (dify-cli.sh) along with a Japanese README and .gitignore. The CLI (≈669 lines) provides login/logout, apps/app export/import, publish/publish-info/url, logs (workflow/chat), tool create/update/get, workflow-tool parent/child discovery, bulk export, and dependency index generation; it relies only on bash, curl, and jq and stores auth tokens and CSRF in local files. .gitignore adds common local artifacts (envs, dify_* files, debug dumps). README documents setup, usage, examples, and security notes.
Introduce a Dify Console API client (lib/dify/client.ts) and related types (lib/dify/types.ts), and wire optional auto-import/publish of DSL files into the chat POST handler. Update .env.example with DIFY_CONSOLE_API_BASE, DIFY_EMAIL, DIFY_PASSWORD and DIFY_PASSWORD_BASE64, and add .dify_auth/.dify_csrf to .gitignore. The client handles login, token persistence to files, import/publish workflows, and publish-URL resolution; it is optional (getDifyClient() returns null when not configured) and failures are logged so chat processing continues uninterrupted.
Detect, validate and persist generated Dify DSLs and optionally auto-import/publish them to Dify. Route changes: import fs/path helpers, validate DSL content, save DSL to DB and local dsl/ directory, and call getDifyClient().importAndPublish() (errors are logged and won't break chat). UI changes: handle Dify publish URL and error deltas in data-stream handler and render publish/error cards in messages. Dify client: added getPathByMode and updated publish URL resolution to choose /workflow or /chat based on mode. git_cli_sample: pick correct path (workflow/chat) when printing publish URL. Docs: document new env vars, local DSL storage, auto-import behavior, and auth file handling. Added multiple DSL YAML and workflow files and new custom UI types for dify-publish-url and dify-error.
Delete the 丁寧語変換 app DSL and its associated workflow YAMLs. Removed files:
- dsl/______a06c6b45-f29c-4c30-8242-285cd6bdad4b_2026-02-05T05-52-51-939Z.yml
- dsl/workflow_a06c6b45-f29c-4c30-8242-285cd6bdad4b_2026-02-05T05-52-31-841Z.yml
- dsl/workflow_a06c6b45-f29c-4c30-8242-285cd6bdad4b_2026-02-05T05-52-33-337Z.yml
These files implemented a Japanese polite-speech (です・ます調) conversion app and its workflows; they were removed as part of repository cleanup.
Move DSL auto-import to the streamText onFinish hook and add YAML extraction/validation logic: extract YAML code blocks, validate DSL shape, infer workflow name, save to a temp file and call Dify import/publish; publish URL is emitted into the UI stream on success. Remove duplicate import logic from the earlier save path. Update docs to describe DSL validation and that import runs once in createUIMessageStream.onFinish. Add several DSL example YAML files (Kansai/Hakata/convertors). Increase guest entitlements (maxMessagesPerDay 20 -> 50). Improve Dify client: change PASSWORD_BASE64 handling to default-on (avoid plain-text errors), simplify access token/mode parsing, require and warn on missing env vars, and harden init logging and error messages.
Docs: change default DIFY_PASSWORD_BASE64 to true, add PASSWORD_BASE64 alias, and clarify behavior (default enabled, explicit false to disable, recommended true). Update flow: show published URL on success, log import errors to server console only, auto-import/save runs once in streamText onFinish (was createUIMessageStream), and remind to restart dev server after env changes. Add new DSL: びっくりマーク付与 — an advanced-chat workflow with a Python code node that appends an exclamation mark to lines that don't end with !/!/?/? while preserving blank lines and trailing newline.
@vercel
Copy link
Contributor

vercel bot commented Feb 5, 2026

@KatoShion is attempting to deploy a commit to the Esteban Team on Vercel.

A member of the Team first needs to authorize it.

momoren1919-ship-it and others added 7 commits February 5, 2026 17:16
Remove the showModelSelector prop from the chat input invocation in components/chat.tsx (selector no longer passed from this component). Also delete multiple obsolete/generated DSL app YAML files under dsl/ (various translation/chat workflow definitions) to clean up stale workflow artifacts.
Add a comprehensive Japanese architecture guide (docs/architecture-explanation.md) that explains the app components, message flow, streaming, DB schema, Dify integration, prompt/YAML handling, and error/security considerations. Also add two Dify workflow YAMLs under dsl/: a "健康情報ナレッジチャット" (health knowledge Q&A with retrieval + LLM and safety rules) and a "テキスト分析レポーター" (text analysis reporter performing intent/sentiment/keyword extraction, conditional summarization and report building). Both workflows are saved in advanced-chat mode for later deployment/inspection.
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ai-sdk/​anthropic@​3.0.35801008798100
Added@​ai-sdk/​google@​3.0.201001008798100
Added@​ai-sdk/​openai@​3.0.25991008898100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants