@sourcegraph/cody-web 0.6.1 → 0.7.0

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.
@@ -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"}
@@ -1,4 +1,4 @@
1
- export { CodyWebPanelProvider } from './components/CodyWebPanelProvider';
2
- export { CodyWebPanel, type CodyWebPanelProps } from './components/CodyWebPanel';
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAEhF,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
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-DVKzbHSN.mjs";
2
- import { w as wrapInActiveSpan, T as TokenCounterUtils, C as ContextItemSource } from "./time-date-5mt-Pcg3.mjs";
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-Cjx_iNtn.mjs";
2
+ import { w as wrapInActiveSpan, T as TokenCounterUtils, C as ContextItemSource } from "./browser-BpZhCiRU.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
@@ -3590,10 +3590,133 @@ body[data-vscode-theme-kind="vscode-high-contrast"] .high-contrast-dark\:tw-bord
3590
3590
  .\[\&_kbd\]\:tw-mt-\[-4px\] kbd {
3591
3591
  margin-top: -4px;
3592
3592
  }
3593
- ._loading_1uiqw_1 {
3594
- margin: auto;
3593
+
3594
+ ._root_1dr1n_2 {
3595
3595
  display: flex;
3596
- align-items: center;
3597
- justify-content: center;
3596
+ height: 100vh;
3597
+ width: 100%;
3598
+ font-size: 13px;
3599
+ overflow: hidden;
3600
+ }
3601
+
3602
+ ._container_1dr1n_10 {
3598
3603
  height: 100%;
3604
+ flex-grow: 1;
3605
+ }
3606
+ :root {
3607
+ --cody-web-skeleton-main-color: #3e475e;
3608
+ --cody-web-skeleton-blink-color: #4d5875;
3609
+ }
3610
+
3611
+ ._root_1yqw7_6 {
3612
+ width: 100%;
3613
+ height: 100%;
3614
+ display: flex;
3615
+ flex-direction: column;
3616
+ gap: 1rem;
3617
+ padding: 0.5rem 0.75rem;
3618
+ }
3619
+
3620
+ ._header_1yqw7_15 {
3621
+ display: flex;
3622
+ gap: 0.5rem;
3623
+ padding: 0.25rem;
3624
+ align-items: center;
3625
+ }
3626
+
3627
+ ._chat_1yqw7_22 {
3628
+ display: flex;
3629
+ flex-direction: column;
3630
+ gap: 0.25rem;
3631
+ }
3632
+
3633
+ ._chat-input_1yqw7_1 {
3634
+ width: 100%;
3635
+ border-radius: 3px;
3636
+ border: 2px solid var(--vscode-widget-border);
3637
+ padding: 0.5rem;
3638
+ display: flex;
3639
+ flex-direction: column;
3640
+ gap: 0.5rem;
3641
+ }
3642
+
3643
+ ._chat-mentions-row_1yqw7_1 {
3644
+ display: flex;
3645
+ gap: 0.25rem;
3646
+ align-items: center;
3647
+ }
3648
+
3649
+ ._chat-submit-button_1yqw7_1 {
3650
+ margin-left: auto;
3651
+ }
3652
+
3653
+ ._message_1yqw7_48 {
3654
+ display: flex;
3655
+ flex-direction: column;
3656
+ gap: 0.25rem;
3657
+ }
3658
+
3659
+ ._message-content_1yqw7_1 {
3660
+ margin-top: 0.5rem;
3661
+ display: flex;
3662
+ gap: 0.5rem;
3663
+ flex-wrap: wrap;
3664
+ }
3665
+
3666
+ ._line_1yqw7_61 {
3667
+ width: 100%;
3668
+ max-width: 7rem;
3669
+ height: 0.75rem;
3670
+ flex-grow: 0;
3671
+ flex-shrink: 0;
3672
+ border-radius: 3px;
3673
+ background-size: 200% 100%;
3674
+ animation: _shine-lines_1yqw7_1 1s infinite linear;
3675
+
3676
+ background-image: linear-gradient(
3677
+ 100deg,
3678
+ var(--cody-web-skeleton-main-color) 0,
3679
+ var(--cody-web-skeleton-blink-color) 40px,
3680
+ var(--cody-web-skeleton-main-color) 80px
3681
+ );
3682
+
3683
+ }
3684
+
3685
+ ._line-circle_1yqw7_1 {
3686
+ width: 1.5rem;
3687
+ height: 1.5rem;
3688
+ border-radius: 50%;
3689
+ flex-grow: 0;
3690
+ flex-shrink: 0;
3691
+ }
3692
+
3693
+ ._line-circle-small_1yqw7_1 {
3694
+ width: 1rem;
3695
+ height: 1rem;
3696
+ }
3697
+
3698
+ ._line-small_1yqw7_1 {
3699
+ max-width: 5rem;
3700
+ height: 0.5rem;
3701
+ }
3702
+
3703
+ ._line-short-text_1yqw7_1 {
3704
+
3705
+ max-width: 3rem;
3706
+ }
3707
+
3708
+ ._line-text_1yqw7_1 {
3709
+
3710
+ max-width: 8rem;
3711
+ }
3712
+
3713
+ ._line-long-text_1yqw7_1 {
3714
+
3715
+ max-width: 20rem;
3716
+ }
3717
+
3718
+ @keyframes _shine-lines_1yqw7_1 {
3719
+ 100% {
3720
+ background-position-x: -200%;
3721
+ }
3599
3722
  }