@sourcegraph/cody-web 0.5.1 → 0.6.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.
@@ -1 +1 @@
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
+ {"version":3,"file":"CodyWebPanel.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAmD,MAAM,OAAO,CAAA;AA6BhF,OAAO,6BAA6B,CAAA;AAkBpC,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAID,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAsM9C,CAAA"}
@@ -1 +1 @@
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,EA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AAA;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,CA8LhG,CAAA;AAED,wBAAgB,iBAAiB,IAAI,uBAAuB,CAE3D"}
@@ -3,11 +3,12 @@ export interface Repository {
3
3
  name: string;
4
4
  }
5
5
  export type InitialContext = {
6
- repositories: Repository[];
7
- fileURL?: string;
8
- fileRange?: {
6
+ repository: Repository;
7
+ isDirectory: boolean;
8
+ fileURL: string | null;
9
+ fileRange: {
9
10
  startLine: number;
10
11
  endLine: number;
11
- };
12
+ } | null;
12
13
  };
13
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CACrD,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,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"}
@@ -0,0 +1,47 @@
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";
3
+ var define_process_default = { env: {} };
4
+ const _exec = util.promisify(exec);
5
+ async function getContextFileFromShell(command) {
6
+ return wrapInActiveSpan("commands.context.command", async (span) => {
7
+ var _a, _b, _c;
8
+ const rootDir = os.homedir() || define_process_default.env.HOME || define_process_default.env.USERPROFILE || "";
9
+ if (!env.shell) {
10
+ void window.showErrorMessage("Shell command is not supported your current workspace.");
11
+ return [];
12
+ }
13
+ const filteredCommand = command.replaceAll(/(\s~\/)/g, ` ${rootDir}${path.sep}`);
14
+ const cwd = (_c = (_b = (_a = workspace.workspaceFolders) == null ? void 0 : _a[0]) == null ? void 0 : _b.uri) == null ? void 0 : _c.fsPath;
15
+ try {
16
+ const { stdout, stderr } = await _exec(filteredCommand, { cwd, encoding: "utf8" });
17
+ const output = JSON.stringify(stdout ?? stderr).trim();
18
+ if (!output) {
19
+ throw new Error("Empty output");
20
+ }
21
+ const content = outputWrapper.replace("{command}", command).replace("{output}", output);
22
+ const size = await TokenCounterUtils.countTokens(content);
23
+ return [
24
+ {
25
+ type: "file",
26
+ content,
27
+ title: "Terminal Output",
28
+ uri: Uri.file(command),
29
+ source: ContextItemSource.Terminal,
30
+ size
31
+ }
32
+ ];
33
+ } catch (error) {
34
+ logError("getContextFileFromShell", "failed", { verbose: error });
35
+ void window.showErrorMessage(error.message);
36
+ throw new Error("Failed to get shell output for Custom Command.");
37
+ }
38
+ });
39
+ }
40
+ const outputWrapper = `
41
+ Terminal output from the \`{command}\` command enclosed between <OUTPUT0412> tags:
42
+ <OUTPUT0412>
43
+ {output}
44
+ </OUTPUT0412>`;
45
+ export {
46
+ getContextFileFromShell
47
+ };
package/dist/style.css CHANGED
@@ -1,9 +1,9 @@
1
- ._editor_1q84r_1 {
1
+ ._editor_9ox0p_1 {
2
2
  position: relative;
3
3
  }
4
4
 
5
5
  /* ContentEditable */
6
- ._content-editable_1q84r_6 {
6
+ ._content-editable_9ox0p_6 {
7
7
  border: 0;
8
8
  display: block;
9
9
  position: relative;
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  /* Placeholder */
14
- ._placeholder_1q84r_14 {
14
+ ._placeholder_9ox0p_14 {
15
15
  opacity: 0.6;
16
16
  overflow: hidden;
17
17
  position: absolute;
@@ -26,9 +26,13 @@
26
26
  }
27
27
 
28
28
  /* Theme */
29
- ._theme-paragraph_1q84r_29 {
29
+ ._theme-paragraph_9ox0p_29 {
30
30
  margin: 0;
31
31
  }
32
+
33
+ html[data-ide='JetBrains'] ._theme-paragraph_9ox0p_29 {
34
+ padding: 0.5rem;
35
+ }
32
36
  :root {
33
37
  --description-font-size: 0.9em; /* match VS Code quickpick description */
34
38
  }
@@ -3366,6 +3370,9 @@ imported in Sourcegraph shell.
3366
3370
  .hover\:tw-underline:hover {
3367
3371
  text-decoration-line: underline;
3368
3372
  }
3373
+ .hover\:tw-no-underline:hover {
3374
+ text-decoration-line: none;
3375
+ }
3369
3376
  .hover\:tw-opacity-100:hover {
3370
3377
  opacity: 1;
3371
3378
  }