Skip to content
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

fix(onboarding steps): onboarding steps were getting shown after navigating from marketplace even after completed #307

Merged
merged 2 commits into from
Jun 19, 2024
Merged
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
1 change: 1 addition & 0 deletions vscode/media/onboarding/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ function allStepsCompleted() {
onboardingCompleted = true;
stepOneCompleted = true;
modelCount = 3;
pendingStepsArr = [];
}
}
function createReferenceChips(references, isCommandAction) {
Expand Down
2 changes: 2 additions & 0 deletions vscode/src/providers/chat_view_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
url: 'https://api.commanddash.dev/agent/get-agent-list',
data: {
"testing": false,
"cli_version": "0.0.1"

Check warning on line 257 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `cli_version` must match one of the following formats: camelCase
}
};
let response = await makeAuthorizedHttpRequest(config, this.context);
Expand All @@ -276,7 +276,7 @@
url: 'https://api.commanddash.dev/agent/get-agent',
data: {
"testing": testing,
"cli_version": "0.0.1",

Check warning on line 279 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `cli_version` must match one of the following formats: camelCase
"name": name,
"version": version
}
Expand Down Expand Up @@ -309,7 +309,7 @@
[`@${name}`]: {
...agentDetails,
name: `@${name}`,
supported_commands: agentDetails?.supported_commands.map((command: any) => ({

Check warning on line 312 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `supported_commands` must match one of the following formats: camelCase
...command,
slug: `/${command.slug}`
}))
Expand Down Expand Up @@ -341,6 +341,8 @@

private async _setupManager() {

this.setupManager = SetupManager.getInstance();
await this.setupManager.updatePendingSteps();
this._view?.webview.postMessage({ type: 'pendingSteps', value: JSON.stringify(this.setupManager.pendingSetupSteps) });

this.setupManager.onDidChangeSetup(event => {
Expand Down Expand Up @@ -482,7 +484,7 @@
//change agents on the select of agents
let prompt = '';
const conversationHistory = this._publicConversationHistory.filter(obj => Object.keys(obj)[0] === this._activeAgent).map(obj => obj[this._activeAgent]);
agentResponse = { ...agentResponse, registered_inputs: [...agentResponse.registered_inputs, { type: "chat_query_input", value: JSON.stringify(conversationHistory), id: Math.floor(Date.now() / 1000).toString() }], 'chat_documents': this.chatDocuments[this._activeAgent] };

Check warning on line 487 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `registered_inputs` must match one of the following formats: camelCase

Check warning on line 487 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `chat_documents` must match one of the following formats: camelCase
if (isCommandLess) {
prompt = agentResponse.prompt;
} else {
Expand All @@ -495,17 +497,17 @@
let auth = Auth.getInstance();
/// Request the client to process the task and handle result or error
let agentTrackData = {
'agent_name': (agentResponse['agent'] as string).substring(1),

Check warning on line 500 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `agent_name` must match one of the following formats: camelCase
'slash_command': agentResponse['slug'],

Check warning on line 501 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `slash_command` must match one of the following formats: camelCase
'agent_version': agentResponse['agent_version']

Check warning on line 502 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `agent_version` must match one of the following formats: camelCase
};
logEvent('agent_start', agentTrackData);
const response = await task.run({
kind: "agent-execute", data: {
"auth_details": {

Check warning on line 507 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `auth_details` must match one of the following formats: camelCase
"type": "gemini",
"key": auth.getApiKey(),
"github_token": auth.getGithubAccessToken()

Check warning on line 510 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `github_token` must match one of the following formats: camelCase
},
...agentResponse,
agent_name: (agentResponse['agent'] as string).substring(1) // remove the '@'
Expand Down
16 changes: 16 additions & 0 deletions vscode/src/utilities/setup-manager/setup-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ export class SetupManager {
}
}

public async updatePendingSteps() {

if (!this.auth.getGithubAccessToken()) {
this.pendingSetupSteps.push(SetupStep.github);
}
if (!this.auth.getApiKey()) {
this.pendingSetupSteps.push(SetupStep.apiKey);
}
if (this.dartClient && !this.dartClient.executableExists()) {
this.pendingSetupSteps.push(SetupStep.executable);
}
if (this.auth.getGithubAccessToken() && this.auth.getApiKey() && (this.dartClient && this.dartClient.executableExists())) {
this.pendingSetupSteps.length = 0;
}
}

public async setupGithub() {
await this.auth.signInWithGithub(this.context!);
this._onDidChangeSetup.fire(SetupStep.github);
Expand Down