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

[WIP] PearAI Inventory Feature #54

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6f6cee2
PearAI Overlay Foundation within pear-app
Fryingpannn Oct 11, 2024
847a682
Add PearAI Icon and visibility toggle layout
Fryingpannn Oct 11, 2024
46fc74b
PearAI Inventory Extension Folder Init
Fryingpannn Oct 11, 2024
44cecd3
Added webview Vite Reactjs to inventory
Fryingpannn Oct 12, 2024
6ffbd33
Working vite Reactjs, use browser to dev for hot reload
Fryingpannn Oct 12, 2024
1eb0031
Reactjs now injected within pearai-app's overlay modal
Fryingpannn Oct 13, 2024
7656430
Working pop up 80% size with React, but janky and has to translate ov…
Fryingpannn Oct 13, 2024
8e2e71b
Working overlay with React inside :D Though when opening or reload wi…
Fryingpannn Oct 13, 2024
6d43335
Make overlay background vscode theme and fill up fully + Basic invent…
Fryingpannn Oct 13, 2024
9210a3e
Added shadcn/ui components and refactored UI look
Fryingpannn Oct 13, 2024
658cb39
smoother anim
Himanshu-Singh-Chauhan Oct 14, 2024
c0d6976
Updated Inventory UI with preview description and quick action slots
Fryingpannn Oct 14, 2024
73b9cbb
Updated Inventory UI with preview description and quick action slots
Fryingpannn Oct 14, 2024
fb9411d
Adapt PearAI Inventory UI to use VS Code theme colors
Fryingpannn Oct 15, 2024
c43d86f
Activate extension on PearAI startup
Fryingpannn Oct 15, 2024
fe8101f
Add PearAI themes for overlay browser fallback values
Fryingpannn Oct 15, 2024
58939ae
Add tabs
Fryingpannn Oct 15, 2024
63782ca
Added tabs + formatting
Fryingpannn Oct 15, 2024
46c656c
Fixed tabs sizing
Fryingpannn Oct 15, 2024
fcbb9d2
Add default background color for modal
Fryingpannn Oct 16, 2024
91db480
Testing merged inventory within submodule
Fryingpannn Oct 17, 2024
936c774
Working chat once open and close overlay through extension commands
Fryingpannn Oct 20, 2024
05f8513
Simultaneous chats enabled from submodule, no longer need hacky open/…
Fryingpannn Oct 21, 2024
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 build/gulpfile.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const compilations = [
'extensions/vscode-api-tests/tsconfig.json',
'extensions/vscode-colorize-tests/tsconfig.json',
'extensions/vscode-test-resolver/tsconfig.json',
'extensions/pearai-inventory/tsconfig.json',

'.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json',
];
Expand Down
1 change: 1 addition & 0 deletions build/npm/dirs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const dirs = [
'test/monaco',
'test/smoke',
'.vscode/extensions/vscode-selfhost-test-provider',
'extensions/pearai-inventory/tsconfig.json'
];

if (fs.existsSync(`${__dirname}/../../.build/distro/npm`)) {
Expand Down
5 changes: 5 additions & 0 deletions extensions/pearai-inventory/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
5 changes: 5 additions & 0 deletions extensions/pearai-inventory/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "connor4312.esbuild-problem-matchers", "ms-vscode.extension-test-runner"]
}
21 changes: 21 additions & 0 deletions extensions/pearai-inventory/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
13 changes: 13 additions & 0 deletions extensions/pearai-inventory/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
75 changes: 75 additions & 0 deletions extensions/pearai-inventory/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
},
{
"type": "npm",
"script": "build:webview",
"group": "build",
"problemMatcher": [],
"label": "npm: build:webview",
"detail": "Build webview",
"runOptions": {
"runOn": "folderOpen"
}
},
]
}
14 changes: 14 additions & 0 deletions extensions/pearai-inventory/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
esbuild.js
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
1 change: 1 addition & 0 deletions extensions/pearai-inventory/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
9 changes: 9 additions & 0 deletions extensions/pearai-inventory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to the "pearai-inventory" extension will be documented in this file.

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

## [Unreleased]

- Initial release
71 changes: 71 additions & 0 deletions extensions/pearai-inventory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# pearai-inventory README

This is the README for your extension "pearai-inventory". After writing up a brief description, we recommend including the following sections.

## Features

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.

For example if there is an image subfolder under your extension project workspace:

\!\[feature X\]\(images/feature-x.png\)

> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.

## Requirements

If you have any requirements or dependencies, add a section describing those and how to install and configure them.

## Extension Settings

Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.

For example:

This extension contributes the following settings:

* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.

## For more information

* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)

**Enjoy!**
56 changes: 56 additions & 0 deletions extensions/pearai-inventory/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const esbuild = require("esbuild");

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',

setup(build) {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
});
console.log('[watch] build finished');
});
},
};

async function main() {
const ctx = await esbuild.context({
entryPoints: [
'src/extension.ts'
],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'dist/extension.js',
external: ['vscode'],
logLevel: 'silent',
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

main().catch(e => {
console.error(e);
process.exit(1);
});
28 changes: 28 additions & 0 deletions extensions/pearai-inventory/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},

rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],

curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
}];
60 changes: 60 additions & 0 deletions extensions/pearai-inventory/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "pearai-inventory",
"displayName": "pearai-inventory",
"description": "Inventory of AI tools for PearAI",
"version": "0.0.1",
"engines": {
"vscode": "^1.94.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onUri",
"onStartupFinished"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "pearai-inventory.helloWorld",
"title": "Hello World PearAI Inventory"
}
]
},
"scripts": {
"install:all": "yarn install && cd webview-ui && yarn install",
"start:webview": "cd webview-ui && yarn run start",
"build:webview": "cd webview-ui && yarn run build",
"vscode:prepublish": "yarn run package",
"compile": "yarn run check-types && yarn run lint && node esbuild.js",
"watch": "tsc -watch -p ./",
"watch:esbuild": "node esbuild.js --watch",
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
"package": "yarn run check-types && yarn run lint && node esbuild.js --production",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "yarn run compile-tests && yarn run compile && yarn run lint",
"check-types": "tsc --noEmit",
"lint": "eslint src",
"test": "vscode-test"
},
"devDependencies": {
"@types/mocha": "^10.0.8",
"@types/node": "20.x",
"@types/vscode": "^1.94.0",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@typescript-eslint/parser": "^8.7.0",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1",
"esbuild": "^0.24.0",
"eslint": "^9.11.1",
"npm-run-all": "^4.1.5",
"typescript": "^5.6.2"
},
"dependencies": {
"@vscode/webview-ui-toolkit": "^1.4.0",
"nanoid": "^5.0.7",
"react-icons": "^5.3.0"
}
}
Loading
Loading