{"id":31689481,"url":"https://github.com/trackman/tps-app-scripting","last_synced_at":"2025-10-08T11:16:11.720Z","repository":{"id":315607362,"uuid":"1057975846","full_name":"TrackMan/tps-app-scripting","owner":"TrackMan","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-06T19:21:30.000Z","size":10859,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T20:46:57.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/TrackMan.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":"2025-09-16T13:08:19.000Z","updated_at":"2025-10-06T19:21:34.000Z","dependencies_parsed_at":"2025-09-19T16:31:22.227Z","dependency_job_id":"a6e2c7d1-045e-44ee-8bf4-b736b75f5393","html_url":"https://github.com/TrackMan/tps-app-scripting","commit_stats":null,"previous_names":["trackman/tps-app-scripting"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TrackMan/tps-app-scripting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrackMan%2Ftps-app-scripting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrackMan%2Ftps-app-scripting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrackMan%2Ftps-app-scripting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrackMan%2Ftps-app-scripting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrackMan","download_url":"https://codeload.github.com/TrackMan/tps-app-scripting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrackMan%2Ftps-app-scripting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931701,"owners_count":26070800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2025-10-08T11:16:09.360Z","updated_at":"2025-10-08T11:16:11.715Z","avatar_url":"https://github.com/TrackMan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here’s a ready-to-commit **README.md** for the `app-scripting` repo.\n\n---\n\n# TrackMan App Scripting\n\nDefine and validate JSON scripts that orchestrate multi-app training flows across **Range Analysis** and **Performance Center**.\n\n* **Schema:** JSON Schema (Draft 2020-12) at `schema/latest/app-scripting.schema.json`\n* **Docs:** Authoring guide, schema reference, and example scripts\n* **Tooling:** Node (AJV) validators + CI workflow\n\n\u003e 📚 **Technical Documentation**: For implementation details, bug fixes, and feature documentation, see [`docs/technical/`](./docs/technical/README.md)\n\n---\n\n## Contents\n\n```\napp-scripting/\n├─ README.md\n├─ docs/\n│  ├─ index.md\n│  ├─ authoring-guide.md\n│  ├─ schema-reference.md\n│  ├─ examples.md\n│  └─ changelog.md\n├─ schema/\n│  ├─ 1.0.0/\n│  │  ├─ app-scripting.schema.json\n│  │  └─ README.md\n│  └─ latest -\u003e 1.0.0 (see “Pointing latest”)\n├─ examples/\n│  ├─ range-analysis/\n│  ├─ performance-center/\n│  └─ composite-flows/\n├─ tools/\n│  ├─ validate.js\n│  └─ format.js\n├─ scripts/\n│  ├─ validate-all.sh\n│  └─ new-example.sh\n├─ package.json\n└─ .github/workflows/validate.yml\n```\n\n---\n\n## Quick start\n\n### 1) Reference the schema from an example\n\nIn any `examples/**.json`:\n\n```json\n{\n  \"$schema\": \"../schema/latest/app-scripting.schema.json\",\n  \"version\": \"1.0.0\",\n  \"activities\": [\n    {\n      \"nodeType\": \"RangeAnalysisScriptedActivity\",\n      \"id\": \"ra-1\",\n      \"introMessage\": { \"header\": \"Welcome\", \"description\": \"\", \"seconds\": 3 },\n      \"endMessage\":  { \"header\": \"Done\",     \"description\": \"\", \"seconds\": 3 },\n      \"steps\": [\n        {\n          \"nodeType\": \"RangeAnalysisScriptedStep\",\n          \"id\": \"ra-step-1\",\n          \"introMessage\":  { \"header\": \"Hit 3 shots\", \"description\": \"\", \"seconds\": 5 },\n          \"successMessage\":{ \"header\": \"Great!\",      \"description\": \"\", \"seconds\": 3 },\n          \"failMessage\":   { \"header\": \"Try again\",   \"description\": \"\", \"seconds\": 3 },\n          \"logic\": {\n            \"nodeType\": \"RangeAnalysisScriptedLogic\",\n            \"setup\": { \"nodeType\": \"RangeAnalysisScriptedSetup\", \"club\": \"Drv\", \"distance\": 200 },\n            \"successCondition\": { \"nodeType\": \"RangeAnalysisScriptedConditions\", \"shots\": 3,\n              \"conditions\": [{ \"parameter\": \"Total\", \"min\": 200 }] },\n            \"failCondition\": { \"nodeType\": \"RangeAnalysisScriptedConditions\", \"shots\": 5 },\n            \"canRetry\": true,\n            \"skipOnSuccess\": true\n          },\n          \"ui\": { \"nodeType\": \"RangeAnalysisScriptedUI\" }\n        }\n      ]\n    }\n  ]\n}\n```\n\n\u003e Adjust the relative path in `$schema` based on the file depth (each `..` goes up one directory).\n\n---\n\n## Validate scripts\n\nUse **Node (AJV)** to scan `examples/**/*.json` and validate against `schema/latest/app-scripting.schema.json`.\n\n1. Install:\n\n```bash\nnpm ci\n```\n\n2. Validate all examples:\n\n```bash\nnpm run validate\n```\n\n3. (Optional) Format JSON files:\n\n```bash\nnpm run format\n```\n\n---\n\n## CI\n\nGitHub Actions workflow runs validation on every push/PR:\n\n```\n.github/workflows/validate.yml\n```\n\nIf any example fails schema validation, the job fails.\n\n---\n\n## Pointing `latest` to a version\n\nYou have three choices for how `schema/latest/app-scripting.schema.json` maps to a specific version (e.g., `1.0.0`). Pick one team-wide and stick with it.\n\n### 1) **Pointer file** (recommended; portable)\n\nCreate `schema/latest/app-scripting.schema.json` with:\n\n```json\n{ \"$ref\": \"../1.0.0/app-scripting.schema.json\" }\n```\n\nPros: single source of truth, no OS features needed.\n\n### 2) **Copy** (simple, but duplicate)\n\n```bash\n# bash\nmkdir -p schema/{1.0.0,latest}\ncp schema/1.0.0/app-scripting.schema.json schema/latest/app-scripting.schema.json\n```\n\n```powershell\n# PowerShell\nNew-Item -ItemType Directory -Force -Path \"schema/1.0.0\",\"schema/latest\" | Out-Null\nCopy-Item \"schema/1.0.0/app-scripting.schema.json\" \"schema/latest/app-scripting.schema.json\" -Force\n```\n\nRe-copy whenever the versioned schema changes.\n\n### 3) **Symlink** (Windows/macOS/Linux; requires privileges)\n\n**Windows (PowerShell):**\n\n```powershell\nNew-Item -ItemType Directory -Force -Path \"schema/1.0.0\",\"schema/latest\" | Out-Null\nNew-Item -ItemType SymbolicLink `\n  -Path \"schema/latest/app-scripting.schema.json\" `\n  -Target \"schema/1.0.0/app-scripting.schema.json\"\n```\n\n**macOS/Linux:**\n\n```bash\nln -sf ../1.0.0/app-scripting.schema.json schema/latest/app-scripting.schema.json\n```\n\n\u003e If Windows blocks symlinks, use the pointer file approach above.\n\n---\n\n## Authoring model (summary)\n\n* A script is an object with an ordered list of **activities**.\n* **Activity types:** `RangeAnalysisScriptedActivity`, `PerformanceCenterScriptedActivity`.\n* Each activity contains **steps**, each with messages, logic, and UI.\n* **Logic** defines a **setup** + **successCondition** and **failCondition**:\n\n  * `shots`: threshold count\n  * `conditions`: per-shot constraints (e.g., `Total`, `Curve`, `FromPin`, `StrokesGained`)\n  * `conditionType`: `\"And\"`/`\"Or\"` (within a single shot)\n* **Booleans:** `canRetry`, `skipOnSuccess`.\n\nSee `docs/authoring-guide.md` and `docs/schema-reference.md` for the full spec and examples.\n\n---\n\n## Versioning\n\n* Schema versions live under `schema/\u003csemver\u003e/…` (e.g., `1.0.0`).\n* `schema/latest/…` is a stable entrypoint used by examples and docs.\n* Breaking changes → bump **MAJOR**, keep old versions for backward compatibility.\n* Add human notes in `docs/changelog.md` and `schema/\u003cver\u003e/README.md`.\n\n---\n\n## Contributing\n\n1. Add or update examples in `examples/**`.\n2. Run validation locally (`npm run validate`).\n3. Open a PR. CI must pass.\n\nCoding style:\n\n* JSON is formatted via Prettier.\n* IDs follow `^[a-z][a-z0-9-]*$`.\n\n---\n\n## Troubleshooting\n\n* **“\\$schema not found”**: Check the relative path from your example to `schema/latest/app-scripting.schema.json`.\n* **Windows symlink errors**: Use the **pointer file** (`{ \"$ref\": \"../1.0.0/app-scripting.schema.json\" }`) instead.\n* **Validator cannot resolve refs**: Ensure your tool runs from the repo root (or provide absolute paths).\n\n---\n\n## License\n\n© TrackMan. All rights reserved. (Replace with your actual license if needed.)\n\n---\n\n## Contacts\n\n* Schema owner: Application Development @ TrackMan\n* Maintainers: (add GitHub handles / emails)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrackman%2Ftps-app-scripting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrackman%2Ftps-app-scripting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrackman%2Ftps-app-scripting/lists"}