@tangle-network/agent-app 0.50.32 → 0.50.33
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/agent-enrollment/application.d.ts +25 -5
- package/dist/agent-enrollment/drizzle.js +1 -1
- package/dist/agent-enrollment/index.d.ts +1 -1
- package/dist/agent-enrollment/index.js +1 -1
- package/dist/app-oauth/index.d.ts +101 -0
- package/dist/app-oauth/index.js +231 -0
- package/dist/app-oauth/index.js.map +1 -0
- package/dist/assistant/index.js +1 -1
- package/dist/chat-routes/index.js +4 -4
- package/dist/{chunk-LDCR7MRU.js → chunk-2PDKWV2S.js} +2 -2
- package/dist/{chunk-NLXY7TFB.js → chunk-C3JSO2CB.js} +43 -18
- package/dist/chunk-C3JSO2CB.js.map +1 -0
- package/dist/{chunk-CNI46COH.js → chunk-CBRYWGUO.js} +2 -2
- package/dist/{chunk-CNI46COH.js.map → chunk-CBRYWGUO.js.map} +1 -1
- package/dist/{chunk-BATKJP3P.js → chunk-E4AY62T2.js} +24 -7
- package/dist/chunk-E4AY62T2.js.map +1 -0
- package/dist/{chunk-5KFRCVAO.js → chunk-IYLPQKAH.js} +2 -2
- package/dist/{chunk-5TOV7EDF.js → chunk-PF3AZD5G.js} +4 -4
- package/dist/{chunk-ACFM2GFL.js → chunk-SYIV74NB.js} +1 -1
- package/dist/design-canvas-react/index.js +4 -4
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/hosted-agent/react/SharedLineAppNotice.d.ts +16 -0
- package/dist/hosted-agent/react/index.d.ts +1 -0
- package/dist/hosted-agent/react/index.js +46 -1
- package/dist/hosted-agent/react/index.js.map +1 -1
- package/dist/hosted-agent/react/lines.css +92 -2
- package/dist/preset-cloudflare/index.js +2 -2
- package/dist/sandbox/index.js +4 -4
- package/dist/studio-react/index.js +91 -56
- package/dist/studio-react/index.js.map +1 -1
- package/dist/theme/tokens.css +3 -1
- package/dist/tools/index.js +4 -4
- package/dist/web-react/index.js +4 -4
- package/dist/web-react/sandbox-terminal.d.ts +2 -0
- package/dist/web-react/terminal.js +1 -1
- package/dist/work-product/index.js +2 -2
- package/dist/workspace-react/companion.d.ts +31 -0
- package/dist/workspace-react/index.d.ts +1 -1
- package/dist/workspace-react/index.js +140 -2
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +25 -5
- package/dist/chunk-BATKJP3P.js.map +0 -1
- package/dist/chunk-NLXY7TFB.js.map +0 -1
- /package/dist/{chunk-LDCR7MRU.js.map → chunk-2PDKWV2S.js.map} +0 -0
- /package/dist/{chunk-5KFRCVAO.js.map → chunk-IYLPQKAH.js.map} +0 -0
- /package/dist/{chunk-5TOV7EDF.js.map → chunk-PF3AZD5G.js.map} +0 -0
- /package/dist/{chunk-ACFM2GFL.js.map → chunk-SYIV74NB.js.map} +0 -0
|
@@ -13,7 +13,6 @@ var EMPTY_CONNECTION = {
|
|
|
13
13
|
loading: false
|
|
14
14
|
};
|
|
15
15
|
function useSandboxTerminalConnection(opts) {
|
|
16
|
-
const [conn, setConn] = useState(EMPTY_CONNECTION);
|
|
17
16
|
const mountedRef = useRef(false);
|
|
18
17
|
const generationRef = useRef(0);
|
|
19
18
|
const fetcher = opts.fetcher ?? fetch;
|
|
@@ -26,10 +25,20 @@ function useSandboxTerminalConnection(opts) {
|
|
|
26
25
|
const separator = base.includes("?") ? "&" : "?";
|
|
27
26
|
return `${base}${separator}connectionId=${encodeURIComponent(opts.connectionId)}`;
|
|
28
27
|
}, [opts.connectionUrl, opts.workspaceId, opts.connectionId]);
|
|
28
|
+
const scopeKey = JSON.stringify([opts.workspaceId, connectionUrl()]);
|
|
29
|
+
const scopeRef = useRef(scopeKey);
|
|
30
|
+
const [connectionState, setConnectionState] = useState(() => ({ scopeKey, connection: EMPTY_CONNECTION }));
|
|
31
|
+
const conn = connectionState.scopeKey === scopeKey ? connectionState.connection : EMPTY_CONNECTION;
|
|
32
|
+
const setConn = useCallback((value) => {
|
|
33
|
+
setConnectionState((current) => ({
|
|
34
|
+
scopeKey,
|
|
35
|
+
connection: typeof value === "function" ? value(current.scopeKey === scopeKey ? current.connection : EMPTY_CONNECTION) : value
|
|
36
|
+
}));
|
|
37
|
+
}, [scopeKey]);
|
|
29
38
|
const connect = useCallback(async () => {
|
|
30
39
|
const generation = generationRef.current + 1;
|
|
31
40
|
generationRef.current = generation;
|
|
32
|
-
const isCurrent = () => mountedRef.current && generationRef.current === generation;
|
|
41
|
+
const isCurrent = () => mountedRef.current && generationRef.current === generation && scopeRef.current === scopeKey;
|
|
33
42
|
const setCurrentConn = (value) => {
|
|
34
43
|
if (!isCurrent()) return;
|
|
35
44
|
setConn(value);
|
|
@@ -108,7 +117,7 @@ function useSandboxTerminalConnection(opts) {
|
|
|
108
117
|
return;
|
|
109
118
|
}
|
|
110
119
|
}
|
|
111
|
-
}, [connectionUrl, fetcher, pollIntervalMs, pollTimeoutMs]);
|
|
120
|
+
}, [connectionUrl, fetcher, pollIntervalMs, pollTimeoutMs, scopeKey, setConn]);
|
|
112
121
|
useEffect(() => {
|
|
113
122
|
mountedRef.current = true;
|
|
114
123
|
return () => {
|
|
@@ -117,8 +126,16 @@ function useSandboxTerminalConnection(opts) {
|
|
|
117
126
|
};
|
|
118
127
|
}, []);
|
|
119
128
|
useEffect(() => {
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
scopeRef.current = scopeKey;
|
|
130
|
+
generationRef.current += 1;
|
|
131
|
+
setConn(EMPTY_CONNECTION);
|
|
132
|
+
return () => {
|
|
133
|
+
generationRef.current += 1;
|
|
134
|
+
};
|
|
135
|
+
}, [scopeKey, setConn]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (opts.autoConnect !== false) void connect();
|
|
138
|
+
}, [connect, opts.autoConnect]);
|
|
122
139
|
useEffect(() => {
|
|
123
140
|
if (!conn.runtimeUrl || !conn.token || !conn.expiresAt) return;
|
|
124
141
|
const refreshAt = Date.parse(conn.expiresAt) - Date.now() - refreshSkewMs;
|
|
@@ -138,7 +155,7 @@ function useSandboxTerminalConnection(opts) {
|
|
|
138
155
|
void connect();
|
|
139
156
|
}, Math.max(1e3, refreshAt));
|
|
140
157
|
return () => window.clearTimeout(timer);
|
|
141
|
-
}, [conn.runtimeUrl, conn.token, conn.expiresAt, connect, refreshSkewMs]);
|
|
158
|
+
}, [conn.runtimeUrl, conn.token, conn.expiresAt, connect, refreshSkewMs, setConn]);
|
|
142
159
|
return { ...conn, connect };
|
|
143
160
|
}
|
|
144
161
|
function sleep(ms) {
|
|
@@ -166,4 +183,4 @@ export {
|
|
|
166
183
|
useSandboxTerminalConnection,
|
|
167
184
|
tabTerminalConnectionId
|
|
168
185
|
};
|
|
169
|
-
//# sourceMappingURL=chunk-
|
|
186
|
+
//# sourceMappingURL=chunk-E4AY62T2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-react/sandbox-terminal.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, type SetStateAction } from 'react'\n\n/** Define the connection details and status for a sandbox terminal session */\nexport interface SandboxTerminalConnection {\n runtimeUrl: string | null\n sidecarUrl: string | null\n token: string | null\n expiresAt: string | null\n status: string\n error: string | null\n loading: boolean\n sandboxId?: string\n connectionId?: string\n}\n\n/**\n * Define the response structure for a sandbox terminal connection including URLs, token, status, and errors\n *\n * The browser-direct scoped-token route (`createSandboxTerminalConnectionRoute`,\n * `src/sandbox/terminal-connection.ts`) returns `sidecarUrl`. The hook also\n * exposes that URL through the historical `runtimeUrl` state field so existing\n * terminal panels do not need transport-specific branching.\n *\n * `connectionId` is the id the route's minted token's `sid` is bound to\n * (echoed back from the `connectionId` the hook sent) — pass it straight\n * through as `TerminalView`'s `connectionId` prop, since any other value\n * fails the WS upgrade on the current platform.\n */\nexport interface SandboxTerminalConnectionResponse {\n runtimeUrl?: string\n sidecarUrl?: string\n token?: string\n expiresAt?: string\n status?: string\n error?: string\n sandboxId?: string\n connectionId?: string\n}\n\n/**\n * Define options for configuring a sandbox terminal connection including workspace ID and connection parameters\n *\n * `connectionId`, when set, is passed to\n * `createSandboxTerminalConnectionRoute` as the `connectionId` query\n * parameter — pass `tabTerminalConnectionId()` here so the route mints a\n * token whose `sid` is bound to the same id `TerminalView` will dial. Give\n * `TerminalView` the response's echoed `connectionId` (not this input\n * value) alongside `sidecarUrl` as `apiUrl` and `token`, since a product's\n * `resolveConnectionId` seam may rewrite it server-side.\n */\nexport interface UseSandboxTerminalConnectionOptions {\n workspaceId: string\n /** Connect each scope by default; false requires an explicit connect after mount or scope changes. */\n autoConnect?: boolean\n connectionUrl?: string | ((workspaceId: string) => string)\n connectionId?: string\n fetcher?: typeof fetch\n provisionPollIntervalMs?: number\n provisionPollTimeoutMs?: number\n tokenRefreshSkewMs?: number\n}\n\n/** Resolve sandbox terminal connection status and provide a method to initiate the connection */\nexport interface UseSandboxTerminalConnectionResult extends SandboxTerminalConnection {\n connect: () => Promise<void>\n}\n\nconst DEFAULT_PROVISION_POLL_INTERVAL_MS = 2_000\nconst DEFAULT_PROVISION_POLL_TIMEOUT_MS = 90_000\nconst DEFAULT_TOKEN_REFRESH_SKEW_MS = 120_000\n\nconst EMPTY_CONNECTION: SandboxTerminalConnection = {\n runtimeUrl: null,\n sidecarUrl: null,\n token: null,\n expiresAt: null,\n status: 'idle',\n error: null,\n loading: false,\n}\n\n/**\n * Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling\n *\n * `connectionUrl` is backed by the browser-direct scoped-token route\n * (`createSandboxTerminalConnectionRoute`,\n * `src/sandbox/terminal-connection.ts`). The route returns `sidecarUrl`; the\n * hook normalizes it into both URL fields for compatibility with existing\n * terminal panels.\n *\n * Pass `tabTerminalConnectionId()` as `opts.connectionId` — the hook forwards\n * it as the `connectionId` query parameter the browser-direct route requires\n * to mint a token whose `sid` is bound to that exact id (the orchestrator's\n * terminal WS gate fails closed on any other value). Give `TerminalView` the\n * RESULT's echoed `connectionId` (not the input value — a product's\n * `resolveConnectionId` seam may rewrite it), the resolved `sidecarUrl`/\n * `runtimeUrl` as `apiUrl`, and `token` as its token prop.\n */\nexport function useSandboxTerminalConnection(opts: UseSandboxTerminalConnectionOptions): UseSandboxTerminalConnectionResult {\n const mountedRef = useRef(false)\n const generationRef = useRef(0)\n const fetcher = opts.fetcher ?? fetch\n const pollIntervalMs = opts.provisionPollIntervalMs ?? DEFAULT_PROVISION_POLL_INTERVAL_MS\n const pollTimeoutMs = opts.provisionPollTimeoutMs ?? DEFAULT_PROVISION_POLL_TIMEOUT_MS\n const refreshSkewMs = opts.tokenRefreshSkewMs ?? DEFAULT_TOKEN_REFRESH_SKEW_MS\n\n const connectionUrl = useCallback(() => {\n const base = typeof opts.connectionUrl === 'function'\n ? opts.connectionUrl(opts.workspaceId)\n : opts.connectionUrl ?? `/api/workspaces/${encodeURIComponent(opts.workspaceId)}/sandbox/connection`\n if (!opts.connectionId) return base\n // `base` may be relative (SSR-safe), so a plain `URL` parse isn't always\n // possible — string-append with proper encoding covers both shapes.\n const separator = base.includes('?') ? '&' : '?'\n return `${base}${separator}connectionId=${encodeURIComponent(opts.connectionId)}`\n }, [opts.connectionUrl, opts.workspaceId, opts.connectionId])\n\n const scopeKey = JSON.stringify([opts.workspaceId, connectionUrl()])\n const scopeRef = useRef(scopeKey)\n const [connectionState, setConnectionState] = useState(() => ({ scopeKey, connection: EMPTY_CONNECTION }))\n const conn = connectionState.scopeKey === scopeKey ? connectionState.connection : EMPTY_CONNECTION\n const setConn = useCallback((value: SetStateAction<SandboxTerminalConnection>) => {\n setConnectionState((current) => ({\n scopeKey,\n connection: typeof value === 'function'\n ? value(current.scopeKey === scopeKey ? current.connection : EMPTY_CONNECTION)\n : value,\n }))\n }, [scopeKey])\n\n const connect = useCallback(async () => {\n const generation = generationRef.current + 1\n generationRef.current = generation\n const isCurrent = () => mountedRef.current && generationRef.current === generation && scopeRef.current === scopeKey\n const setCurrentConn: typeof setConn = (value) => {\n if (!isCurrent()) return\n setConn(value)\n }\n\n setCurrentConn((current) => ({ ...current, loading: true, error: null }))\n const deadline = Date.now() + pollTimeoutMs\n while (isCurrent()) {\n try {\n const res = await fetcher(connectionUrl())\n const data = (await res.json()) as SandboxTerminalConnectionResponse\n if (!isCurrent()) return\n const runtimeUrl = data.runtimeUrl ?? data.sidecarUrl\n if (res.ok && runtimeUrl && data.token && data.expiresAt) {\n setCurrentConn({\n runtimeUrl,\n sidecarUrl: data.sidecarUrl ?? runtimeUrl,\n token: data.token,\n expiresAt: data.expiresAt,\n status: data.status ?? 'running',\n error: null,\n loading: false,\n ...(data.sandboxId ? { sandboxId: data.sandboxId } : {}),\n ...(data.connectionId ? { connectionId: data.connectionId } : {}),\n })\n return\n }\n if (res.ok) {\n setCurrentConn({\n runtimeUrl: null,\n sidecarUrl: null,\n token: null,\n expiresAt: null,\n loading: false,\n error: 'Sandbox connection response is missing required fields',\n status: data.status ?? 'error',\n ...(data.sandboxId ? { sandboxId: data.sandboxId } : {}),\n })\n return\n }\n if (res.status === 503 && Date.now() < deadline) {\n setCurrentConn((current) => ({\n ...current,\n loading: true,\n status: data.status ?? 'provisioning',\n error: null,\n }))\n await sleep(pollIntervalMs)\n continue\n }\n setCurrentConn((current) => ({\n ...current,\n runtimeUrl: null,\n sidecarUrl: null,\n token: null,\n expiresAt: null,\n loading: false,\n error: data.error ?? 'Sandbox not available',\n status: data.status ?? 'error',\n }))\n return\n } catch (err) {\n if (!isCurrent()) return\n if (Date.now() < deadline) {\n await sleep(pollIntervalMs)\n continue\n }\n setCurrentConn((current) => ({\n ...current,\n runtimeUrl: null,\n sidecarUrl: null,\n token: null,\n expiresAt: null,\n loading: false,\n error: err instanceof Error ? err.message : 'Connection failed',\n }))\n return\n }\n }\n }, [connectionUrl, fetcher, pollIntervalMs, pollTimeoutMs, scopeKey, setConn])\n\n useEffect(() => {\n mountedRef.current = true\n return () => {\n mountedRef.current = false\n generationRef.current += 1\n }\n }, [])\n\n useEffect(() => {\n // A token and in-flight provisioning belong to one workspace/connection scope.\n scopeRef.current = scopeKey\n generationRef.current += 1\n setConn(EMPTY_CONNECTION)\n return () => { generationRef.current += 1 }\n }, [scopeKey, setConn])\n\n useEffect(() => {\n if (opts.autoConnect !== false) void connect()\n }, [connect, opts.autoConnect])\n\n useEffect(() => {\n if (!conn.runtimeUrl || !conn.token || !conn.expiresAt) return\n const refreshAt = Date.parse(conn.expiresAt) - Date.now() - refreshSkewMs\n if (!Number.isFinite(refreshAt)) {\n setConn((current) => ({\n ...current,\n runtimeUrl: null,\n sidecarUrl: null,\n token: null,\n expiresAt: null,\n status: 'error',\n error: 'Sandbox token expiry is invalid',\n }))\n return\n }\n const timer = window.setTimeout(() => {\n void connect()\n }, Math.max(1_000, refreshAt))\n return () => window.clearTimeout(timer)\n }, [conn.runtimeUrl, conn.token, conn.expiresAt, connect, refreshSkewMs, setConn])\n\n return { ...conn, connect }\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => window.setTimeout(resolve, ms))\n}\n\nconst DEFAULT_TERMINAL_CID_KEY = 'agent-app:terminal-connection-id'\n\nfunction newConnectionId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') return crypto.randomUUID()\n return `cid-${Date.now().toString(36)}-${Math.floor(Math.random() * 1e9).toString(36)}`\n}\n\n/**\n * Stable-per-tab, unique-per-client terminal connection id.\n *\n * Persists in `sessionStorage` so a reload in the same tab reuses the id (the\n * sidecar restores the same PTY session via `TerminalView.connectionId`), while\n * separate tabs/windows each get a distinct id. Pass the result as\n * `TerminalView`'s `connectionId`. Without it (e.g. gtm-agent today) every tab\n * shares one connection id and their reconnects evict each other.\n *\n * Falls back to an ephemeral id when `sessionStorage` is unavailable (SSR,\n * privacy mode) — still unique per call, just not reload-stable.\n */\nexport function tabTerminalConnectionId(storageKey: string = DEFAULT_TERMINAL_CID_KEY): string {\n try {\n const store = globalThis.sessionStorage\n const existing = store?.getItem(storageKey)\n if (existing) return existing\n const id = newConnectionId()\n store?.setItem(storageKey, id)\n return id\n } catch {\n return newConnectionId()\n }\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M,KAAK,gBAAgB;AAC3B,WAAO,QAAQ,YAAY,EAAE;AAC7B,WAAO;AAAA,EACT,QAAQ;AACN,WAAO,gBAAgB;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError,
|
|
3
3
|
validateOpenUIJsonNode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CBRYWGUO.js";
|
|
5
5
|
|
|
6
6
|
// src/tools/render-ui-schema.ts
|
|
7
7
|
function assertRenderUiSchema(value) {
|
|
@@ -14,4 +14,4 @@ function assertRenderUiSchema(value) {
|
|
|
14
14
|
export {
|
|
15
15
|
assertRenderUiSchema
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-IYLPQKAH.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
buildAppToolOpenAITools,
|
|
7
7
|
findCustomTool,
|
|
8
8
|
isAppToolName
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2PDKWV2S.js";
|
|
10
10
|
import {
|
|
11
11
|
base64UrlDecodeText,
|
|
12
12
|
base64UrlEncodeText,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-S5SRJJQG.js";
|
|
16
16
|
import {
|
|
17
17
|
assertRenderUiSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IYLPQKAH.js";
|
|
19
19
|
import {
|
|
20
20
|
ToolInputError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CBRYWGUO.js";
|
|
22
22
|
|
|
23
23
|
// src/tools/capability.ts
|
|
24
24
|
async function createCapabilityToken(userId, opts) {
|
|
@@ -270,4 +270,4 @@ export {
|
|
|
270
270
|
createAppToolRuntimeExecutor,
|
|
271
271
|
handleAppToolRequest
|
|
272
272
|
};
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
273
|
+
//# sourceMappingURL=chunk-PF3AZD5G.js.map
|
|
@@ -43,10 +43,6 @@ import {
|
|
|
43
43
|
selectTickStep
|
|
44
44
|
} from "../chunk-YJYPXMDL.js";
|
|
45
45
|
import "../chunk-Q2QKEV6J.js";
|
|
46
|
-
import {
|
|
47
|
-
DesignCanvasChromeLazy,
|
|
48
|
-
DesignCanvasLazy
|
|
49
|
-
} from "../chunk-ACFM2GFL.js";
|
|
50
46
|
import "../chunk-ZN5J47UX.js";
|
|
51
47
|
import {
|
|
52
48
|
DEFAULT_INSERT_TEMPLATES,
|
|
@@ -89,6 +85,10 @@ import {
|
|
|
89
85
|
setPagePropsCommand,
|
|
90
86
|
ungroupElementCommand
|
|
91
87
|
} from "../chunk-HQ7R6CGM.js";
|
|
88
|
+
import {
|
|
89
|
+
DesignCanvasChromeLazy,
|
|
90
|
+
DesignCanvasLazy
|
|
91
|
+
} from "../chunk-SYIV74NB.js";
|
|
92
92
|
import {
|
|
93
93
|
assertSceneMediaSrc,
|
|
94
94
|
bleedAwareExportBounds,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SharedLineApp {
|
|
2
|
+
/** Stable app identity used to collapse duplicate registrations. */
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SharedLineAppNoticeProps {
|
|
7
|
+
/** Apps the host has verified can handle this same phone conversation. */
|
|
8
|
+
apps: readonly SharedLineApp[];
|
|
9
|
+
/** The host controls dismissal so the choice can persist with its own policy. */
|
|
10
|
+
open: boolean;
|
|
11
|
+
onKeepSharing(): void;
|
|
12
|
+
/** Omit when the host has no supported dedicated-number flow. */
|
|
13
|
+
onRequestDedicatedNumber?: () => void;
|
|
14
|
+
}
|
|
15
|
+
/** A quiet, dismissible notice for apps that the host verified share a phone thread. */
|
|
16
|
+
export declare function SharedLineAppNotice({ apps, open, onKeepSharing, onRequestDedicatedNumber, }: SharedLineAppNoticeProps): import("react").JSX.Element | null;
|
|
@@ -4,3 +4,4 @@ export { LineSetup } from './LineSetup';
|
|
|
4
4
|
export { LineMembers } from './LineMembers';
|
|
5
5
|
export { LineBilling } from './LineBilling';
|
|
6
6
|
export { ApplicationLineSetup, type ApplicationLineSetupProps, type ApplicationLineSetupClient, type ApplicationLineConnectInput, type ApplicationSenderVerificationStart, type ApplicationSenderVerification } from './ApplicationLineSetup';
|
|
7
|
+
export { SharedLineAppNotice, type SharedLineApp, type SharedLineAppNoticeProps } from './SharedLineAppNotice';
|
|
@@ -814,10 +814,55 @@ function ApplicationLineSetupScope({ client, enabled, ...props }) {
|
|
|
814
814
|
)
|
|
815
815
|
] });
|
|
816
816
|
}
|
|
817
|
+
|
|
818
|
+
// src/hosted-agent/react/SharedLineAppNotice.tsx
|
|
819
|
+
import { useId } from "react";
|
|
820
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
821
|
+
function distinctApps(apps) {
|
|
822
|
+
const seen = /* @__PURE__ */ new Set();
|
|
823
|
+
const result = [];
|
|
824
|
+
for (const app of apps) {
|
|
825
|
+
const id = app.id.trim();
|
|
826
|
+
if (!id || seen.has(id)) continue;
|
|
827
|
+
seen.add(id);
|
|
828
|
+
result.push({ id, name: app.name.trim() || "Unnamed app" });
|
|
829
|
+
}
|
|
830
|
+
return result;
|
|
831
|
+
}
|
|
832
|
+
function SharedLineAppNotice({
|
|
833
|
+
apps,
|
|
834
|
+
open,
|
|
835
|
+
onKeepSharing,
|
|
836
|
+
onRequestDedicatedNumber
|
|
837
|
+
}) {
|
|
838
|
+
const titleId = useId();
|
|
839
|
+
const sharingApps = distinctApps(apps);
|
|
840
|
+
if (!open || sharingApps.length < 2) return null;
|
|
841
|
+
return /* @__PURE__ */ jsxs5("section", { className: "tangle-lines agent-shared-line-notice", "aria-labelledby": titleId, children: [
|
|
842
|
+
/* @__PURE__ */ jsxs5("div", { className: "agent-shared-line-notice__copy", children: [
|
|
843
|
+
/* @__PURE__ */ jsx5("h2", { id: titleId, children: "These apps share one text conversation" }),
|
|
844
|
+
/* @__PURE__ */ jsx5("p", { children: "Each app keeps its own history here. Their replies appear together in the same conversation on your phone." }),
|
|
845
|
+
/* @__PURE__ */ jsx5("ul", { className: "agent-shared-line-notice__apps", "aria-label": "Apps sharing this conversation", children: sharingApps.map((app) => /* @__PURE__ */ jsx5("li", { children: app.name }, app.id)) })
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ jsxs5("div", { className: "agent-shared-line-notice__actions", children: [
|
|
848
|
+
onRequestDedicatedNumber && /* @__PURE__ */ jsx5(
|
|
849
|
+
"button",
|
|
850
|
+
{
|
|
851
|
+
className: "agent-shared-line-notice__secondary",
|
|
852
|
+
type: "button",
|
|
853
|
+
onClick: onRequestDedicatedNumber,
|
|
854
|
+
children: "Get a dedicated number"
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
/* @__PURE__ */ jsx5("button", { className: "agent-shared-line-notice__primary", type: "button", onClick: onKeepSharing, children: "Keep sharing" })
|
|
858
|
+
] })
|
|
859
|
+
] });
|
|
860
|
+
}
|
|
817
861
|
export {
|
|
818
862
|
ApplicationLineSetup,
|
|
819
863
|
LineBilling,
|
|
820
864
|
LineMembers,
|
|
821
|
-
LineSetup
|
|
865
|
+
LineSetup,
|
|
866
|
+
SharedLineAppNotice
|
|
822
867
|
};
|
|
823
868
|
//# sourceMappingURL=index.js.map
|