@ottocode/web-sdk 0.1.294 → 0.1.295

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.
Files changed (35) hide show
  1. package/dist/components/chat/ChatInput.d.ts.map +1 -1
  2. package/dist/components/chat/ChatInputContainer.d.ts.map +1 -1
  3. package/dist/components/chat/NewSessionLanding.d.ts.map +1 -1
  4. package/dist/components/file-browser/FileBrowserSidebar.d.ts.map +1 -1
  5. package/dist/components/file-browser/QuickFilePicker.d.ts.map +1 -1
  6. package/dist/components/git/GitCommitModal.d.ts.map +1 -1
  7. package/dist/components/git/GitSidebar.d.ts.map +1 -1
  8. package/dist/components/index.js +1793 -1455
  9. package/dist/components/index.js.map +27 -27
  10. package/dist/components/mcp/MCPSidebar.d.ts.map +1 -1
  11. package/dist/components/messages/MessageThreadContainer.d.ts.map +1 -1
  12. package/dist/components/research/ResearchSidebar.d.ts.map +1 -1
  13. package/dist/components/session-files/SessionFilesSidebar.d.ts.map +1 -1
  14. package/dist/components/sessions/SessionListContainer.d.ts.map +1 -1
  15. package/dist/components/settings/OttoRouterTopupModal.d.ts.map +1 -1
  16. package/dist/components/settings/SettingsSidebar.d.ts.map +1 -1
  17. package/dist/components/skills/SkillsSidebar.d.ts.map +1 -1
  18. package/dist/components/terminals/TerminalTabBar.d.ts.map +1 -1
  19. package/dist/components/terminals/TerminalViewer.d.ts +1 -1
  20. package/dist/components/terminals/TerminalViewer.d.ts.map +1 -1
  21. package/dist/components/terminals/TerminalsPanel.d.ts.map +1 -1
  22. package/dist/components/tunnel/TunnelSidebar.d.ts.map +1 -1
  23. package/dist/components/ui/ConfirmationDialog.d.ts.map +1 -1
  24. package/dist/components/ui/Toaster.d.ts.map +1 -1
  25. package/dist/hooks/index.js +36 -14
  26. package/dist/hooks/index.js.map +5 -5
  27. package/dist/hooks/useKeyboardShortcuts.d.ts +3 -7
  28. package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -1
  29. package/dist/hooks/useSkills.d.ts +5 -1
  30. package/dist/hooks/useSkills.d.ts.map +1 -1
  31. package/dist/hooks/useVoiceInput.d.ts +2 -1
  32. package/dist/hooks/useVoiceInput.d.ts.map +1 -1
  33. package/dist/index.js +1825 -1484
  34. package/dist/index.js.map +28 -28
  35. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"MCPSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/mcp/MCPSidebar.tsx"],"names":[],"mappings":"AA+QA,eAAO,MAAM,UAAU,8CAmSrB,CAAC"}
1
+ {"version":3,"file":"MCPSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/mcp/MCPSidebar.tsx"],"names":[],"mappings":"AA+QA,eAAO,MAAM,UAAU,8CAGrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThreadContainer.d.ts","sourceRoot":"","sources":["../../../src/components/messages/MessageThreadContainer.tsx"],"names":[],"mappings":"AAUA,UAAU,2BAA2B;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,sBAAsB,mEAoDjC,CAAC"}
1
+ {"version":3,"file":"MessageThreadContainer.d.ts","sourceRoot":"","sources":["../../../src/components/messages/MessageThreadContainer.tsx"],"names":[],"mappings":"AAUA,UAAU,2BAA2B;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,sBAAsB,mEAejC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResearchSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/research/ResearchSidebar.tsx"],"names":[],"mappings":"AA0CA,UAAU,oBAAoB;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,eAAe,4DAwlB1B,CAAC"}
1
+ {"version":3,"file":"ResearchSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/research/ResearchSidebar.tsx"],"names":[],"mappings":"AA0CA,UAAU,oBAAoB;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,eAAe,4DAW1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionFilesSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/session-files/SessionFilesSidebar.tsx"],"names":[],"mappings":"AAiBA,UAAU,wBAAwB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AA6HD,eAAO,MAAM,mBAAmB,gEAmG9B,CAAC"}
1
+ {"version":3,"file":"SessionFilesSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/session-files/SessionFilesSidebar.tsx"],"names":[],"mappings":"AAiBA,UAAU,wBAAwB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AA8HD,eAAO,MAAM,mBAAmB,gEAO9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionListContainer.d.ts","sourceRoot":"","sources":["../../../src/components/sessions/SessionListContainer.tsx"],"names":[],"mappings":"AAOA,UAAU,yBAAyB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,oBAAoB,iEA8S/B,CAAC"}
1
+ {"version":3,"file":"SessionListContainer.d.ts","sourceRoot":"","sources":["../../../src/components/sessions/SessionListContainer.tsx"],"names":[],"mappings":"AAWA,UAAU,yBAAyB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AA2FD,eAAO,MAAM,oBAAoB,iEAiT/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OttoRouterTopupModal.d.ts","sourceRoot":"","sources":["../../../src/components/settings/OttoRouterTopupModal.tsx"],"names":[],"mappings":"AAwCA,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
+ {"version":3,"file":"OttoRouterTopupModal.d.ts","sourceRoot":"","sources":["../../../src/components/settings/OttoRouterTopupModal.tsx"],"names":[],"mappings":"AAwCA,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,8CAG/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsSidebar.tsx"],"names":[],"mappings":"AA20BA,UAAU,oBAAoB;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,4DAyN1B,CAAC"}
1
+ {"version":3,"file":"SettingsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsSidebar.tsx"],"names":[],"mappings":"AA20BA,UAAU,oBAAoB;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,4DAO1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SkillsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillsSidebar.tsx"],"names":[],"mappings":"AA8CA,eAAO,MAAM,aAAa,8CA2RxB,CAAC"}
1
+ {"version":3,"file":"SkillsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillsSidebar.tsx"],"names":[],"mappings":"AA8CA,eAAO,MAAM,aAAa,8CAGxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TerminalTabBar.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalTabBar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,UAAU,mBAAmB;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,2DAqEzB,CAAC"}
1
+ {"version":3,"file":"TerminalTabBar.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalTabBar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,UAAU,mBAAmB;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,2DA6BzB,CAAC"}
@@ -3,6 +3,6 @@ interface TerminalViewerProps {
3
3
  isActive: boolean;
4
4
  onExit?: (terminalId: string) => void;
5
5
  }
6
- export declare function TerminalViewer({ terminalId, isActive, onExit, }: TerminalViewerProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare const TerminalViewer: import("react").NamedExoticComponent<TerminalViewerProps>;
7
7
  export {};
8
8
  //# sourceMappingURL=TerminalViewer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TerminalViewer.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalViewer.tsx"],"names":[],"mappings":"AA8IA,UAAU,mBAAmB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,cAAc,CAAC,EAC9B,UAAU,EACV,QAAQ,EACR,MAAM,GACN,EAAE,mBAAmB,2CAkWrB"}
1
+ {"version":3,"file":"TerminalViewer.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalViewer.tsx"],"names":[],"mappings":"AA8IA,UAAU,mBAAmB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,cAAc,2DA0WzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TerminalsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalsPanel.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,cAAc,8CA2NzB,CAAC"}
1
+ {"version":3,"file":"TerminalsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalsPanel.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,cAAc,8CASzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TunnelSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/tunnel/TunnelSidebar.tsx"],"names":[],"mappings":"AAkCA,eAAO,MAAM,aAAa,8CAoLxB,CAAC"}
1
+ {"version":3,"file":"TunnelSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/tunnel/TunnelSidebar.tsx"],"names":[],"mappings":"AAkCA,eAAO,MAAM,aAAa,8CAGxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/ConfirmationDialog.tsx"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,4CA2IjC"}
1
+ {"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/ConfirmationDialog.tsx"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,4CAGjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Toaster.tsx"],"names":[],"mappings":"AAsKA,wBAAgB,OAAO,4CAYtB"}
1
+ {"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Toaster.tsx"],"names":[],"mappings":"AAuKA,wBAAgB,OAAO,4CAetB"}
@@ -4728,7 +4728,8 @@ var useTerminalStore = create16((set) => ({
4728
4728
 
4729
4729
  // src/hooks/useKeyboardShortcuts.ts
4730
4730
  function useKeyboardShortcuts({
4731
- sessionIds,
4731
+ sessionIds = [],
4732
+ getSessionIds,
4732
4733
  activeSessionId,
4733
4734
  onSelectSession,
4734
4735
  onNewSession,
@@ -4766,12 +4767,13 @@ function useKeyboardShortcuts({
4766
4767
  const toggleSettings = useSettingsStore((state) => state.toggleSidebar);
4767
4768
  const toggleResearch = useResearchStore((state) => state.toggleSidebar);
4768
4769
  const toggleTerminalPanel = useTerminalStore((state) => state.togglePanel);
4769
- const currentSessionIndex = sessionIds.indexOf(activeSessionId || "");
4770
4770
  const handleKeyDown = useCallback3((e) => {
4771
4771
  const target = e.target;
4772
4772
  const isInInput = target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable;
4773
4773
  const isInTerminal = !!target.closest("[data-terminal-viewer]");
4774
4774
  const isShortcutModifierPressed = e.ctrlKey || e.metaKey;
4775
+ const latestSessionIds = getSessionIds?.() ?? sessionIds;
4776
+ const currentSessionIndex = latestSessionIds.indexOf(activeSessionId || "");
4775
4777
  if (isShortcutModifierPressed && !e.shiftKey && !e.altKey && e.key >= "1" && e.key <= "7") {
4776
4778
  e.preventDefault();
4777
4779
  switch (e.key) {
@@ -4900,21 +4902,21 @@ function useKeyboardShortcuts({
4900
4902
  return;
4901
4903
  }
4902
4904
  if (currentFocus === "sessions" && !isInInput) {
4903
- if (e.key === "j" && sessionIds.length > 0) {
4905
+ if (e.key === "j" && latestSessionIds.length > 0) {
4904
4906
  e.preventDefault();
4905
- const nextIndex = Math.min(sessionIndex + 1, sessionIds.length - 1);
4907
+ const nextIndex = Math.min(sessionIndex + 1, latestSessionIds.length - 1);
4906
4908
  setSessionIndex(nextIndex);
4907
4909
  return;
4908
4910
  }
4909
- if (e.key === "k" && sessionIds.length > 0) {
4911
+ if (e.key === "k" && latestSessionIds.length > 0) {
4910
4912
  e.preventDefault();
4911
4913
  const prevIndex = Math.max(sessionIndex - 1, 0);
4912
4914
  setSessionIndex(prevIndex);
4913
4915
  return;
4914
4916
  }
4915
- if (e.key === "Enter" && sessionIds[sessionIndex]) {
4917
+ if (e.key === "Enter" && latestSessionIds[sessionIndex]) {
4916
4918
  e.preventDefault();
4917
- onSelectSession(sessionIds[sessionIndex]);
4919
+ onSelectSession(latestSessionIds[sessionIndex]);
4918
4920
  setFocus("input");
4919
4921
  return;
4920
4922
  }
@@ -4988,8 +4990,9 @@ function useKeyboardShortcuts({
4988
4990
  sessionIndex,
4989
4991
  gitFileIndex,
4990
4992
  sessionIds,
4993
+ getSessionIds,
4994
+ activeSessionId,
4991
4995
  gitTreeRows,
4992
- currentSessionIndex,
4993
4996
  isGitExpanded,
4994
4997
  setFocus,
4995
4998
  setSessionIndex,
@@ -7030,13 +7033,15 @@ function useCopilotDevicePoller() {
7030
7033
  // src/hooks/useSkills.ts
7031
7034
  import { useMutation as useMutation9, useQuery as useQuery13, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
7032
7035
  import { useEffect as useEffect17 } from "react";
7033
- function useSkills() {
7036
+ function useSkills(options = {}) {
7037
+ const enabled = options.enabled ?? true;
7034
7038
  const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
7035
7039
  const query = useQuery13({
7036
7040
  queryKey: ["skills"],
7037
7041
  queryFn: async () => {
7038
7042
  return apiClient.getSkillsConfig();
7039
7043
  },
7044
+ enabled,
7040
7045
  refetchInterval: 30000
7041
7046
  });
7042
7047
  useEffect17(() => {
@@ -7171,6 +7176,7 @@ function appendBuffer(a, b) {
7171
7176
  function useVoiceInput({
7172
7177
  onTranscript,
7173
7178
  onError,
7179
+ onNeedsInstall,
7174
7180
  lang = "en-US"
7175
7181
  } = {}) {
7176
7182
  const [isListening, setIsListening] = useState7(false);
@@ -7187,15 +7193,24 @@ function useVoiceInput({
7187
7193
  const sessionIdRef = useRef9(null);
7188
7194
  const onTranscriptRef = useRef9(onTranscript);
7189
7195
  const onErrorRef = useRef9(onError);
7196
+ const onNeedsInstallRef = useRef9(onNeedsInstall);
7190
7197
  useEffect19(() => {
7191
7198
  onTranscriptRef.current = onTranscript;
7192
7199
  onErrorRef.current = onError;
7193
- }, [onTranscript, onError]);
7200
+ onNeedsInstallRef.current = onNeedsInstall;
7201
+ }, [onTranscript, onError, onNeedsInstall]);
7194
7202
  const isSupported = typeof window !== "undefined" && !!navigator.mediaDevices?.getUserMedia && !!getAudioContextConstructor() && typeof WebSocket !== "undefined";
7195
7203
  const emitError = useCallback12((message) => {
7196
7204
  setError(message);
7197
7205
  onErrorRef.current?.(message);
7198
7206
  }, []);
7207
+ const handleMissingModel = useCallback12(() => {
7208
+ if (onNeedsInstallRef.current) {
7209
+ onNeedsInstallRef.current();
7210
+ return;
7211
+ }
7212
+ emitError("Install a local dictation model from Settings before recording.");
7213
+ }, [emitError]);
7199
7214
  const cleanupAudio = useCallback12(() => {
7200
7215
  if (processorRef.current) {
7201
7216
  processorRef.current.onaudioprocess = null;
@@ -7290,7 +7305,7 @@ function useVoiceInput({
7290
7305
  const status = await apiClient.getDictationStatus();
7291
7306
  const model = status.models.find((item) => item.id === status.defaultModel);
7292
7307
  if (!model?.installed) {
7293
- emitError("Install a local dictation model from Settings before recording.");
7308
+ handleMissingModel();
7294
7309
  return;
7295
7310
  }
7296
7311
  const session = await apiClient.createDictationSession({
@@ -7298,7 +7313,7 @@ function useVoiceInput({
7298
7313
  language: toLanguageCode(lang)
7299
7314
  });
7300
7315
  if (!session.modelInstalled) {
7301
- emitError("Install a local dictation model from Settings before recording.");
7316
+ handleMissingModel();
7302
7317
  return;
7303
7318
  }
7304
7319
  const socket = new WebSocket(session.wsUrl);
@@ -7382,7 +7397,14 @@ function useVoiceInput({
7382
7397
  emitError(msg);
7383
7398
  cleanup();
7384
7399
  }
7385
- }, [cleanup, emitError, handleAudioProcess, isSupported, lang]);
7400
+ }, [
7401
+ cleanup,
7402
+ emitError,
7403
+ handleAudioProcess,
7404
+ handleMissingModel,
7405
+ isSupported,
7406
+ lang
7407
+ ]);
7386
7408
  useEffect19(() => cleanup, [cleanup]);
7387
7409
  return {
7388
7410
  isListening,
@@ -7599,4 +7621,4 @@ export {
7599
7621
  normalizeQueueState
7600
7622
  };
7601
7623
 
7602
- //# debugId=A9770107614A950A64756E2164756E21
7624
+ //# debugId=12EEAF020213040664756E2164756E21