@sourcegraph/cody-web 0.23.1 → 0.25.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.
- package/LICENSE +201 -0
- package/dist/{agent.worker-C1v6q8V7.mjs → agent.worker-BRKfI6SV.mjs} +2197 -8109
- package/dist/agent.worker.js +2 -2
- package/dist/demo/App.d.ts.map +1 -1
- package/dist/{git-log-BSwwZCWt.mjs → git-log-gE5gHQIp.mjs} +1 -3
- package/dist/{index-CAyz-Vhx.mjs → index-C7qlPOAu.mjs} +2 -2
- package/dist/index.js +2029 -1496
- package/dist/lib/components/CodyPromptTemplate.d.ts.map +1 -1
- package/dist/lib/components/CodyWebChat.d.ts +43 -0
- package/dist/lib/components/CodyWebChat.d.ts.map +1 -1
- package/dist/lib/index.d.ts +3 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/style.css +347 -336
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util-CP7jPCzd.mjs +2033 -0
- package/dist/{browser-C8ruBrnx.mjs → vscode-shim-n3ps9Fur.mjs} +17098 -10865
- package/package.json +17 -15
- package/dist/child_process-C6OZyNb4.mjs +0 -18
- package/dist/util-CBKiMezg.mjs +0 -1811
|
@@ -1 +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,EAEH,KAAK,2BAA2B,EAGnC,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAIH,KAAK,kBAAkB,EAC1B,MAAM,4BAA4B,CAAA;AASnC,OAAO,6BAA6B,CAAA;
|
|
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,EAEH,KAAK,2BAA2B,EAGnC,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAIH,KAAK,kBAAkB,EAC1B,MAAM,4BAA4B,CAAA;AASnC,OAAO,6BAA6B,CAAA;AAYpC,MAAM,WAAW,uBAAuB;IACpC,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,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,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,CA0CzE,CAAA"}
|
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
import { type FunctionComponent } from 'react';
|
|
2
|
+
import { type ChatMessage } from '@sourcegraph/cody-shared';
|
|
3
|
+
import type { View } from 'cody-ai/webviews/tabs';
|
|
2
4
|
import type { CodyExternalApi, InitialContext } from '../types';
|
|
3
5
|
import '../global-styles/styles.css';
|
|
6
|
+
/**
|
|
7
|
+
* Controls the rendering of the Cody Web Chat component.
|
|
8
|
+
*/
|
|
9
|
+
export type ViewType = 'page' | 'sidebar';
|
|
10
|
+
export type ControllerMessage = {
|
|
11
|
+
type: 'view.change';
|
|
12
|
+
view: View;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'chat.new';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'history.clear';
|
|
17
|
+
} | {
|
|
18
|
+
type: 'history.download';
|
|
19
|
+
};
|
|
20
|
+
export type CodyWebChatMessage = {
|
|
21
|
+
type: 'chat.change';
|
|
22
|
+
chat: ChatMessage[];
|
|
23
|
+
} | {
|
|
24
|
+
type: 'view.change';
|
|
25
|
+
view: View;
|
|
26
|
+
};
|
|
27
|
+
export type MessageHandler = (message: ControllerMessage) => void;
|
|
28
|
+
export type Unsubscriber = () => void;
|
|
29
|
+
/**
|
|
30
|
+
* The host system can pass an instance of this controller to the Cody Web Chat component to have finer control over its behavior.
|
|
31
|
+
* The controller allows the host system to change which view to show and get information about the current state of the chat.
|
|
32
|
+
*/
|
|
33
|
+
export interface CodyWebChatController {
|
|
34
|
+
/**
|
|
35
|
+
* Sends messages from the chat component to the controller.
|
|
36
|
+
*/
|
|
37
|
+
postMessage(message: CodyWebChatMessage): void;
|
|
38
|
+
/**
|
|
39
|
+
* Handles messages from the controller to the chat component.
|
|
40
|
+
*/
|
|
41
|
+
onMessage(handler: MessageHandler): Unsubscriber;
|
|
42
|
+
}
|
|
4
43
|
export interface CodyWebChatProps {
|
|
5
44
|
serverEndpoint: string;
|
|
6
45
|
accessToken: string | null;
|
|
@@ -9,6 +48,10 @@ export interface CodyWebChatProps {
|
|
|
9
48
|
initialContext?: InitialContext;
|
|
10
49
|
customHeaders?: Record<string, string>;
|
|
11
50
|
className?: string;
|
|
51
|
+
/** A controller that allows the host system to control the behavior of the chat. */
|
|
52
|
+
controller?: CodyWebChatController;
|
|
53
|
+
/** How to render the chat, either as standalone page or sidebar. Defaults to 'sidebar'. */
|
|
54
|
+
viewType?: ViewType;
|
|
12
55
|
/**
|
|
13
56
|
* Whenever an external (imperative) Cody Chat API instance is ready,
|
|
14
57
|
* for example it gives you ability to run prompt, Note that this handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodyWebChat.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebChat.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
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I,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;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,CA2C3D,CAAA"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { CodyWebChat, type CodyWebChatProps } from './components/CodyWebChat';
|
|
1
|
+
export { CodyWebChat, type CodyWebChatProps, type CodyWebChatController, type ViewType, type MessageHandler, type ControllerMessage, type CodyWebChatMessage, } from './components/CodyWebChat';
|
|
2
2
|
export { CodyPromptTemplate, type CodyPromptTemplateProps } from './components/CodyPromptTemplate';
|
|
3
3
|
export { ChatSkeleton } from './components/skeleton/ChatSkeleton';
|
|
4
|
-
export type { Repository, InitialContext, CodyExternalApi } from './types';
|
|
5
|
-
export { serialize, deserialize, } from '@sourcegraph/cody-shared';
|
|
6
|
-
export { type PromptEditorRefAPI } from './types';
|
|
4
|
+
export type { Repository, InitialContext, CodyExternalApi, PromptEditorRefAPI } from './types';
|
|
5
|
+
export { serialize, deserialize, type ChatMessage, } from '@sourcegraph/cody-shared';
|
|
7
6
|
//# 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,
|
|
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"}
|