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 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-channel-claw-task-ops

v0.1.6

Published

OpenClaw channel plugin for Claw Task Ops: pulls tasks via HSF HTTP gateway, processes them, and feeds back logs

Readme

openclaw-channel-claw-task-ops

OpenClaw 渠道插件:从 Claw Task Ops 拉取任务,交由 OpenClaw Agent 处理,并将处理结果和日志反馈回去。

  • 入站:轮询 HSF HTTP 网关拉取 pending 任务,自动更新为 processing
  • 出站:Agent 处理结果通过 HSF 反馈,日志写入 claw_task_log
  • 自动注册:插件启动时自动注册实例,定时心跳更新在线状态

安装

openclaw plugins install openclaw-channel-claw-task-ops

安装后重启网关:

openclaw gateway restart

更新

openclaw plugins update openclaw-channel-claw-task-ops
openclaw gateway restart

卸载

openclaw plugins uninstall openclaw-channel-claw-task-ops
openclaw gateway restart

配置(channels.claw-task-ops)

{
  "channels": {
    "claw-task-ops": {
      "gatewayBaseUrl": "https://pre-clawtask.alibaba-inc.com",
      "instanceId": "my_claw_instance",
      "instanceName": "我的Claw实例",
      "instanceDescription": "处理数据同步任务",
      "authorizedUsers": ["12345", "67890"],
      "accessToken": "your-secret-token"
    }
  }
}

| 参数 | 必填 | 默认值 | 说明 | |------|------|--------|------| | gatewayBaseUrl | 是 | - | HSF HTTP 网关地址 | | instanceId | 是 | - | 实例唯一标识 | | instanceName | 否 | = instanceId | 实例显示名称 | | instanceDescription | 否 | 空 | 实例描述 | | authorizedUsers | 否 | 空(不限制) | 授权用户工号列表,控制管理界面访问权限 | | accessToken | 否 | 空(不校验) | 投递令牌,HTTP/HSF 投递任务时需携带 |

自动注册与权限管理

插件启动后会自动向后端注册实例。如果 instanceId 对应的实例不存在,后端会自动创建;如果已存在,则更新状态为 running 并刷新 lastOnlineTime。此后每次轮询都会更新 lastOnlineTime 作为心跳。

  • authorizedUsers:配置后仅列表中的工号用户可在管理界面查看和操作该实例,未授权用户会看到「无权限」提示。为空或不配置时所有人可访问。
  • accessToken:配置后通过 HTTP/HSF 投递任务时必须携带此 token,后端会校验 token 与实例配置是否一致,不一致则拒绝投递。未配置时不校验。

投递任务

通过 HTTP 接口投递

curl -X POST 'https://pre-clawtask.alibaba-inc.com/luyou/public/gateway/executeHsf.json' \
  -H 'Content-Type: application/json' \
  -d '{
  "appName": "onetouch-logistics-operation",
  "hsfName": "com.alibaba.onetouch.logistics.compass.service.ClawTaskOpsRemoteService#submitTask(com.alibaba.onetouch.logistics.compass.dto.claw.ClawTaskSubmitRequestDTO)~com.alibaba.onetouch.basedata.api.Result",
  "args": [{
    "instanceId": "your_claw_instance_id",
    "taskName": "数据同步任务",
    "taskType": "data_sync",
    "priority": "high",
    "payload": { "sourceTable": "orders", "targetTable": "orders_backup" },
    "operator": "张三",
    "operatorId": "12345",
    "accessToken": "your-secret-token"
  }]
}'

accessToken 包含在请求体中,需与实例配置的 token 一致。taskIdstatus 可不传,后端自动生成。

通过 HSF 接口投递(Java)

引入 compass-sdk 依赖(查询最新版本):

<dependency>
    <groupId>com.alibaba.onetouch</groupId>
    <artifactId>compass-sdk</artifactId>
    <version>最新版本</version>
</dependency>

配置 HSF Consumer 并调用:

@HSFConsumer(serviceInterface = ClawTaskOpsRemoteService.class, serviceVersion = "1.0.0")
private ClawTaskOpsRemoteService clawTaskOpsRemoteService;

public String deliverTask() {
    ClawTaskSubmitRequestDTO request = new ClawTaskSubmitRequestDTO();
    request.setInstanceId("your_claw_instance_id");
    request.setTaskName("报表生成任务");
    request.setTaskType("report");
    request.setPriority("medium");
    request.setPayload(Map.of("reportType", "daily"));
    request.setOperator("系统");
    request.setOperatorId("system");
    request.setAccessToken("your-secret-token");

    Result<ClawTaskDTO> result = clawTaskOpsRemoteService.submitTask(request);
    return result.getData().getTaskId();
}

处理流程

1. 投递任务 (HTTP / HSF / 管理界面)
       ↓
2. 进入队列 (status = pending)
       ↓
3. 插件拉取 (状态变更为 processing)
       ↓
4. Agent 处理 (OpenClaw 执行任务)
       ↓
5. 写入日志 (过程记录到跟进日志)
       ↓
6. 反馈结果 (status → completed / failed)

HSF 接口一览

接口:com.alibaba.onetouch.logistics.compass.service.ClawTaskOpsRemoteService HSF 版本:1.0.0 | 应用:onetouch-logistics-operation

| 方法 | 参数 | 说明 | |------|------|------| | submitTask | ClawTaskSubmitRequestDTO | 投递任务(含 accessToken 校验) | | queryInstances | ClawInstanceQueryRequestDTO | 分页查询实例列表 | | queryTasks | ClawTaskQueryRequestDTO | 分页查询任务列表 | | queryTaskLogs | ClawTaskLogQueryRequestDTO | 分页查询任务日志 | | getInstanceDetail | String instanceId | 查询实例详情 | | getTaskDetail | String taskId | 查询任务详情 | | updateTask | ClawTaskDTO | 更新任务 | | pullTasks | String instanceId, int limit | 拉取 pending 任务(插件用) | | feedbackTask | ClawTaskFeedbackRequestDTO | 反馈任务结果 | | addTaskLog | ClawTaskLogDTO | 添加任务处理日志 | | registerInstance | ClawInstanceRegisterRequestDTO | 注册/心跳实例 |