@burdenoff/fe-libs 2026.915.1 → 2026.915.3
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/shared/assistant/api.d.ts +38 -9
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +79 -74
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +3 -3
- package/dist/shared/assistant/i18nManifest.d.ts +4 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +4 -0
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/runtime.d.ts.map +1 -1
- package/dist/shared/assistant/runtime.js +3 -3
- package/dist/shared/assistant/store.d.ts +19 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +9 -2
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +288 -288
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +1 -1
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +111 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +171 -0
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +184 -0
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts.map +1 -0
- package/dist/shared/assistant/ui/assistantOverlayState.js +68 -0
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantHeartbeat.js +8 -8
- package/dist/shared-assistant.js +113 -111
- package/package.json +1 -1
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { AssistantMode, AssistantPromptPart, AssistantRawMessage, AssistantSandboxAuthContext, AssistantArtifact, AssistantSessionInfo, DownloadedAssistantArtifact, StreamAccess } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Does a proxied request into a sandbox of this mode carry the signed-in user's
|
|
4
|
+
* own tokens (`forwardedAuthToken` / `forwardedWorkspaceToken`)?
|
|
5
|
+
*
|
|
6
|
+
* ★★ Only Ask (`assistant`). It is the one mode that authenticates the
|
|
7
|
+
* in-sandbox agent with the user's OWN identity (read-only, enforced by
|
|
8
|
+
* AI_ASSISTANT_READONLY — see `buildAssistantSandboxEnv`). Every other mode must
|
|
9
|
+
* never receive them:
|
|
10
|
+
* - `api-calls` (Take action) acts through a delegated per-workspace app; the
|
|
11
|
+
* sandbox service mints and sends those credentials itself and never reads the
|
|
12
|
+
* forwarded tokens.
|
|
13
|
+
* - `vibe-plugins`, `general` (and `fluidgrids-node` on the service side) make
|
|
14
|
+
* no platform GraphQL calls at all. Their agent has bash, so a user token
|
|
15
|
+
* handed to one is a token a prompt injection can read and replay as the user
|
|
16
|
+
* (BOFF-7304).
|
|
17
|
+
*
|
|
18
|
+
* ★ Fails closed: an unknown, empty or absent mode forwards nothing. The sandbox
|
|
19
|
+
* service applies the same rule server-side from the sandbox's recorded mode
|
|
20
|
+
* (wspace-sandbox-svc#87); this is the client half, so the tokens never leave
|
|
21
|
+
* the browser for a sandbox that has no use for them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function forwardsUserTokensToSandbox(mode: AssistantMode | null | undefined): boolean;
|
|
2
24
|
export declare function findExistingSandbox(workspaceId: string, product: string, mode: AssistantMode, isProd: boolean, authContext: AssistantSandboxAuthContext, excludedSandboxIds?: ReadonlySet<string>): Promise<string | null>;
|
|
3
25
|
export interface ExistingAssistantSandbox {
|
|
4
26
|
id: string;
|
|
@@ -37,7 +59,7 @@ export declare function createAssistantSandbox(product: string, mode: AssistantM
|
|
|
37
59
|
* the same terminal-error strings either way.
|
|
38
60
|
*/
|
|
39
61
|
export declare function waitForSandboxRunning(sandboxId: string, workspaceId: string, authContext: AssistantSandboxAuthContext, maxWaitMs?: number): Promise<void>;
|
|
40
|
-
export declare function waitForAssistantServiceReady(sandboxId: string, workspaceId: string, authContext: AssistantSandboxAuthContext, maxWaitMs?: number): Promise<void>;
|
|
62
|
+
export declare function waitForAssistantServiceReady(sandboxId: string, workspaceId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext, maxWaitMs?: number): Promise<void>;
|
|
41
63
|
export declare function createAssistantSession(sandboxId: string, workspaceId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<{
|
|
42
64
|
sessionId: string;
|
|
43
65
|
}>;
|
|
@@ -58,7 +80,7 @@ export declare function createAssistantSession(sandboxId: string, workspaceId: s
|
|
|
58
80
|
* did NOT land — silently swallowing it would leave them believing a change was
|
|
59
81
|
* authorised when it was not.
|
|
60
82
|
*/
|
|
61
|
-
export declare function approvePendingWrite(sandboxId: string, workspaceId: string, reference: string, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
83
|
+
export declare function approvePendingWrite(sandboxId: string, workspaceId: string, reference: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
62
84
|
/**
|
|
63
85
|
* Our own assistant sandboxes in this workspace that are for a DIFFERENT mode.
|
|
64
86
|
*
|
|
@@ -124,7 +146,7 @@ options?: {
|
|
|
124
146
|
}): Promise<{
|
|
125
147
|
messageID?: string;
|
|
126
148
|
}>;
|
|
127
|
-
export declare function getAssistantMessages(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext, opts?: {
|
|
149
|
+
export declare function getAssistantMessages(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext, opts?: {
|
|
128
150
|
limit?: number;
|
|
129
151
|
sinceMs?: number;
|
|
130
152
|
}): Promise<AssistantRawMessage[]>;
|
|
@@ -132,9 +154,9 @@ export declare function getAssistantMessages(sandboxId: string, workspaceId: str
|
|
|
132
154
|
* Ask the svc to mint a signed SSE stream URL. Returns null when unavailable
|
|
133
155
|
* (older backend / preview data plane off) → caller falls back to polling.
|
|
134
156
|
*/
|
|
135
|
-
export declare function getAssistantStreamAccess(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<StreamAccess | null>;
|
|
157
|
+
export declare function getAssistantStreamAccess(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<StreamAccess | null>;
|
|
136
158
|
export declare function extendAssistantSandboxTTL(sandboxId: string, workspaceId: string, additionalSeconds: number, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
137
|
-
export declare function sendHeartbeat(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
159
|
+
export declare function sendHeartbeat(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<void>;
|
|
138
160
|
/**
|
|
139
161
|
* Cancel the turn currently running in this sandbox session.
|
|
140
162
|
*
|
|
@@ -155,10 +177,17 @@ export declare function sendHeartbeat(sandboxId: string, workspaceId: string, se
|
|
|
155
177
|
* boolean is the sandbox's own `{ aborted: true }`, so a caller can tell
|
|
156
178
|
* "cancelled" from "asked, and something went wrong".
|
|
157
179
|
*/
|
|
158
|
-
export declare function abortAssistantTurn(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<boolean>;
|
|
159
|
-
export declare function getAssistantArtifacts(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<AssistantArtifact[]>;
|
|
160
|
-
export declare function getAssistantSession(sandboxId: string, workspaceId: string, sessionId: string, authContext: AssistantSandboxAuthContext): Promise<AssistantSessionInfo>;
|
|
161
|
-
export declare function downloadAssistantArtifact(sandboxId: string, workspaceId: string, sessionId: string, artifactPath: string,
|
|
180
|
+
export declare function abortAssistantTurn(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<boolean>;
|
|
181
|
+
export declare function getAssistantArtifacts(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<AssistantArtifact[]>;
|
|
182
|
+
export declare function getAssistantSession(sandboxId: string, workspaceId: string, sessionId: string, mode: AssistantMode, authContext: AssistantSandboxAuthContext): Promise<AssistantSessionInfo>;
|
|
183
|
+
export declare function downloadAssistantArtifact(sandboxId: string, workspaceId: string, sessionId: string, artifactPath: string,
|
|
184
|
+
/**
|
|
185
|
+
* ★ `undefined` is accepted, and forwards no user tokens. A message persisted
|
|
186
|
+
* before its metadata carried `mode` cannot say which sandbox made it.
|
|
187
|
+
* Artifacts are only ever collected for `vibe-plugins`, which needs no user
|
|
188
|
+
* token, and the download is authorised by the sandbox's proxy token.
|
|
189
|
+
*/
|
|
190
|
+
mode: AssistantMode | undefined, authContext: AssistantSandboxAuthContext): Promise<DownloadedAssistantArtifact>;
|
|
162
191
|
export declare function checkAssistantAiCredits(workspaceId: string, authContext: AssistantSandboxAuthContext): Promise<boolean>;
|
|
163
192
|
export declare function reportAssistantAiTokenUsage(workspaceId: string, sessionId: string, messageId: string, model: string | undefined, tokens: {
|
|
164
193
|
input: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,YAAY,EACb,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB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,OAAO,CAAC,oBAAoB,CAAC,CAe/B;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;AACpB;;;;;GAKG;AACH,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,2BAA2B,CAAC,CAmBtC;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,OAAO,CAAC,CASlB;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACzC,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -3,8 +3,11 @@ import { CHECK_AI_CREDITS as n, CREATE_SANDBOX as r, EXTEND_SANDBOX_TTL as i, GE
|
|
|
3
3
|
import { ASSISTANT_API_AUTH_STRATEGY as d, getImageForMode as f, getImageTagForMode as p, getResourcesForMode as m, resolveSandboxAssistantMode as h } from "./images.js";
|
|
4
4
|
import { getCapability as g, isUnknownFieldError as _, markSupported as v, markUnsupported as y } from "./capabilities.js";
|
|
5
5
|
//#region src/shared/assistant/api.ts
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
function b(e) {
|
|
7
|
+
return e === "assistant";
|
|
8
|
+
}
|
|
9
|
+
async function x(n, r, i, a, o, c, l) {
|
|
10
|
+
let u = (await t({
|
|
8
11
|
query: s,
|
|
9
12
|
operationName: "ProxySandboxRequest",
|
|
10
13
|
variables: { input: {
|
|
@@ -12,21 +15,23 @@ async function b(n, r, i, a, o, c) {
|
|
|
12
15
|
path: i,
|
|
13
16
|
method: a,
|
|
14
17
|
body: o,
|
|
15
|
-
context: e(r,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
context: e(r, l),
|
|
19
|
+
...b(c) ? {
|
|
20
|
+
forwardedAuthToken: l?.accessToken ?? void 0,
|
|
21
|
+
forwardedWorkspaceToken: l?.workspaceToken ?? void 0
|
|
22
|
+
} : {}
|
|
18
23
|
} },
|
|
19
24
|
workspaceId: r,
|
|
20
|
-
authContext:
|
|
25
|
+
authContext: l
|
|
21
26
|
})).proxySandboxRequest;
|
|
22
|
-
if (!
|
|
23
|
-
let e =
|
|
24
|
-
throw Error(e?.error ?? `Proxy error: ${
|
|
27
|
+
if (!u || u.status >= 400) {
|
|
28
|
+
let e = u?.body;
|
|
29
|
+
throw Error(e?.error ?? `Proxy error: ${u?.status ?? "unknown"}`);
|
|
25
30
|
}
|
|
26
|
-
return
|
|
31
|
+
return u.body;
|
|
27
32
|
}
|
|
28
|
-
async function
|
|
29
|
-
return
|
|
33
|
+
async function S(n, r, i, o, s, c = /* @__PURE__ */ new Set()) {
|
|
34
|
+
return C((await t({
|
|
30
35
|
query: a,
|
|
31
36
|
operationName: "GetActiveSandboxes",
|
|
32
37
|
variables: { context: e(n, s) },
|
|
@@ -34,13 +39,13 @@ async function x(n, r, i, o, s, c = /* @__PURE__ */ new Set()) {
|
|
|
34
39
|
authContext: s
|
|
35
40
|
})).getActiveSandboxes ?? [], r, i, o, s, c);
|
|
36
41
|
}
|
|
37
|
-
function
|
|
38
|
-
return e.find((e) => !a.has(e.id) && (e.status === "RUNNING" || e.status === "PROVISIONING" || e.status === "PENDING") && e.template === "AI_BUILDER" && h(e) === n && (!i.userId || e.createdBy === i.userId) && e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t && e.metadata?.imageTag === p(n, r) && (!
|
|
42
|
+
function C(e, t, n, r, i, a = /* @__PURE__ */ new Set()) {
|
|
43
|
+
return e.find((e) => !a.has(e.id) && (e.status === "RUNNING" || e.status === "PROVISIONING" || e.status === "PENDING") && e.template === "AI_BUILDER" && h(e) === n && (!i.userId || e.createdBy === i.userId) && e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t && e.metadata?.imageTag === p(n, r) && (!w(n) || e.metadata?.confirmWrites === !0))?.id ?? null;
|
|
39
44
|
}
|
|
40
|
-
function
|
|
45
|
+
function w(e) {
|
|
41
46
|
return e === "api-calls";
|
|
42
47
|
}
|
|
43
|
-
function
|
|
48
|
+
function T(e, t, n, r) {
|
|
44
49
|
let i = [
|
|
45
50
|
{
|
|
46
51
|
name: "AI_ASSISTANT_MODE",
|
|
@@ -68,13 +73,13 @@ function w(e, t, n, r) {
|
|
|
68
73
|
}), r.workspaceToken && i.push({
|
|
69
74
|
name: "WORKSPACE_AUTH_TOKEN",
|
|
70
75
|
value: r.workspaceToken
|
|
71
|
-
})),
|
|
76
|
+
})), w(t) && i.push({
|
|
72
77
|
name: "AI_ASSISTANT_CONFIRM_WRITES",
|
|
73
78
|
value: "1"
|
|
74
79
|
}), i;
|
|
75
80
|
}
|
|
76
|
-
async function
|
|
77
|
-
let l = m(i), u =
|
|
81
|
+
async function E(n, i, a, o, s, c) {
|
|
82
|
+
let l = m(i), u = T(n, i, a, c), h = (t) => ({
|
|
78
83
|
name: `ai-assistant-${i}-${Date.now()}`,
|
|
79
84
|
description: `AI Assistant sandbox (${i} mode)`,
|
|
80
85
|
template: "AI_BUILDER",
|
|
@@ -97,7 +102,7 @@ async function T(n, i, a, o, s, c) {
|
|
|
97
102
|
assistantOrganizationId: c.organizationId ?? null,
|
|
98
103
|
authStrategy: d,
|
|
99
104
|
imageTag: p(i, o),
|
|
100
|
-
confirmWrites:
|
|
105
|
+
confirmWrites: w(i)
|
|
101
106
|
},
|
|
102
107
|
context: e(a, c)
|
|
103
108
|
}), g = (e) => t({
|
|
@@ -117,7 +122,7 @@ async function T(n, i, a, o, s, c) {
|
|
|
117
122
|
if (!_?.createSandbox?.id) throw Error("createSandbox returned empty response");
|
|
118
123
|
return _.createSandbox.id;
|
|
119
124
|
}
|
|
120
|
-
async function
|
|
125
|
+
async function D(n, r, i) {
|
|
121
126
|
return (await t({
|
|
122
127
|
query: o,
|
|
123
128
|
operationName: "GetSandbox",
|
|
@@ -129,10 +134,10 @@ async function E(n, r, i) {
|
|
|
129
134
|
authContext: i
|
|
130
135
|
})).getSandbox;
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function O(e, t) {
|
|
133
138
|
if (e === "FAILED" || e === "STOPPED" || e === "EXPIRED") throw Error(t ? `Sandbox ${e.toLowerCase()}: ${t}` : `Sandbox ${e.toLowerCase()}`);
|
|
134
139
|
}
|
|
135
|
-
async function
|
|
140
|
+
async function k(n, r, i, a = 3e5) {
|
|
136
141
|
let o = Date.now();
|
|
137
142
|
if (g("waitForSandboxRunning") !== "unsupported") for (; Date.now() - o < a;) try {
|
|
138
143
|
let a = await t({
|
|
@@ -149,7 +154,7 @@ async function O(n, r, i, a = 3e5) {
|
|
|
149
154
|
v("waitForSandboxRunning");
|
|
150
155
|
let o = a.waitForSandboxRunning;
|
|
151
156
|
if (o?.status === "RUNNING") return;
|
|
152
|
-
|
|
157
|
+
O(o?.status, o?.errorMessage);
|
|
153
158
|
} catch (e) {
|
|
154
159
|
if (_(e)) {
|
|
155
160
|
y("waitForSandboxRunning");
|
|
@@ -158,17 +163,17 @@ async function O(n, r, i, a = 3e5) {
|
|
|
158
163
|
throw e;
|
|
159
164
|
}
|
|
160
165
|
for (; Date.now() - o < a;) {
|
|
161
|
-
let e = await
|
|
166
|
+
let e = await D(n, r, i);
|
|
162
167
|
if (e?.status === "RUNNING") return;
|
|
163
|
-
|
|
168
|
+
O(e?.status, e?.errorMessage), await new Promise((e) => setTimeout(e, 2e3));
|
|
164
169
|
}
|
|
165
170
|
throw Error("Sandbox startup timed out");
|
|
166
171
|
}
|
|
167
|
-
async function
|
|
168
|
-
let
|
|
169
|
-
for (; Date.now() -
|
|
172
|
+
async function A(e, t, n, r, i = 9e4) {
|
|
173
|
+
let a = Date.now();
|
|
174
|
+
for (; Date.now() - a < i;) {
|
|
170
175
|
try {
|
|
171
|
-
await
|
|
176
|
+
await x(e, t, "/health", "GET", void 0, n, r);
|
|
172
177
|
return;
|
|
173
178
|
} catch (e) {
|
|
174
179
|
let t = e instanceof Error ? e.message : String(e);
|
|
@@ -178,21 +183,21 @@ async function k(e, t, n, r = 9e4) {
|
|
|
178
183
|
}
|
|
179
184
|
throw Error("Assistant service did not become healthy before timeout");
|
|
180
185
|
}
|
|
181
|
-
async function A(e, t, n, r) {
|
|
182
|
-
return { sessionId: (await b(e, t, "/sessions", "POST", { mode: n }, r)).session.id };
|
|
183
|
-
}
|
|
184
186
|
async function j(e, t, n, r) {
|
|
185
|
-
|
|
186
|
-
if (i?.approved !== !0) throw Error(typeof i?.error == "string" ? i.error : "The change could not be approved. It may have expired — ask the assistant to try again.");
|
|
187
|
+
return { sessionId: (await x(e, t, "/sessions", "POST", { mode: n }, n, r)).session.id };
|
|
187
188
|
}
|
|
188
|
-
function M(e, t, n, r, i) {
|
|
189
|
+
async function M(e, t, n, r, i) {
|
|
190
|
+
let a = await x(e, t, `/write-confirmations/${encodeURIComponent(n)}/approve`, "POST", {}, r, i);
|
|
191
|
+
if (a?.approved !== !0) throw Error(typeof a?.error == "string" ? a.error : "The change could not be approved. It may have expired — ask the assistant to try again.");
|
|
192
|
+
}
|
|
193
|
+
function N(e, t, n, r, i) {
|
|
189
194
|
let a = p(n, r);
|
|
190
195
|
return e.filter((e) => e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t && (!i.userId || e.createdBy === i.userId) && !(h(e) === n && e.metadata?.imageTag === a)).map((e) => e.id);
|
|
191
196
|
}
|
|
192
|
-
async function
|
|
197
|
+
async function P(n, r, i, o, s) {
|
|
193
198
|
let c;
|
|
194
199
|
try {
|
|
195
|
-
c =
|
|
200
|
+
c = N((await t({
|
|
196
201
|
query: a,
|
|
197
202
|
operationName: "GetActiveSandboxes",
|
|
198
203
|
variables: { context: e(n, s) },
|
|
@@ -204,13 +209,13 @@ async function N(n, r, i, o, s) {
|
|
|
204
209
|
}
|
|
205
210
|
return (await Promise.all(c.map(async (e) => {
|
|
206
211
|
try {
|
|
207
|
-
return await
|
|
212
|
+
return await F(e, n, s), e;
|
|
208
213
|
} catch {
|
|
209
214
|
return null;
|
|
210
215
|
}
|
|
211
216
|
}))).filter((e) => e !== null);
|
|
212
217
|
}
|
|
213
|
-
async function
|
|
218
|
+
async function F(n, r, i) {
|
|
214
219
|
await t({
|
|
215
220
|
query: l,
|
|
216
221
|
operationName: "StopAssistantSandbox",
|
|
@@ -222,7 +227,7 @@ async function P(n, r, i) {
|
|
|
222
227
|
authContext: i
|
|
223
228
|
});
|
|
224
229
|
}
|
|
225
|
-
function
|
|
230
|
+
function I(e) {
|
|
226
231
|
let { mode: t, prompt: n, pageContext: r, parts: i } = e, a = {
|
|
227
232
|
mode: t,
|
|
228
233
|
prompt: n,
|
|
@@ -230,34 +235,34 @@ function F(e) {
|
|
|
230
235
|
};
|
|
231
236
|
return i && i.length > 0 && (a.parts = i), a;
|
|
232
237
|
}
|
|
233
|
-
async function
|
|
234
|
-
let c = await
|
|
238
|
+
async function L(e, t, n, r, i, a, o, s) {
|
|
239
|
+
let c = await x(e, t, `/sessions/${n}/prompt-async`, "POST", I({
|
|
235
240
|
mode: i,
|
|
236
241
|
prompt: r,
|
|
237
242
|
pageContext: a,
|
|
238
243
|
parts: s?.parts
|
|
239
|
-
}), o);
|
|
244
|
+
}), i, o);
|
|
240
245
|
return { messageID: typeof c.messageID == "string" ? c.messageID : void 0 };
|
|
241
246
|
}
|
|
242
|
-
async function
|
|
243
|
-
let
|
|
244
|
-
|
|
245
|
-
let
|
|
246
|
-
return typeof
|
|
247
|
+
async function R(e, t, n, r, i, a) {
|
|
248
|
+
let o = `/sessions/${n}/messages?limit=${a?.limit ?? 50}`;
|
|
249
|
+
a?.sinceMs && g("sinceParam") !== "unsupported" && (o += `&since=${a.sinceMs}`);
|
|
250
|
+
let s = await x(e, t, o, "GET", void 0, r, i);
|
|
251
|
+
return typeof s.now == "number" && v("sinceParam"), s.messages ?? [];
|
|
247
252
|
}
|
|
248
|
-
async function
|
|
253
|
+
async function z(e, t, n, r, i) {
|
|
249
254
|
if (g("sse") === "unsupported") return null;
|
|
250
255
|
try {
|
|
251
|
-
let
|
|
252
|
-
return typeof
|
|
253
|
-
url:
|
|
254
|
-
expiresAt:
|
|
256
|
+
let a = await x(e, t, `/sessions/${n}/stream-url`, "GET", void 0, r, i);
|
|
257
|
+
return typeof a.url == "string" && typeof a.expiresAt == "number" ? (v("sse"), {
|
|
258
|
+
url: a.url,
|
|
259
|
+
expiresAt: a.expiresAt
|
|
255
260
|
}) : (y("sse"), null);
|
|
256
261
|
} catch {
|
|
257
262
|
return y("sse"), null;
|
|
258
263
|
}
|
|
259
264
|
}
|
|
260
|
-
async function
|
|
265
|
+
async function B(n, r, a, o) {
|
|
261
266
|
await t({
|
|
262
267
|
query: i,
|
|
263
268
|
operationName: "ExtendSandboxTtl",
|
|
@@ -270,36 +275,36 @@ async function z(n, r, a, o) {
|
|
|
270
275
|
authContext: o
|
|
271
276
|
});
|
|
272
277
|
}
|
|
273
|
-
async function
|
|
274
|
-
await
|
|
278
|
+
async function V(e, t, n, r, i) {
|
|
279
|
+
await x(e, t, `/sessions/${n}/heartbeat`, "POST", void 0, r, i).catch(() => void 0);
|
|
275
280
|
}
|
|
276
|
-
async function
|
|
281
|
+
async function H(e, t, n, r, i) {
|
|
277
282
|
try {
|
|
278
|
-
return (await
|
|
283
|
+
return (await x(e, t, `/sessions/${n}/abort`, "POST", void 0, r, i))?.aborted === !0;
|
|
279
284
|
} catch {
|
|
280
285
|
return !1;
|
|
281
286
|
}
|
|
282
287
|
}
|
|
283
|
-
async function
|
|
284
|
-
return ((await
|
|
288
|
+
async function U(e, t, n, r, i) {
|
|
289
|
+
return ((await x(e, t, `/sessions/${n}/artifacts`, "GET", void 0, r, i)).artifacts ?? []).filter((e) => !e.name.startsWith("."));
|
|
285
290
|
}
|
|
286
|
-
async function
|
|
287
|
-
let
|
|
291
|
+
async function W(e, t, n, r, i) {
|
|
292
|
+
let a = await x(e, t, `/sessions/${n}`, "GET", void 0, r, i);
|
|
288
293
|
return {
|
|
289
|
-
id:
|
|
290
|
-
mode:
|
|
294
|
+
id: a.session?.id ?? n,
|
|
295
|
+
mode: a.mode ?? "unknown"
|
|
291
296
|
};
|
|
292
297
|
}
|
|
293
|
-
async function
|
|
294
|
-
let
|
|
295
|
-
if (!
|
|
298
|
+
async function G(e, t, n, r, i, a) {
|
|
299
|
+
let o = (await x(e, t, `/sessions/${n}/artifacts/download?path=${encodeURIComponent(r)}`, "GET", void 0, i, a)).artifact;
|
|
300
|
+
if (!o) throw Error("Artifact download returned an empty response");
|
|
296
301
|
return {
|
|
297
|
-
filename:
|
|
298
|
-
mimeType:
|
|
299
|
-
contentBase64:
|
|
302
|
+
filename: o.filename,
|
|
303
|
+
mimeType: o.mimeType,
|
|
304
|
+
contentBase64: o.contentBase64
|
|
300
305
|
};
|
|
301
306
|
}
|
|
302
|
-
async function
|
|
307
|
+
async function K(e, r) {
|
|
303
308
|
return (await t({
|
|
304
309
|
query: n,
|
|
305
310
|
operationName: "CheckAiCredits",
|
|
@@ -308,7 +313,7 @@ async function G(e, r) {
|
|
|
308
313
|
authContext: r
|
|
309
314
|
})).checkAiCredits;
|
|
310
315
|
}
|
|
311
|
-
async function
|
|
316
|
+
async function q(e, n, r, i, a, o) {
|
|
312
317
|
let s = Math.max(0, Math.round(a.input ?? 0)), l = Math.max(0, Math.round(a.output ?? 0));
|
|
313
318
|
s + l === 0 || !i || await t({
|
|
314
319
|
query: c,
|
|
@@ -325,4 +330,4 @@ async function K(e, n, r, i, a, o) {
|
|
|
325
330
|
});
|
|
326
331
|
}
|
|
327
332
|
//#endregion
|
|
328
|
-
export {
|
|
333
|
+
export { H as abortAssistantTurn, M as approvePendingWrite, T as buildAssistantSandboxEnv, I as buildPromptRequestBody, K as checkAssistantAiCredits, E as createAssistantSandbox, j as createAssistantSession, G as downloadAssistantArtifact, B as extendAssistantSandboxTTL, S as findExistingSandbox, b as forwardsUserTokensToSandbox, U as getAssistantArtifacts, R as getAssistantMessages, W as getAssistantSession, z as getAssistantStreamAccess, w as modeRequiresConfirmWrites, P as releaseSupersededAssistantSandboxes, q as reportAssistantAiTokenUsage, C as selectExistingAssistantSandbox, N as selectSupersededAssistantSandboxes, L as sendAssistantPromptAsync, V as sendHeartbeat, F as stopReapedAssistantSandbox, A as waitForAssistantServiceReady, k as waitForSandboxRunning };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAGV,2BAA2B,EAE3B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,2BAA2B,CAAC;IAClD,cAAc,EAAE,MAAM,MAAM,CAAC;CAC9B;AAYD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,aAAa,GAClB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAGV,2BAA2B,EAE3B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,2BAA2B,CAAC;IAClD,cAAc,EAAE,MAAM,MAAM,CAAC;CAC9B;AAYD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,aAAa,GAClB,yBAAyB,CA+L3B"}
|
|
@@ -27,7 +27,7 @@ function v(v, y) {
|
|
|
27
27
|
T.startKeepWarm();
|
|
28
28
|
let u = Date.now();
|
|
29
29
|
await a(o, t, l, e.prompt, b, E(), s, e.parts?.length ? { parts: e.parts } : void 0);
|
|
30
|
-
let p = null, _ = null, y = await r(o, t, l, s).catch(() => null);
|
|
30
|
+
let p = null, _ = null, y = await r(o, t, l, b, s).catch(() => null);
|
|
31
31
|
if (y && typeof EventSource < "u") try {
|
|
32
32
|
_ = new EventSource(y.url);
|
|
33
33
|
let e = () => {
|
|
@@ -53,7 +53,7 @@ function v(v, y) {
|
|
|
53
53
|
}), C = u + x, D = [], O = c([], u), k = u;
|
|
54
54
|
for (; Date.now() < C;) {
|
|
55
55
|
if (e.signal.aborted) throw Error("Cancelled");
|
|
56
|
-
let r = await n(o, t, l, s, { sinceMs: k });
|
|
56
|
+
let r = await n(o, t, l, b, s, { sinceMs: k });
|
|
57
57
|
D = d(D, r);
|
|
58
58
|
for (let e of r) {
|
|
59
59
|
let t = e.info?.time?.created;
|
|
@@ -64,7 +64,7 @@ function v(v, y) {
|
|
|
64
64
|
await (_ ? S(i) : new Promise((e) => setTimeout(e, i)));
|
|
65
65
|
}
|
|
66
66
|
if (_?.close(), !O.done) throw Error("The assistant timed out while responding. Please try again.");
|
|
67
|
-
let A = await n(o, t, l, s, { limit: 50 }).catch(() => D), j = c(d(D, A), u);
|
|
67
|
+
let A = await n(o, t, l, b, s, { limit: 50 }).catch(() => D), j = c(d(D, A), u);
|
|
68
68
|
if (w) {
|
|
69
69
|
let e = A.filter((e) => e.info?.role === "assistant").sort((e, t) => (t.info?.time?.created ?? 0) - (e.info?.time?.created ?? 0))[0], n = e?.info?.tokens, r = e?.info?.providerID && e?.info?.modelID ? `${e.info.providerID}/${e.info.modelID}` : void 0;
|
|
70
70
|
e?.info?.id && n && i(t, l, e.info.id, r, n, s).then(() => v.onCreditsUpdated?.()).catch(() => void 0);
|
|
@@ -204,6 +204,8 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
204
204
|
readonly "message.stopSpeakingShort": "Stop";
|
|
205
205
|
readonly "messageList.ariaLabel": "Conversation messages";
|
|
206
206
|
readonly "modeSelector.ariaLabel": "Select assistant mode";
|
|
207
|
+
readonly "overlay.launcher": "AI Assistant";
|
|
208
|
+
readonly "overlay.launcherTitle": "AI Assistant ({{shortcut}})";
|
|
207
209
|
readonly "panel.ariaLabel": "AI Assistant";
|
|
208
210
|
readonly "pendingWrite.approve": "Approve this change";
|
|
209
211
|
readonly "pendingWrite.approvedPrompt": "I approved that change — go ahead.";
|
|
@@ -216,6 +218,8 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
216
218
|
readonly "preview.close": "Close preview";
|
|
217
219
|
readonly "preview.failed": "The preview could not be displayed.";
|
|
218
220
|
readonly "preview.title": "Preview";
|
|
221
|
+
readonly "sheet.collapse": "Shrink the assistant";
|
|
222
|
+
readonly "sheet.expand": "Expand the assistant";
|
|
219
223
|
readonly "speech.codeBlock": "Code block";
|
|
220
224
|
readonly "speech.emailAt": "at";
|
|
221
225
|
readonly "speech.emailDot": "dot";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/i18nManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQ1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/i18nManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,m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M,EAAE,MAAM,CAAC,CAiCzB"}
|
|
@@ -98,6 +98,8 @@ var l = {
|
|
|
98
98
|
"message.stopSpeakingShort": "Stop",
|
|
99
99
|
"messageList.ariaLabel": "Conversation messages",
|
|
100
100
|
"modeSelector.ariaLabel": "Select assistant mode",
|
|
101
|
+
"overlay.launcher": "AI Assistant",
|
|
102
|
+
"overlay.launcherTitle": "AI Assistant ({{shortcut}})",
|
|
101
103
|
"panel.ariaLabel": "AI Assistant",
|
|
102
104
|
"pendingWrite.approve": "Approve this change",
|
|
103
105
|
"pendingWrite.approvedPrompt": "I approved that change — go ahead.",
|
|
@@ -110,6 +112,8 @@ var l = {
|
|
|
110
112
|
"preview.close": "Close preview",
|
|
111
113
|
"preview.failed": "The preview could not be displayed.",
|
|
112
114
|
"preview.title": "Preview",
|
|
115
|
+
"sheet.collapse": "Shrink the assistant",
|
|
116
|
+
"sheet.expand": "Expand the assistant",
|
|
113
117
|
"speech.codeBlock": "Code block",
|
|
114
118
|
"speech.emailAt": "at",
|
|
115
119
|
"speech.emailDot": "dot",
|
|
@@ -154,4 +154,6 @@ export * from './useAssistantKeyboardShortcuts';
|
|
|
154
154
|
export * from './ui/AssistantApiCallsConsentDialog';
|
|
155
155
|
export * from './ui/AssistantChatArea';
|
|
156
156
|
export * from './ui/AIAssistantPanel';
|
|
157
|
+
export * from './ui/assistantOverlayState';
|
|
158
|
+
export * from './ui/AssistantOverlay';
|
|
157
159
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC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I;IAYjE,kFAAkF;IAClF,aAAa,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAsFlE,gFAAgF;IAChF,OAAO,CAAC,KAAK,GAAE,YAAqB,GAAG,IAAI;IAkC3C,+EAA+E;IAC/E,aAAa,IAAI,IAAI;IAwCrB,YAAY,IAAI,IAAI;IAWpB,YAAY,IAAI,MAAM,GAAG,IAAI;CAG9B"}
|
|
@@ -45,7 +45,7 @@ var s = 240 * 1e3, c = class {
|
|
|
45
45
|
if (!i.accessToken) throw Error("The assistant requires an authenticated session. Please sign in again.");
|
|
46
46
|
c = await e(this.deps.product, this.deps.mode, n, s, this.deps.ttlSeconds, i);
|
|
47
47
|
}
|
|
48
|
-
this.provisioningSandboxId = c, await o(c, n, i), await a(c, n, i), this.sandboxId = c, this.provisioningSandboxId = null;
|
|
48
|
+
this.provisioningSandboxId = c, await o(c, n, i), await a(c, n, this.deps.mode, i), this.sandboxId = c, this.provisioningSandboxId = null;
|
|
49
49
|
}
|
|
50
50
|
let l = this.sessionId;
|
|
51
51
|
return l || (l = (await t(c, n, this.deps.mode, i)).sessionId, this.sessionId = l), this.persist(), {
|
|
@@ -66,7 +66,7 @@ var s = 240 * 1e3, c = class {
|
|
|
66
66
|
if (this.sandboxId || this.inFlight) return;
|
|
67
67
|
let e = this.deps.getAuthContext();
|
|
68
68
|
r(t, this.deps.product, this.deps.mode, this.deps.isProd(), e, this.quarantinedSandboxIds).then(async (n) => {
|
|
69
|
-
n && (await a(n, t, e).catch(() => void 0), this.sandboxId = n, this.persist());
|
|
69
|
+
n && (await a(n, t, this.deps.mode, e).catch(() => void 0), this.sandboxId = n, this.persist());
|
|
70
70
|
}).catch(() => void 0);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
@@ -80,7 +80,7 @@ var s = 240 * 1e3, c = class {
|
|
|
80
80
|
let e = this.deps.getWorkspaceId();
|
|
81
81
|
if (!e) return;
|
|
82
82
|
let t = this.deps.getAuthContext();
|
|
83
|
-
n(this.sandboxId, e, this.deps.ttlSeconds, t).catch(() => void 0), this.sessionId && i(this.sandboxId, e, this.sessionId, t);
|
|
83
|
+
n(this.sandboxId, e, this.deps.ttlSeconds, t).catch(() => void 0), this.sessionId && i(this.sandboxId, e, this.sessionId, this.deps.mode, t);
|
|
84
84
|
};
|
|
85
85
|
this.keepWarmTimer = setInterval(e, s), this.visibilityHandler = () => {
|
|
86
86
|
typeof document < "u" && document.visibilityState === "visible" && e();
|
|
@@ -105,6 +105,25 @@ interface AssistantState {
|
|
|
105
105
|
/** `null` clears the pick for that language, restoring the ranked default. */
|
|
106
106
|
setPreferredVoice: (languageCode: string, voiceName: string | null) => void;
|
|
107
107
|
}
|
|
108
|
+
/** The sandbox a request addresses, with the mode it was provisioned for. */
|
|
109
|
+
export interface AssistantModeSandboxTarget {
|
|
110
|
+
sandboxId: string;
|
|
111
|
+
mode: AssistantMode;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The sandbox of the panel's CURRENT mode, paired with that mode.
|
|
115
|
+
*
|
|
116
|
+
* ★★ BOFF-7316: the two are returned together so a caller cannot pass one
|
|
117
|
+
* sandbox and a different mode. The mode decides whether the user's own tokens
|
|
118
|
+
* are forwarded (`forwardsUserTokensToSandbox`); a sandbox id taken from
|
|
119
|
+
* anywhere else — a message's metadata, another mode's slot — would pair an Ask
|
|
120
|
+
* mode with a Build sandbox, or the reverse, and send the tokens to a sandbox
|
|
121
|
+
* that must never hold them. `null` when that mode has no sandbox yet.
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveActiveModeSandbox(state: {
|
|
124
|
+
mode: AssistantMode;
|
|
125
|
+
sandboxesByMode: Partial<Record<AssistantMode, AssistantSandboxRuntime>>;
|
|
126
|
+
}): AssistantModeSandboxTarget | null;
|
|
108
127
|
export declare const useAssistantStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<AssistantState>, "setState" | "persist"> & {
|
|
109
128
|
setState(partial: AssistantState | Partial<AssistantState> | ((state: AssistantState) => AssistantState | Partial<AssistantState>), replace?: false | undefined): unknown;
|
|
110
129
|
setState(state: AssistantState | ((state: AssistantState) => AssistantState), replace: true): unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACR,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,UAAU,cAAc;IACtB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;IAC5E,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+CAA+C;IAC/C,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACzE;;;;;OAKG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;;;;OAOG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;;;;;OAUG;IACH,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGxC,kBAAkB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAA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