SuperAPI AI 工具集

clawflow

智能体与模型

查看项目

更新于 10-16 10:59

技能介绍

用途

ClawFlow 适用于需要跨越单个提示或单个分离运行、但仍希望保持一个所有者会话、一个线程上下文以及一个可检查或恢复位置的工作场景。根据资料,常见适用情形包括:带有单一所有者的多步骤后台工作;等待分离的 ACP 或子智能体(subagent)任务的工作;可能需要向所有者发出一次清晰更新的作业;需要在步骤之间传递小型持久化输出包的作业。

主要能力

ClawFlow 管理以下内容:流程身份(flow identity);所有者会话与返回上下文(owner session and return context);等待状态(waiting state);小型持久化输出(small persisted outputs);完成、失败、取消和阻塞状态(finish、fail、cancel、blocked state)。

ClawFlow 不负责分支或业务逻辑,这部分应放在 Lobster、acpx 或调用代码中实现。

使用方式

运行时模式包括以下调用:

  • createFlow(...)
  • runTaskInFlow(...)
  • setFlowWaiting(...) 或 setFlowOutput(...)
  • resumeFlow(...)
  • emitFlowUpdate(...)(仅在需要时)
  • finishFlow(...) 或 failFlow(...)

示例结构:

const flow = createFlow({
  ownerSessionKey,
  goal: "triage inbox",
});

const classify = runTaskInFlow({
  flowId: flow.flowId,
  runtime: "acp",
  task: "Classify inbox messages",
  currentStep: "wait_for_classification",
});

resumeFlow({
  flowId: flow.flowId,
  currentStep: "route_results",
});

setFlowOutput({
  flowId: flow.flowId,
  key: "classification",
  value: { route: "business" },
});

资料强调应将条件判断保留在运行时之上,即用流程运行时处理状态与任务关联,将决策留在编写层(authoring layer):

  • business → post to Slack and wait
  • personal → notify the owner now
  • later → append to an end-of-day summary bucket

适用场景与示例

资料提供的示例文件包括:

  • skills/clawflow/examples/inbox-triage.lobster
  • skills/clawflow/examples/pr-intake.lobster
  • skills/clawflow-inbox-triage/SKILL.md(用于具体的路由模式)

限制

ClawFlow 不负责分支或业务逻辑,条件与决策需由作者在 Lobster、acpx 或调用代码中实现。资料未提供关于收费、价格、平台支持范围或性能表现的说明。