diff --git a/docs/OPERATOR_GUIDE_API_ONLY.md b/docs/OPERATOR_GUIDE_API_ONLY.md deleted file mode 100644 index bbf5ea7..0000000 --- a/docs/OPERATOR_GUIDE_API_ONLY.md +++ /dev/null @@ -1,46 +0,0 @@ -# Operator Guide: API-Only Canonical Policy Operations - -## Canonical Source of Truth - -1. Canonical policy authority is SQLite (`policy_item`, `policy_variant`, `policy_activation`, related audit tables). -2. Runtime reads effective policy state via Layer 3 activation mapping only. -3. World policy files under `data/worlds//policies/**` are not runtime authority. - -## Artifact Import Workflow - -Use deterministic publish artifacts as the only supported import/bootstrap path: - -```bash -mud-server import-policy-artifact --artifact-path /abs/path/publish_.json -``` - -Optional: - -```bash -mud-server import-policy-artifact --artifact-path /abs/path/publish_.json --no-activate -``` - -## init-db Bootstrap Behavior - -`mud-server init-db` now bootstraps policies by importing `latest.json` pointer artifacts from -`pipe-works-world-policies/worlds//world/latest.json` (or from `MUD_POLICY_EXPORTS_ROOT`). - -If the pointer is missing, bootstrap logs a warning and continues. - -## Breaking Change Summary - -The following legacy file-import commands were removed: - -1. `import-species-policies` -2. `import-layer2-policies` -3. `import-tone-prompt-policies` -4. `import-world-policies` - -## Command Replacement Table - -| Removed Command | Replacement | -|---|---| -| `mud-server import-species-policies --world-id ` | `mud-server import-policy-artifact --artifact-path ` | -| `mud-server import-layer2-policies --world-id ` | `mud-server import-policy-artifact --artifact-path ` | -| `mud-server import-tone-prompt-policies --world-id ` | `mud-server import-policy-artifact --artifact-path ` | -| `mud-server import-world-policies --world-id ` | `mud-server import-policy-artifact --artifact-path ` | diff --git a/docs/POLICY_SERVICE_PACKAGE_DESIGN.md b/docs/POLICY_SERVICE_PACKAGE_DESIGN.md deleted file mode 100644 index 5678397..0000000 --- a/docs/POLICY_SERVICE_PACKAGE_DESIGN.md +++ /dev/null @@ -1,100 +0,0 @@ -# Policy Service Package Design - -This document defines the architecture boundaries for the policy service package at -`src/mud_server/services/policy/`. - -## Goals - -1. Keep canonical policy operations DB/artifact-first. -2. Keep `mud_server.services.policy_service` as a stable facade for canonical callers. -3. Remove legacy world-file import/read pathways from runtime and service surfaces. - -## Canonical Invariants - -1. Canonical policy identity is represented by policy object fields and stored in SQLite. -2. Activation (`policy_activation`) and variant status (`policy_variant.status`) are distinct concerns. -3. Runtime effective policy resolution is computed from activation mappings, not file paths. -4. Publish artifacts are deterministic exchange outputs, not runtime authority. -5. Artifact import is idempotent at policy identity + variant granularity. - -## Package Modules - -### `types.py` - -Defines shared typed structures used across policy modules, including: - -- `ActivationScope` -- `EffectiveAxisBundle` - -### `errors.py` - -Defines canonical policy service exceptions consumed by facade and route layers. - -### `constants.py` - -Defines canonical constants used by policy validation and import/publish paths. - -### `utils.py` - -Implements normalization and shared utility helpers used across modules. - -### `hashing.py` - -Owns deterministic content hashing helpers used by upsert and publish flows. - -### `validation.py` - -Owns policy content validation and policy-type specific rules. - -### `activation.py` - -Owns activation writes, activation listing, and effective activation overlays. - -### `runtime_resolution.py` - -Owns runtime effective resolution for policy variants, prompt templates, and axis bundle payloads. - -### `publish.py` - -Owns deterministic publish runs and manifest generation. - -### `artifact_import.py` - -Owns canonical artifact ingestion into policy tables. - -## Facade Contract - -`src/mud_server/services/policy_service.py` provides compatibility wrappers for canonical APIs only. - -Supported canonical facade exports: - -- `list_policies` -- `get_policy` -- `validate_policy_variant` -- `upsert_policy_variant` -- `set_policy_activation` -- `list_policy_activations` -- `resolve_effective_policy_activations` -- `get_effective_policy_variant` -- `resolve_effective_prompt_template` -- `resolve_effective_axis_bundle` -- `publish_scope` -- `get_publish_run` -- `import_published_artifact` -- `parse_scope` - -Removed legacy exports are intentionally absent. - -## Legacy Removal Scope - -Removed from service/CLI surface: - -1. Legacy world-policy file import entry points. -2. Legacy path-to-policy mapping helpers. -3. Legacy runtime fallback assumptions that imply file-path canonicality. - -## Testing Expectations - -1. Unit coverage for validation, activation overlays, runtime resolution, publish, and artifact import. -2. Integration coverage for policy API routes and CLI retained commands. -3. Regression coverage proving DB/runtime behavior does not depend on legacy world policy files. diff --git a/docs/source/api_reference.rst b/docs/source/api_reference.rst index deb49e2..b1e6ffb 100644 --- a/docs/source/api_reference.rst +++ b/docs/source/api_reference.rst @@ -220,6 +220,42 @@ Removed (breaking change): * ``/api/lab/world-prompts/*`` * ``/api/lab/world-policy-bundle/*`` +Canonical Policy APIs +~~~~~~~~~~~~~~~~~~~~~ + +These endpoints provide the DB-first policy control plane. All require +admin or superuser session scope. + +* ``GET /api/policy-capabilities`` - Return allowed policy types/statuses for current role +* ``GET /api/policies`` - List canonical policy variants with optional filters +* ``GET /api/policies/{policy_id}`` - Get one policy variant (optional ``variant`` query) +* ``POST /api/policies/{policy_id}/validate`` - Validate a policy variant payload +* ``PUT /api/policies/{policy_id}/variants/{variant}`` - Validate and upsert a variant +* ``POST /api/policy-activations`` - Set one activation pointer for world/client scope +* ``GET /api/policy-activations`` - List activation pointers (effective overlay by default) +* ``POST /api/policy-publish`` - Publish deterministic manifest/artifact metadata +* ``GET /api/policy-publish/{publish_run_id}`` - Fetch one persisted publish run +* ``POST /api/policy-import`` - Import one publish artifact payload into canonical DB state +* ``GET /api/policy/hash-snapshot`` - Return deterministic world-scope hash snapshot from effective activations + +Publish request example: + +.. code-block:: json + + { + "world_id": "pipeworks_web", + "client_profile": null + } + +Import request example: + +.. code-block:: json + + { + "artifact": { "...": "publish_manifest_payload" }, + "activate": true + } + Pipeline Generation ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/architecture.rst b/docs/source/architecture.rst index f2bca38..c291843 100644 --- a/docs/source/architecture.rst +++ b/docs/source/architecture.rst @@ -127,7 +127,9 @@ Package Layout │ │ ├── game.py # Commands, chat, status, heartbeat │ │ ├── auth.py # Login, logout, session selection │ │ ├── admin.py # Admin dashboard + management routes - │ │ ├── lab.py # Axis Descriptor Lab canonical draft APIs + │ │ ├── lab.py # Axis Descriptor Lab diagnostics + prompt compile APIs + │ │ ├── policies.py # Canonical policy CRUD/activation/publish/import APIs + │ │ ├── policy.py # Canonical policy hash snapshot API │ │ └── register.py # Route assembly helper │ ├── auth.py # DB-backed sessions with TTL │ ├── password.py # bcrypt hashing via passlib @@ -283,7 +285,8 @@ Located in ``src/mud_server/translation/``: from ``world.json``. See :doc:`translation_layer` for the full service contract and -prompt template format. See :doc:`lab_artifact_editor` for the server-backed draft and promotion workflow exposed to the Axis Descriptor Lab. +prompt template format. See :doc:`lab_artifact_editor` for the DB-first +Axis Descriptor Lab diagnostics and prompt compilation workflow. Event Bus Architecture ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/database.rst b/docs/source/database.rst index c5107b4..9288571 100644 --- a/docs/source/database.rst +++ b/docs/source/database.rst @@ -182,6 +182,88 @@ The ASCII diagram below reflects the current SQLite schema in ``data/mud.db``. | NN value TEXT | +----------------------------------+ + + +----------------------------------+ + | policy_item | + +----------------------------------+ + | PK policy_id TEXT | + | NN policy_type TEXT | + | NN namespace TEXT | + | NN policy_key TEXT | + | NN created_at TEXT | DEFAULT CURRENT_TIMESTAMP + | UNI(policy_type, namespace, policy_key) + +----------------------------------+ + + + +----------------------------------+ + | policy_variant | + +----------------------------------+ + | PK id INTEGER | + | NN policy_id TEXT | FK -> policy_item.policy_id (ON DELETE CASCADE) + | NN variant TEXT | + | NN schema_version TEXT | + | NN policy_version INTEGER | + | NN status TEXT | CHECK IN (draft, candidate, active, archived) + | NN content_json TEXT | + | NN content_hash TEXT | + | NN updated_at TEXT | + | NN updated_by TEXT | + | UNI(policy_id, variant) + +----------------------------------+ + + + +----------------------------------+ + | policy_activation | + +----------------------------------+ + | PK world_id TEXT | FK -> worlds.id (ON DELETE CASCADE) + | PK client_profile TEXT | DEFAULT '' + | PK policy_id TEXT | FK -> policy_item.policy_id (ON DELETE CASCADE) + | NN variant TEXT | FK -> policy_variant(policy_id, variant) + | NN activated_at TEXT | + | NN activated_by TEXT | + | rollback_of_activation_id INTEGER | + +----------------------------------+ + + + +----------------------------------+ + | policy_validation_run | + +----------------------------------+ + | PK id INTEGER | + | NN policy_id TEXT | + | NN variant TEXT | + | NN is_valid INTEGER | CHECK IN (0, 1) + | NN errors_json TEXT | DEFAULT '[]' + | NN validated_at TEXT | + | NN validated_by TEXT | + +----------------------------------+ + + + +----------------------------------+ + | policy_audit_event | + +----------------------------------+ + | PK id INTEGER | + | NN event_type TEXT | + | world_id TEXT | + | NN client_profile TEXT | DEFAULT '' + | policy_id TEXT | + | variant TEXT | + | NN actor TEXT | + | NN event_payload_json TEXT | DEFAULT '{}' + | NN created_at TEXT | + +----------------------------------+ + + + +----------------------------------+ + | policy_publish_run | + +----------------------------------+ + | PK id INTEGER | + | NN world_id TEXT | FK -> worlds.id (ON DELETE CASCADE) + | NN client_profile TEXT | DEFAULT '' + | NN actor TEXT | + | NN manifest_json TEXT | + | NN created_at TEXT | + +----------------------------------+ + Notes ----- @@ -198,6 +280,9 @@ Notes in-world sessions must set both and match character ownership/world. - Axis state is tracked in **normalized tables** (``axis``, ``axis_value``, ``character_axis_score``) with an **event ledger** (``event*`` tables). +- Canonical policy control-plane state lives in ``policy_*`` tables. + Runtime policy reads use effective ``policy_activation`` pointers rather than + world package files. - ``world_permissions`` stores invite-style access grants. Open-world access is policy-driven from config and may not require a row in this table. - Hot-path indexes are intentionally maintained for world-scoped session activity, diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 8610bcf..b569f66 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -39,7 +39,14 @@ Initialize Database This creates the SQLite database with required tables. If ``MUD_ADMIN_USER`` and ``MUD_ADMIN_PASSWORD`` are set and no users exist, ``init-db`` also -bootstraps the superuser. +attempts superuser bootstrap. + +By default, ``init-db`` also bootstraps canonical policy artifacts for +discovered worlds using ``latest.json`` pointers from the policy export repo +(``pipe-works-world-policies``). To control this behavior: + +* Set ``MUD_POLICY_EXPORTS_ROOT`` to an explicit export-repo root path. +* Use ``mud-server init-db --skip-policy-import`` to skip bootstrap import. Create Superuser ~~~~~~~~~~~~~~~~ @@ -158,9 +165,25 @@ To create your own world: 1. Create ``data/worlds//world.json``. 2. Add one or more zone files under ``data/worlds//zones/``. -3. Initialize DB and import canonical policy artifacts into SQLite policy tables. -4. Activate policy variants for the target world scope. -5. Restart the server so the world package is loaded. +3. Initialize DB: + + .. code-block:: bash + + mud-server init-db + +4. Import canonical policy artifact for the world (if needed): + + .. code-block:: bash + + mud-server import-policy-artifact --artifact-path /abs/path/publish_.json + +5. Verify effective activation for the world scope: + + .. code-block:: bash + + curl -s "http://127.0.0.1:8000/api/policy-activations?scope=&effective=true&session_id=" + +6. Restart the server so the world package is loaded. No code changes are required. @@ -351,6 +374,9 @@ Optional configuration: * - ``MUD_ADMIN_PASSWORD`` - (none) - Superuser password for create-superuser or init-db bootstrap + * - ``MUD_POLICY_EXPORTS_ROOT`` + - (auto-resolved) + - Override root path used by ``init-db`` artifact bootstrap + publish/import flows * - ``MUD_REQUEST_TIMEOUT`` - ``30`` - HTTP request timeout (seconds) for TUI @@ -408,9 +434,18 @@ The ``mud-server`` CLI provides these commands: .. code-block:: text mud-server init-db Initialize database schema + mud-server import-policy-artifact Import one canonical publish artifact mud-server create-superuser Create a superuser account mud-server run Start the server +Policy bootstrap/import helpers: + +.. code-block:: text + + mud-server init-db --skip-policy-import + mud-server import-policy-artifact --artifact-path /abs/path/publish_.json + mud-server import-policy-artifact --artifact-path /abs/path/publish_.json --no-activate + The ``pipeworks-admin-tui`` CLI (requires ``[admin-tui]`` extra): .. code-block:: text diff --git a/docs/source/index.rst b/docs/source/index.rst index 95b852e..dedc7d7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -22,6 +22,7 @@ JSON-driven world data, and clean architecture. security admin_web_ui_mtls play_web_ui + operator_guide_api_only extending examples @@ -30,6 +31,7 @@ JSON-driven world data, and clean architecture. :caption: Reference api_reference + policy_service_package_design Changelog .. toctree:: diff --git a/docs/source/lab_artifact_editor.rst b/docs/source/lab_artifact_editor.rst index f43b778..bcac85a 100644 --- a/docs/source/lab_artifact_editor.rst +++ b/docs/source/lab_artifact_editor.rst @@ -55,11 +55,17 @@ Operational Flow (DB-Only) mud-server init-db -2. Import canonical artifact into DB (optional activation in same step): +2. Import canonical artifact into DB (activation is enabled by default): .. code-block:: bash - mud-server import-policy-artifact --artifact-path /path/to/artifact.json --activate + mud-server import-policy-artifact --artifact-path /path/to/artifact.json + + To import without applying activation pointers: + + .. code-block:: bash + + mud-server import-policy-artifact --artifact-path /path/to/artifact.json --no-activate 3. Verify effective activation pointers: @@ -93,7 +99,7 @@ Operational Flow (DB-Only) curl -s -X POST "http://127.0.0.1:8000/api/policy-publish?session_id=" \ -H "Content-Type: application/json" \ - -d '{"scope":"pipeworks_web"}' + -d '{"world_id":"pipeworks_web"}' Artifacts are exchange outputs and should be committed in ``pipe-works-world-policies``. They are not runtime authority. diff --git a/docs/source/ledger.rst b/docs/source/ledger.rst index 78cf15f..34707d3 100644 --- a/docs/source/ledger.rst +++ b/docs/source/ledger.rst @@ -68,7 +68,7 @@ Envelope Format Every JSONL line is a self-contained JSON object: -.. code-block:: json +.. code-block:: text { "event_id": "a3f91c9e2d4b5e6f...", diff --git a/docs/source/operator_guide_api_only.rst b/docs/source/operator_guide_api_only.rst new file mode 100644 index 0000000..d86da74 --- /dev/null +++ b/docs/source/operator_guide_api_only.rst @@ -0,0 +1,71 @@ +Operator Guide: API-Only Canonical Policy Operations +===================================================== + +Canonical Source of Truth +------------------------- + +1. Canonical policy authority is SQLite (``policy_item``, ``policy_variant``, + ``policy_activation``, and related audit tables). +2. Runtime reads effective policy state via Layer 3 activation mapping only. +3. World policy files under ``data/worlds//policies/**`` are not runtime authority. + +Artifact Import Workflow +------------------------ + +Use deterministic publish artifacts as the only supported import/bootstrap path: + +.. code-block:: bash + + mud-server import-policy-artifact --artifact-path /abs/path/publish_.json + +Optional (import without activation): + +.. code-block:: bash + + mud-server import-policy-artifact --artifact-path /abs/path/publish_.json --no-activate + +init-db Bootstrap Behavior +-------------------------- + +``mud-server init-db`` bootstraps policies by importing ``latest.json`` pointer artifacts from: + +``/worlds//world/latest.json`` + +Policy exports root resolution order: + +1. ``MUD_POLICY_EXPORTS_ROOT`` environment variable. +2. Sibling repository next to the active CLI repo root (derived from current working directory). +3. Sibling repository next to ``PROJECT_ROOT`` (historical default). + +If ``latest.json`` is missing for a world, bootstrap logs a warning and continues. +If ``latest.json`` exists but points to a missing artifact file, that world import fails and is reported. +If one or more world imports fail, ``init-db`` exits non-zero. + +Use ``mud-server init-db --skip-policy-import`` when you need schema/init only. + +Breaking Change Summary +----------------------- + +The following legacy file-import commands were removed: + +1. ``import-species-policies`` +2. ``import-layer2-policies`` +3. ``import-tone-prompt-policies`` +4. ``import-world-policies`` + +Command Replacement Table +------------------------- + +.. list-table:: + :header-rows: 1 + + * - Removed Command + - Replacement + * - ``mud-server import-species-policies --world-id `` + - ``mud-server import-policy-artifact --artifact-path `` + * - ``mud-server import-layer2-policies --world-id `` + - ``mud-server import-policy-artifact --artifact-path `` + * - ``mud-server import-tone-prompt-policies --world-id `` + - ``mud-server import-policy-artifact --artifact-path `` + * - ``mud-server import-world-policies --world-id `` + - ``mud-server import-policy-artifact --artifact-path `` diff --git a/docs/source/policy_service_package_design.rst b/docs/source/policy_service_package_design.rst new file mode 100644 index 0000000..1a8024d --- /dev/null +++ b/docs/source/policy_service_package_design.rst @@ -0,0 +1,107 @@ +Policy Service Package Design +============================= + +This document defines architecture boundaries for the policy service package at +``src/mud_server/services/policy/``. + +Goals +----- + +1. Keep canonical policy operations DB/artifact-first. +2. Keep ``mud_server.services.policy_service`` as a stable facade for canonical callers. +3. Remove legacy world-file import/read pathways from runtime and service surfaces. + +Canonical Invariants +-------------------- + +1. Canonical policy identity is represented by policy object fields and stored in SQLite. +2. Activation (``policy_activation``) and variant status (``policy_variant.status``) are distinct concerns. +3. Runtime effective policy resolution is computed from activation mappings, not file paths. +4. Publish artifacts are deterministic exchange outputs, not runtime authority. +5. Artifact import is idempotent at policy identity + variant granularity. + +Package Modules +--------------- + +``types.py`` + Defines shared typed structures used across policy modules, including: + ``ActivationScope``, ``EffectiveAxisBundle``, and ``EffectiveImagePolicyBundle``. + +``errors.py`` + Defines canonical policy service exceptions consumed by facade and route layers. + +``constants.py`` + Defines canonical constants used by policy validation and import/publish paths. + +``utils.py`` + Implements normalization and shared utility helpers used across modules. + +``hashing.py`` + Owns deterministic content hashing helpers used by upsert and publish flows. + +``validation.py`` + Owns policy content validation and policy-type specific rules. + +``activation.py`` + Owns activation writes, activation listing, and effective activation overlays. + +``runtime_resolution.py`` + Owns runtime effective resolution for policy variants, prompt templates, axis bundles, + and image-policy diagnostic bundles. + +``publish.py`` + Owns deterministic publish runs and manifest generation. + +``artifact_import.py`` + Owns canonical artifact ingestion into policy tables. + +``paths.py`` + Owns policy export root resolution used by artifact bootstrap/import flows. + +Facade Contract +--------------- + +``src/mud_server/services/policy_service.py`` provides compatibility wrappers for canonical APIs. + +Supported canonical facade exports: + +* ``list_policies`` +* ``get_policy`` +* ``get_policy_capabilities`` +* ``validate_policy_variant`` +* ``upsert_policy_variant`` +* ``set_policy_activation`` +* ``list_policy_activations`` +* ``resolve_effective_policy_activations`` +* ``get_effective_policy_variant`` +* ``resolve_effective_prompt_template`` +* ``resolve_effective_axis_bundle`` +* ``resolve_effective_image_policy_bundle`` +* ``publish_scope`` +* ``get_publish_run`` +* ``import_published_artifact`` +* ``parse_scope`` + +Compatibility aliases are also preserved for existing callers: + +* ``config`` +* ``policy_repo`` +* ``PolicyServiceError`` + +Removed legacy exports are intentionally absent. + +Legacy Removal Scope +-------------------- + +Removed from service/CLI surface: + +1. Legacy world-policy file import entry points. +2. Legacy path-to-policy mapping helpers. +3. Legacy runtime fallback assumptions that imply file-path canonicality. + +Testing Expectations +-------------------- + +1. Unit coverage for validation, activation overlays, runtime resolution, publish, and artifact import. +2. Integration coverage for policy API routes and retained CLI commands. +3. Regression coverage proving DB/runtime behavior does not depend on legacy world policy files. diff --git a/docs/source/translation_layer.rst b/docs/source/translation_layer.rst index e1d20d1..df52fae 100644 --- a/docs/source/translation_layer.rst +++ b/docs/source/translation_layer.rst @@ -299,7 +299,7 @@ deterministic mode is silently skipped. Per-World Enable/Disable ------------------------ -.. code-block:: json +.. code-block:: text {"translation_layer": {"enabled": true}} ← pipeworks_web (test world) {"translation_layer": {"enabled": false}} ← daily_undertaking (production) diff --git a/src/mud_server/web/static/js/api.js b/src/mud_server/web/static/js/api.js index 1fe26c9..fd034b2 100644 --- a/src/mud_server/web/static/js/api.js +++ b/src/mud_server/web/static/js/api.js @@ -138,14 +138,49 @@ class ApiClient { */ async getTableRows(sessionId, tableName, limit = 100, offset = 0) { const safeTableName = encodeURIComponent(tableName); + const requestedLimit = Number(limit); + const safeLimit = Number.isFinite(requestedLimit) + ? Math.min(Math.max(Math.trunc(requestedLimit), 1), 1000) + : 100; + const requestedOffset = Number(offset); + const safeOffset = Number.isFinite(requestedOffset) ? Math.max(Math.trunc(requestedOffset), 0) : 0; const params = new URLSearchParams({ session_id: sessionId, - limit: `${limit}`, - offset: `${offset}`, + limit: `${safeLimit}`, + offset: `${safeOffset}`, }); return this.fetcher(`/admin/database/table/${safeTableName}?${params.toString()}`); } + /** + * Fetch all rows for a table using paged requests. + */ + async getAllTableRows(sessionId, tableName, pageSize = 1000) { + const boundedPageSize = Math.min(Math.max(Math.trunc(Number(pageSize) || 1000), 1), 1000); + const allRows = []; + let columns = []; + let offset = 0; + + while (true) { + const response = await this.getTableRows(sessionId, tableName, boundedPageSize, offset); + if (!columns.length) { + columns = Array.isArray(response.columns) ? response.columns : []; + } + const pageRows = Array.isArray(response.rows) ? response.rows : []; + allRows.push(...pageRows); + if (pageRows.length < boundedPageSize) { + break; + } + offset += pageRows.length; + } + + return { + table: tableName, + columns, + rows: allRows, + }; + } + /** * Fetch world operations rows (status + active character sessions). */ diff --git a/src/mud_server/web/static/js/pages/accounts.js b/src/mud_server/web/static/js/pages/accounts.js index 07bad8b..84b1c06 100644 --- a/src/mud_server/web/static/js/pages/accounts.js +++ b/src/mud_server/web/static/js/pages/accounts.js @@ -247,9 +247,9 @@ async function renderAccountsDashboard(root, { api, session }) { const [accountsResponse, charactersResponse, worldsResponse, worldPermsResponse] = await Promise.all([ api.getPlayers(sessionId), - api.getTableRows(sessionId, 'characters', 2000), + api.getAllTableRows(sessionId, 'characters'), api.getTableRows(sessionId, 'worlds', 300), - api.getTableRows(sessionId, 'world_permissions', 2000), + api.getAllTableRows(sessionId, 'world_permissions'), ]); allAccounts = Array.isArray(accountsResponse.players) ? accountsResponse.players : []; diff --git a/src/mud_server/web/static/js/pages/characters.js b/src/mud_server/web/static/js/pages/characters.js index badc71f..b2e1360 100644 --- a/src/mud_server/web/static/js/pages/characters.js +++ b/src/mud_server/web/static/js/pages/characters.js @@ -385,10 +385,10 @@ async function renderCharactersDashboard(root, { api, session }) { */ const load = async () => { const [charactersResponse, usersResponse, worldsResponse, locationsResponse] = await Promise.all([ - api.getTableRows(sessionId, 'characters', 3000), - api.getTableRows(sessionId, 'users', 2000), + api.getAllTableRows(sessionId, 'characters'), + api.getAllTableRows(sessionId, 'users'), api.getTableRows(sessionId, 'worlds', 300), - api.getTableRows(sessionId, 'character_locations', 3000), + api.getAllTableRows(sessionId, 'character_locations'), ]); allCharacters = rowsToObjects(charactersResponse.columns, charactersResponse.rows).filter( diff --git a/src/mud_server/web/static/js/pages/tombstones.js b/src/mud_server/web/static/js/pages/tombstones.js index fe956d4..23b5c7a 100644 --- a/src/mud_server/web/static/js/pages/tombstones.js +++ b/src/mud_server/web/static/js/pages/tombstones.js @@ -132,8 +132,8 @@ async function renderTombstonesDashboard(root, { api, session }) { */ const load = async () => { const [usersResponse, charactersResponse, worldsResponse] = await Promise.all([ - api.getTableRows(sessionId, 'users', 4000), - api.getTableRows(sessionId, 'characters', 4000), + api.getAllTableRows(sessionId, 'users'), + api.getAllTableRows(sessionId, 'characters'), api.getTableRows(sessionId, 'worlds', 300), ]); diff --git a/src/mud_server/web/static/js/pages/users_data.js b/src/mud_server/web/static/js/pages/users_data.js index 1bf1b1f..acba4b2 100644 --- a/src/mud_server/web/static/js/pages/users_data.js +++ b/src/mud_server/web/static/js/pages/users_data.js @@ -53,10 +53,10 @@ async function loadUsersList({ api, sessionId }) { */ async function loadUsersMetadata({ api, sessionId }) { const [charactersResp, worldsResp, permissionsResp, locationsResp] = await Promise.all([ - api.getTableRows(sessionId, 'characters', 1000), + api.getAllTableRows(sessionId, 'characters'), api.getTableRows(sessionId, 'worlds', 200), - api.getTableRows(sessionId, 'world_permissions', 1000), - api.getTableRows(sessionId, 'character_locations', 1000), + api.getAllTableRows(sessionId, 'world_permissions'), + api.getAllTableRows(sessionId, 'character_locations'), ]); const worldRows = rowsToObjects(worldsResp.columns, worldsResp.rows);