@ottocode/web-sdk 0.1.284 → 0.1.286
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/file-browser/FileViewerPanel.d.ts.map +1 -1
- package/dist/components/git/GitBranchSwitcher.d.ts +8 -0
- package/dist/components/git/GitBranchSwitcher.d.ts.map +1 -0
- package/dist/components/git/GitCreateBranchModal.d.ts +11 -0
- package/dist/components/git/GitCreateBranchModal.d.ts.map +1 -0
- package/dist/components/git/GitDiffPanel.d.ts.map +1 -1
- package/dist/components/git/GitDiffViewer.d.ts.map +1 -1
- package/dist/components/git/GitFileItem.d.ts +3 -1
- package/dist/components/git/GitFileItem.d.ts.map +1 -1
- package/dist/components/git/GitFileList.d.ts.map +1 -1
- package/dist/components/git/GitFileTree.d.ts +11 -0
- package/dist/components/git/GitFileTree.d.ts.map +1 -0
- package/dist/components/git/GitSidebar.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4320 -3159
- package/dist/components/index.js.map +31 -27
- package/dist/components/messages/ActionToolBox.d.ts.map +1 -1
- package/dist/components/messages/renderers/ApplyPatchRenderer.d.ts.map +1 -1
- package/dist/components/messages/renderers/WriteRenderer.d.ts.map +1 -1
- package/dist/components/session-files/SessionFilesDiffPanel.d.ts.map +1 -1
- package/dist/components/sessions/SessionItem.d.ts.map +1 -1
- package/dist/components/sessions/SessionListContainer.d.ts.map +1 -1
- package/dist/components/skills/SkillViewerPanel.d.ts.map +1 -1
- package/dist/components/terminals/TerminalViewer.d.ts.map +1 -1
- package/dist/components/ui/CodeMirrorViewer.d.ts +3 -1
- package/dist/components/ui/CodeMirrorViewer.d.ts.map +1 -1
- package/dist/components/workspace/ToolPreviewPanel.d.ts.map +1 -1
- package/dist/components/workspace/ViewerStatusBar.d.ts +35 -0
- package/dist/components/workspace/ViewerStatusBar.d.ts.map +1 -0
- package/dist/components/workspace/ViewerTabs.d.ts.map +1 -1
- package/dist/hooks/index.js +125 -23
- package/dist/hooks/index.js.map +9 -9
- package/dist/hooks/useGit.d.ts +12 -0
- package/dist/hooks/useGit.d.ts.map +1 -1
- package/dist/hooks/useKeyboardShortcuts.d.ts +3 -3
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/dist/hooks/useSessionStream.d.ts.map +1 -1
- package/dist/index.js +4382 -3216
- package/dist/index.js.map +32 -28
- package/dist/lib/api-client/git.d.ts +12 -1
- package/dist/lib/api-client/git.d.ts.map +1 -1
- package/dist/lib/api-client/index.d.ts +11 -0
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/index.js +34 -2
- package/dist/lib/index.js.map +4 -4
- package/dist/stores/gitStore.d.ts +13 -0
- package/dist/stores/gitStore.d.ts.map +1 -1
- package/dist/stores/index.js +26 -2
- package/dist/stores/index.js.map +4 -4
- package/dist/stores/viewerTabsStore.d.ts +6 -0
- package/dist/stores/viewerTabsStore.d.ts.map +1 -1
- package/dist/types/api.d.ts +14 -0
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionToolBox.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ActionToolBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionToolBox.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ActionToolBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAoLnD,UAAU,kBAAkB;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,kBAAkB,2CAsS5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplyPatchRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/ApplyPatchRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplyPatchRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/ApplyPatchRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsBpD,wBAAgB,kBAAkB,CAAC,EAClC,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,GACR,EAAE,oBAAoB,2CAsJtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/WriteRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"WriteRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/renderers/WriteRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C,wBAAgB,aAAa,CAAC,EAC7B,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,GACP,EAAE,aAAa,2CAsGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionFilesDiffPanel.d.ts","sourceRoot":"","sources":["../../../src/components/session-files/SessionFilesDiffPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionFilesDiffPanel.d.ts","sourceRoot":"","sources":["../../../src/components/session-files/SessionFilesDiffPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AA6H5D,UAAU,0BAA0B;IACnC,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,kEAqPhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionItem.d.ts","sourceRoot":"","sources":["../../../src/components/sessions/SessionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionItem.d.ts","sourceRoot":"","sources":["../../../src/components/sessions/SessionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/C,UAAU,gBAAgB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,wDAmEtB,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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillViewerPanel.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillViewerPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SkillViewerPanel.d.ts","sourceRoot":"","sources":["../../../src/components/skills/SkillViewerPanel.tsx"],"names":[],"mappings":"AAQA,UAAU,qBAAqB;IAC9B,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,6DAuG3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalViewer.d.ts","sourceRoot":"","sources":["../../../src/components/terminals/TerminalViewer.tsx"],"names":[],"mappings":"
|
|
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,4 +1,5 @@
|
|
|
1
1
|
export type CodeMirrorLineTone = 'add' | 'remove' | 'primary';
|
|
2
|
+
type CodeMirrorLineNumberFormatter = (lineNumber: number) => string;
|
|
2
3
|
interface CodeMirrorViewerProps {
|
|
3
4
|
content: string;
|
|
4
5
|
path?: string;
|
|
@@ -9,7 +10,8 @@ interface CodeMirrorViewerProps {
|
|
|
9
10
|
scrollToLine?: number;
|
|
10
11
|
scrollToEndSignal?: string | number;
|
|
11
12
|
disableMarkdownSyntax?: boolean;
|
|
13
|
+
lineNumberFormatter?: CodeMirrorLineNumberFormatter;
|
|
12
14
|
}
|
|
13
|
-
export declare function CodeMirrorViewer({ content, path, className, highlightedLines, highlightTone, lineTones, scrollToLine, scrollToEndSignal, disableMarkdownSyntax, }: CodeMirrorViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function CodeMirrorViewer({ content, path, className, highlightedLines, highlightTone, lineTones, scrollToLine, scrollToEndSignal, disableMarkdownSyntax, lineNumberFormatter, }: CodeMirrorViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
15
17
|
//# sourceMappingURL=CodeMirrorViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirrorViewer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/CodeMirrorViewer.tsx"],"names":[],"mappings":"AAmCA,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeMirrorViewer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/CodeMirrorViewer.tsx"],"names":[],"mappings":"AAmCA,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC9D,KAAK,6BAA6B,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;AAEpE,UAAU,qBAAqB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mBAAmB,CAAC,EAAE,6BAA6B,CAAC;CACpD;AA2PD,wBAAgB,gBAAgB,CAAC,EAChC,OAAO,EACP,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,aAAyB,EACzB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,qBAA6B,EAC7B,mBAAmB,GACnB,EAAE,qBAAqB,2CA6JvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolPreviewPanel.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/ToolPreviewPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EAEd,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolPreviewPanel.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/ToolPreviewPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EAEd,MAAM,8BAA8B,CAAC;AAUtC,UAAU,qBAAqB;IAC9B,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;CAClD;AAOD,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAujBD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,UAAU,EAAE,MAAM,GAChB,gBAAgB,GAAG,IAAI,CAsGzB;AAoFD,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,2CA+Q9D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ChangeCount {
|
|
3
|
+
additions: number;
|
|
4
|
+
removals: number;
|
|
5
|
+
}
|
|
6
|
+
export type ViewerStatusTone = 'neutral' | 'read' | 'write' | 'patch' | 'success' | 'error';
|
|
7
|
+
export declare function countLineTones(lineTones: Map<number, 'add' | 'remove'> | Array<[number, 'add' | 'remove']> | undefined): ChangeCount;
|
|
8
|
+
export declare function normalizeChangeCount(count: ChangeCount): ChangeCount | undefined;
|
|
9
|
+
export declare function countPatchTextChanges(patch: string | undefined, targetPath: string | undefined): ChangeCount | undefined;
|
|
10
|
+
export declare function AnimatedSignedCount({ prefix, value, className, }: {
|
|
11
|
+
prefix: '+' | '-';
|
|
12
|
+
value: number;
|
|
13
|
+
className: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function ChangeCountSlot({ count }: {
|
|
16
|
+
count: ChangeCount;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function InlineChangeCount({ count, className, weight, }: {
|
|
19
|
+
count: ChangeCount;
|
|
20
|
+
className?: string;
|
|
21
|
+
weight?: 'bold' | 'normal';
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface ViewerStatusBarProps {
|
|
24
|
+
label?: string;
|
|
25
|
+
path: string;
|
|
26
|
+
tone?: ViewerStatusTone;
|
|
27
|
+
changeCount?: ChangeCount;
|
|
28
|
+
showSpinner?: boolean;
|
|
29
|
+
spinnerTitle?: string;
|
|
30
|
+
leading?: ReactNode;
|
|
31
|
+
trailing?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function ViewerStatusBar({ label, path, tone, changeCount, showSpinner, spinnerTitle, leading, trailing, }: ViewerStatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=ViewerStatusBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewerStatusBar.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/ViewerStatusBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GACzB,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,CAAC;AAEX,wBAAgB,cAAc,CAC7B,SAAS,EACN,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC,GAC7B,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC,GACjC,SAAS,GACV,WAAW,CAQb;AAED,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,WAAW,GAChB,WAAW,GAAG,SAAS,CAEzB;AAoBD,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC5B,WAAW,GAAG,SAAS,CA2CzB;AA8BD,wBAAgB,mBAAmB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,SAAS,GACT,EAAE;IACF,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB,2CAYA;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,2CAkBhE;AAED,wBAAgB,iBAAiB,CAAC,EACjC,KAAK,EACL,SAAS,EACT,MAAe,GACf,EAAE;IACF,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC3B,2CAmBA;AAeD,UAAU,oBAAoB;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAC/B,KAAK,EACL,IAAI,EACJ,IAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,GACR,EAAE,oBAAoB,2CAoBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewerTabs.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/ViewerTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewerTabs.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/ViewerTabs.tsx"],"names":[],"mappings":"AA8aA,eAAO,MAAM,UAAU,8CAgGrB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -254,7 +254,10 @@ import {
|
|
|
254
254
|
initGitRepo as apiInitGitRepo,
|
|
255
255
|
getGitRemotes as apiGetGitRemotes,
|
|
256
256
|
addGitRemote as apiAddGitRemote,
|
|
257
|
-
removeGitRemote as apiRemoveGitRemote
|
|
257
|
+
removeGitRemote as apiRemoveGitRemote,
|
|
258
|
+
listGitBranches as apiListGitBranches,
|
|
259
|
+
checkoutGitBranch as apiCheckoutGitBranch,
|
|
260
|
+
createGitBranch as apiCreateGitBranch
|
|
258
261
|
} from "@ottocode/api";
|
|
259
262
|
var gitMixin = {
|
|
260
263
|
async initGitRepo() {
|
|
@@ -390,6 +393,32 @@ var gitMixin = {
|
|
|
390
393
|
if (response.error)
|
|
391
394
|
throw new Error(extractErrorMessage(response.error));
|
|
392
395
|
return response.data?.data;
|
|
396
|
+
},
|
|
397
|
+
async listGitBranches() {
|
|
398
|
+
const response = await apiListGitBranches();
|
|
399
|
+
if (response.error)
|
|
400
|
+
throw new Error(extractErrorMessage(response.error));
|
|
401
|
+
return response.data?.data;
|
|
402
|
+
},
|
|
403
|
+
async checkoutBranch(branch) {
|
|
404
|
+
const response = await apiCheckoutGitBranch({
|
|
405
|
+
body: { branch }
|
|
406
|
+
});
|
|
407
|
+
if (response.error)
|
|
408
|
+
throw new Error(extractErrorMessage(response.error));
|
|
409
|
+
return response.data?.data;
|
|
410
|
+
},
|
|
411
|
+
async createGitBranch(name, options) {
|
|
412
|
+
const response = await apiCreateGitBranch({
|
|
413
|
+
body: {
|
|
414
|
+
name,
|
|
415
|
+
...options?.startPoint ? { startPoint: options.startPoint } : {},
|
|
416
|
+
...options?.checkout !== undefined ? { checkout: options.checkout } : {}
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
if (response.error)
|
|
420
|
+
throw new Error(extractErrorMessage(response.error));
|
|
421
|
+
return response.data?.data;
|
|
393
422
|
}
|
|
394
423
|
};
|
|
395
424
|
|
|
@@ -966,6 +995,9 @@ class ApiClient {
|
|
|
966
995
|
getRemotes = gitMixin.getRemotes;
|
|
967
996
|
addRemote = gitMixin.addRemote;
|
|
968
997
|
removeRemote = gitMixin.removeRemote;
|
|
998
|
+
listGitBranches = gitMixin.listGitBranches;
|
|
999
|
+
checkoutBranch = gitMixin.checkoutBranch;
|
|
1000
|
+
createGitBranch = gitMixin.createGitBranch;
|
|
969
1001
|
getConfig = configMixin.getConfig;
|
|
970
1002
|
getModels = configMixin.getModels;
|
|
971
1003
|
getAllModels = configMixin.getAllModels;
|
|
@@ -1532,6 +1564,7 @@ var useViewerTabsStore = create((set) => ({
|
|
|
1532
1564
|
toolName: "write",
|
|
1533
1565
|
callId: preview.callId ?? existingWritePreview?.callId,
|
|
1534
1566
|
content: preview.content ?? existingWritePreview?.content,
|
|
1567
|
+
changeCount: preview.changeCount ?? existingWritePreview?.changeCount,
|
|
1535
1568
|
status: preview.status,
|
|
1536
1569
|
error: preview.error ?? existingWritePreview?.error
|
|
1537
1570
|
}
|
|
@@ -1555,6 +1588,7 @@ var useViewerTabsStore = create((set) => ({
|
|
|
1555
1588
|
toolName: "write",
|
|
1556
1589
|
callId: preview.callId,
|
|
1557
1590
|
content: preview.content ?? existingWrite?.content,
|
|
1591
|
+
changeCount: preview.changeCount ?? existingWrite?.changeCount,
|
|
1558
1592
|
status: preview.status,
|
|
1559
1593
|
error: preview.error ?? existingWrite?.error
|
|
1560
1594
|
}
|
|
@@ -1948,6 +1982,15 @@ var useSessionFilesStore = create8((set) => ({
|
|
|
1948
1982
|
}));
|
|
1949
1983
|
|
|
1950
1984
|
// src/stores/gitStore.ts
|
|
1985
|
+
var GIT_TREE_SECTION_ORDER = ["conflicts", "staged", "changes"];
|
|
1986
|
+
function areGitTreeRowsEqual(left = [], right = []) {
|
|
1987
|
+
if (left.length !== right.length)
|
|
1988
|
+
return false;
|
|
1989
|
+
return left.every((row, index) => {
|
|
1990
|
+
const other = right[index];
|
|
1991
|
+
return row.id === other.id && row.type === other.type && row.path === other.path && row.staged === other.staged && row.status === other.status && row.actionPaths.length === other.actionPaths.length && row.actionPaths.every((path, pathIndex) => path === other.actionPaths[pathIndex]);
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1951
1994
|
var useGitStore = create9((set) => ({
|
|
1952
1995
|
isExpanded: false,
|
|
1953
1996
|
activeSessionId: null,
|
|
@@ -1957,6 +2000,8 @@ var useGitStore = create9((set) => ({
|
|
|
1957
2000
|
isCommitModalOpen: false,
|
|
1958
2001
|
commitSessionId: null,
|
|
1959
2002
|
wasSessionListCollapsed: false,
|
|
2003
|
+
gitTreeSections: {},
|
|
2004
|
+
gitTreeRows: [],
|
|
1960
2005
|
toggleSidebar: () => {
|
|
1961
2006
|
set((state) => {
|
|
1962
2007
|
const newExpanded = !state.isExpanded;
|
|
@@ -1998,7 +2043,18 @@ var useGitStore = create9((set) => ({
|
|
|
1998
2043
|
openCommitModalForSession: (sessionId) => set({ isCommitModalOpen: true, commitSessionId: sessionId }),
|
|
1999
2044
|
closeCommitModal: () => set({ isCommitModalOpen: false, commitSessionId: null }),
|
|
2000
2045
|
setActiveSessionId: (sessionId) => set({ activeSessionId: sessionId }),
|
|
2001
|
-
setSessionListCollapsed: (collapsed) => set({ wasSessionListCollapsed: collapsed })
|
|
2046
|
+
setSessionListCollapsed: (collapsed) => set({ wasSessionListCollapsed: collapsed }),
|
|
2047
|
+
setGitTreeSectionRows: (sectionId, rows) => set((state) => {
|
|
2048
|
+
if (areGitTreeRowsEqual(state.gitTreeSections[sectionId], rows)) {
|
|
2049
|
+
return state;
|
|
2050
|
+
}
|
|
2051
|
+
const gitTreeSections = {
|
|
2052
|
+
...state.gitTreeSections,
|
|
2053
|
+
[sectionId]: rows
|
|
2054
|
+
};
|
|
2055
|
+
const gitTreeRows = GIT_TREE_SECTION_ORDER.flatMap((id) => gitTreeSections[id] ?? []);
|
|
2056
|
+
return { gitTreeSections, gitTreeRows };
|
|
2057
|
+
})
|
|
2002
2058
|
}));
|
|
2003
2059
|
|
|
2004
2060
|
// src/hooks/useGit.ts
|
|
@@ -2152,6 +2208,41 @@ function useRemoveRemote() {
|
|
|
2152
2208
|
}
|
|
2153
2209
|
});
|
|
2154
2210
|
}
|
|
2211
|
+
function useGitBranches(enabled = true) {
|
|
2212
|
+
return useQuery3({
|
|
2213
|
+
queryKey: ["git", "branches"],
|
|
2214
|
+
queryFn: () => apiClient.listGitBranches(),
|
|
2215
|
+
enabled,
|
|
2216
|
+
retry: 1,
|
|
2217
|
+
staleTime: 5000
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
function useCheckoutBranch() {
|
|
2221
|
+
const queryClient = useQueryClient2();
|
|
2222
|
+
return useMutation2({
|
|
2223
|
+
mutationFn: (branch) => apiClient.checkoutBranch(branch),
|
|
2224
|
+
onSuccess: () => {
|
|
2225
|
+
queryClient.invalidateQueries({ queryKey: ["git", "status"] });
|
|
2226
|
+
queryClient.invalidateQueries({ queryKey: ["git", "branch"] });
|
|
2227
|
+
queryClient.invalidateQueries({ queryKey: ["git", "branches"] });
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
function useCreateGitBranch() {
|
|
2232
|
+
const queryClient = useQueryClient2();
|
|
2233
|
+
return useMutation2({
|
|
2234
|
+
mutationFn: ({
|
|
2235
|
+
name,
|
|
2236
|
+
startPoint,
|
|
2237
|
+
checkout
|
|
2238
|
+
}) => apiClient.createGitBranch(name, { startPoint, checkout }),
|
|
2239
|
+
onSuccess: () => {
|
|
2240
|
+
queryClient.invalidateQueries({ queryKey: ["git", "status"] });
|
|
2241
|
+
queryClient.invalidateQueries({ queryKey: ["git", "branch"] });
|
|
2242
|
+
queryClient.invalidateQueries({ queryKey: ["git", "branches"] });
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2155
2246
|
// src/hooks/useMessages.ts
|
|
2156
2247
|
import { useQuery as useQuery5, useMutation as useMutation4, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
2157
2248
|
|
|
@@ -2930,6 +3021,11 @@ ${bestEffortUnescapeJsonString(rawTail)}`;
|
|
|
2930
3021
|
const callId = getToolEventCallId(payload) ?? undefined;
|
|
2931
3022
|
const status = failed ? "error" : eventType === "tool.result" ? "success" : "streaming";
|
|
2932
3023
|
const content = status === "streaming" ? getStreamingWritePreviewContent(args, buffer) : getStringArg(args, buffer, "content");
|
|
3024
|
+
const summary = result?.summary && typeof result.summary === "object" ? result.summary : undefined;
|
|
3025
|
+
const changeCount = typeof summary?.additions === "number" && typeof summary.deletions === "number" ? {
|
|
3026
|
+
additions: summary.additions,
|
|
3027
|
+
removals: summary.deletions
|
|
3028
|
+
} : undefined;
|
|
2933
3029
|
if (status === "success") {
|
|
2934
3030
|
if (content !== undefined)
|
|
2935
3031
|
updateFileContentCache(path, content);
|
|
@@ -2957,6 +3053,7 @@ ${bestEffortUnescapeJsonString(rawTail)}`;
|
|
|
2957
3053
|
toolName: "write",
|
|
2958
3054
|
callId,
|
|
2959
3055
|
content,
|
|
3056
|
+
changeCount,
|
|
2960
3057
|
status,
|
|
2961
3058
|
error: extractErrorMessage2(payload)
|
|
2962
3059
|
});
|
|
@@ -4302,7 +4399,6 @@ var useTerminalStore = create15((set) => ({
|
|
|
4302
4399
|
function useKeyboardShortcuts({
|
|
4303
4400
|
sessionIds,
|
|
4304
4401
|
activeSessionId,
|
|
4305
|
-
gitFiles,
|
|
4306
4402
|
onSelectSession,
|
|
4307
4403
|
onNewSession,
|
|
4308
4404
|
onStageFile,
|
|
@@ -4330,6 +4426,7 @@ function useKeyboardShortcuts({
|
|
|
4330
4426
|
} = useSidebarStore();
|
|
4331
4427
|
const { isExpanded: isGitExpanded, toggleSidebar: toggleGit } = useGitStore();
|
|
4332
4428
|
const closeDiff = useGitStore((state) => state.closeDiff);
|
|
4429
|
+
const gitTreeRows = useGitStore((state) => state.gitTreeRows);
|
|
4333
4430
|
const toggleSessionFiles = useSessionFilesStore((state) => state.toggleSidebar);
|
|
4334
4431
|
const toggleFileBrowser = useFileBrowserStore((state) => state.toggleSidebar);
|
|
4335
4432
|
const toggleTunnel = useTunnelStore((state) => state.toggleSidebar);
|
|
@@ -4492,25 +4589,25 @@ function useKeyboardShortcuts({
|
|
|
4492
4589
|
}
|
|
4493
4590
|
}
|
|
4494
4591
|
if (currentFocus === "git" && !isInInput) {
|
|
4495
|
-
|
|
4592
|
+
const focusedGitRow = gitTreeRows[gitFileIndex];
|
|
4593
|
+
if (e.key === "j" && gitTreeRows.length > 0) {
|
|
4496
4594
|
e.preventDefault();
|
|
4497
|
-
const nextIndex = Math.min(gitFileIndex + 1,
|
|
4595
|
+
const nextIndex = Math.min(gitFileIndex + 1, gitTreeRows.length - 1);
|
|
4498
4596
|
setGitFileIndex(nextIndex);
|
|
4499
4597
|
return;
|
|
4500
4598
|
}
|
|
4501
|
-
if (e.key === "k" &&
|
|
4599
|
+
if (e.key === "k" && gitTreeRows.length > 0) {
|
|
4502
4600
|
e.preventDefault();
|
|
4503
4601
|
const prevIndex = Math.max(gitFileIndex - 1, 0);
|
|
4504
4602
|
setGitFileIndex(prevIndex);
|
|
4505
4603
|
return;
|
|
4506
4604
|
}
|
|
4507
|
-
if (e.key === " " &&
|
|
4605
|
+
if (e.key === " " && focusedGitRow) {
|
|
4508
4606
|
e.preventDefault();
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
onUnstageFile?.(file.path);
|
|
4607
|
+
if (focusedGitRow.staged) {
|
|
4608
|
+
onUnstageFile?.(focusedGitRow.actionPaths);
|
|
4512
4609
|
} else {
|
|
4513
|
-
onStageFile?.(
|
|
4610
|
+
onStageFile?.(focusedGitRow.actionPaths);
|
|
4514
4611
|
}
|
|
4515
4612
|
return;
|
|
4516
4613
|
}
|
|
@@ -4524,20 +4621,18 @@ function useKeyboardShortcuts({
|
|
|
4524
4621
|
onUnstageAll?.();
|
|
4525
4622
|
return;
|
|
4526
4623
|
}
|
|
4527
|
-
if (e.key === "R" &&
|
|
4624
|
+
if (e.key === "R" && focusedGitRow?.type === "file") {
|
|
4528
4625
|
e.preventDefault();
|
|
4529
|
-
const
|
|
4530
|
-
const canRestore = !file.staged && file.status !== "untracked" && file.status !== "added";
|
|
4626
|
+
const canRestore = !focusedGitRow.staged && focusedGitRow.status !== "untracked" && focusedGitRow.status !== "added";
|
|
4531
4627
|
if (canRestore) {
|
|
4532
|
-
onRestoreFile?.(
|
|
4628
|
+
onRestoreFile?.(focusedGitRow.path);
|
|
4533
4629
|
}
|
|
4534
4630
|
return;
|
|
4535
4631
|
}
|
|
4536
4632
|
if (e.shiftKey && e.key === "D" || e.key === "Backspace") {
|
|
4537
4633
|
e.preventDefault();
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
onDeleteFile?.(file.path);
|
|
4634
|
+
if (focusedGitRow?.type === "file" && !focusedGitRow.staged && focusedGitRow.status === "untracked") {
|
|
4635
|
+
onDeleteFile?.(focusedGitRow.path);
|
|
4541
4636
|
}
|
|
4542
4637
|
return;
|
|
4543
4638
|
}
|
|
@@ -4546,10 +4641,14 @@ function useKeyboardShortcuts({
|
|
|
4546
4641
|
onOpenCommitModal?.();
|
|
4547
4642
|
return;
|
|
4548
4643
|
}
|
|
4549
|
-
if (e.key === "Enter" &&
|
|
4644
|
+
if (e.key === "Enter" && focusedGitRow) {
|
|
4550
4645
|
e.preventDefault();
|
|
4551
|
-
|
|
4552
|
-
|
|
4646
|
+
if (focusedGitRow.type === "folder") {
|
|
4647
|
+
focusedGitRow.toggleExpanded?.();
|
|
4648
|
+
} else {
|
|
4649
|
+
focusedGitRow.open?.();
|
|
4650
|
+
onViewDiff?.(focusedGitRow.path, focusedGitRow.staged);
|
|
4651
|
+
}
|
|
4553
4652
|
return;
|
|
4554
4653
|
}
|
|
4555
4654
|
}
|
|
@@ -4558,7 +4657,7 @@ function useKeyboardShortcuts({
|
|
|
4558
4657
|
sessionIndex,
|
|
4559
4658
|
gitFileIndex,
|
|
4560
4659
|
sessionIds,
|
|
4561
|
-
|
|
4660
|
+
gitTreeRows,
|
|
4562
4661
|
currentSessionIndex,
|
|
4563
4662
|
isGitExpanded,
|
|
4564
4663
|
setFocus,
|
|
@@ -6733,6 +6832,7 @@ export {
|
|
|
6733
6832
|
useGitInit,
|
|
6734
6833
|
useGitDiffFullFile,
|
|
6735
6834
|
useGitDiff,
|
|
6835
|
+
useGitBranches,
|
|
6736
6836
|
useGitBranch,
|
|
6737
6837
|
useGenerateCommitMessage,
|
|
6738
6838
|
useFiles,
|
|
@@ -6745,12 +6845,14 @@ export {
|
|
|
6745
6845
|
useDeleteFiles,
|
|
6746
6846
|
useCreateSession,
|
|
6747
6847
|
useCreateResearchSession,
|
|
6848
|
+
useCreateGitBranch,
|
|
6748
6849
|
useCreateBranch,
|
|
6749
6850
|
useCopilotDevicePoller,
|
|
6750
6851
|
useContainerWidth,
|
|
6751
6852
|
useConfig,
|
|
6752
6853
|
useCommitChanges,
|
|
6753
6854
|
useClientEvents,
|
|
6855
|
+
useCheckoutBranch,
|
|
6754
6856
|
useBranches,
|
|
6755
6857
|
useAuthenticateMCPServer,
|
|
6756
6858
|
useAuthStatus,
|
|
@@ -6762,4 +6864,4 @@ export {
|
|
|
6762
6864
|
normalizeQueueState
|
|
6763
6865
|
};
|
|
6764
6866
|
|
|
6765
|
-
//# debugId=
|
|
6867
|
+
//# debugId=3A3CE5241D63364B64756E2164756E21
|