@ottocode/web-sdk 0.1.291 → 0.1.293
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/components/chat/ChatInput.d.ts.map +1 -1
- package/dist/components/chat/InputSecureInputBar.d.ts +6 -0
- package/dist/components/chat/InputSecureInputBar.d.ts.map +1 -0
- package/dist/components/chat/NewSessionLanding.d.ts +1 -0
- package/dist/components/chat/NewSessionLanding.d.ts.map +1 -1
- package/dist/components/index.js +4080 -3848
- package/dist/components/index.js.map +13 -10
- package/dist/components/messages/MessageThread.d.ts.map +1 -1
- package/dist/components/messages/renderers/ProgressUpdateRenderer.d.ts.map +1 -1
- package/dist/components/messages/renderers/TodosRenderer.d.ts.map +1 -1
- package/dist/hooks/index.js +214 -115
- package/dist/hooks/index.js.map +10 -8
- package/dist/hooks/useSessionStream.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.js +4120 -3875
- package/dist/index.js.map +14 -11
- package/dist/lib/api-client/index.d.ts +21 -0
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/api-client/secure-input.d.ts +24 -0
- package/dist/lib/api-client/secure-input.d.ts.map +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/index.js +103 -65
- package/dist/lib/index.js.map +8 -7
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +34 -17
- package/dist/stores/index.js.map +4 -3
- package/dist/stores/secureInputStore.d.ts +18 -0
- package/dist/stores/secureInputStore.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -257,6 +257,27 @@ declare class ApiClient {
|
|
|
257
257
|
createdAt: number;
|
|
258
258
|
}>;
|
|
259
259
|
}>;
|
|
260
|
+
submitSecureInput: (sessionId: string, promptId: string, value: string) => Promise<{
|
|
261
|
+
ok: boolean;
|
|
262
|
+
promptId: string;
|
|
263
|
+
cancelled: boolean;
|
|
264
|
+
}>;
|
|
265
|
+
cancelSecureInput: (sessionId: string, promptId: string) => Promise<{
|
|
266
|
+
ok: boolean;
|
|
267
|
+
promptId: string;
|
|
268
|
+
cancelled: boolean;
|
|
269
|
+
}>;
|
|
270
|
+
getPendingSecureInputs: (sessionId: string) => Promise<{
|
|
271
|
+
ok: boolean;
|
|
272
|
+
pending: Array<{
|
|
273
|
+
promptId: string;
|
|
274
|
+
messageId?: string;
|
|
275
|
+
callId?: string;
|
|
276
|
+
prompt: string;
|
|
277
|
+
inputKind: "password";
|
|
278
|
+
createdAt: number;
|
|
279
|
+
}>;
|
|
280
|
+
}>;
|
|
260
281
|
getOttoRouterBalance: () => Promise<{
|
|
261
282
|
walletAddress: string;
|
|
262
283
|
balance: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api-client/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api-client/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,YAAY,EACX,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,GAC5B,MAAM,aAAa,CAAC;AAErB,cAAM,SAAS;IACd,WAAW,2CAA6B;IACxC,eAAe;aACC,CAAA;cAAgB,CAAC;gDADe;IAChD,aAAa,mFAA+B;IAC5C,aAAa,sGAA+B;IAC5C,iBAAiB,0DAAmC;IACpD,aAAa;;OAA+B;IAC5C,aAAa;;;;;OAA+B;IAC5C,YAAY;;OAA8B;IAC1C,YAAY;;;;OAA8B;IAC1C,aAAa;;;;;;;OAA+B;IAC5C,eAAe;;;iBA2ES,CAAC;kBACzB,CAAC;OA5E+C;IAChD,oBAAoB;;;iBAkFsB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EpD,aAAa,oDAA4B;IACzC,mBAAmB,oDAAkC;IAErD,kBAAkB,+DAAqC;IACvD,mBAAmB,+DAAsC;IACzD,qBAAqB,wIAAwC;IAC7D,oBAAoB,iFAAuC;IAC3D,sBAAsB,+HAAyC;IAC/D,iCAAiC,4BACiB;CAClD;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const secureInputMixin: {
|
|
2
|
+
submitSecureInput(sessionId: string, promptId: string, value: string): Promise<{
|
|
3
|
+
ok: boolean;
|
|
4
|
+
promptId: string;
|
|
5
|
+
cancelled: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
cancelSecureInput(sessionId: string, promptId: string): Promise<{
|
|
8
|
+
ok: boolean;
|
|
9
|
+
promptId: string;
|
|
10
|
+
cancelled: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
getPendingSecureInputs(sessionId: string): Promise<{
|
|
13
|
+
ok: boolean;
|
|
14
|
+
pending: Array<{
|
|
15
|
+
promptId: string;
|
|
16
|
+
messageId?: string;
|
|
17
|
+
callId?: string;
|
|
18
|
+
prompt: string;
|
|
19
|
+
inputKind: "password";
|
|
20
|
+
createdAt: number;
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=secure-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-input.d.ts","sourceRoot":"","sources":["../../../src/lib/api-client/secure-input.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;iCAEhB,MAAM,YACP,MAAM,SACT,MAAM,GACX,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;iCAcrD,MAAM,YACP,MAAM,GACd,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;sCAazB,MAAM,GAAG,OAAO,CAAC;QACxD,EAAE,EAAE,OAAO,CAAC;QACZ,OAAO,EAAE,KAAK,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,MAAM,EAAE,MAAM,CAAC;YACf,SAAS,EAAE,UAAU,CAAC;YACtB,SAAS,EAAE,MAAM,CAAC;SAClB,CAAC,CAAC;KACH,CAAC;CAOF,CAAC"}
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gCAAgC,sBAAsB,CAAC;AAEpE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBzD;AAcD,wBAAgB,8BAA8B,IAAI,MAAM,GAAG,SAAS,CAenE;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAc1D;AAED,wBAAgB,sBAAsB,SAUrC;AAgBD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,eAAO,MAAM,YAAY,QAAsB,CAAC;AAEhD,eAAO,MAAM,MAAM;;CAElB,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -17,6 +17,68 @@ import {
|
|
|
17
17
|
// src/lib/api-client/utils.ts
|
|
18
18
|
import { client } from "@ottocode/api";
|
|
19
19
|
|
|
20
|
+
// src/lib/platform.ts
|
|
21
|
+
function getPlatformWindow() {
|
|
22
|
+
if (typeof window === "undefined")
|
|
23
|
+
return null;
|
|
24
|
+
return window;
|
|
25
|
+
}
|
|
26
|
+
function openPlatformUrl(url) {
|
|
27
|
+
const win = getPlatformWindow();
|
|
28
|
+
if (!win?.OTTO_OPEN_URL)
|
|
29
|
+
return false;
|
|
30
|
+
win.OTTO_OPEN_URL(url);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function showPlatformNotification(notification) {
|
|
34
|
+
const win = getPlatformWindow();
|
|
35
|
+
if (!win?.OTTO_SHOW_NOTIFICATION)
|
|
36
|
+
return false;
|
|
37
|
+
win.OTTO_SHOW_NOTIFICATION(notification);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function listPlatformSystemFonts() {
|
|
41
|
+
const win = getPlatformWindow();
|
|
42
|
+
if (!win?.OTTO_LIST_SYSTEM_FONTS)
|
|
43
|
+
return null;
|
|
44
|
+
return win.OTTO_LIST_SYSTEM_FONTS();
|
|
45
|
+
}
|
|
46
|
+
function notifyPlatformFontFamilyChanged(fontFamily) {
|
|
47
|
+
const win = getPlatformWindow();
|
|
48
|
+
if (!win?.OTTO_SET_DESKTOP_FONT)
|
|
49
|
+
return false;
|
|
50
|
+
win.OTTO_SET_DESKTOP_FONT(fontFamily);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
function openPlatformSession(sessionId) {
|
|
54
|
+
const win = getPlatformWindow();
|
|
55
|
+
if (!win?.OTTO_OPEN_SESSION)
|
|
56
|
+
return false;
|
|
57
|
+
win.OTTO_OPEN_SESSION(sessionId);
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
function getPlatformWindowFocused() {
|
|
61
|
+
const win = getPlatformWindow();
|
|
62
|
+
if (!win?.OTTO_IS_WINDOW_FOCUSED)
|
|
63
|
+
return null;
|
|
64
|
+
return win.OTTO_IS_WINDOW_FOCUSED();
|
|
65
|
+
}
|
|
66
|
+
function hasPlatformOpenUrl() {
|
|
67
|
+
return !!getPlatformWindow()?.OTTO_OPEN_URL;
|
|
68
|
+
}
|
|
69
|
+
function hasPlatformSystemFonts() {
|
|
70
|
+
return !!getPlatformWindow()?.OTTO_LIST_SYSTEM_FONTS;
|
|
71
|
+
}
|
|
72
|
+
function isPlatformDesktop() {
|
|
73
|
+
if (typeof window === "undefined")
|
|
74
|
+
return false;
|
|
75
|
+
try {
|
|
76
|
+
return "__TAURI__" in window || "__TAURI_INTERNALS__" in window || "__TAURI_METADATA__" in window;
|
|
77
|
+
} catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
20
82
|
// src/lib/config.ts
|
|
21
83
|
var RUNTIME_API_BASE_URL_STORAGE_KEY = "otto-api-base-url";
|
|
22
84
|
function normalizeApiBaseUrl(value) {
|
|
@@ -40,6 +102,8 @@ function normalizeApiBaseUrl(value) {
|
|
|
40
102
|
function getStoredApiBaseUrl() {
|
|
41
103
|
if (typeof window === "undefined")
|
|
42
104
|
return;
|
|
105
|
+
if (isPlatformDesktop())
|
|
106
|
+
return;
|
|
43
107
|
try {
|
|
44
108
|
return window.localStorage.getItem(RUNTIME_API_BASE_URL_STORAGE_KEY) ?? undefined;
|
|
45
109
|
} catch {
|
|
@@ -71,9 +135,11 @@ function setRuntimeApiBaseUrl(value) {
|
|
|
71
135
|
if (typeof window !== "undefined") {
|
|
72
136
|
const win = window;
|
|
73
137
|
win.OTTO_SERVER_URL = baseUrl;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
138
|
+
if (!isPlatformDesktop()) {
|
|
139
|
+
try {
|
|
140
|
+
window.localStorage.setItem(RUNTIME_API_BASE_URL_STORAGE_KEY, baseUrl);
|
|
141
|
+
} catch {}
|
|
142
|
+
}
|
|
77
143
|
}
|
|
78
144
|
return baseUrl;
|
|
79
145
|
}
|
|
@@ -1100,6 +1166,36 @@ var dictationMixin = {
|
|
|
1100
1166
|
getDictationModelInstallEventsUrl: buildInstallEventsUrl
|
|
1101
1167
|
};
|
|
1102
1168
|
|
|
1169
|
+
// src/lib/api-client/secure-input.ts
|
|
1170
|
+
var secureInputMixin = {
|
|
1171
|
+
async submitSecureInput(sessionId, promptId, value) {
|
|
1172
|
+
const response = await fetch(`${getBaseUrl()}/v1/sessions/${encodeURIComponent(sessionId)}/secure-input`, {
|
|
1173
|
+
method: "POST",
|
|
1174
|
+
headers: { "Content-Type": "application/json" },
|
|
1175
|
+
body: JSON.stringify({ promptId, value })
|
|
1176
|
+
});
|
|
1177
|
+
if (!response.ok)
|
|
1178
|
+
throw new Error("Failed to submit secure input");
|
|
1179
|
+
return response.json();
|
|
1180
|
+
},
|
|
1181
|
+
async cancelSecureInput(sessionId, promptId) {
|
|
1182
|
+
const response = await fetch(`${getBaseUrl()}/v1/sessions/${encodeURIComponent(sessionId)}/secure-input`, {
|
|
1183
|
+
method: "POST",
|
|
1184
|
+
headers: { "Content-Type": "application/json" },
|
|
1185
|
+
body: JSON.stringify({ promptId, cancelled: true })
|
|
1186
|
+
});
|
|
1187
|
+
if (!response.ok)
|
|
1188
|
+
throw new Error("Failed to cancel secure input");
|
|
1189
|
+
return response.json();
|
|
1190
|
+
},
|
|
1191
|
+
async getPendingSecureInputs(sessionId) {
|
|
1192
|
+
const response = await fetch(`${getBaseUrl()}/v1/sessions/${encodeURIComponent(sessionId)}/secure-input/pending`);
|
|
1193
|
+
if (!response.ok)
|
|
1194
|
+
throw new Error("Failed to get pending secure inputs");
|
|
1195
|
+
return response.json();
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1103
1199
|
// src/lib/api-client/index.ts
|
|
1104
1200
|
class ApiClient {
|
|
1105
1201
|
getSessions = sessionsMixin.getSessions;
|
|
@@ -1158,6 +1254,9 @@ class ApiClient {
|
|
|
1158
1254
|
syncSession = branchesMixin.syncSession;
|
|
1159
1255
|
approveToolCall = approvalMixin.approveToolCall;
|
|
1160
1256
|
getPendingApprovals = approvalMixin.getPendingApprovals;
|
|
1257
|
+
submitSecureInput = secureInputMixin.submitSecureInput;
|
|
1258
|
+
cancelSecureInput = secureInputMixin.cancelSecureInput;
|
|
1259
|
+
getPendingSecureInputs = secureInputMixin.getPendingSecureInputs;
|
|
1161
1260
|
getOttoRouterBalance = ottorouterMixin.getOttoRouterBalance;
|
|
1162
1261
|
getOttoRouterWallet = ottorouterMixin.getOttoRouterWallet;
|
|
1163
1262
|
getOttoRouterUsdcBalance = ottorouterMixin.getOttoRouterUsdcBalance;
|
|
@@ -1316,67 +1415,6 @@ class SSEClient {
|
|
|
1316
1415
|
}
|
|
1317
1416
|
}
|
|
1318
1417
|
}
|
|
1319
|
-
// src/lib/platform.ts
|
|
1320
|
-
function getPlatformWindow() {
|
|
1321
|
-
if (typeof window === "undefined")
|
|
1322
|
-
return null;
|
|
1323
|
-
return window;
|
|
1324
|
-
}
|
|
1325
|
-
function openPlatformUrl(url) {
|
|
1326
|
-
const win = getPlatformWindow();
|
|
1327
|
-
if (!win?.OTTO_OPEN_URL)
|
|
1328
|
-
return false;
|
|
1329
|
-
win.OTTO_OPEN_URL(url);
|
|
1330
|
-
return true;
|
|
1331
|
-
}
|
|
1332
|
-
function showPlatformNotification(notification) {
|
|
1333
|
-
const win = getPlatformWindow();
|
|
1334
|
-
if (!win?.OTTO_SHOW_NOTIFICATION)
|
|
1335
|
-
return false;
|
|
1336
|
-
win.OTTO_SHOW_NOTIFICATION(notification);
|
|
1337
|
-
return true;
|
|
1338
|
-
}
|
|
1339
|
-
function listPlatformSystemFonts() {
|
|
1340
|
-
const win = getPlatformWindow();
|
|
1341
|
-
if (!win?.OTTO_LIST_SYSTEM_FONTS)
|
|
1342
|
-
return null;
|
|
1343
|
-
return win.OTTO_LIST_SYSTEM_FONTS();
|
|
1344
|
-
}
|
|
1345
|
-
function notifyPlatformFontFamilyChanged(fontFamily) {
|
|
1346
|
-
const win = getPlatformWindow();
|
|
1347
|
-
if (!win?.OTTO_SET_DESKTOP_FONT)
|
|
1348
|
-
return false;
|
|
1349
|
-
win.OTTO_SET_DESKTOP_FONT(fontFamily);
|
|
1350
|
-
return true;
|
|
1351
|
-
}
|
|
1352
|
-
function openPlatformSession(sessionId) {
|
|
1353
|
-
const win = getPlatformWindow();
|
|
1354
|
-
if (!win?.OTTO_OPEN_SESSION)
|
|
1355
|
-
return false;
|
|
1356
|
-
win.OTTO_OPEN_SESSION(sessionId);
|
|
1357
|
-
return true;
|
|
1358
|
-
}
|
|
1359
|
-
function getPlatformWindowFocused() {
|
|
1360
|
-
const win = getPlatformWindow();
|
|
1361
|
-
if (!win?.OTTO_IS_WINDOW_FOCUSED)
|
|
1362
|
-
return null;
|
|
1363
|
-
return win.OTTO_IS_WINDOW_FOCUSED();
|
|
1364
|
-
}
|
|
1365
|
-
function hasPlatformOpenUrl() {
|
|
1366
|
-
return !!getPlatformWindow()?.OTTO_OPEN_URL;
|
|
1367
|
-
}
|
|
1368
|
-
function hasPlatformSystemFonts() {
|
|
1369
|
-
return !!getPlatformWindow()?.OTTO_LIST_SYSTEM_FONTS;
|
|
1370
|
-
}
|
|
1371
|
-
function isPlatformDesktop() {
|
|
1372
|
-
if (typeof window === "undefined")
|
|
1373
|
-
return false;
|
|
1374
|
-
try {
|
|
1375
|
-
return "__TAURI__" in window || "__TAURI_INTERNALS__" in window || "__TAURI_METADATA__" in window;
|
|
1376
|
-
} catch {
|
|
1377
|
-
return false;
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
1418
|
export {
|
|
1381
1419
|
showPlatformNotification,
|
|
1382
1420
|
setRuntimeApiBaseUrl,
|
|
@@ -1401,4 +1439,4 @@ export {
|
|
|
1401
1439
|
API_BASE_URL
|
|
1402
1440
|
};
|
|
1403
1441
|
|
|
1404
|
-
//# debugId=
|
|
1442
|
+
//# debugId=275BCE73BE2B1B8A64756E2164756E21
|