@sourcegraph/cody-web 0.6.1 → 0.7.1
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/{agent.worker-DVKzbHSN.mjs → agent.worker-B1CAn5Kx.mjs} +325 -355
- package/dist/agent.worker.js +2 -2
- package/dist/{time-date-5mt-Pcg3.mjs → browser-DJC99jis.mjs} +4512 -4588
- package/dist/demo/App.d.ts.map +1 -1
- package/dist/{git-log-D98vF6zD.mjs → git-log-_sHG8Csy.mjs} +2 -2
- package/dist/{index-AVrhN4Ic.mjs → index-BRvf0zWs.mjs} +2 -2
- package/dist/index.js +24066 -11366
- package/dist/lib/components/CodyWebChat.d.ts +21 -0
- package/dist/lib/components/CodyWebChat.d.ts.map +1 -0
- package/dist/lib/components/skeleton/ChatSkeleton.d.ts +11 -0
- package/dist/lib/components/skeleton/ChatSkeleton.d.ts.map +1 -0
- package/dist/lib/components/use-cody-agent.d.ts +27 -0
- package/dist/lib/components/use-cody-agent.d.ts.map +1 -0
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/{shell-C6EMKtG-.mjs → shell-BGZM4C-m.mjs} +2 -2
- package/dist/style.css +183 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/dist/lib/components/CodyWebPanel.d.ts +0 -7
- package/dist/lib/components/CodyWebPanel.d.ts.map +0 -1
- package/dist/lib/components/CodyWebPanelProvider.d.ts +0 -31
- package/dist/lib/components/CodyWebPanelProvider.d.ts.map +0 -1
- package/dist/lib/utils/use-local-storage.d.ts +0 -14
- package/dist/lib/utils/use-local-storage.d.ts.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FunctionComponent } from 'react';
|
|
2
|
+
import type { InitialContext } from '../types';
|
|
3
|
+
import '../global-styles/styles.css';
|
|
4
|
+
export interface CodyWebChatProps {
|
|
5
|
+
serverEndpoint: string;
|
|
6
|
+
accessToken: string | null;
|
|
7
|
+
createAgentWorker: () => Worker;
|
|
8
|
+
telemetryClientName?: string;
|
|
9
|
+
initialContext?: InitialContext;
|
|
10
|
+
customHeaders?: Record<string, string>;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The root component node for Cody Web Chat, implements Cody Agent client
|
|
15
|
+
* and connects VSCode Cody Chat UI with web-worker agent. The main component
|
|
16
|
+
* to use in Cody Web Consumers.
|
|
17
|
+
*
|
|
18
|
+
* You can see the demo usage of this component in demo/App.tsx
|
|
19
|
+
*/
|
|
20
|
+
export declare const CodyWebChat: FunctionComponent<CodyWebChatProps>;
|
|
21
|
+
//# sourceMappingURL=CodyWebChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodyWebChat.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebChat.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,iBAAiB,EAAmD,MAAM,OAAO,CAAA;AAgCxG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C,OAAO,6BAA6B,CAAA;AAWpC,MAAM,WAAW,gBAAgB;IAC7B,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iBAAiB,EAAE,MAAM,MAAM,CAAA;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AACD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAqC3D,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
interface ChatSkeletonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Skeleton UI for Cody Web Chat UI (loading mock UI state), currently is used only
|
|
7
|
+
* for Cody Web UI since it takes noticeable time to load and initialize.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ChatSkeleton: FC<ChatSkeletonProps>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ChatSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatSkeleton.d.ts","sourceRoot":"","sources":["../../../../lib/components/skeleton/ChatSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAK/B,UAAU,iBAAiB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA4C9C,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type VSCodeWrapper } from 'cody-ai/webviews/utils/VSCodeApi';
|
|
2
|
+
import type { MessageConnection } from 'vscode-jsonrpc/browser';
|
|
3
|
+
import type { InitialContext } from '../types';
|
|
4
|
+
export interface AgentClient {
|
|
5
|
+
rpc: MessageConnection;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
}
|
|
8
|
+
interface UseCodyWebAgentInput {
|
|
9
|
+
serverEndpoint: string;
|
|
10
|
+
accessToken: string | null;
|
|
11
|
+
createAgentWorker: () => Worker;
|
|
12
|
+
telemetryClientName?: string;
|
|
13
|
+
initialContext?: InitialContext;
|
|
14
|
+
customHeaders?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
interface UseCodyWebAgentResult {
|
|
17
|
+
client: AgentClient | Error | null;
|
|
18
|
+
vscodeAPI: VSCodeWrapper | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates Cody Web Agent instance and automatically creates a new chat.
|
|
22
|
+
* Uses cody web-worker agent under the hood with json rpc as a connection between
|
|
23
|
+
* main and web-worker threads, see agent.client.ts for more details
|
|
24
|
+
*/
|
|
25
|
+
export declare function useCodyWebAgent(input: UseCodyWebAgentInput): UseCodyWebAgentResult;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=use-cody-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-cody-agent.d.ts","sourceRoot":"","sources":["../../../lib/components/use-cody-agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,kCAAkC,CAAA;AAUvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAa9C,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,iBAAiB,CAAA;IACtB,OAAO,IAAI,IAAI,CAAA;CAClB;AAED,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iBAAiB,EAAE,MAAM,MAAM,CAAA;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzC;AAED,UAAU,qBAAqB;IAC3B,MAAM,EAAE,WAAW,GAAG,KAAK,GAAG,IAAI,CAAA;IAClC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAA;CAClC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,qBAAqB,CA0DlF"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CodyWebChat, type CodyWebChatProps } from './components/CodyWebChat';
|
|
2
|
+
export { ChatSkeleton } from './components/skeleton/ChatSkeleton';
|
|
3
3
|
export type { Repository, InitialContext } from './types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAEjE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as util, e as exec, o as os, a as env, w as window, p as path, b as workspace, U as Uri, l as logError } from "./agent.worker-
|
|
2
|
-
import { w as wrapInActiveSpan, T as TokenCounterUtils, C as ContextItemSource } from "./
|
|
1
|
+
import { u as util, e as exec, o as os, a as env, w as window, p as path, b as workspace, U as Uri, l as logError } from "./agent.worker-B1CAn5Kx.mjs";
|
|
2
|
+
import { w as wrapInActiveSpan, T as TokenCounterUtils, C as ContextItemSource } from "./browser-DJC99jis.mjs";
|
|
3
3
|
var define_process_default = { env: {} };
|
|
4
4
|
const _exec = util.promisify(exec);
|
|
5
5
|
async function getContextFileFromShell(command) {
|
package/dist/style.css
CHANGED
|
@@ -205,35 +205,35 @@ html[data-ide=JetBrains] ._template-input-node_14yoh_1 {
|
|
|
205
205
|
color: var(--vscode-input-foreground);
|
|
206
206
|
opacity: 0.5;
|
|
207
207
|
}
|
|
208
|
-
._outer-
|
|
208
|
+
._outer-container_xb9w0_1 {
|
|
209
209
|
background-color: var(--vscode-sideBar-background);
|
|
210
210
|
display: flex;
|
|
211
211
|
flex-direction: column;
|
|
212
212
|
box-sizing: border-box;
|
|
213
213
|
height: 100%;
|
|
214
214
|
overflow: hidden;
|
|
215
|
+
isolation: isolate;
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
._error-
|
|
218
|
+
._error-container_xb9w0_11 {
|
|
218
219
|
display: flex;
|
|
219
220
|
flex-direction: column-reverse;
|
|
220
221
|
gap: 0.5rem;
|
|
221
222
|
}
|
|
222
223
|
|
|
223
|
-
.
|
|
224
|
+
._error_xb9w0_11 {
|
|
224
225
|
flex-direction: row;
|
|
225
226
|
display: flex;
|
|
226
227
|
padding: 1rem;
|
|
227
228
|
color: var(--vscode-input-foreground);
|
|
228
229
|
background-color: var(--vscode-inputValidation-errorBackground);
|
|
229
|
-
align-items: center;
|
|
230
230
|
min-height: 2rem;
|
|
231
231
|
position: relative;
|
|
232
232
|
overflow: auto;
|
|
233
233
|
align-items: baseline;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
._close-
|
|
236
|
+
._close-btn_xb9w0_29 {
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 0.65rem;
|
|
239
239
|
right: 0.25rem;
|
|
@@ -930,18 +930,67 @@ button > ._model-title-with-icon_rn0uf_1 ._badge_rn0uf_35 {
|
|
|
930
930
|
border-bottom: solid 1px var(--vscode-inputValidation-errorBorder);
|
|
931
931
|
color: var(--vscode-foreground);
|
|
932
932
|
}
|
|
933
|
-
._tabs-
|
|
933
|
+
._tabs-container_zt8hy_1 {
|
|
934
934
|
background-color: var(--vscode-sideBar-background);
|
|
935
935
|
display: inline-flex;
|
|
936
936
|
justify-content: space-between;
|
|
937
937
|
}
|
|
938
938
|
|
|
939
|
-
._active-
|
|
939
|
+
._active-tab_zt8hy_7 {
|
|
940
940
|
border-color: var(--vscode-button-background);
|
|
941
941
|
color: var(--vscode-button-background);
|
|
942
942
|
border-width: 1.25px;
|
|
943
943
|
}
|
|
944
944
|
|
|
945
|
+
:root {
|
|
946
|
+
--vscode-overlay-background: rgba(0, 0, 0, 0.5);
|
|
947
|
+
--vscode-modal-background: var(--vscode-sideBar-background);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
._dialog-overlay_zt8hy_1 {
|
|
951
|
+
inset: 0;
|
|
952
|
+
position: fixed;
|
|
953
|
+
background-color: var(--vscode-overlay-background);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
._dialog-content_zt8hy_1 {
|
|
957
|
+
background-color: var(--vscode-modal-background);
|
|
958
|
+
border-radius: 6px;
|
|
959
|
+
box-shadow: hsl(206 22% 7% / 35%) 0 10px 38px -10px, hsl(206 22% 7% / 20%) 0 10px 20px -15px;
|
|
960
|
+
position: fixed;
|
|
961
|
+
top: 50%;
|
|
962
|
+
left: 50%;
|
|
963
|
+
transform: translate(-50%, -50%);
|
|
964
|
+
width: 90vw;
|
|
965
|
+
max-width: 450px;
|
|
966
|
+
max-height: 85vh;
|
|
967
|
+
padding: 25px;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
._dialog-content_zt8hy_1:focus {
|
|
971
|
+
outline: none;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
._dialog-title_zt8hy_1 {
|
|
975
|
+
margin: 0;
|
|
976
|
+
font-weight: 500;
|
|
977
|
+
font-size: 17px;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
._dialog-description_zt8hy_1 {
|
|
981
|
+
margin: 10px 0 20px;
|
|
982
|
+
font-size: 15px;
|
|
983
|
+
line-height: 1.5;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
._dialog-footer_zt8hy_1 {
|
|
987
|
+
margin-top: 1.5rem;
|
|
988
|
+
width: 100%;
|
|
989
|
+
display: flex;
|
|
990
|
+
justify-content: flex-end;
|
|
991
|
+
gap: 0.5rem;
|
|
992
|
+
}
|
|
993
|
+
|
|
945
994
|
/*
|
|
946
995
|
Since this package is used only for Cody Web in Sourcegraph it's ok to
|
|
947
996
|
not include this in the cody web package since highlights styles is already
|
|
@@ -3590,10 +3639,133 @@ body[data-vscode-theme-kind="vscode-high-contrast"] .high-contrast-dark\:tw-bord
|
|
|
3590
3639
|
.\[\&_kbd\]\:tw-mt-\[-4px\] kbd {
|
|
3591
3640
|
margin-top: -4px;
|
|
3592
3641
|
}
|
|
3593
|
-
|
|
3594
|
-
|
|
3642
|
+
|
|
3643
|
+
._root_maej5_2 {
|
|
3595
3644
|
display: flex;
|
|
3596
|
-
|
|
3597
|
-
justify-content: center;
|
|
3645
|
+
width: 100%;
|
|
3598
3646
|
height: 100%;
|
|
3647
|
+
font-size: 13px;
|
|
3648
|
+
overflow: hidden;
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
._container_maej5_10 {
|
|
3652
|
+
height: 100%;
|
|
3653
|
+
flex-grow: 1;
|
|
3654
|
+
}
|
|
3655
|
+
:root {
|
|
3656
|
+
--cody-web-skeleton-main-color: #3e475e;
|
|
3657
|
+
--cody-web-skeleton-blink-color: #4d5875;
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
._root_1yqw7_6 {
|
|
3661
|
+
width: 100%;
|
|
3662
|
+
height: 100%;
|
|
3663
|
+
display: flex;
|
|
3664
|
+
flex-direction: column;
|
|
3665
|
+
gap: 1rem;
|
|
3666
|
+
padding: 0.5rem 0.75rem;
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
._header_1yqw7_15 {
|
|
3670
|
+
display: flex;
|
|
3671
|
+
gap: 0.5rem;
|
|
3672
|
+
padding: 0.25rem;
|
|
3673
|
+
align-items: center;
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
._chat_1yqw7_22 {
|
|
3677
|
+
display: flex;
|
|
3678
|
+
flex-direction: column;
|
|
3679
|
+
gap: 0.25rem;
|
|
3680
|
+
}
|
|
3681
|
+
|
|
3682
|
+
._chat-input_1yqw7_1 {
|
|
3683
|
+
width: 100%;
|
|
3684
|
+
border-radius: 3px;
|
|
3685
|
+
border: 2px solid var(--vscode-widget-border);
|
|
3686
|
+
padding: 0.5rem;
|
|
3687
|
+
display: flex;
|
|
3688
|
+
flex-direction: column;
|
|
3689
|
+
gap: 0.5rem;
|
|
3690
|
+
}
|
|
3691
|
+
|
|
3692
|
+
._chat-mentions-row_1yqw7_1 {
|
|
3693
|
+
display: flex;
|
|
3694
|
+
gap: 0.25rem;
|
|
3695
|
+
align-items: center;
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
._chat-submit-button_1yqw7_1 {
|
|
3699
|
+
margin-left: auto;
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
._message_1yqw7_48 {
|
|
3703
|
+
display: flex;
|
|
3704
|
+
flex-direction: column;
|
|
3705
|
+
gap: 0.25rem;
|
|
3706
|
+
}
|
|
3707
|
+
|
|
3708
|
+
._message-content_1yqw7_1 {
|
|
3709
|
+
margin-top: 0.5rem;
|
|
3710
|
+
display: flex;
|
|
3711
|
+
gap: 0.5rem;
|
|
3712
|
+
flex-wrap: wrap;
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
._line_1yqw7_61 {
|
|
3716
|
+
width: 100%;
|
|
3717
|
+
max-width: 7rem;
|
|
3718
|
+
height: 0.75rem;
|
|
3719
|
+
flex-grow: 0;
|
|
3720
|
+
flex-shrink: 0;
|
|
3721
|
+
border-radius: 3px;
|
|
3722
|
+
background-size: 200% 100%;
|
|
3723
|
+
animation: _shine-lines_1yqw7_1 1s infinite linear;
|
|
3724
|
+
|
|
3725
|
+
background-image: linear-gradient(
|
|
3726
|
+
100deg,
|
|
3727
|
+
var(--cody-web-skeleton-main-color) 0,
|
|
3728
|
+
var(--cody-web-skeleton-blink-color) 40px,
|
|
3729
|
+
var(--cody-web-skeleton-main-color) 80px
|
|
3730
|
+
);
|
|
3731
|
+
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
._line-circle_1yqw7_1 {
|
|
3735
|
+
width: 1.5rem;
|
|
3736
|
+
height: 1.5rem;
|
|
3737
|
+
border-radius: 50%;
|
|
3738
|
+
flex-grow: 0;
|
|
3739
|
+
flex-shrink: 0;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
._line-circle-small_1yqw7_1 {
|
|
3743
|
+
width: 1rem;
|
|
3744
|
+
height: 1rem;
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3747
|
+
._line-small_1yqw7_1 {
|
|
3748
|
+
max-width: 5rem;
|
|
3749
|
+
height: 0.5rem;
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
._line-short-text_1yqw7_1 {
|
|
3753
|
+
|
|
3754
|
+
max-width: 3rem;
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
._line-text_1yqw7_1 {
|
|
3758
|
+
|
|
3759
|
+
max-width: 8rem;
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
._line-long-text_1yqw7_1 {
|
|
3763
|
+
|
|
3764
|
+
max-width: 20rem;
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
@keyframes _shine-lines_1yqw7_1 {
|
|
3768
|
+
100% {
|
|
3769
|
+
background-position-x: -200%;
|
|
3770
|
+
}
|
|
3599
3771
|
}
|