feat(events): a param that holds several values (MODULE_API 1.14.0) #213

Merged
whitlocktech merged 1 commits from feat/event-param-multiple into main 2026-10-13 01:03:22 +00:00
Member

Core half of Rust PLAN_REDESIGNS §12.3 (D344, docs#342): one event step can give several permissions, so an action param can now hold a list.

What changes

  • Declaration (modules/registries.js): multiple: true with an optional max (1–100, default 20), on a string or int param only. Refused on other types, on a duration param, on a template's inputs, with a list as the example, and as max without multiple. A param that doesn't say multiple reads back with neither key, exactly as it was declared.
  • Value (events/spec.js): stored as a JSON array. Each item is checked as the type's literal and an empty item is refused. Duplicates are dropped, keeping the first. More than max is refused with the number. A bare value counts as a list of one, and required means at least one.
  • Price (events/authorize.js): cost() gets the array. The switchboard prices a list param's example as a list of one.
  • Editor: a multi-select with the chosen values as chips. With a source, it shows a grouped checklist with a filter box. With a searchable source it uses the typeahead, each pick adding a chip. With no source it is a tag box that adds a value on Enter. Ticking past max is refused in words, and a new step starts with the example as its only value.
  • Run console: params show as name: value, with a list's values joined by commas.
  • MODULE_API 1.13.0 → 1.14.0 on both halves. engagement-triggers.json is regenerated, and the catalog's OpenAPI response schema notes the two keys.

Tests

  • New server/test/eventParamMultiple.test.js (8) and client/test/eventParamMultiple.test.js (8).
  • Server suite: 2,191 tests, 0 fail. Client: 421/421 and the build is clean. Run with MODULES_DIR set to an empty directory, as for #212.

Module-uo proof (frozen manifest against this branch)

The Module-uo main @ 6246383 run against this branch:

  • It registers 12 event actions.
  • frozenManifest --check: routes.manifest.json is current — 76 routes, all documented.
  • Server suite 723/723, client suite 45/45.

Module-uo declares ^1.10.0 and has no multiple param, so nothing it registers changes.

Next: Module-Rust's rust.perm.lend / rust.perm.give (on edge, coreApi ^1.14.0) is pinned to this branch head until this merges. Then I re-pin it to the merge sha. The docs half is a separate docs PR.

  • AI-assisted: written with Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

Core half of Rust **PLAN_REDESIGNS §12.3** (D344, docs#342): one event step can give several permissions, so an action param can now hold a list. ## What changes - **Declaration** (`modules/registries.js`): `multiple: true` with an optional `max` (1–100, default 20), on a `string` or `int` param only. Refused on other types, on a `duration` param, on a template's inputs, with a list as the `example`, and as `max` without `multiple`. A param that doesn't say `multiple` reads back with neither key, exactly as it was declared. - **Value** (`events/spec.js`): stored as a JSON array. Each item is checked as the type's literal and an empty item is refused. Duplicates are dropped, keeping the first. More than `max` is refused with the number. A bare value counts as a list of one, and `required` means at least one. - **Price** (`events/authorize.js`): `cost()` gets the array. The switchboard prices a list param's example as a list of one. - **Editor**: a multi-select with the chosen values as chips. With a source, it shows a grouped checklist with a filter box. With a searchable source it uses the typeahead, each pick adding a chip. With no source it is a tag box that adds a value on Enter. Ticking past `max` is refused in words, and a new step starts with the example as its only value. - **Run console**: params show as `name: value`, with a list's values joined by commas. - **MODULE_API 1.13.0 → 1.14.0** on both halves. `engagement-triggers.json` is regenerated, and the catalog's OpenAPI response schema notes the two keys. ## Tests - New `server/test/eventParamMultiple.test.js` (8) and `client/test/eventParamMultiple.test.js` (8). - Server suite: 2,191 tests, 0 fail. Client: 421/421 and the build is clean. Run with `MODULES_DIR` set to an empty directory, as for #212. ## Module-uo proof (frozen manifest against this branch) The Module-uo `main` @ 6246383 run against this branch: - It registers 12 event actions. - `frozenManifest --check`: *routes.manifest.json is current — 76 routes, all documented*. - Server suite 723/723, client suite 45/45. Module-uo declares `^1.10.0` and has no `multiple` param, so nothing it registers changes. **Next:** Module-Rust's `rust.perm.lend` / `rust.perm.give` (on `edge`, `coreApi ^1.14.0`) is pinned to this branch head until this merges. Then I re-pin it to the merge sha. The docs half is a separate docs PR. - [x] AI-assisted: written with Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-10-12 20:48:26 +00:00
feat(events): a param that holds several values (MODULE_API 1.14.0)
All checks were successful
PR Checks / bot-tests (pull_request) Successful in 47s
PR Checks / client-build (pull_request) Successful in 48s
PR Checks / server-tests (pull_request) Successful in 13m55s
743f1bc8b2
Rust PLAN_REDESIGNS §12.3 (D344): an event action param may declare
`multiple: true`, with an optional `max` (1-100, 20 when left out), on a
`string` or `int` param. The permission reward steps take several permissions
in one step through it.

- registries: the flag and `max` are checked at registration and served in the
  catalog; refused on other types, on a duration, on a template's inputs, and
  with a list as the example. A param that does not say it reads back exactly
  as declared, without the keys.
- spec: the value is a JSON array, each item the type's literal, duplicates
  dropped in order, at most `max`; a bare value is a list of one; `required`
  means at least one; an empty item is refused.
- authorize: a multiple param's example is priced as a list of one, since
  cost() is handed the array.
- editor: a multi-select. Chips above a grouped, filterable checklist for a
  source that answered; the typeahead for a searchable source; a tag box
  otherwise. Ticking past max is refused in words. A new step holds the
  example as a list of one.
- run console: params read as `name: value`, a list joined by commas.
- MODULE_API 1.13.0 -> 1.14.0 on both halves; engagement-triggers.json and the
  catalog's OpenAPI note regenerated.

Additive only: Module-uo (`^1.10.0`) declares no multiple param.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech approved these changes 2026-10-13 01:03:14 +00:00
whitlocktech merged commit a981b2b854 into main 2026-10-13 01:03:22 +00:00
whitlocktech deleted branch feat/event-param-multiple 2026-10-13 01:03:23 +00:00
Sign in to join this conversation.
No description provided.