Skip to content

Commit

Permalink
refactor: Simplify the codebase with functional Overleaf implementati…
Browse files Browse the repository at this point in the history
…on (#2)

Simplify and refactor the entire codebase to the new architecture.
---------

Co-authored-by: YiyanZhai <zhaiyiyan17@gmail.com>
  • Loading branch information
YiyanZhai authored and Neet-Nestor committed Sep 1, 2024
1 parent 18caed0 commit 0a8a210
Show file tree
Hide file tree
Showing 39 changed files with 272 additions and 10,908 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: "16"

- name: Install dependencies
run: npm install

- name: Run linter check
run: npm run lint

56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
# web-agent-interface
# Web-Agent-Interface Library

## Overview

The `web-agent-interface` library provides an API to interact with text selections, modifications, and other functionalities across different web platforms like Overleaf, Google Docs, and Google Calendar. This library makes it easier to customize your tools.

## Supported Platforms

- **Overleaf**: Manipulate text selections and content within Overleaf documents.
<!-- - **Google Docs (GDoc)**: Interact with text selections and modifications in Google Docs.
- **Google Calendar (GCal)**: Integrate and manage events on Google Calendar. -->

## Installation

To install and build the library, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/mlc-ai/web-agent-interface.git
cd web-agent-interface
```

2. Install dependencies and build the project:

```bash
npm install
npm run build
```

## Usage

### 1. Initialize the page handler in content script

```javascript
import { initHandler } from '@mlc-ai/web-agent-interface';
const handler = initHandler();
```
### 2. Get Available Tools
```javascript
import { getTools } from '@mlc-ai/web-agent-interface';
const availableTools = getTools();
```
### 3. Handling Tool Use
```javascript
const observation = handler.handleToolCall(toolName, parameters);
console.log("Got observation:", observation);
```
29 changes: 0 additions & 29 deletions eslint.config.js

This file was deleted.

25 changes: 25 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import eslint from "eslint";

const { ESLint } = eslint;

export default new ESLint({
baseConfig: {
env: {
browser: true,
es2021: true,
node: true,
},
extends: ["eslint:recommended"],
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
},
rules: {
"no-unused-vars": "warn",
"no-console": "off",
indent: ["error", 2],
quotes: ["error", "single"],
semi: ["error", "always"],
},
},
});
Loading

0 comments on commit 0a8a210

Please sign in to comment.