MCPcopy
hub / github.com/agent-infra/sandbox / __getInfo

Method __getInfo

sdk/js/src/api/resources/jupyter/client/Client.ts:126–167  ·  view source on GitHub ↗
(
        requestOptions?: Jupyter.RequestOptions,
    )

Source from the content-addressed store, hash-verified

124 }
125
126 private async __getInfo(
127 requestOptions?: Jupyter.RequestOptions,
128 ): Promise<
129 core.WithRawResponse<core.APIResponse<Sandbox.ResponseJupyterInfoResponse, Sandbox.jupyter.getInfo.Error>>
130 > {
131 const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
132 const _response = await (this._options.fetcher ?? core.fetcher)({
133 url: core.url.join(
134 (await core.Supplier.get(this._options.baseUrl)) ??
135 (await core.Supplier.get(this._options.environment)),
136 "v1/jupyter/info",
137 ),
138 method: "GET",
139 headers: _headers,
140 queryParameters: requestOptions?.queryParams,
141 timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
142 maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
143 abortSignal: requestOptions?.abortSignal,
144 fetchFn: this._options?.fetch,
145 logging: this._options.logging,
146 });
147 if (_response.ok) {
148 return {
149 data: {
150 ok: true,
151 body: _response.body as Sandbox.ResponseJupyterInfoResponse,
152 headers: _response.headers,
153 rawResponse: _response.rawResponse,
154 },
155 rawResponse: _response.rawResponse,
156 };
157 }
158
159 return {
160 data: {
161 ok: false,
162 error: Sandbox.jupyter.getInfo.Error._unknown(core.isFailedResponse(_response) ? _response.error : { reason: "unknown", errorMessage: "Unknown error" }),
163 rawResponse: _response.rawResponse,
164 },
165 rawResponse: _response.rawResponse,
166 };
167 }
168
169 /**
170 * List all active Jupyter sessions

Callers 1

getInfoMethod · 0.95

Calls 2

mergeHeadersFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected