← All procedures

client.trace

Run the steps of a chain one at a time, and give one row for each step. A step that can write does not run.

MCPCLIbrowser
Package
@procedures/client · README
Path
["client","trace"]
CLI
mark client trace --steps <any[]>
MCP tool
client.trace on the dev-tools server
As data
{"$proc":["client","trace"],"input":{}}
Tags
core, control-flow, runs-refs

Try it in the Composer →

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";

for (const procedure of allCoreProcedures) {
  if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","trace"], { steps: [] });
console.log(JSON.stringify(result));

From the command line

$ mark client trace --steps <any[]>

As data, in a program

{ "$proc": ["client", "trace"], "input": { "steps": [] } }

Input

FieldTypeRequired
upTonumberno
sampleLimitnumberno
stepsunknown[]yes
passThroughbooleanno
initialInputunknownno

Output

FieldTypeRequiredDefaultDescription
stepsobject[]yesOne row for each step, in order
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "steps": {
        "type": "array",
        "items": {},
        "description": "The steps of a client.chain program, in order: calls or values"
      },
      "passThrough": {
        "description": "Give each step that has no input the result of the step before",
        "type": "boolean"
      },
      "initialInput": {
        "description": "The input of the first step when passThrough is true"
      },
      "upTo": {
        "description": "The index of the last step to run (default: all steps)",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "sampleLimit": {
        "description": "The most items of each array in the output of a row. The next step gets the full value.",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      }
    },
    "required": [
      "steps"
    ],
    "additionalProperties": {}
  },
  "output": {
    "type": "object",
    "properties": {
      "steps": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "index": {
              "type": "number",
              "description": "The index of the step"
            },
            "name": {
              "description": "The $name of the step",
              "type": "string"
            },
            "proc": {
              "description": "The procedure path of a call step",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "effects": {
              "description": "The declared effects of the procedure of a call step"
            },
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "not-run",
                "error"
              ],
              "description": "ok: the step ran. not-run: the step did not start. error: the step failed."
            },
            "reason": {
              "description": "Why a step did not run",
              "type": "string",
              "enum": [
                "writes",
                "upTo",
                "when",
                "earlier"
              ]
            },
            "output": {
              "description": "The result of the step, with sampleLimit applied"
            },
            "error": {
              "description": "The error of the step",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": {}
            }
          },
          "required": [
            "index",
            "status"
          ],
          "additionalProperties": {}
        },
        "description": "One row for each step, in order"
      }
    },
    "required": [
      "steps"
    ],
    "additionalProperties": {}
  }
}