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 16 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
97 changes: 89 additions & 8 deletions CLAUDE.md

Large diffs are not rendered by default.

26 changes: 19 additions & 7 deletions documentation/docs/setup/reqdConfigFusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type: tip
dbt Fusion is a command-line interface that provides enhanced dbt functionality with improved performance and additional features. Unlike standard dbt Core, dbt Fusion is a standalone executable that doesn't require a Python environment, making it easier to install and manage.

### Key Benefits of dbt Fusion Integration:

- **Standalone Installation**: No Python environment required
- **Enhanced Performance**: Optimized execution compared to standard dbt
- **Cross-Platform Support**: Available for macOS, Linux, and Windows
Expand Down Expand Up @@ -70,18 +71,21 @@ type: info
#### Manual Installation

**macOS and Linux:**

```bash
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh -s -- --update
```

**Windows (PowerShell):**

```powershell
irm https://public.cdn.getdbt.com/fs/install/install.ps1 | iex
```

#### Verify Installation

After installation, verify that dbt Fusion is properly installed by running:

```bash
dbt --version
```
Expand All @@ -93,36 +97,42 @@ You should see output that includes "dbt-fusion" in the version information.
Set the integration type to fusion in your VSCode settings:

#### Method 1: Via VSCode Settings UI

1. Open VSCode Settings (`Ctrl+,` / `Cmd+,`)
2. Search for "dbt integration"
3. Set "Dbt: Dbt Integration" to "fusion"

#### Method 2: Via settings.json

Add the following to your VSCode settings.json:

```json
{
"dbt.dbtIntegration": "fusion"
"dbt.dbtIntegration": "fusion"
}
```

### Step 3: Associate *.sql files with jinja-sql
### Step 3: Associate \*.sql files with jinja-sql

#### Method 1: Configure in Preferences > Settings

![File Associations](images/associations.png)

#### Method 2: Update settings.json directly

```json
{
"files.associations": {
"*.sql": "jinja-sql",
"*.yml": "jinja-yaml"
}
"files.associations": {
"*.sql": "jinja-sql",
"*.yml": "jinja-yaml"
}
}
```

### Step 4: Verify Configuration

After configuration, check that:

1. The bottom status bar shows "dbt fusion" with a checkmark
2. You can execute dbt commands through the extension
3. IntelliSense and syntax highlighting work in your dbt files
Expand Down Expand Up @@ -155,6 +165,7 @@ Go to VSCode extension settings, and add API key and instance name there.
dbt Fusion integration supports most extension features with some exceptions:

### ✅ Supported Features

- **Query Execution**: Execute models and preview results
- **SQL Compilation**: View compiled SQL code
- **Auto-completion**: IntelliSense for models, macros, and sources
Expand All @@ -165,6 +176,7 @@ dbt Fusion integration supports most extension features with some exceptions:
- **Query Explanation**: AI-powered SQL explanation

### ❌ Limited Features

- **Documentation Generation**: Not supported in dbt Fusion CLI
- **Some Advanced Features**: May have limitations compared to dbt Core integration

Expand Down Expand Up @@ -192,4 +204,4 @@ dbt Fusion supports macOS, Linux, and Windows. If you encounter installation iss

#### Why do I need to add the Altimate API key?

The API key is necessary for advanced AI-powered features like query explanation, test generation, and column lineage. Basic dbt operations (execution, compilation) work without an API key.
The API key is necessary for advanced AI-powered features like query explanation, test generation, and column lineage. Basic dbt operations (execution, compilation) work without an API key.
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 @@ -1356,6 +1356,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 @@ -1392,6 +1393,7 @@
"altimateai.vscode-altimate-mcp-server"
],
"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
13 changes: 8 additions & 5 deletions src/altimate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestInit } from "node-fetch";
import { CommentThread, env, Uri, window, workspace } from "vscode";
import { CommentThread, env, Range, Uri, window, workspace } from "vscode";
import { provideSingleton, processStreamResponse } from "./utils";
import { ColumnMetaData, NodeMetaData, SourceMetaData } from "./domain";
import { TelemetryService } from "./telemetry";
Expand All @@ -10,8 +10,11 @@ import { RateLimitException, ExecutionsExhaustedException } from "./exceptions";
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 @@ export interface ConversationGroup {
resource_type?: string;
range:
| {
end: vscode.Range["end"];
start: vscode.Range["start"];
end: Range["end"];
start: Range["start"];
}
| 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 @@ -47,7 +47,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";
import { CteInfo } from "../code_lens_provider/cteCodeLensProvider";

Expand Down
2 changes: 1 addition & 1 deletion src/dbtPowerUserExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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";
import { DbtPowerUserMcpServer } from "./mcp";

enum PromptAnswer {
Expand Down
5 changes: 4 additions & 1 deletion src/inversify.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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";
import {
DBTFusionCommandDetection,
Expand Down
Loading
Loading