Use for Agent Signal sources, actions, policies, middleware, workflow handoff and deduplication.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-agent-signal-f0d46c13ca4d ,按照其中的说明把「agent-signal」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use this skill to implement event-driven background work for agents without coupling the work to the foreground chat request.
Agent Signal has one consistent runtime shape:
source event -> signal interpretation -> action execution -> built-in result signals
Durable self-iteration work has one extra completion branch:
memory/skill action -> execAgent enqueue -> agent.execution.completed -> selfIteration receipt projection
references/architecture.md to map the package boundary, runtime queue, scope model, and async workflow handoff.references/handlers.md before writing any new policy, source handler, signal handler, or action handler.references/observability.md when you need tracing, metrics, debugging, or workflow snapshot visibility.emitAgentSignalSourceEvent(...) when a server-owned producer should execute the pipeline immediately.executeAgentSignalSourceEvent(...) when a worker or controlled backend path already owns execution timing and may inject a runtime guard backend.enqueueAgentSignalSourceEvent(...) when the caller should return quickly and let Upstash Workflow process the event out-of-band.emitAgentSignalSourceEventWithStore(...) for isolated tests or evals that should avoid ambient Redis state.Read:
apps/server/src/services/agentSignal/index.tsapps/server/src/workflows/agentSignal/index.tsapps/server/src/workflows/agentSignal/run.tssource: A normalized fact that happened. Sources come from producers such as runtime lifecycle events, user messages, or bot ingress.signal: A semantic interpretation derived from one source or from another signal. Signals express meaning, routing, or policy state.action: A concrete side effect planned from one signal. Actions do the work.policy: An installable middleware bundle that registers source, signal, and action handlers.procedure: Not a distinct runtime node. Treat "procedure" as the end-to-end flow for one use case: ingress source, matching handlers, planned actions, execution result, and observability.Keep the boundaries strict:
source when the outside world produced a new event.signal when the system needs a reusable semantic interpretation.action when the runtime needs a concrete side effect.policy when you are wiring those pieces together.packages/agent-signal/src/source/sourceTypes.ts.apps/server/src/services/agentSignal/policies/types.ts.defineSourceHandler, defineSignalHandler, or defineActionHandler.apps/server/src/services/agentSignal/sources/** when the producer payload needs shaping.defineAgentSignalHandlers(...).apps/server/src/services/agentSignal/policies/index.ts and pass it into the runtime factory if needed.packages/agent-signal/src/index.ts
packages/agent-signal/src/base/builders.ts
packages/agent-signal/src/base/types.ts
packages/agent-signal/src/source/sourceTypes.ts
packages/agent-signal/src/source/sourceEvent.tsapps/server/src/services/agentSignal/runtime/AgentSignalRuntime.ts
apps/server/src/services/agentSignal/runtime/AgentSignalScheduler.ts
apps/server/src/services/agentSignal/runtime/middleware.ts
apps/server/src/services/agentSignal/runtime/context.tsapps/server/src/services/agentSignal/policies/analyzeIntent/index.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackSatisfaction.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackDomain.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackAction.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/actions/userMemory.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/actions/skillManagement.ts
apps/server/src/services/agentSignal/policies/analyzeIntent/completionSkillSynthesis.ts
apps/server/src/services/agentSignal/policies/completionPolicy.ts
apps/server/src/services/agentSignal/services/selfIteration/completion/buildSelfIterationReceipts.ts
apps/server/src/services/agentSignal/services/selfIteration/completion/selfIterationCompletionHandler.tsapps/server/src/services/agentSignal/observability/projector.ts
apps/server/src/services/agentSignal/observability/traceEvents.ts
packages/observability-otel/src/modules/agent-signal/index.tsexecAgent; the durable write and receipt projection happen after completion.scopeKey to serialize related background work.@lobechat/agent-signal for normalized nodes and result contracts.agent.execution.completed + selfIteration finalState via createSelfIterationCompletionHandler(...).apps/server/src/services/agentSignal/**/__test__ and **/__tests__ are the reference pattern.references/architecture.mdreferences/handlers.mdreferences/observability.md