bun test v1.3.13 (bf2e2cec) gateway-core.test.ts: ✓ discoverTools returns the server's tools with inputSchema as parameters [11.00ms] ✓ discoverTools resolves [] when the socket is unreachable [5.00ms] ✓ buildRegistry namespaces tools and precomputes the autoRun verdict [1.00ms] ✓ loadDefinition parses confirmPreview; absent ⇒ empty map ✓ buildRegistry carries confirmPreview and hides preview tools from the registry integrations: cannot read definition for ghost: Error: ENOENT: no such file or directory, open '/build/gateway-core-test-4b2mMH/reg2/ghost.json' ✓ buildRegistry skips disabled integrations and missing definitions [1.00ms] integrations: cannot read /build/gateway-core-test-4b2mMH/reg3/enabled.json: SyntaxError: JSON Parse error: Expected '}' ✓ buildRegistry yields nothing when enabled.json is unreadable/malformed ✓ enabledMtimeMs is 0 when absent, positive once the file exists [1.00ms] ✓ refreshRegistry rebuilds only when enabled.json's mtime moves ✓ integrationNames lists each enabled integration once ✓ callIntegrationTool: initialize/initialized/tools-call, text concatenated [3.00ms] ✓ callIntegrationTool: server isError surfaces as isError [2.00ms] ✓ callIntegrationTool: connection failure resolves unavailable, never throws ✓ callIntegrationTool: timeout resolves unavailable [203.00ms] ✓ callIntegrationTool: abort signal resolves unavailable [3.00ms] ✓ mcpExchange runs the step chain and yields the final reply [2.00ms] ✓ mcpExchange resolves a failure result, never rejects mcp-server.test.ts: ✓ advertisedTools maps registry entries to MCP tool descriptors ✓ initialize advertises the tool-list-changed capability and marks the session [1.00ms] ✓ notifications/initialized owes no reply ✓ tools/list returns the aggregated advertised tools ✓ an unknown method resolves a JSON-RPC method-not-found error ✓ an autoRun tool forwards immediately with no confirm ✓ a non-autoRun tool confirmed 'once' forwards but does not persist the grant ✓ a non-autoRun tool confirmed 'session' skips the prompt on later calls [1.00ms] ✓ a session grant is scoped to its own session, not shared ✓ a denied tool is never forwarded and returns the denial ✓ an unavailable confirm command blocks the call and says nobody was asked ✓ an unknown tool errors without confirming or forwarding ✓ confirmPreview output is fetched and passed as the confirm context ✓ a failed confirmPreview fails closed: surfaces the error, no prompt, no send ✓ spaces/session is a notification: it owes no reply ✓ two sessions sharing one key share a session grant ✓ distinct keys keep grants isolated [1.00ms] ✓ a bad key (empty / oversized / non-string) does not bind a shared set ✓ binding sweeps entries idle beyond the TTL confirm.test.ts: ✓ returns the verdict the command writes to the verdict file [9.00ms] ✓ tolerates surrounding whitespace/newlines in the verdict [2.00ms] ✓ passes the request JSON to the command via SPACES_CONFIRM_REQUEST [2.00ms] integrations: confirm command unavailable: unknown verdict maybe ✓ reports unavailable when the command writes an unknown token [1.00ms] integrations: confirm command unavailable: no verdict file ✓ reports unavailable when the command writes nothing [1.00ms] integrations: confirm command unavailable: exit 3 ✓ reports unavailable on a non-zero exit even if a verdict was written [1.00ms] integrations: confirm command unavailable: SPACES_INTEGRATION_CONFIRM_CMD is empty ✓ reports unavailable when no confirm command is configured integrations: confirm command unavailable: spawn failed: ENOENT: no such file or directory, posix_spawn '/build/no-such-confirm-command' ✓ reports unavailable when the command cannot be spawned [1.00ms] integrations: confirm command unavailable: no verdict within 200ms ✓ reports unavailable when the command exceeds the timeout [201.00ms] ✓ hands the command the user manager's WAYLAND_DISPLAY when its own env has none [4.00ms] ✓ keeps a display already in the gateway's env [2.00ms] ✓ ignores a quoted or otherwise non-plain user manager value [3.00ms] connect.test.ts: ✓ bridges bytes both directions and resolves when the socket closes [6.00ms] ✓ resolves (never hangs) when the socket is unreachable ✓ bridge declares a spaces/session key as its first socket line [2.00ms] ✓ distinct bridge invocations declare distinct keys [2.00ms] notify.test.ts: ✓ broadcast sends one tools/list_changed notification per initialized client [1.00ms] ✓ broadcast skips a client that has not initialized ✓ broadcast survives a write that throws ✓ watch reports a change of the file, once per change [1.00ms] ✓ watch reports the file appearing and going away ✓ a stopped watch schedules no further poll ✓ watch keeps polling after onChange throws ✓ the real mtime reader treats a missing file as no file ✓ an empty path gives an inert watch live-notify.test.ts: ✓ a live session hears about an integration enabled after it connected [75.00ms] 62 pass 0 fail 136 expect() calls Ran 62 tests across 6 files. [654.00ms]