open-index/open-npm huggingface dataset:
npm package: @larislab/ui
Description: UI react component library based on shadcn/ui
Author: Laris Lab
Latest version: 1.9.4

# UI

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

UI react component library based on [shadcn/ui](https://ui.shadcn.com/)

Read [Documentation 📘](https://ui.larislab.com)

## Installation

[![npm version](https://badge.fury.io/js/@larislab%2Fui.svg)](https://www.npmjs.com/package/@larislab/ui)
[![npm](https://img.shields.io/npm/dt/@larislab/ui)](https://www.npmjs.com/package/@larislab/ui)

### 1. Install package

```bash
npm i @larislab/ui tailwindcss-animate lucide-react
```

### 2. Update `tailwind.config.ts` / `tailwind.config.mjs`

```ts
export default {
    content: ['src/**/*.{js,jsx,mdx,ts,tsx}', 'node_modules/@larislab/ui/dist/**/*.js'],
    plugins: [require('@larislab/ui/plugin'), require('tailwindcss-animate')],
}
```

### 3. Wrap content to provider

```tsx
<UiProvider>...</UiProvider>
```

That's it! You're ready to use the components.
npm package: @lark-anycross/integration
Description: AnyCross Integration SDK for Node.js
Latest version: 0.3.2

# @lark-anycross/integration

轻量封装连接器调用能力，提供 `IntegrationClient`。

## 初始化参数说明

`new IntegrationClient(opts)` 的参数 `opts` 支持以下配置：

- `apiKey?: string`
  - 用于鉴权；默认从 `process.env.LARK_INTEGRATION_API_KEY` 读取
- `baseUrl?: string`
  - 平台基础域名；默认从 `process.env.LARK_INTEGRATION_BASE_URL` 读取，回退为 `https://anycross.feishu.cn/`
- `headers?: Record<string, string> | Headers | [string, string][]`
  - 额外请求头；默认 `{}`。
- `debug?: boolean`
  - 是否开启调试日志；默认取 `process.env.LARK_INTEGRATION_DEBUG === 'true'`
- `timeoutMs?: number`
  - 请求超时时间（毫秒）；默认 `60000`，最小需大于 `0`
- `logger?: { info; error; warning; warn? }`
  - 自定义日志器；默认使用 `globalThis.logger`（如存在）或 `console`

示例：

```ts
import { IntegrationClient } from '@lark-anycross/integration'

const client = new IntegrationClient({
  apiKey: 'YOUR_API_KEY',
  baseUrl: 'https://anycross.feishu.cn/',
  headers: { 'X-Custom-Header': 'demo' },
  debug: false,
  timeoutMs: 30000,
})

const { output } = await client.connector.crm({
  version: '1.0',
  action: 'syncLead',
  connectionID: 'conn_xxx',
  input: { id: '123' },
})
```

## 通过环境变量配置初始化

支持通过环境变量注入初始化信息，无需在代码中显式传入。

可用环境变量：

- `LARK_INTEGRATION_API_KEY`：用于请求鉴权
- `LARK_INTEGRATION_BASE_URL`：平台基础域名，可选配置，默认 `https://anycross.feishu.cn/`
- `LARK_INTEGRATION_DEBUG`：是否开启 Debug 日志（值为字符串 `'true'` 时开启），可选配置

示例（使用 `.env` 或 shell 环境）：

```bash
# .env 或 shell 中设置
LARK_INTEGRATION_API_KEY=sk_xxx
LARK_INTEGRATION_BASE_URL=https://anycross.feishu.cn/
LARK_INTEGRATION_DEBUG=true
```

代码中直接从环境变量读取：

```ts
import 'dotenv/config'
import { IntegrationClient } from '@lark-anycross/integration'

// 显式参数缺省时，将自动读取对应环境变量
const client = new IntegrationClient()

const { output } = await client.connector.crm({
  version: '1.0',
  action: 'syncLead',
})
```

优先级说明：显式传入的 `opts` 参数优先于环境变量。

## Debug 模式说明

当开启 Debug 模式（`debug: true` 或设置环境变量 `LARK_INTEGRATION_DEBUG=true`）时，SDK 会打印调用请求与响应的详细日志，便于排查问题：

- 请求日志：包含 `url`、`method`、`headers`（`Authorization` 将被遮蔽）与 `body` 预览
- 响应日志：包含 `status`、`ok`、`data` 与 `logID`（来自响应头 `x-tt-logid`）

可选自定义日志器：

```ts
const logger = {
  info: (msg: string, payload?: unknown) => console.info(msg, payload),
  error: (msg: string, payload?: unknown) => console.error(msg, payload),
  warning: (msg: string, payload?: unknown) => console.warn(msg, payload),
}

const client = new IntegrationClient({ debug: true, logger })
```

注意：Debug 日志较为详细，建议在本地开发或问题定位时开启，生产环境谨慎使用。
npm package: @lark-apaas/action-plugin-common
Description: Common utilities for aPaaS action plugins
Latest version: 0.1.0

# @lark-apaas/action-plugin-common

Common utilities for aPaaS action plugin development — provides error types and platform API error handling.

## Install

```bash
npm install @lark-apaas/action-plugin-common
```

## API

### Error Classes

#### `RateLimitError`

Thrown when a plugin encounters rate limiting or quota exhaustion. The platform identifies this error by `code === 'RATE_LIMIT_EXCEEDED'` and passes `rateLimitCode` / `rateLimitMessage` to the business layer.

```typescript
import { RateLimitError } from '@lark-apaas/action-plugin-common';

// Quota exhausted
throw new RateLimitError('quota_exceeded', '本月配额已用完，请下月再试');

// QPS throttling
throw new RateLimitError('qps_limit', '请求过于频繁，请稍后再试');
```

#### `PlatformApiError`

Wraps non-rate-limit platform API errors with plugin/action context.

```typescript
import { PlatformApiError } from '@lark-apaas/action-plugin-common';

throw new PlatformApiError(
  'API call failed',
  'my-plugin',
  'myAction',
  errorOutput,
);
```

### Error Handling Utilities

#### `handlePlatformError(output, pluginName, actionName)`

Inspects a platform API error output and throws the appropriate error:

- `RateLimitError` for `ResourceExhausted` errors
- `PlatformApiError` for all others

```typescript
import { handlePlatformError } from '@lark-apaas/action-plugin-common';

// Streaming
if (chunk.success !== true) {
  handlePlatformError(chunk.chunkOutput, 'ai-text-generate', 'textGenerate');
}

// Unary
if (result.data.success === false) {
  handlePlatformError(result.data.output, 'ai-text-to-image', 'textToImage');
}
```

#### `extractRateLimitError(output)`

Returns a `RateLimitError` instance if the output is a rate-limit error, otherwise `null`.

```typescript
import { extractRateLimitError } from '@lark-apaas/action-plugin-common';

const rateLimitError = extractRateLimitError(chunk.chunkOutput);
if (rateLimitError) {
  throw rateLimitError;
}
```

#### `isRateLimitError(output)`

Checks whether a `PlatformErrorOutput` object represents a rate-limit error (`code === 'ResourceExhausted'`).

#### `isRateLimitErrorInstance(error)`

Checks whether an error is an instance of `RateLimitError`.

### Types

```typescript
import type {
  CallApiResponse,
  PlatformErrorDetail,
  PlatformErrorOutput,
  SSEMessage,
  StreamCallChunk,
} from '@lark-apaas/action-plugin-common';
```

| Type | Description |
| --- | --- |
| `CallApiResponse<T>` | Response shape for unary platform API calls |
| `StreamCallChunk` | Chunk shape for streaming platform API calls |
| `SSEMessage` | SSE message structure |
| `PlatformErrorOutput` | Platform API error output |
| `PlatformErrorDetail` | Error detail with business `code` and `message` |

### Constants

- `RATE_LIMIT_ERROR_CODE` — `'ResourceExhausted'`

## License

MIT
npm package: @lark-apaas/aily-web-sdk
Description: Aily Web SDK - iframe-based chat panel integration
Latest version: 0.0.9

# Aily-Web-SDK

Aily Web SDK 是飞书 Aily 团队推出的轻量级 SDK，通过 iframe + postMessage 方式让你快速接入 Aily AI 能力。

## 特点

- **轻量级**: 纯 iframe 实现，无 CDN 资源加载
- **高隔离性**: 完全隔离的运行环境
- **简单易用**: 简洁的 API 设计

## 安装

```bash
npm install @lark-apaas/aily-web-sdk
```

## 使用

```typescript
import { initAilyChat } from '@lark-apaas/aily-web-sdk'

const container = document.querySelector('.container');
const chatPanel = await initAilyChat(container, {
  appKey: 'your-app-key',
  common: {},
  events: {
    onReady: () => console.log('ready'),
    onError: (error) => console.error(error)
  }
});
```

## API

### `initAilyChat(root, config)`

初始化 Aily Chat 面板。

**参数:**

- `root` (`HTMLElement`) - iframe 挂载的容器元素
- `config` (`WebSDKConfig`) - 配置项
  - `appKey` (`string`) - 应用 Key
  - `uuid` (`string`, 可选) - 用户标识
  - `device` (`'pc' | 'mobile'`, 可选) - 设备类型
  - `common` (`WebSDKCommonConfig`) - 通用配置
    - `baseURL` (`string`) - Aily 服务地址
    - `headers` (`Record<string, string>`, 可选) - 自定义请求头
  - `events` (`WebSDKEvents`, 可选) - 事件回调
    - `onReady` - iframe 就绪回调
    - `onError` - 错误回调
    - `onMessage` - 消息回调

**返回:** `Promise<ChatPanel>`

### `ChatPanel`

| 方法 | 说明 |
| --- | --- |
| `sendMessage(data)` | 发送消息 |
| `clear()` | 清空聊天记录 |
| `cancelMessage(messageItem)` | 取消消息 |
| `clearAndStop()` | 清空消息并停止当前响应 |
| `updateWelcomeMessage()` | 刷新欢迎消息 |
| `updateConfig(config)` | 更新面板配置 |
| `destroy()` | 销毁实例 |

## License

MIT
npm package: @lark-apaas/client-capability
Description: Client SDK for calling capabilities
Latest version: 0.1.6

# @lark-apaas/client-capability

前端能力（Capability）调用的底层 SDK。

## 注意

**请勿直接使用此包**。应该使用 `@lark-apaas/toolkit` 导出的 `capabilityClient` 实例：

```typescript
import { capabilityClient } from '@lark-apaas/toolkit';

const result = await capabilityClient.load('create_feishu_group').call('run', {
  group_name: '项目讨论群',
  members: ['user_001', 'user_002'],
});
```

`@lark-apaas/toolkit` 已预配置好 `baseURL`、`csrfToken` 等环境相关参数。

## 包职责

此包仅提供：
- `CapabilityClient` 类
- `createClient` 工厂函数
- 错误类型定义

供 `@lark-apaas/toolkit` 内部使用。

## 许可证

MIT