From 34626f1d435ecd78f43a17f3274ef3d104464c24 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Wed, 18 Nov 2026 10:24:30 -0600 Subject: [PATCH 01/11] ci(mcpx): cover flake container and remote envs --- .github/workflows/mcpx-test.yml | 95 ++++++++++++++++++++++++++++++++- lib/default.nix | 65 ++++++++++++++++++++-- 2 files changed, 156 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mcpx-test.yml b/.github/workflows/mcpx-test.yml index 6cd40c92d7..01bba0f349 100644 --- a/.github/workflows/mcpx-test.yml +++ b/.github/workflows/mcpx-test.yml @@ -279,9 +279,102 @@ jobs: count=$(pgrep -c -x mcpx || true) echo "surviving mcpx daemon count: ${count:-0}" + nix-e2e: + name: "environment: mcpx flake e2e" + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Run the e2e suite against the wrapped flake binary + run: nix build .#checks.x86_64-linux.mcpx-e2e --print-build-logs + + container-e2e: + name: "environment: mcpx container e2e" + runs-on: ubuntu-latest + timeout-minutes: 75 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Build the shipped image and test harness image + run: | + nix build .#packages.x86_64-linux.mcpx-container --print-build-logs --out-link mcpx-image + nix build .#packages.x86_64-linux.mcpx-e2e-test-image --print-build-logs --out-link mcpx-e2e-test-image + - name: Smoke-test the shipped image + run: | + image=$(docker load --input mcpx-image | sed -n 's/^Loaded image: //p') + test -n "$image" + docker run --rm "$image" --version + docker run --rm "$image" exec 'console.log("container-e2e-runtime-ok")' \ + | grep -q 'container-e2e-runtime-ok' + - name: Run e2e inside the flake-built test image + run: | + image=$(docker load --input mcpx-e2e-test-image | sed -n 's/^Loaded image: //p') + test -n "$image" + docker run --rm \ + --mount "type=bind,src=$GITHUB_WORKSPACE,dst=/workspace,readonly" \ + "$image" + + remote-smoke: + name: "environment: mcpx remote daemon smoke" + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Build the shipped image + run: nix build .#packages.x86_64-linux.mcpx-container --print-build-logs --out-link mcpx-image + - name: Connect a client container to a separate daemon container + run: | + set -euo pipefail + image=$(docker load --input mcpx-image | sed -n 's/^Loaded image: //p') + test -n "$image" + network=mcpx-remote-e2e + docker network create "$network" + cleanup() { + docker rm -f mcpx-remote-daemon >/dev/null 2>&1 || true + docker network rm "$network" >/dev/null 2>&1 || true + } + trap cleanup EXIT + docker run --detach --name mcpx-remote-daemon \ + --network "$network" --network-alias mcpxd \ + --env MCPX_DAEMON_ADDRESS=0.0.0.0 \ + --env MCPX_DAEMON_PORT=18765 \ + "$image" daemon + for attempt in $(seq 1 30); do + if output=$(docker run --rm --network "$network" \ + --env MCPX_DAEMON_ENDPOINT=http://mcpxd:18765 \ + "$image" status 2>&1); then + if grep -q 'daemon: running' <<<"$output"; then + echo "$output" + exit 0 + fi + fi + sleep 1 + done + echo "client could not reach the remote daemon" >&2 + echo "$output" >&2 + docker logs mcpx-remote-daemon >&2 + exit 1 + ci-ok: name: "mcpx-test ci-ok" - needs: [init, unit, lint, plugin-ts, e2e] + needs: [init, unit, lint, plugin-ts, e2e, nix-e2e, container-e2e, remote-smoke] if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/lib/default.nix b/lib/default.nix index 5630777811..62078bb859 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -660,12 +660,64 @@ let ) justRecipes.recipes; mcpx = pkgs.callPackage ../pkgs/mcpx/package.nix { }; + mcpxContainerBinary = pkgs.callPackage ../pkgs/mcpx/package.nix { + wrapWithRuntimes = false; + doCheck = false; + }; mcpxContainer = pkgs.callPackage ../pkgs/mcpx/container-image.nix { - mcpx = pkgs.callPackage ../pkgs/mcpx/package.nix { - wrapWithRuntimes = false; - doCheck = false; + mcpx = mcpxContainerBinary; + }; + mcpxTestImage = pkgs.dockerTools.buildLayeredImage { + name = "mcpx-e2e-test"; + tag = "ci"; + # This is a test harness, not the shipped image: Go builds the fake + # MCP server at test time, and the suite requires all wrapped runtimes. + # The mcpx executable is the same unwrapped artifact used by the user + # image; source is mounted read-only by the workflow. + contents = with pkgs; [ + bash + bun + cacert + coreutils + deno + git + go_1_27 + mcpxContainerBinary + nodejs + python3 + ]; + extraCommands = '' + mkdir -p tmp work + chmod 1777 tmp work + ''; + config = { + Entrypoint = [ "${pkgs.bash}/bin/bash" ]; + Cmd = [ + "-lc" + "cd /workspace/pkgs/mcpx && go test ./internal/e2e -count=1 -timeout 30m" + ]; + User = "0:0"; + WorkingDir = "/workspace"; + Env = [ + "HOME=/tmp" + "MCPX_TEST_BINARY=${mcpxContainerBinary}/bin/mcpx" + "MCPX_TEST_REQUIRE=deno,bun,node,python3" + "PATH=${pkgs.lib.makeBinPath (with pkgs; [ bash bun coreutils deno git go_1_27 nodejs python3 ])}:${mcpxContainerBinary}/bin" + "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" + ]; }; }; + mcpxE2ECheck = mcpx.overrideAttrs (_old: { + pname = "mcpx-e2e-check"; + doCheck = true; + checkPhase = '' + runHook preCheck + export MCPX_TEST_BINARY=${mcpx}/bin/mcpx + export MCPX_TEST_REQUIRE=deno,bun,node,python3 + go test ./internal/e2e -count=1 -timeout 30m + runHook postCheck + ''; + }); identity = pkgs.callPackage ../pkgs/identity/package.nix { }; identityImage = pkgs.callPackage ../pkgs/identity/container-image.nix { inherit identity; @@ -718,6 +770,8 @@ let generic-runtime = genericRuntime; generic-js-runtime = genericJsRuntime; generic-python-runtime = genericPythonRuntime; + } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + mcpx-e2e-test-image = mcpxTestImage; }; checks = { # The packaging test (#1981): run the built mcpx artifact -- @@ -771,6 +825,11 @@ let bash scripts/just-recipes-root-check-test.sh touch $out ''; + } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + # Run the end-to-end suite against the wrapped flake artifact. This + # stays separate from the package checkPhase: those tests spawn daemon + # and runtime subprocess trees that do not fit that build's sandbox. + mcpx-e2e = mcpxE2ECheck; }; apps = (pkgs.lib.mapAttrs mkRecipeApp publicRecipes) // { id-mail-deploy = mkApp idMailDeploy "Deploy the mail Worker from this checkout (needs Bitwarden and sops access)"; From 0855d039ed52b5525d1f096451a30f67676bcf62 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Wed, 18 Nov 2026 10:37:29 -0600 Subject: [PATCH 02/11] ci(mcpx): disable test image vcs stamping --- lib/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/default.nix b/lib/default.nix index 62078bb859..81950876e8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -699,6 +699,7 @@ let User = "0:0"; WorkingDir = "/workspace"; Env = [ + "GOFLAGS=-buildvcs=false" "HOME=/tmp" "MCPX_TEST_BINARY=${mcpxContainerBinary}/bin/mcpx" "MCPX_TEST_REQUIRE=deno,bun,node,python3" From f9b82f49cafdaea54002bf2d6bef30ca683ab8ff Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Wed, 18 Nov 2026 10:24:30 -0600 Subject: [PATCH 03/11] ci(mcpx): cover flake container and remote envs --- .github/workflows/mcpx-test.yml | 95 ++++++++++++++++++++++++++++++++- lib/default.nix | 65 ++++++++++++++++++++-- 2 files changed, 156 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mcpx-test.yml b/.github/workflows/mcpx-test.yml index 6cd40c92d7..01bba0f349 100644 --- a/.github/workflows/mcpx-test.yml +++ b/.github/workflows/mcpx-test.yml @@ -279,9 +279,102 @@ jobs: count=$(pgrep -c -x mcpx || true) echo "surviving mcpx daemon count: ${count:-0}" + nix-e2e: + name: "environment: mcpx flake e2e" + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Run the e2e suite against the wrapped flake binary + run: nix build .#checks.x86_64-linux.mcpx-e2e --print-build-logs + + container-e2e: + name: "environment: mcpx container e2e" + runs-on: ubuntu-latest + timeout-minutes: 75 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Build the shipped image and test harness image + run: | + nix build .#packages.x86_64-linux.mcpx-container --print-build-logs --out-link mcpx-image + nix build .#packages.x86_64-linux.mcpx-e2e-test-image --print-build-logs --out-link mcpx-e2e-test-image + - name: Smoke-test the shipped image + run: | + image=$(docker load --input mcpx-image | sed -n 's/^Loaded image: //p') + test -n "$image" + docker run --rm "$image" --version + docker run --rm "$image" exec 'console.log("container-e2e-runtime-ok")' \ + | grep -q 'container-e2e-runtime-ok' + - name: Run e2e inside the flake-built test image + run: | + image=$(docker load --input mcpx-e2e-test-image | sed -n 's/^Loaded image: //p') + test -n "$image" + docker run --rm \ + --mount "type=bind,src=$GITHUB_WORKSPACE,dst=/workspace,readonly" \ + "$image" + + remote-smoke: + name: "environment: mcpx remote daemon smoke" + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + - name: Build the shipped image + run: nix build .#packages.x86_64-linux.mcpx-container --print-build-logs --out-link mcpx-image + - name: Connect a client container to a separate daemon container + run: | + set -euo pipefail + image=$(docker load --input mcpx-image | sed -n 's/^Loaded image: //p') + test -n "$image" + network=mcpx-remote-e2e + docker network create "$network" + cleanup() { + docker rm -f mcpx-remote-daemon >/dev/null 2>&1 || true + docker network rm "$network" >/dev/null 2>&1 || true + } + trap cleanup EXIT + docker run --detach --name mcpx-remote-daemon \ + --network "$network" --network-alias mcpxd \ + --env MCPX_DAEMON_ADDRESS=0.0.0.0 \ + --env MCPX_DAEMON_PORT=18765 \ + "$image" daemon + for attempt in $(seq 1 30); do + if output=$(docker run --rm --network "$network" \ + --env MCPX_DAEMON_ENDPOINT=http://mcpxd:18765 \ + "$image" status 2>&1); then + if grep -q 'daemon: running' <<<"$output"; then + echo "$output" + exit 0 + fi + fi + sleep 1 + done + echo "client could not reach the remote daemon" >&2 + echo "$output" >&2 + docker logs mcpx-remote-daemon >&2 + exit 1 + ci-ok: name: "mcpx-test ci-ok" - needs: [init, unit, lint, plugin-ts, e2e] + needs: [init, unit, lint, plugin-ts, e2e, nix-e2e, container-e2e, remote-smoke] if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/lib/default.nix b/lib/default.nix index f6d7fdd134..cbdc235a56 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -665,12 +665,64 @@ let ) justRecipes.recipes; mcpx = pkgs.callPackage ../pkgs/mcpx/package.nix { }; + mcpxContainerBinary = pkgs.callPackage ../pkgs/mcpx/package.nix { + wrapWithRuntimes = false; + doCheck = false; + }; mcpxContainer = pkgs.callPackage ../pkgs/mcpx/container-image.nix { - mcpx = pkgs.callPackage ../pkgs/mcpx/package.nix { - wrapWithRuntimes = false; - doCheck = false; + mcpx = mcpxContainerBinary; + }; + mcpxTestImage = pkgs.dockerTools.buildLayeredImage { + name = "mcpx-e2e-test"; + tag = "ci"; + # This is a test harness, not the shipped image: Go builds the fake + # MCP server at test time, and the suite requires all wrapped runtimes. + # The mcpx executable is the same unwrapped artifact used by the user + # image; source is mounted read-only by the workflow. + contents = with pkgs; [ + bash + bun + cacert + coreutils + deno + git + go_1_27 + mcpxContainerBinary + nodejs + python3 + ]; + extraCommands = '' + mkdir -p tmp work + chmod 1777 tmp work + ''; + config = { + Entrypoint = [ "${pkgs.bash}/bin/bash" ]; + Cmd = [ + "-lc" + "cd /workspace/pkgs/mcpx && go test ./internal/e2e -count=1 -timeout 30m" + ]; + User = "0:0"; + WorkingDir = "/workspace"; + Env = [ + "HOME=/tmp" + "MCPX_TEST_BINARY=${mcpxContainerBinary}/bin/mcpx" + "MCPX_TEST_REQUIRE=deno,bun,node,python3" + "PATH=${pkgs.lib.makeBinPath (with pkgs; [ bash bun coreutils deno git go_1_27 nodejs python3 ])}:${mcpxContainerBinary}/bin" + "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" + ]; }; }; + mcpxE2ECheck = mcpx.overrideAttrs (_old: { + pname = "mcpx-e2e-check"; + doCheck = true; + checkPhase = '' + runHook preCheck + export MCPX_TEST_BINARY=${mcpx}/bin/mcpx + export MCPX_TEST_REQUIRE=deno,bun,node,python3 + go test ./internal/e2e -count=1 -timeout 30m + runHook postCheck + ''; + }); identity = pkgs.callPackage ../pkgs/identity/package.nix { }; identityImage = pkgs.callPackage ../pkgs/identity/container-image.nix { inherit identity; @@ -739,6 +791,8 @@ let generic-runtime = genericRuntime; generic-js-runtime = genericJsRuntime; generic-python-runtime = genericPythonRuntime; + } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + mcpx-e2e-test-image = mcpxTestImage; }; checks = { # The packaging test (#1981): run the built mcpx artifact -- @@ -792,6 +846,11 @@ let bash scripts/just-recipes-root-check-test.sh touch $out ''; + } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + # Run the end-to-end suite against the wrapped flake artifact. This + # stays separate from the package checkPhase: those tests spawn daemon + # and runtime subprocess trees that do not fit that build's sandbox. + mcpx-e2e = mcpxE2ECheck; }; apps = (pkgs.lib.mapAttrs mkRecipeApp publicRecipes) // { id-mail-deploy = mkApp idMailDeploy "Deploy the mail Worker from this checkout (needs Bitwarden and sops access)"; From 06809c9a48c6ef3390420ab77421cf47990891c2 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Wed, 18 Nov 2026 10:37:29 -0600 Subject: [PATCH 04/11] ci(mcpx): disable test image vcs stamping --- lib/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/default.nix b/lib/default.nix index cbdc235a56..1a0b81ded0 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -704,6 +704,7 @@ let User = "0:0"; WorkingDir = "/workspace"; Env = [ + "GOFLAGS=-buildvcs=false" "HOME=/tmp" "MCPX_TEST_BINARY=${mcpxContainerBinary}/bin/mcpx" "MCPX_TEST_REQUIRE=deno,bun,node,python3" From d023d6be319318711a0ee7752cbeb7242ac72eae Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 00:47:56 -0600 Subject: [PATCH 05/11] ci(mcpx): wire flake container and remote env legs --- .github/workflows/mcpx-test.yml | 41 +++++++++++++++++++++++---------- lib/default.nix | 27 ++++++++-------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/.github/workflows/mcpx-test.yml b/.github/workflows/mcpx-test.yml index 01bba0f349..36adb7f30a 100644 --- a/.github/workflows/mcpx-test.yml +++ b/.github/workflows/mcpx-test.yml @@ -280,19 +280,40 @@ jobs: echo "surviving mcpx daemon count: ${count:-0}" nix-e2e: - name: "environment: mcpx flake e2e" + name: "environment: mcpx flake binary e2e" runs-on: ubuntu-latest timeout-minutes: 60 steps: - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 + with: + go-version-file: pkgs/mcpx/go.mod + cache: true + cache-dependency-path: pkgs/mcpx/go.sum + - uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5 + with: + deno-version: v2.x + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - uses: actions/setup-python@v7 + with: + python-version: "3.x" - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 continue-on-error: true with: use-flakehub: false use-gha-cache: true - - name: Run the e2e suite against the wrapped flake binary - run: nix build .#checks.x86_64-linux.mcpx-e2e --print-build-logs + - name: Build the wrapped flake binary + run: nix build .#packages.x86_64-linux.mcpx --print-build-logs --out-link result-mcpx + - name: Run e2e against the wrapped flake binary + working-directory: pkgs/mcpx + env: + MCPX_TEST_BINARY: ${{ github.workspace }}/result-mcpx/bin/mcpx + MCPX_TEST_REQUIRE: deno,bun,node,python3 + run: go test ./internal/e2e -count=1 -timeout 30m container-e2e: name: "environment: mcpx container e2e" @@ -309,7 +330,7 @@ jobs: - name: Build the shipped image and test harness image run: | nix build .#packages.x86_64-linux.mcpx-container --print-build-logs --out-link mcpx-image - nix build .#packages.x86_64-linux.mcpx-e2e-test-image --print-build-logs --out-link mcpx-e2e-test-image + nix build .#checks.x86_64-linux.mcpx-e2e --print-build-logs --out-link mcpx-e2e-check - name: Smoke-test the shipped image run: | image=$(docker load --input mcpx-image | sed -n 's/^Loaded image: //p') @@ -319,9 +340,9 @@ jobs: | grep -q 'container-e2e-runtime-ok' - name: Run e2e inside the flake-built test image run: | - image=$(docker load --input mcpx-e2e-test-image | sed -n 's/^Loaded image: //p') + image=$(docker load --input mcpx-e2e-check | sed -n 's/^Loaded image: //p') test -n "$image" - docker run --rm \ + docker run --init --rm \ --mount "type=bind,src=$GITHUB_WORKSPACE,dst=/workspace,readonly" \ "$image" @@ -346,11 +367,7 @@ jobs: test -n "$image" network=mcpx-remote-e2e docker network create "$network" - cleanup() { - docker rm -f mcpx-remote-daemon >/dev/null 2>&1 || true - docker network rm "$network" >/dev/null 2>&1 || true - } - trap cleanup EXIT + trap 'docker rm -f mcpx-remote-daemon >/dev/null 2>&1 || true; docker network rm "$network" >/dev/null 2>&1 || true' EXIT docker run --detach --name mcpx-remote-daemon \ --network "$network" --network-alias mcpxd \ --env MCPX_DAEMON_ADDRESS=0.0.0.0 \ @@ -367,7 +384,7 @@ jobs: fi sleep 1 done - echo "client could not reach the remote daemon" >&2 + echo "client could not reach the remote daemon after $attempt attempts" >&2 echo "$output" >&2 docker logs mcpx-remote-daemon >&2 exit 1 diff --git a/lib/default.nix b/lib/default.nix index 1a0b81ded0..8b25f439b5 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -692,8 +692,9 @@ let python3 ]; extraCommands = '' - mkdir -p tmp work + mkdir -p tmp work usr/bin chmod 1777 tmp work + ln -s ${pkgs.coreutils}/bin/env usr/bin/env ''; config = { Entrypoint = [ "${pkgs.bash}/bin/bash" ]; @@ -713,17 +714,6 @@ let ]; }; }; - mcpxE2ECheck = mcpx.overrideAttrs (_old: { - pname = "mcpx-e2e-check"; - doCheck = true; - checkPhase = '' - runHook preCheck - export MCPX_TEST_BINARY=${mcpx}/bin/mcpx - export MCPX_TEST_REQUIRE=deno,bun,node,python3 - go test ./internal/e2e -count=1 -timeout 30m - runHook postCheck - ''; - }); identity = pkgs.callPackage ../pkgs/identity/package.nix { }; identityImage = pkgs.callPackage ../pkgs/identity/container-image.nix { inherit identity; @@ -792,7 +782,7 @@ let generic-runtime = genericRuntime; generic-js-runtime = genericJsRuntime; generic-python-runtime = genericPythonRuntime; - } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { mcpx-e2e-test-image = mcpxTestImage; }; checks = { @@ -847,11 +837,12 @@ let bash scripts/just-recipes-root-check-test.sh touch $out ''; - } // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { - # Run the end-to-end suite against the wrapped flake artifact. This - # stays separate from the package checkPhase: those tests spawn daemon - # and runtime subprocess trees that do not fit that build's sandbox. - mcpx-e2e = mcpxE2ECheck; + } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { + # The e2e suite spawns daemon/runtime process trees and needs init to + # reap them. Expose the flake-built test image as the check output; + # mcpx-test runs the suite in that image with Docker's --init, outside + # the Nix build sandbox where those process trees cannot be reaped. + mcpx-e2e = mcpxTestImage; }; apps = (pkgs.lib.mapAttrs mkRecipeApp publicRecipes) // { id-mail-deploy = mkApp idMailDeploy "Deploy the mail Worker from this checkout (needs Bitwarden and sops access)"; From b0d3016f93daf09d3b6ee1e590779e3804026232 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 00:59:29 -0600 Subject: [PATCH 06/11] test(mcpx): tolerate wrapped binary PATH in git check --- pkgs/mcpx/internal/e2e/git_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/mcpx/internal/e2e/git_test.go b/pkgs/mcpx/internal/e2e/git_test.go index 9bed931f08..33bff341ec 100644 --- a/pkgs/mcpx/internal/e2e/git_test.go +++ b/pkgs/mcpx/internal/e2e/git_test.go @@ -172,9 +172,13 @@ func TestRepoAndWorktreeScopesResolveWithNoGitInstalled(t *testing.T) { line = l } } + // An artifact supplied through MCPX_TEST_BINARY may be a wrapper that + // changes PATH, so only the unwrapped run can assert git is absent. + noGitExpected := os.Getenv("MCPX_TEST_BINARY") == "" if !strings.HasPrefix(line, "ok") || !strings.Contains(line, "worktree "+side) || - !strings.Contains(line, "resolved natively") || !strings.Contains(line, "no git on PATH") { - t.Errorf("doctor should report the native answer and that git is absent, without warning:\n%s", doctor) + !strings.Contains(line, "resolved natively") || + (noGitExpected && !strings.Contains(line, "no git on PATH")) { + t.Errorf("doctor should report the native answer and the expected git fallback, without warning:\n%s", doctor) } } From d5ccc282b1d607523b009e752915f16ece0362e0 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 01:05:25 -0600 Subject: [PATCH 07/11] test(mcpx): align runtime probes with default order --- pkgs/mcpx/internal/e2e/effect_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/mcpx/internal/e2e/effect_test.go b/pkgs/mcpx/internal/e2e/effect_test.go index ad738df56f..5d2dbd3ca3 100644 --- a/pkgs/mcpx/internal/e2e/effect_test.go +++ b/pkgs/mcpx/internal/e2e/effect_test.go @@ -2357,13 +2357,13 @@ func runtimeOf(t *testing.T, e *env, args ...string) string { } // TestScriptRuntimeSelectsTheRuntime is the effect probe for -// script.runtime: scripts run on bun by default and on node once the +// script.runtime: scripts run on deno by default and on node once the // environment names it. func TestScriptRuntimeSelectsTheRuntime(t *testing.T) { testsupport.RequireBinary(t, "node") e := newEnv(t, oneServer) - if rt := runtimeOf(t, e); rt != "bun" { - t.Errorf("the default script.runtime should pick bun, got %q", rt) + if rt := runtimeOf(t, e); rt != "deno" { + t.Errorf("the default script.runtime should pick deno, got %q", rt) } e.setenv("MCPX_SCRIPT_RUNTIME=node") if rt := runtimeOf(t, e); rt != "node" { @@ -2372,13 +2372,13 @@ func TestScriptRuntimeSelectsTheRuntime(t *testing.T) { } // TestScriptRuntimeOrderRanksTheAutoPick is the effect probe for -// script.runtimeOrder: the automatic pick is bun by default and node once +// script.runtimeOrder: the automatic pick is deno by default and node once // the environment ranks node first. func TestScriptRuntimeOrderRanksTheAutoPick(t *testing.T) { testsupport.RequireBinary(t, "node") e := newEnv(t, oneServer) - if rt := runtimeOf(t, e); rt != "bun" { - t.Errorf("the default script.runtimeOrder should pick bun, got %q", rt) + if rt := runtimeOf(t, e); rt != "deno" { + t.Errorf("the default script.runtimeOrder should pick deno, got %q", rt) } e.setenv("MCPX_SCRIPT_RUNTIME_ORDER=node,bun") if rt := runtimeOf(t, e); rt != "node" { From da4164af4877e8b5309b885913828e6fdbf6663c Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 02:21:45 -0600 Subject: [PATCH 08/11] test(mcpx): copy daemon executable for upgrades --- pkgs/mcpx/internal/e2e/takeover_test.go | 8 +------- pkgs/mcpx/internal/e2e/upgrade_test.go | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/mcpx/internal/e2e/takeover_test.go b/pkgs/mcpx/internal/e2e/takeover_test.go index 740a06d67b..9310646417 100644 --- a/pkgs/mcpx/internal/e2e/takeover_test.go +++ b/pkgs/mcpx/internal/e2e/takeover_test.go @@ -425,13 +425,7 @@ func TestUpgradeStartsTheSuccessorThroughTheUnitsStartCommand(t *testing.T) { wrapper := filepath.Join(bin, "mcpx-start") writeUnitScript(t, wrapper, "MCPX_UNIT_TOKEN=rotated\nexport MCPX_UNIT_TOKEN\nexec \"$@\"\n") next := filepath.Join(bin, "mcpx") - src, err := os.ReadFile(e.mcpx) - if err != nil { - t.Fatal(err) - } - if err := os.WriteFile(next, src, 0o755); err != nil { - t.Fatal(err) - } + copyDaemonExecutable(t, before.PID, e.mcpx, next) // systemd reports the wrapper and the binary as the unit's ExecStart. writeUnitScript(t, filepath.Join(bin, "systemctl"), fmt.Sprintf("echo '{ path=%s ; argv[]=%s %s daemon ; ignore_errors=no ; pid=0 ; status=0/0 }'\n", wrapper, wrapper, next)) diff --git a/pkgs/mcpx/internal/e2e/upgrade_test.go b/pkgs/mcpx/internal/e2e/upgrade_test.go index e5f66b17ce..0f4fb01c2a 100644 --- a/pkgs/mcpx/internal/e2e/upgrade_test.go +++ b/pkgs/mcpx/internal/e2e/upgrade_test.go @@ -3,6 +3,7 @@ package e2e_test import ( "os" "path/filepath" + "strconv" "strings" "testing" "time" @@ -19,6 +20,19 @@ func copyExecutable(t *testing.T, from, to string) { } } +// copyDaemonExecutable makes a distinct upgrade target from the executable +// the daemon is actually running. Copying e.mcpx is not sufficient for +// wrapped artifacts: a wrapper can exec an absolute store path, making the +// copied wrapper start the same executable again. +func copyDaemonExecutable(t *testing.T, pid int, fallback, to string) { + t.Helper() + executable := filepath.Join("/proc", strconv.Itoa(pid), "exe") + if _, err := os.Stat(executable); err != nil { + executable = fallback + } + copyExecutable(t, executable, to) +} + func awaitDaemonOtherThan(t *testing.T, e *env, pid int) daemonDoc { t.Helper() deadline := time.Now().Add(30 * time.Second) @@ -45,7 +59,7 @@ func TestUpgradeKeepsTheChildAndHandsMainPIDToTheSuccessor(t *testing.T) { } next := filepath.Join(t.TempDir(), "mcpx-next") - copyExecutable(t, e.mcpx, next) + copyDaemonExecutable(t, before.PID, e.mcpx, next) if out, err := e.tryWith(next, "upgrade"); err != nil { t.Fatalf("upgrade failed: %v\n%s", err, out) } From 09de95edb0e600ebeb0bf680d2d613a55a775de5 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 07:27:53 -0600 Subject: [PATCH 09/11] janitor: preserve aging worktree state (#6884) --- mcpx-images | 1 + mcpx-images-1 | 1 + 2 files changed, 2 insertions(+) create mode 120000 mcpx-images create mode 120000 mcpx-images-1 diff --git a/mcpx-images b/mcpx-images new file mode 120000 index 0000000000..f6724871ff --- /dev/null +++ b/mcpx-images @@ -0,0 +1 @@ +/nix/store/xzsjk110bkd6d903gb3xwkzv7mc06v8p-mcpx.tar.gz \ No newline at end of file diff --git a/mcpx-images-1 b/mcpx-images-1 new file mode 120000 index 0000000000..1743759eeb --- /dev/null +++ b/mcpx-images-1 @@ -0,0 +1 @@ +/nix/store/izprwdhnb53r6kbb396nkl0grgg4zg63-mcpx-e2e-test.tar.gz \ No newline at end of file From 7cdb009326b690fb7e852c8e82c3fa4c74e2b10f Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 07:58:14 -0600 Subject: [PATCH 10/11] fix(mcpx): address environment leg review --- .gitignore | 1 + mcpx-images | 1 - mcpx-images-1 | 1 - pkgs/mcpx/internal/e2e/effect_test.go | 2 ++ 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 120000 mcpx-images delete mode 120000 mcpx-images-1 diff --git a/.gitignore b/.gitignore index de95d9048a..c204b3053c 100755 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ out **/out result* **/result* +/mcpx-images* !test/result* !**/test/result* !tests/result* diff --git a/mcpx-images b/mcpx-images deleted file mode 120000 index f6724871ff..0000000000 --- a/mcpx-images +++ /dev/null @@ -1 +0,0 @@ -/nix/store/xzsjk110bkd6d903gb3xwkzv7mc06v8p-mcpx.tar.gz \ No newline at end of file diff --git a/mcpx-images-1 b/mcpx-images-1 deleted file mode 120000 index 1743759eeb..0000000000 --- a/mcpx-images-1 +++ /dev/null @@ -1 +0,0 @@ -/nix/store/izprwdhnb53r6kbb396nkl0grgg4zg63-mcpx-e2e-test.tar.gz \ No newline at end of file diff --git a/pkgs/mcpx/internal/e2e/effect_test.go b/pkgs/mcpx/internal/e2e/effect_test.go index 5d2dbd3ca3..be5408678b 100644 --- a/pkgs/mcpx/internal/e2e/effect_test.go +++ b/pkgs/mcpx/internal/e2e/effect_test.go @@ -2360,6 +2360,7 @@ func runtimeOf(t *testing.T, e *env, args ...string) string { // script.runtime: scripts run on deno by default and on node once the // environment names it. func TestScriptRuntimeSelectsTheRuntime(t *testing.T) { + testsupport.RequireBinary(t, "deno") testsupport.RequireBinary(t, "node") e := newEnv(t, oneServer) if rt := runtimeOf(t, e); rt != "deno" { @@ -2375,6 +2376,7 @@ func TestScriptRuntimeSelectsTheRuntime(t *testing.T) { // script.runtimeOrder: the automatic pick is deno by default and node once // the environment ranks node first. func TestScriptRuntimeOrderRanksTheAutoPick(t *testing.T) { + testsupport.RequireBinary(t, "deno") testsupport.RequireBinary(t, "node") e := newEnv(t, oneServer) if rt := runtimeOf(t, e); rt != "deno" { From caf10fa5cf120114fc9b9df2a02f4a3881ce2d11 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Fri, 20 Nov 2026 13:33:50 -0600 Subject: [PATCH 11/11] janitor: preserve aging worktree state (#6884) --- pkgs/mcpx/plugin/core/ops.gen.ts | 550 ++++++++++--------------------- 1 file changed, 178 insertions(+), 372 deletions(-) diff --git a/pkgs/mcpx/plugin/core/ops.gen.ts b/pkgs/mcpx/plugin/core/ops.gen.ts index 0ffc74c82e..96ef50e1e2 100644 --- a/pkgs/mcpx/plugin/core/ops.gen.ts +++ b/pkgs/mcpx/plugin/core/ops.gen.ts @@ -6,21 +6,21 @@ // a parameter this file sends is one the route reads. /** Where a parameter travels. */ -type In = "path" | "query" | "body"; +type In = "path" | "query" | "body" -type ParamSpec = { in: In; required?: boolean; raw?: boolean }; +type ParamSpec = { in: In; required?: boolean; raw?: boolean } type OpSpec = { - method: string; - path: string; - params: Record; + method: string + path: string + params: Record /** The body parameter that is the whole body, for routes that take a bare document. */ - wrap?: string; + wrap?: string /** json is parsed; response is handed back for the caller to read as text, bytes or a stream. */ - response: "json" | "response"; -}; + response: "json" | "response" +} -export const OPERATION_FINGERPRINT = "4cb2e300265729ccb26e7f9e7d3775cd10618dfb27223f89a3a3da3310d7b314"; +export const OPERATION_FINGERPRINT = "4cb2e300265729ccb26e7f9e7d3775cd10618dfb27223f89a3a3da3310d7b314" /** Every /v1 operation, by name. */ export const OPS: Record = { @@ -888,7 +888,7 @@ export const OPS: Record = { }, response: "json", }, -}; +} /** A refusal from the daemon, with the status and the body kept. */ export class OpError extends Error { @@ -897,23 +897,23 @@ export class OpError extends Error { readonly status: number, readonly body: string, ) { - let msg = body.trim(); + let msg = body.trim() try { - const parsed = JSON.parse(body) as { error?: unknown }; - if (typeof parsed.error === "string" && parsed.error) msg = parsed.error; + const parsed = JSON.parse(body) as { error?: unknown } + if (typeof parsed.error === "string" && parsed.error) msg = parsed.error } catch { // Not JSON; the text is the message. } - super(`mcpx ${op}: ${status}: ${msg}`); + super(`mcpx ${op}: ${status}: ${msg}`) } } const scalar = (v: unknown): string => { - if (typeof v === "string") return v; - if (typeof v === "boolean") return v ? "1" : "0"; - if (typeof v === "number") return String(v); - return JSON.stringify(v); -}; + if (typeof v === "string") return v + if (typeof v === "boolean") return v ? "1" : "0" + if (typeof v === "number") return String(v) + return JSON.stringify(v) +} /** * The path and request for one operation. The same rules as the Go side's @@ -923,46 +923,46 @@ const scalar = (v: unknown): string => { * document. */ export const buildRequest = (name: string, args: Record = {}): { path: string; init: RequestInit } => { - const spec = OPS[name]; - if (!spec) throw new Error(`mcpx: no operation ${name}`); - let path = spec.path; - const query = new URLSearchParams(); - const body: Record = {}; - let raw: BodyInit | undefined; + const spec = OPS[name] + if (!spec) throw new Error(`mcpx: no operation ${name}`) + let path = spec.path + const query = new URLSearchParams() + const body: Record = {} + let raw: BodyInit | undefined for (const [key, value] of Object.entries(args)) { - if (value === undefined) continue; - const p = spec.params[key]; - if (!p) throw new Error(`mcpx ${name} takes no argument ${key}`); - if (p.raw) raw = value as BodyInit; - else if (p.in === "path") path = path.replace(`{${key}}`, encodeURIComponent(scalar(value))); + if (value === undefined) continue + const p = spec.params[key] + if (!p) throw new Error(`mcpx ${name} takes no argument ${key}`) + if (p.raw) raw = value as BodyInit + else if (p.in === "path") path = path.replace(`{${key}}`, encodeURIComponent(scalar(value))) else if (p.in === "query") { - const s = scalar(value); - if (s !== "") query.set(key, s); - } else body[key] = value; + const s = scalar(value) + if (s !== "") query.set(key, s) + } else body[key] = value } for (const [key, p] of Object.entries(spec.params)) { - if (p.required && args[key] === undefined) throw new Error(`mcpx ${name}: ${key} is required`); + if (p.required && args[key] === undefined) throw new Error(`mcpx ${name}: ${key} is required`) } - if (path.includes("{")) throw new Error(`mcpx ${name}: unfilled path parameter in ${path}`); - const qs = query.toString(); - if (qs) path += "?" + qs; - const init: RequestInit = { method: spec.method }; + if (path.includes("{")) throw new Error(`mcpx ${name}: unfilled path parameter in ${path}`) + const qs = query.toString() + if (qs) path += "?" + qs + const init: RequestInit = { method: spec.method } if (raw !== undefined) { - init.body = raw; - init.headers = { "content-type": "application/octet-stream" }; + init.body = raw + init.headers = { "content-type": "application/octet-stream" } } else if (spec.method !== "GET") { - const doc = spec.wrap ? (body[spec.wrap] ?? {}) : body; - init.body = JSON.stringify(doc); - init.headers = { "content-type": "application/json" }; + const doc = spec.wrap ? (body[spec.wrap] ?? {}) : body + init.body = JSON.stringify(doc) + init.headers = { "content-type": "application/json" } } - return { path, init }; -}; + return { path, init } +} /** Sends one request to the daemon; DaemonClient.raw is one. */ -export type Fetcher = (path: string, init: RequestInit) => Promise; +export type Fetcher = (path: string, init: RequestInit) => Promise /** Options every method accepts. */ -export type CallOptions = { signal?: AbortSignal }; +export type CallOptions = { signal?: AbortSignal } /** A typed method for every /v1 operation. */ export class DaemonOps { @@ -970,33 +970,21 @@ export class DaemonOps { /** Performs any operation by name; the typed methods below are this. */ async invoke(name: string, args: Record = {}, opts: CallOptions = {}): Promise { - const { path, init } = buildRequest(name, args); - if (opts.signal) init.signal = opts.signal; - const res = await this.fetcher(path, init); - if (!res.ok) throw new OpError(name, res.status, await res.text()); - if (OPS[name].response === "response") return res; - const text = await res.text(); - return text ? JSON.parse(text) : undefined; + const { path, init } = buildRequest(name, args) + if (opts.signal) init.signal = opts.signal + const res = await this.fetcher(path, init) + if (!res.ok) throw new OpError(name, res.status, await res.text()) + if (OPS[name].response === "response") return res + const text = await res.text() + return text ? JSON.parse(text) : undefined } /** * Add an adapter declaration, live. `POST /v1/adapters`. * Privileged: it changes the daemon rather than reading it. */ - adaptersAdd( - args: { - name: string; - command: string; - runtime?: string; - args?: unknown[]; - env?: Record; - description?: string; - tools?: unknown[]; - replace?: boolean; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("adapters_add", args, opts) as Promise; + adaptersAdd(args: { name: string; command: string; runtime?: string; args?: unknown[]; env?: Record; description?: string; tools?: unknown[]; replace?: boolean }, opts: CallOptions = {}): Promise { + return this.invoke("adapters_add", args, opts) as Promise } /** @@ -1005,29 +993,15 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ adaptersRemove(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("adapters_remove", args, opts) as Promise; + return this.invoke("adapters_remove", args, opts) as Promise } /** * Add an API declaration, live. `POST /v1/apis`. * Privileged: it changes the daemon rather than reading it. */ - apisAdd( - args: { - name: string; - spec: string; - baseUrl?: string; - include?: unknown[]; - exclude?: unknown[]; - methods?: unknown[]; - includeDeprecated?: boolean; - headers?: Record; - description?: string; - replace?: boolean; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("apis_add", args, opts) as Promise; + apisAdd(args: { name: string; spec: string; baseUrl?: string; include?: unknown[]; exclude?: unknown[]; methods?: unknown[]; includeDeprecated?: boolean; headers?: Record; description?: string; replace?: boolean }, opts: CallOptions = {}): Promise { + return this.invoke("apis_add", args, opts) as Promise } /** @@ -1036,7 +1010,7 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ apisRemove(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("apis_remove", args, opts) as Promise; + return this.invoke("apis_remove", args, opts) as Promise } /** @@ -1045,35 +1019,29 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ artifactDelete(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("artifact_delete", args, opts) as Promise; + return this.invoke("artifact_delete", args, opts) as Promise } /** * Fetch one artifact's bytes. `GET /v1/artifacts/{id}`. */ artifactGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("artifact_get", args, opts) as Promise; + return this.invoke("artifact_get", args, opts) as Promise } /** * Store a file a script produced. `POST /v1/artifacts`. * Privileged: it changes the daemon rather than reading it. */ - artifactPut( - args: { name: string; mime?: string; run?: string; session?: string; ttl?: string; content: BodyInit }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("artifact_put", args, opts) as Promise; + artifactPut(args: { name: string; mime?: string; run?: string; session?: string; ttl?: string; content: BodyInit }, opts: CallOptions = {}): Promise { + return this.invoke("artifact_put", args, opts) as Promise } /** * Files scripts produced, newest first. `GET /v1/artifacts`. */ - artifactsList( - args: { run?: string; session?: string; limit?: number } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("artifacts_list", args, opts) as Promise; + artifactsList(args: { run?: string; session?: string; limit?: number } = {}, opts: CallOptions = {}): Promise { + return this.invoke("artifacts_list", args, opts) as Promise } /** @@ -1082,7 +1050,7 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ askAbandon(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("ask_abandon", args, opts) as Promise; + return this.invoke("ask_abandon", args, opts) as Promise } /** @@ -1090,42 +1058,28 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ askAnswers(args: { id: string; answers: Record }, opts: CallOptions = {}): Promise { - return this.invoke("ask_answers", args, opts) as Promise; + return this.invoke("ask_answers", args, opts) as Promise } /** * Start a call that a server may interrupt with a question. `POST /v1/ask`. */ - askBegin( - args: { - kind: "tools/call" | "prompts/get" | "resources/read"; - server: string; - tool?: string; - name?: string; - uri?: string; - args?: Record; - arguments?: Record; - ttl?: number; - session?: string; - context?: Record; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("ask_begin", args, opts) as Promise; + askBegin(args: { kind: "tools/call" | "prompts/get" | "resources/read"; server: string; tool?: string; name?: string; uri?: string; args?: Record; arguments?: Record; ttl?: number; session?: string; context?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("ask_begin", args, opts) as Promise } /** * What a call is waiting on, or its result. `GET /v1/ask/{id}`. */ askPoll(args: { id: string; waitMs?: number }, opts: CallOptions = {}): Promise { - return this.invoke("ask_poll", args, opts) as Promise; + return this.invoke("ask_poll", args, opts) as Promise } /** * The permissive authorisation decision report. `GET /v1/authz/decisions`. */ authzDecisions(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("authz_decisions", args, opts) as Promise; + return this.invoke("authz_decisions", args, opts) as Promise } /** @@ -1133,109 +1087,63 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ authzDecisionsClear(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("authz_decisions_clear", args, opts) as Promise; + return this.invoke("authz_decisions_clear", args, opts) as Promise } /** * Execute multiple tool calls in a single turn. `POST /v1/batch`. */ - batch( - args: { - calls: unknown[]; - stopOnError?: boolean; - parallel?: boolean; - safePrefix?: boolean; - session?: string; - context?: Record; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("batch", args, opts) as Promise; + batch(args: { calls: unknown[]; stopOnError?: boolean; parallel?: boolean; safePrefix?: boolean; session?: string; context?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("batch", args, opts) as Promise } /** * Call one tool on one server. `POST /v1/call`. */ - call( - args: { - server: string; - tool: string; - args?: Record; - task?: Record; - session?: string; - context?: Record; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("call", args, opts) as Promise; + call(args: { server: string; tool: string; args?: Record; task?: Record; session?: string; context?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("call", args, opts) as Promise } /** * Call one tool, with the pair in the URL. `POST /v1/call/{server}/{tool}`. */ - callPath( - args: { server: string; tool: string; session?: string; arguments?: Record }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("call_path", args, opts) as Promise; + callPath(args: { server: string; tool: string; session?: string; arguments?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("call_path", args, opts) as Promise } /** * Every namespace with as many signatures as fit a token budget. `GET /v1/catalog`. */ - catalog( - args: { - ns?: string; - budget?: number; - bias?: string; - profile?: string; - skipDefault?: "0" | "1"; - allProfiles?: "0" | "1"; - } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("catalog", args, opts) as Promise; + catalog(args: { ns?: string; budget?: number; bias?: string; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("catalog", args, opts) as Promise } /** * What changed in the tool schemas, and when. `GET /v1/catalog/history`. */ catalogHistory(args: { tool?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("catalog_history", args, opts) as Promise; + return this.invoke("catalog_history", args, opts) as Promise } /** * OpenAI-compatible LLM chat completions endpoint. `POST /v1/chat/completions`. */ chatCompletions(args: { model?: string; messages: unknown[] }, opts: CallOptions = {}): Promise { - return this.invoke("chat_completions", args, opts) as Promise; + return this.invoke("chat_completions", args, opts) as Promise } /** * The generated TypeScript client. `GET /v1/client.ts`. */ - clientModule( - args: { ns?: string; session?: string; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("client_module", args, opts) as Promise; + clientModule(args: { ns?: string; session?: string; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("client_module", args, opts) as Promise } /** * Argument autocomplete from an upstream server. `POST /v1/complete`. */ - complete( - args: { - server: string; - ref: Record; - argument: Record; - arguments?: Record; - session?: string; - context?: Record; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("complete", args, opts) as Promise; + complete(args: { server: string; ref: Record; argument: Record; arguments?: Record; session?: string; context?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("complete", args, opts) as Promise } /** @@ -1244,284 +1152,228 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ daemonRestart(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("daemon_restart", args, opts) as Promise; + return this.invoke("daemon_restart", args, opts) as Promise } /** * Live web dashboard HTML. `GET /v1/dashboard`. */ dashboard(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("dashboard", args, opts) as Promise; + return this.invoke("dashboard", args, opts) as Promise } /** * Explain what is wrong with a script, deterministically. `POST /v1/diagnose`. */ diagnose(args: { source: string; session?: string; repair?: boolean }, opts: CallOptions = {}): Promise { - return this.invoke("diagnose", args, opts) as Promise; + return this.invoke("diagnose", args, opts) as Promise } /** * Answer a question a server asked. `POST /v1/elicit/{id}/{action}`. * Privileged: it changes the daemon rather than reading it. */ - elicitAnswer( - args: { id: string; action: "accept" | "decline" | "cancel"; content?: Record }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("elicit_answer", args, opts) as Promise; + elicitAnswer(args: { id: string; action: "accept" | "decline" | "cancel"; content?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("elicit_answer", args, opts) as Promise } /** * One question, with its answer once it has one. `GET /v1/elicit/{id}`. */ elicitGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("elicit_get", args, opts) as Promise; + return this.invoke("elicit_get", args, opts) as Promise } /** * Questions servers are waiting on an answer for. `GET /v1/elicit`. */ elicitList(args: { session?: string; audience?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("elicit_list", args, opts) as Promise; + return this.invoke("elicit_list", args, opts) as Promise } /** * Compute vector embeddings for text. `POST /v1/embeddings`. */ embeddings(args: { input: string; model?: string }, opts: CallOptions = {}): Promise { - return this.invoke("embeddings", args, opts) as Promise; + return this.invoke("embeddings", args, opts) as Promise } /** * Export cached vector embeddings. `GET /v1/embeddings/export`. */ embeddingsExport(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("embeddings_export", args, opts) as Promise; + return this.invoke("embeddings_export", args, opts) as Promise } /** * Import pre-computed vector embeddings. `POST /v1/embeddings/import`. */ embeddingsImport(args: { content: BodyInit }, opts: CallOptions = {}): Promise { - return this.invoke("embeddings_import", args, opts) as Promise; + return this.invoke("embeddings_import", args, opts) as Promise } /** * Server-sent event stream. `GET /v1/events`. * A stream: read the response body until you are done with it. */ - events( - args: { kinds?: string; session?: string; server?: string; uri?: string; since?: number } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("events", args, opts) as Promise; + events(args: { kinds?: string; session?: string; server?: string; uri?: string; since?: number } = {}, opts: CallOptions = {}): Promise { + return this.invoke("events", args, opts) as Promise } /** * Run TypeScript on the daemon. `POST /v1/exec`. * Privileged: it changes the daemon rather than reading it. */ - exec( - args: { source?: string; file?: string; options?: Record } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("exec", args, opts) as Promise; + exec(args: { source?: string; file?: string; options?: Record } = {}, opts: CallOptions = {}): Promise { + return this.invoke("exec", args, opts) as Promise } /** * Submit quality feedback for a trace. `POST /v1/feedback`. */ - feedback( - args: { - traceId: string; - score: number; - target?: string; - retrievalScore?: number; - executionScore?: number; - notes?: string; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("feedback", args, opts) as Promise; + feedback(args: { traceId: string; score: number; target?: string; retrievalScore?: number; executionScore?: number; notes?: string }, opts: CallOptions = {}): Promise { + return this.invoke("feedback", args, opts) as Promise } /** * Ambient declarations for the installed globals. `GET /v1/globals.d.ts`. */ - globals( - args: { ns?: string; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("globals", args, opts) as Promise; + globals(args: { ns?: string; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("globals", args, opts) as Promise } /** * Liveness, version and the loopback endpoint. `GET /v1/health`. */ health(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("health", args, opts) as Promise; + return this.invoke("health", args, opts) as Promise } /** * A request in words, a script back. `POST /v1/intent`. */ - intent( - args: { prompt: string; autonomy?: "propose" | "run"; placeholders?: Record; session?: string }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("intent", args, opts) as Promise; + intent(args: { prompt: string; autonomy?: "propose" | "run"; placeholders?: Record; session?: string }, opts: CallOptions = {}): Promise { + return this.invoke("intent", args, opts) as Promise } /** * Inspect a specific interaction trace. `GET /v1/interactions/{id}`. */ interactionsGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("interactions_get", args, opts) as Promise; + return this.invoke("interactions_get", args, opts) as Promise } /** * List and filter past interaction traces. `GET /v1/interactions`. */ - interactionsList( - args: { q?: string; source?: string; target?: string; hasFeedback?: string } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("interactions_list", args, opts) as Promise; + interactionsList(args: { q?: string; source?: string; target?: string; hasFeedback?: string } = {}, opts: CallOptions = {}): Promise { + return this.invoke("interactions_list", args, opts) as Promise } /** * Query the durable log. `GET /v1/log`. */ - logQuery( - args: { - since?: string; - until?: string; - level?: "debug" | "info" | "warn" | "error"; - event?: string; - server?: string; - tool?: string; - session?: string; - trace?: string; - chain?: string; - grep?: string; - limit?: number; - reverse?: "0" | "1"; - } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("log_query", args, opts) as Promise; + logQuery(args: { since?: string; until?: string; level?: "debug" | "info" | "warn" | "error"; event?: string; server?: string; tool?: string; session?: string; trace?: string; chain?: string; grep?: string; limit?: number; reverse?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("log_query", args, opts) as Promise } /** * Append one record to the durable log. `POST /v1/log`. * Privileged: it changes the daemon rather than reading it. */ - logRecord( - args: { level?: "debug" | "info" | "warn" | "error"; record: Record }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("log_record", args, opts) as Promise; + logRecord(args: { level?: "debug" | "info" | "warn" | "error"; record: Record }, opts: CallOptions = {}): Promise { + return this.invoke("log_record", args, opts) as Promise } /** * Token economics telemetry summary. `GET /v1/metrics/tokens`. */ metricsTokens(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("metrics_tokens", args, opts) as Promise; + return this.invoke("metrics_tokens", args, opts) as Promise } /** * Tool call telemetry, error rates, correlations and timelines. `GET /v1/metrics/tools`. */ metricsTools(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("metrics_tools", args, opts) as Promise; + return this.invoke("metrics_tools", args, opts) as Promise } /** * Every configured server, with tool counts. `GET /v1/namespaces`. */ - namespaces( - args: { profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("namespaces", args, opts) as Promise; + namespaces(args: { profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("namespaces", args, opts) as Promise } /** * This API, as an OpenAPI 3.1 document. `GET /v1/openapi.json`. */ openapi(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("openapi", args, opts) as Promise; + return this.invoke("openapi", args, opts) as Promise } /** * End a plugin session, dropping everything it owns. `DELETE /v1/plugin-sessions/{id}`. */ pluginSessionClose(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("plugin_session_close", args, opts) as Promise; + return this.invoke("plugin_session_close", args, opts) as Promise } /** * One live plugin session. `GET /v1/plugin-sessions/{id}`. */ pluginSessionGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("plugin_session_get", args, opts) as Promise; + return this.invoke("plugin_session_get", args, opts) as Promise } /** * Live plugin sessions and what each one owns. `GET /v1/plugin-sessions`. */ pluginSessionsList(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("plugin_sessions_list", args, opts) as Promise; + return this.invoke("plugin_sessions_list", args, opts) as Promise } /** * Open a plugin session and be issued its id. `POST /v1/plugin-sessions`. */ - pluginSessionsOpen( - args: { plugin: string; capabilities?: unknown[]; hooks?: unknown[] }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("plugin_sessions_open", args, opts) as Promise; + pluginSessionsOpen(args: { plugin: string; capabilities?: unknown[]; hooks?: unknown[] }, opts: CallOptions = {}): Promise { + return this.invoke("plugin_sessions_open", args, opts) as Promise } /** * Check a script's servers are ready before running it. `POST /v1/preflight`. */ preflight(args: { source: string }, opts: CallOptions = {}): Promise { - return this.invoke("preflight", args, opts) as Promise; + return this.invoke("preflight", args, opts) as Promise } /** * Render one prompt with its arguments filled in. `POST /v1/prompt`. */ - promptGet( - args: { server: string; name: string; arguments?: Record; sessionId?: string; callId?: string }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("prompt_get", args, opts) as Promise; + promptGet(args: { server: string; name: string; arguments?: Record; sessionId?: string; callId?: string }, opts: CallOptions = {}): Promise { + return this.invoke("prompt_get", args, opts) as Promise } /** * Every prompt the configured servers offer. `GET /v1/prompts`. */ prompts(args: { ns?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("prompts", args, opts) as Promise; + return this.invoke("prompts", args, opts) as Promise } /** * Which MCP revisions mcpx speaks, in both directions. `GET /v1/protocol`. */ protocol(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("protocol", args, opts) as Promise; + return this.invoke("protocol", args, opts) as Promise } /** * One recipe, with its source. `GET /v1/recipes/{name}`. */ recipeGet(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("recipe_get", args, opts) as Promise; + return this.invoke("recipe_get", args, opts) as Promise } /** @@ -1530,31 +1382,28 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ recipeRemove(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("recipe_remove", args, opts) as Promise; + return this.invoke("recipe_remove", args, opts) as Promise } /** * Run a recipe with its placeholders filled in. `POST /v1/recipes/{name}/run`. */ - recipeRun( - args: { name: string; placeholders?: Record; autonomy?: "propose" | "run"; session?: string }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("recipe_run", args, opts) as Promise; + recipeRun(args: { name: string; placeholders?: Record; autonomy?: "propose" | "run"; session?: string }, opts: CallOptions = {}): Promise { + return this.invoke("recipe_run", args, opts) as Promise } /** * Save a script as a recipe. `POST /v1/recipes/{name}`. */ recipeSave(args: { name: string; source: string; overwrite?: boolean }, opts: CallOptions = {}): Promise { - return this.invoke("recipe_save", args, opts) as Promise; + return this.invoke("recipe_save", args, opts) as Promise } /** * Saved scripts, with the placeholders each takes. `GET /v1/recipes`. */ recipesList(args: { q?: string; limit?: number } = {}, opts: CallOptions = {}): Promise { - return this.invoke("recipes_list", args, opts) as Promise; + return this.invoke("recipes_list", args, opts) as Promise } /** @@ -1562,14 +1411,14 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ refresh(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("refresh", args, opts) as Promise; + return this.invoke("refresh", args, opts) as Promise } /** * Search a public registry of MCP servers. `GET /v1/registry/search`. */ registrySearch(args: { q: string; limit?: number }, opts: CallOptions = {}): Promise { - return this.invoke("registry_search", args, opts) as Promise; + return this.invoke("registry_search", args, opts) as Promise } /** @@ -1577,38 +1426,35 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ reload(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("reload", args, opts) as Promise; + return this.invoke("reload", args, opts) as Promise } /** * Which daemon serves a directory. `GET /v1/resolve`. */ resolve(args: { dir: string }, opts: CallOptions = {}): Promise { - return this.invoke("resolve", args, opts) as Promise; + return this.invoke("resolve", args, opts) as Promise } /** * Read one resource from one server. `POST /v1/resource`. */ - resourceRead( - args: { server: string; uri: string; session?: string; context?: Record }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("resource_read", args, opts) as Promise; + resourceRead(args: { server: string; uri: string; session?: string; context?: Record }, opts: CallOptions = {}): Promise { + return this.invoke("resource_read", args, opts) as Promise } /** * Every templated resource the configured servers offer. `GET /v1/resource-templates`. */ resourceTemplates(args: { ns?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("resource_templates", args, opts) as Promise; + return this.invoke("resource_templates", args, opts) as Promise } /** * Every resource the configured servers offer. `GET /v1/resources`. */ resources(args: { ns?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("resources", args, opts) as Promise; + return this.invoke("resources", args, opts) as Promise } /** @@ -1617,14 +1463,14 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ restart(args: { server?: string; lazy?: boolean } = {}, opts: CallOptions = {}): Promise { - return this.invoke("restart", args, opts) as Promise; + return this.invoke("restart", args, opts) as Promise } /** * Rank tools against a query. `GET /v1/search`. */ search(args: { q: string; limit?: number; semantic?: boolean }, opts: CallOptions = {}): Promise { - return this.invoke("search", args, opts) as Promise; + return this.invoke("search", args, opts) as Promise } /** @@ -1632,28 +1478,28 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ secretRequestDecline(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("secret_request_decline", args, opts) as Promise; + return this.invoke("secret_request_decline", args, opts) as Promise } /** * One secret request, and whether it is still waiting. `GET /v1/secret-requests/{id}`. */ secretRequestGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("secret_request_get", args, opts) as Promise; + return this.invoke("secret_request_get", args, opts) as Promise } /** * Requests waiting for a person to give secrets. `GET /v1/secret-requests`. */ secretRequestsList(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("secret_requests_list", args, opts) as Promise; + return this.invoke("secret_requests_list", args, opts) as Promise } /** * Which secrets servers need, and which of them have a value. `GET /v1/secrets`. */ secretsList(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("secrets_list", args, opts) as Promise; + return this.invoke("secrets_list", args, opts) as Promise } /** @@ -1661,7 +1507,7 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ secretsSet(args: { name: string; value: string }, opts: CallOptions = {}): Promise { - return this.invoke("secrets_set", args, opts) as Promise; + return this.invoke("secrets_set", args, opts) as Promise } /** @@ -1670,43 +1516,29 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ secretsUnset(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("secrets_unset", args, opts) as Promise; + return this.invoke("secrets_unset", args, opts) as Promise } /** * Add a server, live. `POST /v1/servers`. * Privileged: it changes the daemon rather than reading it. */ - serversAdd( - args: { - name: string; - command?: string; - args?: unknown[]; - env?: Record; - url?: string; - headers?: Record; - transport?: "stdio" | "http" | "sse"; - mcpx?: Record; - scope?: "project" | "user"; - replace?: boolean; - }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("servers_add", args, opts) as Promise; + serversAdd(args: { name: string; command?: string; args?: unknown[]; env?: Record; url?: string; headers?: Record; transport?: "stdio" | "http" | "sse"; mcpx?: Record; scope?: "project" | "user"; replace?: boolean }, opts: CallOptions = {}): Promise { + return this.invoke("servers_add", args, opts) as Promise } /** * One configured server, and whether it can run now. `GET /v1/servers/{name}`. */ serversGet(args: { name: string }, opts: CallOptions = {}): Promise { - return this.invoke("servers_get", args, opts) as Promise; + return this.invoke("servers_get", args, opts) as Promise } /** * Every configured server as it is written in the configuration. `GET /v1/servers`. */ serversList(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("servers_list", args, opts) as Promise; + return this.invoke("servers_list", args, opts) as Promise } /** @@ -1715,7 +1547,7 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ serversRemove(args: { name: string; scope?: "project" | "user" }, opts: CallOptions = {}): Promise { - return this.invoke("servers_remove", args, opts) as Promise; + return this.invoke("servers_remove", args, opts) as Promise } /** @@ -1723,42 +1555,36 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ sessionRelease(args: { session: string }, opts: CallOptions = {}): Promise { - return this.invoke("session_release", args, opts) as Promise; + return this.invoke("session_release", args, opts) as Promise } /** * The session inventory: every pool's live instances. `GET /v1/sessions`. */ sessionsRead(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("sessions_read", args, opts) as Promise; + return this.invoke("sessions_read", args, opts) as Promise } /** * One setting. `GET /v1/settings/{path}`. */ settingsGet(args: { path: string }, opts: CallOptions = {}): Promise { - return this.invoke("settings_get", args, opts) as Promise; + return this.invoke("settings_get", args, opts) as Promise } /** * Every setting, its effective value and where that value came from. `GET /v1/settings`. */ - settingsList( - args: { scope?: "daemon" | "client" | "call" | "plugin"; plumbing?: "0" | "1"; changed?: "0" | "1" } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("settings_list", args, opts) as Promise; + settingsList(args: { scope?: "daemon" | "client" | "call" | "plugin"; plumbing?: "0" | "1"; changed?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("settings_list", args, opts) as Promise } /** * Change a setting. `PUT /v1/settings/{path}`. * Privileged: it changes the daemon rather than reading it. */ - settingsSet( - args: { path: string; value: string; persist?: "runtime" | "project" | "user" }, - opts: CallOptions = {}, - ): Promise { - return this.invoke("settings_set", args, opts) as Promise; + settingsSet(args: { path: string; value: string; persist?: "runtime" | "project" | "user" }, opts: CallOptions = {}): Promise { + return this.invoke("settings_set", args, opts) as Promise } /** @@ -1766,7 +1592,7 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ settingsUnset(args: { path: string }, opts: CallOptions = {}): Promise { - return this.invoke("settings_unset", args, opts) as Promise; + return this.invoke("settings_unset", args, opts) as Promise } /** @@ -1775,90 +1601,70 @@ export class DaemonOps { * Destructive: it cannot be undone, and other callers are affected. */ shutdown(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("shutdown", args, opts) as Promise; + return this.invoke("shutdown", args, opts) as Promise } /** * Aggregate the log into numbers. `GET /v1/stats`. */ - statsQuery( - args: { - by?: "calls" | "servers" | "instances" | "errors" | "sessions" | "volume" | "slowest"; - since?: string; - until?: string; - server?: string; - tool?: string; - session?: string; - top?: number; - } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("stats_query", args, opts) as Promise; + statsQuery(args: { by?: "calls" | "servers" | "instances" | "errors" | "sessions" | "volume" | "slowest"; since?: string; until?: string; server?: string; tool?: string; session?: string; top?: number } = {}, opts: CallOptions = {}): Promise { + return this.invoke("stats_query", args, opts) as Promise } /** * The daemon, its pools and live instances. `GET /v1/status`. */ status(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("status", args, opts) as Promise; + return this.invoke("status", args, opts) as Promise } /** * Cancel a running task. `POST /v1/tasks/{id}/cancel`. */ taskCancel(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("task_cancel", args, opts) as Promise; + return this.invoke("task_cancel", args, opts) as Promise } /** * One task's status. `GET /v1/tasks/{id}`. */ taskGet(args: { id: string }, opts: CallOptions = {}): Promise { - return this.invoke("task_get", args, opts) as Promise; + return this.invoke("task_get", args, opts) as Promise } /** * Wait for a task and collect its result. `GET /v1/tasks/{id}/result`. */ taskResult(args: { id: string; waitMs?: number }, opts: CallOptions = {}): Promise { - return this.invoke("task_result", args, opts) as Promise; + return this.invoke("task_result", args, opts) as Promise } /** * Background calls and their status. `GET /v1/tasks`. */ tasksList(args: Record = {}, opts: CallOptions = {}): Promise { - return this.invoke("tasks_list", args, opts) as Promise; + return this.invoke("tasks_list", args, opts) as Promise } /** * Run one of mcpx's own MCP tools as a plain POST. `POST /v1/tools/{tool}`. */ toolInvoke(args: { tool: string; arguments?: Record }, opts: CallOptions = {}): Promise { - return this.invoke("tool_invoke", args, opts) as Promise; + return this.invoke("tool_invoke", args, opts) as Promise } /** * Every tool of every configured server. `GET /v1/tools`. */ tools(args: { ns?: string } = {}, opts: CallOptions = {}): Promise { - return this.invoke("tools", args, opts) as Promise; + return this.invoke("tools", args, opts) as Promise } /** * TypeScript declarations for the named namespaces. `GET /v1/types`. */ - types( - args: { - ns?: string; - instructions?: "0" | "1"; - profile?: string; - skipDefault?: "0" | "1"; - allProfiles?: "0" | "1"; - } = {}, - opts: CallOptions = {}, - ): Promise { - return this.invoke("types", args, opts) as Promise; + types(args: { ns?: string; instructions?: "0" | "1"; profile?: string; skipDefault?: "0" | "1"; allProfiles?: "0" | "1" } = {}, opts: CallOptions = {}): Promise { + return this.invoke("types", args, opts) as Promise } /** @@ -1866,6 +1672,6 @@ export class DaemonOps { * Privileged: it changes the daemon rather than reading it. */ writesClear(args: { server: string }, opts: CallOptions = {}): Promise { - return this.invoke("writes_clear", args, opts) as Promise; + return this.invoke("writes_clear", args, opts) as Promise } }