@awarevue/agent-sdk

中文文档
2.0.155发布于 2026/10/31MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 1719

SDK for building Agent implementations that speak the agent protocol.

原始使用文档

Agent Typescript SDK

An SDK that helps build an agent in Javascript / Typescript. An agent is a process written in any programming language, responsible for connecting devices of partner technologies in the area of perimeter security.

Agent Responsibilities and Guidelines

AWARE platform is a one-stop shop for monitoring and controlling perimeter security equipment including but limited to, CCTV cameras, electronic door locks, motion sensors, IO boards ... etc. This is all achieved by agents where each agent specializes in one technology and connects to devices of that technology to source state updates, events and run commands forwarded by AWARE platform. Also, it is responsible for updating access control policies based on the master policies defined in AWARE.

State, Events and Commands

The general mental model / abstraction of a device in AWARE deals with 3 concepts:

  • State Updates: For each device, there is an object of certain shape that describes the current state of a device. Agents are expected to continuously emit those state updates once they're started
  • Events: For each device, there are types of events that can take place and the agent's responsibility is to communicate those with low latency to AWARE adhering to the structure of these standard events per device type
  • Commands: Depending on device type (camera, door ... etc), platform users can issues commands to run on devices. Those commands are executed by an agent responsible for that particular tehchnology / partner system.

Access Control

Another area that an agent deals with is access control policies. Access control policies are about which person can access which resource at what time. Those access policies are defined in AWARE platform but they're distributed to partner systems via agents. When a user changes an access policy. Access control policies are stored and managed according to the following object model:

  • Persons: Persons are people who are expected to be relevant in a facility
  • Schedules: Weekly time tables that specify include time ranges. Typically, schedules are used by access rules to set when a collection of people can access a collection of resources (devices)
  • Access Rules: Each access rule contains info about which collection of people can access which collection of resources at certain time schedules
  • Zones: a zone is a non-overlapping physical grouping of resources

AWARE platform will propagate those changes to agents on two phases:

  • Validation phase: AWARE will send a message mentioning all the changes (mutations) of access control objects. Mutations are either merges or deletes
  • Apply Phase: Upon successful validation, the agent will be sent a message to apply the changes on the partner system. Applying the changes MUST be idempotent. That includes adding, updating or removing. Operations must always be able to recover if the partner system access objects have been manipulated outside AWARE platform. Taht includes cases like assigning a token to a person where the token has been assigned to someone else on the partner system, or update an object that no more exists in the partner system.

In both, validation and apply phases, the platform will send along all the reference translations for all objects mentioned in change descriptions. It is expected that the agent will inspect the shared references to makes sure they are still valid and to complain if there are objects that do not have needed references.

版本与发布记录

@awarevue/agent-sdk 共发布 287 个版本,首次发布于 2025/05/05;过去 12 个月发布了 140 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.155latest2026/10/319 天前
2.0.1542026/10/2614 天前
2.0.1532026/10/2219 天前
2.0.1522026/10/2119 天前
2.0.1512026/10/1921 天前
2.0.1502026/10/1624 天前

关于 @awarevue/agent-sdk 的常见问题

@awarevue/agent-sdk 是什么?

SDK for building Agent implementations that speak the agent protocol.

如何安装 @awarevue/agent-sdk?

在项目目录运行 npm install @awarevue/agent-sdk,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(4.4.3)、rxjs(^7.8.2)、@awarevue/api-types(2.0.155)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@awarevue/agent-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@awarevue/agent-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@awarevue/agent-sdk 可以商用吗?

@awarevue/agent-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@awarevue/agent-sdk 的下载量有多少?

根据 npm 官方下载统计,@awarevue/agent-sdk 在 2026/10/07 – 2026/11/05 这 30 天内被下载 1,719 次,日均约 57 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@awarevue/agent-sdk 还在维护吗?

最新版本 2.0.155 发布于 2026/10/31(9 天前);至今共发布 287 个版本,其中过去 12 个月发布了 140 个;首次发布于 2025/05/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。