From 79e763d8df8f297dee4bd3c2866a9088624f5880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Mon, 22 Jun 2026 01:35:30 +0200 Subject: [PATCH] fix: empty templates ship input_schema.json and reference it from actor.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Empty templates (ts-empty, js-empty, python-empty) were the only common scaffolding starting points that did not ship a `.actor/input_schema.json`. Agents using these templates would create the schema file themselves but omit the `.input` reference in `.actor/actor.json`, relying on the deprecated auto-discovery fallback. ## What changed ### `agent-bases/{ts,js,python}.AGENTS.md` (the shared bases that propagate into every per-template AGENTS.md via CI) - **Do list (line 28-29 in each)**: added a new bullet right after the existing "set sensible defaults in `.actor/input_schema.json`" bullet: > explicitly reference the input schema from `.actor/actor.json` by > adding `"input": "./input_schema.json"` — do not rely on > auto-discovery, which is deprecated - **Project structure tree**: updated `actor.json` and `input_schema.json` annotations so the linkage is visible at a glance. ### `templates/{ts,js,python}-empty/.actor/actor.json` - Added `"input": "./input_schema.json"` between the `meta` block and the `dockerfile` field. Preserves all other content + 4-space indentation. ### `templates/{ts,js,python}-empty/.actor/input_schema.json` (new file in each) - Ships a minimal starter schema with a single `example` string field (described as "Replace this with your actual input fields"). Mirrors the `python-start` / `ts-start` pattern of shipping a working schema the user replaces. Agents see the linkage live and produce `.input`-referenced schemas by default. ## Rationale The "start" templates already ship both `.actor/input_schema.json` and the `.input` reference in `actor.json`. The "empty" templates were the outlier, leaving agents without a live example to crib from. Bringing them into line + adding the explicit AGENTS.md instruction closes the loop from both directions: the scaffold demonstrates the pattern, and the agent docs reinforce it. Refs: chocholous/apify-evals F40. --- agent-bases/js.AGENTS.md | 5 +++-- agent-bases/python.AGENTS.md | 5 +++-- agent-bases/ts.AGENTS.md | 5 +++-- templates/js-empty/.actor/actor.json | 1 + templates/js-empty/.actor/input_schema.json | 15 +++++++++++++++ templates/python-empty/.actor/actor.json | 1 + templates/python-empty/.actor/input_schema.json | 15 +++++++++++++++ templates/ts-empty/.actor/actor.json | 1 + templates/ts-empty/.actor/input_schema.json | 15 +++++++++++++++ 9 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 templates/js-empty/.actor/input_schema.json create mode 100644 templates/python-empty/.actor/input_schema.json create mode 100644 templates/ts-empty/.actor/input_schema.json diff --git a/agent-bases/js.AGENTS.md b/agent-bases/js.AGENTS.md index 003cd8a42..eabab4159 100644 --- a/agent-bases/js.AGENTS.md +++ b/agent-bases/js.AGENTS.md @@ -26,6 +26,7 @@ Important: Before you begin, fill in the `generatedBy` property in the meta sect - implement retry strategies with exponential backoff for failed requests - use proper concurrency settings (HTTP: 10-50, Browser: 1-5) - set sensible defaults in `.actor/input_schema.json` for all optional fields +- explicitly reference the input schema from `.actor/actor.json` by adding `"input": "./input_schema.json"` — do not rely on auto-discovery, which is deprecated - set up output schema in `.actor/output_schema.json` - clean and validate data before pushing to dataset - use semantic CSS selectors and fallback strategies for missing elements @@ -187,8 +188,8 @@ Ask first: ## Project Structure .actor/ -├── actor.json # Actor config: name, version, env vars, runtime settings -├── input_schema.json # Input validation & Console form definition +├── actor.json # Actor config: name, version, env vars, runtime settings, input schema reference +├── input_schema.json # Input validation & Console form definition (referenced from actor.json via "input") └── output_schema.json # Specifies where an Actor stores its output src/ └── main.js # Actor entry point and orchestrator diff --git a/agent-bases/python.AGENTS.md b/agent-bases/python.AGENTS.md index 1797ae695..974e9271a 100644 --- a/agent-bases/python.AGENTS.md +++ b/agent-bases/python.AGENTS.md @@ -26,6 +26,7 @@ Important: Before you begin, fill in the `generatedBy` property in the meta sect - implement retry strategies with exponential backoff for failed requests - use proper concurrency settings (HTTP: 10-50, Browser: 1-5) - set sensible defaults in `.actor/input_schema.json` for all optional fields +- explicitly reference the input schema from `.actor/actor.json` by adding `"input": "./input_schema.json"` — do not rely on auto-discovery, which is deprecated - set up output schema in `.actor/output_schema.json` - clean and validate data before pushing to dataset - use semantic CSS selectors and fallback strategies for missing elements @@ -189,8 +190,8 @@ Ask first: ## Project Structure .actor/ -├── actor.json # Actor config: name, version, env vars, runtime settings -├── input_schema.json # Input validation & Console form definition +├── actor.json # Actor config: name, version, env vars, runtime settings, input schema reference +├── input_schema.json # Input validation & Console form definition (referenced from actor.json via "input") └── output_schema.json # Specifies where an Actor stores its output src/ └── main.js # Actor entry point and orchestrator diff --git a/agent-bases/ts.AGENTS.md b/agent-bases/ts.AGENTS.md index de8e3e29f..3a363ff2b 100644 --- a/agent-bases/ts.AGENTS.md +++ b/agent-bases/ts.AGENTS.md @@ -26,6 +26,7 @@ Important: Before you begin, fill in the `generatedBy` property in the meta sect - implement retry strategies with exponential backoff for failed requests - use proper concurrency settings (HTTP: 10-50, Browser: 1-5) - set sensible defaults in `.actor/input_schema.json` for all optional fields +- explicitly reference the input schema from `.actor/actor.json` by adding `"input": "./input_schema.json"` — do not rely on auto-discovery, which is deprecated - set up output schema in `.actor/output_schema.json` - clean and validate data before pushing to dataset - use semantic CSS selectors and fallback strategies for missing elements @@ -190,8 +191,8 @@ Ask first: ## Project Structure .actor/ -├── actor.json # Actor config: name, version, env vars, runtime settings -├── input_schema.json # Input validation & Console form definition +├── actor.json # Actor config: name, version, env vars, runtime settings, input schema reference +├── input_schema.json # Input validation & Console form definition (referenced from actor.json via "input") └── output_schema.json # Specifies where an Actor stores its output src/ └── main.js # Actor entry point and orchestrator diff --git a/templates/js-empty/.actor/actor.json b/templates/js-empty/.actor/actor.json index 1fab06922..1e01b4e2b 100644 --- a/templates/js-empty/.actor/actor.json +++ b/templates/js-empty/.actor/actor.json @@ -10,5 +10,6 @@ "templateId": "js-empty", "generatedBy": "" }, + "input": "./input_schema.json", "dockerfile": "../Dockerfile" } diff --git a/templates/js-empty/.actor/input_schema.json b/templates/js-empty/.actor/input_schema.json new file mode 100644 index 000000000..819dfbb1f --- /dev/null +++ b/templates/js-empty/.actor/input_schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://apify.com/schemas/v1/input.ide.json", + "title": "Actor Input", + "type": "object", + "schemaVersion": 1, + "properties": { + "example": { + "title": "Example Field", + "type": "string", + "description": "Replace this with your actual input fields.", + "editor": "textfield" + } + }, + "required": [] +} diff --git a/templates/python-empty/.actor/actor.json b/templates/python-empty/.actor/actor.json index aa2f0886b..67890d863 100644 --- a/templates/python-empty/.actor/actor.json +++ b/templates/python-empty/.actor/actor.json @@ -10,5 +10,6 @@ "templateId": "python-empty", "generatedBy": "" }, + "input": "./input_schema.json", "dockerfile": "../Dockerfile" } diff --git a/templates/python-empty/.actor/input_schema.json b/templates/python-empty/.actor/input_schema.json new file mode 100644 index 000000000..819dfbb1f --- /dev/null +++ b/templates/python-empty/.actor/input_schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://apify.com/schemas/v1/input.ide.json", + "title": "Actor Input", + "type": "object", + "schemaVersion": 1, + "properties": { + "example": { + "title": "Example Field", + "type": "string", + "description": "Replace this with your actual input fields.", + "editor": "textfield" + } + }, + "required": [] +} diff --git a/templates/ts-empty/.actor/actor.json b/templates/ts-empty/.actor/actor.json index cbbe54510..1d00285f4 100644 --- a/templates/ts-empty/.actor/actor.json +++ b/templates/ts-empty/.actor/actor.json @@ -10,5 +10,6 @@ "templateId": "ts-empty", "generatedBy": "" }, + "input": "./input_schema.json", "dockerfile": "../Dockerfile" } diff --git a/templates/ts-empty/.actor/input_schema.json b/templates/ts-empty/.actor/input_schema.json new file mode 100644 index 000000000..819dfbb1f --- /dev/null +++ b/templates/ts-empty/.actor/input_schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://apify.com/schemas/v1/input.ide.json", + "title": "Actor Input", + "type": "object", + "schemaVersion": 1, + "properties": { + "example": { + "title": "Example Field", + "type": "string", + "description": "Replace this with your actual input fields.", + "editor": "textfield" + } + }, + "required": [] +}