@rpgm-tools/neo-angband-mod-sdk 0.19.0 → 0.21.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.
- package/bin/neo-angband-mod-build.mjs +7 -3
- package/dist/capabilities.d.ts +61 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +144 -2
- package/dist/capabilities.js.map +1 -1
- package/dist/compose.d.ts +41 -1
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +70 -5
- package/dist/compose.js.map +1 -1
- package/dist/contested.d.ts +1 -1
- package/dist/contested.d.ts.map +1 -1
- package/dist/contested.js.map +1 -1
- package/dist/fields.d.ts +19 -11
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +63 -14
- package/dist/fields.js.map +1 -1
- package/dist/frontend.d.ts +210 -0
- package/dist/frontend.d.ts.map +1 -1
- package/dist/hud.d.ts +168 -0
- package/dist/hud.d.ts.map +1 -0
- package/dist/hud.js +20 -0
- package/dist/hud.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +43 -11
- package/dist/loader.js.map +1 -1
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +30 -0
- package/dist/manifest.js.map +1 -1
- package/dist/menu.d.ts +162 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +24 -0
- package/dist/menu.js.map +1 -0
- package/dist/provenance.d.ts +36 -1
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +73 -4
- package/dist/provenance.js.map +1 -1
- package/dist/resources.js +1 -1
- package/dist/resources.js.map +1 -1
- package/dist/screen.d.ts +326 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +29 -0
- package/dist/screen.js.map +1 -0
- package/package.json +1 -1
- package/src/capabilities.ts +378 -231
- package/src/compose.ts +111 -5
- package/src/contested.ts +4 -1
- package/src/fields.ts +87 -16
- package/src/frontend.ts +215 -0
- package/src/hud.ts +177 -0
- package/src/index.ts +63 -1
- package/src/loader.ts +855 -780
- package/src/manifest.ts +50 -0
- package/src/menu.ts +153 -0
- package/src/provenance.ts +107 -4
- package/src/resources.ts +1 -1
- package/src/screen.ts +341 -0
- package/src/sections.ts +329 -329
- package/src/sort.ts +429 -429
|
@@ -330,11 +330,15 @@ function pluginProblem(plugin) {
|
|
|
330
330
|
plugin.hooks === undefined &&
|
|
331
331
|
plugin.register === undefined &&
|
|
332
332
|
plugin.controller === undefined &&
|
|
333
|
-
plugin.frontend === undefined
|
|
333
|
+
plugin.frontend === undefined &&
|
|
334
|
+
plugin.hud === undefined &&
|
|
335
|
+
plugin.menu === undefined &&
|
|
336
|
+
plugin.screen === undefined &&
|
|
337
|
+
plugin.regions === undefined
|
|
334
338
|
) {
|
|
335
|
-
return "plugin.js declares no hooks, register, controller or
|
|
339
|
+
return "plugin.js declares no hooks, register, controller, frontend, hud, menu, screen or regions, so it would do nothing";
|
|
336
340
|
}
|
|
337
|
-
for (const name of ["hooks", "register", "controller", "frontend", "uninstall"]) {
|
|
341
|
+
for (const name of ["hooks", "register", "controller", "frontend", "hud", "menu", "screen", "regions", "uninstall"]) {
|
|
338
342
|
if (plugin[name] !== undefined && typeof plugin[name] !== "function") {
|
|
339
343
|
return `plugin.js: ${name} is not a function`;
|
|
340
344
|
}
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
* "registry:profile" | "registry:blow" |
|
|
34
34
|
* "registry:store" | "registry:command" |
|
|
35
35
|
* "registry:monster" | "registry:projection" |
|
|
36
|
-
* "registry:
|
|
36
|
+
* "registry:ui-entry" | "registry:glyph" |
|
|
37
|
+
* "registry:effect-info" |
|
|
37
38
|
* "registry:randart" | "registry:tval" |
|
|
38
39
|
* "registry:vocab"; or the
|
|
39
40
|
* wildcard "registry:*"
|
|
@@ -44,6 +45,13 @@
|
|
|
44
45
|
* of a room-template or vault layout means when the
|
|
45
46
|
* level is drawn - the behaviour half of shipping a
|
|
46
47
|
* vault with a symbol core never heard of.
|
|
48
|
+
* "registry:ui-entry" says what a `combine:` or an
|
|
49
|
+
* `entry-renderer:` `code:` MEANS on the second
|
|
50
|
+
* character screen and the equip-comparison screen -
|
|
51
|
+
* how a row's per-slot values reduce, and how a
|
|
52
|
+
* value becomes a cell symbol and colour. Adding a
|
|
53
|
+
* ui_entry ROW needs no capability; saying what its
|
|
54
|
+
* combiner or renderer does needs this.
|
|
47
55
|
* "registry:effect-info" says what the game PRINTS
|
|
48
56
|
* about an effect - its menu row, its recall
|
|
49
57
|
* sentence, the object properties an activation
|
|
@@ -72,6 +80,48 @@
|
|
|
72
80
|
* "registry:menu" rewrites the semantic rows of
|
|
73
81
|
* one stable front-end menu id. It is distinct from
|
|
74
82
|
* a future full front-end selection capability.
|
|
83
|
+
* - "display:replace" - become the game's FRONT END: everything the
|
|
84
|
+
* player sees of the dungeon is drawn by this
|
|
85
|
+
* plugin (ModPlugin.frontend). Its own kind
|
|
86
|
+
* rather than a registry domain, and NOT
|
|
87
|
+
* covered by "registry:*" - an override
|
|
88
|
+
* wildcard grants every named game system,
|
|
89
|
+
* which is not the same thing as owning the
|
|
90
|
+
* screen.
|
|
91
|
+
* - "ui:<region>.replace" - draw ONE named part of the HUD instead of the
|
|
92
|
+
* game (ModPlugin.hud): "ui:messages.replace" |
|
|
93
|
+
* "ui:sidebar.replace" | "ui:status.replace", or
|
|
94
|
+
* the wildcard "ui:*.replace" for all three.
|
|
95
|
+
* Per REGION on purpose - a mod drawing hit points
|
|
96
|
+
* as a bar should not have to ask for the message
|
|
97
|
+
* line as well, and a player consenting to it
|
|
98
|
+
* should be told which part of their screen is
|
|
99
|
+
* changing hands. There is no "ui:map.replace":
|
|
100
|
+
* the dungeon is "display:replace"'s, and one
|
|
101
|
+
* region answering to two capabilities would be
|
|
102
|
+
* two answers to "who draws this".
|
|
103
|
+
* NOT covered by "display:replace" and it does not
|
|
104
|
+
* cover it, in either direction: taking the map is
|
|
105
|
+
* not taking the vitals.
|
|
106
|
+
* - "backup:folder" - lets the mod write files into a folder the player
|
|
107
|
+
* picks; the mod never learns the folder's real
|
|
108
|
+
* path (the browser will not say), only that a
|
|
109
|
+
* write to it succeeded or failed. Its own kind,
|
|
110
|
+
* like "display:replace" - there is nothing to
|
|
111
|
+
* range over, so it has no wildcard either.
|
|
112
|
+
* - "ui:region.create" - ADD a rectangle of your own to the player's screen
|
|
113
|
+
* (ModPlugin.regions), rather than take one of the
|
|
114
|
+
* game's. The only "ui:" capability whose ACTION is
|
|
115
|
+
* not "replace", and the distinction is the point:
|
|
116
|
+
* every name above is something the game already
|
|
117
|
+
* draws, so consenting to it is consenting to a
|
|
118
|
+
* handover, while this one is new furniture
|
|
119
|
+
* appearing. No wildcard - there is no set of
|
|
120
|
+
* region names to range over, because the region
|
|
121
|
+
* does not exist until the mod declares it. NOT
|
|
122
|
+
* covered by "ui:*.replace", which is why
|
|
123
|
+
* `grantCovers` compares the action as well as the
|
|
124
|
+
* region.
|
|
75
125
|
*
|
|
76
126
|
* This module only surfaces `nondeterministic` from the manifest. The
|
|
77
127
|
* save's determinism ratchet itself - flipping a save from DETERMINISTIC to
|
|
@@ -98,6 +148,16 @@ export type ParsedCapability = {
|
|
|
98
148
|
} | {
|
|
99
149
|
kind: "registry";
|
|
100
150
|
domain: string;
|
|
151
|
+
} | {
|
|
152
|
+
kind: "display";
|
|
153
|
+
action: "replace";
|
|
154
|
+
} | {
|
|
155
|
+
kind: "ui";
|
|
156
|
+
region: string;
|
|
157
|
+
action: "replace" | "create";
|
|
158
|
+
} | {
|
|
159
|
+
kind: "backup";
|
|
160
|
+
action: "folder";
|
|
101
161
|
};
|
|
102
162
|
/**
|
|
103
163
|
* Parse and validate a capability string against the vocabulary above,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiIG;AAEH,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5D,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,KAAK,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AA6CzC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CA8C7D;AAiED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;IAC3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C,OAAO;IAUP;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,aAAa;IAgB1D;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAKzB;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOxB,0EAA0E;IAC1E,kBAAkB,IAAI,OAAO;IAI7B,6DAA6D;IAC7D,iBAAiB,IAAI,OAAO;CAG7B"}
|
package/dist/capabilities.js
CHANGED
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
* "registry:profile" | "registry:blow" |
|
|
34
34
|
* "registry:store" | "registry:command" |
|
|
35
35
|
* "registry:monster" | "registry:projection" |
|
|
36
|
-
* "registry:
|
|
36
|
+
* "registry:ui-entry" | "registry:glyph" |
|
|
37
|
+
* "registry:effect-info" |
|
|
37
38
|
* "registry:randart" | "registry:tval" |
|
|
38
39
|
* "registry:vocab"; or the
|
|
39
40
|
* wildcard "registry:*"
|
|
@@ -44,6 +45,13 @@
|
|
|
44
45
|
* of a room-template or vault layout means when the
|
|
45
46
|
* level is drawn - the behaviour half of shipping a
|
|
46
47
|
* vault with a symbol core never heard of.
|
|
48
|
+
* "registry:ui-entry" says what a `combine:` or an
|
|
49
|
+
* `entry-renderer:` `code:` MEANS on the second
|
|
50
|
+
* character screen and the equip-comparison screen -
|
|
51
|
+
* how a row's per-slot values reduce, and how a
|
|
52
|
+
* value becomes a cell symbol and colour. Adding a
|
|
53
|
+
* ui_entry ROW needs no capability; saying what its
|
|
54
|
+
* combiner or renderer does needs this.
|
|
47
55
|
* "registry:effect-info" says what the game PRINTS
|
|
48
56
|
* about an effect - its menu row, its recall
|
|
49
57
|
* sentence, the object properties an activation
|
|
@@ -72,6 +80,48 @@
|
|
|
72
80
|
* "registry:menu" rewrites the semantic rows of
|
|
73
81
|
* one stable front-end menu id. It is distinct from
|
|
74
82
|
* a future full front-end selection capability.
|
|
83
|
+
* - "display:replace" - become the game's FRONT END: everything the
|
|
84
|
+
* player sees of the dungeon is drawn by this
|
|
85
|
+
* plugin (ModPlugin.frontend). Its own kind
|
|
86
|
+
* rather than a registry domain, and NOT
|
|
87
|
+
* covered by "registry:*" - an override
|
|
88
|
+
* wildcard grants every named game system,
|
|
89
|
+
* which is not the same thing as owning the
|
|
90
|
+
* screen.
|
|
91
|
+
* - "ui:<region>.replace" - draw ONE named part of the HUD instead of the
|
|
92
|
+
* game (ModPlugin.hud): "ui:messages.replace" |
|
|
93
|
+
* "ui:sidebar.replace" | "ui:status.replace", or
|
|
94
|
+
* the wildcard "ui:*.replace" for all three.
|
|
95
|
+
* Per REGION on purpose - a mod drawing hit points
|
|
96
|
+
* as a bar should not have to ask for the message
|
|
97
|
+
* line as well, and a player consenting to it
|
|
98
|
+
* should be told which part of their screen is
|
|
99
|
+
* changing hands. There is no "ui:map.replace":
|
|
100
|
+
* the dungeon is "display:replace"'s, and one
|
|
101
|
+
* region answering to two capabilities would be
|
|
102
|
+
* two answers to "who draws this".
|
|
103
|
+
* NOT covered by "display:replace" and it does not
|
|
104
|
+
* cover it, in either direction: taking the map is
|
|
105
|
+
* not taking the vitals.
|
|
106
|
+
* - "backup:folder" - lets the mod write files into a folder the player
|
|
107
|
+
* picks; the mod never learns the folder's real
|
|
108
|
+
* path (the browser will not say), only that a
|
|
109
|
+
* write to it succeeded or failed. Its own kind,
|
|
110
|
+
* like "display:replace" - there is nothing to
|
|
111
|
+
* range over, so it has no wildcard either.
|
|
112
|
+
* - "ui:region.create" - ADD a rectangle of your own to the player's screen
|
|
113
|
+
* (ModPlugin.regions), rather than take one of the
|
|
114
|
+
* game's. The only "ui:" capability whose ACTION is
|
|
115
|
+
* not "replace", and the distinction is the point:
|
|
116
|
+
* every name above is something the game already
|
|
117
|
+
* draws, so consenting to it is consenting to a
|
|
118
|
+
* handover, while this one is new furniture
|
|
119
|
+
* appearing. No wildcard - there is no set of
|
|
120
|
+
* region names to range over, because the region
|
|
121
|
+
* does not exist until the mod declares it. NOT
|
|
122
|
+
* covered by "ui:*.replace", which is why
|
|
123
|
+
* `grantCovers` compares the action as well as the
|
|
124
|
+
* region.
|
|
75
125
|
*
|
|
76
126
|
* This module only surfaces `nondeterministic` from the manifest. The
|
|
77
127
|
* save's determinism ratchet itself - flipping a save from DETERMINISTIC to
|
|
@@ -82,10 +132,46 @@ import { hasFacet } from "./manifest.js";
|
|
|
82
132
|
export class CapabilityError extends Error {
|
|
83
133
|
}
|
|
84
134
|
const EVENT_RE = /^event:([a-z][a-z0-9-]*)$/;
|
|
135
|
+
/**
|
|
136
|
+
* The parts of the interface a plugin may own, plus the "*" wildcard. `map` is
|
|
137
|
+
* absent deliberately: the dungeon is display:replace's.
|
|
138
|
+
*
|
|
139
|
+
* The first three are HUD REGIONS, sold one at a time because they are three
|
|
140
|
+
* answers to three questions. `menu` is not a region - it is every menu the game
|
|
141
|
+
* asks, held by one presenter that declines the questions it has no better way
|
|
142
|
+
* to ask. One grant rather than one per menu id, because ~50 capability strings
|
|
143
|
+
* would be a consent list nobody could read (`menu-runtime.ts` states the whole
|
|
144
|
+
* argument). `screen` is the same bargain for the full-screen views - the
|
|
145
|
+
* inventory listing, the character sheet, the knowledge browser. `ui:*.replace`
|
|
146
|
+
* covers them all, as it covers the regions.
|
|
147
|
+
*/
|
|
148
|
+
const UI_RE = /^ui:(\*|messages|sidebar|status|menu|screen)\.replace$/;
|
|
149
|
+
/**
|
|
150
|
+
* `ui:region.create` - ADD a rectangle of your own to the screen, rather than
|
|
151
|
+
* take one of the game's.
|
|
152
|
+
*
|
|
153
|
+
* A SEPARATE ACTION, NOT A SEVENTH REGION NAME, and that distinction is the
|
|
154
|
+
* whole reason this is its own pattern. Every string `UI_RE` matches names
|
|
155
|
+
* something that already exists and is currently drawn by the game; consenting
|
|
156
|
+
* to one is consenting to a HANDOVER. This one names nothing - the region does
|
|
157
|
+
* not exist until the mod declares it - so what the player is consenting to is
|
|
158
|
+
* new furniture appearing, which is a different sentence and deserves a
|
|
159
|
+
* different string.
|
|
160
|
+
*
|
|
161
|
+
* THERE IS NO WILDCARD, deliberately. `ui:*.replace` is a wildcard over WHICH
|
|
162
|
+
* region changes hands, and it means something because the set of regions is
|
|
163
|
+
* closed and known. There is no set to range over here: a mod either may add
|
|
164
|
+
* regions or it may not.
|
|
165
|
+
*
|
|
166
|
+
* AND `ui:*.replace` MUST NOT COVER IT. That is enforced in `grantCovers` by
|
|
167
|
+
* comparing `action`, and it is the reason that comparison exists at all - see
|
|
168
|
+
* the note there.
|
|
169
|
+
*/
|
|
170
|
+
const UI_CREATE_RE = /^ui:region\.create$/;
|
|
85
171
|
const STATE_RE = /^state:(\*|[a-z][a-z0-9-]*)\.read$/;
|
|
86
172
|
const NETWORK_RE = /^network:(\*|[a-zA-Z0-9.-]+)$/;
|
|
87
173
|
/** The override domains ModRegistryHost gates, plus the "*" wildcard. */
|
|
88
|
-
const REGISTRY_RE = /^registry:(\*|effect-info|effect|room|profile|blow|store|command|monster|projection|glyph|randart|rune|tval|vocab|menu)$/;
|
|
174
|
+
const REGISTRY_RE = /^registry:(\*|effect-info|effect|room|profile|blow|store|command|monster|projection|ui-entry|glyph|randart|rune|tval|vocab|menu|message)$/;
|
|
89
175
|
/**
|
|
90
176
|
* Parse and validate a capability string against the vocabulary above,
|
|
91
177
|
* returning its structured form. Throws CapabilityError on anything
|
|
@@ -97,6 +183,31 @@ export function parseCapability(cap) {
|
|
|
97
183
|
if (cap === "command:add") {
|
|
98
184
|
return { kind: "command", action: "add" };
|
|
99
185
|
}
|
|
186
|
+
/* NOT a registry domain, deliberately. A registry:* grant means "override
|
|
187
|
+
* one named game system among many"; this one means "everything the player
|
|
188
|
+
* sees of the dungeon is drawn by this mod." It is the display OWNER, so it
|
|
189
|
+
* has no domain to name and no wildcard to sit under - `registry:*` must not
|
|
190
|
+
* carry it, which is exactly what a separate kind buys. */
|
|
191
|
+
if (cap === "display:replace") {
|
|
192
|
+
return { kind: "display", action: "replace" };
|
|
193
|
+
}
|
|
194
|
+
/* "backup:folder": lets the mod write files into a folder the player picks;
|
|
195
|
+
* the mod never learns the folder's real path (the browser will not say),
|
|
196
|
+
* only that a write to it succeeded or failed. Its own kind, not a registry
|
|
197
|
+
* domain: there is nothing to range over, same reasoning as display:replace. */
|
|
198
|
+
if (cap === "backup:folder") {
|
|
199
|
+
return { kind: "backup", action: "folder" };
|
|
200
|
+
}
|
|
201
|
+
const ui = UI_RE.exec(cap);
|
|
202
|
+
if (ui) {
|
|
203
|
+
return { kind: "ui", region: ui[1], action: "replace" };
|
|
204
|
+
}
|
|
205
|
+
/* `region` is the region NAME here as much as `sidebar` is in the line above:
|
|
206
|
+
* it is the literal the author wrote, kept so that one `kind: "ui"` arm has
|
|
207
|
+
* one shape rather than two. What distinguishes it is `action`. */
|
|
208
|
+
if (UI_CREATE_RE.test(cap)) {
|
|
209
|
+
return { kind: "ui", region: "region", action: "create" };
|
|
210
|
+
}
|
|
100
211
|
const event = EVENT_RE.exec(cap);
|
|
101
212
|
if (event) {
|
|
102
213
|
return { kind: "event", name: event[1] };
|
|
@@ -136,6 +247,37 @@ function grantCovers(grant, request) {
|
|
|
136
247
|
case "registry":
|
|
137
248
|
return (grant.kind === "registry" &&
|
|
138
249
|
(grant.domain === "*" || grant.domain === request.domain));
|
|
250
|
+
case "display":
|
|
251
|
+
/* Exact match only. See parseCapability: `registry:*` does not reach
|
|
252
|
+
* here, so a mod holding the override wildcard still cannot take the
|
|
253
|
+
* display without asking for it by name. */
|
|
254
|
+
return grant.kind === "display";
|
|
255
|
+
case "backup":
|
|
256
|
+
/* Exact match only, same reasoning as "display" - there is exactly one
|
|
257
|
+
* backup capability and no wildcard grant could ever cover it. */
|
|
258
|
+
return grant.kind === "backup";
|
|
259
|
+
case "ui":
|
|
260
|
+
/* Per region, with one wildcard. A `display` grant is NOT accepted here
|
|
261
|
+
* and a `ui` grant is not accepted above: owning the dungeon and owning
|
|
262
|
+
* the vitals are two consents, and a mod that wants both says both.
|
|
263
|
+
*
|
|
264
|
+
* THE ACTION IS COMPARED TOO, and until #261 it was not - which was
|
|
265
|
+
* invisible only because every ui capability was a `.replace`, so the
|
|
266
|
+
* comparison would have been of a constant against itself. `ui:region
|
|
267
|
+
* .create` broke that: the wildcard is a wildcard over WHICH REGION
|
|
268
|
+
* changes hands, and reading it as a wildcard over what may be done to
|
|
269
|
+
* the interface let `ui:*.replace` carry the right to put new furniture
|
|
270
|
+
* on the player's screen. That is a grant the consent prompt never showed
|
|
271
|
+
* and the player never approved, and it would have escalated silently -
|
|
272
|
+
* there is no error, no report, and nothing on screen that says a region
|
|
273
|
+
* was created by a mod that was only ever allowed to redraw one.
|
|
274
|
+
*
|
|
275
|
+
* `region` is still compared as well: with two actions the pair is what
|
|
276
|
+
* identifies a grant, and dropping either half re-opens one of the two
|
|
277
|
+
* directions. */
|
|
278
|
+
return (grant.kind === "ui" &&
|
|
279
|
+
grant.action === request.action &&
|
|
280
|
+
(grant.region === "*" || grant.region === request.region));
|
|
139
281
|
}
|
|
140
282
|
}
|
|
141
283
|
/**
|
package/dist/capabilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiIG;AAEH,OAAO,EAAE,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAE5D,MAAM,OAAO,eAAgB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
* Every record in the composed game is identified by a PackRef
|
|
5
5
|
* ("<owner-pack>:<slug>"). Packs may:
|
|
6
6
|
* - add records (they become the owner),
|
|
7
|
-
* - patch records owned by packs they declare as dependencies
|
|
7
|
+
* - patch records owned by packs they declare as hard or optional dependencies
|
|
8
8
|
* (deep merge: objects merge per key, arrays and scalars replace,
|
|
9
9
|
* an explicit null deletes the key),
|
|
10
10
|
* - replace such records wholesale, or
|
|
@@ -24,6 +24,27 @@ export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
|
24
24
|
export type JsonRecord = {
|
|
25
25
|
[key: string]: JsonValue;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* The packs that wrote each top-level key of one composed record.
|
|
29
|
+
*
|
|
30
|
+
* This is composition-time bookkeeping only: loader.ts consumes it before it
|
|
31
|
+
* returns record arrays to the host, so it never reaches a binder or a save.
|
|
32
|
+
*/
|
|
33
|
+
export type FieldWriters = Map<string, Set<string>>;
|
|
34
|
+
/** One top-level value a pack wrote, including an explicit deletion. */
|
|
35
|
+
export interface FieldWrite {
|
|
36
|
+
readonly packId: string;
|
|
37
|
+
readonly value: JsonValue | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** The transient writers and values for one record's top-level keys. */
|
|
40
|
+
export interface FieldProvenance {
|
|
41
|
+
readonly writers: FieldWriters;
|
|
42
|
+
readonly writes: Map<string, FieldWrite[]>;
|
|
43
|
+
}
|
|
44
|
+
/** Start the transient field provenance for a record a pack contributes. */
|
|
45
|
+
export declare function fieldProvenanceFor(record: JsonRecord, packId: string): FieldProvenance;
|
|
46
|
+
/** Record the final values for top-level keys one pack just wrote. */
|
|
47
|
+
export declare function noteFieldWrites(provenance: FieldProvenance, keys: Iterable<string>, packId: string, record: JsonRecord): void;
|
|
27
48
|
/** One pack's contribution to one record file (e.g. "monster"). */
|
|
28
49
|
export interface FileContribution {
|
|
29
50
|
/**
|
|
@@ -78,7 +99,26 @@ export interface ComposedRecord {
|
|
|
78
99
|
/** Every pack that patched or replaced it, in load order. */
|
|
79
100
|
modifiedBy: string[];
|
|
80
101
|
value: JsonRecord;
|
|
102
|
+
/** The record exactly as its OWNER supplied it, before any patch landed. */
|
|
103
|
+
readonly defined: JsonRecord;
|
|
81
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* The transient key provenance for a record from this composition only.
|
|
107
|
+
*
|
|
108
|
+
* Every composed record is registered where it enters the table, so a miss
|
|
109
|
+
* means a NEW path added a record without registering one. That is worth
|
|
110
|
+
* naming rather than casting away: unregistered, the record's writers are
|
|
111
|
+
* invisible, so the namespace-trespass gate stops seeing that record's writes
|
|
112
|
+
* and silently permits what it exists to refuse. Left as a cast, the symptom
|
|
113
|
+
* would instead be a TypeError from inside `noteFieldWrites`, several frames
|
|
114
|
+
* from the mistake.
|
|
115
|
+
*
|
|
116
|
+
* Deliberately NOT a ComposeError. That type is the mod-attributable channel -
|
|
117
|
+
* it carries a pack id and tells an author which line to fix - and this is our
|
|
118
|
+
* bug, not a mod's. Blaming whichever pack happened to be loading would send a
|
|
119
|
+
* reader after the wrong thing entirely.
|
|
120
|
+
*/
|
|
121
|
+
export declare function fieldProvenanceOf(record: ComposedRecord): FieldProvenance;
|
|
82
122
|
export declare class ComposeError extends Error {
|
|
83
123
|
}
|
|
84
124
|
/** Deep merge per the pack patch rules. Returns a new object. */
|
package/dist/compose.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ7C,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,S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-4,7 +4,7 @@
|
|
|
4
4
|
* Every record in the composed game is identified by a PackRef
|
|
5
5
|
* ("<owner-pack>:<slug>"). Packs may:
|
|
6
6
|
* - add records (they become the owner),
|
|
7
|
-
* - patch records owned by packs they declare as dependencies
|
|
7
|
+
* - patch records owned by packs they declare as hard or optional dependencies
|
|
8
8
|
* (deep merge: objects merge per key, arrays and scalars replace,
|
|
9
9
|
* an explicit null deletes the key),
|
|
10
10
|
* - replace such records wholesale, or
|
|
@@ -18,6 +18,57 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { applyFieldPatch } from "./patch.js";
|
|
20
20
|
import { keyDescription, keySpecFor, legacyRecordKey, recordRefKeys, } from "./record-key.js";
|
|
21
|
+
/** Start the transient field provenance for a record a pack contributes. */
|
|
22
|
+
export function fieldProvenanceFor(record, packId) {
|
|
23
|
+
const provenance = { writers: new Map(), writes: new Map() };
|
|
24
|
+
noteFieldWrites(provenance, Object.keys(record), packId, record);
|
|
25
|
+
return provenance;
|
|
26
|
+
}
|
|
27
|
+
/** Record the final values for top-level keys one pack just wrote. */
|
|
28
|
+
export function noteFieldWrites(provenance, keys, packId, record) {
|
|
29
|
+
for (const key of keys) {
|
|
30
|
+
let by = provenance.writers.get(key);
|
|
31
|
+
if (by === undefined) {
|
|
32
|
+
by = new Set();
|
|
33
|
+
provenance.writers.set(key, by);
|
|
34
|
+
}
|
|
35
|
+
by.add(packId);
|
|
36
|
+
let writes = provenance.writes.get(key);
|
|
37
|
+
if (writes === undefined) {
|
|
38
|
+
writes = [];
|
|
39
|
+
provenance.writes.set(key, writes);
|
|
40
|
+
}
|
|
41
|
+
writes.push({ packId, value: record[key] });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/* Deliberately outside ComposedRecord: this cannot become record data or reach
|
|
45
|
+
* a save through an incidental serializer. loader.ts consumes it before it
|
|
46
|
+
* returns the composed values. */
|
|
47
|
+
const fieldProvenanceByRecord = new WeakMap();
|
|
48
|
+
/**
|
|
49
|
+
* The transient key provenance for a record from this composition only.
|
|
50
|
+
*
|
|
51
|
+
* Every composed record is registered where it enters the table, so a miss
|
|
52
|
+
* means a NEW path added a record without registering one. That is worth
|
|
53
|
+
* naming rather than casting away: unregistered, the record's writers are
|
|
54
|
+
* invisible, so the namespace-trespass gate stops seeing that record's writes
|
|
55
|
+
* and silently permits what it exists to refuse. Left as a cast, the symptom
|
|
56
|
+
* would instead be a TypeError from inside `noteFieldWrites`, several frames
|
|
57
|
+
* from the mistake.
|
|
58
|
+
*
|
|
59
|
+
* Deliberately NOT a ComposeError. That type is the mod-attributable channel -
|
|
60
|
+
* it carries a pack id and tells an author which line to fix - and this is our
|
|
61
|
+
* bug, not a mod's. Blaming whichever pack happened to be loading would send a
|
|
62
|
+
* reader after the wrong thing entirely.
|
|
63
|
+
*/
|
|
64
|
+
export function fieldProvenanceOf(record) {
|
|
65
|
+
const provenance = fieldProvenanceByRecord.get(record);
|
|
66
|
+
if (provenance === undefined) {
|
|
67
|
+
throw new Error(`composition bug: no field provenance for "${record.ref}" - a record ` +
|
|
68
|
+
`reached the table without registering one, so the namespace gate cannot see its writers`);
|
|
69
|
+
}
|
|
70
|
+
return provenance;
|
|
71
|
+
}
|
|
21
72
|
export class ComposeError extends Error {
|
|
22
73
|
}
|
|
23
74
|
/** Deep merge per the pack patch rules. Returns a new object. */
|
|
@@ -41,7 +92,9 @@ export function mergePatch(base, patch) {
|
|
|
41
92
|
return out;
|
|
42
93
|
}
|
|
43
94
|
function mayModify(m, ownerPack) {
|
|
44
|
-
return ownerPack === m.id ||
|
|
95
|
+
return (ownerPack === m.id ||
|
|
96
|
+
(m.dependencies ?? {})[ownerPack] !== undefined ||
|
|
97
|
+
(m.optionalDependencies ?? {})[ownerPack] !== undefined);
|
|
45
98
|
}
|
|
46
99
|
function ownerOf(ref) {
|
|
47
100
|
const at = ref.indexOf(":");
|
|
@@ -183,7 +236,15 @@ export function composePacks(packs, options = {}) {
|
|
|
183
236
|
refuse(`${file} adds two records that both resolve to "${ref}", so the second was left out`, `${file}: duplicate record ${ref}`);
|
|
184
237
|
return;
|
|
185
238
|
}
|
|
186
|
-
|
|
239
|
+
const added = {
|
|
240
|
+
ref,
|
|
241
|
+
owner: pid,
|
|
242
|
+
modifiedBy: [],
|
|
243
|
+
value: rec,
|
|
244
|
+
defined: rec,
|
|
245
|
+
};
|
|
246
|
+
fieldProvenanceByRecord.set(added, fieldProvenanceFor(rec, pid));
|
|
247
|
+
table.set(ref, added);
|
|
187
248
|
/* Every other ref this record answers to becomes an alias - EXCEPT one
|
|
188
249
|
* that is some record's real name. "*Healing*"'s legacy ref is plain
|
|
189
250
|
* "Healing"'s primary, and a record's own history must not cost a
|
|
@@ -226,8 +287,11 @@ export function composePacks(packs, options = {}) {
|
|
|
226
287
|
if (at === null)
|
|
227
288
|
continue;
|
|
228
289
|
const existing = table.get(at);
|
|
229
|
-
|
|
230
|
-
|
|
290
|
+
const changed = kind === "patches"
|
|
291
|
+
? Object.keys(body)
|
|
292
|
+
: new Set([...Object.keys(existing.value), ...Object.keys(body)]);
|
|
293
|
+
existing.value = kind === "patches" ? mergePatch(existing.value, body) : body;
|
|
294
|
+
noteFieldWrites(fieldProvenanceOf(existing), changed, pid, existing.value);
|
|
231
295
|
existing.modifiedBy.push(pid);
|
|
232
296
|
}
|
|
233
297
|
}
|
|
@@ -237,6 +301,7 @@ export function composePacks(packs, options = {}) {
|
|
|
237
301
|
continue;
|
|
238
302
|
const existing = table.get(at);
|
|
239
303
|
existing.value = applyFieldPatch(existing.value, ops);
|
|
304
|
+
noteFieldWrites(fieldProvenanceOf(existing), ops.map((op) => op.path.split(".")[0]), pid, existing.value);
|
|
240
305
|
existing.modifiedBy.push(pid);
|
|
241
306
|
}
|
|
242
307
|
for (const refStr of contrib.removes ?? []) {
|
package/dist/compose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;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AI,EAAE,KAAK,IAAI;oBAAE,SAAS;gBAC1B,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/contested.d.ts
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* author forgot to update it, which is the failure this report exists to catch.
|
|
34
34
|
*/
|
|
35
35
|
/** Which composition layer a contested slot belongs to. */
|
|
36
|
-
export type ContestedLayer = "record" | "graphics" | "behaviour" | "rule" | "controller" | "frontend";
|
|
36
|
+
export type ContestedLayer = "record" | "graphics" | "behaviour" | "rule" | "controller" | "frontend" | "hud" | "menu" | "screen";
|
|
37
37
|
/**
|
|
38
38
|
* How a layer resolves several claims on one slot.
|
|
39
39
|
*
|
package/dist/contested.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contested.d.ts","sourceRoot":"","sources":["../src/contested.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GACN,YAAY,GACZ,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"contested.d.ts","sourceRoot":"","sources":["../src/contested.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GACN,YAAY,GACZ,UAAU,GACV,KAAK,GACL,MAAM,GACN,QAAQ,CAAC;AAEb;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,IAAI,GACZ,WAAW,GACX,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,SAAS,GACT,SAAS,GACT,aAAa,CAAC;AAElB,6DAA6D;AAC7D,wBAAgB,Y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D;AAChD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,GAAE,MAAmB,GAC1B,MAAM,CAGR"}
|
package/dist/contested.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contested.js","sourceRoot":"","sources":["../src/contested.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"contested.js","sourceRoot":"","sources":["../src/contested.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAmCH,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,aAAa,CAAC;AAClF,CAAC;AAiCD,2DAA2D;AAC3D,SAAS,SAAS,CAAC,KAAwB;IACzC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,4EAA4E;AAC5E,SAAS,SAAS,CAAC,KAAY,EAAE,MAAc;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IA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