@reverbia/sdk 1.0.0-next.20260109140427 → 1.0.0-next.20260109150925
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/expo/index.d.mts +99 -6
- package/dist/expo/index.d.ts +99 -6
- package/dist/react/index.cjs +129 -34
- package/dist/react/index.d.mts +202 -38
- package/dist/react/index.d.ts +202 -38
- package/dist/react/index.mjs +129 -34
- package/package.json +3 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1439,10 +1439,7 @@ function useChat(options) {
|
|
|
1439
1439
|
continue;
|
|
1440
1440
|
}
|
|
1441
1441
|
if (chunk && typeof chunk === "object") {
|
|
1442
|
-
const { content: contentDelta, thinking: thinkingDelta } = strategy.processStreamChunk(
|
|
1443
|
-
chunk,
|
|
1444
|
-
accumulator
|
|
1445
|
-
);
|
|
1442
|
+
const { content: contentDelta, thinking: thinkingDelta } = strategy.processStreamChunk(chunk, accumulator);
|
|
1446
1443
|
if (contentDelta) {
|
|
1447
1444
|
if (onData) onData(contentDelta);
|
|
1448
1445
|
if (globalOnData) globalOnData(contentDelta);
|
|
@@ -1475,7 +1472,11 @@ function useChat(options) {
|
|
|
1475
1472
|
}
|
|
1476
1473
|
const response = strategy.buildFinalResponse(accumulator);
|
|
1477
1474
|
if (accumulator.toolCalls.size > 0) {
|
|
1478
|
-
console.log(
|
|
1475
|
+
console.log(
|
|
1476
|
+
"[Tool Debug] Found",
|
|
1477
|
+
accumulator.toolCalls.size,
|
|
1478
|
+
"tool calls"
|
|
1479
|
+
);
|
|
1479
1480
|
const executorMap = createToolExecutorMap(tools);
|
|
1480
1481
|
const toolCallsToExecute = [];
|
|
1481
1482
|
for (const toolCall of accumulator.toolCalls.values()) {
|
|
@@ -1485,7 +1486,10 @@ function useChat(options) {
|
|
|
1485
1486
|
console.log("[Tool Debug] Will auto-execute:", toolCall.name);
|
|
1486
1487
|
toolCallsToExecute.push(toolCall);
|
|
1487
1488
|
} else {
|
|
1488
|
-
console.log(
|
|
1489
|
+
console.log(
|
|
1490
|
+
"[Tool Debug] Emitting onToolCall event for:",
|
|
1491
|
+
toolCall.name
|
|
1492
|
+
);
|
|
1489
1493
|
if (onToolCall) {
|
|
1490
1494
|
onToolCall({
|
|
1491
1495
|
id: toolCall.id,
|
|
@@ -1499,7 +1503,11 @@ function useChat(options) {
|
|
|
1499
1503
|
}
|
|
1500
1504
|
}
|
|
1501
1505
|
if (toolCallsToExecute.length > 0) {
|
|
1502
|
-
console.log(
|
|
1506
|
+
console.log(
|
|
1507
|
+
"[Tool Debug] Executing",
|
|
1508
|
+
toolCallsToExecute.length,
|
|
1509
|
+
"tools"
|
|
1510
|
+
);
|
|
1503
1511
|
if (onThinking || globalOnThinking) {
|
|
1504
1512
|
const toolInfo = toolCallsToExecute.map((tc) => {
|
|
1505
1513
|
try {
|
|
@@ -1529,7 +1537,12 @@ Executing tool: ${toolInfo}
|
|
|
1529
1537
|
toolCall,
|
|
1530
1538
|
executorConfig.executor
|
|
1531
1539
|
);
|
|
1532
|
-
console.log(
|
|
1540
|
+
console.log(
|
|
1541
|
+
"[Tool Debug] Tool execution result for",
|
|
1542
|
+
toolCall.name,
|
|
1543
|
+
":",
|
|
1544
|
+
{ result, error }
|
|
1545
|
+
);
|
|
1533
1546
|
return {
|
|
1534
1547
|
id: toolCall.id,
|
|
1535
1548
|
name: toolCall.name,
|
|
@@ -1538,7 +1551,10 @@ Executing tool: ${toolInfo}
|
|
|
1538
1551
|
};
|
|
1539
1552
|
})
|
|
1540
1553
|
);
|
|
1541
|
-
console.log(
|
|
1554
|
+
console.log(
|
|
1555
|
+
"[Tool Debug] All tools executed, results:",
|
|
1556
|
+
executionResults.length
|
|
1557
|
+
);
|
|
1542
1558
|
if (onThinking || globalOnThinking) {
|
|
1543
1559
|
const resultsText = executionResults.map((r) => {
|
|
1544
1560
|
if (r.error) {
|
|
@@ -1574,8 +1590,14 @@ Executing tool: ${toolInfo}
|
|
|
1574
1590
|
tool_call_id: execResult.id
|
|
1575
1591
|
});
|
|
1576
1592
|
}
|
|
1577
|
-
const continuationMessages = [
|
|
1578
|
-
|
|
1593
|
+
const continuationMessages = [
|
|
1594
|
+
...messagesWithContext,
|
|
1595
|
+
...toolResultMessages
|
|
1596
|
+
];
|
|
1597
|
+
console.log(
|
|
1598
|
+
"[Tool Debug] Continuation messages:",
|
|
1599
|
+
JSON.stringify(continuationMessages, null, 2)
|
|
1600
|
+
);
|
|
1579
1601
|
const continuationRequestBody = strategy.buildRequestBody({
|
|
1580
1602
|
messages: continuationMessages,
|
|
1581
1603
|
model,
|
|
@@ -1612,10 +1634,7 @@ Executing tool: ${toolInfo}
|
|
|
1612
1634
|
continue;
|
|
1613
1635
|
}
|
|
1614
1636
|
if (chunk && typeof chunk === "object") {
|
|
1615
|
-
const { content: contentDelta, thinking: thinkingDelta } = strategy.processStreamChunk(
|
|
1616
|
-
chunk,
|
|
1617
|
-
continuationAccumulator
|
|
1618
|
-
);
|
|
1637
|
+
const { content: contentDelta, thinking: thinkingDelta } = strategy.processStreamChunk(chunk, continuationAccumulator);
|
|
1619
1638
|
if (contentDelta) {
|
|
1620
1639
|
if (onData) onData(contentDelta);
|
|
1621
1640
|
if (globalOnData) globalOnData(contentDelta);
|
|
@@ -1626,11 +1645,19 @@ Executing tool: ${toolInfo}
|
|
|
1626
1645
|
}
|
|
1627
1646
|
}
|
|
1628
1647
|
}
|
|
1629
|
-
console.log(
|
|
1630
|
-
|
|
1648
|
+
console.log(
|
|
1649
|
+
"[Tool Debug] Continuation stream complete - accumulated content:",
|
|
1650
|
+
continuationAccumulator.content
|
|
1651
|
+
);
|
|
1652
|
+
console.log(
|
|
1653
|
+
"[Tool Debug] Continuation stream complete - accumulated thinking:",
|
|
1654
|
+
continuationAccumulator.thinking
|
|
1655
|
+
);
|
|
1631
1656
|
} catch (streamErr) {
|
|
1632
1657
|
if (isAbortError(streamErr) || abortController.signal.aborted) {
|
|
1633
|
-
const partialResponse = strategy.buildFinalResponse(
|
|
1658
|
+
const partialResponse = strategy.buildFinalResponse(
|
|
1659
|
+
continuationAccumulator
|
|
1660
|
+
);
|
|
1634
1661
|
return {
|
|
1635
1662
|
data: partialResponse,
|
|
1636
1663
|
error: "Request aborted"
|
|
@@ -1639,7 +1666,9 @@ Executing tool: ${toolInfo}
|
|
|
1639
1666
|
throw streamErr;
|
|
1640
1667
|
}
|
|
1641
1668
|
if (abortController.signal.aborted) {
|
|
1642
|
-
const partialResponse = strategy.buildFinalResponse(
|
|
1669
|
+
const partialResponse = strategy.buildFinalResponse(
|
|
1670
|
+
continuationAccumulator
|
|
1671
|
+
);
|
|
1643
1672
|
return {
|
|
1644
1673
|
data: partialResponse,
|
|
1645
1674
|
error: "Request aborted"
|
|
@@ -1648,7 +1677,9 @@ Executing tool: ${toolInfo}
|
|
|
1648
1677
|
if (sseError) {
|
|
1649
1678
|
throw sseError;
|
|
1650
1679
|
}
|
|
1651
|
-
const finalResponse = strategy.buildFinalResponse(
|
|
1680
|
+
const finalResponse = strategy.buildFinalResponse(
|
|
1681
|
+
continuationAccumulator
|
|
1682
|
+
);
|
|
1652
1683
|
if (onFinish) {
|
|
1653
1684
|
onFinish(finalResponse);
|
|
1654
1685
|
}
|
|
@@ -1681,7 +1712,16 @@ Executing tool: ${toolInfo}
|
|
|
1681
1712
|
}
|
|
1682
1713
|
}
|
|
1683
1714
|
},
|
|
1684
|
-
[
|
|
1715
|
+
[
|
|
1716
|
+
getToken,
|
|
1717
|
+
baseUrl,
|
|
1718
|
+
globalOnData,
|
|
1719
|
+
globalOnThinking,
|
|
1720
|
+
onFinish,
|
|
1721
|
+
onError,
|
|
1722
|
+
onToolCall,
|
|
1723
|
+
defaultApiType
|
|
1724
|
+
]
|
|
1685
1725
|
);
|
|
1686
1726
|
return {
|
|
1687
1727
|
isLoading,
|
|
@@ -6478,11 +6518,17 @@ function DropboxAuthProvider({
|
|
|
6478
6518
|
if (!isConfigured) return;
|
|
6479
6519
|
const handleCallback = async () => {
|
|
6480
6520
|
if (isDropboxCallback()) {
|
|
6481
|
-
const result = await handleDropboxCallback(
|
|
6521
|
+
const result = await handleDropboxCallback(
|
|
6522
|
+
callbackPath,
|
|
6523
|
+
apiClient,
|
|
6524
|
+
walletAddress
|
|
6525
|
+
);
|
|
6482
6526
|
if (result.ok) {
|
|
6483
6527
|
setAccessToken(result.data);
|
|
6484
6528
|
} else {
|
|
6485
|
-
console.error(
|
|
6529
|
+
console.error(
|
|
6530
|
+
`Dropbox OAuth failed: ${result.error.code} - ${result.error.message}`
|
|
6531
|
+
);
|
|
6486
6532
|
}
|
|
6487
6533
|
}
|
|
6488
6534
|
};
|
|
@@ -6508,7 +6554,14 @@ function DropboxAuthProvider({
|
|
|
6508
6554
|
return storedToken;
|
|
6509
6555
|
}
|
|
6510
6556
|
return startDropboxAuth(appKey, callbackPath);
|
|
6511
|
-
}, [
|
|
6557
|
+
}, [
|
|
6558
|
+
accessToken,
|
|
6559
|
+
appKey,
|
|
6560
|
+
callbackPath,
|
|
6561
|
+
isConfigured,
|
|
6562
|
+
apiClient,
|
|
6563
|
+
walletAddress
|
|
6564
|
+
]);
|
|
6512
6565
|
const logout = useCallback10(async () => {
|
|
6513
6566
|
await revokeDropboxToken(apiClient, walletAddress);
|
|
6514
6567
|
setAccessToken(null);
|
|
@@ -6885,11 +6938,17 @@ function GoogleDriveAuthProvider({
|
|
|
6885
6938
|
if (!isConfigured) return;
|
|
6886
6939
|
const handleCallback = async () => {
|
|
6887
6940
|
if (isGoogleDriveCallback()) {
|
|
6888
|
-
const result = await handleGoogleDriveCallback(
|
|
6941
|
+
const result = await handleGoogleDriveCallback(
|
|
6942
|
+
callbackPath,
|
|
6943
|
+
apiClient,
|
|
6944
|
+
walletAddress
|
|
6945
|
+
);
|
|
6889
6946
|
if (result.ok) {
|
|
6890
6947
|
setAccessToken(result.data);
|
|
6891
6948
|
} else {
|
|
6892
|
-
console.error(
|
|
6949
|
+
console.error(
|
|
6950
|
+
`Google Drive OAuth failed: ${result.error.code} - ${result.error.message}`
|
|
6951
|
+
);
|
|
6893
6952
|
}
|
|
6894
6953
|
}
|
|
6895
6954
|
};
|
|
@@ -6909,13 +6968,23 @@ function GoogleDriveAuthProvider({
|
|
|
6909
6968
|
if (accessToken) {
|
|
6910
6969
|
return accessToken;
|
|
6911
6970
|
}
|
|
6912
|
-
const storedToken = await getGoogleDriveAccessToken(
|
|
6971
|
+
const storedToken = await getGoogleDriveAccessToken(
|
|
6972
|
+
apiClient,
|
|
6973
|
+
walletAddress
|
|
6974
|
+
);
|
|
6913
6975
|
if (storedToken) {
|
|
6914
6976
|
setAccessToken(storedToken);
|
|
6915
6977
|
return storedToken;
|
|
6916
6978
|
}
|
|
6917
6979
|
return startGoogleDriveAuth(clientId, callbackPath);
|
|
6918
|
-
}, [
|
|
6980
|
+
}, [
|
|
6981
|
+
accessToken,
|
|
6982
|
+
clientId,
|
|
6983
|
+
callbackPath,
|
|
6984
|
+
isConfigured,
|
|
6985
|
+
apiClient,
|
|
6986
|
+
walletAddress
|
|
6987
|
+
]);
|
|
6919
6988
|
const logout = useCallback12(async () => {
|
|
6920
6989
|
await revokeGoogleDriveToken(apiClient, walletAddress);
|
|
6921
6990
|
setAccessToken(null);
|
|
@@ -8001,7 +8070,9 @@ function BackupAuthProvider({
|
|
|
8001
8070
|
if (result.ok) {
|
|
8002
8071
|
setDropboxToken(result.data);
|
|
8003
8072
|
} else {
|
|
8004
|
-
console.error(
|
|
8073
|
+
console.error(
|
|
8074
|
+
`Dropbox OAuth failed: ${result.error.code} - ${result.error.message}`
|
|
8075
|
+
);
|
|
8005
8076
|
}
|
|
8006
8077
|
}
|
|
8007
8078
|
};
|
|
@@ -8019,7 +8090,9 @@ function BackupAuthProvider({
|
|
|
8019
8090
|
if (result.ok) {
|
|
8020
8091
|
setGoogleToken(result.data);
|
|
8021
8092
|
} else {
|
|
8022
|
-
console.error(
|
|
8093
|
+
console.error(
|
|
8094
|
+
`Google Drive OAuth failed: ${result.error.code} - ${result.error.message}`
|
|
8095
|
+
);
|
|
8023
8096
|
}
|
|
8024
8097
|
}
|
|
8025
8098
|
};
|
|
@@ -8042,7 +8115,13 @@ function BackupAuthProvider({
|
|
|
8042
8115
|
return storedToken;
|
|
8043
8116
|
}
|
|
8044
8117
|
return startDropboxAuth(dropboxAppKey, dropboxCallbackPath);
|
|
8045
|
-
}, [
|
|
8118
|
+
}, [
|
|
8119
|
+
dropboxAppKey,
|
|
8120
|
+
dropboxCallbackPath,
|
|
8121
|
+
isDropboxConfigured,
|
|
8122
|
+
apiClient,
|
|
8123
|
+
walletAddress
|
|
8124
|
+
]);
|
|
8046
8125
|
const logoutDropbox = useCallback16(async () => {
|
|
8047
8126
|
await revokeDropboxToken(apiClient, walletAddress);
|
|
8048
8127
|
setDropboxToken(null);
|
|
@@ -8058,13 +8137,22 @@ function BackupAuthProvider({
|
|
|
8058
8137
|
if (!isGoogleConfigured || !googleClientId) {
|
|
8059
8138
|
throw new Error("Google Drive is not configured");
|
|
8060
8139
|
}
|
|
8061
|
-
const storedToken = await getGoogleDriveAccessToken(
|
|
8140
|
+
const storedToken = await getGoogleDriveAccessToken(
|
|
8141
|
+
apiClient,
|
|
8142
|
+
walletAddress
|
|
8143
|
+
);
|
|
8062
8144
|
if (storedToken) {
|
|
8063
8145
|
setGoogleToken(storedToken);
|
|
8064
8146
|
return storedToken;
|
|
8065
8147
|
}
|
|
8066
8148
|
return startGoogleDriveAuth(googleClientId, googleCallbackPath);
|
|
8067
|
-
}, [
|
|
8149
|
+
}, [
|
|
8150
|
+
googleClientId,
|
|
8151
|
+
googleCallbackPath,
|
|
8152
|
+
isGoogleConfigured,
|
|
8153
|
+
apiClient,
|
|
8154
|
+
walletAddress
|
|
8155
|
+
]);
|
|
8068
8156
|
const logoutGoogle = useCallback16(async () => {
|
|
8069
8157
|
await revokeGoogleDriveToken(apiClient, walletAddress);
|
|
8070
8158
|
setGoogleToken(null);
|
|
@@ -8109,7 +8197,14 @@ function BackupAuthProvider({
|
|
|
8109
8197
|
isGoogleConfigured ? logoutGoogle() : Promise.resolve(),
|
|
8110
8198
|
isIcloudConfigured ? logoutIcloud() : Promise.resolve()
|
|
8111
8199
|
]);
|
|
8112
|
-
}, [
|
|
8200
|
+
}, [
|
|
8201
|
+
isDropboxConfigured,
|
|
8202
|
+
isGoogleConfigured,
|
|
8203
|
+
isIcloudConfigured,
|
|
8204
|
+
logoutDropbox,
|
|
8205
|
+
logoutGoogle,
|
|
8206
|
+
logoutIcloud
|
|
8207
|
+
]);
|
|
8113
8208
|
const dropboxState = {
|
|
8114
8209
|
accessToken: dropboxToken,
|
|
8115
8210
|
isAuthenticated: !!dropboxToken,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reverbia/sdk",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.20260109150925",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -100,7 +100,9 @@
|
|
|
100
100
|
"typedoc": "^0.28.14",
|
|
101
101
|
"typedoc-plugin-frontmatter": "^1.3.0",
|
|
102
102
|
"typedoc-plugin-markdown": "^4.9.0",
|
|
103
|
+
"typedoc-plugin-remark": "^2.0.1",
|
|
103
104
|
"typescript": "^5.9.3",
|
|
105
|
+
"unist-util-visit": "^5.0.0",
|
|
104
106
|
"vitest": "^4.0.14"
|
|
105
107
|
},
|
|
106
108
|
"peerDependencies": {
|