open-index/open-npm huggingface dataset:
npm package: @shuta/commons-chunk-config
Description: ## 关于
Author: shuta
Latest version: 1.0.1

# @shuta/commons-chunk-config

## 关于

官方 `@zeit/next-css/commons-chunk-config` 的替代品。

官方代码有plugins数组兼容bug。

## 使用

下面是在 `next` 项目中同时使用 `less` 和 `css` 的配置示例。
```
// next.config.js
const withLess = require('@zeit/next-less');
const withCss = require('@zeit/next-css');
const commonsChunkConfig = require('@shuta/commons-chunk-config');

module.exports = withLess(withCss({
  webpack: (config) => {
    // do something here
    return commonsChunkConfig(config, /\.(less|css)$/);
  }
}));
```
npm package: @shutsuwei/wagmi-connectors
Description: A collection of connectors for wagmi
Latest version: 0.3.16-shu1

# `@wagmi/connectors`

Collection of connectors for wagmi.

## Installation

Install the `@wagmi/connectors` package.

```
npm i @wagmi/connectors
```

## Usage

Configure your wagmi client with connectors!

```tsx
import { configureChains, createClient } from 'wagmi'

import { InjectedConnector } from '@wagmi/connectors/injected'

const { chains, provider } = configureChains(...)

const client = createClient({
  connectors: [
    new InjectedConnector({ chains }),
  ],
  provider,
})
```

> If your bundler supports tree-shaking (most likely), only the used connectors will be included in the bundle, so you don't have to worry about bundle size. 😊

## Connectors

- [`CoinbaseWalletConnector`](/packages/connectors/src/coinbaseWallet.ts)
- [`InjectedConnector`](/packages/connectors/src/injected.ts)
- [`LedgerConnector`](/packages/connectors/src/ledger.ts)
- [`MetaMaskConnector`](/packages/connectors/src/metaMask.ts)
- [`MockConnector`](/packages/connectors/src/mock.ts)
- [`SafeConnector`](/packages/connectors/src/safe.ts)
- [`WalletConnectConnector`](/packages/connectors/src/walletConnect.ts)

## Contributing

Want to add another chain to the list? Make sure you read the [contributing guide](../../.github/CONTRIBUTING.md) first.
npm package: @shutter-network/shutter-crypto
Description: Core crypto primitives to interact with Shutter Network
Author: Shutter Network
Latest version: 2.0.0

# shutter-crypto

This is a NPM package which provides the core crypto primitives necessary to
interact with the Shutter Network.

## Installation

```
npm install @shutter-network/shutter-crypto
```

## Usage

The module provides the following public functions:

### `async shutterCrypto.init(wasmUrlOrPath)`

Load and initialize the Go wasm library. This Promise needs to be consumed
before any other function in the library is called.

On Node the `wasmUrlOrPath` parameter is optional. If not given it will be
determined automatically.

In a Web context the path to the `shutter-crypto.wasm` file needs to be given
(since it appears no standard cross framework way of automatically determining a
path is available).

### `async shutterCrypto.encrypt(message, eonPublicKey, epochId, sigma)`

...

### `async shutterCrypto.decrypt(encryptedMessage, decryptionKey)`

...

### `async shutterCrypto.verifyDecryptionKey(decryptionKey, eonPublicKey, epochId)`

...

## Releases

### `1.0.1` - 2023-08-02

Only contains a fix in the README.

### `1.0.0` - 2023-08-02

Stable release.

Changes:

- Fix node v18 incompatibility
- Add README

### `0.1.0-beta.3` - 2022-07-18

First usable version

This includes significant size reduction of the generated wasm file.
npm package: @shutter/api
Description: [Shutter.sh](https://shutter.sh/) API client package.
Author: Andy Wermke
Latest version: 0.5.0

# @shutter/api [![NPM Version](https://img.shields.io/npm/v/@shutter/api.svg)](https://www.npmjs.com/package/@shutter/api)

[Shutter.sh](https://shutter.sh/) API client package.

## API

```ts
import { createSnapshot, retrieveFile, loadFileFromDisk } from '@shutter/api'
```

### `createSnapshot(authToken: string, page: File, pageAssets: File[], options: SnapshotCreationOptions = {}): Promise<Snapshot>`

Sends an HTML document and additional assets to the shutter.sh service for rendering. Returns a promise that resolves upon finished upload. The snapshot will not have been rendered yet (see `retrieveProcessedSnapshot`).

```ts
interface SnapshotCreationOptions {
  expectation?: File | null,
  diffOptions?: DiffOptions,
  labels?: Labels,
  renderOptions?: RenderOptions
}

interface DiffOptions {
  autoCrop?: boolean,
  relativeThreshold?: number
}

interface RenderOptions {
  autoCrop?: boolean,
  omitBackground?: boolean
}

type Snapshot = any   // Not yet typed
```

### `retrieveFile(fileHash: string): Promise<Buffer>`

Takes a file hash as included in the `Snapshot` body and returns a promise that resolves to a `Buffer` containing the file contents.

### `retrieveProcessedSnapshot(snapshotID: string): Promise<Snapshot>`

Takes a snapshot ID and returns a promise resolving to the rendered snapshot once the rendering has completed.

### `createFileFromBuffer(content: Buffer, fileName: string, options: FromBufferOptions = {}): File`

Takes a `Buffer` and wraps it to become a `File`.

```ts
interface FromBufferOptions {
  contentType?: string
}
```

### `loadFileFromDisk(filePath: string, options: FromFSOptions = {}): Promise<File>`

Loads a file from the file system.

```ts
interface FromFSOptions {
  contentType?: string,
  fileName?: string
}
```

### `File`

```ts
interface File {
  readonly contentType: string | null
  readonly fileName: string
  getContent: () => Promise<Buffer>
}
```
npm package: @shutter/builddata
Description: Collects general build data from the project, like the git repository, current branch, current commit, package name, ...
Author: Andy Wermke
Latest version: 0.5.0

# @shutter/builddata

Collects general build data from the project, like the git repository, current branch, current commit, package name, ...

This data will be used to group the uploaded snapshots and link to the code / pull request from the inspection dashboard.

## Supported CI Services

- Circle CI
- GitLab CI
- Jenkins CI
- Travis CI

Can also infer data from git repository and `package.json` file.
npm package: @shutter/metacache
Description: Managing persistent cache data on disk, like the snapshot sets cache.
Author: Andy Wermke
Latest version: 0.4.0

# @shutter/metacache [![NPM Version](https://img.shields.io/npm/v/@shutter/metacache.svg)](https://www.npmjs.com/package/@shutter/metacache)

Managing persistent cache data on disk, like the snapshot sets cache.

## API

### `getSnapshotSetsCachePath(): string`

### `openJSONCache<Value = any>(directoryPath: string): Promise<JSONCache>`

### `JSONCache<Value>`

```ts
interface JSONCache<Value> {
  save (key: string, content: Value): Promise<any>
  read (key: string): Promise<Value>
  has (key: string): Promise<boolean>
}
```
npm package: @shutter/shutterrc
Description: Locate and parse the shutter configuration file, `.shutterrc`. Will start looking for `.shutterrc` in the currently working directory, then traverse its parents and finally try the user's home directory.
Author: Andy Wermke
Latest version: 0.4.0

# @shutter/shutterrc [![NPM Version](https://img.shields.io/npm/v/@shutter/shutterrc.svg)](https://www.npmjs.com/package/@shutter/shutterrc)

Locate and parse the shutter configuration file, `.shutterrc`. Will start looking for `.shutterrc` in the currently working directory, then traverse its parents and finally try the user's home directory.

## API

```ts
import { loadShutterConfig } from '@shutter/shutterrc'
```

### `loadShutterConfig(directoryPath: string = process.cwd()): Promise<ShutterConfig>`

Locate the `.shutterrc` file, read and parse it. Start looking in `directoryPath`.

### `updateShutterConfig(configFilePath: string, updatedConfig: ShutterConfig): Promise<void>`

Write an updated shutter configuration to a `.shutterrc` file. The targetted `.shutterrc` may already exist. If not, it will be created.

Pass the whole configuration, not just the entries to update.

### `getUserConfigPath(): string`

Returns the path to the user-specific `.shutterrc` file.

## Sample .shutterrc

```
authtoken=eyJhbGciO...
```
npm package: @shutterly/plugin-s-to
Description: To install dependencies:
Author: PlayingWithClouds
Latest version: 0.0.1

# s-to

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.2.20. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
npm package: @shuttle-ai/type
Description: Shuttle AI 类型定义
Author: Mingbing-get
Latest version: 0.0.17

# `@shuttle-ai/type`

`@shuttle-ai/type` 为 Shuttle AI 框架提供完整的 TypeScript 类型定义，涵盖工具定义、消息结构、代理通信等核心概念(nodejs环境和浏览器均可运行)。

## 安装

```bash
npm install @shuttle-ai/type
# 或
yarn add @shuttle-ai/type
# 或
pnpm add @shuttle-ai/type
```

## 命名空间

### `ShuttleAi.Tool`

工具相关类型定义：

- **Scope**: 工具作用域 (`autoRun` | `read` | `write`)
- **Extras**: 工具额外配置
- **Result**: 工具执行结果
- **ConfirmResult**: 工具调用确认结果
- **Call**: 工具调用信息
- **Define**: 工具定义结构

### `ShuttleAi.SubAgent`

子代理类型定义：

- **Define**: 子代理定义结构

### `ShuttleAi.Message`

消息类型定义：

- **User**: 用户消息
- **AI**: AI 响应消息
- **AIChunk**: AI 流式输出片段
- **AITool**: AI 工具调用请求
- **Tool**: 工具执行结果消息

### `ShuttleAi.Ask`

框架向外部请求的类型：

- **Ping**: 心跳检测
- **Chunk**: 流式输出片段
- **AgentStart**: 代理开始
- **AgentEnd**: 代理结束
- **ToolStart**: 工具开始执行
- **ToolEnd**: 工具执行结束
- **StartWork**: 工作开始
- **EndWork**: 工作结束

### `ShuttleAi.Report`

框架向上报的类型：

- **ConfirmTool**: 工具调用确认
- **AgentStart**: 代理启动上报

## 使用示例

```typescript
import { ShuttleAi } from '@shuttle-ai/type'

// 定义一个工具
const toolDefine: ShuttleAi.Tool.Define = {
  name: 'search',
  description: '搜索内容',
  schema: {
    type: 'object',
    properties: {
      query: { type: 'string' },
    },
    required: ['query'],
  },
  extras: {
    scope: 'autoRun',
  },
}

// 创建消息
const aiMessage: ShuttleAi.Message.AI = {
  role: 'assistant',
  id: 'msg_001',
  agentId: 'agent_001',
  workId: 'work_001',
  content: '我将帮你搜索相关内容',
  toolCalls: [
    {
      id: 'call_001',
      name: 'search',
      args: { query: 'TypeScript 类型' },
    },
  ],
}
```

## 依赖

- `zod`: 用于 schema 验证的类型定义
npm package: @shuttle-data/ai-react
Description: web端ai相关的react渲染库
Author: Mingbing-get
Latest version: 0.0.2

# `@shuttle-data/ai-react`

Web 端 AI 相关的 React 渲染库，提供了丰富的数据操作和管理工具。(运行在浏览器环境)

## 功能特性

- **CRUD 操作**：支持批量创建、条件更新、计数、创建、删除、查询、分组查询和更新记录
- **枚举操作**：支持创建、删除、获取详情和列表、更新枚举
- **模式操作**：支持创建、删除、获取详情和列表、更新表结构
- **React 渲染**：提供了直观的 React 组件用于数据操作和展示

## 安装

```bash
# 使用 npm
npm install @shuttle-data/ai-react

# 使用 yarn
yarn add @shuttle-data/ai-react

# 使用 pnpm
pnpm add @shuttle-data/ai-react
```

## 基本使用

### 导入所有工具

```typescript
import { allTool } from '@shuttle-data/ai-react'

// 获取所有工具
const tools = allTool()

// 或者自定义工具配置
const customTools = allTool({
  // 自定义工具配置
  findRecordsTool: {
    run: {
      defaultProps: {
        // 默认属性
      },
    },
  },
})
```

## 模块详情

### CRUD 模块

包含以下工具：

- `batchCreateRecordsTool`：批量创建记录
- `conditionUpdateRecordsTool`：条件更新记录
- `countTool`：计数记录
- `createRecordTool`：创建记录
- `deleteRecordTool`：删除记录
- `findRecordsTool`：查询记录
- `queryGroupByTool`：分组查询记录
- `updateRecordsTool`：更新记录

### 模式模块

包含以下工具：

- `createTableTool`：创建表
- `dropTableTool`：删除表
- `getTableDetailTool`：获取表详情
- `getTableListTool`：获取表列表
- `updateTableTool`：更新表

### 枚举模块

包含以下工具：

- `createEnumTool`：创建枚举
- `dropEnumTool`：删除枚举
- `getEnumDetailTool`：获取枚举详情
- `getEnumListTool`：获取枚举列表
- `updateEnumTool`：更新枚举

## 依赖

- @shuttle-data/client
- @shuttle-data/type
- @shuttle-data/render-react
- @shuttle-ai/type
- @shuttle-ai/client
- @shuttle-ai/render-react

## 许可证

MIT
npm package: @shuttle-data/ai-server
Description: 数据模型相关的AI提示词和工具定义
Author: Mingbing-get
Latest version: 0.0.2

# `@shuttle-data/ai-server`

数据模型相关的AI提示词和工具定义，为AI代理提供数据操作能力。（运行在Node.js环境）

## 📦 安装

```bash
# 使用 npm
npm install @shuttle-data/ai-server

# 使用 yarn
yarn add @shuttle-data/ai-server

# 使用 pnpm
pnpm add @shuttle-data/ai-server
```

## 🚀 功能特性

- **CRUD 操作工具**：提供完整的数据增删改查能力
- **枚举管理工具**：支持枚举组的创建、查询、更新和删除
- **Schema 管理工具**：支持数据表的创建、查询、更新和删除
- **系统提示词**：为AI代理提供专业的系统提示
- **类型定义**：提供完整的TypeScript类型支持

## 🛠️ 工具列表

### CRUD 工具

| 工具名称                     | 功能描述     |
| ---------------------------- | ------------ |
| `batchCreateRecordsTool`     | 批量创建记录 |
| `conditionUpdateRecordsTool` | 条件更新记录 |
| `countTool`                  | 统计记录数量 |
| `createRecordTool`           | 创建单条记录 |
| `deleteRecordsTool`          | 删除记录     |
| `findRecordsTool`            | 查询记录     |
| `getConditionDefineTool`     | 获取条件定义 |
| `queryGroupByTool`           | 分组查询     |
| `updateRecordsTool`          | 更新记录     |

### 枚举工具

| 工具名称             | 功能描述       |
| -------------------- | -------------- |
| `addGroupTool`       | 添加枚举组     |
| `getGroupDetailTool` | 获取枚举组详情 |
| `getGroupListTool`   | 获取枚举组列表 |
| `removeGroupTool`    | 删除枚举组     |
| `updateGroupTool`    | 更新枚举组     |

### Schema 工具

| 工具名称             | 功能描述       |
| -------------------- | -------------- |
| `createTableTool`    | 创建数据表     |
| `dropTableTool`      | 删除数据表     |
| `getTableDetailTool` | 获取数据表详情 |
| `getTableListTool`   | 获取数据表列表 |
| `updateTableTool`    | 更新数据表     |

## 📖 使用示例

### 导入工具

```typescript
import {
  // CRUD 工具
  batchCreateRecordsTool,
  conditionUpdateRecordsTool,
  countTool,
  createRecordTool,
  deleteRecordsTool,
  findRecordsTool,
  getConditionDefineTool,
  queryGroupByTool,
  updateRecordsTool,
  // 枚举工具
  addGroupTool,
  getGroupDetailTool,
  getGroupListTool,
  removeGroupTool,
  updateGroupTool,
  // Schema 工具
  createTableTool,
  dropTableTool,
  getTableDetailTool,
  getTableListTool,
  updateTableTool,
  // 系统提示词
  shuttleDataAgentSystemPrompt,
} from '@shuttle-data/ai-server'
```

### 使用系统提示词

```typescript
import { shuttleDataAgentSystemPrompt } from '@shuttle-data/ai-server'

// 将系统提示词用于AI代理
const agent = createAgent({
  systemPrompt: shuttleDataAgentSystemPrompt,
  // 其他配置...
})
```

## 📚 依赖

- `@shuttle-data/type` - 类型定义
- `@shuttle-data/schema` - 数据模型定义
- `@shuttle-data/crud` - CRUD操作
- `zod` - 数据验证
- `@shuttle-ai/type` - AI类型定义
- `@shuttle-ai/agent` - AI代理实现

## 📄 许可证

MIT
npm package: @shuttle-data/render-react
Description: web端数据模型react渲染库
Author: Mingbing-get
Latest version: 0.0.2

# `@shuttle-data/render-react`

Web端数据模型React渲染库，提供丰富的UI组件和数据处理功能，用于快速构建数据驱动的React应用。(运行于浏览器环境)

## 安装

```bash
# 使用npm
npm install @shuttle-data/render-react

# 使用yarn
yarn add @shuttle-data/render-react

# 使用pnpm
pnpm add @shuttle-data/render-react
```

## 核心功能

### 1. 数据表格

- 支持排序、筛选、分页
- 可定制列配置
- 支持拖拽排序
- 集成条件查询

### 2. 表单组件

- 支持多种字段类型
- 自动表单验证
- 动态表单配置

### 3. 条件查询

- 支持复杂逻辑条件组合
- 拖拽调整条件顺序
- 可视化条件配置

### 4. 字段插件系统

- 内置多种字段类型插件
- 支持自定义字段插件
- 统一的字段渲染接口

### 5. 数据枚举管理

- 枚举分组管理
- 枚举项选择器
- 枚举编辑器

## 使用示例

### 基本表格

```tsx
import React from 'react'
import { DataModel } from '@shuttle-data/client'
import { DataTable } from '@shuttle-data/render-react'

const dataMoel = new DataModel()

const App = () => {
  return <DataTable dataModel={dataModel} />
}

export default App
```

### 条件查询

```tsx
import React from 'react';
import { DataModel } from '@shuttle-data/client'
import { DataCondition } from '@shuttle-data/render-react';

const dataMoel = new DataModel()

const App = () => {
  const [conditions, setConditions] = React.useState([]);

  return (
    <DataCondition
      conditions={conditions}
      dataModel={dataModel}
      fields={[...]} // 可用字段列表
    />
  );
};

export default App;
```

### 表单

```tsx
import React from 'react'
import { DataModel } from '@shuttle-data/client'
import { DataForm } from '@shuttle-data/render-react'

const dataMoel = new DataModel()

const App = () => {
  const [formData, setFormData] = React.useState({})

  return (
    <DataForm
      dataModel={dataModel}
      tableName={当前编辑的数据模型名称}
      value={editRecord || editId}
    />
  )
}

export default App
```

## 依赖

- @shuttle-data/type
- @shuttle-data/client

## 许可证

MIT License
npm package: @shuttle-data/schema
Description: 数据模型表结构等相关操作
Author: Mingbing-get
Latest version: 0.0.2

# `@shuttle-data/schema`

数据模型表结构管理与字段类型插件系统（运行于 Node.js 环境）。

## 功能特性

- **数据模型 Schema 管理**：创建和管理数据模型表结构，自动添加系统字段（`_id`, `_createdAt`, `_updatedAt`, `_createdBy`, `_updatedBy`）
- **字段类型插件系统**：支持多种字段类型，包括 string、text、number、double、boolean、date、datetime、enum、lookup、json
- **枚举管理**：完整的数据枚举管理功能，支持枚举组和枚举项的 CRUD 操作

## 安装

```bash
npm install @shuttle-data/schema
```

## 快速开始

```typescript
import { DataModelSchema } from '@shuttle-data/schema'

const schema = new DataModelSchema({
  knex: knexInstance,
  userDbName: '_user',
  modelTableConfig: {
    tableName: '_data_model',
    fieldConfig: {
      tableName: '_data_model_field',
    },
  },
})

// 创建数据模型
await schema.createTable({
  name: 'user',
  apiName: 'user',
  label: '用户',
  displayField: 'name',
  fields: [
    {
      name: '_id',
      apiName: 'id',
      label: 'ID',
      type: 'number',
      required: true,
      isSystem: true,
    },
    {
      name: 'name',
      apiName: 'name',
      label: '名称',
      type: 'string',
      required: true,
    },
    { name: 'email', apiName: 'email', label: '邮箱', type: 'string' },
    { name: 'age', apiName: 'age', label: '年龄', type: 'number' },
  ],
})
```

## 字段类型

| 类型       | 说明         |
| ---------- | ------------ |
| `string`   | 字符串字段   |
| `text`     | 长文本字段   |
| `number`   | 数字字段     |
| `double`   | 浮点数字段   |
| `boolean`  | 布尔字段     |
| `date`     | 日期字段     |
| `datetime` | 日期时间字段 |
| `enum`     | 枚举字段     |
| `lookup`   | 关联字段     |
| `json`     | JSON 字段    |

## API

### Schema

- `createTable(model: DataModel.Define)` - 创建数据模型表
- `updateTable(model: DataModel.Define)` - 更新数据模型表结构
- `deleteTable(name: string)` - 删除数据模型表
- `getTable(name: string)` - 获取数据模型定义
- `all()` - 获取所有数据模型

### DataEnumManager

- `addGroup(group: DataEnum.Group)` - 添加枚举组
- `updateGroup(group: DataEnum.Group)` - 更新枚举组
- `deleteGroup(name: string)` - 删除枚举组
- `getGroup(name: string)` - 获取枚举组
- `all()` - 获取所有枚举组

### 字段插件管理器

```typescript
import { schemaFieldPluginManager } from '@shuttle-data/schema'

// 注册自定义字段插件
schemaFieldPluginManager.use(customPlugin)
```

## 依赖

- `@shuttle-data/type` - 类型定义和基础的插件包
npm package: @shuttle-dev/copilot
Description: Command-line process manager w/o misfires.
Author: Michael Freund
Latest version: 0.4.0

![shuttle-copilot-banner](asset/shuttle-copilot-github-banner.png)

# @shuttle-dev/copilot

@shuttle-dev/copilot is a command-line process manager by shuttle™ that allows you to manage and launch your development environments from the command-line without hassle.

![shuttle-copilot-demo](asset/shuttle-copilot-github-demo.gif)

## What is shuttle

shuttle is a developer-focused project management software that connects everyone in strategy & planning
so teams can deliver better results, faster ✊ shuttle is currently under development and will be available around summer 2022.

---

# Documentation

+ [Installation](#installation)
+ [Usage](#usage)
  + [Commands](#commands)
    + [Menu](#menu)
    + [Create](#create)
    + [Start](#start)
    + [List](#list)
    + [Config](#config)
    + [Help](#help)
---

## Installation

````shell
npm install -g @shuttle-dev/copilot
````

## Usage

Once installed, you can invoke CLI commands directly from the command-line of your operating system using the shuttle executable. To list available shuttle commands, type the following:

````shell
> ~ dev/ shuttle --help
````

You can get help on a single command by using the following construct. Substitute any command, such as `menu`, `launch`, `...` where `env` appears in the example below to get detailed help on that command:

````shell
> ~ dev/ shuttle env --help
````

## Commands

TBD
npm package: @shuttle-formula/core
Description: 公式编辑器解析器
Author: Mingbing-get
Latest version: 1.1.0

## `@shuttle-formula/core`

#### 说明

该部分是shuttle-formula的核心包，提供词法分析、语法分析、语法检查、计算表达式等功能

#### 安装

```bash
npm install @shuttle-formula/core
```

#### 词法分析

```ts
import { LexicalAnalysis, useAllTokenParse } from '@shuttle-formula/core'

// 初始化一个词法分析器
const lexicalAnalysis = new LexicalAnalysis()
// 使用内置的词法解析工具
useAllTokenParse(lexicalAnalysis)

// 使用此法分析器分析一段表达式
lexicalAnalysis.setCode('$a.b.c + @sum(10, $a.d) >= 10.8')
const tokens = await lexicalAnalysis.execute()
// 得到分析后的tokens
console.log(tokens)

// 使用更新代码，减少计算时间，如下更新后代码为：$a.test.c + @sum(10, $a.d) >= 10.8
const updateTokens = await lexicalAnalysis.spliceCode(3, 1, 'test')
// 得到更新后的tokens
console.log(updateTokens)
```

#### 语法分析

```ts
import { SyntaxAnalysis } from '@shuttle-formula/core'

// 初始化一个语法分析器
const syntaxAnalysis = new SyntaxAnalysis()

// 将词法分析的结果作为输入，进行语法分析
syntaxAnalysis.setTokenDesc(tokens)
const { syntaxRootIds, syntaxMap } = await syntaxAnalysis.execute()

console.log(syntaxRootIds) // 语法分析后得到的根结点的id列表（可能有多个）
console.log(syntaxMap) // 所有语法结果映射表
```

#### 语法检查

```ts
import { SyntaxCheck, useAllChecker } from '@shuttle-formula/core'

// 初始化一个语法检查器
const syntaxCheck = new SyntaxCheck()
// 使用内置的语法检查规则
useAllChecker(syntaxCheck)

// 设置语法检查时通过变量路径获取变量定义的函数
type GetVariableDefine = (
  path: string[],
) => WithPromise<WithUndefined<VariableDefine.Desc>>

syntaxCheck.setGetVariableFu(fn: GetVariableDefine)
// 设置语法检查时通过函数名称获取函数定义的函数
type GetFunctionDefine = (
  name: string,
) => WithPromise<WithUndefined<FunctionDefine.Desc>>

syntaxCheck.setGetFunctionFu(fn: GetFunctionDefine)

const checkRes = await syntaxCheck.check(syntaxRootIds, syntaxMap)
// 若检查结果有语法错误则返回一个错误对象
// 若检查结果没有语法错误，则返回所有语法块对应的返回值类型
console.log(checkRes)
```

#### 计算表达式

```ts
import { CalculateExpression, useAllComputer } from '@shuttle-formula/core'

// 初始化一个表达式计算器
const calculateExpression = new CalculateExpression()
// 使用内部的计算器
useAllComputer(calculateExpression)

// 设置计算器通过变量路径获取变量值的函数
type GetVariable = (path: string[]) => WithPromise<WithUndefined<any>>

calculateExpression.setGetVariableFu(fn: GetVariable)

// 设置计算器通过函数名获取函数值的函数
type GetFunction = (name: string) => WithPromise<WithUndefined<Function>>

calculateExpression.setGetFunctionFu(fn: GetFunction)

// 通过检查的语法，则可直接放入计算器中进行计算
const value = await calculateExpression.execute(syntaxRootIds, syntaxMap)
console.log(value)
```
npm package: @shuttle-formula/render-react
Description: 公式编辑器react渲染器
Author: Mingbing-get
Latest version: 1.1.0

## `@shuttle-formula/render-react`

#### 说明

提供对接react的渲染方式

#### 安装

```bash
npm install @shuttle-formula/render-react
```

#### 使用

```tsx
import {
  Render,
  Provider,
  VariableTip,
  FunctionTip,
  TokenRender,
  ErrorRender,
  TokenRenderProps,
  ErrorRenderComponentProps,

  // useRender: 能获得shuttle-formula/render中的Render对象，可扩展自定义功能
} from '@shuttle-formula/render-react'

import { BooleanTokenDesc, BooleanTokenParse } from '@shuttle-formula/core'

function Example() {
  return (
    <Provider>
      <Render
        style={{ borderRadius: 5, boxShadow: '0 0 6px 0 #ccc', width: 400 }}
      />
      <VariableTip />
      <FunctionTip />
      <ErrorRender RenderComponent={TestErrorRender} />
      <TokenRender
        useTokenType={BooleanTokenParse.Type}
        RenderComponent={TestTokenTender}
      />
    </Provider>
  )
}

function TestTokenTender({ token, type }: TokenRenderProps<BooleanTokenDesc>) {
  return <span style={{ color: 'red' }}>{token.code}</span>
}

function TestErrorRender({ error }: ErrorRenderComponentProps) {
  return <div style={{ color: 'blue' }}>自定义错误提示: {error?.msg}</div>
}
```
npm package: @shuttle-formula/render-react-antd
Description: 公式编辑器react渲染器，基于antd组件库
Author: Mingbing-get
Latest version: 1.1.0

## `@shuttle-formula/render-react-antd`

#### 说明

提供对接react的渲染方式，基于antd组件库

#### 安装

```bash
npm install @shuttle-formula/render-react-antd
```

#### 使用

```tsx
import { FormulaRender } from '@shuttle-formula/render-react-antd'

function main() {
  return (
    <FormulaRender
      {/* functions={自定义支持的函数，可从@shuttle-formula/functions中引入内置的函数} */}
      {/* variables={自定义支持的变量} */}
      onAstChange={(ast) => {
        console.log('ast: ', ast)
      }}
      onTokenChange={(tokenInfo) => {
        {
          /* 实时输入的公式
          tokenInfo.code */
        }

        console.log(tokenInfo)
      }}
    />
  )
}
```
npm package: @shuttle-formula/render-vue
Description: 公式编辑器vue渲染器
Author: Mingbing-get
Latest version: 1.1.0

## `@shuttle-formula/render-vue`

#### 说明

提供对接vue的渲染方式

#### 安装

```bash
npm install @shuttle-formula/render-vue
```

#### 使用

```vue
<script setup lang="ts">
import {
  Render,
  Provider,

  // VariableTip: 自定义变量提示
  // FunctionTip: 自定义函数提示
  // TokenRender: 自定义token渲染
  // ErrorRender: 自定义error渲染
  // useRender: 能获得shuttle-formula/render中的Render对象，可扩展自定义功能
} from '@shuttle-formula/render-vue'

import { BooleanTokenDesc, BooleanTokenParse } from '@shuttle-formula/core'
</script>

<template>
  <Provider>
    <Render
      style="border-radius: 5px; box-shadow: 0 0 6px 0 #ccc; width: 400px"
    />
  </Provider>
</template>
```
npm package: @shuttle-formula/render-vue-element-plus
Description: 公式编辑器vue渲染器, 基于element-plus
Author: Mingbing-get
Latest version: 1.1.0

## `shuttle-formula/render-vue-element-plus`

#### 说明

提供对接vue的渲染方式, 基于element-plus

#### 安装

```bash
npm install @shuttle-formula/render-vue-element-plus
```

#### 使用

```vue
<template>
<FormulaRender
  functions="自定义支持的函数，可从@shuttle-formula/functions中引入内置的函数"
  variables="自定义支持的变量"
  @astChange="(ast) => {
    console.log('ast: ', ast)
  }"
  @tokenChange="(tokenInfo) => {
    {
      /* 实时输入的公式
      tokenInfo.code */
    }

    console.log(tokenInfo)
  }"
/>
</template>

<script setup lang="ts">
import { FormulaRender } from '@shuttle-formula/render-react-antd'
</scritp>
```
npm package: @shuttle-formula/variable-plugin
Description: 公式编辑器变量插件
Author: Mingbing-get
Latest version: 1.1.0

## `@shuttle-formula/variable-plugin`

公式编辑器变量插件

#### 内置插件类型

| 类型       | 描述             | 其他说明                              |
| ---------- | ---------------- | ------------------------------------- |
| `boolean`  | 布尔类型变量     | 对应公式的boolean类型                 |
| `datetime` | 日期时间类型变量 | 对应公式的custom-datetime类型         |
| `date`     | 日期类型变量     | 对应公式的custom-date类型             |
| `number`   | 数值类型变量     | 对应公式的number类型                  |
| `string`   | 字符串类型变量   | 对应公式的string类型                  |
| `array`    | 数组类型变量     | 对应公式的array类型, 有item属性       |
| `object`   | 对象类型变量     | 对应公式的object类型，有prototype属性 |

#### 扩展插件类型

```ts
// 扩展类型定义
export declare module '@shuttle-formula/variable-plugin' {
  export namespace VariablePlugin {
    export interface TestDefine extends BaseDefine<'test'> {}

    export interface DefineMap {
      test: TestDefine
    }
  }
}

// 实现类型转换工具
import { WithDynamicVariable } from '@shuttle-formula/render'

import {
  VariablePlugin,
  variablePluginManager,
} from '@shuttle-formula/variable-plugin'

export default class TestPlugin implements VariablePlugin.Instance<VariablePlugin.TestDefine> {
  is(define: VariablePlugin.Define): define is VariablePlugin.TestDefine {
    return define.type === 'test'
  }

  toFormula(define: VariablePlugin.TestDefine) {
    // 这里根据需要也可转换为公式其他内部类型
    return {
      type: 'custom-test' as `custom-${string}`,
      label: define.label,
      extra: define, // 将实际定义传递给公式的额外属性，可用于后续判断
    }
  }

  accept(returnType: WithDynamicVariable): boolean {
    return returnType.type === 'custom-test'
  }
}

// 将类型注册到变量的插件管理器中
variablePluginManager.use(new TestPlugin())
```
npm package: @shuttle-ui/color-mode
Description: Using color mode in React
Author: Dennis Chuck
Latest version: 0.2.0

# `@shuttle-ui/color-mode`

> Using color mode in React

## Installation

```
// with npm
npm install @shuttle-ui/color-mode

// with yarn
yarn add @shuttle-ui/color-mode
```

## Documentation

[**The documentation**](https://jumperchuck.github.io/shuttle-ui)
npm package: @shuttle-ui/components
Description: React Native components library
Author: Dennis Chuck
Latest version: 0.2.0

# `@shuttle-ui/components`

> React Native components library

## Installation

```
// with npm
npm install @shuttle-ui/components

// with yarn
yarn add @shuttle-ui/components
```

## Documentation

[**The documentation**](https://jumperchuck.github.io/shuttle-ui)
npm package: @shuttle-ui/system
Description: Layout custom designs for react native
Author: Dennis Chuck
Latest version: 0.2.0

# `@shuttle-ui/system`

> Layout custom designs for react native

## Installation

```
// with npm
npm install @shuttle-ui/system

// with yarn
yarn add @shuttle-ui/system
```

## Documentation

[**The documentation**](https://jumperchuck.github.io/shuttle-ui)
npm package: @shuttle-ui/theme
Description: Customize theme in React Native
Author: Dennis Chuck
Latest version: 0.2.0

# `@shuttle-ui/theme`

> Customize theme in React Native

## Installation

```
// with npm
npm install @shuttle-ui/theme

// with yarn
yarn add @shuttle-ui/theme
```

## Documentation

[**The documentation**](https://jumperchuck.github.io/shuttle-ui)
npm package: @shuttle-ui/utils
Description: React Native component library toolkit
Author: Dennis Chuck
Latest version: 0.2.0

# `@shuttle-ui/utils`

> React Native component library toolkit

## Installation

```
// with npm
npm install @shuttle-ui/utils

// with yarn
yarn add @shuttle-ui/utils
```

## Documentation

[**The documentation**](https://jumperchuck.github.io/shuttle-ui)