portals-mcp 1.3.4 → 1.3.6

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.
Files changed (84) hide show
  1. package/dist/resources/ai/bootstrap.json +57 -57
  2. package/dist/resources/ai/contracts/tool-output-envelope.json +35 -35
  3. package/dist/resources/guide/rules-and-conventions.md +13 -13
  4. package/dist/resources/logic/expression-guide.md +224 -224
  5. package/dist/resources/logic/js-function-reference.md +61 -0
  6. package/dist/resources/logic/js-use-effector.md +2 -0
  7. package/dist/resources/python/lib/board_helpers.py +486 -486
  8. package/dist/resources/python/lib/modular_helpers.py +281 -281
  9. package/dist/resources/python/lib/portals_components.py +135 -135
  10. package/dist/resources/python/requirements.txt +4 -4
  11. package/dist/resources/python/tools/blender_to_portals.py +363 -363
  12. package/dist/resources/python/tools/build_recipe_manifest.py +255 -255
  13. package/dist/resources/python/tools/check_room_storage.py +251 -251
  14. package/dist/resources/python/tools/classify_modular_edges.py +881 -881
  15. package/dist/resources/python/tools/extract_glb_metadata.py +402 -402
  16. package/dist/resources/python/tools/generate_minimap.py +284 -284
  17. package/dist/resources/python/tools/index_room.py +904 -904
  18. package/dist/resources/python/tools/list_components.py +75 -75
  19. package/dist/resources/python/tools/manifest_to_room_data.py +224 -224
  20. package/dist/resources/python/tools/merge_modular_proposal.py +78 -78
  21. package/dist/resources/python/tools/merge_room.py +709 -709
  22. package/dist/resources/python/tools/parse_cdn_upload.py +106 -106
  23. package/dist/resources/python/tools/query_room.py +484 -484
  24. package/dist/resources/python/tools/repack_glb_textures.py +169 -169
  25. package/dist/resources/python/tools/search_recipes.py +317 -317
  26. package/dist/resources/python/tools/sync_room.py +687 -687
  27. package/dist/resources/recipes/board-game-pawn/implementation.md +314 -314
  28. package/dist/resources/recipes/cutscene-camera/implementation.md +258 -258
  29. package/dist/resources/recipes/dice-roll/implementation.md +131 -131
  30. package/dist/resources/recipes/keypad/implementation.md +753 -753
  31. package/dist/resources/recipes/leaderboard-scoring/implementation.md +250 -250
  32. package/dist/resources/recipes/logic-board/implementation.md +246 -246
  33. package/dist/resources/recipes/position-heartbeat/implementation.md +255 -255
  34. package/dist/resources/recipes/side-scroller/implementation.md +461 -461
  35. package/dist/resources/ref/components/catalog.json +29 -29
  36. package/dist/resources/ref/interactions/basic.json +56 -56
  37. package/dist/resources/ref/interactions/patterns.json +75 -75
  38. package/dist/resources/ref/interactions/quest-driven.json +190 -190
  39. package/dist/resources/ref/items/billboard.json +61 -61
  40. package/dist/resources/ref/items/blink-light.json +55 -55
  41. package/dist/resources/ref/items/chart.json +53 -53
  42. package/dist/resources/ref/items/collectible.json +67 -67
  43. package/dist/resources/ref/items/combat-npc.json +150 -150
  44. package/dist/resources/ref/items/destructible.json +83 -83
  45. package/dist/resources/ref/items/elemental.json +67 -67
  46. package/dist/resources/ref/items/gun.json +123 -123
  47. package/dist/resources/ref/items/image.json +61 -61
  48. package/dist/resources/ref/items/jump-pad.json +46 -46
  49. package/dist/resources/ref/items/leaderboard.json +63 -63
  50. package/dist/resources/ref/items/light.json +53 -53
  51. package/dist/resources/ref/items/npc.json +82 -82
  52. package/dist/resources/ref/items/portal.json +55 -55
  53. package/dist/resources/ref/items/screenshare.json +43 -43
  54. package/dist/resources/ref/items/shotgun.json +49 -49
  55. package/dist/resources/ref/items/vehicle.json +83 -83
  56. package/dist/resources/ref/items/video.json +57 -57
  57. package/dist/resources/ref/systems/function-effector-js.json +8 -3
  58. package/dist/resources/ref/systems/function-effector.json +119 -119
  59. package/dist/resources/ref/systems/iframes.json +88 -88
  60. package/dist/resources/ref/systems/movement.json +97 -97
  61. package/dist/resources/ref/systems/quests.json +91 -91
  62. package/dist/resources/ref/systems/variables.json +114 -114
  63. package/dist/resources/reference/glb-asset-catalog.md +923 -923
  64. package/dist/resources/reference/iframes.md +345 -345
  65. package/dist/resources/reference/items/display.md +126 -126
  66. package/dist/resources/reference/items/interactive.md +228 -228
  67. package/dist/resources/reference/movement-reference.md +199 -199
  68. package/dist/resources/reference/parent-child.md +135 -135
  69. package/dist/resources/reference/quests.md +382 -382
  70. package/dist/resources/reference/room-index.md +134 -134
  71. package/dist/resources/usage-rules.md +110 -110
  72. package/dist/resources/workflows/blender-to-portals.md +179 -179
  73. package/dist/resources/workflows/builder-workflow.md +72 -72
  74. package/dist/resources/workflows/function-effects-reference.md +224 -224
  75. package/dist/resources/workflows/modular-build-workflow.md +149 -149
  76. package/dist/resources/workflows/quality-review.md +266 -266
  77. package/dist/resources/workflows/scene-design.md +513 -513
  78. package/package.json +6 -1
  79. package/dist/context-handshake.js +0 -427
  80. package/dist/resources/python/lib/__pycache__/portals_components.cpython-314.pyc +0 -0
  81. package/dist/resources/python/lib/__pycache__/portals_core.cpython-314.pyc +0 -0
  82. package/dist/resources/python/lib/__pycache__/portals_effects.cpython-314.pyc +0 -0
  83. package/dist/resources/python/lib/__pycache__/portals_ops.cpython-314.pyc +0 -0
  84. package/dist/resources/python/lib/__pycache__/portals_utils.cpython-314.pyc +0 -0
@@ -1,57 +1,57 @@
1
- {
2
- "format": "portals-mcp-ai-bootstrap",
3
- "version": "4.0.0",
4
- "mode": "ai-first",
5
- "knowledge_architecture": {
6
- "primary": "Call get_context with a description of your task. It returns inline specs, syntax, gotchas, and recipe matches — everything you need in one call.",
7
- "fast_path": "For simple queries (item fields, trigger types, effect schemas), call lookup(term) — returns the spec directly in ~100 tokens.",
8
- "deep_dive": "docs://ref/*, docs://logic/*, docs://recipes/* — available for detailed reference when the inline context from get_context isn't enough."
9
- },
10
- "build_policy": {
11
- "default_ambition": "impressive",
12
- "principle": "When uncertain about scale, build 5-10x more than the minimum viable version. Players remember abundance, not efficiency.",
13
- "anti_patterns": [
14
- "Building a handful of something when the request implies abundance",
15
- "Creating a 'demo' when a full experience was requested",
16
- "Defaulting to the smallest number that technically works"
17
- ]
18
- },
19
- "policy": {
20
- "optimize_for": [
21
- "accuracy_first",
22
- "minimum_context_tokens",
23
- "predictable_outputs",
24
- "tool_first_execution"
25
- ],
26
- "game_bridge": [
27
- "Call connect_to_game after authentication — no roomId needed, the game client provides it via the WS bridge confirmation",
28
- "Call poll_game_events after builds or when expecting user interaction in-game (Ctrl/Cmd+click for items, Shift+click for locations)",
29
- "Events: item_ctrl_clicked (Ctrl/Cmd+click — roomItemId), location_selected (Shift+click — position data)"
30
- ],
31
- "avoid": [
32
- "Building without calling get_context first — Portals has specific syntax that you cannot guess",
33
- "Loading all resources upfront — use get_context for targeted knowledge, lookup for quick facts",
34
- "Reading large guides when a lookup or get_context answers the question",
35
- "Writing external Python scripts for room generation — use apply_operations for all builds, including complex ones with 200+ items",
36
- "Parsing unstructured log output for control flow — always branch on ok/error.code",
37
- "Skipping post-write verification — always get_room_data after set_room_data",
38
- "Ignoring game events — always poll_game_events after user says they interacted in-game"
39
- ],
40
- "testing_workflow": [
41
- "After building logic, TEST it live using this flow:",
42
- "1. connect_to_game — establish the WS bridge to the live game",
43
- "2. get_runtime_data — check initial variable state, confirm init tasks ran",
44
- "3. change_task_state with effectorId — trigger effectors programmatically to simulate player actions (e.g. button clicks, triggers)",
45
- "4. get_runtime_data — verify variables changed as expected",
46
- "5. render_scene — take a screenshot to visually verify displayHtml overlays and scene state",
47
- "TIP: Create hidden test helper items (add_item_with_logic) with known effector IDs like 'test-ready-up' that call SetVariable to trigger your reactive logic. This lets you test without needing the user to click in-game.",
48
- "TIP: Run get_runtime_data and render_scene in parallel for faster test cycles."
49
- ],
50
- "ai_feedback": [
51
- "REQUIRED: Every call to set_room_data and apply_operations MUST include the feedback parameter. This is not optional — the tool will reject calls without it.",
52
- "The feedback parameter requires: confidence (1-5), and at least one of: what_worked, guesses, doc_gaps, ambiguity_flags, recipe_requests, or suspected_errors.",
53
- "Report honestly — low confidence (1-2) triggers automatic gap detection, suspected_errors flags doc inaccuracies for review, what_worked helps rank useful docs higher.",
54
- "This is AI-submitted feedback, not user-reported. You assess your own confidence and report what you observed. Do NOT ask the user to rate pushes."
55
- ]
56
- }
57
- }
1
+ {
2
+ "format": "portals-mcp-ai-bootstrap",
3
+ "version": "4.0.0",
4
+ "mode": "ai-first",
5
+ "knowledge_architecture": {
6
+ "primary": "Call get_context with a description of your task. It returns inline specs, syntax, gotchas, and recipe matches — everything you need in one call.",
7
+ "fast_path": "For simple queries (item fields, trigger types, effect schemas), call lookup(term) — returns the spec directly in ~100 tokens.",
8
+ "deep_dive": "docs://ref/*, docs://logic/*, docs://recipes/* — available for detailed reference when the inline context from get_context isn't enough."
9
+ },
10
+ "build_policy": {
11
+ "default_ambition": "impressive",
12
+ "principle": "When uncertain about scale, build 5-10x more than the minimum viable version. Players remember abundance, not efficiency.",
13
+ "anti_patterns": [
14
+ "Building a handful of something when the request implies abundance",
15
+ "Creating a 'demo' when a full experience was requested",
16
+ "Defaulting to the smallest number that technically works"
17
+ ]
18
+ },
19
+ "policy": {
20
+ "optimize_for": [
21
+ "accuracy_first",
22
+ "minimum_context_tokens",
23
+ "predictable_outputs",
24
+ "tool_first_execution"
25
+ ],
26
+ "game_bridge": [
27
+ "Call connect_to_game after authentication — no roomId needed, the game client provides it via the WS bridge confirmation",
28
+ "Call poll_game_events after builds or when expecting user interaction in-game (Ctrl/Cmd+click for items, Shift+click for locations)",
29
+ "Events: item_ctrl_clicked (Ctrl/Cmd+click — roomItemId), location_selected (Shift+click — position data)"
30
+ ],
31
+ "avoid": [
32
+ "Building without calling get_context first — Portals has specific syntax that you cannot guess",
33
+ "Loading all resources upfront — use get_context for targeted knowledge, lookup for quick facts",
34
+ "Reading large guides when a lookup or get_context answers the question",
35
+ "Writing external Python scripts for room generation — use apply_operations for all builds, including complex ones with 200+ items",
36
+ "Parsing unstructured log output for control flow — always branch on ok/error.code",
37
+ "Skipping post-write verification — always get_room_data after set_room_data",
38
+ "Ignoring game events — always poll_game_events after user says they interacted in-game"
39
+ ],
40
+ "testing_workflow": [
41
+ "After building logic, TEST it live using this flow:",
42
+ "1. connect_to_game — establish the WS bridge to the live game",
43
+ "2. get_runtime_data — check initial variable state, confirm init tasks ran",
44
+ "3. change_task_state with effectorId — trigger effectors programmatically to simulate player actions (e.g. button clicks, triggers)",
45
+ "4. get_runtime_data — verify variables changed as expected",
46
+ "5. render_scene — take a screenshot to visually verify displayHtml overlays and scene state",
47
+ "TIP: Create hidden test helper items (add_item_with_logic) with known effector IDs like 'test-ready-up' that call SetVariable to trigger your reactive logic. This lets you test without needing the user to click in-game.",
48
+ "TIP: Run get_runtime_data and render_scene in parallel for faster test cycles."
49
+ ],
50
+ "ai_feedback": [
51
+ "REQUIRED: Every call to set_room_data and apply_operations MUST include the feedback parameter. This is not optional — the tool will reject calls without it.",
52
+ "The feedback parameter requires: confidence (1-5), and at least one of: what_worked, guesses, doc_gaps, ambiguity_flags, recipe_requests, or suspected_errors.",
53
+ "Report honestly — low confidence (1-2) triggers automatic gap detection, suspected_errors flags doc inaccuracies for review, what_worked helps rank useful docs higher.",
54
+ "This is AI-submitted feedback, not user-reported. You assess your own confidence and report what you observed. Do NOT ask the user to rate pushes."
55
+ ]
56
+ }
57
+ }
@@ -1,35 +1,35 @@
1
- {
2
- "format": "portals-mcp-tool-output-envelope",
3
- "version": "1.0.0",
4
- "description": "Canonical response envelope used by all MCP tools.",
5
- "schema": {
6
- "success": {
7
- "ok": true,
8
- "action": "string",
9
- "summary": "string",
10
- "data": "object",
11
- "next_steps": [
12
- "string"
13
- ]
14
- },
15
- "error": {
16
- "ok": false,
17
- "action": "string",
18
- "summary": "string",
19
- "error": {
20
- "code": "string",
21
- "message": "string",
22
- "details": "object (optional)"
23
- },
24
- "next_steps": [
25
- "string"
26
- ]
27
- }
28
- },
29
- "required_parsing_rules": [
30
- "Always parse as JSON from content[0].text.",
31
- "Gate behavior on ok=true/false before reading data.",
32
- "Use error.code for remediation routing.",
33
- "Treat next_steps as actionable suggestions, not guaranteed prerequisites."
34
- ]
35
- }
1
+ {
2
+ "format": "portals-mcp-tool-output-envelope",
3
+ "version": "1.0.0",
4
+ "description": "Canonical response envelope used by all MCP tools.",
5
+ "schema": {
6
+ "success": {
7
+ "ok": true,
8
+ "action": "string",
9
+ "summary": "string",
10
+ "data": "object",
11
+ "next_steps": [
12
+ "string"
13
+ ]
14
+ },
15
+ "error": {
16
+ "ok": false,
17
+ "action": "string",
18
+ "summary": "string",
19
+ "error": {
20
+ "code": "string",
21
+ "message": "string",
22
+ "details": "object (optional)"
23
+ },
24
+ "next_steps": [
25
+ "string"
26
+ ]
27
+ }
28
+ },
29
+ "required_parsing_rules": [
30
+ "Always parse as JSON from content[0].text.",
31
+ "Gate behavior on ok=true/false before reading data.",
32
+ "Use error.code for remediation routing.",
33
+ "Treat next_steps as actionable suggestions, not guaranteed prerequisites."
34
+ ]
35
+ }
@@ -1,13 +1,13 @@
1
- # Rules and Conventions
2
-
3
- ## Core Rules
4
-
5
- - **Never read snapshot.json into context.** Use `room_index.md` for overview, query tools for specific items. See `docs://reference/room-index`.
6
- - **Design before building.** Never skip to generating items.
7
- - **Always read before writing.** MCP write tools replace entire objects — call `get_room_data` first.
8
- - **Save everything locally.** Design docs, scripts, snapshots — all in `games/{room-id}/`.
9
- - **Build with apply_operations.** Use bulk operations for complex builds, `add_item_with_logic` for items with interactions, and `add_component` for common patterns.
10
- - **Always use the full asset catalog workflow for GLB placement.** See `docs://reference/glb-asset-catalog`.
11
- - **Always search recipes first.** Use `search_recipes` before designing or building any mechanic.
12
- - **Test your logic live.** After building, use `connect_to_game` → `get_runtime_data` to verify variables, `change_task_state` to trigger effectors, and `render_scene` to screenshot the result. Create test helper items with known effector IDs to simulate player actions programmatically.
13
- - **Sync before overwriting.** If a user made manual changes, run `sync_room` before pushing. See `docs://guide/workflow-steps`.
1
+ # Rules and Conventions
2
+
3
+ ## Core Rules
4
+
5
+ - **Never read snapshot.json into context.** Use `room_index.md` for overview, query tools for specific items. See `docs://reference/room-index`.
6
+ - **Design before building.** Never skip to generating items.
7
+ - **Always read before writing.** MCP write tools replace entire objects — call `get_room_data` first.
8
+ - **Save everything locally.** Design docs, scripts, snapshots — all in `games/{room-id}/`.
9
+ - **Build with apply_operations.** Use bulk operations for complex builds, `add_item_with_logic` for items with interactions, and `add_component` for common patterns.
10
+ - **Always use the full asset catalog workflow for GLB placement.** See `docs://reference/glb-asset-catalog`.
11
+ - **Always search recipes first.** Use `search_recipes` before designing or building any mechanic.
12
+ - **Test your logic live.** After building, use `connect_to_game` → `get_runtime_data` to verify variables, `change_task_state` to trigger effectors, and `render_scene` to screenshot the result. Create test helper items with known effector IDs to simulate player actions programmatically.
13
+ - **Sync before overwriting.** If a user made manual changes, run `sync_room` before pushing. See `docs://guide/workflow-steps`.