Skip to content

Commit 9c2e1a6

Browse files
committed
Point HTML task previews at shared runner
1 parent a50e9a7 commit 9c2e1a6

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ If both exist, the website keeps the main task card and adds:
8484

8585
for the matched HTML companion.
8686

87+
By default, HTML companions run through the shared `psyflow-web` GitHub Pages runner:
88+
89+
```text
90+
https://taskbeacon.github.io/psyflow-web/?task=H000006-mid
91+
```
92+
93+
You can override this with metadata such as `links.run_url` when needed.
94+
8795
Rate limits:
8896

8997
- Without a token, GitHub API requests may fail.

scripts/build-index.mjs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const TOKEN =
77
process.env.GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GITHUB_PAT || "";
88
const PAGES_ORIGIN =
99
process.env.TASKBEACON_PAGES_ORIGIN || `https://${String(ORG).toLowerCase()}.github.io`;
10+
const HTML_RUNNER_REPO = process.env.TASKBEACON_HTML_RUNNER_REPO || "psyflow-web";
11+
const HTML_RUNNER_URL =
12+
process.env.TASKBEACON_HTML_RUNNER_URL ||
13+
`${PAGES_ORIGIN}/${encodeURIComponent(HTML_RUNNER_REPO)}/`;
1014
const LOCAL_WORKSPACE_ROOT = process.env.TASKBEACON_LOCAL_WORKSPACE || path.resolve(process.cwd(), "..");
1115

1216
const GH_API = "https://api.github.com";
@@ -258,9 +262,11 @@ function inferSlugFromRepo(repo) {
258262
.toLowerCase();
259263
}
260264

261-
function inferPagesRunUrl(repo, explicitUrl = null) {
265+
function inferHtmlRunUrl(repo, explicitUrl = null) {
262266
if (explicitUrl) return String(explicitUrl);
263-
return `${PAGES_ORIGIN}/${encodeURIComponent(String(repo ?? "").trim())}/`;
267+
const url = new URL(String(HTML_RUNNER_URL));
268+
url.searchParams.set("task", String(repo ?? "").trim());
269+
return url.toString();
264270
}
265271

266272
function isHtmlVariant(item) {
@@ -535,7 +541,7 @@ function buildTaskItem({
535541
last_updated,
536542
structure,
537543
readme_run_anchor: run_anchor,
538-
run_url: variant === "html" ? inferPagesRunUrl(repo, explicitRunUrl) : null,
544+
run_url: variant === "html" ? inferHtmlRunUrl(repo, explicitRunUrl) : null,
539545
web_variant: null
540546
};
541547
}
@@ -614,7 +620,7 @@ function toWebVariant(item) {
614620
variant: item.variant ?? null,
615621
release_tag: item.release_tag ?? null,
616622
last_updated: item.last_updated,
617-
run_url: item.run_url ?? inferPagesRunUrl(item.repo),
623+
run_url: item.run_url ?? inferHtmlRunUrl(item.repo),
618624
download_zip: downloadZipUrl(item.html_url, item.default_branch)
619625
};
620626
}

src/data/SCHEMA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ Optional:
6464
- `taskbeacon.yaml` and `taskbeacon.yml` are preferred metadata sources. The indexer still accepts `task.yaml`, `task.yml`, and `task.json` for backward compatibility.
6565
- `short_description` is taken from metadata first, then README table fields, then the README first paragraph, then the GitHub repo description.
6666
- `maturity` is taken from metadata when present; otherwise it is parsed from README badges like `![Maturity: smoke_tested]`.
67-
- `run_url` is mainly used for standalone HTML tasks.
67+
- `run_url` is used for HTML tasks and web companions. By default it points to the shared `psyflow-web` GitHub Pages runner with `?task=<repo>`, unless metadata overrides it.
6868
- `web_variant` is attached to a main task when the indexer finds a companion repo with the same `slug` and `variant: html`.

src/data/tasks_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
"variant": "html",
361361
"release_tag": "0.1.0",
362362
"last_updated": "2026-03-06T09:13:27.3316330Z",
363-
"run_url": "https://taskbeacon.github.io/H000006-mid/",
363+
"run_url": "https://taskbeacon.github.io/psyflow-web/?task=H000006-mid",
364364
"download_zip": "https://github.com/TaskBeacon/H000006-mid/archive/refs/heads/main.zip"
365365
}
366366
},

0 commit comments

Comments
 (0)