author-ambient-trigger
v4 sub-skill #5 (optional). Adds the `ambient:` block — declares an AmbientAgent that watches the bus / graph / clock and spawns workflows of the listed types. Skipped when the operator answers "no" to "does this domain need an ambient hook?".
- License 许可
- MIT
- 最近更新
- 2026-09-28
- Stars
- ★ 1
- Forks
- 2
01 前言 Front Matter
- name
- author-ambient-trigger
- inputs
- [ "brief.function (so codegen knows which file to append to)" ]
- outputs
- [ "brief.ambient (optional)", "<sandbox>/api/server/services/ambient_agents/<function>.py (append-or-create)" ]
- audience
- design-time-only
- description
- v4 sub-skill #5 (optional). Adds the `ambient:` block — declares an AmbientAgent that watches the bus / graph / clock and spawns workflows of the listed types. Skipped when the operator answers "no" to "does this domain need an ambient hook?".
- hands_off_to
- existing v3 generators
- forbidden-runtime
- true
02 资源文件 3
- 脚本__init__.py—
- 脚本codegen.py3.8 KB
- 脚本validator.py4.4 KB
03 SKILL.md 正文
author-ambient-trigger
Most domains need no ambient hook (the workflow is operator-driven end-to-end). When one is needed, declare it as a single block:
ambient:
name: <PascalCase> # e.g. VendorRiskWatcher
function: <one of the 10 keys> # which file to land in
reasoning_skill: <kebab> # optional GHCP skill, null = deterministic
spawnable_workflow_types: [<wt>, ...] # workflows this watcher may spawn
triggers: # ≥ 1 of: bus | cypher | cadence
- kind: bus
event_type: <FleetEvent type>
filter: <Cypher-like predicate>
- kind: cypher
pattern: "(node:Type {prop:value})"
sweep_seconds: 3600
- kind: cadence
cron: "0 0 * * *"
Procedure
- Ask the operator: "does this domain need an ambient hook?".
- If no → write nothing, return cleanly. Pipeline continues.
- If yes → propose the
ambient:block and write it to the brief. - Run
validator.py:validate(brief). STOP onSchemaError. - Render with
codegen.render_ambient(brief)→(file_path, append_block). File path isapi/server/services/ambient_agents/<function>.py. - The codegen wraps the constructor in a sentinel block
# compose-domain:ambient:<workflow_type>sograduate.shappends idempotently. - The constructor is guarded by
if hasattr(_module, "AmbientAgent")so the file is import-clean before Phase 3 lands theAmbientAgentprimitive.
Constraints
ambient.functionmust equalbrief.function(same registry ownership). Validator enforces.- Every entry in
spawnable_workflow_typesmust be present in the liveapi.shared.domains.DOMAINSregistry OR be the brief's owndomain.workflow_type(forward-declaration of self-spawning). - Triggers form a discriminated union: each entry sets exactly one
of
bus | cypher | cadenceand supplies the kind-specific keys.
04 同仓库更多 Skills
proactive-customer-care
Proactively notifies and, where warranted, extends a small bounded goodwill gesture to a customer whose itinerary materially changed.
payment-exception
Resolves a failed balance payment by retrying it to complete the booking, or releasing the booking's inventory when retry is not viable.
hotel-supplier-recovery
Restores accommodation for a shortfall-hit hotel allotment by moving contracted rooms from a donor allotment with headroom, resolving the reported supplier shortfall.
holiday-sales-booking
暂无简介
flight-disruption-recovery
暂无简介
destination-operations
Dispatches a replacement resort transfer when an arrival is at risk, rebinding any travellers on the at-risk transfer to the replacement.