npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@neural-nexus/neural-client-runtime

v0.0.1

Published

会话客户端运行时sdk

Readme

neural-client-runtime

会话客户端运行时sdk

Getting started

安装

npm i @neural-nexus/neural-client-runtime

使用说明

使用示例

import Runtime, { MessageType } from '@neural-nexus/neural-client-runtime'

const cardRunTime = new Runtime('cardCode')

cardRunTime.application.openApp('https://1688.com', '1688')

cardRunTime.ui.openNotification({
  title: '消息',
  message: '这是一条消息的提示消息',
  type: MessageType.INF
})

API列表

Action(自定义行为)

export interface Action {
  /**
   * 注册自定义行为
   * @param name 行为名称
   * @param containerCode 行为触发端
   * @param cb 行为回调
   */
  register(name:string, containerCode: string, cb: () => void): void;

  /**
   * 触发自定义行为
   * @param name 行为名称
   * @param params 行为参数
   * @param containerCodeList 行为触发端列表
   */
  trigger(name: string, params: any, containerCodeList: string[]): void;
}

application(应用空间)

export interface Application {
  /**
   * 打开应用空间
   */
  openWorkspace(): void;
  /**
   * 打开工作台首页
   */
  openLaunchPad(): void;
  /**
   * 打开
   */
  openNexus(): void;
  /**
   * 打开子应用
   */
  openApp(url: string, name: string): void;
  /**
   * 页面回退
   */
  goBack(): void;
  /**
   * 更新首页关注内容
   */
  updateFollow(): void;
    
  /**
   * 更新首页通知
   */
  updateNotice(payload: any): void;
  
  /**
   * 更新首页任务
   */
  updateTask(payload: any): void;
  
  /**
   * 更新首页示险
   */
  updateWarning(payload: any): void
}

nexus(会话)

export enum NexusMessageType {
  CARD = "card",
  TEXT = "text",
}

export interface ITextMsgPayload {
  text: string,
  show?: boolean,
  notTriggerAPI?: boolean
}

export interface ICardMsgPayload<T = any>  {
  code: string,
  data: T,
  position?: string
}
export interface Nexus {
  /**
   * 发送系统消息
   * @param type 消息类型
   * @param payload 消息数据
   */
  sendSystemMsg(type: NexusMessageType, payload: ITextMsgPayload | ICardMsgPayload): void;
  /**
   * 发送用户消息
   * @param type 消息类型
   * @param payload 消息数据
   */
  sendUserMsg(type: NexusMessageType, payload: ITextMsgPayload | ICardMsgPayload): void;

  /**
   * 更新上次回答结果
   * @param content 回答内容
   */
  updateLastResult(content: string): void;
}

ui

export interface UI {

openToast (params: IToastOpts): void;

/**
 * 打开通知,可以从四个角弹出
 * 里面的组件属性和饿了么一样
 * @param {*} params
 */
openNotification (params: INotificationOpts): void;

/**
 * 打开 Modal 弹窗
 * 里面的组件属性和饿了么一样
 * @param {*} params
 */
openDialog (params: IDialogOpts): void;