diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..07fa427 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,5 @@ +{ + "enabledPlugins": { + "superpowers@superpowers-marketplace": true + } +} diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..f2c3076 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,18 @@ +{ + "permissions": { + "allow": [ + "Bash(gh pr view:*)", + "WebFetch(domain:github.com)", + "Skill(superpowers:writing-plans)", + "Bash(mkdir:*)", + "Skill(superpowers:subagent-driven-development)", + "Bash(npm test:*)", + "Bash(npm run build:*)", + "Bash(git show:*)", + "Bash(git ls-tree:*)", + "Bash(grep:*)", + "Bash(done)", + "Skill(superpowers:finishing-a-development-branch)" + ] + } +} diff --git a/dist/schemas/config_v3.schema.json b/dist/schemas/config_v3.schema.json index 02711e4..83a5a0f 100644 --- a/dist/schemas/config_v3.schema.json +++ b/dist/schemas/config_v3.schema.json @@ -1995,6 +1995,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2102,6 +2107,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2134,6 +2144,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2644,6 +2658,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2751,6 +2770,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2783,6 +2807,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4568,6 +4596,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4658,6 +4713,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4713,6 +4795,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4876,6 +4984,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4967,6 +5102,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5006,6 +5168,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5182,6 +5364,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5289,6 +5476,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5321,6 +5513,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6654,6 +6850,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -8231,6 +8560,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8321,6 +8677,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8376,6 +8759,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -10098,6 +10507,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10205,6 +10619,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10237,6 +10656,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10747,6 +11170,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10854,6 +11282,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10886,6 +11319,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12671,6 +13108,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12761,6 +13225,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12816,6 +13307,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12979,6 +13496,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13070,6 +13614,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13109,6 +13680,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13285,6 +13876,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13392,6 +13988,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13424,6 +14025,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14757,6 +15362,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/find_v3.schema.json b/dist/schemas/find_v3.schema.json index 4f4aea6..13ce731 100644 --- a/dist/schemas/find_v3.schema.json +++ b/dist/schemas/find_v3.schema.json @@ -488,6 +488,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -595,6 +600,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -627,6 +637,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -1137,6 +1151,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1244,6 +1263,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1276,6 +1300,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, diff --git a/dist/schemas/report_v3.schema.json b/dist/schemas/report_v3.schema.json index 5868b73..59d97d7 100644 --- a/dist/schemas/report_v3.schema.json +++ b/dist/schemas/report_v3.schema.json @@ -2428,6 +2428,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2535,6 +2540,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2567,6 +2577,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3077,6 +3091,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3184,6 +3203,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3216,6 +3240,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -5001,6 +5029,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5091,6 +5146,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5146,6 +5228,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -5309,6 +5417,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5400,6 +5535,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5439,6 +5601,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5615,6 +5797,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5722,6 +5909,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5754,6 +5946,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -7087,6 +7283,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -10005,6 +10334,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10112,6 +10446,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10144,6 +10483,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10654,6 +10997,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10761,6 +11109,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10793,6 +11146,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12578,6 +12935,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12668,6 +13052,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12723,6 +13134,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12886,6 +13323,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12977,6 +13441,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13016,6 +13507,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13192,6 +13703,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13299,6 +13815,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13331,6 +13852,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14664,6 +15189,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/resolvedTests_v3.schema.json b/dist/schemas/resolvedTests_v3.schema.json index 8126dfc..02d4713 100644 --- a/dist/schemas/resolvedTests_v3.schema.json +++ b/dist/schemas/resolvedTests_v3.schema.json @@ -2008,6 +2008,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2115,6 +2120,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2147,6 +2157,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2657,6 +2671,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2764,6 +2783,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2796,6 +2820,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4581,6 +4609,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4671,6 +4726,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4726,6 +4808,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4889,6 +4997,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4980,6 +5115,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5019,6 +5181,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5195,6 +5377,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5302,6 +5489,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5334,6 +5526,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6667,6 +6863,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -8244,6 +8573,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8334,6 +8690,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8389,6 +8772,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -10111,6 +10520,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10218,6 +10632,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10250,6 +10669,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10760,6 +11183,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10867,6 +11295,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10899,6 +11332,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12684,6 +13121,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12774,6 +13238,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12829,6 +13320,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12992,6 +13509,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13083,6 +13627,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13122,6 +13693,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13298,6 +13889,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13405,6 +14001,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13437,6 +14038,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14674,14 +15279,99 @@ true, "results.mp4", { - "path": "results.mp4", - "directory": "static/media", - "overwrite": "true" + "path": "results.mp4", + "directory": "static/media", + "overwrite": "true" + } + ] + } + }, + "title": "record" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "stopRecord" + ], + "properties": { + "stopRecord": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "stopRecord", + "description": "Stop the current recording.", + "anyOf": [ + { + "type": "boolean", + "nullable": true } + ], + "examples": [ + true ] } }, - "title": "record" + "title": "stopRecord" } ] }, @@ -14748,25 +15438,73 @@ { "type": "object", "required": [ - "stopRecord" + "terminateScope" ], "properties": { - "stopRecord": { + "terminateScope": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "stopRecord", - "description": "Stop the current recording.", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", "anyOf": [ { - "type": "boolean", - "nullable": true + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" } ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, "examples": [ - true + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -18903,6 +19641,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19010,6 +19753,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19042,6 +19790,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -19552,6 +20304,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19659,6 +20416,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19691,6 +20453,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -21476,6 +22242,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -21566,6 +22359,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -21621,6 +22441,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -21784,6 +22630,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -21875,6 +22748,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -21914,6 +22814,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -22090,6 +23010,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -22197,6 +23122,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -22229,6 +23159,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -23554,11 +24488,144 @@ } ], "examples": [ - true + true + ] + } + }, + "title": "stopRecord" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -26480,6 +27547,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26587,6 +27659,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26619,6 +27696,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -27129,6 +28210,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -27236,6 +28322,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -27268,6 +28359,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -29053,6 +30148,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29143,6 +30265,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29198,6 +30347,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -29361,6 +30536,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -29452,6 +30654,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -29491,6 +30720,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -29667,6 +30916,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -29774,6 +31028,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -29806,6 +31065,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -31139,6 +32402,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/runCode_v3.schema.json b/dist/schemas/runCode_v3.schema.json index 23899a5..9917193 100644 --- a/dist/schemas/runCode_v3.schema.json +++ b/dist/schemas/runCode_v3.schema.json @@ -87,6 +87,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -178,6 +205,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -217,6 +271,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } \ No newline at end of file diff --git a/dist/schemas/runShell_v3.schema.json b/dist/schemas/runShell_v3.schema.json index a65de4f..a1da95e 100644 --- a/dist/schemas/runShell_v3.schema.json +++ b/dist/schemas/runShell_v3.schema.json @@ -86,6 +86,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -176,6 +203,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -231,6 +285,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } \ No newline at end of file diff --git a/dist/schemas/spec_v3.schema.json b/dist/schemas/spec_v3.schema.json index 4fb10e2..a9af4d7 100644 --- a/dist/schemas/spec_v3.schema.json +++ b/dist/schemas/spec_v3.schema.json @@ -2410,6 +2410,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2517,6 +2522,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2549,6 +2559,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3059,6 +3073,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3166,6 +3185,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3198,6 +3222,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4983,6 +5011,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5073,6 +5128,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5128,6 +5210,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -5291,6 +5399,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5382,6 +5517,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5421,6 +5583,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5597,6 +5779,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5704,6 +5891,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5736,6 +5928,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -7069,6 +7265,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -9987,6 +10316,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10094,6 +10428,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10126,6 +10465,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10636,6 +10979,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10743,6 +11091,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10775,6 +11128,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12560,6 +12917,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12650,6 +13034,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12705,6 +13116,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12868,6 +13305,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12959,6 +13423,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12998,6 +13489,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13174,6 +13685,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13281,6 +13797,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13313,6 +13834,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14646,6 +15171,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/step_v3.schema.json b/dist/schemas/step_v3.schema.json index fd6e96b..9980258 100644 --- a/dist/schemas/step_v3.schema.json +++ b/dist/schemas/step_v3.schema.json @@ -1210,6 +1210,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1317,6 +1322,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1349,6 +1359,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -1859,6 +1873,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1966,6 +1985,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1998,6 +2022,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3783,6 +3811,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -3873,6 +3928,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -3928,6 +4010,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4091,6 +4199,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4182,6 +4317,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4221,6 +4383,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -4397,6 +4579,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -4504,6 +4691,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -4536,6 +4728,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -5869,6 +6065,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/terminateScope_v3.schema.json b/dist/schemas/terminateScope_v3.schema.json new file mode 100644 index 0000000..547c2e2 --- /dev/null +++ b/dist/schemas/terminateScope_v3.schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] +} \ No newline at end of file diff --git a/dist/schemas/test_v3.schema.json b/dist/schemas/test_v3.schema.json index 5e3f97b..183fad3 100644 --- a/dist/schemas/test_v3.schema.json +++ b/dist/schemas/test_v3.schema.json @@ -1809,6 +1809,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1916,6 +1921,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1948,6 +1958,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2458,6 +2472,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2565,6 +2584,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2597,6 +2621,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4382,6 +4410,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4472,6 +4527,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4527,6 +4609,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4690,6 +4798,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4781,6 +4916,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4820,6 +4982,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -4996,6 +5178,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5103,6 +5290,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5135,6 +5327,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6468,6 +6664,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -9386,6 +9715,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -9493,6 +9827,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -9525,6 +9864,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10035,6 +10378,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10142,6 +10490,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10174,6 +10527,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -11959,6 +12316,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12049,6 +12433,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12104,6 +12515,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12267,6 +12704,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12358,6 +12822,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12397,6 +12888,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -12573,6 +13084,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -12680,6 +13196,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -12712,6 +13233,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14045,6 +14570,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/dist/schemas/type_v3.schema.json b/dist/schemas/type_v3.schema.json index 566eda5..dc0f9d3 100644 --- a/dist/schemas/type_v3.schema.json +++ b/dist/schemas/type_v3.schema.json @@ -100,6 +100,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -207,6 +212,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -239,6 +249,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } \ No newline at end of file diff --git a/src/schemas/dereferenceSchemas.js b/src/schemas/dereferenceSchemas.js index 3709834..8ecdcd8 100644 --- a/src/schemas/dereferenceSchemas.js +++ b/src/schemas/dereferenceSchemas.js @@ -1,206 +1,207 @@ -const parser = require("@apidevtools/json-schema-ref-parser"); -const path = require("path"); -const fs = require("fs"); - -(async () => { - await dereferenceSchemas(); -})(); - -/** - * Processes JSON schema files by updating reference paths, dereferencing all `$ref` pointers, and generating fully resolved schema outputs. - * - * For each schema in the input directory, this function updates reference paths, writes intermediate schemas to a build directory, dereferences all references, removes `$id` properties, and writes the final schemas to an output directory. It also creates a consolidated `schemas.json` file containing all dereferenced schemas keyed by filename. - * - * @remark The function assumes all schema files listed exist in the input directory and does not handle missing files or invalid JSON beyond throwing synchronous errors. - */ -async function dereferenceSchemas() { - const inputDir = path.resolve(`${__dirname}/src_schemas`); - const buildDir = path.resolve(`${__dirname}/build`); - fs.mkdirSync(buildDir, { recursive: true }); - const outputDir = path.resolve(`${__dirname}/output_schemas`); - fs.mkdirSync(outputDir, { recursive: true }); - const distDir = path.resolve(__dirname, `../../dist/schemas`); - fs.mkdirSync(distDir, { recursive: true }); - - // List of schema files to process - // These files should be present in the input directory - const files = [ - // v3 schemas - "checkLink_v3.schema.json", - "click_v3.schema.json", - "config_v3.schema.json", - "context_v3.schema.json", - "dragAndDrop_v3.schema.json", - "find_v3.schema.json", - "goTo_v3.schema.json", - "loadCookie_v3.schema.json", - "loadVariables_v3.schema.json", - "httpRequest_v3.schema.json", - "openApi_v3.schema.json", - "record_v3.schema.json", - "resolvedTests_v3.schema.json", - "report_v3.schema.json", - "runCode_v3.schema.json", - "runShell_v3.schema.json", - "saveCookie_v3.schema.json", - "screenshot_v3.schema.json", - "sourceIntegration_v3.schema.json", - "spec_v3.schema.json", - "step_v3.schema.json", - "stopRecord_v3.schema.json", - "test_v3.schema.json", - "type_v3.schema.json", - "wait_v3.schema.json", - // v2 schemas - "checkLink_v2.schema.json", - "config_v2.schema.json", - "context_v2.schema.json", - "find_v2.schema.json", - "goTo_v2.schema.json", - "httpRequest_v2.schema.json", - "moveTo_v2.schema.json", - "openApi_v2.schema.json", - "runShell_v2.schema.json", - "runCode_v2.schema.json", - "saveScreenshot_v2.schema.json", - "setVariables_v2.schema.json", - "startRecording_v2.schema.json", - "stopRecording_v2.schema.json", - "spec_v2.schema.json", - "test_v2.schema.json", - "typeKeys_v2.schema.json", - "wait_v2.schema.json", - ]; - - // Update schema reference paths - console.log("Updating schema reference paths..."); - for (const file of files) { - console.log(`File: ${file}`) - const filePath = path.resolve(`${inputDir}/${file}`); - const buildFilePath = path.resolve(`${buildDir}/${file}`); - try { - // Check if file exists - if (!fs.existsSync(filePath)) { - throw new Error(`File not found: ${filePath}`); - } - // Load schema - let schema = fs.readFileSync(filePath).toString(); - schema = JSON.parse(schema); - - // Update references to current relative path - schema.$id = `${filePath}`; - schema = updateRefPaths(schema); - - // Write to build directory - fs.writeFileSync(buildFilePath, JSON.stringify(schema, null, 2)); - } catch (err) { - console.error(`Error processing ${file}:`, err); - } - } - - // Dereference schemas - console.log("Dereferencing schemas..."); - for await (const file of files) { - console.log(`Processing file: ${file}`); - const filePath = path.resolve(`${buildDir}/${file}`); - const outputFilePath = path.resolve(`${outputDir}/${file}`); - try { - // Check if file exists - if (!fs.existsSync(filePath)) - throw new Error(`File not found: ${filePath}`); - - // Load schema - let schema = fs.readFileSync(filePath).toString(); - schema = JSON.parse(schema); - - // Dereference schema - schema = await parser.dereference(schema); - // Delete $id attributes - schema = deleteDollarIds(schema); - - // Write to file - fs.writeFileSync(outputFilePath, JSON.stringify(schema, null, 2)); - } catch (err) { - console.error(`Error processing ${file}:`, err); - } - } - // Build final schemas.json file - console.log("Building schemas.json file..."); - const schemas = {}; - files.forEach(async (file) => { - const key = file.replace(".schema.json", ""); - // Load schema from file - let schema = require(`${outputDir}/${file}`); - // Load into `schema` object - schemas[key] = schema; - }); - fs.writeFileSync( - `${__dirname}/schemas.json`, - JSON.stringify(schemas, null, 2) - ); - - // Clean up build dir - // fs.rm(buildDir, { recursive: true }, (err) => { - // if (err) throw err; - // }); - - // Publish v3 schemas to distribution directory - const publishedSchemas = files.filter(file => file.includes('_v3.schema.json')); - - console.log("Publishing schemas to dist/schemas directory..."); - publishedSchemas.forEach((file) => { - try { - console.log(`Publishing file: ${file}`); - const srcPath = path.resolve(`${outputDir}/${file}`); - const destPath = path.resolve(`${distDir}/${file}`); - - // Verify source file exists before copying - if (!fs.existsSync(srcPath)) { - throw new Error(`Source file not found: ${srcPath}`); - } - - fs.copyFileSync(srcPath, destPath); - } catch (err) { - console.error(`Error publishing ${file}:`, err); - } - }); -} - -// Prepend app-root path to referenced relative paths -function updateRefPaths(schema) { - if (schema === null || typeof schema !== "object") return schema; - for (let [key, value] of Object.entries(schema)) { - if (typeof value === "object") { - updateRefPaths(value); - } - if (key === "$ref" && !value.startsWith("#")) { - // File name of the referenced schema - valueFile = value.split("#")[0]; - // Attribute path in the referenced schema - valueAttribute = value.split("#")[1]; - valuePath = path.resolve(`${__dirname}/build/${valueFile}`); - schema[key] = `${valuePath}#${valueAttribute}`; - // console.log({value, valueFile, valueAttribute, final: schema[key]}) - } - } - return schema; -} - -/** - * Recursively removes all `$id` properties from a JSON schema object. - * - * @param {object} schema - The JSON schema object to process. - * @returns {object} The schema object with all `$id` properties deleted. - */ -function deleteDollarIds(schema) { - if (schema === null || typeof schema !== "object") return schema; - for (let [key, value] of Object.entries(schema)) { - if (typeof value === "object") { - deleteDollarIds(value); - } - if (key === "$id") { - delete schema[key]; - } - } - return schema; -} +const parser = require("@apidevtools/json-schema-ref-parser"); +const path = require("path"); +const fs = require("fs"); + +(async () => { + await dereferenceSchemas(); +})(); + +/** + * Processes JSON schema files by updating reference paths, dereferencing all `$ref` pointers, and generating fully resolved schema outputs. + * + * For each schema in the input directory, this function updates reference paths, writes intermediate schemas to a build directory, dereferences all references, removes `$id` properties, and writes the final schemas to an output directory. It also creates a consolidated `schemas.json` file containing all dereferenced schemas keyed by filename. + * + * @remark The function assumes all schema files listed exist in the input directory and does not handle missing files or invalid JSON beyond throwing synchronous errors. + */ +async function dereferenceSchemas() { + const inputDir = path.resolve(`${__dirname}/src_schemas`); + const buildDir = path.resolve(`${__dirname}/build`); + fs.mkdirSync(buildDir, { recursive: true }); + const outputDir = path.resolve(`${__dirname}/output_schemas`); + fs.mkdirSync(outputDir, { recursive: true }); + const distDir = path.resolve(__dirname, `../../dist/schemas`); + fs.mkdirSync(distDir, { recursive: true }); + + // List of schema files to process + // These files should be present in the input directory + const files = [ + // v3 schemas + "checkLink_v3.schema.json", + "click_v3.schema.json", + "config_v3.schema.json", + "context_v3.schema.json", + "dragAndDrop_v3.schema.json", + "find_v3.schema.json", + "goTo_v3.schema.json", + "loadCookie_v3.schema.json", + "loadVariables_v3.schema.json", + "httpRequest_v3.schema.json", + "openApi_v3.schema.json", + "record_v3.schema.json", + "resolvedTests_v3.schema.json", + "report_v3.schema.json", + "runCode_v3.schema.json", + "runShell_v3.schema.json", + "saveCookie_v3.schema.json", + "screenshot_v3.schema.json", + "sourceIntegration_v3.schema.json", + "spec_v3.schema.json", + "step_v3.schema.json", + "stopRecord_v3.schema.json", + "terminateScope_v3.schema.json", + "test_v3.schema.json", + "type_v3.schema.json", + "wait_v3.schema.json", + // v2 schemas + "checkLink_v2.schema.json", + "config_v2.schema.json", + "context_v2.schema.json", + "find_v2.schema.json", + "goTo_v2.schema.json", + "httpRequest_v2.schema.json", + "moveTo_v2.schema.json", + "openApi_v2.schema.json", + "runShell_v2.schema.json", + "runCode_v2.schema.json", + "saveScreenshot_v2.schema.json", + "setVariables_v2.schema.json", + "startRecording_v2.schema.json", + "stopRecording_v2.schema.json", + "spec_v2.schema.json", + "test_v2.schema.json", + "typeKeys_v2.schema.json", + "wait_v2.schema.json", + ]; + + // Update schema reference paths + console.log("Updating schema reference paths..."); + for (const file of files) { + console.log(`File: ${file}`) + const filePath = path.resolve(`${inputDir}/${file}`); + const buildFilePath = path.resolve(`${buildDir}/${file}`); + try { + // Check if file exists + if (!fs.existsSync(filePath)) { + throw new Error(`File not found: ${filePath}`); + } + // Load schema + let schema = fs.readFileSync(filePath).toString(); + schema = JSON.parse(schema); + + // Update references to current relative path + schema.$id = `${filePath}`; + schema = updateRefPaths(schema); + + // Write to build directory + fs.writeFileSync(buildFilePath, JSON.stringify(schema, null, 2)); + } catch (err) { + console.error(`Error processing ${file}:`, err); + } + } + + // Dereference schemas + console.log("Dereferencing schemas..."); + for await (const file of files) { + console.log(`Processing file: ${file}`); + const filePath = path.resolve(`${buildDir}/${file}`); + const outputFilePath = path.resolve(`${outputDir}/${file}`); + try { + // Check if file exists + if (!fs.existsSync(filePath)) + throw new Error(`File not found: ${filePath}`); + + // Load schema + let schema = fs.readFileSync(filePath).toString(); + schema = JSON.parse(schema); + + // Dereference schema + schema = await parser.dereference(schema); + // Delete $id attributes + schema = deleteDollarIds(schema); + + // Write to file + fs.writeFileSync(outputFilePath, JSON.stringify(schema, null, 2)); + } catch (err) { + console.error(`Error processing ${file}:`, err); + } + } + // Build final schemas.json file + console.log("Building schemas.json file..."); + const schemas = {}; + files.forEach(async (file) => { + const key = file.replace(".schema.json", ""); + // Load schema from file + let schema = require(`${outputDir}/${file}`); + // Load into `schema` object + schemas[key] = schema; + }); + fs.writeFileSync( + `${__dirname}/schemas.json`, + JSON.stringify(schemas, null, 2) + ); + + // Clean up build dir + // fs.rm(buildDir, { recursive: true }, (err) => { + // if (err) throw err; + // }); + + // Publish v3 schemas to distribution directory + const publishedSchemas = files.filter(file => file.includes('_v3.schema.json')); + + console.log("Publishing schemas to dist/schemas directory..."); + publishedSchemas.forEach((file) => { + try { + console.log(`Publishing file: ${file}`); + const srcPath = path.resolve(`${outputDir}/${file}`); + const destPath = path.resolve(`${distDir}/${file}`); + + // Verify source file exists before copying + if (!fs.existsSync(srcPath)) { + throw new Error(`Source file not found: ${srcPath}`); + } + + fs.copyFileSync(srcPath, destPath); + } catch (err) { + console.error(`Error publishing ${file}:`, err); + } + }); +} + +// Prepend app-root path to referenced relative paths +function updateRefPaths(schema) { + if (schema === null || typeof schema !== "object") return schema; + for (let [key, value] of Object.entries(schema)) { + if (typeof value === "object") { + updateRefPaths(value); + } + if (key === "$ref" && !value.startsWith("#")) { + // File name of the referenced schema + valueFile = value.split("#")[0]; + // Attribute path in the referenced schema + valueAttribute = value.split("#")[1]; + valuePath = path.resolve(`${__dirname}/build/${valueFile}`); + schema[key] = `${valuePath}#${valueAttribute}`; + // console.log({value, valueFile, valueAttribute, final: schema[key]}) + } + } + return schema; +} + +/** + * Recursively removes all `$id` properties from a JSON schema object. + * + * @param {object} schema - The JSON schema object to process. + * @returns {object} The schema object with all `$id` properties deleted. + */ +function deleteDollarIds(schema) { + if (schema === null || typeof schema !== "object") return schema; + for (let [key, value] of Object.entries(schema)) { + if (typeof value === "object") { + deleteDollarIds(value); + } + if (key === "$id") { + delete schema[key]; + } + } + return schema; +} diff --git a/src/schemas/output_schemas/config_v3.schema.json b/src/schemas/output_schemas/config_v3.schema.json index 02711e4..83a5a0f 100644 --- a/src/schemas/output_schemas/config_v3.schema.json +++ b/src/schemas/output_schemas/config_v3.schema.json @@ -1995,6 +1995,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2102,6 +2107,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2134,6 +2144,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2644,6 +2658,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2751,6 +2770,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2783,6 +2807,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4568,6 +4596,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4658,6 +4713,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4713,6 +4795,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4876,6 +4984,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4967,6 +5102,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5006,6 +5168,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5182,6 +5364,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5289,6 +5476,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5321,6 +5513,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6654,6 +6850,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -8231,6 +8560,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8321,6 +8677,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8376,6 +8759,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -10098,6 +10507,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10205,6 +10619,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10237,6 +10656,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10747,6 +11170,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10854,6 +11282,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10886,6 +11319,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12671,6 +13108,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12761,6 +13225,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12816,6 +13307,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12979,6 +13496,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13070,6 +13614,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13109,6 +13680,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13285,6 +13876,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13392,6 +13988,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13424,6 +14025,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14757,6 +15362,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/endRecord_v3.schema.json b/src/schemas/output_schemas/endRecord_v3.schema.json index 9eb8fdd..95433e8 100644 --- a/src/schemas/output_schemas/endRecord_v3.schema.json +++ b/src/schemas/output_schemas/endRecord_v3.schema.json @@ -1,14 +1,14 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "endRecord", - "description": "Stop the current recording.", - "anyOf": [ - { - "type": "boolean", - "nullable": true - } - ], - "examples": [ - true - ] +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "endRecord", + "description": "Stop the current recording.", + "anyOf": [ + { + "type": "boolean", + "nullable": true + } + ], + "examples": [ + true + ] } \ No newline at end of file diff --git a/src/schemas/output_schemas/find_v3.schema.json b/src/schemas/output_schemas/find_v3.schema.json index 4f4aea6..13ce731 100644 --- a/src/schemas/output_schemas/find_v3.schema.json +++ b/src/schemas/output_schemas/find_v3.schema.json @@ -488,6 +488,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -595,6 +600,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -627,6 +637,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -1137,6 +1151,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1244,6 +1263,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1276,6 +1300,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, diff --git a/src/schemas/output_schemas/report_v3.schema.json b/src/schemas/output_schemas/report_v3.schema.json index 5868b73..59d97d7 100644 --- a/src/schemas/output_schemas/report_v3.schema.json +++ b/src/schemas/output_schemas/report_v3.schema.json @@ -2428,6 +2428,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2535,6 +2540,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2567,6 +2577,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3077,6 +3091,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3184,6 +3203,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3216,6 +3240,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -5001,6 +5029,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5091,6 +5146,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5146,6 +5228,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -5309,6 +5417,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5400,6 +5535,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5439,6 +5601,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5615,6 +5797,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5722,6 +5909,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5754,6 +5946,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -7087,6 +7283,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -10005,6 +10334,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10112,6 +10446,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10144,6 +10483,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10654,6 +10997,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10761,6 +11109,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10793,6 +11146,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12578,6 +12935,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12668,6 +13052,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12723,6 +13134,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12886,6 +13323,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12977,6 +13441,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13016,6 +13507,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13192,6 +13703,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13299,6 +13815,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13331,6 +13852,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14664,6 +15189,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/resolvedTests_v3.schema.json b/src/schemas/output_schemas/resolvedTests_v3.schema.json index 8126dfc..02d4713 100644 --- a/src/schemas/output_schemas/resolvedTests_v3.schema.json +++ b/src/schemas/output_schemas/resolvedTests_v3.schema.json @@ -2008,6 +2008,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2115,6 +2120,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2147,6 +2157,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2657,6 +2671,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2764,6 +2783,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2796,6 +2820,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4581,6 +4609,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4671,6 +4726,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4726,6 +4808,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4889,6 +4997,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4980,6 +5115,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5019,6 +5181,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5195,6 +5377,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5302,6 +5489,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5334,6 +5526,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6667,6 +6863,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -8244,6 +8573,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8334,6 +8690,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8389,6 +8772,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -10111,6 +10520,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10218,6 +10632,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10250,6 +10669,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10760,6 +11183,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10867,6 +11295,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10899,6 +11332,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12684,6 +13121,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12774,6 +13238,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12829,6 +13320,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12992,6 +13509,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13083,6 +13627,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13122,6 +13693,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13298,6 +13889,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13405,6 +14001,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13437,6 +14038,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14674,14 +15279,99 @@ true, "results.mp4", { - "path": "results.mp4", - "directory": "static/media", - "overwrite": "true" + "path": "results.mp4", + "directory": "static/media", + "overwrite": "true" + } + ] + } + }, + "title": "record" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "stopRecord" + ], + "properties": { + "stopRecord": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "stopRecord", + "description": "Stop the current recording.", + "anyOf": [ + { + "type": "boolean", + "nullable": true } + ], + "examples": [ + true ] } }, - "title": "record" + "title": "stopRecord" } ] }, @@ -14748,25 +15438,73 @@ { "type": "object", "required": [ - "stopRecord" + "terminateScope" ], "properties": { - "stopRecord": { + "terminateScope": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "stopRecord", - "description": "Stop the current recording.", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", "anyOf": [ { - "type": "boolean", - "nullable": true + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" } ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, "examples": [ - true + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -18903,6 +19641,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19010,6 +19753,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19042,6 +19790,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -19552,6 +20304,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19659,6 +20416,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19691,6 +20453,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -21476,6 +22242,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -21566,6 +22359,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -21621,6 +22441,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -21784,6 +22630,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -21875,6 +22748,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -21914,6 +22814,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -22090,6 +23010,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -22197,6 +23122,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -22229,6 +23159,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -23554,11 +24488,144 @@ } ], "examples": [ - true + true + ] + } + }, + "title": "stopRecord" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -26480,6 +27547,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26587,6 +27659,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26619,6 +27696,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -27129,6 +28210,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -27236,6 +28322,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -27268,6 +28359,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -29053,6 +30148,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29143,6 +30265,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29198,6 +30347,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -29361,6 +30536,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -29452,6 +30654,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -29491,6 +30720,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -29667,6 +30916,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -29774,6 +31028,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -29806,6 +31065,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -31139,6 +32402,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/runCode_v3.schema.json b/src/schemas/output_schemas/runCode_v3.schema.json index 23899a5..9917193 100644 --- a/src/schemas/output_schemas/runCode_v3.schema.json +++ b/src/schemas/output_schemas/runCode_v3.schema.json @@ -87,6 +87,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -178,6 +205,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -217,6 +271,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } \ No newline at end of file diff --git a/src/schemas/output_schemas/runShell_v3.schema.json b/src/schemas/output_schemas/runShell_v3.schema.json index a65de4f..a1da95e 100644 --- a/src/schemas/output_schemas/runShell_v3.schema.json +++ b/src/schemas/output_schemas/runShell_v3.schema.json @@ -86,6 +86,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -176,6 +203,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -231,6 +285,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } \ No newline at end of file diff --git a/src/schemas/output_schemas/spec_v3.schema.json b/src/schemas/output_schemas/spec_v3.schema.json index 4fb10e2..a9af4d7 100644 --- a/src/schemas/output_schemas/spec_v3.schema.json +++ b/src/schemas/output_schemas/spec_v3.schema.json @@ -2410,6 +2410,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2517,6 +2522,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2549,6 +2559,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3059,6 +3073,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3166,6 +3185,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3198,6 +3222,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4983,6 +5011,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5073,6 +5128,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5128,6 +5210,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -5291,6 +5399,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5382,6 +5517,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5421,6 +5583,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5597,6 +5779,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5704,6 +5891,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5736,6 +5928,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -7069,6 +7265,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -9987,6 +10316,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10094,6 +10428,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10126,6 +10465,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10636,6 +10979,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10743,6 +11091,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10775,6 +11128,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -12560,6 +12917,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12650,6 +13034,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12705,6 +13116,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12868,6 +13305,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12959,6 +13423,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12998,6 +13489,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13174,6 +13685,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13281,6 +13797,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13313,6 +13834,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14646,6 +15171,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/step_v3.schema.json b/src/schemas/output_schemas/step_v3.schema.json index fd6e96b..9980258 100644 --- a/src/schemas/output_schemas/step_v3.schema.json +++ b/src/schemas/output_schemas/step_v3.schema.json @@ -1210,6 +1210,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1317,6 +1322,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1349,6 +1359,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -1859,6 +1873,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1966,6 +1985,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1998,6 +2022,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3783,6 +3811,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -3873,6 +3928,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -3928,6 +4010,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4091,6 +4199,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4182,6 +4317,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4221,6 +4383,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -4397,6 +4579,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -4504,6 +4691,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -4536,6 +4728,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -5869,6 +6065,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/terminateScope_v3.schema.json b/src/schemas/output_schemas/terminateScope_v3.schema.json new file mode 100644 index 0000000..547c2e2 --- /dev/null +++ b/src/schemas/output_schemas/terminateScope_v3.schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] +} \ No newline at end of file diff --git a/src/schemas/output_schemas/test_v3.schema.json b/src/schemas/output_schemas/test_v3.schema.json index 5e3f97b..183fad3 100644 --- a/src/schemas/output_schemas/test_v3.schema.json +++ b/src/schemas/output_schemas/test_v3.schema.json @@ -1809,6 +1809,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1916,6 +1921,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -1948,6 +1958,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -2458,6 +2472,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2565,6 +2584,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2597,6 +2621,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4382,6 +4410,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4472,6 +4527,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -4527,6 +4609,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -4690,6 +4798,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4781,6 +4916,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -4820,6 +4982,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -4996,6 +5178,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5103,6 +5290,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5135,6 +5327,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -6468,6 +6664,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -9386,6 +9715,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -9493,6 +9827,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -9525,6 +9864,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -10035,6 +10378,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10142,6 +10490,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10174,6 +10527,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -11959,6 +12316,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12049,6 +12433,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -12104,6 +12515,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -12267,6 +12704,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12358,6 +12822,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -12397,6 +12888,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -12573,6 +13084,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -12680,6 +13196,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -12712,6 +13233,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -14045,6 +14570,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { diff --git a/src/schemas/output_schemas/type_v3.schema.json b/src/schemas/output_schemas/type_v3.schema.json index 566eda5..dc0f9d3 100644 --- a/src/schemas/output_schemas/type_v3.schema.json +++ b/src/schemas/output_schemas/type_v3.schema.json @@ -100,6 +100,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -207,6 +212,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -239,6 +249,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } \ No newline at end of file diff --git a/src/schemas/schemas.json b/src/schemas/schemas.json index 50f923a..8c26b7c 100644 --- a/src/schemas/schemas.json +++ b/src/schemas/schemas.json @@ -2393,6 +2393,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2500,6 +2505,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -2532,6 +2542,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -3042,6 +3056,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3149,6 +3168,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -3181,6 +3205,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -4966,6 +4994,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5056,6 +5111,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -5111,6 +5193,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -5274,6 +5382,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5365,6 +5500,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -5404,6 +5566,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -5580,6 +5762,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5687,6 +5874,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -5719,6 +5911,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -7052,6 +7248,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -8629,6 +8958,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8719,6 +9075,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -8774,6 +9157,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -10496,6 +10905,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10603,6 +11017,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -10635,6 +11054,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -11145,6 +11568,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -11252,6 +11680,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -11284,6 +11717,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -13069,6 +13506,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -13159,6 +13623,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -13214,6 +13705,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -13377,6 +13894,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13468,6 +14012,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -13507,6 +14078,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -13683,6 +14274,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13790,6 +14386,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -13822,6 +14423,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -15155,6 +15760,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -18230,6 +18968,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -18337,6 +19080,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -18369,6 +19117,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -18879,6 +19631,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -18986,6 +19743,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -19018,6 +19780,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -23012,6 +23778,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -23119,6 +23890,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -23151,6 +23927,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -23661,6 +24441,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -23768,6 +24553,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -23800,6 +24590,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -25585,6 +26379,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -25675,6 +26496,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -25730,6 +26578,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -25893,6 +26767,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -25984,6 +26885,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -26023,6 +26951,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -26199,6 +27147,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26306,6 +27259,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -26338,6 +27296,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -27671,6 +28633,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -29248,6 +30343,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29338,6 +30460,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -29393,6 +30542,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -31115,6 +32290,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -31222,6 +32402,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -31254,6 +32439,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -31764,6 +32953,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -31871,6 +33065,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -31903,6 +33102,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -33688,6 +34891,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -33778,6 +35008,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -33833,6 +35090,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -33996,6 +35279,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -34087,6 +35397,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -34126,6 +35463,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -34302,6 +35659,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -34409,6 +35771,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -34441,6 +35808,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -35774,6 +37145,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -39907,6 +41411,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -40014,6 +41523,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -40046,6 +41560,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -40556,6 +42074,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -40663,6 +42186,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -40695,6 +42223,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -42480,6 +44012,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -42570,6 +44129,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -42625,6 +44211,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -42788,6 +44400,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -42879,6 +44518,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -42918,6 +44584,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -43094,6 +44780,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -43201,6 +44892,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -43233,6 +44929,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -44566,6 +46266,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -47484,6 +49317,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -47591,6 +49429,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -47623,6 +49466,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -48133,6 +49980,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -48240,6 +50092,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -48272,6 +50129,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -50057,6 +51918,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -50147,6 +52035,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -50202,6 +52117,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -50365,6 +52306,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -50456,6 +52424,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -50495,6 +52490,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -50671,6 +52686,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -50778,6 +52798,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -50810,6 +52835,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -52143,6 +54172,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -56771,6 +58933,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -56878,6 +59045,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -56910,6 +59082,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -57420,6 +59596,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -57527,6 +59708,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -57559,6 +59745,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -59344,6 +61534,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -59434,6 +61651,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -59489,6 +61733,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -59652,6 +61922,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -59743,6 +62040,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -59782,6 +62106,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -59958,6 +62302,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -60065,6 +62414,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -60097,6 +62451,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -61430,6 +63788,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -64348,6 +66839,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -64455,6 +66951,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -64487,6 +66988,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -64997,6 +67502,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -65104,6 +67614,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -65136,6 +67651,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -66921,6 +69440,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -67011,6 +69557,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -67066,6 +69639,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -67229,6 +69828,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -67320,6 +69946,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -67359,6 +70012,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -67535,6 +70208,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -67642,6 +70320,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -67674,6 +70357,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -69068,22 +71755,155 @@ "title": "Common" }, { - "title": "loadVariables", "type": "object", "required": [ - "loadVariables" + "terminateScope" ], "properties": { - "loadVariables": { + "terminateScope": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "loadVariables", - "type": "string", - "description": "Load environment variables from the specified `.env` file.", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, "examples": [ - ".env" + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } - } + }, + "title": "terminateScope" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "title": "loadVariables", + "type": "object", + "required": [ + "loadVariables" + ], + "properties": { + "loadVariables": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "loadVariables", + "type": "string", + "description": "Load environment variables from the specified `.env` file.", + "examples": [ + ".env" + ] + } + } } ] }, @@ -71260,6 +74080,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -71351,6 +74198,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -71390,6 +74264,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] }, @@ -71481,6 +74375,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -71571,6 +74492,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -71626,6 +74574,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] }, @@ -75017,6 +77991,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -75124,6 +78103,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -75156,6 +78140,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -75666,6 +78654,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -75773,6 +78766,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -75805,6 +78803,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -77590,6 +80592,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -77680,6 +80709,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -77735,6 +80791,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -77898,6 +80980,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -77989,6 +81098,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -78028,6 +81164,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -78204,6 +81360,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -78311,6 +81472,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -78343,6 +81509,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -79676,6 +82846,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -82594,6 +85897,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -82701,6 +86009,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -82733,6 +86046,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -83243,6 +86560,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -83350,6 +86672,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -83382,6 +86709,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -85167,6 +88498,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -85257,6 +88615,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -85312,6 +88697,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -85475,6 +88886,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -85566,6 +89004,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -85605,6 +89070,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -85781,6 +89266,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -85888,6 +89378,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -85920,6 +89415,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -87253,6 +90752,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -90451,6 +94083,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -90558,6 +94195,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -90590,6 +94232,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -91100,6 +94746,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -91207,6 +94858,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -91239,6 +94895,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -93024,6 +96684,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -93114,6 +96801,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -93169,6 +96883,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -93332,6 +97072,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -93423,6 +97190,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -93462,6 +97256,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -93638,6 +97452,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -93745,6 +97564,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -93777,6 +97601,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -95088,25 +98916,158 @@ { "type": "object", "required": [ - "stopRecord" + "stopRecord" + ], + "properties": { + "stopRecord": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "stopRecord", + "description": "Stop the current recording.", + "anyOf": [ + { + "type": "boolean", + "nullable": true + } + ], + "examples": [ + true + ] + } + }, + "title": "stopRecord" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" ], "properties": { - "stopRecord": { + "terminateScope": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "stopRecord", - "description": "Stop the current recording.", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", "anyOf": [ { - "type": "boolean", - "nullable": true + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" } ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, "examples": [ - true + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -96572,6 +100533,68 @@ true ] }, + "terminateScope_v3": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + }, "test_v3": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "test", @@ -98383,6 +102406,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -98490,6 +102518,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -98522,6 +102555,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -99032,6 +103069,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -99139,6 +103181,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -99171,6 +103218,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -100956,6 +105007,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -101046,6 +105124,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -101101,6 +105206,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -101264,6 +105395,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -101355,6 +105513,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -101394,6 +105579,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -101570,6 +105775,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -101677,6 +105887,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -101709,6 +105924,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -103020,25 +107239,158 @@ { "type": "object", "required": [ - "stopRecord" + "stopRecord" + ], + "properties": { + "stopRecord": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "stopRecord", + "description": "Stop the current recording.", + "anyOf": [ + { + "type": "boolean", + "nullable": true + } + ], + "examples": [ + true + ] + } + }, + "title": "stopRecord" + } + ] + }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" ], "properties": { - "stopRecord": { + "terminateScope": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "stopRecord", - "description": "Stop the current recording.", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", "anyOf": [ { - "type": "boolean", - "nullable": true + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" } ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, "examples": [ - true + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } ] } }, - "title": "stopRecord" + "title": "terminateScope" } ] }, @@ -105960,6 +110312,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -106067,6 +110424,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -106099,6 +110461,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -106609,6 +110975,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -106716,6 +111087,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -106748,6 +111124,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, @@ -108533,6 +112913,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -108623,6 +113030,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run shell command (detailed)" @@ -108678,6 +113112,32 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": [ + "run", + "dev" + ], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": [ + "-f", + "/var/log/app.log" + ], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } } ] } @@ -108841,6 +113301,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -108932,6 +113419,33 @@ "type": "integer", "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } } }, "title": "Run code (detailed)" @@ -108971,6 +113485,26 @@ "directory": "output", "maxVariation": 0.1, "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } } ] } @@ -109147,6 +113681,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -109254,6 +113793,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -109286,6 +113830,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] } @@ -110619,6 +115167,139 @@ } ] }, + { + "allOf": [ + { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + }, + "title": "Common" + }, + { + "type": "object", + "required": [ + "terminateScope" + ], + "properties": { + "terminateScope": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] + } + }, + "title": "terminateScope" + } + ] + }, { "allOf": [ { @@ -112541,6 +117222,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -112648,6 +117334,11 @@ "elementAria": { "type": "string", "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "required": [ @@ -112680,6 +117371,10 @@ "$ENTER$" ], "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" } ] }, diff --git a/src/schemas/src_schemas/runCode_v3.schema.json b/src/schemas/src_schemas/runCode_v3.schema.json index 163f153..89355b2 100644 --- a/src/schemas/src_schemas/runCode_v3.schema.json +++ b/src/schemas/src_schemas/runCode_v3.schema.json @@ -1,137 +1,184 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "runCode", - "description": "Assemble and run code.", - "anyOf": [ - { - "$ref": "#/components/schemas/object" - } - ], - "components": { - "schemas": { - "object": { - "type": "object", - "required": [ - "code", - "language" - ], - "properties": { - "language": { - "type": "string", - "description": "Language of the code to run.", - "enum": [ - "python", - "bash", - "javascript" - ] - }, - "code": { - "description": "Code to run.", - "type": "string" - }, - "args": { - "type": "array", - "description": "Arguments for the command.", - "items": { - "anyOf": [ - { - "type": "string" - } - ] - }, - "default": [] - }, - "workingDirectory": { - "type": "string", - "description": "Working directory for the command.", - "default": "." - }, - "exitCodes": { - "type": "array", - "description": "Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.", - "items": { - "anyOf": [ - { - "type": "integer" - } - ] - }, - "default": [ - 0 - ] - }, - "stdio": { - "type": "string", - "description": "Content expected in the command's output. If the expected content can't be found in the command's output (either stdout or stderr), the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in `/^hello-world.*/`." - }, - "path": { - "type": "string", - "description": "File path to save the command's output, relative to `directory`." - }, - "directory": { - "type": "string", - "description": "Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory." - }, - "maxVariation": { - "type": "number", - "description": "Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than `maxVariation`, the step fails. If output doesn't exist at `path`, this value is ignored.", - "default": 0, - "minimum": 0, - "maximum": 1 - }, - "overwrite": { - "type": "string", - "description": "If `true`, overwrites the existing output at `path` if it exists.\nIf `aboveVariation`, overwrites the existing output at `path` if the difference between the new output and the existing output is greater than `maxVariation`.", - "enum": [ - "true", - "false", - "aboveVariation" - ], - "default": "aboveVariation" - }, - "timeout": { - "type": "integer", - "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", - "default": 60000 - } - }, - "title": "Run code (detailed)" - } - } - }, - "examples": [ - { - "language": "javascript", - "code": "console.log('Hello, ${process.env.USER}!');" - }, - { - "language": "bash", - "code": "docker run hello-world", - "timeout": 20000, - "exitCodes": [ - 0 - ], - "stdio": "Hello from Docker!" - }, - { - "language": "javascript", - "code": "return false", - "exitCodes": [ - 1 - ] - }, - { - "language": "python", - "code": "print('Hello from Python')", - "workingDirectory": ".", - "exitCodes": [ - 0 - ], - "stdio": "Hello from Python!", - "path": "python-output.txt", - "directory": "output", - "maxVariation": 0.1, - "overwrite": "aboveVariation" - } - ] +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "runCode", + "description": "Assemble and run code.", + "anyOf": [ + { + "$ref": "#/components/schemas/object" + } + ], + "components": { + "schemas": { + "object": { + "type": "object", + "required": [ + "code", + "language" + ], + "properties": { + "language": { + "type": "string", + "description": "Language of the code to run.", + "enum": [ + "python", + "bash", + "javascript" + ] + }, + "code": { + "description": "Code to run.", + "type": "string" + }, + "args": { + "type": "array", + "description": "Arguments for the command.", + "items": { + "anyOf": [ + { + "type": "string" + } + ] + }, + "default": [] + }, + "workingDirectory": { + "type": "string", + "description": "Working directory for the command.", + "default": "." + }, + "exitCodes": { + "type": "array", + "description": "Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.", + "items": { + "anyOf": [ + { + "type": "integer" + } + ] + }, + "default": [ + 0 + ] + }, + "stdio": { + "type": "string", + "description": "Content expected in the command's output. If the expected content can't be found in the command's output (either stdout or stderr), the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in `/^hello-world.*/`." + }, + "path": { + "type": "string", + "description": "File path to save the command's output, relative to `directory`." + }, + "directory": { + "type": "string", + "description": "Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory." + }, + "maxVariation": { + "type": "number", + "description": "Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than `maxVariation`, the step fails. If output doesn't exist at `path`, this value is ignored.", + "default": 0, + "minimum": 0, + "maximum": 1 + }, + "overwrite": { + "type": "string", + "description": "If `true`, overwrites the existing output at `path` if it exists.\nIf `aboveVariation`, overwrites the existing output at `path` if the difference between the new output and the existing output is greater than `maxVariation`.", + "enum": [ + "true", + "false", + "aboveVariation" + ], + "default": "aboveVariation" + }, + "timeout": { + "type": "integer", + "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", + "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent code execution session. Allows reusing the same execution context across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } + } + }, + "title": "Run code (detailed)" + } + } + }, + "examples": [ + { + "language": "javascript", + "code": "console.log('Hello, ${process.env.USER}!');" + }, + { + "language": "bash", + "code": "docker run hello-world", + "timeout": 20000, + "exitCodes": [ + 0 + ], + "stdio": "Hello from Docker!" + }, + { + "language": "javascript", + "code": "return false", + "exitCodes": [ + 1 + ] + }, + { + "language": "python", + "code": "print('Hello from Python')", + "workingDirectory": ".", + "exitCodes": [ + 0 + ], + "stdio": "Hello from Python!", + "path": "python-output.txt", + "directory": "output", + "maxVariation": 0.1, + "overwrite": "aboveVariation" + }, + { + "language": "python", + "code": "import time\nwhile True:\n print('Running')\n time.sleep(1)", + "scope": "background-process", + "waitUntil": { + "stdio": { + "stdout": "Running" + } + } + }, + { + "language": "javascript", + "code": "const http = require('http');\nconst server = http.createServer();\nserver.listen(3000, () => console.log('Server started'));", + "scope": "http-server", + "waitUntil": { + "stdio": { + "stdout": "/Server started/" + } + } + } + ] } \ No newline at end of file diff --git a/src/schemas/src_schemas/runShell_v3.schema.json b/src/schemas/src_schemas/runShell_v3.schema.json index 1d490ca..5e21f13 100644 --- a/src/schemas/src_schemas/runShell_v3.schema.json +++ b/src/schemas/src_schemas/runShell_v3.schema.json @@ -1,155 +1,202 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "runShell", - "description": "Perform a native shell command.", - "anyOf": [ - { - "$ref": "#/components/schemas/string" - }, - { - "$ref": "#/components/schemas/object" - } - ], - "components": { - "schemas": { - "string": { - "title": "Run shell command (simple)", - "description": "Command to perform in the machine's default shell.", - "type": "string", - "transform": [ - "trim" - ] - }, - "object": { - "type": "object", - "required": [ - "command" - ], - "additionalProperties": false, - "properties": { - "command": { - "type": "string", - "description": "Command to perform in the machine's default shell." - }, - "args": { - "type": "array", - "description": "Arguments for the command.", - "items": { - "anyOf": [ - { - "type": "string" - } - ] - }, - "default": [] - }, - "workingDirectory": { - "type": "string", - "description": "Working directory for the command.", - "default": "." - }, - "exitCodes": { - "type": "array", - "description": "Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.", - "items": { - "anyOf": [ - { - "type": "integer" - } - ] - }, - "default": [ - 0 - ] - }, - "stdio": { - "type": "string", - "description": "Content expected in the command's stdout or stderr. If the expected content can't be found in the command's stdout or stderr, the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in `/^hello-world.*/`." - }, - "path": { - "type": "string", - "description": "File path to save the command's output, relative to `directory`." - }, - "directory": { - "type": "string", - "description": "Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory." - }, - "maxVariation": { - "type": "number", - "description": "Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than `maxVariation`, the step fails. If output doesn't exist at `path`, this value is ignored.", - "default": 0, - "minimum": 0, - "maximum": 1 - }, - "overwrite": { - "type": "string", - "description": "If `true`, overwrites the existing output at `path` if it exists.\nIf `aboveVariation`, overwrites the existing output at `path` if the difference between the new output and the existing output is greater than `maxVariation`.", - "enum": [ - "true", - "false", - "aboveVariation" - ], - "default": "aboveVariation" - }, - "timeout": { - "type": "integer", - "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", - "default": 60000 - } - }, - "title": "Run shell command (detailed)" - } - } - }, - "examples": [ - "docker run hello-world", - { - "command": "echo", - "args": [ - "$USER" - ] - }, - { - "command": "echo", - "args": [ - "hello-world" - ] - }, - { - "command": "docker run hello-world", - "timeout": 20000, - "exitCodes": [ - 0 - ], - "stdio": "Hello from Docker!" - }, - { - "command": "false", - "exitCodes": [ - 1 - ] - }, - { - "command": "echo", - "args": [ - "setup" - ], - "exitCodes": [ - 0 - ], - "stdio": "/.*?/" - }, - { - "command": "docker run hello-world", - "workingDirectory": ".", - "exitCodes": [ - 0 - ], - "stdio": "Hello from Docker!", - "path": "docker-output.txt", - "directory": "output", - "maxVariation": 0.1, - "overwrite": "aboveVariation" - } - ] +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "runShell", + "description": "Perform a native shell command.", + "anyOf": [ + { + "$ref": "#/components/schemas/string" + }, + { + "$ref": "#/components/schemas/object" + } + ], + "components": { + "schemas": { + "string": { + "title": "Run shell command (simple)", + "description": "Command to perform in the machine's default shell.", + "type": "string", + "transform": [ + "trim" + ] + }, + "object": { + "type": "object", + "required": [ + "command" + ], + "additionalProperties": false, + "properties": { + "command": { + "type": "string", + "description": "Command to perform in the machine's default shell." + }, + "args": { + "type": "array", + "description": "Arguments for the command.", + "items": { + "anyOf": [ + { + "type": "string" + } + ] + }, + "default": [] + }, + "workingDirectory": { + "type": "string", + "description": "Working directory for the command.", + "default": "." + }, + "exitCodes": { + "type": "array", + "description": "Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.", + "items": { + "anyOf": [ + { + "type": "integer" + } + ] + }, + "default": [ + 0 + ] + }, + "stdio": { + "type": "string", + "description": "Content expected in the command's stdout or stderr. If the expected content can't be found in the command's stdout or stderr, the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in `/^hello-world.*/`." + }, + "path": { + "type": "string", + "description": "File path to save the command's output, relative to `directory`." + }, + "directory": { + "type": "string", + "description": "Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory." + }, + "maxVariation": { + "type": "number", + "description": "Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than `maxVariation`, the step fails. If output doesn't exist at `path`, this value is ignored.", + "default": 0, + "minimum": 0, + "maximum": 1 + }, + "overwrite": { + "type": "string", + "description": "If `true`, overwrites the existing output at `path` if it exists.\nIf `aboveVariation`, overwrites the existing output at `path` if the difference between the new output and the existing output is greater than `maxVariation`.", + "enum": [ + "true", + "false", + "aboveVariation" + ], + "default": "aboveVariation" + }, + "timeout": { + "type": "integer", + "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.", + "default": 60000 + }, + "scope": { + "type": "string", + "description": "Named scope for persistent terminal session. Allows reusing the same terminal across multiple steps. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "waitUntil": { + "type": "object", + "description": "Conditions to wait for before considering the step complete. Waits for patterns to appear in stdout or stderr output. Useful for long-running processes or waiting for specific output.", + "additionalProperties": false, + "properties": { + "stdio": { + "type": "object", + "description": "Standard I/O stream conditions to wait for.", + "additionalProperties": false, + "properties": { + "stdout": { + "type": "string", + "description": "Pattern to match in stdout. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + }, + "stderr": { + "type": "string", + "description": "Pattern to match in stderr. Supports strings and regular expressions. To use a regex, the string must start and end with a forward slash, like `/pattern/flags`." + } + } + } + } + } + }, + "title": "Run shell command (detailed)" + } + } + }, + "examples": [ + "docker run hello-world", + { + "command": "echo", + "args": [ + "$USER" + ] + }, + { + "command": "echo", + "args": [ + "hello-world" + ] + }, + { + "command": "docker run hello-world", + "timeout": 20000, + "exitCodes": [ + 0 + ], + "stdio": "Hello from Docker!" + }, + { + "command": "false", + "exitCodes": [ + 1 + ] + }, + { + "command": "echo", + "args": [ + "setup" + ], + "exitCodes": [ + 0 + ], + "stdio": "/.*?/" + }, + { + "command": "docker run hello-world", + "workingDirectory": ".", + "exitCodes": [ + 0 + ], + "stdio": "Hello from Docker!", + "path": "docker-output.txt", + "directory": "output", + "maxVariation": 0.1, + "overwrite": "aboveVariation" + }, + { + "command": "npm", + "args": ["run", "dev"], + "scope": "dev-server", + "waitUntil": { + "stdio": { + "stdout": "Server listening on" + } + } + }, + { + "command": "tail", + "args": ["-f", "/var/log/app.log"], + "scope": "log-monitor", + "waitUntil": { + "stdio": { + "stdout": "/ERROR.*critical/" + } + } + } + ] } \ No newline at end of file diff --git a/src/schemas/src_schemas/step_v3.schema.json b/src/schemas/src_schemas/step_v3.schema.json index b5f66a2..7acd654 100644 --- a/src/schemas/src_schemas/step_v3.schema.json +++ b/src/schemas/src_schemas/step_v3.schema.json @@ -1,632 +1,649 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "step", - "description": "A step in a test.", - "type": "object", - "components": { - "schemas": { - "common": { - "type": "object", - "dynamicDefaults": { - "stepId": "uuid" - }, - "properties": { - "$schema": { - "$ref": "#/components/schemas/$schema" - }, - "stepId": { - "$ref": "#/components/schemas/stepId" - }, - "description": { - "$ref": "#/components/schemas/description" - }, - "unsafe": { - "$ref": "#/components/schemas/unsafe" - }, - "outputs": { - "$ref": "#/components/schemas/outputs" - }, - "variables": { - "$ref": "#/components/schemas/variables" - }, - "breakpoint": { - "$ref": "#/components/schemas/breakpoint" - } - }, - "title": "Common" - }, - "$schema": { - "description": "JSON Schema for this object.", - "type": "string", - "enum": [ - "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" - ] - }, - "stepId": { - "type": "string", - "description": "ID of the step." - }, - "description": { - "type": "string", - "description": "Description of the step." - }, - "unsafe": { - "type": "boolean", - "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", - "default": false - }, - "outputs": { - "type": "object", - "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", - "default": {}, - "patternProperties": { - "^[A-Za-z0-9_]+$": { - "type": "string", - "description": "Runtime expression for a user-defined output value." - } - }, - "title": "Outputs (step)" - }, - "variables": { - "type": "object", - "description": "Environment variables to set from user-defined expressions.", - "default": {}, - "patternProperties": { - "^[A-Za-z0-9_]+$": { - "type": "string", - "description": "Runtime expression for a user-defined output value." - } - }, - "title": "Variables (step)" - }, - "breakpoint": { - "type": "boolean", - "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", - "default": false - } - } - }, - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["checkLink"], - "properties": { - "checkLink": { - "$ref": "checkLink_v3.schema.json#" - } - }, - "title": "checkLink" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["click"], - "properties": { - "click": { - "$ref": "click_v3.schema.json#" - } - }, - "title": "click" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["find"], - "properties": { - "find": { - "$ref": "find_v3.schema.json#" - } - }, - "title": "find" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["goTo"], - "properties": { - "goTo": { - "$ref": "goTo_v3.schema.json#" - } - }, - "title": "goTo" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["httpRequest"], - "properties": { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#" - } - }, - "title": "httpRequest" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["runShell"], - "properties": { - "runShell": { - "$ref": "runShell_v3.schema.json#" - } - }, - "title": "runShell" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["runCode"], - "properties": { - "runCode": { - "$ref": "runCode_v3.schema.json#" - } - }, - "title": "runCode" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["type"], - "properties": { - "type": { - "$ref": "type_v3.schema.json#" - } - }, - "title": "type" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["screenshot"], - "properties": { - "screenshot": { - "$ref": "screenshot_v3.schema.json#" - } - }, - "title": "screenshot" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["saveCookie"], - "properties": { - "saveCookie": { - "$ref": "saveCookie_v3.schema.json#" - } - }, - "title": "saveCookie" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["record"], - "properties": { - "record": { - "$ref": "record_v3.schema.json#" - } - }, - "title": "record" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "type": "object", - "required": ["stopRecord"], - "properties": { - "stopRecord": { - "$ref": "stopRecord_v3.schema.json#" - } - }, - "title": "stopRecord" - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "title": "loadVariables", - "type": "object", - "required": ["loadVariables"], - "properties": { - "loadVariables": { - "$ref": "loadVariables_v3.schema.json#" - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "title": "dragAndDrop", - "type": "object", - "required": ["dragAndDrop"], - "properties": { - "dragAndDrop": { - "$ref": "dragAndDrop_v3.schema.json#" - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "title": "loadCookie", - "type": "object", - "required": ["loadCookie"], - "properties": { - "loadCookie": { - "$ref": "loadCookie_v3.schema.json#" - } - } - } - ] - }, - { - "allOf": [ - { - "$ref": "#/components/schemas/common" - }, - { - "title": "wait", - "type": "object", - "required": ["wait"], - "properties": { - "wait": { - "$ref": "wait_v3.schema.json#" - } - } - } - ] - } - ], - "examples": [ - { - "stepId": "uuid", - "description": "Description of the step.", - "checkLink": "https://www.google.com", - "outputs": { - "outputKey": "outputValue" - }, - "variables": { - "variableKey": "variableValue" - } - }, - { - "checkLink": "https://www.google.com" - }, - { - "stepId": "path-only", - "checkLink": "/search" - }, - { - "stepId": "status-code", - "checkLink": { - "url": "https://www.google.com", - "statusCodes": [200] - } - }, - { - "goTo": { - "url": "https://www.google.com" - } - }, - { - "goTo": "https://www.google.com" - }, - { - "wait": 5000 - }, - { - "runCode": { - "language": "python", - "code": "print('Hello from Python')", - "workingDirectory": ".", - "exitCodes": [0], - "stdio": "Hello from Python!", - "path": "python-output.txt", - "directory": "output", - "maxVariation": 0.1, - "overwrite": "aboveVariation" - } - }, - { - "stopRecord": true - }, - { - "screenshot": true - }, - { - "screenshot": "image.png" - }, - { - "screenshot": "static/images/image.png" - }, - { - "screenshot": "/User/manny/projects/doc-detective/static/images/image.png" - }, - { - "screenshot": { - "path": "image.png", - "directory": "static/images", - "maxVariation": 0.1, - "overwrite": "aboveVariation", - "crop": "#elementToScreenshot" - } - }, - { - "screenshot": { - "path": "image.png", - "directory": "static/images", - "maxVariation": 0.1, - "overwrite": "aboveVariation" - } - }, - { - "screenshot": { - "path": "image.png", - "directory": "static/images", - "maxVariation": 0.1, - "overwrite": "aboveVariation", - "crop": { - "selector": "#elementToScreenshot", - "elementText": "Element text", - "padding": { - "top": 0, - "right": 0, - "bottom": 0, - "left": 0 - } - } - } - }, - { - "record": true - }, - { - "record": "video.mp4" - }, - { - "record": "static/media/video.mp4" - }, - { - "record": "/User/manny/projects/doc-detective/static/media/video.mp4" - }, - { - "record": { - "path": "video.mp4", - "directory": "static/media", - "overwrite": true - } - }, - { - "loadVariables": "variables.env" - }, - { - "saveCookie": "session_token" - }, - { - "saveCookie": { - "name": "auth_cookie", - "path": "auth-session.txt", - "directory": "./test-data", - "overwrite": true - } - }, - { - "loadCookie": "session_token" - }, - { - "loadCookie": { - "name": "auth_cookie", - "path": "auth-session.txt", - "directory": "./test-data" - } - }, - { - "find": { - "$ref": "find_v3.schema.json#/examples/0" - } - }, - { - "find": { - "$ref": "find_v3.schema.json#/examples/1" - } - }, - { - "find": { - "$ref": "find_v3.schema.json#/examples/2" - } - }, - { - "find": { - "$ref": "find_v3.schema.json#/examples/3" - } - }, - { - "find": { - "$ref": "find_v3.schema.json#/examples/4" - } - }, - { - "click": { - "$ref": "click_v3.schema.json#/examples/0" - } - }, - { - "click": { - "$ref": "click_v3.schema.json#/examples/1" - } - }, - { - "click": { - "$ref": "click_v3.schema.json#/examples/2" - } - }, - { - "click": { - "$ref": "click_v3.schema.json#/examples/3" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/0" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/1" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/2" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/3" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/4" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/5" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/6" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/7" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/8" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/9" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/10" - } - }, - { - "httpRequest": { - "$ref": "httpRequest_v3.schema.json#/examples/11" - } - }, - { - "stepId": "breakpoint-example", - "description": "Step with breakpoint enabled", - "goTo": "https://www.example.com", - "breakpoint": true - }, - { - "checkLink": "https://www.google.com", - "breakpoint": false - }, - { - "dragAndDrop": { - "source": { - "selector": "#sourceElement" - }, - "target": { - "selector": "#targetElement" - } - } - } - ] -} +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "step", + "description": "A step in a test.", + "type": "object", + "components": { + "schemas": { + "common": { + "type": "object", + "dynamicDefaults": { + "stepId": "uuid" + }, + "properties": { + "$schema": { + "$ref": "#/components/schemas/$schema" + }, + "stepId": { + "$ref": "#/components/schemas/stepId" + }, + "description": { + "$ref": "#/components/schemas/description" + }, + "unsafe": { + "$ref": "#/components/schemas/unsafe" + }, + "outputs": { + "$ref": "#/components/schemas/outputs" + }, + "variables": { + "$ref": "#/components/schemas/variables" + }, + "breakpoint": { + "$ref": "#/components/schemas/breakpoint" + } + }, + "title": "Common" + }, + "$schema": { + "description": "JSON Schema for this object.", + "type": "string", + "enum": [ + "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json" + ] + }, + "stepId": { + "type": "string", + "description": "ID of the step." + }, + "description": { + "type": "string", + "description": "Description of the step." + }, + "unsafe": { + "type": "boolean", + "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.", + "default": false + }, + "outputs": { + "type": "object", + "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Outputs (step)" + }, + "variables": { + "type": "object", + "description": "Environment variables to set from user-defined expressions.", + "default": {}, + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": "string", + "description": "Runtime expression for a user-defined output value." + } + }, + "title": "Variables (step)" + }, + "breakpoint": { + "type": "boolean", + "description": "Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.", + "default": false + } + } + }, + "anyOf": [ + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["checkLink"], + "properties": { + "checkLink": { + "$ref": "checkLink_v3.schema.json#" + } + }, + "title": "checkLink" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["click"], + "properties": { + "click": { + "$ref": "click_v3.schema.json#" + } + }, + "title": "click" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["find"], + "properties": { + "find": { + "$ref": "find_v3.schema.json#" + } + }, + "title": "find" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["goTo"], + "properties": { + "goTo": { + "$ref": "goTo_v3.schema.json#" + } + }, + "title": "goTo" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["httpRequest"], + "properties": { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#" + } + }, + "title": "httpRequest" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["runShell"], + "properties": { + "runShell": { + "$ref": "runShell_v3.schema.json#" + } + }, + "title": "runShell" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["runCode"], + "properties": { + "runCode": { + "$ref": "runCode_v3.schema.json#" + } + }, + "title": "runCode" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "$ref": "type_v3.schema.json#" + } + }, + "title": "type" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["screenshot"], + "properties": { + "screenshot": { + "$ref": "screenshot_v3.schema.json#" + } + }, + "title": "screenshot" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["saveCookie"], + "properties": { + "saveCookie": { + "$ref": "saveCookie_v3.schema.json#" + } + }, + "title": "saveCookie" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["record"], + "properties": { + "record": { + "$ref": "record_v3.schema.json#" + } + }, + "title": "record" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["stopRecord"], + "properties": { + "stopRecord": { + "$ref": "stopRecord_v3.schema.json#" + } + }, + "title": "stopRecord" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "type": "object", + "required": ["terminateScope"], + "properties": { + "terminateScope": { + "$ref": "terminateScope_v3.schema.json#" + } + }, + "title": "terminateScope" + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "title": "loadVariables", + "type": "object", + "required": ["loadVariables"], + "properties": { + "loadVariables": { + "$ref": "loadVariables_v3.schema.json#" + } + } + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "title": "dragAndDrop", + "type": "object", + "required": ["dragAndDrop"], + "properties": { + "dragAndDrop": { + "$ref": "dragAndDrop_v3.schema.json#" + } + } + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "title": "loadCookie", + "type": "object", + "required": ["loadCookie"], + "properties": { + "loadCookie": { + "$ref": "loadCookie_v3.schema.json#" + } + } + } + ] + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/common" + }, + { + "title": "wait", + "type": "object", + "required": ["wait"], + "properties": { + "wait": { + "$ref": "wait_v3.schema.json#" + } + } + } + ] + } + ], + "examples": [ + { + "stepId": "uuid", + "description": "Description of the step.", + "checkLink": "https://www.google.com", + "outputs": { + "outputKey": "outputValue" + }, + "variables": { + "variableKey": "variableValue" + } + }, + { + "checkLink": "https://www.google.com" + }, + { + "stepId": "path-only", + "checkLink": "/search" + }, + { + "stepId": "status-code", + "checkLink": { + "url": "https://www.google.com", + "statusCodes": [200] + } + }, + { + "goTo": { + "url": "https://www.google.com" + } + }, + { + "goTo": "https://www.google.com" + }, + { + "wait": 5000 + }, + { + "runCode": { + "language": "python", + "code": "print('Hello from Python')", + "workingDirectory": ".", + "exitCodes": [0], + "stdio": "Hello from Python!", + "path": "python-output.txt", + "directory": "output", + "maxVariation": 0.1, + "overwrite": "aboveVariation" + } + }, + { + "stopRecord": true + }, + { + "screenshot": true + }, + { + "screenshot": "image.png" + }, + { + "screenshot": "static/images/image.png" + }, + { + "screenshot": "/User/manny/projects/doc-detective/static/images/image.png" + }, + { + "screenshot": { + "path": "image.png", + "directory": "static/images", + "maxVariation": 0.1, + "overwrite": "aboveVariation", + "crop": "#elementToScreenshot" + } + }, + { + "screenshot": { + "path": "image.png", + "directory": "static/images", + "maxVariation": 0.1, + "overwrite": "aboveVariation" + } + }, + { + "screenshot": { + "path": "image.png", + "directory": "static/images", + "maxVariation": 0.1, + "overwrite": "aboveVariation", + "crop": { + "selector": "#elementToScreenshot", + "elementText": "Element text", + "padding": { + "top": 0, + "right": 0, + "bottom": 0, + "left": 0 + } + } + } + }, + { + "record": true + }, + { + "record": "video.mp4" + }, + { + "record": "static/media/video.mp4" + }, + { + "record": "/User/manny/projects/doc-detective/static/media/video.mp4" + }, + { + "record": { + "path": "video.mp4", + "directory": "static/media", + "overwrite": true + } + }, + { + "loadVariables": "variables.env" + }, + { + "saveCookie": "session_token" + }, + { + "saveCookie": { + "name": "auth_cookie", + "path": "auth-session.txt", + "directory": "./test-data", + "overwrite": true + } + }, + { + "loadCookie": "session_token" + }, + { + "loadCookie": { + "name": "auth_cookie", + "path": "auth-session.txt", + "directory": "./test-data" + } + }, + { + "find": { + "$ref": "find_v3.schema.json#/examples/0" + } + }, + { + "find": { + "$ref": "find_v3.schema.json#/examples/1" + } + }, + { + "find": { + "$ref": "find_v3.schema.json#/examples/2" + } + }, + { + "find": { + "$ref": "find_v3.schema.json#/examples/3" + } + }, + { + "find": { + "$ref": "find_v3.schema.json#/examples/4" + } + }, + { + "click": { + "$ref": "click_v3.schema.json#/examples/0" + } + }, + { + "click": { + "$ref": "click_v3.schema.json#/examples/1" + } + }, + { + "click": { + "$ref": "click_v3.schema.json#/examples/2" + } + }, + { + "click": { + "$ref": "click_v3.schema.json#/examples/3" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/0" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/1" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/2" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/3" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/4" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/5" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/6" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/7" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/8" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/9" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/10" + } + }, + { + "httpRequest": { + "$ref": "httpRequest_v3.schema.json#/examples/11" + } + }, + { + "stepId": "breakpoint-example", + "description": "Step with breakpoint enabled", + "goTo": "https://www.example.com", + "breakpoint": true + }, + { + "checkLink": "https://www.google.com", + "breakpoint": false + }, + { + "dragAndDrop": { + "source": { + "selector": "#sourceElement" + }, + "target": { + "selector": "#targetElement" + } + } + } + ] +} diff --git a/src/schemas/src_schemas/terminateScope_v3.schema.json b/src/schemas/src_schemas/terminateScope_v3.schema.json new file mode 100644 index 0000000..e2899e0 --- /dev/null +++ b/src/schemas/src_schemas/terminateScope_v3.schema.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "terminateScope", + "description": "Terminate a named scope and its associated process.", + "anyOf": [ + { + "$ref": "#/components/schemas/string" + }, + { + "$ref": "#/components/schemas/object" + } + ], + "components": { + "schemas": { + "string": { + "title": "Terminate scope (simple)", + "description": "Name of the scope to terminate.", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + }, + "object": { + "type": "object", + "required": [ + "scope" + ], + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "description": "Name of the scope to terminate. The associated process will receive SIGTERM, followed by SIGKILL after a grace period if still running.", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "title": "Terminate scope (detailed)" + } + } + }, + "examples": [ + "dev-server", + { + "scope": "background-process" + }, + { + "scope": "log-monitor" + } + ] +} diff --git a/src/schemas/src_schemas/type_v3.schema.json b/src/schemas/src_schemas/type_v3.schema.json index 5d36f4b..fda2dc9 100644 --- a/src/schemas/src_schemas/type_v3.schema.json +++ b/src/schemas/src_schemas/type_v3.schema.json @@ -1,118 +1,127 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "typeKeys", - "description": "Type keys. To type special keys, begin and end the string with `$` and use the special key's keyword. For example, to type the Escape key, enter `$ESCAPE$`.", - "anyOf": [ - { - "$ref": "#/components/schemas/keys" - }, - { - "$ref": "#/components/schemas/object" - } - ], - "components": { - "schemas": { - "keys": { - "title": "Type keys (simple)", - "description": "Sequence of keys to enter.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - } - ] - } - } - ] - }, - "object": { - "title": "Type keys (detailed)", - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/keys" - }, - "inputDelay": { - "type": "number", - "description": "Delay in milliseconds between each key press during a recording", - "default": 100 - }, - "selector": { - "type": "string", - "description": "Selector for the element to type into. If not specified, the typing occurs in the active element." - }, - "elementText": { - "type": "string", - "description": "Display text of the element to type into. If combined with other element finding fields, the element must match all specified criteria." - }, - "elementId": { - "type": "string", - "description": "ID attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax." - }, - "elementTestId": { - "type": "string", - "description": "data-testid attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax." - }, - "elementClass": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], - "description": "Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes." - }, - "elementAttribute": { - "type": "object", - "description": "Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence.", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - } - }, - "elementAria": { - "type": "string", - "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." - } - }, - "required": ["keys"], - "additionalProperties": false - } - } - }, - "examples": [ - "kittens", - ["$ENTER$"], - ["kittens", "$ENTER$"], - { - "keys": "kittens" - }, - { - "keys": ["$ENTER$"] - }, - { - "keys": ["kittens", "$ENTER$"], - "inputDelay": 500 - } - ] -} +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "typeKeys", + "description": "Type keys. To type special keys, begin and end the string with `$` and use the special key's keyword. For example, to type the Escape key, enter `$ESCAPE$`.", + "anyOf": [ + { + "$ref": "#/components/schemas/keys" + }, + { + "$ref": "#/components/schemas/object" + } + ], + "components": { + "schemas": { + "keys": { + "title": "Type keys (simple)", + "description": "Sequence of keys to enter.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + } + ] + } + } + ] + }, + "object": { + "title": "Type keys (detailed)", + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/keys" + }, + "inputDelay": { + "type": "number", + "description": "Delay in milliseconds between each key press during a recording", + "default": 100 + }, + "selector": { + "type": "string", + "description": "Selector for the element to type into. If not specified, the typing occurs in the active element." + }, + "elementText": { + "type": "string", + "description": "Display text of the element to type into. If combined with other element finding fields, the element must match all specified criteria." + }, + "elementId": { + "type": "string", + "description": "ID attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax." + }, + "elementTestId": { + "type": "string", + "description": "data-testid attribute of the element to find. Supports exact match or regex pattern using /pattern/ syntax." + }, + "elementClass": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes." + }, + "elementAttribute": { + "type": "object", + "description": "Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence.", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "elementAria": { + "type": "string", + "description": "Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax." + }, + "scope": { + "type": "string", + "description": "Named scope of an existing terminal or code session to type into. When specified, sends input to the scoped process instead of the browser. Scope names must be alphanumeric with hyphens or underscores (1-64 characters).", + "pattern": "^[a-zA-Z0-9_-]{1,64}$" + } + }, + "required": ["keys"], + "additionalProperties": false + } + } + }, + "examples": [ + "kittens", + ["$ENTER$"], + ["kittens", "$ENTER$"], + { + "keys": "kittens" + }, + { + "keys": ["$ENTER$"] + }, + { + "keys": ["kittens", "$ENTER$"], + "inputDelay": 500 + }, + { + "keys": "ls -la\n", + "scope": "dev-server" + } + ] +}