Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lazToum committed Nov 23, 2024
0 parents commit 51d68e9
Show file tree
Hide file tree
Showing 38 changed files with 8,499 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-react"]
}
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#https://editorconfig.org/#file-format-details
root = true

[*]
charset = utf-8
end-of-line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# set eol to lf
* text=auto eol=lf
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/node_modules/
/.vscode-test/
.yarn/
.local/
.eslintcache
.stylelintcache
out/
public/*
!public/overview.webp
**/*.vsix
dist/
23 changes: 23 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from '@vscode/test-cli';
import * as path from 'path';
import * as url from 'url';

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export default defineConfig({
files: 'dist/test/**/*.test.js',
extensionDevelopmentPath: __dirname,
workspaceFolder: path.resolve(__dirname, 'example'),
launchArgs: [
'--disable-extensions',
'--disable-gpu',
'--no-sandbox',
'--profile-temp',
'--new-window',
'--sync',
'off',
'--log',
'critical'
]
});
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
41 changes: 41 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--sync",
"off",
"${workspaceFolder}/examples"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js",
"${workspaceFolder}/public/**/*"
],
"preLaunchTask": "npm: compile",
"debugWebviews": true,
"trace": true,
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/dist/test",
"${workspaceFolder}/examples"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: pre-test"
}
]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"files.eol": "\n",
"npm.packageManager": "yarn",
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"cSpell.words": [
"autohiding",
"csstree",
"eslintcache",
"forlint",
"ipynb",
"nosources",
"stylelintcache",
"trivago",
"USERPROFILE",
"waldiez",
"webp",
"xyflow",
"yarnrc"
],
"stm32-for-vscode.openOCDPath": false,
"stm32-for-vscode.armToolchainPath": false
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": ["$tsc-watch"],
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
7 changes: 7 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*
!icons/
!dist/
!LICENSE
!README.md
!package.json
!public/
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Waldiez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# @waldiez/vscode

A waldiez extension for Visual Studio Code.

<!--markdownlint-disable MD033-->
<img src="https://raw.githubusercontent.com/waldiez/vscode/refs/heads/main/public/overview.webp" alt="Waldiez Overview" width="100%">

## Features

- [x] Handle .waldiez files
- [x] Load existing .waldiez flows
- [ ] Convert .waldiez flows to .py scripts or .ipynb notebooks
- [ ] Run .waldiez flows sung a python interpreter

## Installation

The extension is still a work in progress and is not yet available in the Visual Studio Code marketplace. To build and install the extension locally, follow the instructions below.

1. Clone the repository
2. Run `yarn install` to install the dependencies
3. Run `yarn build` to build the extension. It should generate waldiez-vscode-x.y.z.vsix in the root directory
4. Install the extension by running `code --install-extension waldiez-vscode-x.y.z.vsix` or:
- Go to the Extensions view.
- Click Views and More Actions (or the ... icon) and select Install from VSIX....

To uninstall the extension and cleanup everything, you can remove the extension files (waldiez.* folder) from the extensions directory. The extensions directory is located at:

- Windows: %USERPROFILE%\.vscode\extensions
- macOS: ~/.vscode/extensions
- Linux: ~/.vscode/extensions

Reference: <https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions>
85 changes: 85 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import eslint from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslintTs from 'typescript-eslint';

// export default eslintTs.config({
const defaultConfig = eslintTs.config({
extends: [
eslint.configs.recommended,
...eslintTs.configs.recommended,
eslintPluginPrettierRecommended
],
ignores: ['node_modules', 'dist', 'public', '.local', '**/assets/**'],
plugins: {
'@stylistic': stylistic
},
rules: {
'prettier/prettier': [
'error',
{
tabWidth: 4,
singleQuote: true,
trailingComma: 'none',
arrowParens: 'avoid',
endOfLine: 'auto'
},
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@stylistic/no-explicit-any': 'off',
'@stylistic/no-trailing-spaces': 'off',
'@stylistic/padded-blocks': 'off',
'@stylistic/function-paren-newline': 'off',
'@stylistic/no-use-before-define': 'off',
'@stylistic/quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: false
}
],
curly: ['error', 'all'],
eqeqeq: 'error',
'prefer-arrow-callback': 'error'
}
});

export default [
...defaultConfig,
// overrides
...defaultConfig.map(config => ({
...config,
files: ['*spec.ts', '*spec.tsx'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules: {
...config.rules,
'jest/expect-expect': 'off'
}
}))
];
1 change: 1 addition & 0 deletions examples/On-boarding.waldiez
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"flow","name":"On-boarding","description":"Sequential Chats and Customer Onboarding","tags":[],"requirements":[],"storageId":"id-25ff1085-a83a-4b40-ac1b-e5e859309526","createdAt":"2024-11-19T18:42:47.160Z","updatedAt":"2024-11-19T18:43:01.254Z","data":{"nodes":[{"id":"wa-7jZd6Xl63-ERlwgCrB0z_","type":"agent","position":{"x":45,"y":180},"hidden":false,"measured":{"width":206,"height":216},"selected":false,"dragging":false},{"id":"wm-lg_EkFoogeOmHCtbz1kzt","type":"model","position":{"x":0,"y":0},"measured":{"width":182,"height":182},"selected":false,"hidden":true},{"id":"wm-Vu7wVaMZdiiphPWqjZKBy","type":"model","position":{"x":240,"y":0},"measured":{"width":182,"height":182},"selected":false,"hidden":true},{"id":"wa-1o9wXz2yEKvf0K-dBv_xs","position":{"x":45,"y":600},"type":"agent","selected":false,"measured":{"width":206,"height":216},"dragging":false,"hidden":false},{"id":"wa-G3QDaq8eNguzALeN7MjFL","type":"agent","position":{"x":600,"y":375},"hidden":false,"measured":{"width":206,"height":216},"selected":false,"dragging":false},{"id":"wa-VBomQg7ktU08PEpRhbqpZ","type":"agent","position":{"x":1020,"y":375},"hidden":false,"measured":{"width":206,"height":216},"selected":false,"dragging":false}],"edges":[{"id":"we-dZSBom-8MDL7aDUHmE1NY","source":"wa-7jZd6Xl63-ERlwgCrB0z_","target":"wa-G3QDaq8eNguzALeN7MjFL","type":"chat","animated":false,"selected":false,"markerEnd":{"type":"arrowclosed","color":"#66bc57","width":10,"height":10},"style":{"stroke":"#66bc57","strokeWidth":3}},{"id":"we-6srMl_vK6XO2RkYNCgBdP","source":"wa-1o9wXz2yEKvf0K-dBv_xs","target":"wa-G3QDaq8eNguzALeN7MjFL","type":"chat","animated":false,"selected":false,"markerEnd":{"type":"arrowclosed","color":"#66bc57","width":10,"height":10},"style":{"stroke":"#66bc57","strokeWidth":3}},{"id":"we-yzQjCkp9F_BtX-UPT7EUZ","source":"wa-G3QDaq8eNguzALeN7MjFL","target":"wa-VBomQg7ktU08PEpRhbqpZ","type":"chat","animated":false,"selected":false,"markerEnd":{"type":"arrowclosed","color":"#bc76f5","width":10,"height":10},"style":{"stroke":"#bc76f5","strokeWidth":3}}],"viewport":{"x":133.5,"y":76.5,"zoom":1},"agents":{"users":[{"id":"wa-G3QDaq8eNguzALeN7MjFL","type":"agent","agentType":"user","name":"Customer Proxy","description":"A user proxy agent","tags":[],"requirements":[],"createdAt":"2024-10-28T17:57:39.013Z","updatedAt":"2024-10-28T17:58:01.613Z","data":{"systemMessage":null,"humanInputMode":"ALWAYS","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":[],"skills":[],"parentId":null,"nestedChats":[]}}],"assistants":[{"id":"wa-7jZd6Xl63-ERlwgCrB0z_","type":"agent","agentType":"assistant","name":"personal_information_agent","description":"On-boarding Personal information agent","tags":[],"requirements":[],"createdAt":"2024-10-28T17:48:28.045Z","updatedAt":"2024-10-28T17:54:30.390Z","data":{"systemMessage":"You are a helpful customer on-boarding agent, you are here to help new customers get started with our product. Your job is to gather customer's name and location. Do not ask for other information. Return 'TERMINATE' when you have gathered all the information.\n","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"keyword","keywords":["TERMINATE"],"criterion":"ending","methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-Vu7wVaMZdiiphPWqjZKBy"],"skills":[],"parentId":null,"nestedChats":[]}},{"id":"wa-1o9wXz2yEKvf0K-dBv_xs","type":"agent","agentType":"assistant","name":"topic_preference_agent","description":"On-boarding Topic Preference Agent","tags":[],"requirements":[],"createdAt":"2024-10-28T17:48:28.045Z","updatedAt":"2024-10-28T18:02:44.341Z","data":{"systemMessage":"You are a helpful customer topic preference agent, you are here to help new customers get started with our product. Your job is to gather customer's topic of interest. Do not ask for other information. Return 'TERMINATE' when you have gathered all the information.\n","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"keyword","keywords":["TERMINATE"],"criterion":"ending","methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-Vu7wVaMZdiiphPWqjZKBy"],"skills":[],"parentId":null,"nestedChats":[]}},{"id":"wa-VBomQg7ktU08PEpRhbqpZ","type":"agent","agentType":"assistant","name":"customer_engagement_agent","description":"On-boarding Customer Engagement Agent","tags":[],"requirements":[],"createdAt":"2024-10-28T17:58:18.219Z","updatedAt":"2024-10-28T17:59:50.040Z","data":{"systemMessage":"You are a helpful customer service agent here to provide fun for the customer based on the user's personal information and topic preferences. This could include fun facts, jokes, or interesting stories. Make sure to make it engaging and fun! Return 'TERMINATE' when you are done.","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"keyword","keywords":["TERMINATE"],"criterion":"ending","methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-lg_EkFoogeOmHCtbz1kzt"],"skills":[],"parentId":null,"nestedChats":[]}}],"managers":[],"rag_users":[]},"models":[{"id":"wm-lg_EkFoogeOmHCtbz1kzt","type":"model","name":"gpt-3.5-turbo","description":"OpenAI GPT-3.5","tags":[],"requirements":[],"createdAt":"2024-10-28T07:23:33.793Z","updatedAt":"2024-10-28T18:09:02.969Z","data":{"apiKey":"REPLACE_ME","apiType":"openai","baseUrl":null,"temperature":0.5,"topP":null,"maxTokens":null,"defaultHeaders":{},"price":{"promptPricePer1k":null,"completionTokenPricePer1k":null}}},{"id":"wm-Vu7wVaMZdiiphPWqjZKBy","type":"model","name":"claude-3-5-sonnet-20240620","description":"Claude 3-5-sonnet-20240620","tags":[],"requirements":[],"createdAt":"2024-09-26T16:50:41.290Z","updatedAt":"2024-10-28T18:09:07.877Z","data":{"apiKey":"REPLACE_ME","apiType":"anthropic","baseUrl":null,"temperature":0.5,"topP":null,"maxTokens":null,"defaultHeaders":{},"price":{"promptPricePer1k":null,"completionTokenPricePer1k":null}}}],"skills":[],"chats":[{"id":"we-dZSBom-8MDL7aDUHmE1NY","data":{"source":"wa-7jZd6Xl63-ERlwgCrB0z_","target":"wa-G3QDaq8eNguzALeN7MjFL","name":"personal_inform => Customer Proxy","order":1,"description":"The personal information agent asks for the user details, like name and location.","position":1,"clearHistory":true,"maxTurns":1,"message":{"type":"string","use_carryover":false,"content":"Hello, I'm here to help you get started with our product. Could you tell me your name and location?","context":{}},"nestedChat":{"message":null,"reply":null},"summary":{"method":"reflection_with_llm","prompt":"Return the customer information into as JSON object only: {'name': '', 'location': ''}","args":{"summary_role":"user"}}}},{"id":"we-6srMl_vK6XO2RkYNCgBdP","data":{"source":"wa-1o9wXz2yEKvf0K-dBv_xs","target":"wa-G3QDaq8eNguzALeN7MjFL","name":"topic_preferenc => Customer Proxy","order":2,"description":"The topic preference agent asks the user about their topics of interest.","position":2,"clearHistory":true,"maxTurns":1,"message":{"type":"string","use_carryover":false,"content":"Great! Could you tell me what topics you are interested in reading about?","context":{}},"nestedChat":{"message":null,"reply":null},"summary":{"method":"reflection_with_llm","prompt":"Return the customer information into as JSON object only: {'topic_of_interest': ''}","args":{"summary_role":"user"}}}},{"id":"we-yzQjCkp9F_BtX-UPT7EUZ","data":{"source":"wa-G3QDaq8eNguzALeN7MjFL","target":"wa-VBomQg7ktU08PEpRhbqpZ","name":"Customer Proxy => customer_engage","order":3,"description":"The customer proxy agent passes the gathered information to the customer engagement agent.","position":3,"clearHistory":true,"maxTurns":1,"message":{"type":"string","use_carryover":false,"content":"Let's find something fun to read.","context":{}},"nestedChat":{"message":null,"reply":null},"summary":{"method":"reflection_with_llm","prompt":"","args":{"summary_role":"user"}}}}]}}
Loading

0 comments on commit 51d68e9

Please sign in to comment.