this derivation will be built: /nix/store/h8ir54yky93yw5c92jb2p4p3l6yspyjr-spaces-integration-gateway-unit-test.drv this path will be fetched (0.0 KiB download, 75.9 MiB unpacked): /nix/store/xjvj5vi8qrhdy5miayc2gzdbxd968vsx-bun-1.4.2 warning: ignoring the client-specified setting 'store', because it is a restricted setting and you are not a trusted user building '/nix/store/h8ir54yky93yw5c92jb2p4p3l6yspyjr-spaces-integration-gateway-unit-test.drv' on nix-store.geninf.io:50051 spaces-integration-gateway-unit-test> build01: building h8ir54yky93yw5c92jb2p4p3l6yspyjr-spaces-integration-gateway-unit-test.drv spaces-integration-gateway-unit-test> bun test v1.4.2 (744846f84) spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> gateway-core.test.ts: spaces-integration-gateway-unit-test> ✓ discoverTools returns the server's tools with inputSchema as parameters [9.45ms] spaces-integration-gateway-unit-test> ✓ discoverTools resolves [] when the socket is unreachable [2.32ms] spaces-integration-gateway-unit-test> ✓ buildRegistry namespaces tools and precomputes the autoRun verdict [1.41ms] spaces-integration-gateway-unit-test> ✓ loadDefinition parses confirmPreview; absent ⇒ empty map [0.29ms] spaces-integration-gateway-unit-test> ✓ buildRegistry carries confirmPreview and hides preview tools from the registry [0.50ms] spaces-integration-gateway-unit-test> integrations: cannot read definition for ghost: Error: ENOENT: no such file or directory, open '/build/gateway-core-test-PE5bSB/reg2/ghost.json' spaces-integration-gateway-unit-test> ✓ buildRegistry skips disabled integrations and missing definitions [0.92ms] spaces-integration-gateway-unit-test> integrations: cannot read /build/gateway-core-test-PE5bSB/reg3/enabled.json: SyntaxError: JSON Parse error: Expected '}' spaces-integration-gateway-unit-test> ✓ buildRegistry yields nothing when enabled.json is unreadable/malformed [0.33ms] spaces-integration-gateway-unit-test> ✓ enabledMtimeMs is 0 when absent, positive once the file exists [0.42ms] spaces-integration-gateway-unit-test> ✓ refreshRegistry rebuilds only when enabled.json's mtime moves [0.61ms] spaces-integration-gateway-unit-test> ✓ integrationNames lists each enabled integration once [0.44ms] spaces-integration-gateway-unit-test> ✓ callIntegrationTool: initialize/initialized/tools-call, text concatenated [2.47ms] spaces-integration-gateway-unit-test> ✓ callIntegrationTool: server isError surfaces as isError [1.29ms] spaces-integration-gateway-unit-test> ✓ callIntegrationTool: connection failure resolves unavailable, never throws [0.42ms] spaces-integration-gateway-unit-test> ✓ callIntegrationTool: timeout resolves unavailable [201.14ms] spaces-integration-gateway-unit-test> ✓ callIntegrationTool: abort signal resolves unavailable [1.26ms] spaces-integration-gateway-unit-test> ✓ mcpExchange runs the step chain and yields the final reply [1.13ms] spaces-integration-gateway-unit-test> ✓ mcpExchange resolves a failure result, never rejects [0.39ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> mcp-server.test.ts: spaces-integration-gateway-unit-test> ✓ advertisedTools maps registry entries to MCP tool descriptors [0.18ms] spaces-integration-gateway-unit-test> ✓ initialize advertises the tool-list-changed capability and marks the session [0.38ms] spaces-integration-gateway-unit-test> ✓ notifications/initialized owes no reply [0.09ms] spaces-integration-gateway-unit-test> ✓ tools/list returns the aggregated advertised tools [0.14ms] spaces-integration-gateway-unit-test> ✓ an unknown method resolves a JSON-RPC method-not-found error [0.10ms] spaces-integration-gateway-unit-test> ✓ an autoRun tool forwards immediately with no confirm [0.42ms] spaces-integration-gateway-unit-test> ✓ a non-autoRun tool confirmed 'once' forwards but does not persist the grant [0.20ms] spaces-integration-gateway-unit-test> ✓ a non-autoRun tool confirmed 'session' skips the prompt on later calls [0.15ms] spaces-integration-gateway-unit-test> ✓ a session grant is scoped to its own session, not shared [0.12ms] spaces-integration-gateway-unit-test> ✓ a denied tool is never forwarded and returns the denial [0.14ms] spaces-integration-gateway-unit-test> ✓ an unavailable confirm command blocks the call and says nobody was asked [0.13ms] spaces-integration-gateway-unit-test> ✓ an unknown tool errors without confirming or forwarding [0.11ms] spaces-integration-gateway-unit-test> ✓ confirmPreview output is fetched and passed as the confirm context [0.14ms] spaces-integration-gateway-unit-test> ✓ a failed confirmPreview fails closed: surfaces the error, no prompt, no send [0.17ms] spaces-integration-gateway-unit-test> ✓ spaces/session is a notification: it owes no reply [0.19ms] spaces-integration-gateway-unit-test> ✓ two sessions sharing one key share a session grant [0.23ms] spaces-integration-gateway-unit-test> ✓ distinct keys keep grants isolated [0.17ms] spaces-integration-gateway-unit-test> ✓ a bad key (empty / oversized / non-string) does not bind a shared set [0.27ms] spaces-integration-gateway-unit-test> ✓ binding sweeps entries idle beyond the TTL [0.20ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> confirm.test.ts: spaces-integration-gateway-unit-test> ✓ returns the verdict the command writes to the verdict file [9.28ms] spaces-integration-gateway-unit-test> ✓ tolerates surrounding whitespace/newlines in the verdict [2.46ms] spaces-integration-gateway-unit-test> ✓ passes the request JSON to the command via SPACES_CONFIRM_REQUEST [2.55ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: unknown verdict maybe spaces-integration-gateway-unit-test> ✓ reports unavailable when the command writes an unknown token [2.23ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: no verdict file spaces-integration-gateway-unit-test> ✓ reports unavailable when the command writes nothing [2.27ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: exit 3 spaces-integration-gateway-unit-test> ✓ reports unavailable on a non-zero exit even if a verdict was written [2.32ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: SPACES_INTEGRATION_CONFIRM_CMD is empty spaces-integration-gateway-unit-test> ✓ reports unavailable when no confirm command is configured [0.37ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: spawn failed: ENOENT: no such file or directory, posix_spawn '/build/no-such-confirm-command' spaces-integration-gateway-unit-test> ✓ reports unavailable when the command cannot be spawned [1.40ms] spaces-integration-gateway-unit-test> integrations: confirm command unavailable: no verdict within 200ms spaces-integration-gateway-unit-test> ✓ reports unavailable when the command exceeds the timeout [202.24ms] spaces-integration-gateway-unit-test> ✓ hands the command the user manager's WAYLAND_DISPLAY when its own env has none [7.19ms] spaces-integration-gateway-unit-test> ✓ keeps a display already in the gateway's env [6.51ms] spaces-integration-gateway-unit-test> ✓ ignores a quoted or otherwise non-plain user manager value [6.13ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> connect.test.ts: spaces-integration-gateway-unit-test> ✓ bridges bytes both directions and resolves when the socket closes [13.11ms] spaces-integration-gateway-unit-test> ✓ resolves (never hangs) when the socket is unreachable [0.89ms] spaces-integration-gateway-unit-test> ✓ bridge declares a spaces/session key as its first socket line [2.20ms] spaces-integration-gateway-unit-test> ✓ distinct bridge invocations declare distinct keys [2.38ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> notify.test.ts: spaces-integration-gateway-unit-test> ✓ broadcast sends one tools/list_changed notification per initialized client [0.31ms] spaces-integration-gateway-unit-test> ✓ broadcast skips a client that has not initialized [0.08ms] spaces-integration-gateway-unit-test> ✓ broadcast survives a write that throws [0.22ms] spaces-integration-gateway-unit-test> ✓ watch reports a change of the file, once per change [0.45ms] spaces-integration-gateway-unit-test> ✓ watch reports the file appearing and going away [0.16ms] spaces-integration-gateway-unit-test> ✓ a stopped watch schedules no further poll [0.16ms] spaces-integration-gateway-unit-test> ✓ watch keeps polling after onChange throws [0.19ms] spaces-integration-gateway-unit-test> ✓ the real mtime reader treats a missing file as no file [0.55ms] spaces-integration-gateway-unit-test> ✓ an empty path gives an inert watch [0.10ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> live-notify.test.ts: spaces-integration-gateway-unit-test> ✓ a live session hears about an integration enabled after it connected [85.66ms] spaces-integration-gateway-unit-test> spaces-integration-gateway-unit-test> 62 pass spaces-integration-gateway-unit-test> 0 fail spaces-integration-gateway-unit-test> 136 expect() calls spaces-integration-gateway-unit-test> Ran 62 tests across 6 files. [620.00ms]