@ottocode/web-sdk 0.1.244 → 0.1.246
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/assets/provider-logos.d.ts +1 -0
- package/dist/assets/provider-logos.d.ts.map +1 -1
- package/dist/components/chat/UnifiedModelSelector.d.ts.map +1 -1
- package/dist/components/common/ProviderLogo.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +757 -560
- package/dist/components/index.js.map +33 -32
- package/dist/components/mcp/MCPSidebar.d.ts.map +1 -1
- package/dist/components/messages/ActionToolBox.d.ts.map +1 -1
- package/dist/components/onboarding/steps/ProviderSetupStep.d.ts.map +1 -1
- package/dist/components/settings/{SetuTopupModal.d.ts → OttoRouterTopupModal.d.ts} +2 -2
- package/dist/components/settings/OttoRouterTopupModal.d.ts.map +1 -0
- package/dist/components/skills/SkillsSidebar.d.ts.map +1 -1
- package/dist/components/ui/ToggleSwitch.d.ts +7 -0
- package/dist/components/ui/ToggleSwitch.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +120 -78
- package/dist/hooks/index.js.map +17 -17
- package/dist/hooks/useAuthStatus.d.ts +1 -1
- package/dist/hooks/useAuthStatus.d.ts.map +1 -1
- package/dist/hooks/useConfig.d.ts +7 -0
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useOttoRouterBalance.d.ts +4 -0
- package/dist/hooks/useOttoRouterBalance.d.ts.map +1 -0
- package/dist/hooks/useSkills.d.ts +8 -3
- package/dist/hooks/useSkills.d.ts.map +1 -1
- package/dist/index.js +771 -573
- package/dist/index.js.map +34 -33
- package/dist/lib/api-client/auth.d.ts +4 -4
- package/dist/lib/api-client/auth.d.ts.map +1 -1
- package/dist/lib/api-client/config.d.ts +7 -0
- package/dist/lib/api-client/config.d.ts.map +1 -1
- package/dist/lib/api-client/index.d.ts +22 -7
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/api-client/{setu.d.ts → ottorouter.d.ts} +5 -5
- package/dist/lib/api-client/ottorouter.d.ts.map +1 -0
- package/dist/lib/api-client/skills.d.ts +15 -0
- package/dist/lib/api-client/skills.d.ts.map +1 -1
- package/dist/lib/index.js +46 -30
- package/dist/lib/index.js.map +8 -8
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +8 -4
- package/dist/stores/index.js.map +6 -6
- package/dist/stores/onboardingStore.d.ts +1 -1
- package/dist/stores/onboardingStore.d.ts.map +1 -1
- package/dist/stores/{setuStore.d.ts → ottorouterStore.d.ts} +15 -15
- package/dist/stores/ottorouterStore.d.ts.map +1 -0
- package/dist/stores/skillsStore.d.ts +10 -0
- package/dist/stores/skillsStore.d.ts.map +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/settings/SetuTopupModal.d.ts.map +0 -1
- package/dist/hooks/useSetuBalance.d.ts +0 -4
- package/dist/hooks/useSetuBalance.d.ts.map +0 -1
- package/dist/lib/api-client/setu.d.ts.map +0 -1
- package/dist/stores/setuStore.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MCPSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/mcp/MCPSidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MCPSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/mcp/MCPSidebar.tsx"],"names":[],"mappings":"AAoQA,eAAO,MAAM,UAAU,8CAgQrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionToolBox.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ActionToolBox.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA4InD,UAAU,kBAAkB;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ActionToolBox.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ActionToolBox.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA4InD,UAAU,kBAAkB;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CA6PnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderSetupStep.d.ts","sourceRoot":"","sources":["../../../../src/components/onboarding/steps/ProviderSetupStep.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAKlE,UAAU,sBAAsB;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjE,kBAAkB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,KACT,OAAO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OAAO,CAAC;QACvB,YAAY,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC,CAAC;IACH,0BAA0B,CAAC,EAAE,MAAM,OAAO,CAAC;QAC1C,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,IAAI,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC,CAAC;IACH,uBAAuB,CAAC,EAAE,MAAM,OAAO,CAAC;QACvC,YAAY,EAAE,KAAK,CAAC;YACnB,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC;YACzB,UAAU,EAAE,OAAO,CAAC;YACpB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;YAChC,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,KAAK,CAAC,EAAE,MAAM,CAAC;SACf,CAAC,CAAC;QACH,OAAO,EAAE;YACR,KAAK,EAAE,OAAO,CAAC;YACf,KAAK,EAAE,OAAO,CAAC;YACf,QAAQ,EAAE;gBAAE,SAAS,EAAE,OAAO,CAAC;gBAAC,aAAa,EAAE,OAAO,CAAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SAC1E,CAAC;KACF,CAAC,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ProviderSetupStep.d.ts","sourceRoot":"","sources":["../../../../src/components/onboarding/steps/ProviderSetupStep.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAKlE,UAAU,sBAAsB;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,cAAc,EAAE,CAAC,UAAU,EA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AAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SAC1E,CAAC;KACF,CAAC,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,8DAokC5B,CAAC"}
|
|
@@ -6,5 +6,5 @@ declare global {
|
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
10
|
-
//# sourceMappingURL=
|
|
9
|
+
export declare const OttoRouterTopupModal: import("react").NamedExoticComponent<object>;
|
|
10
|
+
//# sourceMappingURL=OttoRouterTopupModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OttoRouterTopupModal.d.ts","sourceRoot":"","sources":["../../../src/components/settings/OttoRouterTopupModal.tsx"],"names":[],"mappings":"AA6CA,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,QAAQ,EAAE,KACT,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B;YACJ,IAAI,EAAE,MAAM,IAAI,CAAC;YACjB,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;SACjD,CAAC;KACF;CACD;AA0DD,eAAO,MAAM,oBAAoB,8CAqlB/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillsSidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SkillsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillsSidebar.tsx"],"names":[],"mappings":"AA4CA,eAAO,MAAM,aAAa,8CAgPxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/ToggleSwitch.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;aAMf,OAAO;cACN,OAAO;cACP,MAAM,IAAI;eACT,OAAO;EA2BjB,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export * from './useQueueState';
|
|
|
15
15
|
export * from './useBranch';
|
|
16
16
|
export * from './useResearch';
|
|
17
17
|
export * from './useSetuPayments';
|
|
18
|
-
export * from './
|
|
18
|
+
export * from './useOttoRouterBalance';
|
|
19
19
|
export * from './useShareStatus';
|
|
20
20
|
export * from './useToolApprovalShortcuts';
|
|
21
21
|
export * from './useTopupCallback';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -503,11 +503,11 @@ var approvalMixin = {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
|
|
506
|
-
// src/lib/api-client/
|
|
506
|
+
// src/lib/api-client/ottorouter.ts
|
|
507
507
|
import {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
508
|
+
getOttoRouterBalance as apiGetSetuBalance,
|
|
509
|
+
getOttoRouterWallet as apiGetSetuWallet,
|
|
510
|
+
getOttoRouterUsdcBalance as apiGetSetuUsdcBalance,
|
|
511
511
|
createPolarCheckout as apiCreatePolarCheckout,
|
|
512
512
|
getPolarTopupEstimate as apiGetPolarTopupEstimate,
|
|
513
513
|
getPolarTopupStatus as apiGetPolarTopupStatus,
|
|
@@ -518,8 +518,8 @@ import {
|
|
|
518
518
|
cancelTopup as apiCancelTopup,
|
|
519
519
|
getPendingTopup as apiGetPendingTopup
|
|
520
520
|
} from "@ottocode/api";
|
|
521
|
-
var
|
|
522
|
-
async
|
|
521
|
+
var ottorouterMixin = {
|
|
522
|
+
async getOttoRouterBalance() {
|
|
523
523
|
try {
|
|
524
524
|
const response = await apiGetSetuBalance();
|
|
525
525
|
if (response.error)
|
|
@@ -529,7 +529,7 @@ var setuMixin = {
|
|
|
529
529
|
return null;
|
|
530
530
|
}
|
|
531
531
|
},
|
|
532
|
-
async
|
|
532
|
+
async getOttoRouterWallet() {
|
|
533
533
|
try {
|
|
534
534
|
const response = await apiGetSetuWallet();
|
|
535
535
|
if (response.error)
|
|
@@ -539,7 +539,7 @@ var setuMixin = {
|
|
|
539
539
|
return { configured: false };
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
|
-
async
|
|
542
|
+
async getOttoRouterUsdcBalance(network = "mainnet") {
|
|
543
543
|
try {
|
|
544
544
|
const response = await apiGetSetuUsdcBalance({
|
|
545
545
|
query: { network }
|
|
@@ -644,9 +644,9 @@ var setuMixin = {
|
|
|
644
644
|
// src/lib/api-client/auth.ts
|
|
645
645
|
import {
|
|
646
646
|
getAuthStatus as apiGetAuthStatus,
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
647
|
+
setupOttoRouterWallet as apiSetupSetuWallet,
|
|
648
|
+
importOttoRouterWallet as apiImportSetuWallet,
|
|
649
|
+
exportOttoRouterWallet as apiExportSetuWallet,
|
|
650
650
|
addProviderApiKey as apiAddProviderApiKey,
|
|
651
651
|
removeProvider as apiRemoveProvider,
|
|
652
652
|
completeOnboarding as apiCompleteOnboarding,
|
|
@@ -667,13 +667,13 @@ var authMixin = {
|
|
|
667
667
|
throw new Error(extractErrorMessage(response.error));
|
|
668
668
|
return response.data;
|
|
669
669
|
},
|
|
670
|
-
async
|
|
670
|
+
async setupOttoRouterWallet() {
|
|
671
671
|
const response = await apiSetupSetuWallet();
|
|
672
672
|
if (response.error)
|
|
673
673
|
throw new Error(extractErrorMessage(response.error));
|
|
674
674
|
return response.data;
|
|
675
675
|
},
|
|
676
|
-
async
|
|
676
|
+
async importOttoRouterWallet(privateKey) {
|
|
677
677
|
const response = await apiImportSetuWallet({
|
|
678
678
|
body: { privateKey }
|
|
679
679
|
});
|
|
@@ -681,7 +681,7 @@ var authMixin = {
|
|
|
681
681
|
throw new Error(extractErrorMessage(response.error));
|
|
682
682
|
return response.data;
|
|
683
683
|
},
|
|
684
|
-
async
|
|
684
|
+
async exportOttoRouterWallet() {
|
|
685
685
|
const response = await apiExportSetuWallet();
|
|
686
686
|
if (response.error)
|
|
687
687
|
throw new Error(extractErrorMessage(response.error));
|
|
@@ -782,6 +782,8 @@ var authMixin = {
|
|
|
782
782
|
|
|
783
783
|
// src/lib/api-client/skills.ts
|
|
784
784
|
import {
|
|
785
|
+
getSkillsConfig as apiGetSkillsConfig,
|
|
786
|
+
updateSkillsConfig as apiUpdateSkillsConfig,
|
|
785
787
|
listSkills as apiListSkills,
|
|
786
788
|
getSkill as apiGetSkill,
|
|
787
789
|
listSkillFiles as apiListSkillFiles,
|
|
@@ -813,6 +815,18 @@ var skillsMixin = {
|
|
|
813
815
|
if (response.error)
|
|
814
816
|
throw new Error(extractErrorMessage(response.error));
|
|
815
817
|
return response.data;
|
|
818
|
+
},
|
|
819
|
+
async getSkillsConfig() {
|
|
820
|
+
const response = await apiGetSkillsConfig();
|
|
821
|
+
if (response.error)
|
|
822
|
+
throw new Error(extractErrorMessage(response.error));
|
|
823
|
+
return response.data;
|
|
824
|
+
},
|
|
825
|
+
async updateSkillsConfig(input) {
|
|
826
|
+
const response = await apiUpdateSkillsConfig({ body: input });
|
|
827
|
+
if (response.error)
|
|
828
|
+
throw new Error(extractErrorMessage(response.error));
|
|
829
|
+
return response.data;
|
|
816
830
|
}
|
|
817
831
|
};
|
|
818
832
|
|
|
@@ -863,22 +877,22 @@ class ApiClient {
|
|
|
863
877
|
syncSession = branchesMixin.syncSession;
|
|
864
878
|
approveToolCall = approvalMixin.approveToolCall;
|
|
865
879
|
getPendingApprovals = approvalMixin.getPendingApprovals;
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
getPolarTopupEstimate =
|
|
870
|
-
createPolarCheckout =
|
|
871
|
-
selectTopupMethod =
|
|
872
|
-
cancelTopup =
|
|
873
|
-
getPendingTopup =
|
|
874
|
-
getPolarTopupStatus =
|
|
875
|
-
getRazorpayTopupEstimate =
|
|
876
|
-
createRazorpayOrder =
|
|
877
|
-
verifyRazorpayPayment =
|
|
880
|
+
getOttoRouterBalance = ottorouterMixin.getOttoRouterBalance;
|
|
881
|
+
getOttoRouterWallet = ottorouterMixin.getOttoRouterWallet;
|
|
882
|
+
getOttoRouterUsdcBalance = ottorouterMixin.getOttoRouterUsdcBalance;
|
|
883
|
+
getPolarTopupEstimate = ottorouterMixin.getPolarTopupEstimate;
|
|
884
|
+
createPolarCheckout = ottorouterMixin.createPolarCheckout;
|
|
885
|
+
selectTopupMethod = ottorouterMixin.selectTopupMethod;
|
|
886
|
+
cancelTopup = ottorouterMixin.cancelTopup;
|
|
887
|
+
getPendingTopup = ottorouterMixin.getPendingTopup;
|
|
888
|
+
getPolarTopupStatus = ottorouterMixin.getPolarTopupStatus;
|
|
889
|
+
getRazorpayTopupEstimate = ottorouterMixin.getRazorpayTopupEstimate;
|
|
890
|
+
createRazorpayOrder = ottorouterMixin.createRazorpayOrder;
|
|
891
|
+
verifyRazorpayPayment = ottorouterMixin.verifyRazorpayPayment;
|
|
878
892
|
getAuthStatus = authMixin.getAuthStatus;
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
893
|
+
setupOttoRouterWallet = authMixin.setupOttoRouterWallet;
|
|
894
|
+
importOttoRouterWallet = authMixin.importOttoRouterWallet;
|
|
895
|
+
exportOttoRouterWallet = authMixin.exportOttoRouterWallet;
|
|
882
896
|
addProvider = authMixin.addProvider;
|
|
883
897
|
removeProvider = authMixin.removeProvider;
|
|
884
898
|
completeOnboarding = authMixin.completeOnboarding;
|
|
@@ -896,6 +910,8 @@ class ApiClient {
|
|
|
896
910
|
getSkill = skillsMixin.getSkill;
|
|
897
911
|
getSkillFiles = skillsMixin.getSkillFiles;
|
|
898
912
|
getSkillFileContent = skillsMixin.getSkillFileContent;
|
|
913
|
+
getSkillsConfig = skillsMixin.getSkillsConfig;
|
|
914
|
+
updateSkillsConfig = skillsMixin.updateSkillsConfig;
|
|
899
915
|
}
|
|
900
916
|
var apiClient = new ApiClient;
|
|
901
917
|
|
|
@@ -1073,6 +1089,9 @@ import { create } from "zustand";
|
|
|
1073
1089
|
var useSkillsStore = create((set) => ({
|
|
1074
1090
|
isExpanded: false,
|
|
1075
1091
|
skills: [],
|
|
1092
|
+
globalEnabled: true,
|
|
1093
|
+
totalCount: 0,
|
|
1094
|
+
enabledCount: 0,
|
|
1076
1095
|
selectedSkill: null,
|
|
1077
1096
|
isViewerOpen: false,
|
|
1078
1097
|
viewingFile: null,
|
|
@@ -1103,6 +1122,7 @@ var useSkillsStore = create((set) => ({
|
|
|
1103
1122
|
},
|
|
1104
1123
|
collapseSidebar: () => set({ isExpanded: false }),
|
|
1105
1124
|
setSkills: (skills) => set({ skills }),
|
|
1125
|
+
setSkillsConfig: ({ skills, globalEnabled, totalCount, enabledCount }) => set({ skills, globalEnabled, totalCount, enabledCount }),
|
|
1106
1126
|
selectSkill: (name) => set({ selectedSkill: name, isViewerOpen: false, viewingFile: null }),
|
|
1107
1127
|
openViewer: (file) => set({ isViewerOpen: true, viewingFile: file }),
|
|
1108
1128
|
closeViewer: () => set({ isViewerOpen: false, viewingFile: null })
|
|
@@ -3773,9 +3793,9 @@ toast.successWithAction = (message, action, duration = 6000) => {
|
|
|
3773
3793
|
return id;
|
|
3774
3794
|
};
|
|
3775
3795
|
|
|
3776
|
-
// src/stores/
|
|
3796
|
+
// src/stores/ottorouterStore.ts
|
|
3777
3797
|
import { create as create15 } from "zustand";
|
|
3778
|
-
var
|
|
3798
|
+
var useOttoRouterStore = create15((set) => ({
|
|
3779
3799
|
balance: null,
|
|
3780
3800
|
usdcBalance: null,
|
|
3781
3801
|
network: "mainnet",
|
|
@@ -3819,8 +3839,8 @@ var useTopupApprovalStore = create16((set) => ({
|
|
|
3819
3839
|
function useSetuPayments(sessionId) {
|
|
3820
3840
|
const clientRef = useRef2(null);
|
|
3821
3841
|
const loadingToastIdRef = useRef2(null);
|
|
3822
|
-
const setBalance =
|
|
3823
|
-
const setPaymentPending =
|
|
3842
|
+
const setBalance = useOttoRouterStore((s) => s.setBalance);
|
|
3843
|
+
const setPaymentPending = useOttoRouterStore((s) => s.setPaymentPending);
|
|
3824
3844
|
const removeToast = useToastStore((s) => s.removeToast);
|
|
3825
3845
|
const updateToast = useToastStore((s) => s.updateToast);
|
|
3826
3846
|
const setPendingTopup = useTopupApprovalStore((s) => s.setPendingTopup);
|
|
@@ -3835,7 +3855,7 @@ function useSetuPayments(sessionId) {
|
|
|
3835
3855
|
const unsubscribe = client2.on("*", (event) => {
|
|
3836
3856
|
const payload = event.payload;
|
|
3837
3857
|
switch (event.type) {
|
|
3838
|
-
case "
|
|
3858
|
+
case "ottorouter.topup.required": {
|
|
3839
3859
|
const amountUsd = typeof payload?.amountUsd === "number" ? payload.amountUsd : 0;
|
|
3840
3860
|
const currentBalance = typeof payload?.currentBalance === "number" ? payload.currentBalance : 0;
|
|
3841
3861
|
const minTopupUsd = typeof payload?.minTopupUsd === "number" ? payload.minTopupUsd : 5;
|
|
@@ -3851,7 +3871,7 @@ function useSetuPayments(sessionId) {
|
|
|
3851
3871
|
});
|
|
3852
3872
|
break;
|
|
3853
3873
|
}
|
|
3854
|
-
case "
|
|
3874
|
+
case "ottorouter.topup.method_selected": {
|
|
3855
3875
|
const method = payload?.method;
|
|
3856
3876
|
if (method === "crypto") {
|
|
3857
3877
|
setPaymentPending(true);
|
|
@@ -3859,13 +3879,13 @@ function useSetuPayments(sessionId) {
|
|
|
3859
3879
|
}
|
|
3860
3880
|
break;
|
|
3861
3881
|
}
|
|
3862
|
-
case "
|
|
3882
|
+
case "ottorouter.topup.cancelled": {
|
|
3863
3883
|
clearPendingTopup();
|
|
3864
3884
|
const reason = typeof payload?.reason === "string" ? payload.reason : "Request cancelled";
|
|
3865
3885
|
toast(`⚠️ ${reason}`);
|
|
3866
3886
|
break;
|
|
3867
3887
|
}
|
|
3868
|
-
case "
|
|
3888
|
+
case "ottorouter.payment.required": {
|
|
3869
3889
|
const amountUsd = typeof payload?.amountUsd === "number" ? payload.amountUsd : 0;
|
|
3870
3890
|
setPaymentPending(true);
|
|
3871
3891
|
if (!loadingToastIdRef.current) {
|
|
@@ -3873,7 +3893,7 @@ function useSetuPayments(sessionId) {
|
|
|
3873
3893
|
}
|
|
3874
3894
|
break;
|
|
3875
3895
|
}
|
|
3876
|
-
case "
|
|
3896
|
+
case "ottorouter.payment.signing": {
|
|
3877
3897
|
if (loadingToastIdRef.current) {
|
|
3878
3898
|
updateToast(loadingToastIdRef.current, {
|
|
3879
3899
|
message: "✍️ Signing transaction..."
|
|
@@ -3883,7 +3903,7 @@ function useSetuPayments(sessionId) {
|
|
|
3883
3903
|
}
|
|
3884
3904
|
break;
|
|
3885
3905
|
}
|
|
3886
|
-
case "
|
|
3906
|
+
case "ottorouter.payment.complete": {
|
|
3887
3907
|
clearPendingTopup();
|
|
3888
3908
|
const rawAmount = payload?.amountUsd;
|
|
3889
3909
|
const rawBalance = payload?.newBalance;
|
|
@@ -3907,7 +3927,7 @@ function useSetuPayments(sessionId) {
|
|
|
3907
3927
|
}
|
|
3908
3928
|
break;
|
|
3909
3929
|
}
|
|
3910
|
-
case "
|
|
3930
|
+
case "ottorouter.fiat.checkout_created": {
|
|
3911
3931
|
clearPendingTopup();
|
|
3912
3932
|
setPaymentPending(false);
|
|
3913
3933
|
if (loadingToastIdRef.current) {
|
|
@@ -3917,7 +3937,7 @@ function useSetuPayments(sessionId) {
|
|
|
3917
3937
|
toast.success("\uD83D\uDCB3 Complete payment, then retry your message");
|
|
3918
3938
|
break;
|
|
3919
3939
|
}
|
|
3920
|
-
case "
|
|
3940
|
+
case "ottorouter.balance.updated": {
|
|
3921
3941
|
const rawBalance = payload?.balanceRemaining;
|
|
3922
3942
|
const newBalance = typeof rawBalance === "number" ? rawBalance : typeof rawBalance === "string" ? parseFloat(rawBalance) : null;
|
|
3923
3943
|
if (newBalance !== null && !Number.isNaN(newBalance)) {
|
|
@@ -3925,7 +3945,7 @@ function useSetuPayments(sessionId) {
|
|
|
3925
3945
|
}
|
|
3926
3946
|
break;
|
|
3927
3947
|
}
|
|
3928
|
-
case "
|
|
3948
|
+
case "ottorouter.payment.error": {
|
|
3929
3949
|
clearPendingTopup();
|
|
3930
3950
|
const error = typeof payload?.error === "string" ? payload.error : "Payment failed";
|
|
3931
3951
|
setPaymentPending(false);
|
|
@@ -3954,7 +3974,7 @@ function useSetuPayments(sessionId) {
|
|
|
3954
3974
|
clearPendingTopup
|
|
3955
3975
|
]);
|
|
3956
3976
|
}
|
|
3957
|
-
// src/hooks/
|
|
3977
|
+
// src/hooks/useOttoRouterBalance.ts
|
|
3958
3978
|
import { useEffect as useEffect8, useCallback as useCallback6 } from "react";
|
|
3959
3979
|
|
|
3960
3980
|
// src/stores/usageStore.ts
|
|
@@ -3972,31 +3992,31 @@ var useUsageStore = create17((set) => ({
|
|
|
3972
3992
|
closeModal: () => set({ isModalOpen: false, modalProvider: null })
|
|
3973
3993
|
}));
|
|
3974
3994
|
|
|
3975
|
-
// src/hooks/
|
|
3976
|
-
function
|
|
3977
|
-
const setBalance =
|
|
3978
|
-
const setUsdcBalance =
|
|
3979
|
-
const setWalletAddress =
|
|
3980
|
-
const setLoading =
|
|
3981
|
-
const setScope =
|
|
3982
|
-
const setPayg =
|
|
3983
|
-
const setSubscription =
|
|
3984
|
-
const setLimits =
|
|
3995
|
+
// src/hooks/useOttoRouterBalance.ts
|
|
3996
|
+
function useOttoRouterBalance(providerName) {
|
|
3997
|
+
const setBalance = useOttoRouterStore((s) => s.setBalance);
|
|
3998
|
+
const setUsdcBalance = useOttoRouterStore((s) => s.setUsdcBalance);
|
|
3999
|
+
const setWalletAddress = useOttoRouterStore((s) => s.setWalletAddress);
|
|
4000
|
+
const setLoading = useOttoRouterStore((s) => s.setLoading);
|
|
4001
|
+
const setScope = useOttoRouterStore((s) => s.setScope);
|
|
4002
|
+
const setPayg = useOttoRouterStore((s) => s.setPayg);
|
|
4003
|
+
const setSubscription = useOttoRouterStore((s) => s.setSubscription);
|
|
4004
|
+
const setLimits = useOttoRouterStore((s) => s.setLimits);
|
|
3985
4005
|
const setUsage = useUsageStore((s) => s.setUsage);
|
|
3986
|
-
const balance =
|
|
3987
|
-
const usdcBalance =
|
|
3988
|
-
const subscription =
|
|
3989
|
-
const network =
|
|
4006
|
+
const balance = useOttoRouterStore((s) => s.balance);
|
|
4007
|
+
const usdcBalance = useOttoRouterStore((s) => s.usdcBalance);
|
|
4008
|
+
const subscription = useOttoRouterStore((s) => s.subscription);
|
|
4009
|
+
const network = useOttoRouterStore((s) => s.network);
|
|
3990
4010
|
const fetchBalance = useCallback6(async () => {
|
|
3991
|
-
if (providerName !== "
|
|
4011
|
+
if (providerName !== "ottorouter") {
|
|
3992
4012
|
return;
|
|
3993
4013
|
}
|
|
3994
4014
|
setLoading(true);
|
|
3995
4015
|
try {
|
|
3996
4016
|
const [setuData, usdcData, walletData] = await Promise.all([
|
|
3997
|
-
apiClient.
|
|
3998
|
-
apiClient.
|
|
3999
|
-
apiClient.
|
|
4017
|
+
apiClient.getOttoRouterBalance(),
|
|
4018
|
+
apiClient.getOttoRouterUsdcBalance(network),
|
|
4019
|
+
apiClient.getOttoRouterWallet()
|
|
4000
4020
|
]);
|
|
4001
4021
|
if (setuData) {
|
|
4002
4022
|
setBalance(setuData.balance);
|
|
@@ -4007,8 +4027,8 @@ function useSetuBalance(providerName) {
|
|
|
4007
4027
|
setLimits(setuData.limits ?? null);
|
|
4008
4028
|
const sub = setuData.subscription;
|
|
4009
4029
|
if (sub?.active && sub.usageWindows) {
|
|
4010
|
-
setUsage("
|
|
4011
|
-
provider: "
|
|
4030
|
+
setUsage("ottorouter", {
|
|
4031
|
+
provider: "ottorouter",
|
|
4012
4032
|
primaryWindow: {
|
|
4013
4033
|
usedPercent: sub.usageWindows.fiveHour.percentUsed,
|
|
4014
4034
|
windowSeconds: 18000,
|
|
@@ -4050,7 +4070,7 @@ function useSetuBalance(providerName) {
|
|
|
4050
4070
|
]);
|
|
4051
4071
|
const needsUsageWindows = subscription?.active && !subscription.usageWindows;
|
|
4052
4072
|
useEffect8(() => {
|
|
4053
|
-
if (providerName === "
|
|
4073
|
+
if (providerName === "ottorouter" && (balance === null || usdcBalance === null || needsUsageWindows)) {
|
|
4054
4074
|
fetchBalance();
|
|
4055
4075
|
}
|
|
4056
4076
|
}, [providerName, balance, usdcBalance, needsUsageWindows, fetchBalance]);
|
|
@@ -4141,7 +4161,7 @@ var STORAGE_KEY3 = "pendingPolarCheckout";
|
|
|
4141
4161
|
function useTopupCallback() {
|
|
4142
4162
|
const hasHandled = useRef3(false);
|
|
4143
4163
|
const loadingToastId = useRef3(null);
|
|
4144
|
-
const setBalance =
|
|
4164
|
+
const setBalance = useOttoRouterStore((s) => s.setBalance);
|
|
4145
4165
|
const removeToast = useToastStore((s) => s.removeToast);
|
|
4146
4166
|
useEffect10(() => {
|
|
4147
4167
|
if (hasHandled.current)
|
|
@@ -4175,7 +4195,7 @@ function useTopupCallback() {
|
|
|
4175
4195
|
if (status?.confirmed) {
|
|
4176
4196
|
localStorage.removeItem(STORAGE_KEY3);
|
|
4177
4197
|
dismissLoading();
|
|
4178
|
-
const balanceData = await apiClient.
|
|
4198
|
+
const balanceData = await apiClient.getOttoRouterBalance();
|
|
4179
4199
|
if (balanceData?.balance !== undefined) {
|
|
4180
4200
|
setBalance(balanceData.balance);
|
|
4181
4201
|
}
|
|
@@ -4281,7 +4301,7 @@ function useAuthStatus() {
|
|
|
4281
4301
|
const status = await fetchAuthStatus();
|
|
4282
4302
|
if (status) {
|
|
4283
4303
|
const hasAnyProvider = Object.values(status.providers).some((p) => p.configured);
|
|
4284
|
-
const needsOnboarding = !status.onboardingComplete || !hasAnyProvider || !status.
|
|
4304
|
+
const needsOnboarding = !status.onboardingComplete || !hasAnyProvider || !status.ottorouter.configured;
|
|
4285
4305
|
if (needsOnboarding) {
|
|
4286
4306
|
setOpen(true);
|
|
4287
4307
|
}
|
|
@@ -4292,7 +4312,7 @@ function useAuthStatus() {
|
|
|
4292
4312
|
setLoading(true);
|
|
4293
4313
|
setError(null);
|
|
4294
4314
|
try {
|
|
4295
|
-
const result = await apiClient.
|
|
4315
|
+
const result = await apiClient.setupOttoRouterWallet();
|
|
4296
4316
|
await fetchAuthStatus();
|
|
4297
4317
|
return result;
|
|
4298
4318
|
} catch (err) {
|
|
@@ -4307,7 +4327,7 @@ function useAuthStatus() {
|
|
|
4307
4327
|
setLoading(true);
|
|
4308
4328
|
setError(null);
|
|
4309
4329
|
try {
|
|
4310
|
-
const result = await apiClient.
|
|
4330
|
+
const result = await apiClient.importOttoRouterWallet(privateKey);
|
|
4311
4331
|
await fetchAuthStatus();
|
|
4312
4332
|
return result;
|
|
4313
4333
|
} catch (err) {
|
|
@@ -4689,7 +4709,7 @@ function useProviderUsage(provider, authType) {
|
|
|
4689
4709
|
const fetchRef = useRef6(fetchUsage);
|
|
4690
4710
|
fetchRef.current = fetchUsage;
|
|
4691
4711
|
useEffect13(() => {
|
|
4692
|
-
if (!isOAuthProvider)
|
|
4712
|
+
if (!provider || !isOAuthProvider)
|
|
4693
4713
|
return;
|
|
4694
4714
|
fetchRef.current();
|
|
4695
4715
|
const interval = setInterval(() => fetchRef.current(), POLL_INTERVAL);
|
|
@@ -4940,24 +4960,45 @@ function useCopilotDevicePoller() {
|
|
|
4940
4960
|
return copilotDevice;
|
|
4941
4961
|
}
|
|
4942
4962
|
// src/hooks/useSkills.ts
|
|
4943
|
-
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
4963
|
+
import { useMutation as useMutation9, useQuery as useQuery13, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
4944
4964
|
import { useEffect as useEffect15 } from "react";
|
|
4945
4965
|
function useSkills() {
|
|
4946
|
-
const
|
|
4966
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
4947
4967
|
const query = useQuery13({
|
|
4948
4968
|
queryKey: ["skills"],
|
|
4949
4969
|
queryFn: async () => {
|
|
4950
|
-
return apiClient.
|
|
4970
|
+
return apiClient.getSkillsConfig();
|
|
4951
4971
|
},
|
|
4952
4972
|
refetchInterval: 30000
|
|
4953
4973
|
});
|
|
4954
4974
|
useEffect15(() => {
|
|
4955
|
-
if (query.data?.
|
|
4956
|
-
|
|
4975
|
+
if (query.data?.items) {
|
|
4976
|
+
setSkillsConfig({
|
|
4977
|
+
skills: query.data.items,
|
|
4978
|
+
globalEnabled: query.data.enabled,
|
|
4979
|
+
totalCount: query.data.totalCount,
|
|
4980
|
+
enabledCount: query.data.enabledCount
|
|
4981
|
+
});
|
|
4957
4982
|
}
|
|
4958
|
-
}, [query.data,
|
|
4983
|
+
}, [query.data, setSkillsConfig]);
|
|
4959
4984
|
return query;
|
|
4960
4985
|
}
|
|
4986
|
+
function useUpdateSkillsConfig() {
|
|
4987
|
+
const queryClient = useQueryClient11();
|
|
4988
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
4989
|
+
return useMutation9({
|
|
4990
|
+
mutationFn: (input) => apiClient.updateSkillsConfig(input),
|
|
4991
|
+
onSuccess: (data) => {
|
|
4992
|
+
setSkillsConfig({
|
|
4993
|
+
skills: data.items,
|
|
4994
|
+
globalEnabled: data.enabled,
|
|
4995
|
+
totalCount: data.totalCount,
|
|
4996
|
+
enabledCount: data.enabledCount
|
|
4997
|
+
});
|
|
4998
|
+
queryClient.setQueryData(["skills"], data);
|
|
4999
|
+
}
|
|
5000
|
+
});
|
|
5001
|
+
}
|
|
4961
5002
|
function useSkillDetail(name) {
|
|
4962
5003
|
return useQuery13({
|
|
4963
5004
|
queryKey: ["skills", name],
|
|
@@ -4993,6 +5034,7 @@ function useSkillFileContent(name, filePath) {
|
|
|
4993
5034
|
}
|
|
4994
5035
|
export {
|
|
4995
5036
|
useWorkingDirectory,
|
|
5037
|
+
useUpdateSkillsConfig,
|
|
4996
5038
|
useUpdateSession,
|
|
4997
5039
|
useUpdateDefaults,
|
|
4998
5040
|
useUnstageFiles,
|
|
@@ -5013,7 +5055,6 @@ export {
|
|
|
5013
5055
|
useSkillDetail,
|
|
5014
5056
|
useShareStatus,
|
|
5015
5057
|
useSetuPayments,
|
|
5016
|
-
useSetuBalance,
|
|
5017
5058
|
useSessionsInfinite,
|
|
5018
5059
|
useSessions,
|
|
5019
5060
|
useSessionStream,
|
|
@@ -5031,6 +5072,7 @@ export {
|
|
|
5031
5072
|
useProviderUsage,
|
|
5032
5073
|
usePreferences,
|
|
5033
5074
|
useParentSession,
|
|
5075
|
+
useOttoRouterBalance,
|
|
5034
5076
|
useModels,
|
|
5035
5077
|
useMessages,
|
|
5036
5078
|
useMessageQueuePosition,
|
|
@@ -5069,4 +5111,4 @@ export {
|
|
|
5069
5111
|
sessionsQueryKey
|
|
5070
5112
|
};
|
|
5071
5113
|
|
|
5072
|
-
//# debugId=
|
|
5114
|
+
//# debugId=E9A3724C0AF9596F64756E2164756E21
|