@sourcegraph/cody-web 0.32.0 → 0.32.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.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/dist/{agent.worker-CDpvFRkI.mjs → agent.worker-CKzz1GcO.mjs} +46 -159
  3. package/dist/agent.worker.js +2 -2
  4. package/dist/demo/App.d.ts +4 -0
  5. package/dist/demo/App.d.ts.map +1 -0
  6. package/dist/demo/index.d.ts +2 -0
  7. package/dist/demo/index.d.ts.map +1 -0
  8. package/dist/{git-log-ltF6h_Tk.mjs → git-log-bbWyul1E.mjs} +1 -1
  9. package/dist/{index-D6x43_Eb.mjs → index-zVNzRGEc.mjs} +2 -2
  10. package/dist/index.js +1005 -861
  11. package/dist/lib/agent/agent.client.d.ts +19 -0
  12. package/dist/lib/agent/agent.client.d.ts.map +1 -0
  13. package/dist/lib/agent/agent.worker.d.ts +2 -0
  14. package/dist/lib/agent/agent.worker.d.ts.map +1 -0
  15. package/dist/lib/agent/index-db-storage.d.ts +15 -0
  16. package/dist/lib/agent/index-db-storage.d.ts.map +1 -0
  17. package/dist/lib/agent/shims/child_process.d.ts +5 -0
  18. package/dist/lib/agent/shims/child_process.d.ts.map +1 -0
  19. package/dist/lib/agent/shims/env-paths.d.ts +2 -0
  20. package/dist/lib/agent/shims/env-paths.d.ts.map +1 -0
  21. package/dist/lib/agent/shims/fs-extra.d.ts +3 -0
  22. package/dist/lib/agent/shims/fs-extra.d.ts.map +1 -0
  23. package/dist/lib/agent/shims/fs.d.ts +9 -0
  24. package/dist/lib/agent/shims/fs.d.ts.map +1 -0
  25. package/dist/lib/agent/shims/fs__promises.d.ts +11 -0
  26. package/dist/lib/agent/shims/fs__promises.d.ts.map +1 -0
  27. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts +3 -0
  28. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts.map +1 -0
  29. package/dist/lib/agent/shims/open.d.ts +3 -0
  30. package/dist/lib/agent/shims/open.d.ts.map +1 -0
  31. package/dist/lib/agent/shims/os.d.ts +10 -0
  32. package/dist/lib/agent/shims/os.d.ts.map +1 -0
  33. package/dist/lib/agent/shims/stream.d.ts +9 -0
  34. package/dist/lib/agent/shims/stream.d.ts.map +1 -0
  35. package/dist/lib/agent/shims/worker_threads.d.ts +3 -0
  36. package/dist/lib/agent/shims/worker_threads.d.ts.map +1 -0
  37. package/dist/lib/agent/shims/zlib.d.ts +7 -0
  38. package/dist/lib/agent/shims/zlib.d.ts.map +1 -0
  39. package/dist/lib/components/CodyPromptTemplate.d.ts +25 -0
  40. package/dist/lib/components/CodyPromptTemplate.d.ts.map +1 -0
  41. package/dist/lib/components/CodyWebChat.d.ts +69 -0
  42. package/dist/lib/components/CodyWebChat.d.ts.map +1 -0
  43. package/dist/lib/components/skeleton/ChatSkeleton.d.ts +12 -0
  44. package/dist/lib/components/skeleton/ChatSkeleton.d.ts.map +1 -0
  45. package/dist/lib/components/use-cody-agent.d.ts +20 -0
  46. package/dist/lib/components/use-cody-agent.d.ts.map +1 -0
  47. package/dist/lib/index.d.ts +6 -0
  48. package/dist/lib/index.d.ts.map +1 -0
  49. package/dist/lib/types.d.ts +28 -0
  50. package/dist/lib/types.d.ts.map +1 -0
  51. package/dist/tsconfig.tsbuildinfo +1 -0
  52. package/dist/{util-PivrZJhX.mjs → util-B-IYnWCp.mjs} +1 -1
  53. package/dist/{vscode-shim-Coc7PRnS.mjs → vscode-shim-BmcAncjv.mjs} +93 -105
  54. package/package.json +17 -15
@@ -0,0 +1,19 @@
1
+ import type { ServerInfo } from 'cody-ai/src/jsonrpc/agent-protocol';
2
+ import { type MessageConnection } from 'vscode-jsonrpc/browser';
3
+ export interface AgentClient {
4
+ serverInfo: ServerInfo;
5
+ rpc: MessageConnection;
6
+ dispose(): void;
7
+ }
8
+ interface AgentClientOptions {
9
+ serverEndpoint: string;
10
+ accessToken: string;
11
+ createAgentWorker: () => Worker;
12
+ telemetryClientName?: string;
13
+ customHeaders?: Record<string, string>;
14
+ debug?: boolean;
15
+ trace?: boolean;
16
+ }
17
+ export declare function createAgentClient({ serverEndpoint, accessToken, createAgentWorker, customHeaders, telemetryClientName, debug, trace, }: AgentClientOptions): Promise<AgentClient>;
18
+ export {};
19
+ //# sourceMappingURL=agent.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.client.d.ts","sourceRoot":"","sources":["../../../lib/agent/agent.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAGH,KAAK,iBAAiB,EAGzB,MAAM,wBAAwB,CAAA;AAG/B,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,iBAAiB,CAAA;IACtB,OAAO,IAAI,IAAI,CAAA;CAClB;AAED,UAAU,kBAAkB;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,MAAM,CAAA;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAsB,iBAAiB,CAAC,EACpC,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,KAAY,EACZ,KAAa,GAChB,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAyE3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=agent.worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.worker.d.ts","sourceRoot":"","sources":["../../../lib/agent/agent.worker.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { type IDBPDatabase } from 'idb';
2
+ import type * as vscode from 'vscode';
3
+ export declare class IndexDBStorage implements vscode.Memento {
4
+ private db;
5
+ static DATABASE_NAME: string;
6
+ static DATABASE_STORE_NAME: string;
7
+ private static IN_MEMORY_STORAGE;
8
+ private static initialize;
9
+ static create(): Promise<IndexDBStorage>;
10
+ constructor(db: IDBPDatabase);
11
+ keys(): readonly string[];
12
+ get<T>(key: string, defaultValue?: T): T | undefined;
13
+ update(key: string, value: any): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=index-db-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-db-storage.d.ts","sourceRoot":"","sources":["../../../lib/agent/index-db-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AAMrC,qBAAa,cAAe,YAAW,MAAM,CAAC,OAAO;IA+CrC,OAAO,CAAC,EAAE;IA9CtB,MAAM,CAAC,aAAa,SAAuB;IAC3C,MAAM,CAAC,mBAAmB,SAA4B;IAEtD,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAA8B;mBAOzC,UAAU;WAiBlB,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;gBAmB1B,EAAE,EAAE,YAAY;IAEpC,IAAI,IAAI,SAAS,MAAM,EAAE;IAIzB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAI9C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAWvD"}
@@ -0,0 +1,5 @@
1
+ export declare function spawn(): unknown;
2
+ export declare function execSync(): unknown;
3
+ export declare function execFile(): unknown;
4
+ export declare function exec(): unknown;
5
+ //# sourceMappingURL=child_process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child_process.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/child_process.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,IAAI,IAAI,OAAO,CAE9B"}
@@ -0,0 +1,2 @@
1
+ export default function (): unknown;
2
+ //# sourceMappingURL=env-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-paths.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/env-paths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,cAAc,OAAO,CAElC"}
@@ -0,0 +1,3 @@
1
+ export default function (): unknown;
2
+ export declare function copySync(): void;
3
+ //# sourceMappingURL=fs-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-extra.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/fs-extra.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,cAAc,OAAO,CAElC;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAE/B"}
@@ -0,0 +1,9 @@
1
+ export declare function readFileSync(): unknown;
2
+ export declare function appendFileSync(): unknown;
3
+ export declare function existsSync(): unknown;
4
+ export declare function mkdirSync(): unknown;
5
+ export declare function rmSync(): unknown;
6
+ export declare function copySync(): unknown;
7
+ export declare function copyFileSync(): unknown;
8
+ export declare function statSync(): unknown;
9
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/fs.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC"}
@@ -0,0 +1,11 @@
1
+ import type { Dirent, Stats } from 'node:fs';
2
+ export declare function readFile(): unknown;
3
+ export declare function stat(path: string): Promise<Stats>;
4
+ export declare function readdir(): Promise<Dirent[]>;
5
+ declare const _default: {
6
+ readFile: typeof readFile;
7
+ stat: typeof stat;
8
+ readdir: typeof readdir;
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=fs__promises.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs__promises.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/fs__promises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE5C,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAGjD;AAED,wBAAgB,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAM3C;;;;;;AAED,wBAA0C"}
@@ -0,0 +1,3 @@
1
+ import type { Observable } from 'observable-fns';
2
+ export declare function createInlineCompletionItemProvider(): Observable<void>;
3
+ //# sourceMappingURL=inline-completion-item-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-completion-item-provider.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/inline-completion-item-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,wBAAgB,kCAAkC,IAAI,UAAU,CAAC,IAAI,CAAC,CAErE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ //# sourceMappingURL=open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/open.ts"],"names":[],"mappings":";AAAA,wBAAiB"}
@@ -0,0 +1,10 @@
1
+ export declare function platform(): unknown;
2
+ export declare function arch(): unknown;
3
+ export declare function homedir(): unknown;
4
+ declare const _default: {
5
+ platform: typeof platform;
6
+ arch: typeof arch;
7
+ homedir: typeof homedir;
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=os.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/os.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,IAAI,IAAI,OAAO,CAE9B;AAED,wBAAgB,OAAO,IAAI,OAAO,CAEjC;;;;;;AAED,wBAA0C"}
@@ -0,0 +1,9 @@
1
+ export declare function Readable(): unknown;
2
+ export declare function Writable(): unknown;
3
+ declare const _default: {
4
+ Readable: {
5
+ prototype: {};
6
+ };
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/stream.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;;;;;;AAED,wBAEC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ //# sourceMappingURL=worker_threads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker_threads.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/worker_threads.ts"],"names":[],"mappings":";AAAA,wBAAiB"}
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ Readable: {
3
+ prototype: {};
4
+ };
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=zlib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zlib.d.ts","sourceRoot":"","sources":["../../../../lib/agent/shims/zlib.ts"],"names":[],"mappings":";;;;;AAAA,wBAEC"}
@@ -0,0 +1,25 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { type SerializedPromptEditorState } from '@sourcegraph/cody-shared';
3
+ import { type PromptEditorRefAPI } from '@sourcegraph/prompt-editor';
4
+ import { type UseCodyWebAgentInput } from './use-cody-agent';
5
+ import '../global-styles/styles.css';
6
+ export interface CodyPromptTemplateProps {
7
+ agentConfig: UseCodyWebAgentInput;
8
+ className?: string;
9
+ initialEditorState?: SerializedPromptEditorState | undefined;
10
+ disabled?: boolean;
11
+ placeholder?: string;
12
+ /**
13
+ * Whenever an external (imperative) Cody Chat API instance is ready,
14
+ * for example it gives you ability to run prompt, Note that this handler
15
+ * should be memoized and not change between components re-render, otherwise
16
+ * it will be stuck in infinite update loop
17
+ */
18
+ onEditorApiReady?: (api: PromptEditorRefAPI) => void;
19
+ }
20
+ /**
21
+ * The root component node for Cody Prompt Template editing, implements all things necessary
22
+ * to run this with @ mentions in the prompt template editor.
23
+ */
24
+ export declare const CodyPromptTemplate: FunctionComponent<CodyPromptTemplateProps>;
25
+ //# sourceMappingURL=CodyPromptTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodyPromptTemplate.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyPromptTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAMzB,MAAM,OAAO,CAAA;AAEd,OAAO,EASH,KAAK,2BAA2B,EAGnC,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAIH,KAAK,kBAAkB,EAC1B,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,6BAA6B,CAAA;AAYpC,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,oBAAoB,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAA;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAA;CACvD;AACD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CAgCzE,CAAA"}
@@ -0,0 +1,69 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { type ChatMessage } from '@sourcegraph/cody-shared';
3
+ import type { View } from 'cody-ai/webviews/tabs';
4
+ import type { CodyExternalApi, InitialContext } from '../types';
5
+ import { type UseCodyWebAgentInput } from './use-cody-agent';
6
+ import '../global-styles/styles.css';
7
+ /**
8
+ * Controls the rendering of the Cody Web Chat component.
9
+ */
10
+ export type ViewType = 'page' | 'sidebar';
11
+ export type ControllerMessage = {
12
+ type: 'view.change';
13
+ view: View;
14
+ } | {
15
+ type: 'chat.new';
16
+ } | {
17
+ type: 'history.clear';
18
+ } | {
19
+ type: 'history.download';
20
+ };
21
+ export type CodyWebChatMessage = {
22
+ type: 'chat.change';
23
+ chat: ChatMessage[];
24
+ } | {
25
+ type: 'view.change';
26
+ view: View;
27
+ };
28
+ export type MessageHandler = (message: ControllerMessage) => void;
29
+ type Unsubscriber = () => void;
30
+ /**
31
+ * The host system can pass an instance of this controller to the Cody Web Chat component to have finer control over its behavior.
32
+ * The controller allows the host system to change which view to show and get information about the current state of the chat.
33
+ */
34
+ export interface CodyWebChatController {
35
+ /**
36
+ * Sends messages from the chat component to the controller.
37
+ */
38
+ postMessage(message: CodyWebChatMessage): void;
39
+ /**
40
+ * Handles messages from the controller to the chat component.
41
+ */
42
+ onMessage(handler: MessageHandler): Unsubscriber;
43
+ }
44
+ export interface CodyWebChatProps {
45
+ agentConfig: UseCodyWebAgentInput;
46
+ initialContext?: InitialContext;
47
+ className?: string;
48
+ /** A controller that allows the host system to control the behavior of the chat. */
49
+ controller?: CodyWebChatController;
50
+ /** How to render the chat, either as standalone page or sidebar. Defaults to 'sidebar'. */
51
+ viewType?: ViewType;
52
+ /**
53
+ * Whenever an external (imperative) Cody Chat API instance is ready,
54
+ * for example it gives you ability to run prompt, Note that this handler
55
+ * should be memoized and not change between components re-render, otherwise
56
+ * it will be stuck in infinite update loop
57
+ */
58
+ onExternalApiReady?: (api: CodyExternalApi) => void;
59
+ }
60
+ /**
61
+ * The root component node for Cody Web Chat, implements Cody Agent client
62
+ * and connects VSCode Cody Chat UI with web-worker agent. The main component
63
+ * to use in Cody Web Consumers.
64
+ *
65
+ * You can see the demo usage of this component in demo/App.tsx
66
+ */
67
+ export declare const CodyWebChat: FunctionComponent<CodyWebChatProps>;
68
+ export {};
69
+ //# 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,EAEH,KAAK,iBAAiB,EAOzB,MAAM,OAAO,CAAA;AAGd,OAAO,EACH,KAAK,WAAW,EAUnB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAKjD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE/D,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,6BAA6B,CAAA;AAOpC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AASzC,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAElC,MAAM,MAAM,kBAAkB,GACxB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;AACjE,KAAK,YAAY,GAAG,MAAM,IAAI,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAC9C;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,YAAY,CAAA;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oFAAoF;IACpF,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAElC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAA;CACtD;AACD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAyC3D,CAAA"}
@@ -0,0 +1,12 @@
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 declare const PromptTemplateSkeleton: FC<ChatSkeletonProps>;
11
+ export {};
12
+ //# 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;AA0BD,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,iBAAiB,CAcxD,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { type VSCodeWrapper } from 'cody-ai/webviews/utils/VSCodeApi';
2
+ import { type AgentClient } from '../agent/agent.client';
3
+ export interface CodyWebAgent {
4
+ client: AgentClient;
5
+ vscodeAPI: VSCodeWrapper;
6
+ createNewChat: () => Promise<void>;
7
+ }
8
+ export interface UseCodyWebAgentInput {
9
+ serverEndpoint: string;
10
+ accessToken: string | null;
11
+ telemetryClientName?: string;
12
+ customHeaders?: Record<string, string>;
13
+ createAgentWorker: () => Worker;
14
+ }
15
+ /**
16
+ * Creates or reuses a cody agent instance. To improve performance we share a single cody agent
17
+ * instance across multiple invocations of cody web.
18
+ */
19
+ export declare function useCodyWebAgent(input: UseCodyWebAgentInput): CodyWebAgent | Error | null;
20
+ //# 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;AAGvF,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,uBAAuB,CAAA;AAe3E,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,WAAW,CAAA;IACnB,SAAS,EAAE,aAAa,CAAA;IACxB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACrC;AAMD,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,iBAAiB,EAAE,MAAM,MAAM,CAAA;CAClC;AA0BD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,GAAG,KAAK,GAAG,IAAI,CAexF"}
@@ -0,0 +1,6 @@
1
+ export { CodyWebChat, type CodyWebChatProps, type CodyWebChatController, type ViewType, type MessageHandler, type ControllerMessage, type CodyWebChatMessage, } from './components/CodyWebChat';
2
+ export { CodyPromptTemplate, type CodyPromptTemplateProps } from './components/CodyPromptTemplate';
3
+ export { ChatSkeleton } from './components/skeleton/ChatSkeleton';
4
+ export type { Repository, InitialContext, CodyExternalApi, PromptEditorRefAPI } from './types';
5
+ export { serialize, deserialize, type ChatMessage, } from '@sourcegraph/cody-shared';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GAC1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAClG,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAEjE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE9F,OAAO,EACH,SAAS,EACT,WAAW,EACX,KAAK,WAAW,GACnB,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,28 @@
1
+ import type { SerializedPromptEditorValue } from '@sourcegraph/cody-shared';
2
+ interface ExternalPrompt {
3
+ text: string;
4
+ autoSubmit: boolean;
5
+ mode?: 'search' | 'chat' | 'edit' | 'insert';
6
+ }
7
+ export interface CodyExternalApi {
8
+ runPrompt: (action: ExternalPrompt) => Promise<void>;
9
+ }
10
+ export interface Repository {
11
+ id: string | null;
12
+ name: string;
13
+ }
14
+ export type InitialContext = {
15
+ repository: Repository;
16
+ isDirectory: boolean;
17
+ fileURL: string | null;
18
+ fileRange: {
19
+ startLine: number;
20
+ endLine: number;
21
+ } | null;
22
+ };
23
+ export interface PromptEditorRefAPI {
24
+ getSerializedValue(): SerializedPromptEditorValue;
25
+ appendText(text: string): Promise<void>;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAI3E,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;CAC/C;AAED,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC3D,CAAA;AAED,MAAM,WAAW,kBAAkB;IAC/B,kBAAkB,IAAI,2BAA2B,CAAA;IACjD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1C"}