@boxrouter/sdk 0.0.0-stage → 0.12.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +40 -0
- package/README.md +508 -2
- package/dist/addresses.d.ts +5 -0
- package/dist/addresses.js +10 -0
- package/dist/api-error.d.ts +62 -0
- package/dist/api-error.js +264 -0
- package/dist/boxrouter.d.ts +68 -0
- package/dist/boxrouter.js +291 -0
- package/dist/browser-session/index.d.ts +17 -0
- package/dist/browser-session/index.js +48 -0
- package/dist/browser-session/operations.gen.d.ts +272 -0
- package/dist/browser-session/operations.gen.js +58 -0
- package/dist/browser-session/responseContracts/api_keys.d.ts +2 -0
- package/dist/browser-session/responseContracts/api_keys.js +10 -0
- package/dist/browser-session/responseContracts/credits.d.ts +2 -0
- package/dist/browser-session/responseContracts/credits.js +8 -0
- package/dist/browser-session/responseContracts/github.d.ts +2 -0
- package/dist/browser-session/responseContracts/github.js +11 -0
- package/dist/browser-session/responseContracts/identity.d.ts +2 -0
- package/dist/browser-session/responseContracts/identity.js +30 -0
- package/dist/browser-session/responseContracts/organizations.d.ts +2 -0
- package/dist/browser-session/responseContracts/organizations.js +17 -0
- package/dist/browser-session/responseContracts/privacy.d.ts +2 -0
- package/dist/browser-session/responseContracts/privacy.js +7 -0
- package/dist/browser-session/responseContracts.gen.d.ts +3 -0
- package/dist/browser-session/responseContracts.gen.js +10 -0
- package/dist/browser-session/responseValidators/api_keys-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/api_keys-diagnostics.d.cts +4 -0
- package/dist/browser-session/responseValidators/api_keys.cjs +2 -0
- package/dist/browser-session/responseValidators/api_keys.d.cts +4 -0
- package/dist/browser-session/responseValidators/credits-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/credits-diagnostics.d.cts +3 -0
- package/dist/browser-session/responseValidators/credits.cjs +2 -0
- package/dist/browser-session/responseValidators/credits.d.cts +3 -0
- package/dist/browser-session/responseValidators/github-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/github-diagnostics.d.cts +3 -0
- package/dist/browser-session/responseValidators/github.cjs +2 -0
- package/dist/browser-session/responseValidators/github.d.cts +3 -0
- package/dist/browser-session/responseValidators/identity-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/identity-diagnostics.d.cts +23 -0
- package/dist/browser-session/responseValidators/identity.cjs +2 -0
- package/dist/browser-session/responseValidators/identity.d.cts +23 -0
- package/dist/browser-session/responseValidators/organizations-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/organizations-diagnostics.d.cts +15 -0
- package/dist/browser-session/responseValidators/organizations.cjs +2 -0
- package/dist/browser-session/responseValidators/organizations.d.cts +15 -0
- package/dist/browser-session/responseValidators/privacy-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/privacy-diagnostics.d.cts +2 -0
- package/dist/browser-session/responseValidators/privacy.cjs +2 -0
- package/dist/browser-session/responseValidators/privacy.d.cts +2 -0
- package/dist/client/client.gen.d.ts +2 -0
- package/dist/client/client.gen.js +168 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.js +17 -0
- package/dist/client/types.gen.d.ts +120 -0
- package/dist/client/types.gen.js +3 -0
- package/dist/client/utils.gen.d.ts +37 -0
- package/dist/client/utils.gen.js +239 -0
- package/dist/client.gen.d.ts +12 -0
- package/dist/client.gen.js +6 -0
- package/dist/command-check.gen.d.ts +14 -0
- package/dist/command-check.gen.js +23 -0
- package/dist/command-input.gen.d.ts +6 -0
- package/dist/command-input.gen.js +45 -0
- package/dist/core/auth.gen.d.ts +25 -0
- package/dist/core/auth.gen.js +18 -0
- package/dist/core/binaryStream.d.ts +8 -0
- package/dist/core/binaryStream.js +76 -0
- package/dist/core/bodySerializer.gen.d.ts +25 -0
- package/dist/core/bodySerializer.gen.js +60 -0
- package/dist/core/commandValidators.cjs +1 -0
- package/dist/core/commandValidators.d.cts +14 -0
- package/dist/core/eventValidation.d.ts +17 -0
- package/dist/core/eventValidation.js +56 -0
- package/dist/core/eventValidators.cjs +1 -0
- package/dist/core/eventValidators.d.cts +2 -0
- package/dist/core/json.d.ts +3 -0
- package/dist/core/json.js +33 -0
- package/dist/core/params.gen.d.ts +43 -0
- package/dist/core/params.gen.js +112 -0
- package/dist/core/pathSerializer.gen.d.ts +33 -0
- package/dist/core/pathSerializer.gen.js +115 -0
- package/dist/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/core/queryKeySerializer.gen.js +98 -0
- package/dist/core/responseContracts/actions.d.ts +2 -0
- package/dist/core/responseContracts/actions.js +30 -0
- package/dist/core/responseContracts/agents.d.ts +2 -0
- package/dist/core/responseContracts/agents.js +7 -0
- package/dist/core/responseContracts/artifacts.d.ts +2 -0
- package/dist/core/responseContracts/artifacts.js +8 -0
- package/dist/core/responseContracts/commands.d.ts +2 -0
- package/dist/core/responseContracts/commands.js +6 -0
- package/dist/core/responseContracts/credits.d.ts +2 -0
- package/dist/core/responseContracts/credits.js +27 -0
- package/dist/core/responseContracts/files.d.ts +2 -0
- package/dist/core/responseContracts/files.js +15 -0
- package/dist/core/responseContracts/github.d.ts +2 -0
- package/dist/core/responseContracts/github.js +8 -0
- package/dist/core/responseContracts/images.d.ts +2 -0
- package/dist/core/responseContracts/images.js +8 -0
- package/dist/core/responseContracts/launchRuns.d.ts +2 -0
- package/dist/core/responseContracts/launchRuns.js +10 -0
- package/dist/core/responseContracts/launches.d.ts +2 -0
- package/dist/core/responseContracts/launches.js +10 -0
- package/dist/core/responseContracts/operations.d.ts +2 -0
- package/dist/core/responseContracts/operations.js +7 -0
- package/dist/core/responseContracts/previews.d.ts +2 -0
- package/dist/core/responseContracts/previews.js +8 -0
- package/dist/core/responseContracts/pricing.d.ts +2 -0
- package/dist/core/responseContracts/pricing.js +6 -0
- package/dist/core/responseContracts/processes.d.ts +2 -0
- package/dist/core/responseContracts/processes.js +11 -0
- package/dist/core/responseContracts/provider_accounts.d.ts +2 -0
- package/dist/core/responseContracts/provider_accounts.js +13 -0
- package/dist/core/responseContracts/providers.d.ts +2 -0
- package/dist/core/responseContracts/providers.js +6 -0
- package/dist/core/responseContracts/routing.d.ts +2 -0
- package/dist/core/responseContracts/routing.js +8 -0
- package/dist/core/responseContracts/sandboxes.d.ts +2 -0
- package/dist/core/responseContracts/sandboxes.js +15 -0
- package/dist/core/responseContracts/secrets.d.ts +2 -0
- package/dist/core/responseContracts/secrets.js +8 -0
- package/dist/core/responseContracts/spend_limits.d.ts +2 -0
- package/dist/core/responseContracts/spend_limits.js +8 -0
- package/dist/core/responseContracts/terminals.d.ts +2 -0
- package/dist/core/responseContracts/terminals.js +11 -0
- package/dist/core/responseContracts/usage.d.ts +2 -0
- package/dist/core/responseContracts/usage.js +7 -0
- package/dist/core/responseContracts/volumes.d.ts +2 -0
- package/dist/core/responseContracts/volumes.js +19 -0
- package/dist/core/responseContracts.gen.d.ts +3 -0
- package/dist/core/responseContracts.gen.js +27 -0
- package/dist/core/responseModes.d.ts +19 -0
- package/dist/core/responseModes.js +13 -0
- package/dist/core/responseValidation.d.ts +44 -0
- package/dist/core/responseValidation.js +174 -0
- package/dist/core/responseValidators/actions-diagnostics.cjs +4 -0
- package/dist/core/responseValidators/actions-diagnostics.d.cts +24 -0
- package/dist/core/responseValidators/actions.cjs +2 -0
- package/dist/core/responseValidators/actions.d.cts +24 -0
- package/dist/core/responseValidators/agents-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/agents-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/agents.cjs +2 -0
- package/dist/core/responseValidators/agents.d.cts +2 -0
- package/dist/core/responseValidators/artifacts-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/artifacts-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/artifacts.cjs +2 -0
- package/dist/core/responseValidators/artifacts.d.cts +2 -0
- package/dist/core/responseValidators/commands-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/commands-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/commands.cjs +2 -0
- package/dist/core/responseValidators/commands.d.cts +1 -0
- package/dist/core/responseValidators/compact.cjs +122 -0
- package/dist/core/responseValidators/credits-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/credits-diagnostics.d.cts +21 -0
- package/dist/core/responseValidators/credits.cjs +2 -0
- package/dist/core/responseValidators/credits.d.cts +21 -0
- package/dist/core/responseValidators/files-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/files-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/files.cjs +2 -0
- package/dist/core/responseValidators/files.d.cts +5 -0
- package/dist/core/responseValidators/github-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/github-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/github.cjs +2 -0
- package/dist/core/responseValidators/github.d.cts +2 -0
- package/dist/core/responseValidators/images-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/images-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/images.cjs +2 -0
- package/dist/core/responseValidators/images.d.cts +3 -0
- package/dist/core/responseValidators/launchRuns-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/launchRuns-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/launchRuns.cjs +2 -0
- package/dist/core/responseValidators/launchRuns.d.cts +5 -0
- package/dist/core/responseValidators/launches-diagnostics.cjs +10 -0
- package/dist/core/responseValidators/launches-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/launches.cjs +2 -0
- package/dist/core/responseValidators/launches.d.cts +5 -0
- package/dist/core/responseValidators/operations-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/operations-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/operations.cjs +2 -0
- package/dist/core/responseValidators/operations.d.cts +2 -0
- package/dist/core/responseValidators/previews-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/previews-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/previews.cjs +2 -0
- package/dist/core/responseValidators/previews.d.cts +3 -0
- package/dist/core/responseValidators/pricing-diagnostics.cjs +7 -0
- package/dist/core/responseValidators/pricing-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/pricing.cjs +2 -0
- package/dist/core/responseValidators/pricing.d.cts +1 -0
- package/dist/core/responseValidators/processes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/processes-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/processes.cjs +2 -0
- package/dist/core/responseValidators/processes.d.cts +2 -0
- package/dist/core/responseValidators/provider_accounts-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/provider_accounts-diagnostics.d.cts +8 -0
- package/dist/core/responseValidators/provider_accounts.cjs +2 -0
- package/dist/core/responseValidators/provider_accounts.d.cts +8 -0
- package/dist/core/responseValidators/providers-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/providers-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/providers.cjs +2 -0
- package/dist/core/responseValidators/providers.d.cts +1 -0
- package/dist/core/responseValidators/routing-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/routing-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/routing.cjs +2 -0
- package/dist/core/responseValidators/routing.d.cts +3 -0
- package/dist/core/responseValidators/sandboxes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/sandboxes-diagnostics.d.cts +10 -0
- package/dist/core/responseValidators/sandboxes.cjs +2 -0
- package/dist/core/responseValidators/sandboxes.d.cts +10 -0
- package/dist/core/responseValidators/secrets-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/secrets-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/secrets.cjs +2 -0
- package/dist/core/responseValidators/secrets.d.cts +1 -0
- package/dist/core/responseValidators/spend_limits-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/spend_limits-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/spend_limits.cjs +2 -0
- package/dist/core/responseValidators/spend_limits.d.cts +3 -0
- package/dist/core/responseValidators/terminals-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/terminals-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/terminals.cjs +2 -0
- package/dist/core/responseValidators/terminals.d.cts +2 -0
- package/dist/core/responseValidators/usage-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/usage-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/usage.cjs +2 -0
- package/dist/core/responseValidators/usage.d.cts +1 -0
- package/dist/core/responseValidators/volumes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/volumes-diagnostics.d.cts +10 -0
- package/dist/core/responseValidators/volumes.cjs +2 -0
- package/dist/core/responseValidators/volumes.d.cts +10 -0
- package/dist/core/serverSentEvents.gen.d.ts +30 -0
- package/dist/core/serverSentEvents.gen.js +313 -0
- package/dist/core/streamErrors.d.ts +32 -0
- package/dist/core/streamErrors.js +51 -0
- package/dist/core/types.gen.d.ts +83 -0
- package/dist/core/types.gen.js +3 -0
- package/dist/core/utils.gen.d.ts +19 -0
- package/dist/core/utils.gen.js +93 -0
- package/dist/creation.gen.d.ts +21 -0
- package/dist/creation.gen.js +35 -0
- package/dist/data-origin.d.ts +25 -0
- package/dist/data-origin.js +57 -0
- package/dist/error-codes.gen.d.ts +2 -0
- package/dist/error-codes.gen.js +2 -0
- package/dist/idempotency.gen.d.ts +1 -0
- package/dist/idempotency.gen.js +60 -0
- package/dist/images.d.ts +74 -0
- package/dist/images.js +88 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +80 -0
- package/dist/launch-input.gen.d.ts +9 -0
- package/dist/launch-input.gen.js +83 -0
- package/dist/launch.d.ts +28 -0
- package/dist/launch.js +222 -0
- package/dist/namespace-actions.d.mts +307 -0
- package/dist/namespace-actions.mjs +595 -0
- package/dist/namespace-agents.d.mts +33 -0
- package/dist/namespace-agents.mjs +40 -0
- package/dist/namespace-artifacts.d.mts +46 -0
- package/dist/namespace-artifacts.mjs +69 -0
- package/dist/namespace-base.d.mts +7 -0
- package/dist/namespace-base.mjs +7 -0
- package/dist/namespace-commands.d.mts +57 -0
- package/dist/namespace-commands.mjs +57 -0
- package/dist/namespace-credits.d.mts +213 -0
- package/dist/namespace-credits.mjs +476 -0
- package/dist/namespace-files.d.mts +203 -0
- package/dist/namespace-files.mjs +334 -0
- package/dist/namespace-github.d.mts +50 -0
- package/dist/namespace-github.mjs +68 -0
- package/dist/namespace-images.d.mts +52 -0
- package/dist/namespace-images.mjs +78 -0
- package/dist/namespace-launch_runs.d.mts +89 -0
- package/dist/namespace-launch_runs.mjs +133 -0
- package/dist/namespace-launches.d.mts +89 -0
- package/dist/namespace-launches.mjs +133 -0
- package/dist/namespace-operations.d.mts +45 -0
- package/dist/namespace-operations.mjs +52 -0
- package/dist/namespace-previews.d.mts +79 -0
- package/dist/namespace-previews.mjs +101 -0
- package/dist/namespace-pricing.d.mts +31 -0
- package/dist/namespace-pricing.mjs +22 -0
- package/dist/namespace-processes.d.mts +125 -0
- package/dist/namespace-processes.mjs +184 -0
- package/dist/namespace-provider_accounts.d.mts +156 -0
- package/dist/namespace-provider_accounts.mjs +241 -0
- package/dist/namespace-providers.d.mts +28 -0
- package/dist/namespace-providers.mjs +24 -0
- package/dist/namespace-routing.d.mts +64 -0
- package/dist/namespace-routing.mjs +86 -0
- package/dist/namespace-sandboxes.d.mts +287 -0
- package/dist/namespace-sandboxes.mjs +402 -0
- package/dist/namespace-secrets.d.mts +46 -0
- package/dist/namespace-secrets.mjs +68 -0
- package/dist/namespace-spend_limits.d.mts +48 -0
- package/dist/namespace-spend_limits.mjs +70 -0
- package/dist/namespace-terminals.d.mts +112 -0
- package/dist/namespace-terminals.mjs +177 -0
- package/dist/namespace-usage.d.mts +46 -0
- package/dist/namespace-usage.mjs +53 -0
- package/dist/namespace-volumes.d.mts +110 -0
- package/dist/namespace-volumes.mjs +269 -0
- package/dist/operations.d.ts +14 -0
- package/dist/operations.js +31 -0
- package/dist/retry.d.ts +8 -0
- package/dist/retry.js +63 -0
- package/dist/routing-choices.gen.d.ts +132 -0
- package/dist/routing-choices.gen.js +136 -0
- package/dist/routing.d.ts +23 -0
- package/dist/routing.js +38 -0
- package/dist/sandbox-handle.gen.d.ts +8 -0
- package/dist/sandbox-handle.gen.js +14 -0
- package/dist/sandboxes.d.ts +213 -0
- package/dist/sandboxes.js +507 -0
- package/dist/sdk.gen.d.ts +2029 -0
- package/dist/sdk.gen.js +3862 -0
- package/dist/server-timing.d.ts +19 -0
- package/dist/server-timing.gen.d.ts +265 -0
- package/dist/server-timing.gen.js +254 -0
- package/dist/server-timing.js +421 -0
- package/dist/spend-limits.d.ts +17 -0
- package/dist/spend-limits.js +26 -0
- package/dist/telemetry.d.ts +51 -0
- package/dist/telemetry.gen.d.ts +1 -0
- package/dist/telemetry.gen.js +5 -0
- package/dist/telemetry.js +438 -0
- package/dist/terminal.d.ts +61 -0
- package/dist/terminal.js +266 -0
- package/dist/transfer.d.ts +75 -0
- package/dist/transfer.js +389 -0
- package/dist/types.gen.d.ts +15016 -0
- package/dist/types.gen.js +3 -0
- package/dist/user-agent.d.ts +2 -0
- package/dist/user-agent.js +18 -0
- package/dist/version.gen.d.ts +1 -0
- package/dist/version.gen.js +5 -0
- package/dist/volumes.d.ts +33 -0
- package/dist/volumes.js +221 -0
- package/dist/waits.d.ts +31 -0
- package/dist/waits.js +42 -0
- package/dist/workflow-policy.gen.d.ts +41 -0
- package/dist/workflow-policy.gen.js +45 -0
- package/package.json +135 -4
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestTrace = void 0;
|
|
4
|
+
exports.isTimeoutError = isTimeoutError;
|
|
5
|
+
exports.setRequestPhaseObserver = setRequestPhaseObserver;
|
|
6
|
+
exports.tracedRequest = tracedRequest;
|
|
7
|
+
const api_1 = require("@opentelemetry/api");
|
|
8
|
+
const telemetry_gen_1 = require("./telemetry.gen");
|
|
9
|
+
const api_error_1 = require("./api-error");
|
|
10
|
+
function isTimeoutError(error) {
|
|
11
|
+
return error instanceof DOMException && error.name === 'TimeoutError';
|
|
12
|
+
}
|
|
13
|
+
const RESPONSE_HEADERS_DURATION = 'boxrouter.client.response_headers.duration_ms';
|
|
14
|
+
const RESPONSE_PROCESSING_DURATION = 'boxrouter.client.response_processing.duration_ms';
|
|
15
|
+
const REQUEST_PREPARATION_DURATION = 'boxrouter.client.request_preparation.duration_ms';
|
|
16
|
+
let requestPhaseObserver;
|
|
17
|
+
/** Opt in to bounded, payload-free request phase observations. */
|
|
18
|
+
function setRequestPhaseObserver(observer) {
|
|
19
|
+
requestPhaseObserver = observer;
|
|
20
|
+
}
|
|
21
|
+
function monotonicMilliseconds() {
|
|
22
|
+
try {
|
|
23
|
+
const performance = globalThis.performance;
|
|
24
|
+
const now = performance?.now;
|
|
25
|
+
if (typeof now !== 'function')
|
|
26
|
+
return undefined;
|
|
27
|
+
const value = now.call(performance);
|
|
28
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function elapsedMilliseconds(start, end) {
|
|
35
|
+
if (start === undefined || end === undefined || end < start)
|
|
36
|
+
return undefined;
|
|
37
|
+
const elapsed = end - start;
|
|
38
|
+
return Number.isFinite(elapsed) && elapsed >= 0 ? elapsed : undefined;
|
|
39
|
+
}
|
|
40
|
+
function nonRecordingParentSpan(parent) {
|
|
41
|
+
let spanContext = api_1.INVALID_SPAN_CONTEXT;
|
|
42
|
+
try {
|
|
43
|
+
spanContext = api_1.trace.getSpan(parent)?.spanContext() ?? api_1.INVALID_SPAN_CONTEXT;
|
|
44
|
+
}
|
|
45
|
+
catch { /* Optional observation. */ }
|
|
46
|
+
return api_1.trace.wrapSpanContext(spanContext);
|
|
47
|
+
}
|
|
48
|
+
/** The application owns providers, sampling, propagation and export. */
|
|
49
|
+
class RequestTrace {
|
|
50
|
+
span;
|
|
51
|
+
context;
|
|
52
|
+
streaming = false;
|
|
53
|
+
timingEnabled = false;
|
|
54
|
+
requestPreparationStarted;
|
|
55
|
+
requestPreparationDuration;
|
|
56
|
+
requestPreparationMeasured = false;
|
|
57
|
+
responseHeadersDuration;
|
|
58
|
+
responseProcessingStarted;
|
|
59
|
+
responseProcessingDuration;
|
|
60
|
+
responseProcessingMeasured = false;
|
|
61
|
+
phaseObserver;
|
|
62
|
+
streamLifetimeStarted;
|
|
63
|
+
requestPreparationOutcomeSent = false;
|
|
64
|
+
responseProcessingOutcomeSent = false;
|
|
65
|
+
responseHeadersOutcomeSent = false;
|
|
66
|
+
responseHeadersSpanWritten = false;
|
|
67
|
+
responseStatus;
|
|
68
|
+
responseWasHttpError = false;
|
|
69
|
+
constructor(method, path, parent) {
|
|
70
|
+
let parentContext = parent;
|
|
71
|
+
if (parentContext === undefined) {
|
|
72
|
+
try {
|
|
73
|
+
parentContext = api_1.context.active();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
parentContext = api_1.ROOT_CONTEXT;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
this.context = parentContext;
|
|
80
|
+
this.phaseObserver = requestPhaseObserver;
|
|
81
|
+
const operation = telemetry_gen_1.operationNames.get(`${method} ${path}`);
|
|
82
|
+
try {
|
|
83
|
+
this.span = api_1.trace.getTracer('boxrouter.client').startSpan(operation ? `boxrouter.${operation}` : 'boxrouter.request', { kind: api_1.SpanKind.CLIENT }, parentContext);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
this.span = nonRecordingParentSpan(parentContext);
|
|
87
|
+
this.phaseObserver = undefined;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
this.context = api_1.trace.setSpan(parentContext, this.span);
|
|
92
|
+
}
|
|
93
|
+
catch { /* Preserve parent propagation. */ }
|
|
94
|
+
let recording = false;
|
|
95
|
+
try {
|
|
96
|
+
recording = this.span.isRecording();
|
|
97
|
+
}
|
|
98
|
+
catch { /* Optional timing observation. */ }
|
|
99
|
+
this.timingEnabled = recording || this.phaseObserver !== undefined;
|
|
100
|
+
if (this.timingEnabled)
|
|
101
|
+
this.requestPreparationStarted = monotonicMilliseconds();
|
|
102
|
+
}
|
|
103
|
+
inject(headers) {
|
|
104
|
+
try {
|
|
105
|
+
const carrier = {};
|
|
106
|
+
api_1.propagation.inject(this.context, carrier);
|
|
107
|
+
// A globally configured baggage propagator must not export application data.
|
|
108
|
+
if (carrier.traceparent)
|
|
109
|
+
headers.set('traceparent', carrier.traceparent);
|
|
110
|
+
}
|
|
111
|
+
catch { /* Optional propagation must not block the request. */ }
|
|
112
|
+
}
|
|
113
|
+
async fetchResponse(fetchCallback) {
|
|
114
|
+
if (!this.timingEnabled && !this.phaseObserver)
|
|
115
|
+
return fetchCallback();
|
|
116
|
+
const started = monotonicMilliseconds();
|
|
117
|
+
this.requestPreparationMeasured = true;
|
|
118
|
+
this.requestPreparationDuration = elapsedMilliseconds(this.requestPreparationStarted, started);
|
|
119
|
+
try {
|
|
120
|
+
const response = await fetchCallback();
|
|
121
|
+
const returned = monotonicMilliseconds();
|
|
122
|
+
this.responseHeadersDuration = elapsedMilliseconds(started, returned);
|
|
123
|
+
if (returned !== undefined && (started === undefined || returned >= started)) {
|
|
124
|
+
this.responseProcessingStarted = returned;
|
|
125
|
+
}
|
|
126
|
+
this.setTiming(REQUEST_PREPARATION_DURATION, this.requestPreparationDuration);
|
|
127
|
+
if (this.phaseObserver)
|
|
128
|
+
this.finishRequestPreparationOutcome('success');
|
|
129
|
+
return response;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
this.responseHeadersDuration = elapsedMilliseconds(started, monotonicMilliseconds());
|
|
133
|
+
this.setTiming(REQUEST_PREPARATION_DURATION, this.requestPreparationDuration);
|
|
134
|
+
let outcome = 'unknown';
|
|
135
|
+
try {
|
|
136
|
+
outcome = this.responseOutcome(error);
|
|
137
|
+
}
|
|
138
|
+
catch { /* Preserve the fetch failure. */ }
|
|
139
|
+
if (this.phaseObserver) {
|
|
140
|
+
try {
|
|
141
|
+
this.finishRequestPreparationOutcome('success');
|
|
142
|
+
}
|
|
143
|
+
catch { /* Preserve the fetch failure. */ }
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
this.finishResponseHeadersOutcome(outcome);
|
|
147
|
+
}
|
|
148
|
+
catch { /* Preserve the fetch failure. */ }
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
finishBufferedResponse() {
|
|
153
|
+
if (!this.timingEnabled)
|
|
154
|
+
return;
|
|
155
|
+
if (!this.requestPreparationMeasured) {
|
|
156
|
+
const finished = monotonicMilliseconds();
|
|
157
|
+
this.requestPreparationMeasured = true;
|
|
158
|
+
this.requestPreparationDuration = elapsedMilliseconds(this.requestPreparationStarted, finished);
|
|
159
|
+
this.setTiming(REQUEST_PREPARATION_DURATION, this.requestPreparationDuration);
|
|
160
|
+
}
|
|
161
|
+
if (this.phaseObserver)
|
|
162
|
+
this.finishRequestPreparationOutcome('success');
|
|
163
|
+
let recording = false;
|
|
164
|
+
try {
|
|
165
|
+
recording = this.span.isRecording();
|
|
166
|
+
}
|
|
167
|
+
catch { /* Optional timing observation. */ }
|
|
168
|
+
if (!recording)
|
|
169
|
+
return;
|
|
170
|
+
this.recordResponseHeadersSpan();
|
|
171
|
+
this.setTiming(RESPONSE_PROCESSING_DURATION, this.responseProcessingDuration);
|
|
172
|
+
}
|
|
173
|
+
recordResponseHeadersSpan() {
|
|
174
|
+
if (this.responseHeadersSpanWritten)
|
|
175
|
+
return;
|
|
176
|
+
let recording = false;
|
|
177
|
+
try {
|
|
178
|
+
recording = this.span.isRecording();
|
|
179
|
+
}
|
|
180
|
+
catch { /* Optional timing observation. */ }
|
|
181
|
+
if (!recording)
|
|
182
|
+
return;
|
|
183
|
+
this.responseHeadersSpanWritten = true;
|
|
184
|
+
this.setTiming(RESPONSE_HEADERS_DURATION, this.responseHeadersDuration);
|
|
185
|
+
}
|
|
186
|
+
finishRequestPreparationOutcome(outcome) {
|
|
187
|
+
if (!this.phaseObserver || this.requestPreparationOutcomeSent)
|
|
188
|
+
return;
|
|
189
|
+
if (!this.requestPreparationMeasured) {
|
|
190
|
+
const finished = monotonicMilliseconds();
|
|
191
|
+
this.requestPreparationMeasured = true;
|
|
192
|
+
this.requestPreparationDuration = elapsedMilliseconds(this.requestPreparationStarted, finished);
|
|
193
|
+
this.setTiming(REQUEST_PREPARATION_DURATION, this.requestPreparationDuration);
|
|
194
|
+
}
|
|
195
|
+
this.requestPreparationOutcomeSent = true;
|
|
196
|
+
const durationMs = this.requestPreparationDuration;
|
|
197
|
+
if (durationMs === undefined)
|
|
198
|
+
return;
|
|
199
|
+
try {
|
|
200
|
+
this.phaseObserver({ phase: 'request_preparation', outcome, durationMs });
|
|
201
|
+
}
|
|
202
|
+
catch { /* Preserve request result. */ }
|
|
203
|
+
}
|
|
204
|
+
finishResponseHeadersOutcome(outcome) {
|
|
205
|
+
this.recordResponseHeadersSpan();
|
|
206
|
+
if (!this.phaseObserver || this.responseHeadersOutcomeSent)
|
|
207
|
+
return;
|
|
208
|
+
this.responseHeadersOutcomeSent = true;
|
|
209
|
+
const durationMs = this.responseHeadersDuration;
|
|
210
|
+
if (durationMs === undefined)
|
|
211
|
+
return;
|
|
212
|
+
try {
|
|
213
|
+
this.phaseObserver({ phase: 'response_headers', outcome, durationMs });
|
|
214
|
+
}
|
|
215
|
+
catch { /* Preserve request result. */ }
|
|
216
|
+
}
|
|
217
|
+
finishResponseOutcome(outcome) {
|
|
218
|
+
this.finishResponseProcessing();
|
|
219
|
+
if (!this.phaseObserver || this.responseProcessingOutcomeSent)
|
|
220
|
+
return;
|
|
221
|
+
this.responseProcessingOutcomeSent = true;
|
|
222
|
+
const durationMs = this.responseProcessingDuration;
|
|
223
|
+
if (durationMs !== undefined) {
|
|
224
|
+
try {
|
|
225
|
+
this.phaseObserver({ phase: 'response_processing', outcome, durationMs });
|
|
226
|
+
}
|
|
227
|
+
catch { /* Preserve request result. */ }
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
startStreamLifetime() {
|
|
231
|
+
if (!this.phaseObserver)
|
|
232
|
+
return;
|
|
233
|
+
this.streamLifetimeStarted = monotonicMilliseconds();
|
|
234
|
+
}
|
|
235
|
+
finishStreamLifetime(outcome) {
|
|
236
|
+
if (!this.phaseObserver || this.streamLifetimeStarted === undefined)
|
|
237
|
+
return;
|
|
238
|
+
const durationMs = elapsedMilliseconds(this.streamLifetimeStarted, monotonicMilliseconds());
|
|
239
|
+
this.streamLifetimeStarted = undefined;
|
|
240
|
+
if (durationMs === undefined)
|
|
241
|
+
return;
|
|
242
|
+
try {
|
|
243
|
+
this.phaseObserver({ phase: 'stream_lifetime', outcome, durationMs });
|
|
244
|
+
}
|
|
245
|
+
catch { /* Preserve stream result. */ }
|
|
246
|
+
}
|
|
247
|
+
finishResponseProcessing() {
|
|
248
|
+
if ((!this.timingEnabled && !this.phaseObserver) || this.responseProcessingStarted === undefined || this.responseProcessingMeasured)
|
|
249
|
+
return;
|
|
250
|
+
this.responseProcessingMeasured = true;
|
|
251
|
+
this.responseProcessingDuration = elapsedMilliseconds(this.responseProcessingStarted, monotonicMilliseconds());
|
|
252
|
+
}
|
|
253
|
+
finishObserverOutcome(outcome) {
|
|
254
|
+
if (!this.phaseObserver)
|
|
255
|
+
return;
|
|
256
|
+
this.finishResponseOutcome(outcome);
|
|
257
|
+
}
|
|
258
|
+
finishFailureOutcomes(error) {
|
|
259
|
+
if (!this.phaseObserver)
|
|
260
|
+
return;
|
|
261
|
+
let outcome;
|
|
262
|
+
try {
|
|
263
|
+
outcome = this.responseOutcome(error);
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
this.finishRequestPreparationOutcome(outcome);
|
|
270
|
+
}
|
|
271
|
+
catch { /* Preserve the caller's original failure. */ }
|
|
272
|
+
try {
|
|
273
|
+
this.finishObserverOutcome(outcome);
|
|
274
|
+
}
|
|
275
|
+
catch { /* Preserve the caller's original failure. */ }
|
|
276
|
+
}
|
|
277
|
+
response(response) {
|
|
278
|
+
this.responseStatus = response.status;
|
|
279
|
+
this.responseWasHttpError = !response.ok;
|
|
280
|
+
try {
|
|
281
|
+
this.span.setAttribute('http.response.status_code', response.status);
|
|
282
|
+
}
|
|
283
|
+
catch { /* Optional observation. */ }
|
|
284
|
+
try {
|
|
285
|
+
const requestId = response.headers.get('x-request-id') ?? '';
|
|
286
|
+
if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(requestId)) {
|
|
287
|
+
this.span.setAttribute('boxrouter.request.id', requestId);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch { /* Optional observation. */ }
|
|
291
|
+
try {
|
|
292
|
+
if (!response.ok)
|
|
293
|
+
this.span.setStatus({ code: api_1.SpanStatusCode.ERROR });
|
|
294
|
+
}
|
|
295
|
+
catch { /* Optional observation. */ }
|
|
296
|
+
try {
|
|
297
|
+
this.finishResponseHeadersOutcome(response.ok ? 'success' : 'http_error');
|
|
298
|
+
}
|
|
299
|
+
catch { /* Preserve the response. */ }
|
|
300
|
+
// Start body decoding only after response attributes and status have been recorded.
|
|
301
|
+
if (this.responseProcessingStarted !== undefined)
|
|
302
|
+
this.responseProcessingStarted = monotonicMilliseconds();
|
|
303
|
+
}
|
|
304
|
+
error(error) {
|
|
305
|
+
// Generated response handling may report errors before control returns to tracedRequest.
|
|
306
|
+
this.finishResponseProcessing();
|
|
307
|
+
let classified = error;
|
|
308
|
+
try {
|
|
309
|
+
if (classified instanceof api_error_1.RequestError) {
|
|
310
|
+
const cause = classified.cause;
|
|
311
|
+
if (cause !== undefined)
|
|
312
|
+
classified = cause;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
catch { /* Keep the fixed classifier safe when error properties are hostile. */ }
|
|
316
|
+
// Error.name/message and thrown response bodies can contain arbitrary payloads.
|
|
317
|
+
let type = 'unknown';
|
|
318
|
+
try {
|
|
319
|
+
type = classified?.code === 'parse_error' ? 'parse_error'
|
|
320
|
+
: isTimeoutError(classified) ? 'TimeoutError'
|
|
321
|
+
: classified instanceof DOMException && classified.name === 'AbortError' ? 'AbortError'
|
|
322
|
+
: classified instanceof TypeError ? 'TypeError'
|
|
323
|
+
: classified instanceof SyntaxError ? 'SyntaxError' : classified instanceof Error ? 'Error' : 'unknown';
|
|
324
|
+
}
|
|
325
|
+
catch { /* Retain the fixed unknown classification. */ }
|
|
326
|
+
try {
|
|
327
|
+
this.span.setAttribute('error.type', type);
|
|
328
|
+
}
|
|
329
|
+
catch { /* Optional observation. */ }
|
|
330
|
+
try {
|
|
331
|
+
this.span.setStatus({ code: api_1.SpanStatusCode.ERROR });
|
|
332
|
+
}
|
|
333
|
+
catch { /* Optional observation. */ }
|
|
334
|
+
}
|
|
335
|
+
responseOutcome(error) {
|
|
336
|
+
if (this.responseWasHttpError)
|
|
337
|
+
return 'http_error';
|
|
338
|
+
if (error instanceof api_error_1.APIError)
|
|
339
|
+
return 'parse_error';
|
|
340
|
+
try {
|
|
341
|
+
if (error?.code === 'parse_error')
|
|
342
|
+
return 'parse_error';
|
|
343
|
+
}
|
|
344
|
+
catch { /* Keep the fixed classifier safe when error properties are hostile. */ }
|
|
345
|
+
if (this.streamLifetimeStarted !== undefined)
|
|
346
|
+
return 'stream_error';
|
|
347
|
+
if (error instanceof api_error_1.RequestError) {
|
|
348
|
+
if (error.cause instanceof DOMException && error.cause.name === 'AbortError')
|
|
349
|
+
return 'cancelled';
|
|
350
|
+
if (error.response && !error.response.ok)
|
|
351
|
+
return 'http_error';
|
|
352
|
+
if (error.response)
|
|
353
|
+
return 'parse_error';
|
|
354
|
+
if (error.cause instanceof TypeError)
|
|
355
|
+
return 'network_error';
|
|
356
|
+
return 'network_error';
|
|
357
|
+
}
|
|
358
|
+
if (error instanceof DOMException && error.name === 'AbortError')
|
|
359
|
+
return 'cancelled';
|
|
360
|
+
if (error instanceof SyntaxError)
|
|
361
|
+
return 'parse_error';
|
|
362
|
+
if (error instanceof TypeError)
|
|
363
|
+
return 'network_error';
|
|
364
|
+
return 'unknown';
|
|
365
|
+
}
|
|
366
|
+
successfulResponseOutcome() {
|
|
367
|
+
return this.responseStatus !== undefined && this.responseStatus >= 400 ? 'http_error' : 'success';
|
|
368
|
+
}
|
|
369
|
+
setTiming(name, value) {
|
|
370
|
+
if (value === undefined)
|
|
371
|
+
return;
|
|
372
|
+
try {
|
|
373
|
+
this.span.setAttribute(name, value);
|
|
374
|
+
}
|
|
375
|
+
catch { /* Optional timing observation. */ }
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
exports.RequestTrace = RequestTrace;
|
|
379
|
+
function tracedRequest(method, path, run) {
|
|
380
|
+
const telemetry = new RequestTrace(method, path);
|
|
381
|
+
let operation;
|
|
382
|
+
const finish = () => {
|
|
383
|
+
if (telemetry.streaming)
|
|
384
|
+
return;
|
|
385
|
+
try {
|
|
386
|
+
telemetry.finishBufferedResponse();
|
|
387
|
+
}
|
|
388
|
+
catch { /* Preserve the caller's result and failure. */ }
|
|
389
|
+
try {
|
|
390
|
+
telemetry.span.end();
|
|
391
|
+
}
|
|
392
|
+
catch { /* Optional observation. */ }
|
|
393
|
+
};
|
|
394
|
+
const runOnce = () => {
|
|
395
|
+
if (operation)
|
|
396
|
+
return operation;
|
|
397
|
+
let result;
|
|
398
|
+
try {
|
|
399
|
+
result = Promise.resolve(run(telemetry));
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
result = Promise.reject(error);
|
|
403
|
+
}
|
|
404
|
+
operation = result.then(value => {
|
|
405
|
+
if (!telemetry.streaming) {
|
|
406
|
+
try {
|
|
407
|
+
telemetry.finishResponseProcessing();
|
|
408
|
+
telemetry.finishObserverOutcome(telemetry.successfulResponseOutcome());
|
|
409
|
+
}
|
|
410
|
+
catch { /* Preserve the caller's result. */ }
|
|
411
|
+
}
|
|
412
|
+
finish();
|
|
413
|
+
return value;
|
|
414
|
+
}, error => {
|
|
415
|
+
try {
|
|
416
|
+
telemetry.finishFailureOutcomes(error);
|
|
417
|
+
}
|
|
418
|
+
catch { /* Preserve the caller's original failure. */ }
|
|
419
|
+
try {
|
|
420
|
+
telemetry.error(error);
|
|
421
|
+
}
|
|
422
|
+
catch { /* Preserve the caller's original failure. */ }
|
|
423
|
+
finish();
|
|
424
|
+
throw error;
|
|
425
|
+
});
|
|
426
|
+
return operation;
|
|
427
|
+
};
|
|
428
|
+
let scoped;
|
|
429
|
+
try {
|
|
430
|
+
scoped = api_1.context.with(telemetry.context, runOnce);
|
|
431
|
+
}
|
|
432
|
+
catch { /* Run once outside failed observation. */ }
|
|
433
|
+
try {
|
|
434
|
+
void Promise.resolve(scoped).catch(() => undefined);
|
|
435
|
+
}
|
|
436
|
+
catch { /* Ignore optional context completion. */ }
|
|
437
|
+
return operation ?? runOnce();
|
|
438
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { BoxRouterApi } from './sdk.gen';
|
|
2
|
+
import type { SandboxTerminal, SandboxTerminalErrorEvent, SandboxTerminalExitEvent, SandboxTerminalOutputEvent } from './types.gen';
|
|
3
|
+
import { type MutationOptions, type RequestOptions } from './sandboxes';
|
|
4
|
+
/** Terminal output: the exact bytes the program wrote, decoded from the wire's base64. */
|
|
5
|
+
export interface TerminalOutputEvent extends Omit<SandboxTerminalOutputEvent, 'data_base64'> {
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export type TerminalEvent = TerminalOutputEvent | SandboxTerminalExitEvent | SandboxTerminalErrorEvent;
|
|
9
|
+
export interface TerminalOptions extends MutationOptions {
|
|
10
|
+
rows?: number;
|
|
11
|
+
cols?: number;
|
|
12
|
+
timeoutSeconds?: number;
|
|
13
|
+
terminalId?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TerminalEvents {
|
|
16
|
+
stream: AsyncGenerator<TerminalEvent>;
|
|
17
|
+
/** Close this HTTP observer only; the shell keeps running. */
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|
|
20
|
+
export interface TerminalOutputOptions extends RequestOptions {
|
|
21
|
+
/** Resume after this cursor; omitted resumes after the last event consumed by this handle. */
|
|
22
|
+
lastEventId?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class TerminalError extends Error {
|
|
25
|
+
readonly event: SandboxTerminalErrorEvent;
|
|
26
|
+
readonly code: string;
|
|
27
|
+
readonly outcome: SandboxTerminalErrorEvent['error']['outcome'];
|
|
28
|
+
readonly retry: SandboxTerminalErrorEvent['error']['retry'];
|
|
29
|
+
constructor(event: SandboxTerminalErrorEvent);
|
|
30
|
+
}
|
|
31
|
+
type RegisterObserver = (close: () => void) => () => void;
|
|
32
|
+
export declare function closeObservers(observers: Iterable<() => void>): void;
|
|
33
|
+
export declare function combineCleanupErrors(errors: unknown[], message: string): unknown;
|
|
34
|
+
/**
|
|
35
|
+
* One PTY shell on any provider. Closing this handle detaches local observers only; the shell runs
|
|
36
|
+
* until it exits, is killed or reaches its timeout. Attach again with its id.
|
|
37
|
+
*/
|
|
38
|
+
export declare class Terminal {
|
|
39
|
+
#private;
|
|
40
|
+
readonly state: SandboxTerminal;
|
|
41
|
+
constructor(api: BoxRouterApi, state: SandboxTerminal, registerObserver?: RegisterObserver);
|
|
42
|
+
get id(): string;
|
|
43
|
+
get sandboxId(): string;
|
|
44
|
+
get lastEventId(): string | null;
|
|
45
|
+
get exitCode(): number | null;
|
|
46
|
+
/** Detach this handle's HTTP observers only; the remote shell keeps running. */
|
|
47
|
+
close(): void;
|
|
48
|
+
/** Raw typed events; an early end throws. */
|
|
49
|
+
events(options?: TerminalOutputOptions): Promise<TerminalEvents>;
|
|
50
|
+
/** Yield exact output chunks, then stop at exit; errors and incomplete streams raise. */
|
|
51
|
+
output(options?: TerminalOutputOptions): AsyncGenerator<Uint8Array>;
|
|
52
|
+
/** Await writes sequentially. Never replay an uncertain write. */
|
|
53
|
+
write(data: Uint8Array, options?: MutationOptions): Promise<void>;
|
|
54
|
+
/** Change the window size; the foreground program receives SIGWINCH. */
|
|
55
|
+
resize(rows: number, cols: number, options?: MutationOptions): Promise<void>;
|
|
56
|
+
/** End the shell; its exit event follows on the stream. */
|
|
57
|
+
kill(options?: MutationOptions): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** Open a PTY shell by sandbox ID, or attach to terminalId; observer ownership stays local. */
|
|
60
|
+
export declare function openTerminal(api: BoxRouterApi, sandboxId: string, options?: TerminalOptions, registerObserver?: RegisterObserver): Promise<Terminal>;
|
|
61
|
+
export {};
|