@astralbeam/sdk 0.17.0 → 0.18.0
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/README.md +8 -1
- package/dist/{api-BaIPbj-Q.js → api-B3UxSTtl.js} +135 -1
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -2
- package/dist/auth-lifecycle-B0BXyDr7.js +25 -0
- package/dist/badge-B9WuChHI.js +1 -0
- package/dist/client.d.ts +57 -8
- package/dist/client.js +1 -1
- package/dist/constants-C-Yp0Vhg.js +1 -0
- package/dist/{core-DeMY6_wQ.js → core-CLWlvgYl.js} +203 -72
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -2
- package/dist/css-BGIxQoYs.js +1 -0
- package/dist/css-DgaLhXQH.js +1 -0
- package/dist/{debug-qLts7gEt.js → debug-DLDY8CZb.js} +1 -1
- package/dist/diff-woXpYk--.js +1 -0
- package/dist/github-dark-C-LZuMrd.js +1 -0
- package/dist/github-light-EUqPIrTm.js +1 -0
- package/dist/highlighter-Bd_oZUcA.js +152 -0
- package/dist/html-B3xvRgDO.js +1 -0
- package/dist/{index-NT05_Yw_.d.ts → index-DDfmeUeU.d.ts} +76 -50
- package/dist/{index-CfGnT6Od.d.ts → index-DFxtXIXy.d.ts} +104 -3
- package/dist/item-a9y_9nk7.js +1 -0
- package/dist/javascript-BzbQS41l.js +1 -0
- package/dist/javascript-CpIGwZ_Y.js +1 -0
- package/dist/json-qhed-kSA.js +1 -0
- package/dist/jsx-Bz0zcwM4.js +1 -0
- package/dist/listings-DzxJtGCD.js +1 -0
- package/dist/markdown-BYOwaDjH.js +1 -0
- package/dist/mcp-servers-ESbOt00F.js +1 -0
- package/dist/python-gzcpVVnB.js +1 -0
- package/dist/react.d.ts +23 -16
- package/dist/react.js +46 -8
- package/dist/server.d.ts +14 -26
- package/dist/server.js +190 -347
- package/dist/shellscript-CLZ0U2zV.js +1 -0
- package/dist/sql-CEbI0hMM.js +1 -0
- package/dist/styles.generated-D4k7izMB.js +80 -0
- package/dist/tsx-udAQXfEw.js +1 -0
- package/dist/typescript-bsJCZSQ-.js +1 -0
- package/dist/validate-BOw-BAyv.js +140 -0
- package/dist/widget-DGmCPqzk.js +24 -0
- package/dist/yaml-rwi0_p6S.js +1 -0
- package/package.json +18 -15
- package/dist/constants-enyqxaJi.js +0 -1
- package/dist/listings-BH_hPkxx.js +0 -1
- package/dist/rolldown-runtime-QTnfLwEv.js +0 -1
- package/dist/styles.generated-D8sDOLu3.js +0 -98
- package/dist/type_checks-C-WTHaWs.js +0 -117
- package/dist/widget-BdiuWvPf.js +0 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ct as
|
|
2
|
-
import {
|
|
1
|
+
import { A as getCurrentUser, At as personalMcpTestConnection, Bt as astralBeamChatFetch, C as getChatConfig, Ct as personalMcpAuthorizeConnection, Dt as personalMcpDisconnectConnection, Et as personalMcpCreateConnection, Ht as resolveApiUrl, It as updateChatThread, Ot as personalMcpGetCatalog, S as getChatAttachment, Tt as personalMcpCompleteAuthorization, Vt as isAstralBeamApiError, at as getResolveChatToolResultUrl, gt as listChatMessages, kt as personalMcpSetHeaders, ot as getRunChatUrl, v as createChatThread, vt as listChatThreads, w as getChatFile, wt as personalMcpBindBrowser, x as deleteChatThread, zt as uploadChatFile } from "./api-B3UxSTtl.js";
|
|
2
|
+
import { _ as strictDecoder, i as isObject, l as decode, p as JWTInvalid } from "./validate-BOw-BAyv.js";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
5
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
6
6
|
var __exportAll = (all, no_symbols) => {
|
|
7
7
|
let target = {};
|
|
8
8
|
for (var name in all) __defProp(target, name, {
|
|
@@ -13,9 +13,9 @@ var __exportAll = (all, no_symbols) => {
|
|
|
13
13
|
return target;
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region node_modules/.
|
|
16
|
+
//#region ../node_modules/.bun/jose@6.2.12/node_modules/jose/dist/webapi/util/decode_jwt.js
|
|
17
17
|
function decodeJwt(jwt) {
|
|
18
|
-
if (typeof jwt
|
|
18
|
+
if (typeof jwt != "string") throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
19
19
|
const { 1: payload, length } = jwt.split(".");
|
|
20
20
|
if (length === 5) throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");
|
|
21
21
|
if (length !== 3) throw new JWTInvalid("Invalid JWT");
|
|
@@ -36,7 +36,7 @@ function decodeJwt(jwt) {
|
|
|
36
36
|
return result;
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region node_modules/.
|
|
39
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/response-stream.js
|
|
40
40
|
var UnsupportedResponseStreamError = class extends Error {
|
|
41
41
|
missingFeature;
|
|
42
42
|
constructor(missingFeature) {
|
|
@@ -58,14 +58,14 @@ function createResponseStreamTextDecoder() {
|
|
|
58
58
|
return new globalThis.TextDecoder();
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region node_modules/.
|
|
61
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/sse-utils.js
|
|
62
62
|
function parseSseDataLine(line) {
|
|
63
63
|
if (!line.startsWith("data:")) return line;
|
|
64
64
|
const data = line.slice(5);
|
|
65
65
|
return data.startsWith(" ") ? data.slice(1) : data;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region node_modules/.
|
|
68
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/message-date-normalizer.js
|
|
69
69
|
function validDate(value) {
|
|
70
70
|
if (value instanceof Date) return Number.isNaN(value.getTime()) ? void 0 : value;
|
|
71
71
|
if (typeof value !== "string") return void 0;
|
|
@@ -97,7 +97,7 @@ function normalizeMessagesDates(messages) {
|
|
|
97
97
|
return messages.map(normalizeMessageDates);
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
|
-
//#region node_modules/.
|
|
100
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.js
|
|
101
101
|
function definedDetails(value) {
|
|
102
102
|
return Object.keys(value).length > 0 ? value : void 0;
|
|
103
103
|
}
|
|
@@ -142,7 +142,7 @@ function fromSpecTokenUsage(usage, leftover) {
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
|
-
//#region node_modules/.
|
|
145
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/merge-metadata.js
|
|
146
146
|
function isPlainRecord$1(value) {
|
|
147
147
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
148
148
|
}
|
|
@@ -182,7 +182,7 @@ function withTanstackMetadata(value, tanstack) {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
|
-
//#region node_modules/.
|
|
185
|
+
//#region ../node_modules/.bun/@ag-ui+core@1.0.0+969a6d035afea0f4/node_modules/@ag-ui/core/dist/version-CTNE2I0_.mjs
|
|
186
186
|
/**
|
|
187
187
|
* The discriminator carried by every event.
|
|
188
188
|
*/
|
|
@@ -221,7 +221,7 @@ let EventType = /* @__PURE__ */ function(EventType) {
|
|
|
221
221
|
return EventType;
|
|
222
222
|
}({});
|
|
223
223
|
//#endregion
|
|
224
|
-
//#region node_modules/.
|
|
224
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/reasoning-encrypted-value.js
|
|
225
225
|
/**
|
|
226
226
|
* Id prefix for the reasoning message of a redacted thinking block (Anthropic
|
|
227
227
|
* `redacted_thinking`). AG-UI's `encryptedValue` does not say what kind of
|
|
@@ -233,7 +233,7 @@ function isRedactedThinkingId(id) {
|
|
|
233
233
|
return typeof id === "string" && id.startsWith("redacted_thinking-");
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region node_modules/.
|
|
236
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/interrupt-serialization.js
|
|
237
237
|
var SHA256_K = new Uint32Array([
|
|
238
238
|
1116352408,
|
|
239
239
|
1899447441,
|
|
@@ -408,7 +408,7 @@ function cloneAndDeepFreezeJson(value) {
|
|
|
408
408
|
return clone;
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
|
-
//#region node_modules/.
|
|
411
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/interrupts.js
|
|
412
412
|
function canonicalizeInterruptResolutions(resolutions) {
|
|
413
413
|
const frozen = cloneAndDeepFreezeJson([...resolutions].sort((left, right) => left.interruptId.localeCompare(right.interruptId)));
|
|
414
414
|
const canonicalResolutions = canonicalInterruptJson(frozen);
|
|
@@ -419,7 +419,7 @@ function canonicalizeInterruptResolutions(resolutions) {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
//#endregion
|
|
422
|
-
//#region node_modules/.
|
|
422
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/schema-converter.js
|
|
423
423
|
/**
|
|
424
424
|
* Build a JSONSchema object from any plain key/value source. The `JSONSchema`
|
|
425
425
|
* interface's `[key: string]: any` index signature makes every property
|
|
@@ -687,7 +687,7 @@ async function validateWithStandardSchema(schema, data) {
|
|
|
687
687
|
};
|
|
688
688
|
}
|
|
689
689
|
//#endregion
|
|
690
|
-
//#region node_modules/.
|
|
690
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/approval-schema.js
|
|
691
691
|
var jsonSchemaKeywords = /* @__PURE__ */ new Set([
|
|
692
692
|
"$schema",
|
|
693
693
|
"$id",
|
|
@@ -763,13 +763,15 @@ function normalizeApprovalSchema(approvalSchema, inputSchema) {
|
|
|
763
763
|
const normalizedInput = inputSchema === void 0 ? null : schemaToWire(inputSchema);
|
|
764
764
|
let approve = null;
|
|
765
765
|
let reject = null;
|
|
766
|
-
if (approvalSchema !== void 0)
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
766
|
+
if (approvalSchema !== void 0) {
|
|
767
|
+
if (isStandardSchema(approvalSchema) || isRawJsonSchema(approvalSchema)) {
|
|
768
|
+
approve = schemaToWire(approvalSchema);
|
|
769
|
+
reject = approve;
|
|
770
|
+
} else if (isApprovalBranchMap(approvalSchema)) {
|
|
771
|
+
approve = approvalSchema.approve === void 0 ? null : schemaToWire(approvalSchema.approve);
|
|
772
|
+
reject = approvalSchema.reject === void 0 ? null : schemaToWire(approvalSchema.reject);
|
|
773
|
+
} else throw new TypeError("approvalSchema must be a SchemaInput or a nonempty map containing approve or reject.");
|
|
774
|
+
}
|
|
773
775
|
const responseSchema = { oneOf: [decisionEnvelope({
|
|
774
776
|
approved: true,
|
|
775
777
|
payload: approve,
|
|
@@ -799,7 +801,7 @@ function hashSchemaInput(schema) {
|
|
|
799
801
|
return digestInterruptJson(canonicalInterruptJson(schemaToWire(schema).jsonSchema ?? { standardValidator: "unserialized" }));
|
|
800
802
|
}
|
|
801
803
|
//#endregion
|
|
802
|
-
//#region node_modules/.
|
|
804
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/interrupt-resume.js
|
|
803
805
|
/**
|
|
804
806
|
* The `Interrupt.metadata` key under which this package's resume binding
|
|
805
807
|
* travels.
|
|
@@ -920,7 +922,7 @@ function readInterruptBinding(descriptor) {
|
|
|
920
922
|
};
|
|
921
923
|
}
|
|
922
924
|
//#endregion
|
|
923
|
-
//#region node_modules/.
|
|
925
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/interrupt-definition.js
|
|
924
926
|
var INTERRUPT_PAYLOAD_METADATA_KEY = "tanstack:interruptPayload";
|
|
925
927
|
function schemaJson(schema, name) {
|
|
926
928
|
if (!isStandardJSONSchema(schema)) throw new TypeError(`${name} must be a Standard Schema with a JSON Schema converter.`);
|
|
@@ -945,7 +947,7 @@ function hashInterruptDefinitionSchema(schema) {
|
|
|
945
947
|
return digestInterruptJson(schemaJson(schema, "Interrupt schema").canonicalJson);
|
|
946
948
|
}
|
|
947
949
|
//#endregion
|
|
948
|
-
//#region node_modules/.
|
|
950
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/generic-interrupt-continuation.js
|
|
949
951
|
/**
|
|
950
952
|
* `ResumeEntry.metadata` key for a first-party generic request.
|
|
951
953
|
*
|
|
@@ -984,7 +986,7 @@ function genericInterruptContinuationFromDescriptor(interrupt) {
|
|
|
984
986
|
};
|
|
985
987
|
}
|
|
986
988
|
//#endregion
|
|
987
|
-
//#region node_modules/.
|
|
989
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/provider-executed.js
|
|
988
990
|
/**
|
|
989
991
|
* Narrow a tool call's opaque `metadata` to the provider-executed convention.
|
|
990
992
|
* Returns the typed metadata when the call is provider-executed, else `null`.
|
|
@@ -1014,7 +1016,7 @@ function isAssistantSegmentOf(id, parentId) {
|
|
|
1014
1016
|
return id?.startsWith(`${parentId}-segment-`) === true;
|
|
1015
1017
|
}
|
|
1016
1018
|
//#endregion
|
|
1017
|
-
//#region node_modules/.
|
|
1019
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/tool-result.js
|
|
1018
1020
|
var CONTENT_PART_TYPES = /* @__PURE__ */ new Set([
|
|
1019
1021
|
"text",
|
|
1020
1022
|
"image",
|
|
@@ -1075,7 +1077,7 @@ function normalizeToolResult(result) {
|
|
|
1075
1077
|
return JSON.stringify(result);
|
|
1076
1078
|
}
|
|
1077
1079
|
//#endregion
|
|
1078
|
-
//#region node_modules/.
|
|
1080
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/subagent-wire.js
|
|
1079
1081
|
function isRecord$2(value) {
|
|
1080
1082
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1081
1083
|
}
|
|
@@ -1179,7 +1181,7 @@ function splitSubagentWire(messages) {
|
|
|
1179
1181
|
};
|
|
1180
1182
|
}
|
|
1181
1183
|
//#endregion
|
|
1182
|
-
//#region node_modules/.
|
|
1184
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/messages.js
|
|
1183
1185
|
function isRecord$1(value) {
|
|
1184
1186
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1185
1187
|
}
|
|
@@ -1847,7 +1849,7 @@ function generateMessageId() {
|
|
|
1847
1849
|
return `msg-${Date.now()}-${Math.random().toString(36).substring(7)}`;
|
|
1848
1850
|
}
|
|
1849
1851
|
//#endregion
|
|
1850
|
-
//#region node_modules/.
|
|
1852
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-wire.js
|
|
1851
1853
|
function isRecord(value) {
|
|
1852
1854
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1853
1855
|
}
|
|
@@ -1937,14 +1939,15 @@ function uiMessagesToWire(messages, options) {
|
|
|
1937
1939
|
parts: []
|
|
1938
1940
|
};
|
|
1939
1941
|
const segments = [current];
|
|
1940
|
-
for (const part of parts) if (part.type === "thinking")
|
|
1941
|
-
current
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1942
|
+
for (const part of parts) if (part.type === "thinking") {
|
|
1943
|
+
if (current.parts.some((p) => p.type === "tool-call" && isProviderExecutedToolCall(p))) {
|
|
1944
|
+
current = {
|
|
1945
|
+
thinking: [part],
|
|
1946
|
+
parts: []
|
|
1947
|
+
};
|
|
1948
|
+
segments.push(current);
|
|
1949
|
+
} else current.thinking.push(part);
|
|
1950
|
+
} else current.parts.push(part);
|
|
1948
1951
|
segments.forEach((segment, index) => {
|
|
1949
1952
|
for (const part of segment.thinking) {
|
|
1950
1953
|
const reasoning = {
|
|
@@ -2181,7 +2184,7 @@ function hashContent(s) {
|
|
|
2181
2184
|
return Math.abs(h).toString(36);
|
|
2182
2185
|
}
|
|
2183
2186
|
//#endregion
|
|
2184
|
-
//#region node_modules/.
|
|
2187
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/restore-inbound-chunk.js
|
|
2185
2188
|
/**
|
|
2186
2189
|
* Rebuild TanStack `TokenUsage` (`promptTokens`) from spec `usage[]` plus
|
|
2187
2190
|
* leftover fields in `metadata.tanstack.usage`. Restore in-process aliases
|
|
@@ -2218,7 +2221,7 @@ function restoreInboundChunk(chunk) {
|
|
|
2218
2221
|
return next;
|
|
2219
2222
|
}
|
|
2220
2223
|
//#endregion
|
|
2221
|
-
//#region node_modules/.
|
|
2224
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.js
|
|
2222
2225
|
/**
|
|
2223
2226
|
* Create an isomorphic tool definition that can be used directly or instantiated for server/client
|
|
2224
2227
|
*
|
|
@@ -2316,7 +2319,7 @@ function toolDefinition(config) {
|
|
|
2316
2319
|
};
|
|
2317
2320
|
}
|
|
2318
2321
|
//#endregion
|
|
2319
|
-
//#region node_modules/.
|
|
2322
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/chunk-ids.js
|
|
2320
2323
|
function stringField(value) {
|
|
2321
2324
|
return typeof value === "string" && value !== "" ? value : void 0;
|
|
2322
2325
|
}
|
|
@@ -2329,7 +2332,7 @@ function getChunkRunId(chunk) {
|
|
|
2329
2332
|
return stringField(tanstackMetadata(chunk)?.runId);
|
|
2330
2333
|
}
|
|
2331
2334
|
//#endregion
|
|
2332
|
-
//#region node_modules/.
|
|
2335
|
+
//#region ../node_modules/.bun/partial-json@0.1.7/node_modules/partial-json/dist/options.js
|
|
2333
2336
|
var require_options = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2334
2337
|
/**
|
|
2335
2338
|
* Sometimes you don't allow every type to be partially parsed.
|
|
@@ -2419,9 +2422,9 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2419
2422
|
exports.default = exports.Allow;
|
|
2420
2423
|
}));
|
|
2421
2424
|
//#endregion
|
|
2422
|
-
//#region node_modules/.
|
|
2423
|
-
var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2424
|
-
var __createBinding =
|
|
2425
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/json-parser.js
|
|
2426
|
+
var import_dist = (/* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
2427
|
+
var __createBinding = this$1 && this$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
2425
2428
|
if (k2 === void 0) k2 = k;
|
|
2426
2429
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2427
2430
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
@@ -2435,8 +2438,8 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2435
2438
|
if (k2 === void 0) k2 = k;
|
|
2436
2439
|
o[k2] = m[k];
|
|
2437
2440
|
}));
|
|
2438
|
-
var __exportStar =
|
|
2439
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports
|
|
2441
|
+
var __exportStar = this$1 && this$1.__exportStar || function(m, exports) {
|
|
2442
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2440
2443
|
};
|
|
2441
2444
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2442
2445
|
exports.Allow = exports.MalformedJSON = exports.PartialJSON = exports.parseJSON = exports.parse = void 0;
|
|
@@ -2641,7 +2644,7 @@ function parsePartialJSON(jsonString) {
|
|
|
2641
2644
|
return defaultJSONParser.parse(jsonString);
|
|
2642
2645
|
}
|
|
2643
2646
|
//#endregion
|
|
2644
|
-
//#region node_modules/.
|
|
2647
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/strategies.js
|
|
2645
2648
|
/**
|
|
2646
2649
|
* Immediate Strategy - emit on every chunk (default behavior)
|
|
2647
2650
|
*/
|
|
@@ -2651,7 +2654,7 @@ var ImmediateStrategy = class {
|
|
|
2651
2654
|
}
|
|
2652
2655
|
};
|
|
2653
2656
|
//#endregion
|
|
2654
|
-
//#region node_modules/.
|
|
2657
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/utilities/errors.js
|
|
2655
2658
|
/**
|
|
2656
2659
|
* Convert an AG-UI RUN_ERROR event to the Error shape exposed to consumers.
|
|
2657
2660
|
* Preserves the provider code and sanitized raw event when available, while
|
|
@@ -2665,7 +2668,7 @@ function runErrorEventToError(chunk) {
|
|
|
2665
2668
|
return error;
|
|
2666
2669
|
}
|
|
2667
2670
|
//#endregion
|
|
2668
|
-
//#region node_modules/.
|
|
2671
|
+
//#region ../node_modules/.bun/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/helpers.mjs
|
|
2669
2672
|
/*!
|
|
2670
2673
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
2671
2674
|
* (c) 2017-2022 Joachim Wester
|
|
@@ -2797,7 +2800,7 @@ var PatchError = function(_super) {
|
|
|
2797
2800
|
return PatchError;
|
|
2798
2801
|
}(Error);
|
|
2799
2802
|
//#endregion
|
|
2800
|
-
//#region node_modules/.
|
|
2803
|
+
//#region ../node_modules/.bun/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/core.mjs
|
|
2801
2804
|
var core_exports = /* @__PURE__ */ __exportAll({
|
|
2802
2805
|
JsonPatchError: () => JsonPatchError,
|
|
2803
2806
|
_areEquals: () => _areEquals,
|
|
@@ -2933,8 +2936,10 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
2933
2936
|
if (mutateDocument === void 0) mutateDocument = true;
|
|
2934
2937
|
if (banPrototypeModifications === void 0) banPrototypeModifications = true;
|
|
2935
2938
|
if (index === void 0) index = 0;
|
|
2936
|
-
if (validateOperation)
|
|
2937
|
-
|
|
2939
|
+
if (validateOperation) {
|
|
2940
|
+
if (typeof validateOperation == "function") validateOperation(operation, 0, document, operation.path);
|
|
2941
|
+
else validator(operation, 0);
|
|
2942
|
+
}
|
|
2938
2943
|
if (operation.path === "") {
|
|
2939
2944
|
var returnValue = { newDocument: document };
|
|
2940
2945
|
if (operation.op === "add") {
|
|
@@ -3124,7 +3129,7 @@ function _areEquals(a, b) {
|
|
|
3124
3129
|
return a !== a && b !== b;
|
|
3125
3130
|
}
|
|
3126
3131
|
//#endregion
|
|
3127
|
-
//#region node_modules/.
|
|
3132
|
+
//#region ../node_modules/.bun/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/duplex.mjs
|
|
3128
3133
|
/*!
|
|
3129
3134
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
3130
3135
|
* (c) 2017-2021 Joachim Wester
|
|
@@ -3301,7 +3306,7 @@ function compare(tree1, tree2, invertible) {
|
|
|
3301
3306
|
return patches;
|
|
3302
3307
|
}
|
|
3303
3308
|
//#endregion
|
|
3304
|
-
//#region node_modules/.
|
|
3309
|
+
//#region ../node_modules/.bun/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.mjs
|
|
3305
3310
|
/**
|
|
3306
3311
|
* Default export for backwards compat
|
|
3307
3312
|
*/
|
|
@@ -3312,7 +3317,7 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
|
|
|
3312
3317
|
unescapePathComponent
|
|
3313
3318
|
});
|
|
3314
3319
|
//#endregion
|
|
3315
|
-
//#region node_modules/.
|
|
3320
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/activity-records.js
|
|
3316
3321
|
function isActivityPart(part) {
|
|
3317
3322
|
return part.type === "activity";
|
|
3318
3323
|
}
|
|
@@ -3388,7 +3393,7 @@ function applyActivityDeltaToUIMessages(messages, chunk) {
|
|
|
3388
3393
|
}
|
|
3389
3394
|
}
|
|
3390
3395
|
//#endregion
|
|
3391
|
-
//#region node_modules/.
|
|
3396
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/message-updaters.js
|
|
3392
3397
|
/**
|
|
3393
3398
|
* Message Updaters (Internal)
|
|
3394
3399
|
*
|
|
@@ -3690,7 +3695,7 @@ function updateThinkingPart(messages, messageId, stepId, content, signature) {
|
|
|
3690
3695
|
});
|
|
3691
3696
|
}
|
|
3692
3697
|
//#endregion
|
|
3693
|
-
//#region node_modules/.
|
|
3698
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/processor.js
|
|
3694
3699
|
/**
|
|
3695
3700
|
* Unified Stream Processor
|
|
3696
3701
|
*
|
|
@@ -5814,14 +5819,14 @@ function createReplayStream(recording) {
|
|
|
5814
5819
|
} };
|
|
5815
5820
|
}
|
|
5816
5821
|
//#endregion
|
|
5817
|
-
//#region node_modules/.
|
|
5822
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/byok/providers.js
|
|
5818
5823
|
/** `[a-z][a-z0-9-]{0,63}` — lowercase, no underscores, max 64 chars. */
|
|
5819
5824
|
var BYOK_PROVIDER_ID_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
5820
5825
|
function isProviderId(value) {
|
|
5821
5826
|
return typeof value === "string" && BYOK_PROVIDER_ID_PATTERN.test(value);
|
|
5822
5827
|
}
|
|
5823
5828
|
//#endregion
|
|
5824
|
-
//#region node_modules/.
|
|
5829
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/byok/missing.js
|
|
5825
5830
|
function isByokMissingBody(value) {
|
|
5826
5831
|
if (typeof value !== "object" || value === null) return false;
|
|
5827
5832
|
if (!("error" in value)) return false;
|
|
@@ -5834,7 +5839,7 @@ function isByokMissingBody(value) {
|
|
|
5834
5839
|
return true;
|
|
5835
5840
|
}
|
|
5836
5841
|
//#endregion
|
|
5837
|
-
//#region node_modules/.
|
|
5842
|
+
//#region ../node_modules/.bun/@tanstack+ai@0.68.0+367daa2260c029d6/node_modules/@tanstack/ai/dist/esm/byok/errors.js
|
|
5838
5843
|
var ByokMissingError = class extends Error {
|
|
5839
5844
|
provider;
|
|
5840
5845
|
constructor(provider) {
|
|
@@ -5860,7 +5865,7 @@ var ByokUnresolvedProviderError = class extends Error {
|
|
|
5860
5865
|
}
|
|
5861
5866
|
};
|
|
5862
5867
|
//#endregion
|
|
5863
|
-
//#region node_modules/.
|
|
5868
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/connection-adapters.js
|
|
5864
5869
|
/**
|
|
5865
5870
|
* Associates connect-wrapped chunks with the run they were produced under.
|
|
5866
5871
|
* Content events (TEXT_MESSAGE_CONTENT, TOOL_CALL_*, …) carry no `runId` of
|
|
@@ -6558,7 +6563,7 @@ async function* abortableIterable(iterable, signal) {
|
|
|
6558
6563
|
}
|
|
6559
6564
|
}
|
|
6560
6565
|
//#endregion
|
|
6561
|
-
//#region node_modules/.
|
|
6566
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/interrupt-manager.js
|
|
6562
6567
|
function isClientOwnedInterrupt(item) {
|
|
6563
6568
|
return item.resumable;
|
|
6564
6569
|
}
|
|
@@ -7500,7 +7505,7 @@ var InterruptManager = class {
|
|
|
7500
7505
|
}
|
|
7501
7506
|
};
|
|
7502
7507
|
//#endregion
|
|
7503
|
-
//#region node_modules/.
|
|
7508
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/byok/client.js
|
|
7504
7509
|
var registeredProviderIds = /* @__PURE__ */ new WeakMap();
|
|
7505
7510
|
/**
|
|
7506
7511
|
* Provider to stamp when the caller did not pass a slug.
|
|
@@ -7513,7 +7518,7 @@ function byokFallbackProviderId(byok) {
|
|
|
7513
7518
|
if (registered.length === 1) return registered[0];
|
|
7514
7519
|
}
|
|
7515
7520
|
//#endregion
|
|
7516
|
-
//#region node_modules/.
|
|
7521
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/byok/resolve.js
|
|
7517
7522
|
function resolveByokProviderId(byokProvider, ...candidates) {
|
|
7518
7523
|
const fromFn = byokProvider?.();
|
|
7519
7524
|
if (isProviderId(fromFn)) return fromFn;
|
|
@@ -7529,7 +7534,7 @@ async function prepareResolvedByokHeaders(byok, provider) {
|
|
|
7529
7534
|
return byok.headers(provider);
|
|
7530
7535
|
}
|
|
7531
7536
|
//#endregion
|
|
7532
|
-
//#region node_modules/.
|
|
7537
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/events.js
|
|
7533
7538
|
/**
|
|
7534
7539
|
* Abstract base class for ChatClient event emission
|
|
7535
7540
|
*/
|
|
@@ -7703,7 +7708,7 @@ var ChatClientEventEmitter = class {
|
|
|
7703
7708
|
}
|
|
7704
7709
|
};
|
|
7705
7710
|
//#endregion
|
|
7706
|
-
//#region node_modules/.
|
|
7711
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/devtools-noop.js
|
|
7707
7712
|
var NoOpChatClientEventEmitter = class extends ChatClientEventEmitter {
|
|
7708
7713
|
emitEvent() {}
|
|
7709
7714
|
};
|
|
@@ -7748,7 +7753,7 @@ var NoOpChatDevtoolsBridge = class {
|
|
|
7748
7753
|
};
|
|
7749
7754
|
var createNoOpChatDevtoolsBridge = (options) => new NoOpChatDevtoolsBridge(options);
|
|
7750
7755
|
//#endregion
|
|
7751
|
-
//#region node_modules/.
|
|
7756
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/client-persistor.js
|
|
7752
7757
|
/** Normalize a raw `getItem` result (legacy bare array or combined record). */
|
|
7753
7758
|
function normalizePersistedState(raw) {
|
|
7754
7759
|
if (Array.isArray(raw)) return { messages: raw };
|
|
@@ -8013,7 +8018,7 @@ var ChatPersistor = class {
|
|
|
8013
8018
|
}
|
|
8014
8019
|
};
|
|
8015
8020
|
//#endregion
|
|
8016
|
-
//#region node_modules/.
|
|
8021
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/cleared-stream-tracker.js
|
|
8017
8022
|
function getChunkToolCallId(chunk) {
|
|
8018
8023
|
return "toolCallId" in chunk && typeof chunk.toolCallId === "string" ? chunk.toolCallId : void 0;
|
|
8019
8024
|
}
|
|
@@ -8106,7 +8111,7 @@ var ClearedStreamTracker = class {
|
|
|
8106
8111
|
}
|
|
8107
8112
|
};
|
|
8108
8113
|
//#endregion
|
|
8109
|
-
//#region node_modules/.
|
|
8114
|
+
//#region ../node_modules/.bun/@tanstack+ai-client@0.39.2+367daa2260c029d6/node_modules/@tanstack/ai-client/dist/esm/chat-client.js
|
|
8110
8115
|
var STREAM_PROCESSING_BUDGET_MS = 8;
|
|
8111
8116
|
function yieldToHost() {
|
|
8112
8117
|
const { scheduler } = globalThis;
|
|
@@ -10273,9 +10278,10 @@ function buildAgentTools(widgets, hostTools, renderWidget, debug) {
|
|
|
10273
10278
|
];
|
|
10274
10279
|
}
|
|
10275
10280
|
function buildRenderWidgetTool(widgets, render) {
|
|
10281
|
+
const catalog = Object.entries(widgets).map(([name, { description, parameters }]) => `- ${name}: ${description} Props schema: ${JSON.stringify(toJsonSchema(parameters))}`).join("\n");
|
|
10276
10282
|
return toolDefinition({
|
|
10277
10283
|
name: RENDER_WIDGET_TOOL,
|
|
10278
|
-
description: "Render one of the host application's own UI widgets inline in the conversation. The widget appears in the transcript at the point of the call, so prefer it over describing the same information in text. Available widgets:\n" +
|
|
10284
|
+
description: "Render one of the host application's own UI widgets inline in the conversation. The widget appears in the transcript at the point of the call, so prefer it over describing the same information in text. Available widgets:\n" + catalog,
|
|
10279
10285
|
inputSchema: {
|
|
10280
10286
|
type: "object",
|
|
10281
10287
|
properties: {
|
|
@@ -10641,6 +10647,100 @@ function startAuthentication(options) {
|
|
|
10641
10647
|
};
|
|
10642
10648
|
}
|
|
10643
10649
|
//#endregion
|
|
10650
|
+
//#region src/core/mcp.ts
|
|
10651
|
+
async function manageMcpConnection(operation, options) {
|
|
10652
|
+
switch (operation.action) {
|
|
10653
|
+
case "connect": return personalMcpCreateConnection({ mcp_server_id: operation.mcpServerId }, options);
|
|
10654
|
+
case "headers": {
|
|
10655
|
+
const connection = await personalMcpCreateConnection({ mcp_server_id: operation.mcpServerId }, options);
|
|
10656
|
+
await personalMcpSetHeaders(connection.id, {
|
|
10657
|
+
lock_version: connection.lock_version,
|
|
10658
|
+
headers: operation.headers
|
|
10659
|
+
}, options);
|
|
10660
|
+
return { id: connection.id };
|
|
10661
|
+
}
|
|
10662
|
+
case "disconnect": return personalMcpDisconnectConnection(operation.id, options);
|
|
10663
|
+
case "test": return personalMcpTestConnection(operation.id, options);
|
|
10664
|
+
}
|
|
10665
|
+
}
|
|
10666
|
+
async function authorizeMcpConnection(input, requestOptions) {
|
|
10667
|
+
const popup = window.open("about:blank", "_blank", "popup,width=600,height=720");
|
|
10668
|
+
if (!popup) throw new Error("Allow popups to authorize this connection.");
|
|
10669
|
+
try {
|
|
10670
|
+
const id = input.id ?? (await personalMcpCreateConnection({ mcp_server_id: input.mcpServerId }, await requestOptions())).id;
|
|
10671
|
+
const response = await personalMcpAuthorizeConnection(id, await requestOptions());
|
|
10672
|
+
const attempt = {
|
|
10673
|
+
organizationId: response.attempt.organization_id,
|
|
10674
|
+
tenantId: response.attempt.tenant_id,
|
|
10675
|
+
connectionId: response.attempt.connection_id,
|
|
10676
|
+
id: response.attempt.id
|
|
10677
|
+
};
|
|
10678
|
+
const url = new URL(response.popup_url);
|
|
10679
|
+
url.searchParams.set("origin", window.location.origin);
|
|
10680
|
+
await new Promise((resolve, reject) => {
|
|
10681
|
+
let challenge;
|
|
10682
|
+
let bound = false;
|
|
10683
|
+
let finished = false;
|
|
10684
|
+
let completing = false;
|
|
10685
|
+
const cleanup = () => {
|
|
10686
|
+
finished = true;
|
|
10687
|
+
window.removeEventListener("message", receive);
|
|
10688
|
+
clearInterval(poll);
|
|
10689
|
+
clearTimeout(expiry);
|
|
10690
|
+
};
|
|
10691
|
+
const fail = (error) => {
|
|
10692
|
+
cleanup();
|
|
10693
|
+
reject(error instanceof Error ? error : /* @__PURE__ */ new Error("Authorization failed."));
|
|
10694
|
+
};
|
|
10695
|
+
const complete = async () => {
|
|
10696
|
+
if (completing || finished) return;
|
|
10697
|
+
completing = true;
|
|
10698
|
+
try {
|
|
10699
|
+
if (challenge) {
|
|
10700
|
+
if (!bound) {
|
|
10701
|
+
await personalMcpBindBrowser(id, {
|
|
10702
|
+
attempt_id: attempt.id,
|
|
10703
|
+
challenge
|
|
10704
|
+
}, await requestOptions());
|
|
10705
|
+
bound = true;
|
|
10706
|
+
}
|
|
10707
|
+
if (finished) return;
|
|
10708
|
+
const connected = await personalMcpCompleteAuthorization(id, { attempt_id: attempt.id }, await requestOptions());
|
|
10709
|
+
if (finished) return;
|
|
10710
|
+
if (connected) {
|
|
10711
|
+
cleanup();
|
|
10712
|
+
resolve();
|
|
10713
|
+
return;
|
|
10714
|
+
}
|
|
10715
|
+
}
|
|
10716
|
+
if (popup.closed) fail(/* @__PURE__ */ new Error("Authorization window closed."));
|
|
10717
|
+
} catch (error) {
|
|
10718
|
+
const status = error instanceof Error ? error.status : void 0;
|
|
10719
|
+
if (!(error instanceof TypeError) && status !== 429 && (status ?? 0) < 500) fail(error);
|
|
10720
|
+
} finally {
|
|
10721
|
+
completing = false;
|
|
10722
|
+
}
|
|
10723
|
+
};
|
|
10724
|
+
const receive = (event) => {
|
|
10725
|
+
if (event.source !== popup || event.origin !== url.origin) return;
|
|
10726
|
+
const data = event.data;
|
|
10727
|
+
if (!data?.attempt || data.attempt.id !== attempt.id || data.attempt.organizationId !== attempt.organizationId || data.attempt.tenantId !== attempt.tenantId || data.attempt.connectionId !== attempt.connectionId) return;
|
|
10728
|
+
if (data.type === "mcp-browser-challenge" && !challenge && typeof data.challenge === "string") {
|
|
10729
|
+
challenge = data.challenge;
|
|
10730
|
+
complete();
|
|
10731
|
+
}
|
|
10732
|
+
};
|
|
10733
|
+
const poll = setInterval(() => void complete(), 5e3);
|
|
10734
|
+
const expiry = setTimeout(() => fail(/* @__PURE__ */ new Error("Authorization expired. Try connecting again.")), 6e5);
|
|
10735
|
+
window.addEventListener("message", receive);
|
|
10736
|
+
popup.location.replace(url.href);
|
|
10737
|
+
});
|
|
10738
|
+
return id;
|
|
10739
|
+
} finally {
|
|
10740
|
+
popup.close();
|
|
10741
|
+
}
|
|
10742
|
+
}
|
|
10743
|
+
//#endregion
|
|
10644
10744
|
//#region src/core/messages.ts
|
|
10645
10745
|
function isSettledToolCall(part) {
|
|
10646
10746
|
return part.state === "complete" || part.state === "error" || part.output !== void 0;
|
|
@@ -10856,6 +10956,7 @@ function projectThreadMessages(records, pendingInteractions = [], liveToolMessag
|
|
|
10856
10956
|
const savedId = savedToolCallId(message.id, String(part.id), responseTargetId);
|
|
10857
10957
|
const call = {
|
|
10858
10958
|
...part,
|
|
10959
|
+
savedToolTitle: part.declaration && typeof part.declaration === "object" && !Array.isArray(part.declaration) && "title" in part.declaration && typeof part.declaration.title === "string" ? part.declaration.title : void 0,
|
|
10859
10960
|
id: liveToolMessageIds.get(toolCallId) === message.id ? toolCallId : savedId,
|
|
10860
10961
|
upstreamToolCallId: toolCallId,
|
|
10861
10962
|
applicationPartId: part.id,
|
|
@@ -11010,6 +11111,9 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11010
11111
|
});
|
|
11011
11112
|
if (state.auth.status !== "error" || state.auth.error !== failure) live.streamCallbacks?.onError?.(failure);
|
|
11012
11113
|
};
|
|
11114
|
+
const clearUnavailableMcpConnection = (id) => {
|
|
11115
|
+
update({ unavailableMcpConnections: state.unavailableMcpConnections?.filter((entry) => entry !== id) ?? [] });
|
|
11116
|
+
};
|
|
11013
11117
|
const requestOptions = async (conversation = true) => {
|
|
11014
11118
|
const generation = selectionGeneration;
|
|
11015
11119
|
const authSignal = authentication.session.abortController.signal;
|
|
@@ -11420,6 +11524,16 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11420
11524
|
}
|
|
11421
11525
|
return;
|
|
11422
11526
|
}
|
|
11527
|
+
if (eventType === "astralbeam_mcp_tools") {
|
|
11528
|
+
const event = data;
|
|
11529
|
+
const titles = {};
|
|
11530
|
+
for (const tool of event.tools ?? []) if (typeof tool.name === "string" && typeof tool.title === "string") titles[tool.name] = tool.title;
|
|
11531
|
+
update({
|
|
11532
|
+
serverToolTitles: titles,
|
|
11533
|
+
unavailableMcpConnections: event.unavailable ?? []
|
|
11534
|
+
});
|
|
11535
|
+
return;
|
|
11536
|
+
}
|
|
11423
11537
|
const limit = data;
|
|
11424
11538
|
if (eventType === "astralbeam.usage_limit.reached" && typeof limit?.name === "string" && typeof limit.resetsAt === "string") {
|
|
11425
11539
|
update({ usageLimitReached: {
|
|
@@ -11438,6 +11552,10 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11438
11552
|
},
|
|
11439
11553
|
onChunk: (chunk) => {
|
|
11440
11554
|
if (client !== next) return;
|
|
11555
|
+
if (chunk.type === EventType.RUN_STARTED) update({
|
|
11556
|
+
serverToolTitles: {},
|
|
11557
|
+
unavailableMcpConnections: []
|
|
11558
|
+
});
|
|
11441
11559
|
live.streamCallbacks?.onChunk?.(chunk);
|
|
11442
11560
|
},
|
|
11443
11561
|
onResponse: (response) => {
|
|
@@ -11519,6 +11637,8 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11519
11637
|
sandboxStatus: void 0,
|
|
11520
11638
|
usageLimitReached: void 0,
|
|
11521
11639
|
pendingInteractions: [],
|
|
11640
|
+
serverToolTitles: {},
|
|
11641
|
+
unavailableMcpConnections: [],
|
|
11522
11642
|
threadLoadFailed: false,
|
|
11523
11643
|
messagesCursor: void 0,
|
|
11524
11644
|
olderMessagesLoading: false
|
|
@@ -11925,6 +12045,17 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11925
12045
|
if (!thread) throw new Error("Open a conversation before downloading attachments.");
|
|
11926
12046
|
return (await getChatAttachment(thread.id, messageId, partId, await requestOptions())).blob();
|
|
11927
12047
|
},
|
|
12048
|
+
getMcpCatalog: async () => personalMcpGetCatalog(await requestOptions(false)),
|
|
12049
|
+
manageMcpConnection: async (operation) => {
|
|
12050
|
+
const result = await manageMcpConnection(operation, await requestOptions(false));
|
|
12051
|
+
if ("id" in operation) clearUnavailableMcpConnection(operation.id);
|
|
12052
|
+
else if (result && "id" in result) clearUnavailableMcpConnection(result.id);
|
|
12053
|
+
return result;
|
|
12054
|
+
},
|
|
12055
|
+
authorizeMcpConnection: async (input) => {
|
|
12056
|
+
const id = await authorizeMcpConnection(input, () => requestOptions(false));
|
|
12057
|
+
clearUnavailableMcpConnection(id);
|
|
12058
|
+
},
|
|
11928
12059
|
abandonToolCall,
|
|
11929
12060
|
reset: () => {
|
|
11930
12061
|
debug?.("status", "conversation reset");
|