@tangle-network/agent-app 0.44.59 → 0.44.60
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/dist/assistant/index.js +1 -1
- package/dist/chat-routes/index.js +1 -1
- package/dist/{chunk-2UDJH6QR.js → chunk-APFJITYT.js} +66 -1
- package/dist/chunk-APFJITYT.js.map +1 -0
- package/dist/{chunk-HCOROIRT.js → chunk-S4YW2Y52.js} +8 -5
- package/dist/chunk-S4YW2Y52.js.map +1 -0
- package/dist/sandbox/index.d.ts +435 -27
- package/dist/sandbox/index.js +3 -1
- package/dist/web-react/index.js +1 -1
- package/dist/web-react/terminal.d.ts +48 -3
- package/dist/web-react/terminal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UDJH6QR.js.map +0 -1
- package/dist/chunk-HCOROIRT.js.map +0 -1
|
@@ -8,8 +8,24 @@ interface SandboxTerminalConnection {
|
|
|
8
8
|
error: string | null;
|
|
9
9
|
loading: boolean;
|
|
10
10
|
sandboxId?: string;
|
|
11
|
+
connectionId?: string;
|
|
11
12
|
}
|
|
12
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Define the response structure for a sandbox terminal connection including URLs, token, status, and errors
|
|
15
|
+
*
|
|
16
|
+
* Transport-agnostic by construction (#341/#349): the browser-direct
|
|
17
|
+
* scoped-token route (`createSandboxTerminalConnectionRoute`,
|
|
18
|
+
* `src/sandbox/terminal-connection.ts`) returns `sidecarUrl` only — no
|
|
19
|
+
* `runtimeUrl` — while the (now `@deprecated`) same-origin proxy route
|
|
20
|
+
* returns both. `useSandboxTerminalConnection` below resolves
|
|
21
|
+
* `runtimeUrl ?? sidecarUrl` so either shape lands on the same connection
|
|
22
|
+
* state without a hook change.
|
|
23
|
+
*
|
|
24
|
+
* `connectionId` is the id the route's minted token's `sid` is bound to
|
|
25
|
+
* (echoed back from the `connectionId` the hook sent) — pass it straight
|
|
26
|
+
* through as `TerminalView`'s `connectionId` prop, since any other value
|
|
27
|
+
* fails the WS upgrade on the current platform.
|
|
28
|
+
*/
|
|
13
29
|
interface SandboxTerminalConnectionResponse {
|
|
14
30
|
runtimeUrl?: string;
|
|
15
31
|
sidecarUrl?: string;
|
|
@@ -18,11 +34,23 @@ interface SandboxTerminalConnectionResponse {
|
|
|
18
34
|
status?: string;
|
|
19
35
|
error?: string;
|
|
20
36
|
sandboxId?: string;
|
|
37
|
+
connectionId?: string;
|
|
21
38
|
}
|
|
22
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Define options for configuring a sandbox terminal connection including workspace ID and connection parameters
|
|
41
|
+
*
|
|
42
|
+
* `connectionId`, when set, is passed to
|
|
43
|
+
* `createSandboxTerminalConnectionRoute` as the `connectionId` query
|
|
44
|
+
* parameter — pass `tabTerminalConnectionId()` here so the route mints a
|
|
45
|
+
* token whose `sid` is bound to the same id `TerminalView` will dial. Give
|
|
46
|
+
* `TerminalView` the response's echoed `connectionId` (not this input
|
|
47
|
+
* value) alongside `sidecarUrl` as `apiUrl` and `token`, since a product's
|
|
48
|
+
* `resolveConnectionId` seam may rewrite it server-side.
|
|
49
|
+
*/
|
|
23
50
|
interface UseSandboxTerminalConnectionOptions {
|
|
24
51
|
workspaceId: string;
|
|
25
52
|
connectionUrl?: string | ((workspaceId: string) => string);
|
|
53
|
+
connectionId?: string;
|
|
26
54
|
fetcher?: typeof fetch;
|
|
27
55
|
provisionPollIntervalMs?: number;
|
|
28
56
|
provisionPollTimeoutMs?: number;
|
|
@@ -32,7 +60,24 @@ interface UseSandboxTerminalConnectionOptions {
|
|
|
32
60
|
interface UseSandboxTerminalConnectionResult extends SandboxTerminalConnection {
|
|
33
61
|
connect: () => Promise<void>;
|
|
34
62
|
}
|
|
35
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling
|
|
65
|
+
*
|
|
66
|
+
* Transport-agnostic (#341/#349): this hook does not care whether
|
|
67
|
+
* `connectionUrl` is backed by the fleet-default browser-direct
|
|
68
|
+
* scoped-token route (`createSandboxTerminalConnectionRoute`,
|
|
69
|
+
* `src/sandbox/terminal-connection.ts`, `sidecarUrl` only) or the
|
|
70
|
+
* `@deprecated` same-origin proxy route (`runtimeUrl` + `sidecarUrl`) — it
|
|
71
|
+
* resolves `runtimeUrl ?? sidecarUrl` either way.
|
|
72
|
+
*
|
|
73
|
+
* Pass `tabTerminalConnectionId()` as `opts.connectionId` — the hook forwards
|
|
74
|
+
* it as the `connectionId` query parameter the browser-direct route requires
|
|
75
|
+
* to mint a token whose `sid` is bound to that exact id (the orchestrator's
|
|
76
|
+
* terminal WS gate fails closed on any other value). Give `TerminalView` the
|
|
77
|
+
* RESULT's echoed `connectionId` (not the input value — a product's
|
|
78
|
+
* `resolveConnectionId` seam may rewrite it), the resolved `sidecarUrl`/
|
|
79
|
+
* `runtimeUrl` as `apiUrl`, and `token` as its token prop.
|
|
80
|
+
*/
|
|
36
81
|
declare function useSandboxTerminalConnection(opts: UseSandboxTerminalConnectionOptions): UseSandboxTerminalConnectionResult;
|
|
37
82
|
/**
|
|
38
83
|
* Stable-per-tab, unique-per-client terminal connection id.
|
package/package.json
CHANGED