@parcha/agentrun-dsl 0.1.0-beta.48 → 0.1.0-beta.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,6 @@
4
4
  * against, so each local `$ref` (`#`, `#/...`) is relocated under `#/properties/value`. A subschema
5
5
  * that sets its own `$id` is a separate resource: its local references do not move. Every runner that
6
6
  * delivers a node's record through a tool call uses this one envelope, so a schema behaves the same on
7
- * every harness. A keyword the host alone reads (`criteria`, `x-carried`) is left out of every schema in it, never a property or
7
+ * every harness. A keyword the host alone reads (`criteria`, any `x-` one) is left out of every schema in it, never a property or
8
8
  * definition of that name; the submission is still checked against the node's schema as written. */
9
9
  export declare function submitParameters(schema: unknown): Record<string, unknown>;
@@ -1,15 +1,15 @@
1
1
  // Keywords that may sit on a schema but are not JSON Schema, read by the host alone: the DSL's `criteria` (System One's
2
- // question keyword) and AgentRun's `x-carried` (the fields of an agent's answer its next run reads back, an annotation an
3
- // agent's output schema carries and a learned workflow's output node can copy; Google's OpenAPI-subset `parameters`
4
- // refuses a field it does not know). The model never sees them.
5
- const DSL_ONLY_SCHEMA_KEYWORDS = new Set(["criteria", "x-carried"]);
2
+ // question keyword) and every `x-` annotation (AgentRun's `x-carried`, the fields of an agent's answer its next run reads
3
+ // back, which a learned workflow's output node can copy from the agent's output schema). Google's OpenAPI-subset
4
+ // `parameters` refuses a field it does not know. The model never sees them.
5
+ const hostOnlyKeyword = (key) => key === "criteria" || key.startsWith("x-");
6
6
  /** The input schema of a node runner's `submit` tool: the node's output schema under `value`, as
7
7
  * `{ value: <schema> }`. A node schema is not a valid tool input as it stands (a root `$ref` or `$defs`
8
8
  * is not an object schema), and embedding it moves the document root its local pointers resolve
9
9
  * against, so each local `$ref` (`#`, `#/...`) is relocated under `#/properties/value`. A subschema
10
10
  * that sets its own `$id` is a separate resource: its local references do not move. Every runner that
11
11
  * delivers a node's record through a tool call uses this one envelope, so a schema behaves the same on
12
- * every harness. A keyword the host alone reads (`criteria`, `x-carried`) is left out of every schema in it, never a property or
12
+ * every harness. A keyword the host alone reads (`criteria`, any `x-` one) is left out of every schema in it, never a property or
13
13
  * definition of that name; the submission is still checked against the node's schema as written. */
14
14
  export function submitParameters(schema) {
15
15
  const maps = new Set(["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"]);
@@ -21,7 +21,7 @@ export function submitParameters(schema) {
21
21
  // $id establishes a separate schema resource: its local references do not move.
22
22
  resourceScope ||= typeof node.$id === "string" && node.$id !== "";
23
23
  const child = (value) => relocate(value, resourceScope);
24
- return Object.fromEntries(Object.entries(node).filter(([key]) => !DSL_ONLY_SCHEMA_KEYWORDS.has(key)).map(([key, value]) => {
24
+ return Object.fromEntries(Object.entries(node).filter(([key]) => !hostOnlyKeyword(key)).map(([key, value]) => {
25
25
  if (!resourceScope && key === "$ref" && typeof value === "string" && (value === "#" || value.startsWith("#/"))) {
26
26
  return [key, `#/properties/value${value.slice(1)}`];
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-dsl",
3
- "version": "0.1.0-beta.48",
3
+ "version": "0.1.0-beta.49",
4
4
  "description": "Composable, typed workflows for agents",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",