{{ message }}
Repository navigation
Import the Translation Agent as private apps/server and apps/console workspace apps - #55
Open
diogoascarneiro wants to merge 7 commits into
Open
diogoascarneiro wants to merge 7 commits into
diogoascarneiro wants to merge 7 commits into
Conversation
…date documentation links
…ate documentation
Contributor
Contributor
Scope checkThis PR changes 14,188 lines across 82 files. PolyStella is maintained by a small team, so smaller focused PRs are more likely to be reviewed. If this scope is intentional, no action is required. |
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
polystella-docs | 74590e5 | Commit Preview URL Branch Preview URL |
Sep 29 2026, 04:24 PM |
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
This adds the Translation Agent to the monorepo as two private workspace apps. It's the first step toward running the Agent on
@cloudflare/polystella-core.apps/server(polystella-server): the Agent's Hono API Worker. This covers/api/translate, the model adapters, streaming, the content guardrail, and the evaluation scripts.apps/console(polystella-console): the Agent's existing React translation UI and its static-assets Worker. It talks to the server only over HTTP; neither app depends on the other in the workspace.No published package changes. The changeset is empty.
The code comes from the old repo at
0757e8f, moved without changes except where noted below. The old repo stays authoritative for production and language resources. This port runs in isolation until parity is confirmed, and it is not deployed.What changed
Apps
api/becomesapps/server/, includingdocs/openapi.yamlandNOTICE. Itsui/becomesapps/console/.package.jsonis split between the two apps by dependency. Tests moved toapps/server/vitest.config.ts; the console'svite.config.tsis build and dev only.apps/console/styles.css, the Kumo@sourcepath changed from../node_modules/…to./node_modules/….-local, withworkers_dev: falseandpreview_urls: false.apps/server/README.mdmaps old-repo paths to port paths so upstream changes can be replayed while the port runs in isolation.Language resources now come from PolyStella glossaries
apps/server/scripts/load-glossaries.tsruns Core's glossary loader (@cloudflare/polystella-core/cli/glossary) beforedevandbuild. It writes the gitignoredsrc/generated/glossaries.json, which is bundled into the Worker. Two variables control it:GLOSSARY_SOURCE: JSON in Core'sglossaryconfig shape (file,http, orr2). If unset, the loader writes{}.GLOSSARY_LOCALES: optional. Defaults to every supported locale plusdefault. Required forhttpandr2, because those sources fail on a missing locale.prompt-utils.tsbuilds the prompt from the target locale's glossary:preferredTranslations. The Agent's;alias syntax in keys is still supported.doNotTranslate.styleRulesandnotes.defaultglossary.src/terminology.ts,locales/utils.ts, and thenode:fsreadFileSyncstyle-guide lookup (which couldn't run on Workerd).workspace:*). The Worker imports only theGlossarytype.vitest.config.tsreplaces the generated file with{}.prompt-utils.test.tsinstalls synthetic glossaries.Workspace and CI
test:apps,typecheck:apps,build:apps,dev:apps.testandtypechecknow include the apps.pnpm test:appsandpnpm build:apps.build:appsis a Wrangler dry run with no deploy.braintrusttoallowBuilds.AGENTS.mdcommand table and added a "Modify the hosted Translation Agent" row.Security overrides (
pnpm audit:prodwas failing)fast-urigoes from 3.1.6 to 3.1.7 (GHSA-qw65-cvwx-89v3, GHSA-58mr-gqgx-xq4g; reached throughbraintrust > ajv).undicigoes from 8.10.0 to 8.10.2 (GHSA-3wwx-pv8p-q78v; reached throughastro > unifontin the docs site).Behaviour differences from the old repo
GLOSSARY_SOURCE) instead of the bundledterminology.ts,locales/utils.ts, andlanguage-guide-new/*.md. With no source set, prompts have no terminology, do-not-translate list, or style guide.styleRules(one### <category>section each) andnotes, instead of the.mdfile verbatim. The text is the same, but headings become the converted category names.defaultfallback, instead of one global list. A converted glossary repeats the global list in each locale, so the output is the same.meta.styleGuideSourceand thestyle_guide_sourcespan field readglossary:<locale>orglossary:defaultinstead of<locale>.mdordefault.md.POST /api/translaterequest fields, response shape,meta[locale].model, limits) is unchanged.Testing
pnpm test: all suites pass (server: 249 passed, 4 skipped; 4 new style-guide and fallback tests)pnpm typecheck, with an empty glossary file and with 19 real glossaries loadedpnpm build:appspnpm check:packagespnpm format:checkpnpm audit:prod: no known vulnerabilitiestest:appsandtypecheck:appspassfilesource writes 19 glossaries, and the prompt picks up terminology, do-not-translate terms, andglossary:<locale>orglossary:defaultstyle guideswrangler deploy --dry-runwrangler devsmoke test: not run. TheAIbinding always uses remote Workers AI, so it needs Cloudflare auth and incurs inference charges.