@spellkave/tool-contracts 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE +89 -0
  2. package/package.json +48 -4
  3. package/src/admission.ts +62 -0
  4. package/src/authoring-schemas.ts +3491 -0
  5. package/src/authoring-tool-names.ts +46 -0
  6. package/src/contract-data.ts +37 -0
  7. package/src/contract-guard.ts +377 -0
  8. package/src/contracts-metadata.json +6940 -0
  9. package/src/docs-metadata.ts +42 -0
  10. package/src/exploration.ts +248 -0
  11. package/src/git-batch.ts +36 -0
  12. package/src/grant-schemas.ts +38 -0
  13. package/src/index.ts +10 -0
  14. package/src/metadata.ts +48 -0
  15. package/src/owner-instance-read.ts +123 -0
  16. package/src/personas.generated.json +47 -0
  17. package/src/personas.ts +19 -0
  18. package/src/roster.ts +13 -0
  19. package/src/scene-schemas.ts +29 -0
  20. package/src/schema-registry.ts +197 -0
  21. package/src/schemas.ts +786 -0
  22. package/src/snapshot-storage.ts +133 -0
  23. package/src/tool-contracts.breaking-acknowledged.json +392 -0
  24. package/src/tool-contracts.snapshot/index.json +104 -0
  25. package/src/tool-contracts.snapshot/rosters/AUTHOR.json +54 -0
  26. package/src/tool-contracts.snapshot/rosters/DM.json +19 -0
  27. package/src/tool-contracts.snapshot/rosters/PLAYER.json +25 -0
  28. package/src/tool-contracts.snapshot/tools/spellkave_acting_context.json +35 -0
  29. package/src/tool-contracts.snapshot/tools/spellkave_actor_principals.json +23 -0
  30. package/src/tool-contracts.snapshot/tools/spellkave_annotate_place.json +82 -0
  31. package/src/tool-contracts.snapshot/tools/spellkave_apply_manifest_delta.json +66 -0
  32. package/src/tool-contracts.snapshot/tools/spellkave_applyset_apply.json +131 -0
  33. package/src/tool-contracts.snapshot/tools/spellkave_applyset_diff.json +122 -0
  34. package/src/tool-contracts.snapshot/tools/spellkave_attach_map_layer.json +114 -0
  35. package/src/tool-contracts.snapshot/tools/spellkave_author_place.json +132 -0
  36. package/src/tool-contracts.snapshot/tools/spellkave_bind_actor.json +79 -0
  37. package/src/tool-contracts.snapshot/tools/spellkave_bind_edge_affordance.json +69 -0
  38. package/src/tool-contracts.snapshot/tools/spellkave_can_i.json +123 -0
  39. package/src/tool-contracts.snapshot/tools/spellkave_communicate.json +44 -0
  40. package/src/tool-contracts.snapshot/tools/spellkave_declare_inexpressible.json +33 -0
  41. package/src/tool-contracts.snapshot/tools/spellkave_define_action.json +133 -0
  42. package/src/tool-contracts.snapshot/tools/spellkave_define_action_verb.json +215 -0
  43. package/src/tool-contracts.snapshot/tools/spellkave_define_affordance.json +69 -0
  44. package/src/tool-contracts.snapshot/tools/spellkave_define_behavior.json +505 -0
  45. package/src/tool-contracts.snapshot/tools/spellkave_define_bundle.json +67 -0
  46. package/src/tool-contracts.snapshot/tools/spellkave_define_capability.json +64 -0
  47. package/src/tool-contracts.snapshot/tools/spellkave_define_condition.json +244 -0
  48. package/src/tool-contracts.snapshot/tools/spellkave_define_consequence.json +65 -0
  49. package/src/tool-contracts.snapshot/tools/spellkave_define_entity_type.json +199 -0
  50. package/src/tool-contracts.snapshot/tools/spellkave_define_niche.json +88 -0
  51. package/src/tool-contracts.snapshot/tools/spellkave_define_resource.json +93 -0
  52. package/src/tool-contracts.snapshot/tools/spellkave_define_roll_table.json +87 -0
  53. package/src/tool-contracts.snapshot/tools/spellkave_define_session.json +115 -0
  54. package/src/tool-contracts.snapshot/tools/spellkave_define_trace_kind.json +71 -0
  55. package/src/tool-contracts.snapshot/tools/spellkave_describe.json +73 -0
  56. package/src/tool-contracts.snapshot/tools/spellkave_diff.json +90 -0
  57. package/src/tool-contracts.snapshot/tools/spellkave_docs.json +104 -0
  58. package/src/tool-contracts.snapshot/tools/spellkave_end_turn.json +21 -0
  59. package/src/tool-contracts.snapshot/tools/spellkave_entity.json +32 -0
  60. package/src/tool-contracts.snapshot/tools/spellkave_entity_body.json +32 -0
  61. package/src/tool-contracts.snapshot/tools/spellkave_entity_container.json +32 -0
  62. package/src/tool-contracts.snapshot/tools/spellkave_equip_item.json +49 -0
  63. package/src/tool-contracts.snapshot/tools/spellkave_eval.json +87 -0
  64. package/src/tool-contracts.snapshot/tools/spellkave_events.json +30 -0
  65. package/src/tool-contracts.snapshot/tools/spellkave_explain.json +83 -0
  66. package/src/tool-contracts.snapshot/tools/spellkave_export.json +66 -0
  67. package/src/tool-contracts.snapshot/tools/spellkave_export_grants.json +50 -0
  68. package/src/tool-contracts.snapshot/tools/spellkave_get.json +87 -0
  69. package/src/tool-contracts.snapshot/tools/spellkave_grant_role.json +80 -0
  70. package/src/tool-contracts.snapshot/tools/spellkave_hand_over_role.json +89 -0
  71. package/src/tool-contracts.snapshot/tools/spellkave_intervention_windows.json +32 -0
  72. package/src/tool-contracts.snapshot/tools/spellkave_inventory.json +40 -0
  73. package/src/tool-contracts.snapshot/tools/spellkave_item_detail.json +37 -0
  74. package/src/tool-contracts.snapshot/tools/spellkave_link_places.json +84 -0
  75. package/src/tool-contracts.snapshot/tools/spellkave_list_grants.json +56 -0
  76. package/src/tool-contracts.snapshot/tools/spellkave_manipulate.json +84 -0
  77. package/src/tool-contracts.snapshot/tools/spellkave_manipulation_context.json +62 -0
  78. package/src/tool-contracts.snapshot/tools/spellkave_map.json +109 -0
  79. package/src/tool-contracts.snapshot/tools/spellkave_map_graph.json +143 -0
  80. package/src/tool-contracts.snapshot/tools/spellkave_move.json +75 -0
  81. package/src/tool-contracts.snapshot/tools/spellkave_note_doc_gap.json +43 -0
  82. package/src/tool-contracts.snapshot/tools/spellkave_observer_knowledge.json +32 -0
  83. package/src/tool-contracts.snapshot/tools/spellkave_observer_place_knowledge.json +32 -0
  84. package/src/tool-contracts.snapshot/tools/spellkave_observer_trace_knowledge.json +32 -0
  85. package/src/tool-contracts.snapshot/tools/spellkave_offer_control.json +30 -0
  86. package/src/tool-contracts.snapshot/tools/spellkave_orient.json +39 -0
  87. package/src/tool-contracts.snapshot/tools/spellkave_pace_time.json +59 -0
  88. package/src/tool-contracts.snapshot/tools/spellkave_place_actor.json +190 -0
  89. package/src/tool-contracts.snapshot/tools/spellkave_place_entity.json +190 -0
  90. package/src/tool-contracts.snapshot/tools/spellkave_prepare_hand_over.json +57 -0
  91. package/src/tool-contracts.snapshot/tools/spellkave_query.json +290 -0
  92. package/src/tool-contracts.snapshot/tools/spellkave_react_option.json +47 -0
  93. package/src/tool-contracts.snapshot/tools/spellkave_reaction_options.json +32 -0
  94. package/src/tool-contracts.snapshot/tools/spellkave_release_claim.json +32 -0
  95. package/src/tool-contracts.snapshot/tools/spellkave_remove_entity.json +39 -0
  96. package/src/tool-contracts.snapshot/tools/spellkave_render_scene.json +59 -0
  97. package/src/tool-contracts.snapshot/tools/spellkave_return_npc_control.json +59 -0
  98. package/src/tool-contracts.snapshot/tools/spellkave_revoke_role.json +55 -0
  99. package/src/tool-contracts.snapshot/tools/spellkave_scene.json +74 -0
  100. package/src/tool-contracts.snapshot/tools/spellkave_scene_detail.json +37 -0
  101. package/src/tool-contracts.snapshot/tools/spellkave_self_states.json +77 -0
  102. package/src/tool-contracts.snapshot/tools/spellkave_self_summary.json +21 -0
  103. package/src/tool-contracts.snapshot/tools/spellkave_sense.json +68 -0
  104. package/src/tool-contracts.snapshot/tools/spellkave_sense_context.json +28 -0
  105. package/src/tool-contracts.snapshot/tools/spellkave_session_close.json +71 -0
  106. package/src/tool-contracts.snapshot/tools/spellkave_session_move.json +38 -0
  107. package/src/tool-contracts.snapshot/tools/spellkave_session_open.json +36 -0
  108. package/src/tool-contracts.snapshot/tools/spellkave_session_status.json +41 -0
  109. package/src/tool-contracts.snapshot/tools/spellkave_set_metadata.json +205 -0
  110. package/src/tool-contracts.snapshot/tools/spellkave_set_movement_default.json +58 -0
  111. package/src/tool-contracts.snapshot/tools/spellkave_stage_scene.json +55 -0
  112. package/src/tool-contracts.snapshot/tools/spellkave_status.json +23 -0
  113. package/src/tool-contracts.snapshot/tools/spellkave_stow_item.json +55 -0
  114. package/src/tool-contracts.snapshot/tools/spellkave_suggest_next_action.json +32 -0
  115. package/src/tool-contracts.snapshot/tools/spellkave_tag_entity.json +61 -0
  116. package/src/tool-contracts.snapshot/tools/spellkave_take_npc_control.json +64 -0
  117. package/src/tool-contracts.snapshot/tools/spellkave_trace_detail.json +36 -0
  118. package/src/tool-contracts.snapshot/tools/spellkave_traces.json +55 -0
  119. package/src/tool-contracts.snapshot/tools/spellkave_wake_up.json +23 -0
  120. package/src/tool-contracts.snapshot/tools/spellkave_withdraw_control.json +30 -0
  121. package/src/tool-contracts.snapshot/tools/spellkave_write_rows.json +62 -0
  122. package/README.md +0 -3
@@ -0,0 +1,215 @@
1
+ {
2
+ "name": "spellkave_define_action_verb",
3
+ "label": "Define Action Verb (verb)",
4
+ "description": "Author ONE action-verb chain — action_definitions + outcome_templates + affordance_templates + consequence_templates (+ optional consequence_frame_writes) — in a single call, with NO actor grant (contrast spellkave_define_behavior, which always binds its generated cluster to a `grant_to` caster). The composite fold for the action/affordance/outcome/consequence chain (executable finding #40): `required_capability`/`niche_id` must already resolve (workspace, live, or the active target) — this verb never auto-creates either (use spellkave_define_capability first; `niche_id` needs no niche_definitions row at all for the two common synthetic-niche shapes, see this verb's own file-header note). Omit `consequence.frame_writes` entirely for MF-VAL-222's own no-op consequence shape. Self-scaffolds the [[bundles]] header if `bundle` has none yet. #1968 workspace idempotency: re-authoring the SAME bundle+id REPLACES all four rows + every satellite wholesale.",
5
+ "parameters": {
6
+ "type": "object",
7
+ "required": [
8
+ "id",
9
+ "niche_id"
10
+ ],
11
+ "properties": {
12
+ "bundle": {
13
+ "type": "string",
14
+ "description": "bundle_id stamped on every generated row. Omit to fall back to `context.defaultBundle` (#1968 smart default)."
15
+ },
16
+ "id": {
17
+ "type": "string",
18
+ "description": "Local id stem every derived id qualifies against '<bundle>/<id>': action_id itself, plus '<action_id>/outcome' (outcome_templates), '<action_id>/affordance' (affordance_templates), and '<action_id>/success' (consequence_templates, also `action_definitions.on_success`) — matches both grounding call sites' own naming convention verbatim, never a caller override."
19
+ },
20
+ "required_capability": {
21
+ "type": "string",
22
+ "description": "An ALREADY-authored capability_definitions id (workspace, live, or the active target, e.g. via spellkave_define_capability) this call never creates — reused for BOTH action_definitions.required_capability AND affordance_templates.capability_id (this verb's own grounding call sites always use the SAME id in both places), UNLESS `affordance_capability_id` overrides the affordance half (see that param). sk-9ll.6: omit (or pass '') for an UNGATED verb — some authored chains (e.g. an always-hit attack with no gating capability at all) need no capability row, matching the schema's own empty-string default; an empty value is never existence-checked — only a non-empty value still requires a matching capability_definitions row."
23
+ },
24
+ "affordance_capability_id": {
25
+ "type": "string",
26
+ "description": "actor-carried-verbs D6: overrides affordance_templates.capability_id independently of action_definitions.required_capability — for the creature-carried-statblock shape, where the ACTION stays keyed on a shared discriminator (e.g. 'srd/action/attack', an initiative-watch read site) while the AFFORDANCE's actual admission gate is a per-creature capability (e.g. 'srd/creature/black-bear/action') granted only to that creature. An ALREADY-authored capability_definitions id (workspace, live, or the active target) this call never creates — same existence-check posture as `required_capability` (a non-empty value is checked; '' is not). Omit for the verb's original single-id posture (default: `required_capability`'s own value)."
27
+ },
28
+ "niche_id": {
29
+ "type": "string",
30
+ "description": "affordance_templates.niche_id. NOT existence-checked against niche_definitions (see this verb's own file-header note) — a bare entity_definition_tag value (e.g. 'creature') or the 'capability:<capability_id>' synthetic-niche convention are both LEGAL here despite authoring no niche_definitions row of their own, but a bare entity_definition_tag with no niche_definitions row resolves to the 'place' provider's fail-closed default (requires_spatial_attachment: true) and REJECTS every dispatch with attachment_presence — an actor-carried tag has no place attachment to satisfy it. Pair the tag with an explicit spellkave_write_rows niche_definitions row (provider = 'entity') whenever the niche is entity-provided, not place-attached. An authored niche_definitions id (via spellkave_define_niche) works too."
31
+ },
32
+ "display_name": {
33
+ "type": "string",
34
+ "description": "Overrides the derived title-cased `id` for the action/outcome/affordance rows alike (mirrors spellkave_define_affordance's own shared display_name). Omit for the smart default (#1968)."
35
+ },
36
+ "description": {
37
+ "type": "string",
38
+ "description": "action_definitions.description (#1968 first-class column)."
39
+ },
40
+ "predicate_source": {
41
+ "type": "string",
42
+ "description": "affordance_templates.predicate_source — the deterministic ELIGIBILITY gate for whether this affordance offers. A stochastic comparison here (e.g. 'd20 >= 13') is treated as satisfied at materialise time and never gates offer (#1891) — use this verb's own resolution_predicate_source (with resolution_mode = 'Stochastic') for dice instead. Omit for an ungated trigger (predicate_bool = true) — mirrors spellkave_define_affordance's identical omit-for-ungated convention."
43
+ },
44
+ "range_m": {
45
+ "type": "number",
46
+ "description": "affordance_templates.range_m (ADR-0053 metric embedding). Default 0."
47
+ },
48
+ "accepts_global_storm": {
49
+ "type": "boolean",
50
+ "description": "affordance_templates.accepts_global_storm — modder opt-in acknowledging this template's predicate classifies as Global. Default false."
51
+ },
52
+ "cost_time_ms": {
53
+ "type": "number",
54
+ "description": "action_definitions.cost_time_ms in fiction milliseconds. With spends_channel, omit or set 0 to spend one full channel pool; without a channel, 0 is unmetered."
55
+ },
56
+ "on_failure": {
57
+ "type": "string",
58
+ "description": "action_definitions.on_failure — the consequence_templates id applied on failure. Omit for none (schema default: empty string) — this verb only ever AUTHORS the on_success consequence, never an on_failure one (neither grounding call site needs one; author it separately, e.g. via spellkave_define_consequence, if wanted)."
59
+ },
60
+ "outcome_expression_source": {
61
+ "type": "string",
62
+ "description": "outcome_templates.outcome_expression_source (playable-fighter-l1-20 D-1) — e.g. \"invoke_outcome_graph('<bundle>/<id>/graph')\" to ALSO fire a pre-authored outcome graph, in addition to this action's own `consequence` (independent, sequential — the action runs first, followed by the expression in the same binding context). Every prior corpus example (`srd/acid_arrow`, `srd/outcome_guard_state_branch`) sets this INSTEAD of `consequence` (an empty-consequence, graph-only action) — setting BOTH on this verb's own generated outcome row is new with this field, structurally supported (no validator or runtime exclusivity found), used to bolt a defeat-consequence (e.g. an XP credit) onto an action whose own damage/ condition writes are unchanged. Omit for '' (schema default) — today's byte-identical behavior."
63
+ },
64
+ "resolution_mode": {
65
+ "anyOf": [
66
+ {
67
+ "type": "string",
68
+ "const": "Deterministic"
69
+ },
70
+ {
71
+ "type": "string",
72
+ "const": "Stochastic"
73
+ },
74
+ {
75
+ "type": "string",
76
+ "const": "Deferred"
77
+ }
78
+ ],
79
+ "description": "action_definitions.resolution_mode. Omit for the schema default ('Deterministic')."
80
+ },
81
+ "resolution_predicate_source": {
82
+ "type": "string",
83
+ "description": "action_definitions.resolution_predicate_source — authored boolean DSL for Stochastic resolution. Omit for empty (Deterministic/Deferred)."
84
+ },
85
+ "resolution_scope": {
86
+ "type": "string",
87
+ "description": "action_definitions.resolution_scope — open authored id selecting scoped actor-side roll modifiers. Omit for no narrow scope."
88
+ },
89
+ "non_steering": {
90
+ "type": "boolean",
91
+ "description": "Explicit author assertion that target effects are cooperative/non-steering and need no target claim. Omit/false for conservative automatic classification; marking a hostile effect true is a content bug."
92
+ },
93
+ "session_def_id": {
94
+ "type": "string",
95
+ "description": "action_definitions.session_def_id. Omit for the schema default (empty string)."
96
+ },
97
+ "self_eligible": {
98
+ "type": "boolean",
99
+ "description": "action_definitions.self_eligible. Omit for the schema default (false)."
100
+ },
101
+ "self_only": {
102
+ "type": "boolean",
103
+ "description": "action_definitions.self_only (ADR-0075). Omit for the schema default (false)."
104
+ },
105
+ "spends_channel": {
106
+ "type": "string",
107
+ "description": "action_definitions.spends_channel — an open FK into economy_channel_definitions.id (action-economy budgeting). Omit for unmetered (schema default: absent)."
108
+ },
109
+ "reaction_eligibility": {
110
+ "type": "string",
111
+ "description": "action_definitions.reaction_eligibility — a DSL predicate over a candidate reactor (§8.4 WHO axis). Omit for not-a-reaction-candidate (schema default: absent)."
112
+ },
113
+ "reaction_window_ms": {
114
+ "type": "number",
115
+ "description": "action_definitions.reaction_window_ms. Omit for an implementation default when `reaction_eligibility` is set."
116
+ },
117
+ "reaction_trigger": {
118
+ "type": "string",
119
+ "description": "action_definitions.reaction_trigger — a DSL predicate over the triggering event (§8.4 WHAT axis). Omit to provoke on every co-located trigger (schema default: absent)."
120
+ },
121
+ "tags": {
122
+ "type": "array",
123
+ "items": {
124
+ "type": "string"
125
+ },
126
+ "description": "One action_definition_tag row per tag."
127
+ },
128
+ "consequence": {
129
+ "type": "object",
130
+ "properties": {
131
+ "effect_ref": {
132
+ "type": "string",
133
+ "description": "consequence_templates.effect_refs_csv — an already-authored effect_definitions id this consequence invokes. Omit for a consequence with no effect_definitions reference (the common case for a check-shaped action)."
134
+ },
135
+ "description": {
136
+ "type": "string",
137
+ "description": "consequence_templates.description (#1968 first-class column)."
138
+ },
139
+ "frame_writes": {
140
+ "type": "array",
141
+ "items": {
142
+ "anyOf": [
143
+ {
144
+ "type": "object",
145
+ "patternProperties": {
146
+ "^.*$": {}
147
+ }
148
+ },
149
+ {
150
+ "type": "string",
151
+ "const": "BreakPlaceSeal"
152
+ }
153
+ ]
154
+ },
155
+ "description": "consequence_frame_writes rows, in AUTHORED order — each a raw FrameWriteOp body object or the unit string BreakPlaceSeal, mirroring spellkave_define_consequence's own `frame_writes` param verbatim. Omit entirely for MF-VAL-222's own documented no-op shape: a manipulation-dispatchable action needs a non-empty `on_success`, and a consequence_templates row with NO frame_writes at all is the validator-sanctioned way to satisfy that with no actual effect (both this verb's grounding call sites use exactly this shape for most of their generated checks)."
156
+ }
157
+ }
158
+ },
159
+ "outcome_id_suffix": {
160
+ "type": "string",
161
+ "description": "sk-9ll.6: the local suffix qualifying the generated outcome_templates id as '<action_id>/<outcome_id_suffix>' (also `affordance_templates.outcome_template_id`). Omit for the legacy default 'outcome'. Raw write_rows chains this verb is meant to fold use several different suffixes here (e.g. 'hit') — set this to match an existing convention instead of falling back to spellkave_write_rows."
162
+ },
163
+ "consequence_id_suffix": {
164
+ "type": "string",
165
+ "description": "sk-9ll.6: the local suffix qualifying the generated consequence_templates id (and `action_definitions.on_success`) as '<action_id>/<consequence_id_suffix>'. Omit for the legacy default 'success'. Raw write_rows chains this verb is meant to fold use several different suffixes here (e.g. 'consequence') — set this to match an existing convention instead of falling back to spellkave_write_rows."
166
+ },
167
+ "spends_channel_placement": {
168
+ "anyOf": [
169
+ {
170
+ "type": "string",
171
+ "const": "affordance"
172
+ },
173
+ {
174
+ "type": "string",
175
+ "const": "action"
176
+ },
177
+ {
178
+ "type": "string",
179
+ "const": "both"
180
+ }
181
+ ],
182
+ "description": "sk-9ll.6: where a set `spends_channel` value is written. Default 'both' (this verb's original mirrored behavior) — the server reads `spends_channel` off BOTH rows for DIFFERENT purposes: an on-turn action reads the resolved affordance template, while an off-turn reaction uses the originating action definition. A reaction action with no action-row spends_channel is UNMETERED (free). Pass 'affordance' to write it only on affordance_templates (a non-reaction, on-turn-only verb where the action-row copy is genuinely dead), or 'action' to write it only on action_definitions. Ignored when `spends_channel` itself is omitted."
183
+ },
184
+ "composes": {
185
+ "type": "array",
186
+ "items": {
187
+ "type": "string"
188
+ },
189
+ "description": "sk-9ll.6: affordance_templates.composes — child affordance_template ids this template unrolls into on a successful manipulate (the action-composition slice, `r_manipulate`'s own composition unroll). Pass-through, verbatim, in AUTHORED order. Omit for the schema default (no composition, this verb's own consequence fires alone)."
190
+ },
191
+ "communication_speech_act_id": {
192
+ "type": "string",
193
+ "description": "sk-9ll.6: outcome_templates.communication_speech_act_id — when set, the generated outcome surfaces as a communication speech act (mirrors spellkave_define_behavior's own identical pass-through) while r_manipulate still EXECUTES the gated consequence normally. Omit for the legacy default: no speech-act framing."
194
+ }
195
+ }
196
+ },
197
+ "executionMode": "sequential",
198
+ "roles": [
199
+ "AUTHOR"
200
+ ],
201
+ "admission": {
202
+ "anyOf": [
203
+ {
204
+ "kind": "all",
205
+ "capabilities": [
206
+ "frontier.apply_manifest"
207
+ ]
208
+ },
209
+ {
210
+ "kind": "publisher"
211
+ }
212
+ ],
213
+ "ports": []
214
+ }
215
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "spellkave_define_affordance",
3
+ "label": "Define Affordance (verb)",
4
+ "description": "#1968 verb-UX round 6: author ONE niche-triggered ENVIRONMENTAL affordance — an outcome_templates row + an affordance_templates row referencing an ALREADY-authored `niche_id`/`capability_id` — in a single call, with NO actor grant (contrast spellkave_define_behavior, which always binds a capability to a `grant_to` caster). The US5-7 live-dungeon pressure-plate trap shape: 'any actor holding an existing capability (e.g. core/walk) that steps onto an existing niche triggers this'. Self-scaffolds the [[bundles]] header if `bundle` has none yet. #1968 workspace idempotency: re-authoring the SAME bundle+id REPLACES both rows wholesale.",
5
+ "parameters": {
6
+ "type": "object",
7
+ "required": [
8
+ "id",
9
+ "niche_id",
10
+ "capability_id"
11
+ ],
12
+ "properties": {
13
+ "bundle": {
14
+ "type": "string",
15
+ "description": "bundle_id stamped on every generated row. Omit to fall back to `context.defaultBundle` (#1968 smart default)."
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "description": "Local affordance key stem — derives template_id '<bundle>/<id>/affordance' and outcome_template_id '<bundle>/<id>/outcome'."
20
+ },
21
+ "niche_id": {
22
+ "type": "string",
23
+ "description": "affordance_templates.niche_id — an ALREADY-authored niche_definitions id (workspace, live, or the active target, e.g. via spellkave_define_niche) this call never creates — the trigger surface (a trap/trigger niche, e.g. a pressure plate)."
24
+ },
25
+ "capability_id": {
26
+ "type": "string",
27
+ "description": "affordance_templates.capability_id — an ALREADY-authored capability_definitions id (workspace, live, or the active target, e.g. 'core/walk') this call never creates — the pre-existing capability any qualifying actor already holds (no NEW grant is authored by this call)."
28
+ },
29
+ "display_name": {
30
+ "type": "string",
31
+ "description": "Overrides the derived title-cased `id` for BOTH the outcome and affordance rows."
32
+ },
33
+ "predicate_source": {
34
+ "type": "string",
35
+ "description": "affordance_templates.predicate_source — the deterministic ELIGIBILITY gate for whether this affordance offers (e.g. a capability/state check like 'target.stat(\"srd/ac\") >= 1'). A stochastic comparison here (e.g. 'd20 >= 13') is treated as satisfied at materialise time and never gates offer (#1891) — author dice on the action's resolution_predicate_source (resolution_mode = 'Stochastic') instead. Omit for an ungated trigger (predicate_bool = true)."
36
+ },
37
+ "range_m": {
38
+ "type": "number",
39
+ "description": "affordance_templates.range_m (ADR-0053 metric embedding). Default 0."
40
+ },
41
+ "outcome_expression_source": {
42
+ "type": "string",
43
+ "description": "outcome_templates.outcome_expression_source — invokes a pre-authored effect (e.g. \"invoke_outcome_graph('<bundle>/<id>/graph')\"). Exactly ONE of `outcome_expression_source`/`manipulation_action_id` is required — an affordance with neither would trigger nothing."
44
+ },
45
+ "manipulation_action_id": {
46
+ "type": "string",
47
+ "description": "outcome_templates.manipulation_action_id — executes a pre-authored action_definitions row instead (the darkness-consumer idiom, packages/spellkave-srd/src/author/author-darkness.ts's `act_in_dark`). Exactly ONE of `outcome_expression_source`/`manipulation_action_id` is required."
48
+ }
49
+ }
50
+ },
51
+ "executionMode": "sequential",
52
+ "roles": [
53
+ "AUTHOR"
54
+ ],
55
+ "admission": {
56
+ "anyOf": [
57
+ {
58
+ "kind": "all",
59
+ "capabilities": [
60
+ "frontier.apply_manifest"
61
+ ]
62
+ },
63
+ {
64
+ "kind": "publisher"
65
+ }
66
+ ],
67
+ "ports": []
68
+ }
69
+ }