@sourcegraph/cody-web 0.5.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.
- package/dist/{agent.worker-CHrb4rcq.js → agent.worker-Cjx_iNtn.mjs} +3602 -8945
- package/dist/agent.worker.js +2 -3
- package/dist/{time-date-C7nUVQ0Y.js → browser-BpZhCiRU.mjs} +11020 -4401
- package/dist/{cl100k_base-BgU9RXdk.js → cl100k_base-B4kyDDRQ.mjs} +3 -3
- package/dist/demo/App.d.ts.map +1 -1
- package/dist/{git-log-Bn_F1p4S.js → git-log-BWpOPYwA.mjs} +10 -10
- package/dist/{index-ZysJUhSy.js → index-D2gpkgry.mjs} +74 -74
- package/dist/index.js +26961 -14269
- 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/lib/types.d.ts +5 -4
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/shell-DvMNfs3M.mjs +47 -0
- package/dist/style.css +138 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- 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
- package/dist/shell-DFgpuMKe.js +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sourcegraph/cody-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Cody standalone web app",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"types": "dist/lib/index.d.ts",
|
|
13
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": true,
|
|
14
14
|
"files": ["dist/*"],
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "vite --mode development",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@vitest/web-worker": "^1.4.0",
|
|
29
29
|
"@vscode/codicons": "^0.0.35",
|
|
30
30
|
"buffer": "^6.0.3",
|
|
31
|
+
"classnames": "^2.5.1",
|
|
31
32
|
"cody-ai": "workspace:*",
|
|
32
33
|
"events": "^3.3.0",
|
|
33
34
|
"idb": "^8.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodyWebPanel.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAmD,MAAM,OAAO,CAAA;AA2BhF,OAAO,6BAA6B,CAAA;AAkBpC,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAID,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwK9C,CAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type FunctionComponent, type PropsWithChildren } from 'react';
|
|
2
|
-
import type { MessageConnection } from 'vscode-jsonrpc/browser';
|
|
3
|
-
import { type VSCodeWrapper } from 'cody-ai/webviews/utils/VSCodeApi';
|
|
4
|
-
import type { InitialContext } from '../types';
|
|
5
|
-
interface AgentClient {
|
|
6
|
-
rpc: MessageConnection;
|
|
7
|
-
dispose(): void;
|
|
8
|
-
}
|
|
9
|
-
interface CodyWebPanelContextData {
|
|
10
|
-
client: AgentClient | Error | null;
|
|
11
|
-
activeWebviewPanelID: string;
|
|
12
|
-
vscodeAPI: VSCodeWrapper;
|
|
13
|
-
initialContext: InitialContext | undefined;
|
|
14
|
-
}
|
|
15
|
-
export declare const CodyWebPanelContext: import("react").Context<CodyWebPanelContextData>;
|
|
16
|
-
interface CodyWebPanelProviderProps {
|
|
17
|
-
serverEndpoint: string;
|
|
18
|
-
accessToken: string | null;
|
|
19
|
-
createAgentWorker: () => Worker;
|
|
20
|
-
telemetryClientName?: string;
|
|
21
|
-
initialContext?: InitialContext;
|
|
22
|
-
customHeaders?: Record<string, string>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The root store/provider node for Cody Web, creates and shares
|
|
26
|
-
* agent client and maintains active web panel ID, chat history and vscodeAPI.
|
|
27
|
-
*/
|
|
28
|
-
export declare const CodyWebPanelProvider: FunctionComponent<PropsWithChildren<CodyWebPanelProviderProps>>;
|
|
29
|
-
export declare function useWebAgentClient(): CodyWebPanelContextData;
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=CodyWebPanelProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodyWebPanelProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebPanelProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EASzB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAM/D,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,kCAAkC,CAAA;AAGvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAS9C,UAAU,WAAW;IACjB,GAAG,EAAE,iBAAiB,CAAA;IACtB,OAAO,IAAI,IAAI,CAAA;CAClB;AAED,UAAU,uBAAuB;IAC7B,MAAM,EAAE,WAAW,GAAG,KAAK,GAAG,IAAI,CAAA;IAClC,oBAAoB,EAAE,MAAM,CAAA;IAC5B,SAAS,EAAE,aAAa,CAAA;IACxB,cAAc,EAAE,cAAc,GAAG,SAAS,CAAA;CAC7C;AAED,eAAO,MAAM,mBAAmB,kDAS9B,CAAA;AAEF,UAAU,yBAAyB;IAC/B,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;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAwLhG,CAAA;AAED,wBAAgB,iBAAiB,IAAI,uBAAuB,CAE3D"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A helper method to convert any `Storage` object into a React hook, such as `useLocalStorage`.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useStorageHook: <T>(storage: Storage, key: string, initialValue: T) => [T, Dispatch<SetStateAction<T>>];
|
|
6
|
-
/**
|
|
7
|
-
* A React hook to use and set state that is persisted in localStorage.
|
|
8
|
-
*
|
|
9
|
-
* @param key The localStorage key to use for persistence.
|
|
10
|
-
* @param initialValue The initial value to use when there is no value in localStorage for the key.
|
|
11
|
-
* @returns A getter and setter for the value (`const [foo, setFoo] = useLocalStorage('key', 123)`).
|
|
12
|
-
*/
|
|
13
|
-
export declare const useLocalStorage: <T>(key: string, initialValue: T) => [T, Dispatch<SetStateAction<T>>];
|
|
14
|
-
//# sourceMappingURL=use-local-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-local-storage.d.ts","sourceRoot":"","sources":["../../../lib/utils/use-local-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,cAAc,EAKtB,MAAM,OAAO,CAAA;AAyCd;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,WACnB,OAAO,OACX,MAAM,gBACG,CAAC,KAChB,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAwBjC,CAAA;AA2DD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,OAAO,MAAM,gBAAgB,CAAC,KAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CACvC,CAAA"}
|
package/dist/shell-DFgpuMKe.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const agent_worker = require("./agent.worker-CHrb4rcq.js");
|
|
4
|
-
const timeDate = require("./time-date-C7nUVQ0Y.js");
|
|
5
|
-
var define_process_default = { env: {} };
|
|
6
|
-
const _exec = agent_worker.util.promisify(agent_worker.exec);
|
|
7
|
-
async function getContextFileFromShell(command) {
|
|
8
|
-
return timeDate.wrapInActiveSpan("commands.context.command", async (span) => {
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
const rootDir = agent_worker.os.homedir() || define_process_default.env.HOME || define_process_default.env.USERPROFILE || "";
|
|
11
|
-
if (!agent_worker.env.shell) {
|
|
12
|
-
void agent_worker.window.showErrorMessage("Shell command is not supported your current workspace.");
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
const filteredCommand = command.replaceAll(/(\s~\/)/g, ` ${rootDir}${agent_worker.path.sep}`);
|
|
16
|
-
const cwd = (_c = (_b = (_a = agent_worker.workspace.workspaceFolders) == null ? void 0 : _a[0]) == null ? void 0 : _b.uri) == null ? void 0 : _c.fsPath;
|
|
17
|
-
try {
|
|
18
|
-
const { stdout, stderr } = await _exec(filteredCommand, { cwd, encoding: "utf8" });
|
|
19
|
-
const output = JSON.stringify(stdout ?? stderr).trim();
|
|
20
|
-
if (!output) {
|
|
21
|
-
throw new Error("Empty output");
|
|
22
|
-
}
|
|
23
|
-
const content = outputWrapper.replace("{command}", command).replace("{output}", output);
|
|
24
|
-
const size = await timeDate.TokenCounterUtils.countTokens(content);
|
|
25
|
-
return [
|
|
26
|
-
{
|
|
27
|
-
type: "file",
|
|
28
|
-
content,
|
|
29
|
-
title: "Terminal Output",
|
|
30
|
-
uri: agent_worker.Uri.file(command),
|
|
31
|
-
source: timeDate.ContextItemSource.Terminal,
|
|
32
|
-
size
|
|
33
|
-
}
|
|
34
|
-
];
|
|
35
|
-
} catch (error) {
|
|
36
|
-
agent_worker.logError("getContextFileFromShell", "failed", { verbose: error });
|
|
37
|
-
void agent_worker.window.showErrorMessage(error.message);
|
|
38
|
-
throw new Error("Failed to get shell output for Custom Command.");
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const outputWrapper = `
|
|
43
|
-
Terminal output from the \`{command}\` command enclosed between <OUTPUT0412> tags:
|
|
44
|
-
<OUTPUT0412>
|
|
45
|
-
{output}
|
|
46
|
-
</OUTPUT0412>`;
|
|
47
|
-
exports.getContextFileFromShell = getContextFileFromShell;
|