Add strings_pull and strings_push tools#47
Draft
Stefan Bruhns (sbruhns) wants to merge 2 commits intomainfrom
Draft
Add strings_pull and strings_push tools#47Stefan Bruhns (sbruhns) wants to merge 2 commits intomainfrom
Stefan Bruhns (sbruhns) wants to merge 2 commits intomainfrom
Conversation
8b95619 to
4d07058
Compare
Member
|
Stefan Bruhns (@sbruhns) since you introduced replay tests with this change, I suggest adding some documentation how to re-generate those in the README. |
| throw new Error("Download timed out after polling"); | ||
| } | ||
|
|
||
| export function registerPullTool(server: McpServer, runtime: ProductRuntime<"strings">) { |
There was a problem hiding this comment.
This basically emulates the CLI pull command? It probably works for really basic configs but there are a lot more options that are not supported and we'd need to fully reimplement the target parsing if it should be compatible with the config
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
strings_pulltool: downloads locale files based onphrase.ymlpull targets, supports<locale_name>/<locale_code>placeholders, tag filtering, and branch downloads (automatically resolves branch project ID viabranchShow— the Phrase API requires the branch's own project ID for locale downloads)strings_pushtool: uploads locale files fromphrase.ymlpush sources with glob expansion (including**), locale extraction from path patterns, tag tagging, and async upload pollingphrase_config.tsfor config parsing, placeholder substitution, and glob-to-regex conversionBranchesApitoStringsClient(needed for branch project ID resolution in pull)mcp-pull-push-testPhrase project — run in replay mode with no network or token requiredTest plan
npm test— all tests pass in replay modePOLLY_MODE=record PHRASE_STRINGS_TOKEN=<token> npm test -- src/products/strings/tools/pull.test.tsthen...push.test.ts(run files separately to avoid rate limiting)strings_pullvia MCP: point at a realphrase.ymland confirm locale files are written to diskstrings_pushvia MCP: push locale files and confirm uploads appear in Phrase Strings🤖 Generated with Claude Code