{"id":50425389,"url":"https://github.com/pirate/polyglot-agent","last_synced_at":"2026-05-31T10:02:55.678Z","repository":{"id":357536608,"uuid":"1237390545","full_name":"pirate/polyglot-agent","owner":"pirate","description":"🇺🇳 Auto-translate a codebase from Typescript into Python, Golang, Rust, and Ruby continusously using a Codex agent loop.","archived":false,"fork":false,"pushed_at":"2026-05-13T06:31:13.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T08:29:32.115Z","etag":null,"topics":["agent","codex","coding-agent","go","golang","js","language-translation","polyglot","python","ruby","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T06:23:25.000Z","updated_at":"2026-05-13T06:31:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pirate/polyglot-agent","commit_stats":null,"previous_names":["pirate/polyglot-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pirate/polyglot-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirate%2Fpolyglot-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirate%2Fpolyglot-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirate%2Fpolyglot-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirate%2Fpolyglot-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirate","download_url":"https://codeload.github.com/pirate/polyglot-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirate%2Fpolyglot-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33726719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","codex","coding-agent","go","golang","js","language-translation","polyglot","python","ruby","rust","typescript"],"created_at":"2026-05-31T10:02:54.554Z","updated_at":"2026-05-31T10:02:55.667Z","avatar_url":"https://github.com/pirate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# polyglot-agent\n\n`polyglot-agent` is a Codex-backed harness for keeping a TypeScript codebase mapped into Python, Go, Rust, and Ruby packages.\n\nThe tool does not translate code by itself. It builds a strict repair prompt, discovers TypeScript source files, maps them to target-language files, embeds relevant `AGENTS.md` guidance, and invokes `codex exec` to repair drift.\n\n## What It Enforces\n\n- TypeScript is the canonical source.\n- Public API shape, naming, signatures, return values, errors, defaults, async behavior, event names, and serialization semantics must match across selected languages.\n- Public callable and type names preserve the TypeScript name verbatim where the target language allows it.\n- Casing transforms are category-specific: fields, locals, config keys, fixture data, JSON/event payload values, and non-callable values use `snake_case`.\n- Existing target-language files are authoritative when they already correspond to a TypeScript source file.\n- Generated paths are candidate paths for missing files only; the agent must first prove that the target runtime owns the behavior.\n- Runtime ownership beats file symmetry. Frontend/browser, extension/service-worker, server-only, CLI/build, codegen, native platform, and other source-runtime-only TypeScript files may be intentionally unmapped in target languages that do not own that runtime.\n- Tests and examples are part of the mapping contract when they exercise target-owned behavior, not optional follow-up work.\n- Scoped runs stay scoped: unrelated validation failures should be reported, not repaired, unless they were caused by the current edits.\n\n## Install\n\nFrom a checkout:\n\n```bash\npython3 -m pip install -e .\n```\n\nOr run the local wrapper directly:\n\n```bash\nbin/polyglot-map --help\n```\n\nThe harness expects the Codex CLI to be available as `codex` unless you pass `--codex /path/to/codex`.\n\n## One-Shot Drift Repair\n\nRun against the current repository:\n\n```bash\npolyglot-map run \\\n  --source-root ./client/js \\\n  --target python=./client/python \\\n  --target go=./client/go \\\n  --package-name my_package \\\n  --languages ts,python,golang\n```\n\nInspect the exact prompt without changing files:\n\n```bash\npolyglot-map run \\\n  --dry-run \\\n  --source-root ./client/js \\\n  --target python=./client/python \\\n  --target go=./client/go \\\n  --package-name my_package \\\n  --languages ts,python,golang\n```\n\n## Watch Mode\n\nWatch TypeScript files and repair drift after changes:\n\n```bash\npolyglot-map watch \\\n  --source-root ./client/js \\\n  --target python=./client/python \\\n  --target go=./client/go \\\n  --languages ts,python,golang \\\n  --interval 2\n```\n\nAdd `--initial` to run a full repair once before watching.\n\n## Mapping Preview\n\nPrint the source-to-target manifest:\n\n```bash\npolyglot-map map \\\n  --source-root ./client/js \\\n  --target python=./client/python \\\n  --target go=./client/go \\\n  --package-name my_package \\\n  --languages ts,python,golang\n```\n\nEach target path is marked with one of:\n\n- `mapped-existing`: the generated mapped path already exists.\n- `existing-equivalent`: a target-language file with an equivalent source stem already exists, so the agent must update that file in place.\n- `generated-missing`: no equivalent file exists yet, so the generated path is a candidate creation target only if the target runtime owns that behavior.\n\nEach manifest entry also includes a `mapping_contract` and allowed mapping decisions. The invoked agent must classify the TypeScript source responsibility before editing:\n\n- `implement-in-target`: target runtime owns this behavior and needs a real implementation or update.\n- `existing-target-equivalent`: an established target file owns the behavior.\n- `source-runtime-only`: TypeScript owns behavior that runs in a runtime unavailable to the target language.\n- `generated-artifact`: parity belongs to generator/schema output or generated metadata.\n- `test-contract-only`: parity should be asserted through existing public behavior tests.\n- `unsupported-runtime-limitation`: the target runtime cannot express the behavior; report the reason without stubs.\n\n## Defaults\n\nWhen no options are provided:\n\n- `--repo` defaults to the current working directory.\n- `--source-root` defaults to the repository root.\n- Target roots default to `python/`, `go/`, `rust/`, and `ruby/` under the repository root.\n- `--package-name` defaults to the repository directory name converted to `snake_case`.\n- Guidance files default to `AGENTS.md` and direct child `*/AGENTS.md` files under the repository root.\n\nOverride guidance discovery with one or more `--agents-glob` values:\n\n```bash\npolyglot-map run \\\n  --agents-glob AGENTS.md \\\n  --agents-glob 'packages/*/AGENTS.md'\n```\n\n## Language Selection\n\nUse `--languages` to limit a run:\n\n```bash\npolyglot-map run --languages ts,python,golang\n```\n\nAliases include `ts`, `typescript`, `py`, `python`, `go`, `golang`, `rs`, `rust`, `rb`, and `ruby`.\n\n## Prompt Template\n\nThe full agent prompt lives in `src/polyglot_map/system_prompt.md`.\n\nThe CLI hydrates that template with invocation-specific values such as configured languages, repository roots, discovered `AGENTS.md` content, and the JSON source manifest. Edit the Markdown file to change policy; keep Python changes focused on discovery and rendering.\n\n## Safety Model\n\nThe generated system prompt forbids destructive git commands, silent test downgrades, TODO placeholders for mapped files, compatibility shims that hide drift, and rename-only layout churn.\n\nFor publishing or public use, prefer explicit `--source-root`, `--target`, `--package-name`, and `--agents-glob` arguments so generated prompts contain only paths and guidance you intend to share with the invoked agent.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirate%2Fpolyglot-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirate%2Fpolyglot-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirate%2Fpolyglot-agent/lists"}