open-index/open-npm huggingface dataset:
npm package: @hzkj/mars-event-lib
Description: a collection of rpa platform events.
Author: hsukid
Latest version: 1.0.19

# Mars Event Lib

```typescript
// 生命周期
enum LifeCircleEvent {
  inited = 'ON_INITED',
  updated = 'ON_UPDATED',
  beforeDestory = 'ON_BEFORE_DESTORY'
}
// 命令
enum OrderEvent {
  send = 'TO_SEND',
  resolve = 'TO_RESOLVE',
  do = 'TO_DO'
}

// 表单构建操作
enum FormDesign {
  generate = 'Generate',
  import = 'Import'
}

// rpa通用操作
enum RpaCommon {
  // 加载中
  loading = 'Loading'
}

// rpa工单推送操作
enum RpaWorkCreate {
  // 处理数据列表
  matrialList = 'MatrialList',
  // 流程列表
  flowList = 'FlowList',
  // 流程
  flowItem = 'FlowItem',
  // 表单数据
  formList = 'FormList',
  // 流程处理结果
  workResult = 'WorkResult'
}

// rpa工单数据
enum RpaWorkHistory {
  // 历史包列表
  viewWorks = 'ViewWorks',
  // 包详情
  viewWork = 'ViewWork',
  // 包错误列表
  viewFails = 'ViewFails',
  // 包错误详情
  viewFail = 'ViewFail',
  // 包操作
  executeOnWork = 'ExcuteOnWork',

  // 任务列表
  viewJobs = 'ViewJobs',
  // 任务详情
  viewJob = 'ViewJob',
  // 任务操作
  executeOnJob = 'ExcuteOnJob',

  // 节点列表
  nodeList = 'NodeList',
  // 节点详情
  nodeDetail = 'NodeDetail',
  // 节点操作
  executeOnNode = 'ExcuteOnNode'
}
```
npm package: @hzkj/voicenine
Description: js sdk of cloud platform base on janus gateway.
Author: hsukid
Latest version: 1.4.5

# HANZI VOICENINE

## VERSION 1.4.2

## 引入

```ts
import { VoiceNine } from '@hzkj/voicenine'
const voice9 = new VoiceNine()
```

## 方法

```ts
//身份初始化方法
voice9.init(login接口返回的对象)

//主动触发登出
voice9.logout()

//设置登录状态为”忙碌“
voice9.setBusy()

//设置登录状态为”空闲“
voice9.setReady()

//自定义忙碌(参数自定义)
voice9.setWorkNotReady('1234')

//拨打电话
voice9.call(telNum)

//接通电话
voice9.answer()

//挂断电话
voice9.hangup()

//发送按键
voice9.sendDtmf('1234')

//转接(转技能组: groupId:1, 转坐席: 1001@test, 转ivr: ivrId:100, 转外呼: 13311112222)
voice9.transfer(telNum)

//咨询(咨询ivr流程: ivrId:123,  咨询坐席:1001@test,  咨询分机:950002)
voice9.consult(telNum)

//取消咨询
voice9.consultCancel(telNum)

//咨询转接
voice9.consultTransfer(telNum)

//转多方
voice9.consultParty()

//通话静音
voice9.mute()

//通话取消静音
voice9.cancelMute()

//通话保持
voice9.hold()

//通话取消保持
voice9.cancelHold()

//班长监听：班长可以听到别人的声音，别人听不到班长的声音。
voice9.monitor('1003@test', callId)

//强拆：原本与客户通话的坐席会被挂断，发起强拆的坐席代替原坐席继续与客户通话。(必须处于监听中的电话)
voice9.intercept()

//强插：通话将由原来的双方通话变成三人会议
voice9.barge('1003@test', callId)

//辅导：辅导过程中被辅导坐席可以听到辅导者的声音，客户无法听到辅导者的声音。
voice9.coach('1003@test', callId)
```

## 事件

```ts
// 监听全量消息
voice9.on('message', (data) => {})

// 监听退出
voice9.on('logout', (data) => {})

// 监听可用行为列表
voice9.on('btnstate', (btns) => {})

// 监听状态变化
voice9.on('agentstate', (state) => {})

// 监听具体状态
voice9.on(voice9.enum.state.LOGIN, (data) => {})

// 触发事件
voice9.emit(event, data)
```

## 状态枚举

| 状态值 | 说明 |
|--------|------|
| `LOGIN` | 已登录 |
| `LOGOUT` | 已退出 |
| `READY` | 空闲 |
| `NOT_READY` | 忙碌 |
| `WORK_NOT_READY` | 自定义忙碌 |
| `AFTER` | 话后 |
| `OUT_CALL` | 外呼中 |
| `OUT_CALLER_RING` | 外呼主叫振铃 |
| `OUT_CALLED_RING` | 外呼被叫振铃 |
| `PLAY_AGENT_ID` | 播放坐席工号 |
| `TALKING` | 通话中 |
| `MUTE_TALKING` | 静音中 |
| `HOLD_TALKING` | 保持中 |
| `INNER_CALL_RING` | 内呼来电振铃 |
| `INNER_CALL_TALKING` | 内呼通话中 |
| `INBOUND_RING` | 来电振铃 |
| `TRANSFER` | 转接中 |
| `TRANSFERED_RING` | 转接来电振铃 |
| `TRANSFER_OUT_RING` | 转接外呼振铃 |
| `TRANSFERED_TALKING` | 转接来电通话中 |
| `CONSULT` | 咨询中 |
| `CONSULT_RING` | 咨询来电振铃 |
| `CONSULT_OUT_RING` | 咨询外呼振铃 |
| `CONSULT_IVR` | 咨询IVR |
| `CONSULT_TALKING` | 咨询通话中 |
| `CONSULTED_TALKING` | 来电咨询中 |
| `CONFERENCE_TALKING` | 多方通话 |

使用方式：

```ts
voice9.on(voice9.enum.state.TALKING, (data) => {})
voice9.on(voice9.enum.state.INBOUND_RING, (data) => {})
// 也可以直接用字符串
voice9.on('TALKING', (data) => {})
```

## 连接状态事件

```ts
// 监听 WebSocket / Janus 连接状态变化
voice9.on('connstate', ({ type, state, code, reason }) => {
  // type: 'ws' | 'janus'
  // state: 'connecting' | 'connected' | 'closed' | 'failed'
})

// 监听 SIP 注册状态
voice9.on('sipstate', ({ registered, username, code, reason }) => {})

// 监听通话 ICE 连接状态（WebRTC 重连）
// state: 'disconnected' | 'reconnecting' | 'reconnected' | 'failed'
voice9.on('icestate', ({ state }) => {})
```
npm package: @hzkj/web-tracking
Description: a web-tracking tool base on aliyun SLS and used with vue 2/3
Author: hsukid
Latest version: 1.0.4

# Hanzi Web Tracking Plguin

```ts
// 全局环境参数集合
type LogEnv = {
  /** 环境属性 */
  app_name: string
  // 客户端版本号
  app_version: string
  // 服务端版本号
  api_version: string
  // 当前环境
  environment: string
  // 用户ID
  uid: string
  // 用户名称
  nick_name: string
  // 用户登录token
  session: string
  // 系统
  system: string
}

// 配置参数
type Options = {
  // aliyun sls 配置
  sls: {
    host: string
    project: string
    logstore: string
  }
  // 接口白名单
  ignores?: string[]
}

type Router = VueRouter

// 用于存储和获取全局参数
interface Store {
  state: LogEnv
  get(): LogEnv
  set(v: LogEnv): void
}
```

## 使用方法

### 一、注册插件

```ts
import { WebTracking } from '@hzkj/web-tracking'

// vue 3.x
app.use(WebTracking, { options, router })

// vue 2.x
Vue.use(WebTracking, { options, router })
```

### 二、全局环境参数存入

```ts
import { WebTrackingStore } from '@hzkj/web-tracking'

const wtstore = new WebTrackingStore()
wtstore.set({ ... })
```

### 三、处理路由日志

```ts
// main.js
import router from '...'

// vue 3.x
app.use(router)
app.use(WebTracking, { options, router })
app.mount(...)

// vue 2.x
Vue.use(WebTracking, { options, router })
new Vue({ router })
```

### 四、处理接口日志

```ts
// 在 request.js 中，注入拦截器

import { WebTracking } from '@hzkj/web-tracking'

const service = axios.create({...})
// 放置在别的拦截器之前
WebTracking.withInterceptor(service)

service.interceptors.request.use(...)
```
npm package: @hzkjn/create-gene
Description: HZKJN app generator
Latest version: 0.1.13

# Gene

[![Test](https://github.com/hzkjn/gene/actions/workflows/test.yml/badge.svg)](https://github.com/hzkjn/gene/actions/workflows/test.yml)
[![Release](https://github.com/hzkjn/gene/actions/workflows/release.yml/badge.svg)](https://github.com/hzkjn/gene/actions/workflows/release.yml)

CLI scaffolder for HZKJN apps.

Gene helps you quickly scaffold different types of applications (web, SaaS, mobile, CLI, etc.) with sensible defaults and opinionated structure.

---

## Usage

### Interactive mode

```bash
bun create @hzkjn/gene
```

This will prompt you to:
1. Enter your app name
2. Select the type of app you want to create

### Standard usage

```bash
bun create @hzkjn/gene my-app
```

This will prompt you to select the type of app you want to create.

### Semi-interactive (template specified)

```bash
bun create @hzkjn/gene --template web
```

This will prompt only for the app name, using the specified template.

### Power user mode (skip all prompts)

```bash
bun create @hzkjn/gene my-app --template saas-workspaces
```

or

```bash
bun create @hzkjn/gene my-app -t web
```

### Available templates

- `web`
- `mobile`
- `browser-extension`
- `api`
- `cli`
- `lib`
- `saas-workspaces`
- `saas-domains`

---

## For App Developers (using Gene)

After scaffolding your app:

```bash
cd my-app
bun install
bun run dev
```

That’s it. You’re ready to build.

---

## For Gene Maintainers (developing Gene itself)

When making changes to **Gene** (the CLI):

1. Run tests
   ```bash
   bun test
   ```

2. Build the package
   ```bash
   bun run build
   ```

3. Bump the version
   ```bash
   npm version <major|minor|patch>
   ```

4. Push commits and tags
   ```bash
   git push
   git push --tags
   ```

Publishing is handled via GitHub Actions.

> ⚠️ Do not publish manually.  
> Tagged releases trigger the automated publish workflow.

---

## License

MIT