* feat(preset): declare Agent compositions in profile YAML * fix(preset): share scope binding cleanup and refresh module graph * fix(preset): use host syntax colors in the YAML editor * fix(preset): write new profile declarations as block YAML * fix(preset): align eager activation with browser and worker surfaces * fix(ui-agent-preset): retain the existing preset card layout * fix(preset): keep rows waiting for a Host service mounted and re-audit after settlement A preset row whose Host provider was still activating at declaration time was reported as waiting for a missing service, and the registry recorded the definition as broken for the rest of the process. Split the mount audit into failed and pending rows: failures and root-realm leaks still reject the mount, while pending rows stay mounted and every read and binding re-audits them after the Host Loader tree settles. Remove the accidental self-dependency of @deepseek-ai/dsh-web-app and its lockfile self-link. Archive the copy-only preset authoring note, which the declarative-preset note fully supersedes, and update the ralph note's restore recipe to the profile-patch mechanism. * chore(lint): re-key and prune the unknown-cast baseline after the master merge * refactor(web-app): ship each Agent preset as its own bundle patch file `dsh.bundle.patch` accepts an ordered file list, so the four shipped preset declarations move out of the 1000-line web patch into `presets/<id>.patch.yml`, one insert per file, applied after the host patch. The host patch keeps the preset registry row. Gates and test scaffolds that read the web layer resolve every patch file through `bundlePatchPaths` instead of one hardcoded path. * refactor(preset): drop the save notice injected into live Agents The notice duplicated the save result the Web editor already shows, and after the producer-owned message sources it would have needed its own persisted source kind. Saving now only persists and reports the activation diagnostic; the persistence catalog is unchanged from master. * docs: regenerate the module graph after dropping the registry's llm dependency * test(ui-agent-preset): cover the guide dialog's keyboard handling on the declarative section * fix(preset): address the remaining review comments Apply the lowercase id rule only when creating a declaration, so presets declared with other ids stay editable. Export `isBuiltInPreset` from the display fold and key the client card groups on it. Remove the dead `error` and `retry` locale keys, the JSDoc orphaned by the `trust` removal, the `trust` fields in the plugin-inventory test fixtures, and the stale `dsh-agent-presets` package name in comments and READMEs. * refactor(preset): make the Web preset page view-and-select only Remove the child-plugin YAML editor, the `agent_preset` tool and the registry's read/save Remote methods. Presets are declared and changed only by bundle patches; the settings page keeps the roster, the new-task default and the mode help, and its question icon explains that and offers to start a Creator-mode task. The `editing-cordis-compositions` skill and the Creator persona describe the bundle-based path, and the authored skill-load Session and Web snapshots are refreshed for it. * docs(skill): make the composition skill self-sufficient for preset authoring State where the shipped declarations live, list every declaration field, inline a complete minimal bundle and an override example, and name the verification calls, so Creator mode no longer reads DSH package sources to infer the format. Refresh the authored skill-load Session for the new text. * test(tools): drop the removed agent_preset tool from the catalog expectation
description, kind
| description | kind |
|---|---|
| Webhook rule runtime for maintainers registering trusted external-event policies that create Workspace Sessions. | package-reference |
@deepseek-ai/dsh-webhook
English | 中文
Summary
dsh-webhook provides the Host ctx.webhookRuntime: a registry for trusted programmatic webhook rules plus the one built-in action, creating an ordinary root Session inside a Web Workspace. The interface stays at register(rule) and dispatch(delivery); provider authentication belongs to adapter packages. Use it when a trusted rule must turn an external event into a new agent Session.
Table of Contents
- Rule interface
- Session request
- Composition
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Rule interface
WebhookRule<K> has a branded unique id, a provider kind, and run(delivery, signal). A callback may execute arbitrary trusted code and returns either null or one WebhookSessionRequest. Rules of the same kind start independently, and one throw or rejection is logged without starving siblings.
VerifiedWebhookDelivery carries provider kind, configured source id, provider delivery id, normalized lossless JSON, and receipt time. The runtime snapshots and freezes the complete value before sharing it. deliveryId records the provider's identifier only; repeated delivery runs the rules again.
Registration is an effect. Its awaitable disposer first hides the rule, then aborts and drains active callbacks. Callbacks must observe the supplied signal; same-process code that ignores cancellation cannot be forcibly stopped safely.
Session request
WebhookSessionRequest requires workspacePath, title, prompt, agentPreset, and permissionPreset; optional model names an explicit provider/model route plus an output-token cap. An explicit route uses its adapter's reasoning default. Omission snapshots the complete current deployment selection, including reasoning effort, until the first request records its durable header; later Web model changes retain the ordinary session behavior.
The runtime validates presets before mutation, resolves or creates the canonical Workspace, creates an Agent with that Workspace path as SessionHeader.cwd, mounts the agent preset before publication, and attaches the Session before applying permissions, title, and prompt. Failed attachment disposes the unpublished action. A later pre-prompt failure detaches the Workspace and disposes the Agent on a best-effort rollback.
Successful Agent.followup() is the webhook operation's commit point. The message uses source.kind: "webhook" and records the provider, source, delivery, and rule identifiers. The runtime does not wait for idle, flush specially, inspect the reply, or publish completion state; ordinary Agent and Session behavior owns everything afterward.
Composition
Load the runtime on the Web Host plane after Agents, model defaults, agent presets, permission presets, titles, and the Workspace registry. User-authored rule plugins inject webhookRuntime and yield the disposer returned by register() through their own effect.
The GitHub review guide shows a rule module, dedicated ingress port, secret setup, and Workspace routing.
Model Experience
Rule-authored initial prompt
What the model sees
For each matching rule, the model sees exactly the non-empty text returned as WebhookSessionRequest.prompt. The generic runtime adds no private framing; a rule incorporating external text owns its trust labeling. The shipped GitHub example labels selected PR fields as untrusted JSON metadata.
Token effect
One data-dependent user-role message is retained in the new Session and contributes tokens until ordinary compaction replaces or removes that history.
KV Cache effect
The initial prompt begins a new Session, so it establishes rather than invalidates that Session's reusable request prefix.
Known Limitations and Deferred Work
- Process-local fire-and-forget only — a crash loses rule calls that have not admitted a prompt; there is no queue, replay, or retry.
- No built-in deduplication — repeated provider deliveries may create repeated Sessions; rules that need idempotency own it.
- No completion result — HTTP acceptance and rule settlement do not report Agent success, idle, or output.
- Trusted callbacks must cooperate with cancellation — runtime teardown aborts and awaits them but cannot terminate arbitrary same-process code.
- Workspace creation may outlive a failed Session attempt — an empty Workspace is retained because another concurrent caller may already use it.
Dev Note
Working context for maintainers — click to expand
None.