跳到正文
Skillpedia
部署与云(DevOps)8.5k · #12439

process-event-sources

它能做什么

这项技能讲解 Firstmate 如何在不阻塞对话的情况下监视耗时较长的外部进程。适合需要慢速任务结果的人,例如评审面板或外部检查。

适用场景

  • ✓当外部进程需要很长时间,而你希望智能体同时继续工作的时候。
  • ✓当进程事件唤醒通知称某个被监视的来源已完成时。
  • ✓当某个被监视的来源被报告为滞留或启动失败时。

技能链接

https://github.com/kunchenguid/firstmate/blob/main/.agents/skills/process-event-sources/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/kunchenguid/firstmate/blob/main/.agents/skills/process-event-sources/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请开始监视这个长时间的评审面板,并在它有需要我回复的反馈时唤醒我。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体把外部进程注册为一个来源,并继续工作。进程结束时,唤醒消息会把结果带回对话中。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

process-event-sources

Load this before arming a long-polling source, before registering a deterministic condition->action watch, whenever a check: wake carries procevent <adapter> <source-id> <sequence>, and whenever the watcher headlines a process-event source stranded or process-event source failed to start wake.

The runner exists so a blocking external process never holds firstmate's conversational turn. Firstmate registers a source, keeps working, and is woken when that process completes.

Arming a source

Use the adapter, not the generic runner, for a real source. Before either Lavish arm form below, open the artifact with lavish-axi so its saved session can route the listener; the operating contract owns the prerequisite and refusal boundary. For a Lavish review artifact firstmate owns:

bin/fm-procevent-lavish.sh arm <artifact.html>

A worker-owned board uses bin/fm-procevent-lavish.sh arm <artifact.html> --for <task-id> and re-arms with its reply after each nonterminal round; the existing handled marker is the acknowledgement. Arm it once, then re-arm only when a round is actually waiting: arming again with nothing to acknowledge is refused. A terminal round is never re-armed: the board stays yours until you acknowledge it with bin/fm-procevent.sh handled <source-id> <sequence>, which retires it, and until then retire refuses the board too. Never arm a board that a live task hosts; follow the crew-hosted Lavish board contract for reply acceptance and older-version limits.

Registering a source is not the same fact as listening to it. Lavish arm waits until this registration's listener is confirmed running and does not report ready without that evidence; other adapters still record the source for the watcher's next reconcile. When an earlier registration's listener still holds the board as the confirm window ends, Lavish arm prints still-listening instead of armed; that listener keeps serving the board, and the new registration takes effect only after you retire the source and arm it again. After arming by hand, confirm bin/fm-procevent.sh list reports that source as live, and run bin/fm-procevent.sh reconcile when it does not. Reconcile reports every launch that did not prove it took its claim within the confirm window as failed= and exits non-zero, so a source that cannot be started says so instead of looking armed, and it wakes you once per failure episode about it because the watcher discards that count; start does not fix that - if the source stays unowned, run start attached to read the runner's refusal, then check the source command and adapter binary the registration names, and if a later reconcile finds the source owned the episode closes on its own. A source list reports as orphaned is one reconcile will not relaunch, because something may still be polling it; reconcile wakes you once about it, and that wake's payload says which of two recoveries applies. If the claim's recorded pid is alive under a different identity, bin/fm-procevent.sh start <source-id> takes the source back once you have checked nothing is still polling it - provided the dead generation's reservation records can still be tidied; otherwise it refuses with cannot claim source. If the runner itself died and its process group survives, start reports already owned and takes nothing back: verify whether the dead runner's polling child is still attached to the source, and once that group is empty the next reconcile reclaims the source on its own. Nothing signals that group automatically.

When a source carries captain answers to captain-held tasks, bind it BEFORE arming it, so it can never produce an answer that has nowhere to go:

bin/fm-captain-hold.sh bind <source-id>

The runner then passes each captured result to that source's own adapter answers command and pipes the keyed answers it prints into the one keyed-answer intake, which owns every rule about what they mean; the keys are captain-held task ids. This is generic across built-in adapters with an answers command, and the runner still wakes you to act on the result. External process-event bindings intentionally expose no answer operation and cannot feed the captain-answer intake. captain-hold-lifecycle owns when a binding is required and what the keys must be.

常见问题

进程运行时智能体会等待吗?

不会。智能体会继续工作,进程结束时才会收到唤醒消息。

滞留是什么意思?

它表示某个被监视的来源失去了连接,需要检查,这项技能会说明如何处理。

智能体可以监视任何工具吗?

不可以。它为每个支持的来源使用专门的适配器,而不是一个适用于所有工具的通用运行器。

详情

作者的原始描述

Load before arming a long-polling source firstmate owns, before registering a deterministic condition->action watch, on any `procevent <adapter> <source-id> <sequence>` check wake, and on any `process-event source stranded` or `process-event source failed to start` check wake.

repo: kunchenguid/firstmate

热度

GitHub 星标
8.5k
排名
#12439
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能