@spellkave/tool-contracts 0.0.0-bootstrap
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.
- package/LICENSE +89 -0
- package/package.json +50 -0
- package/src/admission.ts +62 -0
- package/src/authoring-schemas.ts +3491 -0
- package/src/authoring-tool-names.ts +46 -0
- package/src/contract-data.ts +37 -0
- package/src/contract-guard.ts +377 -0
- package/src/contracts-metadata.json +6940 -0
- package/src/docs-metadata.ts +42 -0
- package/src/exploration.ts +248 -0
- package/src/git-batch.ts +36 -0
- package/src/grant-schemas.ts +38 -0
- package/src/index.ts +10 -0
- package/src/metadata.ts +48 -0
- package/src/owner-instance-read.ts +123 -0
- package/src/personas.generated.json +47 -0
- package/src/personas.ts +19 -0
- package/src/roster.ts +13 -0
- package/src/scene-schemas.ts +29 -0
- package/src/schema-registry.ts +197 -0
- package/src/schemas.ts +786 -0
- package/src/snapshot-storage.ts +133 -0
- package/src/tool-contracts.breaking-acknowledged.json +392 -0
- package/src/tool-contracts.snapshot/index.json +104 -0
- package/src/tool-contracts.snapshot/rosters/AUTHOR.json +54 -0
- package/src/tool-contracts.snapshot/rosters/DM.json +19 -0
- package/src/tool-contracts.snapshot/rosters/PLAYER.json +25 -0
- package/src/tool-contracts.snapshot/tools/spellkave_acting_context.json +35 -0
- package/src/tool-contracts.snapshot/tools/spellkave_actor_principals.json +23 -0
- package/src/tool-contracts.snapshot/tools/spellkave_annotate_place.json +82 -0
- package/src/tool-contracts.snapshot/tools/spellkave_apply_manifest_delta.json +66 -0
- package/src/tool-contracts.snapshot/tools/spellkave_applyset_apply.json +131 -0
- package/src/tool-contracts.snapshot/tools/spellkave_applyset_diff.json +122 -0
- package/src/tool-contracts.snapshot/tools/spellkave_attach_map_layer.json +114 -0
- package/src/tool-contracts.snapshot/tools/spellkave_author_place.json +132 -0
- package/src/tool-contracts.snapshot/tools/spellkave_bind_actor.json +79 -0
- package/src/tool-contracts.snapshot/tools/spellkave_bind_edge_affordance.json +69 -0
- package/src/tool-contracts.snapshot/tools/spellkave_can_i.json +123 -0
- package/src/tool-contracts.snapshot/tools/spellkave_communicate.json +44 -0
- package/src/tool-contracts.snapshot/tools/spellkave_declare_inexpressible.json +33 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_action.json +133 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_action_verb.json +215 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_affordance.json +69 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_behavior.json +505 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_bundle.json +67 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_capability.json +64 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_condition.json +244 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_consequence.json +65 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_entity_type.json +199 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_niche.json +88 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_resource.json +93 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_roll_table.json +87 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_session.json +115 -0
- package/src/tool-contracts.snapshot/tools/spellkave_define_trace_kind.json +71 -0
- package/src/tool-contracts.snapshot/tools/spellkave_describe.json +73 -0
- package/src/tool-contracts.snapshot/tools/spellkave_diff.json +90 -0
- package/src/tool-contracts.snapshot/tools/spellkave_docs.json +104 -0
- package/src/tool-contracts.snapshot/tools/spellkave_end_turn.json +21 -0
- package/src/tool-contracts.snapshot/tools/spellkave_entity.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_entity_body.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_entity_container.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_equip_item.json +49 -0
- package/src/tool-contracts.snapshot/tools/spellkave_eval.json +87 -0
- package/src/tool-contracts.snapshot/tools/spellkave_events.json +30 -0
- package/src/tool-contracts.snapshot/tools/spellkave_explain.json +83 -0
- package/src/tool-contracts.snapshot/tools/spellkave_export.json +66 -0
- package/src/tool-contracts.snapshot/tools/spellkave_export_grants.json +50 -0
- package/src/tool-contracts.snapshot/tools/spellkave_get.json +87 -0
- package/src/tool-contracts.snapshot/tools/spellkave_grant_role.json +80 -0
- package/src/tool-contracts.snapshot/tools/spellkave_hand_over_role.json +89 -0
- package/src/tool-contracts.snapshot/tools/spellkave_intervention_windows.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_inventory.json +40 -0
- package/src/tool-contracts.snapshot/tools/spellkave_item_detail.json +37 -0
- package/src/tool-contracts.snapshot/tools/spellkave_link_places.json +84 -0
- package/src/tool-contracts.snapshot/tools/spellkave_list_grants.json +56 -0
- package/src/tool-contracts.snapshot/tools/spellkave_manipulate.json +84 -0
- package/src/tool-contracts.snapshot/tools/spellkave_manipulation_context.json +62 -0
- package/src/tool-contracts.snapshot/tools/spellkave_map.json +109 -0
- package/src/tool-contracts.snapshot/tools/spellkave_map_graph.json +143 -0
- package/src/tool-contracts.snapshot/tools/spellkave_move.json +75 -0
- package/src/tool-contracts.snapshot/tools/spellkave_note_doc_gap.json +43 -0
- package/src/tool-contracts.snapshot/tools/spellkave_observer_knowledge.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_observer_place_knowledge.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_observer_trace_knowledge.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_offer_control.json +30 -0
- package/src/tool-contracts.snapshot/tools/spellkave_orient.json +39 -0
- package/src/tool-contracts.snapshot/tools/spellkave_pace_time.json +59 -0
- package/src/tool-contracts.snapshot/tools/spellkave_place_actor.json +190 -0
- package/src/tool-contracts.snapshot/tools/spellkave_place_entity.json +190 -0
- package/src/tool-contracts.snapshot/tools/spellkave_prepare_hand_over.json +57 -0
- package/src/tool-contracts.snapshot/tools/spellkave_query.json +290 -0
- package/src/tool-contracts.snapshot/tools/spellkave_react_option.json +47 -0
- package/src/tool-contracts.snapshot/tools/spellkave_reaction_options.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_release_claim.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_remove_entity.json +39 -0
- package/src/tool-contracts.snapshot/tools/spellkave_render_scene.json +59 -0
- package/src/tool-contracts.snapshot/tools/spellkave_return_npc_control.json +59 -0
- package/src/tool-contracts.snapshot/tools/spellkave_revoke_role.json +55 -0
- package/src/tool-contracts.snapshot/tools/spellkave_scene.json +74 -0
- package/src/tool-contracts.snapshot/tools/spellkave_scene_detail.json +37 -0
- package/src/tool-contracts.snapshot/tools/spellkave_self_states.json +77 -0
- package/src/tool-contracts.snapshot/tools/spellkave_self_summary.json +21 -0
- package/src/tool-contracts.snapshot/tools/spellkave_sense.json +68 -0
- package/src/tool-contracts.snapshot/tools/spellkave_sense_context.json +28 -0
- package/src/tool-contracts.snapshot/tools/spellkave_session_close.json +71 -0
- package/src/tool-contracts.snapshot/tools/spellkave_session_move.json +38 -0
- package/src/tool-contracts.snapshot/tools/spellkave_session_open.json +36 -0
- package/src/tool-contracts.snapshot/tools/spellkave_session_status.json +41 -0
- package/src/tool-contracts.snapshot/tools/spellkave_set_metadata.json +205 -0
- package/src/tool-contracts.snapshot/tools/spellkave_set_movement_default.json +58 -0
- package/src/tool-contracts.snapshot/tools/spellkave_stage_scene.json +55 -0
- package/src/tool-contracts.snapshot/tools/spellkave_status.json +23 -0
- package/src/tool-contracts.snapshot/tools/spellkave_stow_item.json +55 -0
- package/src/tool-contracts.snapshot/tools/spellkave_suggest_next_action.json +32 -0
- package/src/tool-contracts.snapshot/tools/spellkave_tag_entity.json +61 -0
- package/src/tool-contracts.snapshot/tools/spellkave_take_npc_control.json +64 -0
- package/src/tool-contracts.snapshot/tools/spellkave_trace_detail.json +36 -0
- package/src/tool-contracts.snapshot/tools/spellkave_traces.json +55 -0
- package/src/tool-contracts.snapshot/tools/spellkave_wake_up.json +23 -0
- package/src/tool-contracts.snapshot/tools/spellkave_withdraw_control.json +30 -0
- package/src/tool-contracts.snapshot/tools/spellkave_write_rows.json +62 -0
package/src/schemas.ts
ADDED
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
|
|
3
|
+
export const SPELLKAVE_OFFER_CONTROL_TOOL = "spellkave_offer_control";
|
|
4
|
+
export const SPELLKAVE_WITHDRAW_CONTROL_TOOL = "spellkave_withdraw_control";
|
|
5
|
+
export const SPELLKAVE_TAKE_NPC_CONTROL_TOOL = "spellkave_take_npc_control";
|
|
6
|
+
export const SPELLKAVE_RETURN_NPC_CONTROL_TOOL = "spellkave_return_npc_control";
|
|
7
|
+
export const OFFER_CONTROL_PARAMS = Type.Object({
|
|
8
|
+
identity: Type.String({
|
|
9
|
+
minLength: 1,
|
|
10
|
+
description:
|
|
11
|
+
"Login identity to consent to steering this primary body; authority is still required.",
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
export const WITHDRAW_CONTROL_PARAMS = Type.Object({
|
|
15
|
+
identity: Type.String({
|
|
16
|
+
minLength: 1,
|
|
17
|
+
description: "Login identity whose steering consent is withdrawn.",
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
const AS_BODY_PARAMS = {
|
|
21
|
+
as_body_id: Type.Optional(
|
|
22
|
+
Type.String({
|
|
23
|
+
minLength: 1,
|
|
24
|
+
description:
|
|
25
|
+
"Observed non-presence body to act as using frontier.impersonate; the server checks scope and consent.",
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
export const CONTROL_TOKEN_PARAMS = Type.Object({
|
|
30
|
+
world_instance_id: Type.String({ minLength: 1 }),
|
|
31
|
+
generation: Type.String({ pattern: "^[0-9]+$" }),
|
|
32
|
+
actor_id: Type.String({ pattern: "^[0-9]+$" }),
|
|
33
|
+
body_entity_id: Type.String({ pattern: "^[0-9]+$" }),
|
|
34
|
+
});
|
|
35
|
+
const ORIGINAL_CONTROL_TOKEN = { control_token: Type.Optional(CONTROL_TOKEN_PARAMS) };
|
|
36
|
+
export const TAKE_NPC_CONTROL_PARAMS = Type.Object({
|
|
37
|
+
actor_id: Type.String({ pattern: "^[0-9]+$" }),
|
|
38
|
+
presence_actor_id: Type.String({ pattern: "^[0-9]+$" }),
|
|
39
|
+
world_instance_id: Type.String({ minLength: 1 }),
|
|
40
|
+
expected_generation: Type.String({ pattern: "^[0-9]+$" }),
|
|
41
|
+
request_id: Type.String({ minLength: 1, maxLength: 128 }),
|
|
42
|
+
reason: Type.String({ minLength: 1, maxLength: 1024 }),
|
|
43
|
+
});
|
|
44
|
+
export const RETURN_NPC_CONTROL_PARAMS = Type.Object({
|
|
45
|
+
actor_id: Type.String({ pattern: "^[0-9]+$" }),
|
|
46
|
+
world_instance_id: Type.String({ minLength: 1 }),
|
|
47
|
+
expected_generation: Type.String({ pattern: "^[0-9]+$" }),
|
|
48
|
+
request_id: Type.String({ minLength: 1, maxLength: 128 }),
|
|
49
|
+
reason: Type.String({ minLength: 1, maxLength: 1024 }),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const SPELLKAVE_STATUS_TOOL = "spellkave_status";
|
|
53
|
+
export const SPELLKAVE_EVENTS_TOOL = "spellkave_events";
|
|
54
|
+
export const SPELLKAVE_SELF_SUMMARY_TOOL = "spellkave_self_summary";
|
|
55
|
+
export const SPELLKAVE_SELF_STATES_TOOL = "spellkave_self_states";
|
|
56
|
+
export const SPELLKAVE_SCENE_TOOL = "spellkave_scene";
|
|
57
|
+
export const SPELLKAVE_SCENE_DETAIL_TOOL = "spellkave_scene_detail";
|
|
58
|
+
export const SPELLKAVE_INVENTORY_TOOL = "spellkave_inventory";
|
|
59
|
+
export const SPELLKAVE_ITEM_DETAIL_TOOL = "spellkave_item_detail";
|
|
60
|
+
export const SPELLKAVE_TRACES_TOOL = "spellkave_traces";
|
|
61
|
+
export const SPELLKAVE_TRACE_DETAIL_TOOL = "spellkave_trace_detail";
|
|
62
|
+
export const SPELLKAVE_SESSION_STATUS_TOOL = "spellkave_session_status";
|
|
63
|
+
export const SPELLKAVE_REACTION_OPTIONS_TOOL = "spellkave_reaction_options";
|
|
64
|
+
export const SPELLKAVE_REACT_OPTION_TOOL = "spellkave_react_option";
|
|
65
|
+
export const SPELLKAVE_INTERVENTION_WINDOWS_TOOL = "spellkave_intervention_windows";
|
|
66
|
+
export const SPELLKAVE_SUGGEST_NEXT_ACTION_TOOL = "spellkave_suggest_next_action";
|
|
67
|
+
export const SPELLKAVE_MOVE_TOOL = "spellkave_move";
|
|
68
|
+
// Renamed from spellkave_player_map (bead sk-due): player-facing tools are
|
|
69
|
+
// named for the THING, never the role — spellkave_scene, spellkave_inventory,
|
|
70
|
+
// spellkave_traces, spellkave_self_summary; this was the only one carrying a
|
|
71
|
+
// role prefix. "scene = what I see here, map = what I know of the world."
|
|
72
|
+
// The AUTHOR twin keeps its own name (spellkave_map_graph — "_graph" is
|
|
73
|
+
// right there, since an author looks at substrate structure, not knowledge).
|
|
74
|
+
export const SPELLKAVE_MAP_TOOL = "spellkave_map";
|
|
75
|
+
// bead sk-cdi: rebuild self/scene/session/factual action context/inventory + a paged
|
|
76
|
+
// window of traces in one call — the re-orientation an actor with no history
|
|
77
|
+
// (fresh conversation, reloaded world, restarted host) legitimately needs.
|
|
78
|
+
export const SPELLKAVE_ORIENT_TOOL = "spellkave_orient";
|
|
79
|
+
|
|
80
|
+
// Perceive tools (read-only) over existing @spellkave/sdk readers.
|
|
81
|
+
/** ADR-0137's additive action-independent discovery projection. */
|
|
82
|
+
export const SPELLKAVE_MANIPULATION_CONTEXT_TOOL = "spellkave_manipulation_context";
|
|
83
|
+
/** ADR-0141's factual, action-independent sensing discovery projection. */
|
|
84
|
+
export const SPELLKAVE_SENSE_CONTEXT_TOOL = "spellkave_sense_context";
|
|
85
|
+
export const SPELLKAVE_ENTITY_TOOL = "spellkave_entity";
|
|
86
|
+
export const SPELLKAVE_ENTITY_CONTAINER_TOOL = "spellkave_entity_container";
|
|
87
|
+
export const SPELLKAVE_OBSERVER_KNOWLEDGE_TOOL = "spellkave_observer_knowledge";
|
|
88
|
+
export const SPELLKAVE_OBSERVER_PLACE_KNOWLEDGE_TOOL = "spellkave_observer_place_knowledge";
|
|
89
|
+
export const SPELLKAVE_OBSERVER_TRACE_KNOWLEDGE_TOOL = "spellkave_observer_trace_knowledge";
|
|
90
|
+
export const SPELLKAVE_ENTITY_BODY_TOOL = "spellkave_entity_body";
|
|
91
|
+
export const SPELLKAVE_ACTOR_PRINCIPALS_TOOL = "spellkave_actor_principals";
|
|
92
|
+
|
|
93
|
+
// Act tools (invoke reducers) over existing @spellkave/sdk actor verbs.
|
|
94
|
+
export const SPELLKAVE_COMMUNICATE_TOOL = "spellkave_communicate";
|
|
95
|
+
export const SPELLKAVE_SENSE_TOOL = "spellkave_sense";
|
|
96
|
+
export const SPELLKAVE_SESSION_OPEN_TOOL = "spellkave_session_open";
|
|
97
|
+
export const SPELLKAVE_SESSION_CLOSE_TOOL = "spellkave_session_close";
|
|
98
|
+
export const SPELLKAVE_SESSION_MOVE_TOOL = "spellkave_session_move";
|
|
99
|
+
export const SPELLKAVE_END_TURN_TOOL = "spellkave_end_turn";
|
|
100
|
+
export const SPELLKAVE_MANIPULATE_TOOL = "spellkave_manipulate";
|
|
101
|
+
export const SPELLKAVE_RELEASE_CLAIM_TOOL = "spellkave_release_claim";
|
|
102
|
+
export const SPELLKAVE_WAKE_UP_TOOL = "spellkave_wake_up";
|
|
103
|
+
|
|
104
|
+
export const STATUS_PARAMS = Type.Object({});
|
|
105
|
+
|
|
106
|
+
/** Read the caller-scoped factored manipulation context; no reducer is invoked. */
|
|
107
|
+
export const MANIPULATION_CONTEXT_PARAMS = Type.Object({
|
|
108
|
+
...AS_BODY_PARAMS,
|
|
109
|
+
|
|
110
|
+
detail: Type.Optional(
|
|
111
|
+
Type.Union([Type.Literal("summary"), Type.Literal("full")], {
|
|
112
|
+
description:
|
|
113
|
+
'Optional, default "summary": prompts[], targets[], participants[], the most relevant action rows (answers to open prompts first, then authored cues and defaults, then input forms, then alphabetical) as composition syntax, and more_action_ids naming every other action. "full" returns every action row with provider flags, template ids, groups and tags; it grows with the actor\'s capabilities (100 KB for a spellcaster) and is meant for programmatic readers.',
|
|
114
|
+
}),
|
|
115
|
+
),
|
|
116
|
+
action_ids: Type.Optional(
|
|
117
|
+
Type.Array(Type.String({ minLength: 1 }), {
|
|
118
|
+
maxItems: 25,
|
|
119
|
+
description:
|
|
120
|
+
"Optional, summary only: action ids (from more_action_ids, a prompt's response_action_ids, or a hint) whose syntax rows to return first in actions[]. Ids the listing does not hold come back in unknown_action_ids.",
|
|
121
|
+
}),
|
|
122
|
+
),
|
|
123
|
+
|
|
124
|
+
wait_for_prompt_ms: Type.Optional(
|
|
125
|
+
Type.Number({
|
|
126
|
+
minimum: 0,
|
|
127
|
+
maximum: 30000,
|
|
128
|
+
description:
|
|
129
|
+
"Optional. When prompts[] holds no open, unanswered prompt yet, wait up to this many milliseconds for one to open before returning (a prompt opens one to three ticks after the answer that leads to it). Returns as soon as one opens, or at the deadline with prompts[] as it is then; the host may cap the wait. Omit for an immediate read.",
|
|
130
|
+
}),
|
|
131
|
+
),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export const SENSE_CONTEXT_PARAMS = Type.Object({});
|
|
135
|
+
|
|
136
|
+
export const SELF_SUMMARY_PARAMS = Type.Object({});
|
|
137
|
+
|
|
138
|
+
export const SCENE_TARGETS_PARAMS = Type.Object({
|
|
139
|
+
kind: Type.Optional(
|
|
140
|
+
Type.Union(
|
|
141
|
+
[Type.Literal("actor"), Type.Literal("entity"), Type.Literal("exit"), Type.Literal("trace")],
|
|
142
|
+
{
|
|
143
|
+
description: "Optional scene target kind filter.",
|
|
144
|
+
},
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, description: "Rows per page." })),
|
|
148
|
+
cursor: Type.Optional(Type.String({ description: "Opaque next_cursor from the prior page." })),
|
|
149
|
+
wait_for_arrival_ms: Type.Optional(
|
|
150
|
+
Type.Number({
|
|
151
|
+
minimum: 0,
|
|
152
|
+
maximum: 30000,
|
|
153
|
+
description:
|
|
154
|
+
"Optional. While you are on a journey (a move that takes several ticks), wait up to this many milliseconds for it to end, then answer with the scene as it is then. Returns at once when you are not travelling; the host may cap the wait, and journey_wait says how it ended. Use this instead of re-reading the scene or the session status until you arrive.",
|
|
155
|
+
}),
|
|
156
|
+
),
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
export const SCENE_DETAIL_PARAMS = Type.Object({
|
|
160
|
+
rev: Type.Optional(
|
|
161
|
+
Type.String({
|
|
162
|
+
minLength: 1,
|
|
163
|
+
description:
|
|
164
|
+
"With handle: the target's OWN rev, copied verbatim from its row in spellkave_scene — not the listing envelope's top-level rev (stable per-target handles, freshness gated per target). Omit when addressing by target_id.",
|
|
165
|
+
}),
|
|
166
|
+
),
|
|
167
|
+
handle: Type.Optional(
|
|
168
|
+
Type.String({
|
|
169
|
+
minLength: 2,
|
|
170
|
+
description:
|
|
171
|
+
"Stable scene target handle, e.g. s:exit:32 or s:actor:7 — copied from spellkave_scene. Pass with rev, or pass target_id instead.",
|
|
172
|
+
}),
|
|
173
|
+
),
|
|
174
|
+
target_id: Type.Optional(
|
|
175
|
+
Type.String({
|
|
176
|
+
minLength: 3,
|
|
177
|
+
description:
|
|
178
|
+
"Alternative addressing, the same typed id spellkave_manipulate and spellkave_communicate take (entity:156, item:157, actor:7): reads a current scene target or an item:N child disclosed through an exposed container, and returns its rev. One of {handle, rev} or target_id.",
|
|
179
|
+
}),
|
|
180
|
+
),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
export const MAP_PARAMS = Type.Object({
|
|
184
|
+
graph: Type.Optional(
|
|
185
|
+
Type.String({
|
|
186
|
+
description:
|
|
187
|
+
"Optional map id — when set, draw that map restricted to places " +
|
|
188
|
+
"the connected actor has already seen. " +
|
|
189
|
+
"Omit and the map picks for you: while you are in a fight that opened a " +
|
|
190
|
+
"tactical grid, it draws THAT grid composed over the location you are fighting " +
|
|
191
|
+
"in (backdrop art plus the room's own layout, combat cells on top); " +
|
|
192
|
+
"otherwise it composes every known outdoor map. " +
|
|
193
|
+
"Naming a map explicitly always wins — pass the location's own id to see the " +
|
|
194
|
+
"region while a fight is open, or compose_parent=false for the bare grid.",
|
|
195
|
+
}),
|
|
196
|
+
),
|
|
197
|
+
slice: Type.Optional(
|
|
198
|
+
Type.Union(
|
|
199
|
+
[
|
|
200
|
+
Type.Literal("elevation_band"),
|
|
201
|
+
Type.Literal("all_floors_offset"),
|
|
202
|
+
Type.Literal("topology_only"),
|
|
203
|
+
Type.Literal("metric"),
|
|
204
|
+
Type.Literal("h3_world"),
|
|
205
|
+
],
|
|
206
|
+
{
|
|
207
|
+
description:
|
|
208
|
+
"How to project multi-floor / unpositioned maps: elevation_band (one floor), " +
|
|
209
|
+
"all_floors_offset (floors side-by-side), topology_only (adjacency layout), metric (all z in one plane), " +
|
|
210
|
+
"h3_world (outdoor maps laid out geographically). Omit for auto.",
|
|
211
|
+
},
|
|
212
|
+
),
|
|
213
|
+
),
|
|
214
|
+
compose_parent: Type.Optional(
|
|
215
|
+
Type.Boolean({
|
|
216
|
+
description:
|
|
217
|
+
"Default true. When the selected map is a battle grid (including an automatically selected one), " +
|
|
218
|
+
"the grid draws composed over its parent location's " +
|
|
219
|
+
"own known layout (and, for output_type='jpg', the parent's backdrop art too) — " +
|
|
220
|
+
"one picture, the battle grid in room context. Has no effect for a non-grid map. " +
|
|
221
|
+
"Set false for the grid alone " +
|
|
222
|
+
"when you specifically want just the battle grid with no surrounding room.",
|
|
223
|
+
}),
|
|
224
|
+
),
|
|
225
|
+
z: Type.Optional(
|
|
226
|
+
Type.Number({
|
|
227
|
+
description:
|
|
228
|
+
"Elevation for slice=elevation_band. Omit to use the anchor floor for a battle grid " +
|
|
229
|
+
"composed over its parent location; otherwise defaults to 0. An explicit z always wins.",
|
|
230
|
+
}),
|
|
231
|
+
),
|
|
232
|
+
z_tolerance: Type.Optional(
|
|
233
|
+
Type.Number({
|
|
234
|
+
description: "Half-width of elevation_band in elevation units (default 0.5).",
|
|
235
|
+
}),
|
|
236
|
+
),
|
|
237
|
+
output_type: Type.Optional(
|
|
238
|
+
Type.Union(
|
|
239
|
+
[
|
|
240
|
+
Type.Literal("utf8"),
|
|
241
|
+
Type.Literal("ascii"),
|
|
242
|
+
Type.Literal("braille"),
|
|
243
|
+
Type.Literal("inventory"),
|
|
244
|
+
Type.Literal("svg"),
|
|
245
|
+
Type.Literal("jpg"),
|
|
246
|
+
],
|
|
247
|
+
{
|
|
248
|
+
description:
|
|
249
|
+
"Which single artifact to render — the engine computes ONLY this one. 'utf8' box-" +
|
|
250
|
+
"drawing text, 'ascii' 7-bit text, 'braille' dense-dot text — each returned " +
|
|
251
|
+
"in the like-named details field. 'inventory' skips the picture entirely, " +
|
|
252
|
+
"details.inventory only. 'svg' (default) returns the raw SVG string in details.svg (and, when " +
|
|
253
|
+
"the host renders tool-result images, an inline picture). " +
|
|
254
|
+
"'jpg' writes a backdrop-composed JPEG to output_dir/output_name and returns its " +
|
|
255
|
+
"path as details.jpg_path — no svg/ascii/utf8/braille text in the response at all.",
|
|
256
|
+
},
|
|
257
|
+
),
|
|
258
|
+
),
|
|
259
|
+
output_dir: Type.Optional(
|
|
260
|
+
Type.String({
|
|
261
|
+
minLength: 1,
|
|
262
|
+
description:
|
|
263
|
+
"output_type='jpg' only; ignored otherwise. Host-supplied directory to write the " +
|
|
264
|
+
"map-art JPEG into — absolute, or RELATIVE to the host process's own cwd. " +
|
|
265
|
+
"A relative value resolves against process.cwd() for the " +
|
|
266
|
+
"write, and is echoed back UNCHANGED — never resolved — in details.jpg_path, so a " +
|
|
267
|
+
"caller recording a portable artifact never leaks its own machine-local checkout " +
|
|
268
|
+
"path. Optional: omit for a fresh temp directory — a caller that just " +
|
|
269
|
+
"wants 'a JPEG, anywhere' does not have to invent a path. Backdrop art is " +
|
|
270
|
+
"drawn in full (the map on top stays scoped to places already seen, but the " +
|
|
271
|
+
"backdrop itself is NOT masked, so it may show rooms not yet discovered).",
|
|
272
|
+
}),
|
|
273
|
+
),
|
|
274
|
+
output_name: Type.Optional(
|
|
275
|
+
Type.String({
|
|
276
|
+
minLength: 1,
|
|
277
|
+
description:
|
|
278
|
+
"output_type='jpg' only; ignored otherwise. Base filename (no extension) for the " +
|
|
279
|
+
"JPEG written under output_dir, e.g. 'arrival'. Optional: omit for a " +
|
|
280
|
+
"name derived from graph, or 'map' " +
|
|
281
|
+
"when graph itself is also omitted.",
|
|
282
|
+
}),
|
|
283
|
+
),
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
export const INVENTORY_PARAMS = Type.Object({
|
|
287
|
+
kind: Type.Optional(
|
|
288
|
+
Type.String({
|
|
289
|
+
description: "Optional exact authored entity kind filter. Forces the flat paged list.",
|
|
290
|
+
}),
|
|
291
|
+
),
|
|
292
|
+
name_prefix: Type.Optional(
|
|
293
|
+
Type.String({
|
|
294
|
+
description: "Optional case-insensitive item-name prefix filter. Forces the flat paged list.",
|
|
295
|
+
}),
|
|
296
|
+
),
|
|
297
|
+
limit: Type.Optional(
|
|
298
|
+
Type.Number({
|
|
299
|
+
minimum: 1,
|
|
300
|
+
maximum: 100,
|
|
301
|
+
description:
|
|
302
|
+
"Maximum items per page, and the unfiltered grouped-tree threshold. Defaults to 50.",
|
|
303
|
+
}),
|
|
304
|
+
),
|
|
305
|
+
cursor: Type.Optional(
|
|
306
|
+
Type.String({
|
|
307
|
+
description: "Opaque next_cursor from a prior paged response. Forces the flat paged list.",
|
|
308
|
+
}),
|
|
309
|
+
),
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
export const ITEM_DETAIL_PARAMS = Type.Object({
|
|
313
|
+
rev: Type.Optional(
|
|
314
|
+
Type.String({
|
|
315
|
+
minLength: 1,
|
|
316
|
+
description:
|
|
317
|
+
"With handle: the item's OWN rev, copied verbatim from its row in spellkave_inventory — not the listing envelope's top-level rev (stable per-item handles, freshness gated per item). Omit when addressing by target_id.",
|
|
318
|
+
}),
|
|
319
|
+
),
|
|
320
|
+
handle: Type.Optional(
|
|
321
|
+
Type.String({
|
|
322
|
+
minLength: 2,
|
|
323
|
+
description:
|
|
324
|
+
"Stable inventory item handle, e.g. i:42 — copied from spellkave_inventory. Pass with rev, or pass target_id instead.",
|
|
325
|
+
}),
|
|
326
|
+
),
|
|
327
|
+
target_id: Type.Optional(
|
|
328
|
+
Type.String({
|
|
329
|
+
minLength: 3,
|
|
330
|
+
description:
|
|
331
|
+
"Alternative addressing, the same typed id spellkave_manipulate takes (item:157 or entity:157): the current inventory row for that item is read without a rev, and its rev is returned. One of {handle, rev} or target_id.",
|
|
332
|
+
}),
|
|
333
|
+
),
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
export const SESSION_STATUS_PARAMS = Type.Object({
|
|
337
|
+
limit: Type.Optional(
|
|
338
|
+
Type.Integer({
|
|
339
|
+
minimum: 1,
|
|
340
|
+
maximum: 100,
|
|
341
|
+
description: "Ongoing sessions per page; implies detail.",
|
|
342
|
+
}),
|
|
343
|
+
),
|
|
344
|
+
cursor: Type.Optional(
|
|
345
|
+
Type.String({
|
|
346
|
+
description:
|
|
347
|
+
"Continuation from ongoing.next_cursor; implies detail. Restart without cursor if the list changes.",
|
|
348
|
+
}),
|
|
349
|
+
),
|
|
350
|
+
detail: Type.Optional(
|
|
351
|
+
Type.Boolean({
|
|
352
|
+
description:
|
|
353
|
+
"Include authorized operation details and world-tick timing, including initiated and external-wait phases.",
|
|
354
|
+
}),
|
|
355
|
+
),
|
|
356
|
+
session_id: Type.Optional(
|
|
357
|
+
Type.String({
|
|
358
|
+
pattern: "^[0-9]+$",
|
|
359
|
+
description:
|
|
360
|
+
"Read details for a previously observed session, including its terminal state. Requires participation; implies detail.",
|
|
361
|
+
}),
|
|
362
|
+
),
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
export const REACTION_OPTIONS_PARAMS = Type.Object({
|
|
366
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, description: "Rows per page." })),
|
|
367
|
+
cursor: Type.Optional(Type.String({ description: "Opaque next_cursor from the prior page." })),
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
export const INTERVENTION_WINDOWS_PARAMS = Type.Object({
|
|
371
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, description: "Rows per page." })),
|
|
372
|
+
cursor: Type.Optional(Type.String({ description: "Opaque next_cursor from the prior page." })),
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
export const REACT_OPTION_PARAMS = Type.Object({
|
|
376
|
+
rev: Type.String({
|
|
377
|
+
minLength: 1,
|
|
378
|
+
description:
|
|
379
|
+
"Current reaction-window or intervention-window revision (matches the handle's domain).",
|
|
380
|
+
}),
|
|
381
|
+
handle: Type.String({
|
|
382
|
+
minLength: 2,
|
|
383
|
+
description:
|
|
384
|
+
"A handle from spellkave_reaction_options (e.g. r2) or spellkave_intervention_windows (e.g. w0).",
|
|
385
|
+
}),
|
|
386
|
+
response_intent: Type.String({
|
|
387
|
+
minLength: 1,
|
|
388
|
+
description: "Authored or free-text response intent passed to the typed reaction reducer.",
|
|
389
|
+
}),
|
|
390
|
+
selected_draw_index: Type.Optional(
|
|
391
|
+
Type.Number({
|
|
392
|
+
minimum: 0,
|
|
393
|
+
description:
|
|
394
|
+
"Intervention windows only: the index (into that window's `faces`) of the already-drawn face to replace. Omit to decline — the original result stands and nothing is spent. Providing an index accepts: it spends the window's fuel resource and replaces exactly that one face; the new roll must then be used. Ignored (and should be omitted) for a plain spellkave_reaction_options seat.",
|
|
395
|
+
}),
|
|
396
|
+
),
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
export const TRACE_ENTRIES_PARAMS = Type.Object({
|
|
400
|
+
kind: Type.Optional(Type.String({ description: "Optional exact authored trace kind." })),
|
|
401
|
+
kind_prefix: Type.Optional(Type.String({ description: "Optional authored trace-kind prefix." })),
|
|
402
|
+
inscribed_by: Type.Optional(Type.String({ description: "Optional exact inscriber id." })),
|
|
403
|
+
visibility: Type.Optional(Type.String({ description: "Optional exact visibility class." })),
|
|
404
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, description: "Rows per page." })),
|
|
405
|
+
cursor: Type.Optional(Type.String({ description: "Opaque next_cursor from the prior page." })),
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
// bead sk-cdi Scope B: traces page by CURSOR, most-recent-first, small
|
|
409
|
+
// default (see `ORIENT_TRACES_DEFAULT_LIMIT`/`ORIENT_TRACES_MAX_LIMIT` in
|
|
410
|
+
// tools.ts for the justification) — never a fixed time window, and never the
|
|
411
|
+
// whole history in one call.
|
|
412
|
+
export const ORIENT_PARAMS = Type.Object({
|
|
413
|
+
cursor: Type.Optional(
|
|
414
|
+
Type.String({
|
|
415
|
+
description:
|
|
416
|
+
"Opaque traces.next_cursor from a prior spellkave_orient call — fetches the NEXT (older) page of traces. Omit for the first call: the most recent page, which stands alone as a usable orientation.",
|
|
417
|
+
}),
|
|
418
|
+
),
|
|
419
|
+
limit: Type.Optional(
|
|
420
|
+
Type.Number({
|
|
421
|
+
minimum: 1,
|
|
422
|
+
maximum: 25,
|
|
423
|
+
description:
|
|
424
|
+
"Traces per page (default 10, max 25). Going further back costs more calls, deliberately — recall should cost turns, not one unbounded dump.",
|
|
425
|
+
}),
|
|
426
|
+
),
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
export const TRACE_DETAIL_PARAMS = Type.Object({
|
|
430
|
+
rev: Type.String({
|
|
431
|
+
minLength: 1,
|
|
432
|
+
description:
|
|
433
|
+
"The trace's OWN rev, copied verbatim from its row in spellkave_traces — not the listing envelope's top-level rev (stable per-trace handles, freshness gated per trace).",
|
|
434
|
+
}),
|
|
435
|
+
handle: Type.String({
|
|
436
|
+
minLength: 2,
|
|
437
|
+
description: "Stable trace handle, e.g. t:4 — copied from spellkave_traces.",
|
|
438
|
+
}),
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
export const SELF_STATES_PARAMS = Type.Object({
|
|
442
|
+
kind: Type.Optional(
|
|
443
|
+
Type.Union(
|
|
444
|
+
[
|
|
445
|
+
Type.Literal("state"),
|
|
446
|
+
Type.Literal("condition"),
|
|
447
|
+
Type.Literal("capability"),
|
|
448
|
+
Type.Literal("evaluation"),
|
|
449
|
+
Type.Literal("economy"),
|
|
450
|
+
Type.Literal("economy_budget"),
|
|
451
|
+
Type.Literal("identity"),
|
|
452
|
+
],
|
|
453
|
+
{
|
|
454
|
+
description: "Self-sheet row kind. Defaults to state.",
|
|
455
|
+
},
|
|
456
|
+
),
|
|
457
|
+
),
|
|
458
|
+
state_prefix: Type.Optional(
|
|
459
|
+
Type.String({ description: "Exact state_id prefix filter; valid only for kind=state." }),
|
|
460
|
+
),
|
|
461
|
+
state_tag: Type.Optional(
|
|
462
|
+
Type.String({ description: "Exact authored resource tag filter; valid only for kind=state." }),
|
|
463
|
+
),
|
|
464
|
+
provenance_id: Type.Optional(
|
|
465
|
+
Type.String({
|
|
466
|
+
description:
|
|
467
|
+
"Exact provenance_id filter; valid only for kind=evaluation. Returns matched 1 and the row, or matched 0.",
|
|
468
|
+
}),
|
|
469
|
+
),
|
|
470
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, description: "Rows per page." })),
|
|
471
|
+
cursor: Type.Optional(Type.String({ description: "Opaque next_cursor from the prior page." })),
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
export const EVENTS_PARAMS = Type.Object({
|
|
475
|
+
limit: Type.Optional(
|
|
476
|
+
Type.Number({
|
|
477
|
+
description: "Maximum number of recent events to read.",
|
|
478
|
+
minimum: 1,
|
|
479
|
+
maximum: 100,
|
|
480
|
+
}),
|
|
481
|
+
),
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
export const SUGGEST_NEXT_ACTION_PARAMS = Type.Object({
|
|
485
|
+
entity_ref: Type.String({
|
|
486
|
+
description:
|
|
487
|
+
"EntityRef of the perceiver body to suggest for — not `Actor.actor_id` (the steering principal). Accepts a bare numeric entity id (`42`), `entity:42`, `item:42` (an item is still an entity row; same numeric id), or a manifest key suffix (`core/player`).",
|
|
488
|
+
minLength: 1,
|
|
489
|
+
}),
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
// T7 (act_scene -> spellkave_move rename): exactly one addressing mode.
|
|
493
|
+
// Preferred mode: {rev, handle}, a revision-bound exit handle copied from
|
|
494
|
+
// spellkave_scene. Compatibility mode: {edge_id}, a raw place_edge id for
|
|
495
|
+
// general/operator callers that do not go through spellkave_scene at all
|
|
496
|
+
// (absorbed from the deprecated raw spellkave_move wrapper). The run
|
|
497
|
+
// function, not this schema, enforces "exactly one" — TypeBox has no
|
|
498
|
+
// first-class XOR-of-optional-groups shape.
|
|
499
|
+
export const MOVE_PARAMS = Type.Object({
|
|
500
|
+
...AS_BODY_PARAMS,
|
|
501
|
+
...ORIGINAL_CONTROL_TOKEN,
|
|
502
|
+
|
|
503
|
+
rev: Type.Optional(
|
|
504
|
+
Type.String({
|
|
505
|
+
minLength: 1,
|
|
506
|
+
description:
|
|
507
|
+
"Scene-handle mode: the exit's OWN rev, copied verbatim from its row in spellkave_scene — not the listing envelope's top-level rev. Required together with handle; omit both and pass edge_id instead for the adjacent-exit mode.",
|
|
508
|
+
}),
|
|
509
|
+
),
|
|
510
|
+
handle: Type.Optional(
|
|
511
|
+
Type.String({
|
|
512
|
+
minLength: 2,
|
|
513
|
+
description:
|
|
514
|
+
"Scene-handle mode: stable scene exit handle, e.g. s:exit:32, from spellkave_scene. Required together with rev; omit both and pass edge_id instead for the adjacent-exit mode.",
|
|
515
|
+
}),
|
|
516
|
+
),
|
|
517
|
+
edge_id: Type.Optional(
|
|
518
|
+
Type.String({
|
|
519
|
+
minLength: 1,
|
|
520
|
+
description:
|
|
521
|
+
"Adjacent-exit mode: identifier of an adjacent exit from where you are. Prefer rev+handle instead — this mode exists when you do not have a scene handle.",
|
|
522
|
+
}),
|
|
523
|
+
),
|
|
524
|
+
wait_for_arrival_ms: Type.Optional(
|
|
525
|
+
Type.Number({
|
|
526
|
+
minimum: 0,
|
|
527
|
+
maximum: 30000,
|
|
528
|
+
description:
|
|
529
|
+
'Optional, scene-handle mode. A move longer than your reach becomes a journey of several ticks (outcome "travelling"). With this field the call waits up to that many milliseconds for the journey to end and then returns the arrival observation; journey says whether you arrived, were stopped elsewhere, or are still travelling (the host may cap the wait). Without it the call returns as soon as the journey starts.',
|
|
530
|
+
}),
|
|
531
|
+
),
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
export const ENTITY_PARAMS = Type.Object({
|
|
535
|
+
entity_id: Type.String({
|
|
536
|
+
description:
|
|
537
|
+
"Entity identifier (numeric id, 'entity:N', or a manifest key). Returns its identity row — entity_def_id, name, kind, and stack quantity — or null if it does not resolve. General-purpose quantity surface outside the PLAYER inventory flow (spellkave_inventory and spellkave_item_detail also carry quantity); spellkave_entity_container returns containment only, never quantity.",
|
|
538
|
+
minLength: 1,
|
|
539
|
+
}),
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
export const ENTITY_CONTAINER_PARAMS = Type.Object({
|
|
543
|
+
entity_id: Type.String({
|
|
544
|
+
description:
|
|
545
|
+
"Contained entity identifier. Returns the container that holds it, or null if it is not contained.",
|
|
546
|
+
minLength: 1,
|
|
547
|
+
}),
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
export const OBSERVER_KNOWLEDGE_PARAMS = Type.Object({
|
|
551
|
+
observer_id: Type.String({
|
|
552
|
+
description:
|
|
553
|
+
"Observer body entity identifier. Returns what that body has perceived (entities, action facts, traces).",
|
|
554
|
+
minLength: 1,
|
|
555
|
+
}),
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
export const OBSERVER_PLACE_KNOWLEDGE_PARAMS = Type.Object({
|
|
559
|
+
observer_id: Type.String({
|
|
560
|
+
description:
|
|
561
|
+
"Observer body entity identifier. Returns the place nodes that body has perceived.",
|
|
562
|
+
minLength: 1,
|
|
563
|
+
}),
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
export const OBSERVER_TRACE_KNOWLEDGE_PARAMS = Type.Object({
|
|
567
|
+
observer_id: Type.String({
|
|
568
|
+
description:
|
|
569
|
+
"Observer body entity identifier. Returns the inscribed-trace knowledge that body has perceived (seam A + seam B — ADR-0040).",
|
|
570
|
+
minLength: 1,
|
|
571
|
+
}),
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
export const ENTITY_BODY_PARAMS = Type.Object({
|
|
575
|
+
entity_id: Type.String({
|
|
576
|
+
description: "Entity identifier. Returns its body row, or null if it has none.",
|
|
577
|
+
minLength: 1,
|
|
578
|
+
}),
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
export const ACTOR_PRINCIPALS_PARAMS = Type.Object({});
|
|
582
|
+
|
|
583
|
+
export const COMMUNICATE_PARAMS = Type.Object({
|
|
584
|
+
target_id: Type.String({
|
|
585
|
+
description:
|
|
586
|
+
"Typed target reference to communicate with — use an observed participant or location reference (e.g. 'entity:42'). The world authoritatively validates the attempt; a bare numeric id is ambiguous and may be rejected or misresolved.",
|
|
587
|
+
minLength: 1,
|
|
588
|
+
}),
|
|
589
|
+
speech_act_id: Type.String({ description: "Speech-act identifier to perform.", minLength: 1 }),
|
|
590
|
+
utterance: Type.Optional(
|
|
591
|
+
Type.String({
|
|
592
|
+
description:
|
|
593
|
+
"Optional words to say. On acceptance they are delivered to the world as dispatch_text, echoed in the receipt, and may open the bounded reply window.",
|
|
594
|
+
}),
|
|
595
|
+
),
|
|
596
|
+
args_json: Type.Optional(
|
|
597
|
+
Type.String({
|
|
598
|
+
description:
|
|
599
|
+
"Optional JSON argument blob, passed 1:1 to the world. Defaults to '{}'. For an authored session opener, participant_entity_ids is a nonempty list of up to 64 distinct runtime body ids; the session definition and grid remain authored, and older modules refuse this argument before dispatch. For an action that creates an entity, definition_ref names an allowed definition; the world checks the choice against the action's authored limits. A prompt-bound answer (a speech_act_id listed in a prompts[] row's responseActionIds in spellkave_manipulation_context, e.g. dm/dialog/choice/2) must carry that prompts[] row here as {\"semantic_context\": <row>}; without it the world rejects the answer with prompt_context_required.",
|
|
600
|
+
}),
|
|
601
|
+
),
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
export const SESSION_OPEN_PARAMS = Type.Object({
|
|
605
|
+
session_def_id: Type.String({
|
|
606
|
+
description: "Session definition identifier to open.",
|
|
607
|
+
minLength: 1,
|
|
608
|
+
}),
|
|
609
|
+
participants_csv: Type.Optional(
|
|
610
|
+
Type.String({
|
|
611
|
+
description:
|
|
612
|
+
"Optional comma-separated participant body ids the caller directly controls. Defaults to empty.",
|
|
613
|
+
}),
|
|
614
|
+
),
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
export const SESSION_CLOSE_PARAMS = Type.Object({
|
|
618
|
+
control_tokens: Type.Optional(
|
|
619
|
+
Type.Array(CONTROL_TOKEN_PARAMS, {
|
|
620
|
+
minItems: 1,
|
|
621
|
+
maxItems: 64,
|
|
622
|
+
description:
|
|
623
|
+
"Original control observations for every Service participant you directly drive. Copy the observations from the decision snapshot; stale, missing or held observations refuse the whole close before any effects.",
|
|
624
|
+
}),
|
|
625
|
+
),
|
|
626
|
+
session_id: Type.Number({ description: "Session id to close.", minimum: 0 }),
|
|
627
|
+
outcome: Type.String({
|
|
628
|
+
description: "Terminal session outcome: completed, abandoned, or failed.",
|
|
629
|
+
minLength: 1,
|
|
630
|
+
}),
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
export const SESSION_MOVE_PARAMS = Type.Object({
|
|
634
|
+
session_id: Type.Number({ description: "Session id to advance.", minimum: 0 }),
|
|
635
|
+
move_template_id: Type.String({
|
|
636
|
+
description: "Move template identifier to submit.",
|
|
637
|
+
minLength: 1,
|
|
638
|
+
}),
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
export const END_TURN_PARAMS = Type.Object({});
|
|
642
|
+
|
|
643
|
+
export const MANIPULATE_PARAMS = Type.Object({
|
|
644
|
+
...AS_BODY_PARAMS,
|
|
645
|
+
...ORIGINAL_CONTROL_TOKEN,
|
|
646
|
+
|
|
647
|
+
target_id: Type.String({
|
|
648
|
+
description:
|
|
649
|
+
"Typed target reference to manipulate — prefer target_ref from spellkave_manipulation_context when it is ready (e.g. 'entity:42', 'item:7'). Direct typed attempts remain allowed; the world authoritatively validates them. A bare numeric id is ambiguous (defaults to entity) and will misresolve a contained item's location, e.g. rejecting a self-targeted item use as out_of_range (#1838). A carried item is an item: target; the inventory handle 'i:7' is read as 'item:7'.",
|
|
650
|
+
minLength: 1,
|
|
651
|
+
}),
|
|
652
|
+
action_id: Type.String({
|
|
653
|
+
description:
|
|
654
|
+
"Open authored action identifier to attempt against the target — prefer action_id from spellkave_manipulation_context when it is ready; it is discovery data, not an eligibility guarantee.",
|
|
655
|
+
minLength: 1,
|
|
656
|
+
}),
|
|
657
|
+
args_json: Type.Optional(
|
|
658
|
+
Type.String({
|
|
659
|
+
description:
|
|
660
|
+
"Optional JSON argument blob, passed 1:1 to the world. Defaults to '{}'. For an authored session opener, participant_entity_ids is a nonempty list of up to 64 distinct runtime body ids; the session definition and grid remain authored, and older modules refuse this argument before dispatch. For an action that creates an entity, definition_ref names an allowed definition; the world checks the choice against the action's authored limits. May include participant_context (an mpc:<id> token from spellkave_manipulation_context.participants) when the action has more than one disclosed participant binding. A prompt-bound action (an action_id listed in a prompts[] row's responseActionIds in spellkave_manipulation_context) must carry that prompts[] row here as {\"semantic_context\": <row>}; without it the world rejects the attempt with prompt_context_required.",
|
|
661
|
+
}),
|
|
662
|
+
),
|
|
663
|
+
participant_context: Type.Optional(
|
|
664
|
+
Type.String({
|
|
665
|
+
description:
|
|
666
|
+
"Optional mpc:<id> token from spellkave_manipulation_context.participants for this action. Required when the ready context lists more than one participant row for the action (e.g. Load with two bolts). May also be placed inside args_json; the two must agree.",
|
|
667
|
+
minLength: 1,
|
|
668
|
+
}),
|
|
669
|
+
),
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
/** Direct sensing is a typed attempt. `spellkave_sense_context` supplies
|
|
673
|
+
* factual query syntax; the server freshly selects and authorizes it. */
|
|
674
|
+
export const SENSE_PARAMS = Type.Object({
|
|
675
|
+
...AS_BODY_PARAMS,
|
|
676
|
+
...ORIGINAL_CONTROL_TOKEN,
|
|
677
|
+
|
|
678
|
+
query_kind: Type.String({
|
|
679
|
+
description:
|
|
680
|
+
"Authored sensing query identifier from spellkave_sense_context (for example 'look'). The server authoritatively selects and validates it.",
|
|
681
|
+
minLength: 1,
|
|
682
|
+
}),
|
|
683
|
+
visibility: Type.String({
|
|
684
|
+
description: "Authored visibility class from spellkave_sense_context (for example 'Local').",
|
|
685
|
+
minLength: 1,
|
|
686
|
+
}),
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
export const RELEASE_CLAIM_PARAMS = Type.Object({
|
|
690
|
+
target_id: Type.String({
|
|
691
|
+
description:
|
|
692
|
+
"Target entity identifier whose claim/lock this actor releases (multiplayer contention).",
|
|
693
|
+
minLength: 1,
|
|
694
|
+
}),
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
export const WAKE_UP_PARAMS = Type.Object({});
|
|
698
|
+
|
|
699
|
+
export const READ_ONLY_TOOL_NAMES = [
|
|
700
|
+
SPELLKAVE_STATUS_TOOL,
|
|
701
|
+
SPELLKAVE_EVENTS_TOOL,
|
|
702
|
+
SPELLKAVE_SUGGEST_NEXT_ACTION_TOOL,
|
|
703
|
+
SPELLKAVE_MANIPULATION_CONTEXT_TOOL,
|
|
704
|
+
SPELLKAVE_SENSE_CONTEXT_TOOL,
|
|
705
|
+
SPELLKAVE_ENTITY_CONTAINER_TOOL,
|
|
706
|
+
SPELLKAVE_OBSERVER_KNOWLEDGE_TOOL,
|
|
707
|
+
SPELLKAVE_OBSERVER_PLACE_KNOWLEDGE_TOOL,
|
|
708
|
+
SPELLKAVE_OBSERVER_TRACE_KNOWLEDGE_TOOL,
|
|
709
|
+
SPELLKAVE_TRACES_TOOL,
|
|
710
|
+
SPELLKAVE_TRACE_DETAIL_TOOL,
|
|
711
|
+
SPELLKAVE_SESSION_STATUS_TOOL,
|
|
712
|
+
SPELLKAVE_REACTION_OPTIONS_TOOL,
|
|
713
|
+
SPELLKAVE_INTERVENTION_WINDOWS_TOOL,
|
|
714
|
+
SPELLKAVE_ENTITY_BODY_TOOL,
|
|
715
|
+
SPELLKAVE_ACTOR_PRINCIPALS_TOOL,
|
|
716
|
+
] as const;
|
|
717
|
+
|
|
718
|
+
export const TOOL_SCHEMAS = {
|
|
719
|
+
[SPELLKAVE_STATUS_TOOL]: STATUS_PARAMS,
|
|
720
|
+
[SPELLKAVE_EVENTS_TOOL]: EVENTS_PARAMS,
|
|
721
|
+
[SPELLKAVE_SUGGEST_NEXT_ACTION_TOOL]: SUGGEST_NEXT_ACTION_PARAMS,
|
|
722
|
+
[SPELLKAVE_MOVE_TOOL]: MOVE_PARAMS,
|
|
723
|
+
[SPELLKAVE_MANIPULATION_CONTEXT_TOOL]: MANIPULATION_CONTEXT_PARAMS,
|
|
724
|
+
[SPELLKAVE_SENSE_CONTEXT_TOOL]: SENSE_CONTEXT_PARAMS,
|
|
725
|
+
[SPELLKAVE_ENTITY_TOOL]: ENTITY_PARAMS,
|
|
726
|
+
[SPELLKAVE_ENTITY_CONTAINER_TOOL]: ENTITY_CONTAINER_PARAMS,
|
|
727
|
+
[SPELLKAVE_OBSERVER_KNOWLEDGE_TOOL]: OBSERVER_KNOWLEDGE_PARAMS,
|
|
728
|
+
[SPELLKAVE_OBSERVER_PLACE_KNOWLEDGE_TOOL]: OBSERVER_PLACE_KNOWLEDGE_PARAMS,
|
|
729
|
+
[SPELLKAVE_OBSERVER_TRACE_KNOWLEDGE_TOOL]: OBSERVER_TRACE_KNOWLEDGE_PARAMS,
|
|
730
|
+
[SPELLKAVE_TRACES_TOOL]: TRACE_ENTRIES_PARAMS,
|
|
731
|
+
[SPELLKAVE_TRACE_DETAIL_TOOL]: TRACE_DETAIL_PARAMS,
|
|
732
|
+
[SPELLKAVE_SESSION_STATUS_TOOL]: SESSION_STATUS_PARAMS,
|
|
733
|
+
[SPELLKAVE_REACTION_OPTIONS_TOOL]: REACTION_OPTIONS_PARAMS,
|
|
734
|
+
[SPELLKAVE_INTERVENTION_WINDOWS_TOOL]: INTERVENTION_WINDOWS_PARAMS,
|
|
735
|
+
[SPELLKAVE_REACT_OPTION_TOOL]: REACT_OPTION_PARAMS,
|
|
736
|
+
[SPELLKAVE_ENTITY_BODY_TOOL]: ENTITY_BODY_PARAMS,
|
|
737
|
+
[SPELLKAVE_ACTOR_PRINCIPALS_TOOL]: ACTOR_PRINCIPALS_PARAMS,
|
|
738
|
+
[SPELLKAVE_COMMUNICATE_TOOL]: COMMUNICATE_PARAMS,
|
|
739
|
+
[SPELLKAVE_SENSE_TOOL]: SENSE_PARAMS,
|
|
740
|
+
[SPELLKAVE_SESSION_OPEN_TOOL]: SESSION_OPEN_PARAMS,
|
|
741
|
+
[SPELLKAVE_SESSION_CLOSE_TOOL]: SESSION_CLOSE_PARAMS,
|
|
742
|
+
[SPELLKAVE_SESSION_MOVE_TOOL]: SESSION_MOVE_PARAMS,
|
|
743
|
+
[SPELLKAVE_END_TURN_TOOL]: END_TURN_PARAMS,
|
|
744
|
+
[SPELLKAVE_MANIPULATE_TOOL]: MANIPULATE_PARAMS,
|
|
745
|
+
[SPELLKAVE_RELEASE_CLAIM_TOOL]: RELEASE_CLAIM_PARAMS,
|
|
746
|
+
[SPELLKAVE_WAKE_UP_TOOL]: WAKE_UP_PARAMS,
|
|
747
|
+
} as const;
|
|
748
|
+
|
|
749
|
+
export * from "./authoring-schemas";
|
|
750
|
+
export * from "./authoring-tool-names";
|
|
751
|
+
|
|
752
|
+
export const SPELLKAVE_PACE_TIME_TOOL = "spellkave_pace_time";
|
|
753
|
+
export const PACE_TIME_PARAMS = Type.Object(
|
|
754
|
+
{
|
|
755
|
+
op: Type.Union([
|
|
756
|
+
Type.Literal("pause"),
|
|
757
|
+
Type.Literal("resume"),
|
|
758
|
+
Type.Literal("step"),
|
|
759
|
+
Type.Literal("interval"),
|
|
760
|
+
]),
|
|
761
|
+
ticks: Type.Optional(Type.Integer({ minimum: 1, maximum: 10000 })),
|
|
762
|
+
seconds: Type.Optional(Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER })),
|
|
763
|
+
},
|
|
764
|
+
{ additionalProperties: false },
|
|
765
|
+
);
|
|
766
|
+
|
|
767
|
+
export * from "./grant-schemas";
|
|
768
|
+
|
|
769
|
+
export const ACTING_CONTEXT_PARAMS = Type.Object(
|
|
770
|
+
{
|
|
771
|
+
binding_id: Type.Optional(
|
|
772
|
+
Type.String({
|
|
773
|
+
description:
|
|
774
|
+
"Select a currently caller-owned presence binding. Omit to list your contexts.",
|
|
775
|
+
}),
|
|
776
|
+
),
|
|
777
|
+
character: Type.Optional(
|
|
778
|
+
Type.Boolean({
|
|
779
|
+
description: "Select your primary character. Mutually exclusive with binding_id.",
|
|
780
|
+
}),
|
|
781
|
+
),
|
|
782
|
+
},
|
|
783
|
+
{ additionalProperties: false },
|
|
784
|
+
);
|
|
785
|
+
|
|
786
|
+
export * from "./scene-schemas";
|