1
0
Fork 0
Commit graph

893 commits

Author SHA1 Message Date
42d860da44 feat(wiki): redesign index with URL-shared filters, category portals, featured strip
Rewrite the wiki index: filters (query/tag/category/sort) sync to the URL for shareable/bookmarkable views; a moderator-curated 'Start here' featured strip; category grouping with per-category portal pages (/wiki/category/*) and CATEGORY_META blurbs; excerpt previews; case-insensitive, alphabetized tag counts; and a compact WikiRow. Updates the wiki controls tour copy.
2026-10-09 17:56:09 -04:00
2bc9e08b6f feat(wiki): add page curation for featured strip
Add a curation group to wiki-pages with featured and featuredOrder, access-gated to intelligence (wiki moderators). A page flagged featured surfaces in the 'Start here' strip on /wiki. Migration adds curation_featured (default false) and curation_featured_order (nullable).
2026-10-09 17:56:02 -04:00
cab789cf75 feat(mcp): add read-only MCP key provisioning CLI
Provision a find-only API key bound to a superuser so agents can read every collection without create/update/delete. Idempotent per label, with --rotate to replace, env selection (dev/stg/prd), and a --help flag. Wires up the new bun run mcp:key script.
2026-10-09 17:55:58 -04:00
3a2ae34b83 feat(contributions): add crowdsourced XP reward system
Reward users for helping build the app: wiki pages, mission planning
markers (queued until the mission completes), surveys, and manual awards.
Contribution XP folds into the existing virtual profile total, so it
flows into the level ladder, sidebar XP display, dashboard, and profile.

- contribution-entries ledger collection + profile progression.contributions.xpEarned bucket
- src/lib/contributions service (record/grant/expire/revoke, caps, idempotency, leaderboard) with a pure rules module
- per-mission planning-map delegation (missions:update grants) and a completed/cancelled map lock
- wiki, survey, and marker action/hook integration
- contribution:* event types, muteable notifications, permissions group, event targets
- profile Contributions section and /contributions leaderboard
- migration, reconcile tool, and integration tests
2026-10-09 16:30:05 -04:00
b28708c590 docs(agents): split domain guidance into nested AGENTS.md files
Move 19 domain sections out of the root guide into per-directory
AGENTS.md files that OpenCode v2 injects lazily when an agent reads
each subtree. The always-loaded root drops from 121KB to ~30KB and
gains a domain index table with never-miss invariants. Original root
and pre-merge sub-guides are preserved under
docs/backups/pre-agents-split-20261009/ for restoration.

Note: also carries the pre-existing uncommitted wiki-section edits to
the root AGENTS.md, preserved verbatim in src/lib/wiki/AGENTS.md.
2026-10-09 15:46:36 -04:00
4de7a4e923 feat(mcp): add read-only server instructions to the MCP plugin 2026-10-09 15:10:52 -04:00
f454d3523d docs: document read-only production MCP for agents 2026-10-09 15:10:49 -04:00
37d7297b1a feat(notifications): add staff toggle to show only your own notifications
Staff with read-all oversight (superuser / system:admin-access) see everyone's
notifications in the bell. Add a "Show all users" switch inside the dropdown,
rendered only when the caller can view others, that narrows the feed to the
caller's own notifications. The choice is remembered per browser (localStorage)
and the unread badge follows the selected scope.

The inbox route now reports canViewOthers and honors scope=all|mine; non-staff
callers are always forced to their own regardless of the param.
2026-10-09 14:43:12 -04:00
0ed7524fdf v0.7.4 - show Chronicle drafts to staff, rename Story Beats to Chronicle Entries 2026-10-09 13:48:56 -04:00
aa09252b06 feat(chronicle): show draft entries to staff on /story
Drafts were only reachable in the admin panel: /story hard-filtered to
published. Story staff (admin/developer) now see drafts in the
Chronicle, badged and clearly marked, while everyone else stays
published-only. The collection's own read access remains the backstop
(overrideAccess stays false), so a non-staff request can never leak a
draft.

- page: staff fetch all entries, others published-only
- new DraftBadge (amber pill) rendered in the list, immersive reader,
  book view, and table of contents
- drafts hide the read marker and reactions
- front-end copy adopts Chronicle wording
2026-10-09 13:48:51 -04:00
dffcd0013c chore(chronicle): rename Story Beats to Chronicle Entries
The Chronicle collections were auto-labeled from their slugs ("Story
Beats"). Give them explicit Chronicle labels and adopt the word
Chronicle in the surrounding titles, descriptions, and event text.

- StoryBeats: labels Chronicle Entry/Entries, admin group Story ->
  Chronicle, descriptions updated
- Voiceovers / StoryBeatStates: Chronicle labels, group, descriptions
  (including the "beat" field label)
- GameEventLogs: event-log target labels -> Chronicle Entries / States
- lib/story: event message text -> "chronicle entry" (internal
  event-type strings left intact so existing logs stay valid)
- regenerate payload-types.ts

Slugs are unchanged, so no migration is required.
2026-10-09 13:48:14 -04:00
a696a864ca docs: add v0.7.3 changelog entry 2026-10-09 13:22:05 -04:00
2687402d5c v0.7.3 - add on-hold campaign status, per-recipient notification read state, voiceover + bot fixes 2026-10-09 13:16:18 -04:00
b0ce171c2e test(voiceover): add per-script submission count test 2026-10-09 13:14:35 -04:00
9f9257cadf test(notifications): add per-recipient read-scope test 2026-10-09 13:14:35 -04:00
5c06e9f40f chore(payload): regenerate admin import map
Regenerated the Payload admin import map to pick up the LaborCrewField
admin component. Unrelated to the campaign/notifications changes; kept in
its own commit so the feature commits stay focused.
2026-10-09 13:13:27 -04:00
741469e88e fix(voiceover): scope script submission counts per script
listScriptsForUser passes all submissions at once, so a take on one
script was being counted under every script's card. Skip submissions
whose script id doesn't match the card being rendered so each count stays
scoped to its own script.
2026-10-09 13:13:19 -04:00
66e70d3d56 feat(notifications): scope notification read state per recipient
Read state is personal to the recipient. Marking a notification read now
only ever flips the acting user's own rows — never another user's, even
when staff view it via read-all oversight (which would otherwise hide it
from its real owner).

- add /api/notifications/inbox endpoint that enriches each row with
  ownerId, ownerName, and isMine so the bell can label "meant for
  someone else" rows
- move mark-read logic into per-user lib helpers (markNotificationsReadForUser,
  markAllNotificationsReadForUser) and have the actions delegate
- surface ownership in the bell UI and skip marking rows that aren't mine
2026-10-09 13:13:16 -04:00
c019e642a3 feat(campaigns): hide completed campaigns by default
Default the campaigns list "Show completed" toggle to off, so only
ongoing campaigns show until the user opts in. Renamed the toggle from
"Hide completed" to "Show completed" and flipped the empty-state link to
turn completion visibility on.
2026-10-09 13:13:09 -04:00
6f3d1a4147 feat(campaigns): let owners set campaign status from the detail page
Add a Campaign Status dropdown on the campaign detail page, gated by
campaign ownership or the campaigns:update permission (mirroring the
existing requireCampaignOwnership gate). Owners can set On Hold to pause
a campaign they are not actively running, and flip it back; admins act
through the same control. The editor optimistically updates the field,
toasts on success, refreshes the view, and reverts on failure.

- new CampaignStatusEditor client component (optimistic select + save)
- updateCampaignStatus server action (owner OR campaigns:update)
- render the editor on the detail page for authorized users
- add "On Hold" to the create dialog status options
- color + label the new status on cards and campaign rows (missions,
  factions, dashboard) so it never renders as raw "onHold"
2026-10-09 13:13:05 -04:00
19112bcde1 feat(campaigns): add on-hold campaign status
Introduce an "onHold" campaign status, placed between inProgress and
completed in the select. The enum value is added via a migration
(ALERT TYPE enum_campaigns_status ADD VALUE 'onHold' BEFORE 'completed'),
the type is regenerated, and every Record<Campaign["status"]> map now
includes onHold so the build stays green.

- Campaigns.ts: add "On Hold" status option
- migration 20261009_160740_add_campaign_on_hold_status + registration
- regenerate payload-types.ts
2026-10-09 13:12:49 -04:00
8469502e9f fix(bot): compute Friday ops slot window in Eastern time, not server clock
The open-slot notice fired for a claimed slot because upcomingFridayRange
built its query window from the server-local calendar. On the UTC deploy
container, Wednesday 8 PM ET is already Thursday, so the window became
Fri 00:00Z-23:59Z (Thu 8 PM ET - Fri 8 PM ET) and any op starting Friday
evening Eastern fell outside it: hasMissionOnFriday said open,
getFridayClaimant found no claimant, and the dedup token rendered the
wrong date (October 8 instead of October 9).

The window is now Friday 00:00-23:59:59.999 America/New_York computed
from the Eastern calendar date, identical on any server timezone. When it
is already Friday Eastern, that day itself is the slot, keeping the dedup
token stable from Wednesday through the op day so late claims still
credit. Tests use explicit UTC instants plus a regression case for the
prod scenario, verified under TZ=UTC and America/New_York.
2026-10-08 14:01:07 -04:00
e57633c575 docs: add v0.7.2 changelog entry 2026-10-08 13:44:24 -04:00
42fbaefe8b v0.7.2 - fix modlist uploads, validate launcher presets 2026-10-08 13:39:13 -04:00
cc9d3b8073 fix(missions): only accept Arma 3 Launcher preset exports as mod lists
Root cause of the upload failures: the launcher writes an
<?xml version="1.0"?> prologue, Payload sniffs uploads with
fileTypeFromBuffer, and the collection mimeTypes allowlist lacked
application/xml, so every genuine launcher export was rejected with
'Invalid MIME type: application/xml'.

- Add application/xml to the mod-lists upload mimeTypes (the document is
  still stored as text/html; verified end to end).
- New pure parser src/lib/modlistPreset.ts validates the launcher export
  structure (arma:Type=preset meta + data-type=ModContainer rows) and is
  shared by the server action (authoritative) and CreateSideOpDialog
  (instant client-side feedback).
- Plain-text lists are no longer accepted anywhere: dialog accept/hint,
  collection mimeTypes, and the action now agree on HTML presets only.
- Upload name defaults to the preset's own arma:PresetName.
- Tests: tests/int/modlist-preset.int.spec.ts (9 cases).
2026-10-08 13:25:08 -04:00
27bf97946e docs: add v0.7.0 and v0.7.1 changelog entries 2026-10-08 12:43:57 -04:00
81d31d705d v0.7.1 - persist voice takes, mod lists and mission files on the media volume 2026-10-08 12:25:16 -04:00
8e42077c1f fix(uploads): store upload collections under the persistent media volume
VoiceSubmissions, ModLists and MissionFiles relied on Payload's default
upload staticDir (the collection slug resolved from cwd), so prod wrote
their files to /app/<slug> instead of the mounted /app/media volume and
every redeploy wiped them (voice takes returned 500 on play/download).
Pin all three under media/ subdirs like story Voiceovers already does,
add regression guards, and fix the audio-preview fallbacks that pointed
at the media collection's file route instead of the owning collection.
2026-10-08 12:14:46 -04:00
6cd94c31f8 v0.7.0 - add Labor Crew admin panel, fix npc-dialogue countdown spacing 2026-10-07 23:29:02 -04:00
0370df6c2d feat(game-structures): add Labor Crew admin panel for staffing writes
Wire the previously orphaned LaborCrewPanel into the game-structures
editor so staff can set actual headcount and per-worker wage for a
labor classification. Adds a laborCrewPanel ui field on the edit view,
a POST route under /api/game-structures that authenticates and gates on
game-structures:update, delegates to the canonical setLaborHeadcount
service (enforcing caps and wage logic), and an integration test
covering auth, validation, and cap enforcement.
2026-10-07 23:28:35 -04:00
02307aa2ee fix(npc-dialogue): split countdown units into controlled-gap cells
The countdown rendered each time unit with a raw monospace space,
which reads wide and odd when inline with proportional text. Split the
value into per-unit inline-flex cells separated by a CSS gap so spacing
stays consistent, and cover the new markup in the interpolate
integration test.
2026-10-07 23:28:31 -04:00
375023f708 fix(mcp): backfill missing capability columns on payload_mcp_api_keys
The plugin generates one checkbox column per enabled collection
(<slug>_find/_create/_update/_delete), but only recent feature migrations
added theirs; 256 columns for older collections were never created, so any
query against the keys table failed with 'column does not exist' (HTTP 500
on list/create). Adds an idempotent ALTER TABLE IF NOT EXISTS migration for
all missing columns, registered in the migration index with a full-schema
snapshot sidecar (migrate:create reports no diff since the snapshot chain
already contained them).
2026-10-07 18:26:42 -04:00
f97912f1c1 fix(mcp): gate API-key collection with system:admin-access so superusers can issue keys
The MCP plugin's key collection was gated by hasRoles(), which reads only
the legacy roles enum column. All current admins authenticate through
dynamic roleDocs superuser roles, so nobody could create an MCP API key
and every client of /api/mcp got 401. Both override blocks (MCP keys and
the AI plugin instructions) now use requirePermission('system:admin-access'),
and the sync-only admin.hidden checks were dropped in favor of the read
gate, matching the repo's requireAdminPageAccess pattern.

Adds tests/int/mcp-api-keys.int.spec.ts covering the plain-user rejection,
dynamic-superuser key creation with HMAC index resolution (mirroring the
plugin's resolveAccessSettings), explicit system:admin-access grants, and
read visibility.
2026-10-07 18:21:06 -04:00
a96eddf32c feat(npc-dialogue): bigger flow handles + delete edges via Delete
- Enlarge flow-editor wire handles from size-2 (8px) to size-3 (12px) so
  they are easier to click and grab.
- Select an edge by clicking it, then remove it with the Delete key.
  Selection is tracked in state and the highlight renders through BaseEdge
  stroke props so the chosen line stands out.
- Edges are a derived projection, so deletion scrubs the hop from the
  source node data via a new pure removeHopFromNode() helper in dialogue.ts
  (choice row, condition branch, or single continuation).
- Add tests/int/npc-dialogue-remove-hop.int.spec.ts (4 tests).
2026-10-07 14:25:14 -04:00
538b7d4c4c feat(npc-dialogue): reorder choices in the dialogue editor
Choice rows in the dialogue node editor now have up/down buttons so a
choice can be moved up or down into the desired order, which is the
order shown to the player. The swap lives in a pure reorderChoice
helper (no-op at the edges, input not mutated) with a focused test.
2026-10-07 14:01:00 -04:00
9f0f7db612 feat(npc-dialogue): auto-grow the dialogue line box to fit its content
The Line textarea in the dialogue node editor grows to fit its content
up to a 200px default max, so long lines no longer scroll in a
fixed-height box. It stays drag-resizable (resize-y) and the user can
still expand it past the max.

The auto-grow hooks run above the early-return guard so their call
order never changes, fixing a Rules of Hooks violation the change would
otherwise introduce.
2026-10-07 14:00:15 -04:00
f643028638 feat(npc-dialogue): let event flag effects target self, global, or a specific user
Event node flag effects previously always wrote the active participant's
flag. A flag's identity is (owner, key), so the same key can hold
independent values for different owners, but there was no way to target
them from the editor.

- Add flagTarget ("self" | "global" | "user") + flagTargetUserId to
  NpcDialogueEffect. "self" (default) keeps current behavior.
- Add resolveFlagOwner (flags.ts) to map a scope onto the player-flags
  user column; "user" with no id falls back to the participant so a
  misconfigured effect never nudges the global flag.
- Move applyFlagEffect into flags.ts, parameterized by resolved owner;
  the runtime action resolves the owner and delegates.
- Add a Target control (+ user picker) to the event node editor and
  validateGraph enforcement for the "user" scope.
- Integration tests cover owner resolution and self/global/user writes.
2026-10-07 13:33:52 -04:00
2231cc86ee feat(dashboard): flag restricted events with a lock icon in Recent Events 2026-10-07 13:07:23 -04:00
03c8794026 docs: add v0.6.0 changelog entry 2026-10-07 01:54:09 -04:00
cbccc09e23 v0.6.0 - npc dialogue markup and tooltips, event log visibility, reinforcement pools, ticket archiving 2026-10-07 01:48:11 -04:00
33ed389be0 docs: polish v0.5.x changelog copy 2026-10-07 01:48:01 -04:00
207de71153 fix(dev): allow LAN hosts in allowedDevOrigins so the dev server hydrates on other devices 2026-10-07 01:48:01 -04:00
e0f305b026 feat(tickets): allow staff to archive tickets, hiding them from the front-end
Archived tickets disappear from every front-end surface for all users
(staff included): helpdesk list, detail page 404s, dashboard widget, and
project board/sprints/releases/search views. They remain fully visible in
the Payload admin panel, where un-archiving restores them. The collection
hook stamps archivedAt and appends an activity entry on each toggle; the
archiveTicket server action is tickets:staff gated and emits a
ticket:archive event. Edits and votes on archived tickets are rejected.
2026-10-07 01:22:51 -04:00
38e6b3d89f feat(reinforcement-pools): store per-pool balances and sync to the game bridge
New Game collection reinforcement-pools (name, faction, armaFactions,
available, enabled) with manual-edit audit via reinforcement:adjust. The
events hook applies reinforcement.spawn/.refund deltas (soft limits, no
floor, idempotent by eventId) before the game's next pull, and a new GET
/api/arma/v1/reinforcements endpoint serves enabled pools to the server.
2026-10-07 00:28:42 -04:00
565e190c7e test(arma-locker-sync): scope locker.apply assertions to this run
The helper counted arma-commands DB-wide, so any spec file that leaves a
game-server online (operation-*, supply-*, respawn-tickets) made later
web-originated locker edits leak into the count once vitest's timing-based
file order put those files first. Filter commands by this run's instance
refs, and mark the grid-metadata fixture write with the lockerSyncOrigin
context flag so it stops enqueuing an echo command of its own.
2026-10-06 23:31:38 -04:00
8cda724e21 feat(event-log): configurable per-event visibility with permission gates
- game-event-logs gains visibility (public|restricted) + requiredPermissions
  (any-of gate from the permission registry); read access becomes a Where
  clause: public OR actor-is-me OR held permission; superusers and
  game-event-logs:update staff see all; admin panel gate unchanged
- src/utils/event-log/visibility.ts: per-type policy map consumed by
  emitGameEvent, with per-emit overrides; npc:dialogue and flag:set start
  restricted, everything else stays public
- PlayerFlags hooks emit restricted flag:set audit events on every flag
  write (admin edits and dialogue effects alike)
- fix dashboard RecentEvents leaking events: local API find now runs as
  the viewer with overrideAccess false
- SSE broadcast sends an opaque nudge for restricted events instead of
  type/actor metadata
- /events table marks restricted rows with a lock badge
- migration 20261007_025942_add_event_log_visibility + regenerated types
- tests/int/event-log-visibility.int.spec.ts (8 cases)
2026-10-06 23:31:30 -04:00
b1168dcc38 fix(personnel): mobile layout for conversations
- Converse button no longer floats over the hero text on phones: it sits
  in the card's content flow below the status chips and only anchors to
  the hero's right edge from md up
- conversation dialog keeps a side margin on small screens instead of
  rendering edge-to-edge
- dialog titles truncate with min-w-0 so long NPC names and attachment
  urls cannot push the close buttons out
2026-10-06 17:21:26 -04:00
6d2cde88db fix(npc-dialogue): content-only flow hashing for NEW badges
Rearranging nodes on the canvas (positions, edge ids, styling) no longer
changes the flow hash, so tidying a conversation in the editor does not
re-badge it as NEW for every player. The hash now covers node identity,
type, data, and edge source/target with order-independent serialization;
real text or branching edits still re-flag.
2026-10-06 17:15:34 -04:00
f595828c99 feat(npc-dialogue): stacked markup, link popups, new badges, locked choices, timed flags
- DialogueText rewritten as a recursive parser so markup accumulates
  ({green}**bold green**{/} and friends nest freely, colors close inner-first)
- [label](url) dialogue links open in an iframe popup dialog so
  conversation progress survives; only http(s)/relative urls render
- NEW badges: Converse button + choice buttons badge unread paths via a
  per-browser seen map (ptf:npc-dialogue-seen) keyed by flow hash, so GM
  edits re-flag the conversation
- choices gain lockedHint: failing conditions can show the choice disabled
  with a rich tooltip instead of hiding it (evaluateNpcDialogueChoices now
  returns ChoiceGate pass/showLocked pairs)
- player flags gain activatesAt/expiresAt time windows honored by readFlag,
  flag effects gain flagDelayMinutes for slow-burn writes, and
  {{countdown:key}} tokens tick live toward activation (done/missing states)
- migration 20261006_add_flag_time_windows; spec extended to 33 tests
2026-10-06 17:06:27 -04:00
c1e13e5dc9 feat(npc-dialogue): entry gates and priority for multi-conversation selection
- npc-dialogues gains priority + entryGate (flag key/op/amount) fields
- contact page offers the highest-priority conversation whose gate
  passes (ungated = fallback, ties by oldest); only the winner's flow
  leaves the server so locked story content never reaches clients
- extract shared flag reads (readFlag/evaluateCondition) to
  lib/npc-dialogue/flags and pure selection to lib/npc-dialogue/selection
- migration 20261006_203217_add_dialogue_entry_gate; spec covers
  ordering, gating, fallback, and storage round-trip
2026-10-06 16:42:56 -04:00