feat(workflows): add JSON file download/upload for workflow transfer#59
Open
rafal-fryc wants to merge 1 commit into
Open
feat(workflows): add JSON file download/upload for workflow transfer#59rafal-fryc wants to merge 1 commit into
rafal-fryc wants to merge 1 commit into
Conversation
Lets users export a workflow as a .mikeworkflow.json envelope and import one on another instance. Round-trips title, type, practice, prompt_md, and columns_config. Upload reuses the existing POST /workflows endpoint via createWorkflow, so no backend, schema, or Supabase config changes are required. - New: frontend/src/app/lib/workflowFile.ts Envelope schema (format "mike.workflow", version 1), download helper, and a strict parser that rejects malformed files. - New: frontend/src/app/components/workflows/UploadWorkflowButton.tsx File picker that parses the envelope, creates a workflow under the current user, and surfaces validation errors inline. - Modified: frontend/src/app/components/workflows/WorkflowList.tsx Mounts the Upload button next to "+ New" and adds a per-row Download icon. Trailing actions column widened from w-8 to w-16. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dshamir
added a commit
to Dshamir/AI-Legal
that referenced
this pull request
May 24, 2026
- Wire up monthly credit checking and incrementing for both chat streaming routes. Credits checked before LLM call (429 if exceeded), incremented after successful response. Auto-resets when past reset date. Limit via MONTHLY_CREDIT_LIMIT env var (PR willchen96#157). - Add GET /workflows/:id/export (.mikeworkflow.json download) and POST /workflows/import endpoints for portable workflow transfer between environments (PR willchen96#59). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dshamir
added a commit
to Dshamir/AI-Legal
that referenced
this pull request
May 24, 2026
…tegration - CHANGELOG: add security hardening and feature entries for PRs willchen96#158, willchen96#81, willchen96#76, willchen96#79, willchen96#145, willchen96#112, willchen96#111, willchen96#110, willchen96#155, willchen96#157, willchen96#59 - ROADMAP: mark 12 new items as completed - CLAUDE.md: add sanitize.ts, streamTimeout.ts, credits.ts to lib index, update test count to 40 - README: update API endpoints table (chat pagination, workflow export), security row (HKDF, RLS, prompt defense), encryption row Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a way to move a workflow between Mike instances by exporting it as a
.mikeworkflow.jsonfile and importing it elsewhere — useful for sharing built/customised workflows across teams, environments, or organisations without needing a shared account./workflowsgets a small download icon that serialises the workflow to a JSON envelope (format: "mike.workflow",version: 1) withtitle,type,practice,prompt_md, andcolumns_config.POST /workflowsendpoint viacreateWorkflow. Email sharing is untouched.Files
frontend/src/app/lib/workflowFile.ts— envelope builder, download helper, strict parser with typed errors.frontend/src/app/components/workflows/UploadWorkflowButton.tsx— file-picker button that creates a workflow from a parsed envelope and shows inline errors.frontend/src/app/components/workflows/WorkflowList.tsx— mounts the upload button next to+ New, adds a per-row download icon, widens the trailing actions column fromw-8tow-16.No new dependencies. All icons come from the existing
lucide-reactimport.Test plan
<title>.mikeworkflow.jsonfile downloads and the JSON containsformat: "mike.workflow",version: 1, and the expected fields.columns_configround-trips.format) → expect a clear inline error.+ New, email share modal, hide/unhide built-ins, bulk delete.🤖 Generated with Claude Code