Skip to content

Feat-agents-v0 #1574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ module.exports = {
coverageDirectory: "coverage",
moduleNameMapper: {
"^vscode$": "<rootDir>/src/test/mock/vscode.ts",
"^@lib$": "<rootDir>/src/test/mock/lib.ts",
"^@altimateai/extension-components$": "<rootDir>/src/test/mock/lib.ts",
},
};
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,7 @@
"@vscode/debugprotocol": "^1.68.0",
"@vscode/test-electron": "^2.4.1",
"@vscode/zeromq": "^0.2.1",
"babel-loader": "^10.0.0",
"chai": "^4.3.10",
"concurrently": "^8.2.2",
"copy-webpack-plugin": "^11.0.0",
Expand Down Expand Up @@ -2092,6 +2093,7 @@
"ms-python.python"
],
"dependencies": {
"@altimateai/extension-components": "0.0.10-beta.3",
"@jupyterlab/coreutils": "^6.2.4",
"@jupyterlab/nbformat": "^4.2.4",
"@jupyterlab/services": "^6.6.7",
Expand Down
47 changes: 0 additions & 47 deletions postInstall.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,5 @@
// Copied from https://github.com/microsoft/vscode-jupyter/blob/main/build/ci/postInstall.js
const fs = require("fs");
const { downloadZMQ } = require("@vscode/zeromq");
const path = require("path");

/**
* In order to get raw kernels working, we reuse the default kernel that jupyterlab ships.
* However it expects to be talking to a websocket which is serializing the messages to strings.
* Our raw kernel is not a web socket and needs to do its own serialization. To do so, we make a copy
* of the default kernel with the serialization stripped out. This is simpler than making a copy of the module
* at runtime.
*/
function createJupyterKernelWithoutSerialization() {
var relativePath = path.join(
"node_modules",
"@jupyterlab",
"services",
"lib",
"kernel",
"default.js",
);
var filePath = path.join("", relativePath);
if (!fs.existsSync(filePath)) {
throw new Error(
"Jupyter lab default kernel not found '" +
filePath +
"' (Jupyter Extension post install script)",
);
}
var fileContents = fs.readFileSync(filePath, { encoding: "utf8" });
var replacedContents = fileContents
.replace(
/^const serialize =.*$/gm,
"const serialize = { serialize: (a) => a, deserialize: (a) => a };",
)
.replace(
"const owned = team.session === this.clientId;",
"const owned = parentHeader.session === this.clientId;",
);
if (replacedContents === fileContents) {
throw new Error(
"Jupyter lab default kernel cannot be made non serializing",
);
}
var destPath = path.join(path.dirname(filePath), "nonSerializingKernel.js");
fs.writeFileSync(destPath, replacedContents);
console.log(destPath + " file generated (by Jupyter VSC)");
}

async function downloadZmqBinaries() {
// if (common.getBundleConfiguration() === common.bundleConfiguration.web) {
Expand All @@ -55,7 +9,6 @@ async function downloadZmqBinaries() {
await downloadZMQ();
}

createJupyterKernelWithoutSerialization();
downloadZmqBinaries()
.then(() => process.exit(0))
.catch((ex) => {
Expand Down
7 changes: 5 additions & 2 deletions src/altimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
import { DBTProject } from "./manifest/dbtProject";
import { DBTTerminal } from "./dbt_client/dbtTerminal";
import { PythonEnvironment } from "./manifest/pythonEnvironment";
import { PreconfiguredNotebookItem, NotebookItem, NotebookSchema } from "@lib";
import * as vscode from "vscode";
import {
PreconfiguredNotebookItem,
NotebookItem,
NotebookSchema,
} from "@altimateai/extension-components";

export class NoCredentialsError extends Error {}

Expand Down Expand Up @@ -333,8 +336,8 @@
resource_type?: string;
range:
| {
end: vscode.Range["end"];

Check failure on line 339 in src/altimate.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

Cannot find namespace 'vscode'.

Check failure on line 339 in src/altimate.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Cannot find namespace 'vscode'.
start: vscode.Range["start"];

Check failure on line 340 in src/altimate.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

Cannot find namespace 'vscode'.

Check failure on line 340 in src/altimate.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Cannot find namespace 'vscode'.
}
| undefined;
};
Expand Down
2 changes: 1 addition & 1 deletion src/code_lens_provider/virtualSqlCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { provideSingleton } from "../utils";
import { QueryManifestService } from "../services/queryManifestService";
import { DBTProjectContainer } from "../manifest/dbtProjectContainer";
import { NotebookService } from "@lib";
import { NotebookService } from "@altimateai/extension-components";

@provideSingleton(VirtualSqlCodeLensProvider)
export class VirtualSqlCodeLensProvider
Expand Down
5 changes: 4 additions & 1 deletion src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ import { DBTProject } from "../manifest/dbtProject";
import { SQLLineagePanel } from "../webview_provider/sqlLineagePanel";
import { QueryManifestService } from "../services/queryManifestService";
import { AltimateRequest } from "../altimate";
import { DatapilotNotebookController, OpenNotebookRequest } from "@lib";
import {
DatapilotNotebookController,
OpenNotebookRequest,
} from "@altimateai/extension-components";
import { NotebookQuickPick } from "../quickpick/notebookQuickPick";

@provideSingleton(VSCodeCommands)
Expand Down
2 changes: 1 addition & 1 deletion src/dbtPowerUserExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { HoverProviders } from "./hover_provider";
import { DbtPowerUserActionsCenter } from "./quickpick";
import { ValidationProvider } from "./validation_provider";
import { CommentProviders } from "./comment_provider";
import { NotebookProviders } from "@lib";
import { NotebookProviders } from "@altimateai/extension-components";

enum PromptAnswer {
YES = "Yes",
Expand Down
5 changes: 4 additions & 1 deletion src/inversify.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ import { AltimateRequest } from "./altimate";
import { ValidationProvider } from "./validation_provider";
import { DeferToProdService } from "./services/deferToProdService";
import { SharedStateService } from "./services/sharedStateService";
import { NotebookKernelClient, NotebookDependencies } from "@lib";
import {
NotebookKernelClient,
NotebookDependencies,
} from "@altimateai/extension-components";
import { DBTCoreCommandProjectIntegration } from "./dbt_client/dbtCoreCommandIntegration";

export const container = new Container();
Expand Down
Loading
Loading