From 2450fd4e7379cad5e242226f08b422dae7983874 Mon Sep 17 00:00:00 2001 From: helix-nine <267227783+helix-nine@users.noreply.github.com> Date: Fri, 12 Jun 2026 12:03:59 +0000 Subject: [PATCH] docs: input-not-matches task input split into accept/set Match the SDK 2.0 TaskInput shape: `{ kind: 'partial', accept: [...], set: ... }` replaces the single `value`. Updates the tasks, dependencies, and enforce-dependency recipe pages. --- packaging/src/dependencies.md | 5 +++-- packaging/src/recipe-enforce-dependency.md | 2 +- packaging/src/tasks.md | 9 ++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packaging/src/dependencies.md b/packaging/src/dependencies.md index a286ebd..6fe8bf0 100644 --- a/packaging/src/dependencies.md +++ b/packaging/src/dependencies.md @@ -63,7 +63,8 @@ export const setDependencies = sdk.setupDependencies(async ({ effects }) => { await sdk.action.createTask(effects, 'dependency-id', someAction, 'critical', { input: { kind: 'partial', - value: { /* fields matching the action's input spec */ }, + accept: [{ /* one or more acceptable partial inputs */ }], + set: { /* the value to pre-fill when none are accepted */ }, }, when: { condition: 'input-not-matches', once: false }, reason: i18n('Human-readable reason shown to user'), @@ -88,7 +89,7 @@ sdk.action.createTask( action: ActionDefinition, // imported from the dependency package severity: 'critical' | 'high' | 'medium' | 'low', options?: { - input?: { kind: 'partial', value: Partial }, + input?: { kind: 'partial', accept: Partial[], set: Partial }, when?: { condition: 'input-not-matches', once: boolean }, reason: string, replayId?: string, // prevents duplicate task execution diff --git a/packaging/src/recipe-enforce-dependency.md b/packaging/src/recipe-enforce-dependency.md index a43c550..4cfc03e 100644 --- a/packaging/src/recipe-enforce-dependency.md +++ b/packaging/src/recipe-enforce-dependency.md @@ -4,7 +4,7 @@ Sometimes your service requires specific configuration on a dependency — Bitco ## Solution -In `setupDependencies()`, call `sdk.action.createTask()` targeting the dependency's autoconfig action (imported from the dependency's package). Pass `input: { kind: 'partial', value: { ... } }` with the required field values, and `when: { condition: 'input-not-matches', once: false }` so the task re-fires whenever the dependency's config drifts. The autoconfig action must be exported by the dependency and added to your `package.json` dependencies. +In `setupDependencies()`, call `sdk.action.createTask()` targeting the dependency's autoconfig action (imported from the dependency's package). Pass `input: { kind: 'partial', accept: [{ ... }], set: { ... } }` — `accept` lists the partial inputs that satisfy the task and `set` is pre-filled when none match — and `when: { condition: 'input-not-matches', once: false }` so the task re-fires whenever the dependency's config drifts. The autoconfig action must be exported by the dependency and added to your `package.json` dependencies. **Reference:** [Dependencies](dependencies.md) · [Tasks](tasks.md) diff --git a/packaging/src/tasks.md b/packaging/src/tasks.md index fb75167..39d84c3 100644 --- a/packaging/src/tasks.md +++ b/packaging/src/tasks.md @@ -68,7 +68,8 @@ export const setDependencies = sdk.setupDependencies(async ({ effects }) => { await sdk.action.createTask(effects, 'dependency-id', someAction, 'critical', { input: { kind: 'partial', - value: { /* fields matching the action's input spec */ }, + accept: [{ /* one or more acceptable partial inputs */ }], + set: { /* the value to pre-fill when none are accepted */ }, }, when: { condition: 'input-not-matches', once: false }, reason: i18n('Configure the dependency for use with this service'), @@ -98,11 +99,13 @@ export const setDependencies = sdk.setupDependencies(async ({ effects }) => { | Field | Type | Description | | ---------- | ----------------------------------------------------- | ---------------------------------------------------------------- | -| `input` | `{ kind: 'partial', value: Partial }` | Pre-fill fields in the action's input form | -| `when` | `{ condition: 'input-not-matches', once: boolean }` | Re-trigger until the action's input matches the provided values | +| `input` | `{ kind: 'partial', accept: Partial[], set: Partial }` | `accept` lists the partial inputs that satisfy the task; `set` pre-fills the action's input form when none of them match | +| `when` | `{ condition: 'input-not-matches', once: boolean }` | Re-trigger until the action's input matches one of the `accept` values | | `reason` | `string` | Human-readable explanation shown to the user | | `replayId` | `string` (optional) | Overrides the default idempotency key (see below) | +With `condition: 'input-not-matches'`, the task is **satisfied** when the action's current input is a superset of **any** entry in `accept` (each entry is matched partially — only the fields you list must agree). When none match, the task is shown and the action form is pre-filled with `set`. Use multiple `accept` entries to tolerate several already-good configurations while still steering the user to one recommended value; for the common case where any value but one specific target is unacceptable, pass a single `accept` entry equal to `set`. + > [!NOTE] > The dependency must be listed in your `package.json` so the action can be imported (e.g., `"synapse-startos": "file:../synapse-wrapper"`). See [Dependencies](./dependencies.md) for more on cross-service integration.