Skip to content

Commit

Permalink
Merge branch 'fix/feature-agents' into web-app
Browse files Browse the repository at this point in the history
  • Loading branch information
wadhia-yash committed Sep 16, 2024
2 parents 9120d90 + 2bb6a14 commit d5def36
Show file tree
Hide file tree
Showing 17 changed files with 916 additions and 897 deletions.
10 changes: 10 additions & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to the "commanddash" extension will be documented in this fi

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.5.1]
- Replacing CLI with REST APIs to interact with model
- Crashing fixes

## [0.5.0]
- User Experience Improvements

## [0.4.9]
- Set minimum VSCode engine to 1.77.0

## [0.4.8]
- Don't ask for Gemini API Key
- Removed google generative ai package dependencies
Expand Down
12 changes: 6 additions & 6 deletions vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<div align="center">
<h3>Integrate APIs, SDKs or Packages with AI Agents</h3>
<h3>Integrate Packages and SDKs with AI Agents</h3>

[![VScode Downloads](https://img.shields.io/visual-studio-marketplace/d/WelltestedAI.fluttergpt)](https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt&ssr=false#overview) [![VScode version](https://img.shields.io/visual-studio-marketplace/v/WelltestedAI.fluttergpt)](https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt&ssr=false#overview) [![License: APACHE](https://img.shields.io/badge/License-APACHE%202.0-yellow)](/LICENSE)
</div>
<img src="/assets/docs/poster.jpg"></a>

-----------------
CommandDash is a marketplace of AI agents that are expert at integrating APIs and SDKs.
CommandDash is a marketplace of AI agents that are expert at integrating Packages and SDKs.

Dash Agents are trained on the latest documentation, examples and issues enabling you to integrate any library without reading its docs by generating integration code contextualized to your codebase.

##### ✨ Skip the documentation
##### 🤝 Supports all languages
##### 👨🏼‍💻 Free for every developer

Currently in Beta, CommandDash is being built in [open-sourced](https://github.com/CommandDash/commanddash) with the community.
CommandDash is being built in [open-sourced](https://github.com/CommandDash/commanddash) with the community.

-----------------

Expand Down Expand Up @@ -54,19 +54,19 @@ Note: Commands are optionally offered by agents depending on the usecase.

## Contributing

CommanDash is hub of AI agents on docs of any APIs, SDKs and more.
CommanDash is hub of AI agents on docs of any Packages, SDKs and Github Libraries.

You can suggest agents to add to the marketplace, or contribute to the VSCODE or IntelliJ extension or also to the shared [engine](https://github.com/CommandDash/packages).

- **File feature requests**: Suggest features that'll make your development process easier in the [issues board](https://github.com/CommandDash/commanddash//issues).

- **Pick up open issues**: Pick up and fix existing issues open to the community in [issues board](https://github.com/CommandDash/commanddash/issues).

- **Request agents in the marketplace**: You can submit requests to add agents for your most used APIs or SDKs. [Fill Form](https://airtable.com/app22SBaii3xYD5aR/shrLv4mDsEtnFjmtj).
- **Create agents in the marketplace**: You can create agents for any Packages or SDKs in one-click. [Create Here](https://app.commanddash.io/?create=true).

## Community

Do you love devtools but hate documentation? Join our community and help developers build without leaving their IDE: [Join Now](https://join.slack.com/t/welltested-ai/shared_invite/zt-25u09fty8-gaggH9HbmopB~4tialTrlA) 👋🏼
Do you love devtools but hate documentation? Join our community and help developers build without leaving their IDE: [Join Now](https://discord.gg/szUCAnrsHQ) 👋🏼

## License

Expand Down
28 changes: 24 additions & 4 deletions vscode/media/market-place/market-place.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const userIcon =
<path d="M7.48514 7.55446C8.98514 7.55446 10.1881 6.41783 10.1881 5.03169C10.1881 3.64555 8.98514 2.49506 7.48514 2.49506C5.98514 2.49506 4.78217 3.63169 4.78217 5.01783C4.78217 6.40397 5.98514 7.55446 7.48514 7.55446ZM7.48514 3.1604C8.58415 3.1604 9.47524 3.99209 9.47524 5.01783C9.47524 6.04357 8.58415 6.87525 7.48514 6.87525C6.38613 6.87525 5.49504 6.05743 5.49504 5.03169C5.49504 4.00595 6.38613 3.1604 7.48514 3.1604ZM2.79207 11.505H12.2079C12.401 11.505 12.5644 11.3525 12.5644 11.1723C12.5644 9.42575 11.0346 7.99803 9.16336 7.99803H5.83663C3.96534 7.99803 2.43564 9.42575 2.43564 11.1723C2.43564 11.3525 2.599 11.505 2.79207 11.505ZM5.83663 8.66337H9.16336C10.5297 8.66337 11.6436 9.60595 11.8218 10.8396H3.17821C3.35643 9.60595 4.47029 8.66337 5.83663 8.66337Z" fill="white"/>
</svg>`;

const githubIcon =
`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 32 32">
<path fill="currentColor" fill-rule="evenodd" d="M16 2a14 14 0 0 0-4.43 27.28c.7.13 1-.3 1-.67v-2.38c-3.89.84-4.71-1.88-4.71-1.88a3.7 3.7 0 0 0-1.62-2.05c-1.27-.86.1-.85.1-.85a2.94 2.94 0 0 1 2.14 1.45a3 3 0 0 0 4.08 1.16a2.93 2.93 0 0 1 .88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4 5.4 0 0 1 1.44-3.76a5 5 0 0 1 .14-3.7s1.17-.38 3.85 1.43a13.3 13.3 0 0 1 7 0c2.67-1.81 3.84-1.43 3.84-1.43a5 5 0 0 1 .14 3.7a5.4 5.4 0 0 1 1.44 3.76c0 5.38-3.27 6.56-6.39 6.91a3.33 3.33 0 0 1 .95 2.59v3.84c0 .46.25.81 1 .67A14 14 0 0 0 16 2"/>
</svg>`;

const downloadIcon =
`<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.10151 8.53455C4.97826 8.65536 4.97627 8.85319 5.09705 8.97644L7.27905 11.1584C7.33757 11.2172 7.41711 11.2501 7.5 11.25C7.58289 11.2501 7.66239 11.2172 7.72095 11.1584L9.90295 8.97644C10.022 8.85494 10.022 8.66055 9.90295 8.53905C9.78214 8.41579 9.58431 8.41377 9.46106 8.53455L7.8125 10.1831V1.5625C7.8125 1.38992 7.67258 1.25 7.5 1.25C7.32742 1.25 7.1875 1.38992 7.1875 1.5625V10.1831L5.5389 8.53455C5.41744 8.41549 5.22301 8.41549 5.10151 8.53455ZM11.25 5.625H10.3125C10.1399 5.625 10 5.76492 10 5.9375C10 6.11008 10.1399 6.25 10.3125 6.25H11.25C11.94 6.25088 12.4991 6.81 12.5 7.5V11.875C12.4991 12.565 11.94 13.1241 11.25 13.125H3.75C3.06 13.1241 2.50088 12.565 2.5 11.875V7.5C2.50088 6.81 3.06 6.25088 3.75 6.25H5.3125C5.48508 6.25 5.625 6.11008 5.625 5.9375C5.625 5.76492 5.48508 5.625 5.3125 5.625H3.75C2.71492 5.62614 1.87614 6.46492 1.875 7.5V11.875C1.87614 12.9101 2.71492 13.7489 3.75 13.75H11.25C12.2851 13.7489 13.1239 12.9101 13.125 11.875V7.5C13.1239 6.46492 12.2851 5.62614 11.25 5.625Z" fill="white"/>
Expand Down Expand Up @@ -86,6 +91,21 @@ function parseAgents(agents) {
return { agents: {}, agentsList: [] };
}

const formatGithubUrl = (url) => {
const urlObj = new URL(url);
const paths = urlObj.pathname.split("/").filter(Boolean);
const [author, repo] = paths.slice(-2);
return { author, repo };
};

function formatText(url, maxLength) {
const { author, repo } = formatGithubUrl(url);
const formattedText = `${author}/${repo}`;
return formattedText.length > maxLength
? formattedText.slice(0, maxLength) + "..."
: formattedText;
}

function renderAgentsList(_agents) {
_agents.forEach(agent => {
// Create li element
Expand Down Expand Up @@ -157,12 +177,12 @@ function renderAgentsList(_agents) {
divRowInner.className = "inline-flex flex-row";

const spanAuthor = document.createElement("span");
spanAuthor.className = "text-xs text-gray-400 px-1 border-b border-gray-500";
spanAuthor.innerHTML = `<a target="_blank" href="https://github.com/${agent.author.github_id}">${agent.author.github_id}</a>`;
spanAuthor.className = "text-xs text-gray-400 px-1 border-b border-gray-500 ml-1";
spanAuthor.innerHTML = `<a target="_blank" rel="noreferrer" href="${agent.author.source_url}">${formatText(agent.author.source_url, 20)}</a>`;

const divAuthor = document.createElement("div");
divAuthor.className = "inline-flex flex-row items-center w-full justify-between";
divAuthor.innerHTML = userIcon;
divAuthor.innerHTML = githubIcon;
divAuthor.appendChild(spanAuthor);

divRowInner.appendChild(divAuthor);
Expand Down Expand Up @@ -201,7 +221,7 @@ function loadOnErrorImage(agentImage) {
agentImage.remove();

const svgContainer = document.createElement("div");
svgContainer.innerHTML = userIcon;
svgContainer.innerHTML = githubIcon;
agentImage.parentElement.appendChild(svgContainer);
}

Expand Down
15 changes: 0 additions & 15 deletions vscode/media/onboarding/onboarding.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@
Sign in with GitHub
</button>
</div>
<div id="executable-container" class="inline-flex flex-col items-center" style="width: 100%;">
<div class="inline-flex flex-row items-center">
<p class="break-words">Setting up your engine</p>
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"
id="executable-tick">
<path
d="M6 0C2.685 0 0 2.685 0 6C0 9.315 2.685 12 6 12C9.315 12 12 9.315 12 6C12 2.685 9.315 0 6 0ZM9 2.67L10.08 3.75L5.25 8.58L2.67 6L3.75 4.92L5.25 6.42L9 2.67Z"
fill="#3079D8" />
</svg>
</div>
</div>
<progress class="w-full mt-2" id="executable-progress" value="0" max="100"
style="width: 100%;"></progress>
</div>
</div>
</div>
<div class="flex-1 flex" id="bottom-container">
Expand Down
45 changes: 8 additions & 37 deletions vscode/media/onboarding/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,11 @@ const textInputContainer = document.getElementById("text-input-container");
const header = document.getElementById("header");
const chips = document.getElementById("chips");
const codeSnippetButton = document.getElementById("code-snippets");
const executableProgress = document.getElementById("executable-progress");
const githubLogin = document.getElementById("github-sign-in");
const executableTick = document.getElementById("executable-tick");
const onboardingSetup = document.getElementById("onboarding-setup");
const workspaceLoader = document.getElementById('workspace-loader');
const workspaceLoaderText = document.getElementById('workspace-loader-text');
const questionnaireContainer = document.getElementById("questionaire-container");
const executableContainer = document.getElementById("executable-container");
const fileUpload = document.getElementById("file-upload");
const activeAgentAttach = document.getElementById("agents");
// const activeCommandsAttach = document.getElementById("slash-commands");
Expand Down Expand Up @@ -979,7 +976,7 @@ async function submitResponse() {
if (checkValueExists(agentsData.registered_inputs)) {
const currentAgentData = data.find((agent) => agent.name === currentActiveAgent);
toggleLoader(true);
vscode.postMessage({ type: "agents", value: { data: { ...agentsData, agent: currentActiveAgent, agent_version: currentAgentData?.version, testing: currentAgentData?.testing, metadata: currentAgentData?.metadata }, isCommandLess: false } });
vscode.postMessage({ type: "agents", value: { data: { ...agentsData, agent: currentActiveAgent, agent_version: currentAgentData?.version ?? currentAgentData.versions[0].version, testing: currentAgentData?.testing, metadata: currentAgentData?.metadata }, isCommandLess: false } });

questionnaireContainer.classList.add("hidden");
textInput.textContent = "";
Expand All @@ -998,7 +995,7 @@ async function submitResponse() {
commandLessData.prompt = value;

const activeAgentData = data.find(agent => agent.name === currentActiveAgent);
const commandLess = { agent_version: activeAgentData.version, agent: activeAgentData.name, chat_mode: activeAgentData?.chat_mode, ...commandLessData, testing: activeAgentData?.testing, metadata: activeAgentData?.metadata };
const commandLess = { agent_version: activeAgentData.version ?? activeAgentData.versions[0].version, agent: activeAgentData.name, chat_mode: activeAgentData?.chat_mode, ...commandLessData, testing: activeAgentData?.testing, metadata: activeAgentData?.metadata };
vscode.postMessage({ type: "agents", value: { data: { ...commandLess }, isCommandLess: true } });
questionnaireContainer.classList.add("hidden");
textInput.textContent = "";
Expand Down Expand Up @@ -1055,7 +1052,7 @@ function handleSubmit(event) {
});
}
}

//' `vscode` what is this code'
// When triggered with /
else if (type === 'slash') {
// If no agent selected yet
Expand Down Expand Up @@ -1274,13 +1271,6 @@ function handleTriggerMessage(event) {
case 0:
isGithubLoginPending = true;
githubLogin.classList.remove("hidden");
executableContainer.classList.add("hidden");
break;

case 1:
isExecutableDownloadPending = true;
executableTick.classList.add('hidden');
executableProgress.classList.remove("hidden");
break;
}
});
Expand All @@ -1289,33 +1279,14 @@ function handleTriggerMessage(event) {
if (!isGithubLoginPending) {
isGithubLoginPending = false;
githubLogin.classList.add("hidden");
executableContainer.classList.remove("hidden");
vscode.postMessage({
type: "executeDownload",
});
}
if (!isExecutableDownloadPending) {
isExecutableDownloadPending = false;
executableTick.classList.remove("hidden");
executableProgress.classList.add("hidden");
}

allStepsCompleted();
setLoading(false);
break;
case 'executableDownloadProgress':
executableProgress.value = message.value;
break;
case 'executableDownloaded':
isExecutableDownloadPending = false;
executableTick.classList.remove("hidden");
executableProgress.classList.add("hidden");
allStepsCompleted();
break;
case 'githubLoggedIn':
isGithubLoginPending = false;
githubLogin.classList.add("hidden");
executableContainer.classList.remove("hidden");
allStepsCompleted();
break;
case 'cleanUpEventListener':
Expand Down Expand Up @@ -1410,7 +1381,7 @@ function toggleLoader(isShowLoader) {
}

function allStepsCompleted() {
if (!isGithubLoginPending && !isExecutableDownloadPending) {
if (!isGithubLoginPending) {
onboardingSetup.classList.add("hidden");
bottomContainer.classList.add("flex");
bottomContainer.classList.remove("hidden");
Expand Down Expand Up @@ -1732,7 +1703,7 @@ function displayMessages() {
roleElement.classList.add("block", "w-full", "px-2.5", "py-1.5", "bg-[#497BEF]/[.2]");

contentElement.classList.add("text-sm", "block", "px-2.5", "py-1.5", "pt-2", "break-words", "leading-relaxed", "bg-[#497BEF]/[.2]");
contentElement.innerHTML = markdownToPlain(message.parts);
contentElement.innerHTML = markdownToPlain(message.text);

} else if (message.role === "user") {
roleElement.innerHTML = "<strong>You</strong>";
Expand All @@ -1742,13 +1713,13 @@ function displayMessages() {
roleElement.appendChild(agents);
agents.innerHTML = `<span class="text-[#497BEF]">@${message.agent ? message.agent : ""}</span><span class="text-rose-500 mx-1">${message.slug ? message.slug : ""}</span>`;
contentElement.classList.add("text-sm", "block", "w-full", "px-2.5", "py-1.5", "break-words", "user-message");
contentElement.innerHTML = markdownToPlain(message.parts);
contentElement.innerHTML = markdownToPlain(message.text);
} else if (message.role === "dash") {
//UI implementation
roleElement.innerHTML = "<strong class='text-white'>CommandDash</strong>";
roleElement.classList.add("block", "w-full", "px-2.5", "py-1.5", "bg-[#497BEF]");
contentElement.classList.add("text-sm", "block", "w-full", "px-2.5", "py-1.5", "break-words", "bg-[#497BEF]", "text-white");
contentElement.innerHTML = markdownToPlain(message.parts);
contentElement.innerHTML = markdownToPlain(message.text);
buttonContainer.classList.add("inline-flex", "w-full", "px-2.5", "py-1.5",
"bg-[#497BEF]");
const messageIndex = conversationHistory.indexOf(message);
Expand All @@ -1768,7 +1739,7 @@ function displayMessages() {
roleElement.innerHTML = "<strong class='text-white'>Error</strong>";
roleElement.classList.add("block", "w-full", "px-2.5", "py-1.5", "bg-red-700");
contentElement.classList.add("text-sm", "block", "w-full", "px-2.5", "py-1.5", "break-words", "bg-red-700", "text-white");
contentElement.innerHTML = markdownToPlain(message.parts);
contentElement.innerHTML = markdownToPlain(message.text);
}
messageElement.classList.add("mt-1");
messageElement.appendChild(roleElement);
Expand Down
6 changes: 3 additions & 3 deletions vscode/package-lock.json

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

8 changes: 4 additions & 4 deletions vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "fluttergpt",
"displayName": "CommandDash: AI Agents for APIs, SDKs and more",
"description": "AI assist to integrate 1000+ libraries with expert agents from marketplace",
"version": "0.4.8",
"displayName": "CommandDash: Assist for Packages, SDKs, APIs and Github",
"description": "Only AI Copilot to integrate libraries with expert agents",
"version": "0.5.1",
"publisher": "WelltestedAI",
"icon": "media/icon.png",
"engines": {
"vscode": "^1.82.0"
"vscode": "^1.77.0"
},
"repository": {
"url": "https://github.com/CommandDash/commanddash"
Expand Down
29 changes: 0 additions & 29 deletions vscode/src/action-managers/refactor-agent.ts

This file was deleted.

Loading

0 comments on commit d5def36

Please sign in to comment.