{
  "id": "toml-config-compose",
  "name": "Typed TOML configuration composer",
  "description": "Compose deterministic TOML 1.0-compatible configuration from explicit string, signed-int64, boolean and homogeneous-array declarations; preserve integer precision and detect table conflicts.",
  "category": "structured",
  "priceUsd": "0.005",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.005",
    "sixDecimalTokenBaseUnits": "5000",
    "subscription": false,
    "includesPayerWalletOrNetworkFees": false,
    "liveQuoteVerified": false,
    "condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
  },
  "intents": [
    "compose typed TOML configuration",
    "generate TOML with exact int64 values",
    "serialize homogeneous arrays and nested TOML tables",
    "detect TOML table scalar conflicts"
  ],
  "whenToUse": [
    "Creating new TOML 1.0-compatible files from explicit typed declarations",
    "Preserving full signed-int64 precision without JavaScript numeric conversion",
    "Producing an inert exact-byte configuration artifact for an offline consumer"
  ],
  "whenNotToUse": [
    "Parsing, merging or editing existing TOML source or preserving comments",
    "Floating-point values, dates, times, null, nested or mixed arrays, arrays of tables or inline tables",
    "Application configuration validation, interpolation, environment expansion, filesystem includes or secret classification",
    "Network requests, writing files, live configuration changes, authentication, publishing or deployment"
  ],
  "capabilities": [
    "Profile toml-1.0-typed-config-v1; quoted basic-string keys; UTF-16 ordinal ordering with parents first",
    "Signed-int64 decimal strings; typed homogeneous primitive arrays; Unicode scalar strings",
    "Duplicate table/key and scalar/table-ancestor conflict rejection; exact key segments including literal dots",
    "LF line endings and final LF for nonempty output; empty root produces the empty document",
    "Deterministic supplied-input-only artifact; no network, clock or randomness",
    "Exact artifact UTF-8 byte lengths and SHA-256 hashes"
  ],
  "related": [
    "zip-store-compose",
    "json-schema-check"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 12000,
    "depth": 20,
    "tables": 128,
    "entries": 512,
    "tablePathSegments": 4,
    "keyUtf8Bytes": 128,
    "arrayCells": 256,
    "aggregateCells": 2048,
    "stringValueUtf8Bytes": 32768,
    "artifactUtf8Bytes": 100000,
    "profile": "toml-1.0-typed-config-v1"
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "INVALID_INPUT",
    "UNSAFE_KEY",
    "TOML_INTEGER",
    "TOML_KEY_LIMIT",
    "TOML_DUPLICATE_TABLE",
    "TOML_ENTRY_LIMIT",
    "TOML_CELL_LIMIT",
    "TOML_ARRAY_TYPE",
    "TOML_STRING_LIMIT",
    "TOML_DUPLICATE_KEY",
    "TOML_TABLE_CONFLICT",
    "TOML_OUTPUT_LIMIT"
  ],
  "requirementsProfile": {
    "format": "declared-requirements-v1",
    "facts": {
      "execution.suppliedCode": false,
      "execution.remoteMutation": false,
      "execution.llmInference": false,
      "execution.paidMcp": false,
      "verification.semanticTruth": false,
      "verification.sourceAuthenticity": false,
      "verification.liveVulnerabilities": false,
      "numbers.arbitraryPrecisionJson": false,
      "numbers.model": "ieee754-binary64",
      "privacy.requestBodyPersisted": false,
      "execution.deterministic": true,
      "execution.networkAccess": false,
      "privacy.resultBodyPersisted": false,
      "payment.x402": true,
      "payment.mpp": true,
      "operation.id": "toml-config-compose",
      "operation.category": "structured",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 300000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "serialization.profile": "toml-1.0-typed-config-v1",
      "serialization.actions": "compose",
      "serialization.integerMin": "-9223372036854775808",
      "serialization.integerMax": "9223372036854775807",
      "serialization.exactDecimalStringIntegers": true,
      "serialization.unicodePolicy": "unicode-scalars-no-normalization",
      "serialization.consumerCompatibilityVerified": false,
      "serialization.determinismScope": "this-profile-only",
      "toml.maxTables": 128,
      "toml.maxEntries": 512,
      "toml.maxPathSegments": 4,
      "toml.maxKeyBytes": 128,
      "toml.maxArrayCells": 256,
      "toml.maxTotalCells": 2048,
      "toml.maxStringBytes": 32768,
      "toml.maxTextBytes": 100000,
      "toml.parsesExistingSource": false,
      "toml.preservesComments": false,
      "toml.floatTypes": false,
      "toml.dateTimeTypes": false,
      "toml.installsConfiguration": false,
      "toml.secretClassification": false,
      "input.tables.maxItems": 128
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/toml-config-compose.md",
  "serviceContract": "/reference/services/toml-config-compose.json",
  "errors": [
    {
      "status": 400,
      "meaning": "Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch",
      "retry": "Correct the request before payment"
    },
    {
      "status": 402,
      "meaning": "Payment challenge or rejected payment",
      "retry": "Use official protocol SDK; inspect payment outcome before another payment"
    },
    {
      "status": 409,
      "meaning": "Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN",
      "retry": "Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay"
    },
    {
      "status": 413,
      "meaning": "Input or generated output too large",
      "retry": "Reduce input; no payment attempted for validation failure"
    },
    {
      "status": 415,
      "meaning": "Unsupported media type or compression",
      "retry": "Send uncompressed application/json"
    },
    {
      "status": 422,
      "meaning": "Schema or service-specific semantic validation failure",
      "retry": "Correct input using returned error code; no payment attempted"
    },
    {
      "status": 429,
      "meaning": "Request/payment-attempt rate exceeded",
      "retry": "Wait for rate limit window; preserve existing payment identity"
    },
    {
      "status": 503,
      "meaning": "Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement",
      "retry": "Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation"
    }
  ],
  "numericPrecision": "JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.",
  "paymentWorkflow": {
    "discoveryOnly": false,
    "supportedProtocols": [
      "x402",
      "mpp"
    ],
    "x402": {
      "credentialHeader": "PAYMENT-SIGNATURE",
      "challengeHeader": "PAYMENT-REQUIRED",
      "receiptHeader": "PAYMENT-RESPONSE",
      "version": 2,
      "scheme": "exact",
      "paymentIdentifier": "payment-identifier extension MUST equal the HTTP Idempotency-Key",
      "sdk": "@x402/core with @x402/evm"
    },
    "mpp": {
      "supported": true,
      "credentialHeader": "Authorization",
      "challengeHeader": "WWW-Authenticate",
      "receiptHeader": "Payment-Receipt",
      "method": "tempo",
      "intent": "charge",
      "sdk": "mppx",
      "tokenDecimals": 6
    },
    "steps": [
      "Check configured readiness and the exact service schema",
      "Generate a fresh random Idempotency-Key for this operation; never use a discovery probe fixture for purchases",
      "Send valid input without a credential to obtain the official protocol challenge",
      "Use the official SDK and authorized wallet to fulfill the challenge",
      "Retry only with identical key, body, protocol and credential",
      "On PAYMENT_UNCERTAIN stop and request operator reconciliation; never blindly pay again"
    ],
    "versionedRetries": "Request fingerprint includes service release version. Retries across a version upgrade can conflict; coordinate upgrades outside the 24-hour replay window and reconcile pending attempts.",
    "docs": "/llms.txt"
  },
  "method": "POST",
  "paths": {
    "x402": "/v1/x402/toml-config-compose",
    "mpp": "/v1/mpp/toml-config-compose"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "tables": {
        "maxItems": 128,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 128
              }
            },
            "entries": {
              "maxItems": 512,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "string"
                          },
                          "value": {
                            "type": "string",
                            "maxLength": 32768
                          }
                        },
                        "required": [
                          "type",
                          "value"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "integer"
                          },
                          "value": {
                            "type": "string",
                            "maxLength": 20
                          }
                        },
                        "required": [
                          "type",
                          "value"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "boolean"
                          },
                          "value": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "type",
                          "value"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "array"
                          },
                          "elementType": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "boolean"
                            ]
                          },
                          "values": {
                            "maxItems": 256,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 32768
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          }
                        },
                        "required": [
                          "type",
                          "elementType",
                          "values"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "path",
            "entries"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "tables"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "toml-config-compose",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "const": "toml-1.0-typed-config-v1"
          },
          "text": {
            "type": "string",
            "maxLength": 100000
          },
          "byteLength": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "tableCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 128
          },
          "entryCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 512
          }
        },
        "required": [
          "profile",
          "text",
          "byteLength",
          "sha256",
          "tableCount",
          "entryCount"
        ],
        "additionalProperties": false
      },
      "provenance": {
        "type": "object",
        "required": [
          "inputSha256",
          "outputSha256",
          "deterministic",
          "externalRequests"
        ],
        "properties": {
          "inputSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "outputSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "deterministic": {
            "const": true
          },
          "externalRequests": {
            "const": 0
          }
        }
      }
    },
    "additionalProperties": false
  },
  "exampleInput": {
    "tables": [
      {
        "path": [
          "server"
        ],
        "entries": [
          {
            "key": "port",
            "value": {
              "type": "integer",
              "value": "8080"
            }
          },
          {
            "key": "enabled",
            "value": {
              "type": "boolean",
              "value": true
            }
          },
          {
            "key": "name",
            "value": {
              "type": "string",
              "value": "café"
            }
          }
        ]
      }
    ]
  },
  "exampleResponse": {
    "operation": "toml-config-compose",
    "version": "0.29.0",
    "result": {
      "profile": "toml-1.0-typed-config-v1",
      "text": "[\"server\"]\n\"enabled\" = true\n\"name\" = \"café\"\n\"port\" = 8080\n",
      "byteLength": 59,
      "sha256": "87bc7526e622cadc468e1870a97859ccc52909d2419e07064af6162e22a99d35",
      "tableCount": 1,
      "entryCount": 3
    },
    "provenance": {
      "inputSha256": "fe94f7a66d0e2d6a9ea149fd1123d7e3673ab90b272e1a4b855a7683f273e4da",
      "outputSha256": "050fb9b266805cf67ae8e4a0d458b3b89cd5424fe22ae1e866475934ef7d3f6f",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/toml-config-compose.json",
  "execution": {
    "deterministic": true,
    "externalRequests": 0,
    "maxExternalRequests": 0,
    "resultSnapshotPersisted": false,
    "fixedExampleIsIllustrativeSnapshot": false,
    "requiresPayment": true,
    "supportsMcpExecution": false
  },
  "releaseSnapshot": {
    "format": "static-release-reference-v1",
    "sourceVersion": "0.29.0",
    "sourceRegistrySha256": "a2b5ec09bf6c38b9d2879d746a4fded374f5928b445377b0270ef6aa8e6cac65",
    "generatedAt": "2026-10-06T15:38:00Z",
    "releaseAcceptance": "not-verified-by-generator",
    "runtimeReadiness": "not-evaluated",
    "livePaymentsVerified": false,
    "indexingVerified": false,
    "apiOrigin": null,
    "notice": "Build-time release reference. Runtime readiness, deployment, payment settlement and external indexing are not evaluated here. Prices are proposed; this file cannot authorize execution or payment."
  }
}
