@theprototype/agent 1.63.0 → 1.64.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/README.md CHANGED
@@ -10,7 +10,7 @@ to everyone in the session with undo, exactly like a person editing.
10
10
  claude mcp add theprototype -- npx -y @theprototype/agent mcp 'https://theprototype.app/#F0FD3'
11
11
  ```
12
12
 
13
- That is the whole setup. Replace the link with yours: in the app, **Connect ▸ Request AI** gives
13
+ That is the whole setup. Replace the link with yours: in the app, **Connect ▸ Invite ▸ AI agent** gives
14
14
  you a link with an invite in it (the agent joins at once, with the role you picked), or copy
15
15
  your plain session link (the agent knocks and you press **Approve**).
16
16
 
package/catalog.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "format": 2,
4
4
  "generator": {
5
5
  "source": "tpAgent.tools() via core scripts/agent-tool-catalog.cjs, mapped by tools/agent/src/catalog.js",
6
- "hostTools": 78,
6
+ "hostTools": 83,
7
7
  "dropped": []
8
8
  },
9
9
  "instructions": "You are building in the person's own open theprototype.app tab: a live, shared 3D scene. Every change shows for everyone in the session and can be undone.\nThis may be a VOICE conversation: answer in one or two short spoken sentences and say what changed in plain words (\"Added three trees by the fire\"). Never read out uuids, lists of numbers or JSON.\nIf a tool says the tab is closed or not connected, tell the person to open theprototype.app and press Connect Claude, then wait; do not retry in a loop.\nCall status first: it says whether you may edit (a viewer can only look).\nWhen the person says \"undo that\" or \"take that back\", call undo_last; if it refuses, say who changed what.\nYou act as this person in their own tab: status \"you\" is them (their peer id, name and role); the other users are everyone else.\nCall list_scene before editing so you use real uuids; batch many objects into one call.\nFor \"in front of me\", call where_are_users and build at the spots it gives, facing the person (face_user: true). For \"here\" or \"this\", build at the person's latest ping: at: {ping: \"latest\"}; ask them to ping (Ctrl+Alt+click, or Ping in the menu) if they have none.\nMotion and interaction are flow nodes (create_flow_nodes); call describe_node_types before wiring edges.\nTake a screenshot after each change to check your work.\nWhen asked what you can do here, call what_can_you_do and say its \"say\" line.",
@@ -1908,10 +1908,137 @@
1908
1908
  "openWorldHint": false
1909
1909
  }
1910
1910
  },
1911
+ {
1912
+ "name": "create_path",
1913
+ "title": "Add a path to walk along",
1914
+ "description": "Add a Path object: a line through the scene that guards patrol, animals wander along or a camera rides. Points are WORLD positions; each point may also say how long to wait there, the speed and ease of the stretch after it, jump (skip straight to the next point), an event name fired on arrival (an On Path Event node hears it) and a facing to hold while waiting. walk: loop | pingpong | once | random. Hidden in Play unless show_in_play. walkers = object uuids that walk it at once (each gets a Path patrol node). Returns the path uuid; walk it later with create_flow_nodes pathpatrol {path: \"<uuid>\", offset}.\nTake a screenshot after each change to check your work.",
1915
+ "inputSchema": {
1916
+ "type": "object",
1917
+ "properties": {
1918
+ "points": {
1919
+ "type": "array",
1920
+ "minItems": 2,
1921
+ "maxItems": 200,
1922
+ "description": "at least 2: [x,y,z] or {pos: [x,y,z], wait?, speed?, ease?, jump?, event?, facing?}",
1923
+ "items": {
1924
+ "anyOf": [
1925
+ {
1926
+ "type": "array",
1927
+ "items": {
1928
+ "type": "number"
1929
+ },
1930
+ "minItems": 3,
1931
+ "maxItems": 3
1932
+ },
1933
+ {
1934
+ "type": "object",
1935
+ "properties": {
1936
+ "pos": {
1937
+ "type": "array",
1938
+ "items": {
1939
+ "type": "number"
1940
+ },
1941
+ "minItems": 3,
1942
+ "maxItems": 3
1943
+ },
1944
+ "wait": {
1945
+ "type": "number",
1946
+ "description": "seconds to stand at this point"
1947
+ },
1948
+ "speed": {
1949
+ "type": "number",
1950
+ "description": "m/s for the stretch AFTER this point (default: the path speed)"
1951
+ },
1952
+ "ease": {
1953
+ "type": "string",
1954
+ "enum": [
1955
+ "linear",
1956
+ "in",
1957
+ "out",
1958
+ "inout"
1959
+ ],
1960
+ "description": "the stretch after this point: linear, in (speed up), out (slow down), inout"
1961
+ },
1962
+ "jump": {
1963
+ "type": "boolean",
1964
+ "description": "skip straight to the next point (no walking in between)"
1965
+ },
1966
+ "event": {
1967
+ "type": "string",
1968
+ "description": "a name fired when a walker arrives here"
1969
+ },
1970
+ "facing": {
1971
+ "type": "number",
1972
+ "description": "degrees of yaw to face while waiting (0 = +Z)"
1973
+ }
1974
+ },
1975
+ "required": [
1976
+ "pos"
1977
+ ]
1978
+ }
1979
+ ]
1980
+ }
1981
+ },
1982
+ "walk": {
1983
+ "type": "string",
1984
+ "enum": [
1985
+ "loop",
1986
+ "pingpong",
1987
+ "once",
1988
+ "random"
1989
+ ],
1990
+ "description": "default loop"
1991
+ },
1992
+ "speed": {
1993
+ "type": "number",
1994
+ "description": "m/s, default 1.5"
1995
+ },
1996
+ "closed": {
1997
+ "type": "boolean",
1998
+ "description": "join the last point back to the first (3+ points)"
1999
+ },
2000
+ "smooth": {
2001
+ "type": "boolean",
2002
+ "description": "a smooth curve through the points (default) or straight lines"
2003
+ },
2004
+ "show_in_play": {
2005
+ "type": "boolean",
2006
+ "description": "draw the line while playing (default hidden)"
2007
+ },
2008
+ "seed": {
2009
+ "type": "number",
2010
+ "description": "random walk: which random order"
2011
+ },
2012
+ "name": {
2013
+ "type": "string"
2014
+ },
2015
+ "walkers": {
2016
+ "type": "array",
2017
+ "items": {
2018
+ "type": "string"
2019
+ },
2020
+ "description": "object uuids that walk this path now"
2021
+ },
2022
+ "offset": {
2023
+ "type": "number",
2024
+ "description": "walkers: seconds between each one along the path (spreads them out)"
2025
+ }
2026
+ },
2027
+ "required": [
2028
+ "points"
2029
+ ]
2030
+ },
2031
+ "annotations": {
2032
+ "title": "Add a path to walk along",
2033
+ "readOnlyHint": false,
2034
+ "destructiveHint": false,
2035
+ "openWorldHint": false
2036
+ }
2037
+ },
1911
2038
  {
1912
2039
  "name": "set_material",
1913
2040
  "title": "Change materials and textures",
1914
- "description": "Make objects look finished: colour, roughness, metalness, emissive, opacity and texture maps, on many objects in one call. Maps take a library image hash or an https URL (https only, CORS-enabled, 16 MB, PNG/JPEG/WebP/GIF/AVIF; it becomes a library item first and is re-encoded like an upload; returned in assets). cc0 fetches a free CC0 material by id or name from Poly Haven (its texture names) or ambientCG (ids like \"Wood051\", \"Bricks076\", \"Metal032\", \"Ground037\"), or by words (\"brown planks\"); preset applies a named preset: one of Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, or one the person saved (list_materials lists them all). faces gives just those faces their own new material slot. One undo step.\nTake a screenshot after each change to check your work.",
2041
+ "description": "Make objects look finished: colour, roughness, metalness, emissive, opacity and texture maps, on many objects in one call. Maps take a library image hash or an https URL (https only, CORS-enabled, 16 MB, PNG/JPEG/WebP/GIF/AVIF; it becomes a library item first and is re-encoded like an upload; returned in assets). cc0 fetches a free CC0 material by id or name from Poly Haven (its texture names) or ambientCG (ids like \"Wood051\", \"Bricks076\", \"Metal032\", \"Ground037\"), or by words (\"brown planks\"); preset applies a named preset: one of Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, or one the person saved (list_materials lists them all). faces gives just those faces their own new material slot. One undo step.\nTake a screenshot after each change to check your work.",
1915
2042
  "inputSchema": {
1916
2043
  "type": "object",
1917
2044
  "properties": {
@@ -2028,7 +2155,7 @@
2028
2155
  },
2029
2156
  "preset": {
2030
2157
  "type": "string",
2031
- "description": "a preset: Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, or a saved one list_materials names"
2158
+ "description": "a preset: Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, or a saved one list_materials names"
2032
2159
  },
2033
2160
  "cc0": {
2034
2161
  "type": "string",
@@ -2058,7 +2185,7 @@
2058
2185
  {
2059
2186
  "name": "list_materials",
2060
2187
  "title": "Read materials",
2061
- "description": "What objects wear: per object its material slots (type, colour, numbers, which maps) and shader, plus the preset names (the starters Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, and any the person saved) and shader keys. Read this before editing.",
2188
+ "description": "What objects wear: per object its material slots (type, colour, numbers, which maps) and shader, plus the preset names (the starters Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, and any the person saved) and shader keys. Read this before editing.",
2062
2189
  "inputSchema": {
2063
2190
  "type": "object",
2064
2191
  "properties": {
@@ -3417,6 +3544,366 @@
3417
3544
  "openWorldHint": false
3418
3545
  }
3419
3546
  },
3547
+ {
3548
+ "name": "set_levels",
3549
+ "title": "Set levels",
3550
+ "description": "The game's ONE Levels table: the levels in play order, each {name, scene (a project scene), spawn (an object name to start at), goal}; keep = what carries from level to level (score, inventory, health, or \"var:<name>\" for a named variable; New game resets them); unlock = all | sequential. levels replaces the list, add appends, update [{id, …}] patches, remove [ids] drops, clear: true removes the table; no field reads it. The Go to level / Next level / Finish level nodes and portals use this same table. One undo step.\nTake a screenshot after each change to check your work.",
3551
+ "inputSchema": {
3552
+ "type": "object",
3553
+ "properties": {
3554
+ "levels": {
3555
+ "type": "array",
3556
+ "items": {
3557
+ "type": "object",
3558
+ "properties": {
3559
+ "id": {
3560
+ "type": "string",
3561
+ "description": "a stable id (default: from the name)"
3562
+ },
3563
+ "name": {
3564
+ "type": "string"
3565
+ },
3566
+ "scene": {
3567
+ "type": "string",
3568
+ "description": "a project scene name: the level is that scene"
3569
+ },
3570
+ "spawn": {
3571
+ "type": "string",
3572
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
3573
+ },
3574
+ "goal": {
3575
+ "type": "string",
3576
+ "description": "one line the player reads"
3577
+ }
3578
+ }
3579
+ }
3580
+ },
3581
+ "add": {
3582
+ "type": "array",
3583
+ "items": {
3584
+ "type": "object",
3585
+ "properties": {
3586
+ "id": {
3587
+ "type": "string",
3588
+ "description": "a stable id (default: from the name)"
3589
+ },
3590
+ "name": {
3591
+ "type": "string"
3592
+ },
3593
+ "scene": {
3594
+ "type": "string",
3595
+ "description": "a project scene name: the level is that scene"
3596
+ },
3597
+ "spawn": {
3598
+ "type": "string",
3599
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
3600
+ },
3601
+ "goal": {
3602
+ "type": "string",
3603
+ "description": "one line the player reads"
3604
+ }
3605
+ }
3606
+ }
3607
+ },
3608
+ "update": {
3609
+ "type": "array",
3610
+ "items": {
3611
+ "type": "object",
3612
+ "properties": {
3613
+ "id": {
3614
+ "type": "string",
3615
+ "description": "a stable id (default: from the name)"
3616
+ },
3617
+ "name": {
3618
+ "type": "string"
3619
+ },
3620
+ "scene": {
3621
+ "type": "string",
3622
+ "description": "a project scene name: the level is that scene"
3623
+ },
3624
+ "spawn": {
3625
+ "type": "string",
3626
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
3627
+ },
3628
+ "goal": {
3629
+ "type": "string",
3630
+ "description": "one line the player reads"
3631
+ }
3632
+ }
3633
+ }
3634
+ },
3635
+ "remove": {
3636
+ "type": "array",
3637
+ "items": {
3638
+ "type": "string"
3639
+ }
3640
+ },
3641
+ "keep": {
3642
+ "type": "array",
3643
+ "items": {
3644
+ "type": "string"
3645
+ }
3646
+ },
3647
+ "unlock": {
3648
+ "type": "string",
3649
+ "enum": [
3650
+ "all",
3651
+ "sequential"
3652
+ ]
3653
+ },
3654
+ "clear": {
3655
+ "type": "boolean"
3656
+ }
3657
+ }
3658
+ },
3659
+ "annotations": {
3660
+ "title": "Set levels",
3661
+ "readOnlyHint": false,
3662
+ "destructiveHint": true,
3663
+ "openWorldHint": false
3664
+ }
3665
+ },
3666
+ {
3667
+ "name": "set_portal",
3668
+ "title": "Set portal",
3669
+ "description": "A Portal: a doorway that takes the player who walks through it somewhere else, ONE player at a time. Target: level (a Levels-table row id or name), or scene (a project scene) and / or spawn (an object name to arrive at), or back: true (where they came from). transition = fade | iris | card | none (VR always fades); loading = this portal's own loading screen. New: position or at; change one: object (uuid). What the game keeps (set_levels keep) carries through. One undo step.\nTake a screenshot after each change to check your work.",
3670
+ "inputSchema": {
3671
+ "type": "object",
3672
+ "properties": {
3673
+ "position": {
3674
+ "type": "array",
3675
+ "items": {
3676
+ "type": "number"
3677
+ },
3678
+ "minItems": 3,
3679
+ "maxItems": 3,
3680
+ "description": "its base [x, y, z] (a new one)"
3681
+ },
3682
+ "at": {
3683
+ "type": "object",
3684
+ "description": "placement like create_objects: {ping: \"latest\"} = at the person's ping"
3685
+ },
3686
+ "yaw": {
3687
+ "type": "number",
3688
+ "description": "turn in radians; its arrow points -Z at 0 (arriving players face the arrow)"
3689
+ },
3690
+ "face_user": {
3691
+ "type": "boolean"
3692
+ },
3693
+ "name": {
3694
+ "type": "string"
3695
+ },
3696
+ "object": {
3697
+ "type": "string",
3698
+ "description": "uuid of an existing one to change (leave out to place a new one)"
3699
+ },
3700
+ "show": {
3701
+ "type": "boolean",
3702
+ "description": "false = invisible in Play (still works): a trigger inside your own doorway"
3703
+ },
3704
+ "level": {
3705
+ "type": "string"
3706
+ },
3707
+ "scene": {
3708
+ "type": "string"
3709
+ },
3710
+ "spawn": {
3711
+ "type": "string"
3712
+ },
3713
+ "back": {
3714
+ "type": "boolean"
3715
+ },
3716
+ "transition": {
3717
+ "type": "string",
3718
+ "enum": [
3719
+ "fade",
3720
+ "iris",
3721
+ "card",
3722
+ "none"
3723
+ ]
3724
+ },
3725
+ "loading": {
3726
+ "type": [
3727
+ "object",
3728
+ "null"
3729
+ ],
3730
+ "properties": {
3731
+ "preset": {
3732
+ "type": "string",
3733
+ "enum": [
3734
+ "fade",
3735
+ "bar",
3736
+ "logo",
3737
+ "image",
3738
+ "item"
3739
+ ]
3740
+ },
3741
+ "background": {
3742
+ "type": "string",
3743
+ "description": "#rrggbb"
3744
+ },
3745
+ "image": {
3746
+ "type": "string",
3747
+ "description": "an image URL or library item (the image preset)"
3748
+ },
3749
+ "logo": {
3750
+ "type": "string"
3751
+ },
3752
+ "textColor": {
3753
+ "type": "string"
3754
+ },
3755
+ "bar": {
3756
+ "type": "object",
3757
+ "properties": {
3758
+ "style": {
3759
+ "type": "string",
3760
+ "enum": [
3761
+ "thin",
3762
+ "thick"
3763
+ ]
3764
+ },
3765
+ "color": {
3766
+ "type": "string"
3767
+ }
3768
+ }
3769
+ },
3770
+ "tips": {
3771
+ "type": "array",
3772
+ "items": {
3773
+ "type": "string"
3774
+ }
3775
+ },
3776
+ "title": {
3777
+ "type": "string"
3778
+ }
3779
+ }
3780
+ }
3781
+ }
3782
+ },
3783
+ "annotations": {
3784
+ "title": "Set portal",
3785
+ "readOnlyHint": false,
3786
+ "destructiveHint": true,
3787
+ "openWorldHint": false
3788
+ }
3789
+ },
3790
+ {
3791
+ "name": "set_checkpoint",
3792
+ "title": "Set checkpoint",
3793
+ "description": "A Checkpoint pad: stepping on it saves THAT player's progress there; after a fall (or Back to checkpoint, or reloading an exported game) they come back to it. New: position or at; change one: object (uuid). label = what the flash says. One undo step.\nTake a screenshot after each change to check your work.",
3794
+ "inputSchema": {
3795
+ "type": "object",
3796
+ "properties": {
3797
+ "position": {
3798
+ "type": "array",
3799
+ "items": {
3800
+ "type": "number"
3801
+ },
3802
+ "minItems": 3,
3803
+ "maxItems": 3,
3804
+ "description": "its base [x, y, z] (a new one)"
3805
+ },
3806
+ "at": {
3807
+ "type": "object",
3808
+ "description": "placement like create_objects: {ping: \"latest\"} = at the person's ping"
3809
+ },
3810
+ "yaw": {
3811
+ "type": "number",
3812
+ "description": "turn in radians; its arrow points -Z at 0 (arriving players face the arrow)"
3813
+ },
3814
+ "face_user": {
3815
+ "type": "boolean"
3816
+ },
3817
+ "name": {
3818
+ "type": "string"
3819
+ },
3820
+ "object": {
3821
+ "type": "string",
3822
+ "description": "uuid of an existing one to change (leave out to place a new one)"
3823
+ },
3824
+ "label": {
3825
+ "type": "string"
3826
+ },
3827
+ "show": {
3828
+ "type": "boolean",
3829
+ "description": "false = no message when reached (it still saves)"
3830
+ }
3831
+ }
3832
+ },
3833
+ "annotations": {
3834
+ "title": "Set checkpoint",
3835
+ "readOnlyHint": false,
3836
+ "destructiveHint": true,
3837
+ "openWorldHint": false
3838
+ }
3839
+ },
3840
+ {
3841
+ "name": "set_loading",
3842
+ "title": "Set loading",
3843
+ "description": "The loading screen every level change shows (only when the load takes a moment; at least 0.4 s once shown): preset fade | bar | logo | image | item, background, image, logo, bar {style, color}, tips (lines that rotate), title; clear: true = the default bar. Fields you leave out stay. Needs a Levels table (set_levels). No field reads it. One undo step.\nTake a screenshot after each change to check your work.",
3844
+ "inputSchema": {
3845
+ "type": "object",
3846
+ "properties": {
3847
+ "preset": {
3848
+ "type": "string",
3849
+ "enum": [
3850
+ "fade",
3851
+ "bar",
3852
+ "logo",
3853
+ "image",
3854
+ "item"
3855
+ ]
3856
+ },
3857
+ "background": {
3858
+ "type": "string",
3859
+ "description": "#rrggbb"
3860
+ },
3861
+ "image": {
3862
+ "type": "string",
3863
+ "description": "an image URL or library item (the image preset)"
3864
+ },
3865
+ "logo": {
3866
+ "type": "string"
3867
+ },
3868
+ "textColor": {
3869
+ "type": "string"
3870
+ },
3871
+ "bar": {
3872
+ "type": "object",
3873
+ "properties": {
3874
+ "style": {
3875
+ "type": "string",
3876
+ "enum": [
3877
+ "thin",
3878
+ "thick"
3879
+ ]
3880
+ },
3881
+ "color": {
3882
+ "type": "string"
3883
+ }
3884
+ }
3885
+ },
3886
+ "tips": {
3887
+ "type": "array",
3888
+ "items": {
3889
+ "type": "string"
3890
+ }
3891
+ },
3892
+ "title": {
3893
+ "type": "string"
3894
+ },
3895
+ "clear": {
3896
+ "type": "boolean"
3897
+ }
3898
+ }
3899
+ },
3900
+ "annotations": {
3901
+ "title": "Set loading",
3902
+ "readOnlyHint": false,
3903
+ "destructiveHint": true,
3904
+ "openWorldHint": false
3905
+ }
3906
+ },
3420
3907
  {
3421
3908
  "name": "search_assets",
3422
3909
  "title": "Find assets",
@@ -4344,7 +4831,7 @@
4344
4831
  {
4345
4832
  "name": "logs",
4346
4833
  "title": "Read the recent log",
4347
- "description": "The page's recent log: errors, warnings, console lines and the toasts people saw, oldest first. Pass since (the \"now\" of the previous answer) for only what is new. status shows the newest few.",
4834
+ "description": "The page's recent log: errors, warnings, console lines, Announce lines (scope announce: in Edit an Announce node draws no banner, its line lands here with the node that said it) and the toasts people saw, oldest first. Pass since (the \"now\" of the previous answer) for only what is new. status shows the newest few.",
4348
4835
  "inputSchema": {
4349
4836
  "type": "object",
4350
4837
  "properties": {
@@ -4520,7 +5007,7 @@
4520
5007
  },
4521
5008
  "data": {
4522
5009
  "type": "object",
4523
- "description": "node params, e.g. spin {axis:\"y\",speed:2}; bounce {amplitude:0.5,speed:2}; pathpatrol {points:[[x,y,z],…] (>=2 world waypoints), speed:1, mode:\"loop\"|\"pingpong\"}; setcolor {color:\"#ff0000\"}; latch {initial:false}; delay {seconds:3}; sequence {delay1:0,delay2:0.5,delay3:0.5,delay4:0.5} (delays are CUMULATIVE). Omit for defaults."
5010
+ "description": "node params, e.g. spin {axis:\"y\",speed:2}; bounce {amplitude:0.5,speed:2}; pathpatrol {path:\"<Path object uuid from create_path>\", offset:0, face:true} (walks the Path: its waits/speeds/events live on the Path; legacy {points:[[x,y,z],…], speed, mode} still works); onpathevent {path, event} fires when a walker arrives at a point carrying that event; setcolor {color:\"#ff0000\"}; latch {initial:false}; delay {seconds:3}; sequence {delay1:0,delay2:0.5,delay3:0.5,delay4:0.5} (delays are CUMULATIVE). Omit for defaults."
4524
5011
  }
4525
5012
  },
4526
5013
  "required": [
@@ -4643,7 +5130,7 @@
4643
5130
  {
4644
5131
  "name": "create_behaviour",
4645
5132
  "title": "Add a code behaviour",
4646
- "description": "Create a code behaviour: game logic (rules, waves, scoring, timers, win/lose) as ONE JavaScript module, run on the session authority and replicated. Prefer it over large node graphs for game rules. Linted before it is applied; problems come back with line numbers. The result names the node id and its sockets — wire them with create_flow_nodes (an On Click / On Enter into an input; an output into HUD Text, Visibility, Announce…).\nBEHAVIOURS (create_behaviour / edit_behaviour): game logic as ONE JavaScript module, run on ONE peer (the session authority); `state` replicates to everyone.\nexport default behaviour({ name, params: {k: literal | {value, min, max, step, unit}}, state: {plain JSON}, inputs: [names], outputs: [names], on: {event(payload) {...}}, ...methods });\ninputs: a trigger wired into input \"x\" runs on.x. outputs: a state field = a value output, any other name = an event fired by this.emit(\"name\").\nA behaviour does NOT move, rotate, recolour or hide objects (no such this.*): it drives effect nodes (spin, visibility, setcolor…) via its outputs. NO per-frame hook (no onTick/update): repeat with this.after(seconds, \"method\").\nthis: params, state, kit (also bare `kit`), after(seconds, \"method\", ...args) (survives the host leaving; counts PLAY time — it holds while the game is paused), cancel(key), rand(), randInt(a,b), pick(list), now(), find(glob) / findAll(glob) -> {uuid, name, pos, tags}, object, log() — always as this.find(…) etc. (only `kit` and the helpers are bare). Helpers: dist(a,b), clamp, lerp.\nevents: load (runs on EVERY peer when the behaviour loads — local, state read-only: register things there), start (once, on the authority); grabRequest({piece, distance, hand, refuse}) (runs on the grabbing peer, read-only: call refuse(reason)); any kit event as \"piece.event\" or roundStart, go, won, lost, paused, resumed, menu, levelSelected, scored, collected, allCollected, spawned, despawned, emptied, damaged, healed, died, revived, stuck, grabRefused. Entity payloads have entity.is(glob), entity.hasTag(t).\nkit calls: kit.round.start/win(reason)/lose(reason), kit.score.add(n), kit.spawner.spawn({kind, template: uuid, at, count, hp, mover: {speed}}), kit.health.damage(id, n), kit.mover.chase(kind, \"nearestPlayer\"), kit.rules.set({reach, jump}), kit.pickups.register({id, score, respawn, radius}) — register pickups in on.load (every peer must know them, or touching one does nothing), never in start.\nForbidden (the load is refused): Math.random, Date / Date.now, performance.now, localStorage, document/window/globalThis, fetch, eval, setTimeout/setInterval, import. Unknown this.* members, unknown events and hook-named methods nothing calls are refused too.\nEXAMPLE (passes the lint; wire a trigger into input gemTouched, output left into a HUD Text, timeUp into a Visibility or Announce):\nexport default behaviour({\n name: 'Countdown',\n params: { seconds: 30 },\n state: { left: 30, found: 0 },\n inputs: ['gemTouched'],\n outputs: ['left', 'found', 'timeUp'],\n on: {\n start() { this.state.left = this.params.seconds; this.after(1, 'tick'); },\n gemTouched() { this.state.found += 1; }\n },\n tick() {\n this.state.left -= 1;\n if (this.state.left > 0) this.after(1, 'tick');\n else this.emit('timeUp');\n }\n});\nTake a screenshot after each change to check your work.",
5133
+ "description": "Create a code behaviour: game logic (rules, waves, scoring, timers, win/lose) as ONE JavaScript module, run on the session authority and replicated. Prefer it over large node graphs for game rules. Linted before it is applied; problems come back with line numbers. The result names the node id and its sockets — wire them with create_flow_nodes (an On Click / On Enter into an input; an output into HUD Text, Visibility, Announce…).\nBEHAVIOURS (create_behaviour / edit_behaviour): game logic as ONE JavaScript module, run on ONE peer (the session authority); `state` replicates to everyone.\nexport default behaviour({ name, params: {k: literal | {value, min, max, step, unit}}, state: {plain JSON}, inputs: [names], outputs: [names], on: {event(payload) {...}}, ...methods });\ninputs: a trigger wired into input \"x\" runs on.x. outputs: a state field = a value output, any other name = an event fired by this.emit(\"name\").\nA behaviour does NOT move, rotate, recolour or hide objects (no such this.*): it drives effect nodes (spin, visibility, setcolor…) via its outputs. NO per-frame hook (no onTick/update): repeat with this.after(seconds, \"method\").\nthis: params, state, kit (also bare `kit`), after(seconds, \"method\", ...args) (survives the host leaving; counts PLAY time — it holds while the game is paused), cancel(key), rand(), randInt(a,b), pick(list), now(), find(glob) / findAll(glob) -> {uuid, name, pos, tags}, object, log() — always as this.find(…) etc. (only `kit` and the helpers are bare). Helpers: dist(a,b), clamp, lerp.\nevents: load (runs on EVERY peer when the behaviour loads — local, state read-only: register things there), start (once, on the authority); grabRequest({piece, distance, hand, refuse}) (runs on the grabbing peer, read-only: call refuse(reason)); any kit event as \"piece.event\" or roundStart, go, won, lost, paused, resumed, menu, levelSelected, scored, collected, allCollected, spawned, despawned, emptied, damaged, healed, died, revived, stuck, grabRefused. Entity payloads have entity.is(glob), entity.hasTag(t).\nkit calls: kit.round.start/win(reason)/lose(reason), kit.score.add(n), kit.spawner.spawn({kind, template: uuid, at, count, hp, mover: {speed}}), kit.health.damage(id, n), kit.mover.chase(kind, \"nearestPlayer\"), kit.rules.set({reach, jump}), kit.pickups.register({id, score, respawn, radius}) — register pickups in on.load (every peer must know them, or touching one does nothing), never in start.\nA handler that throws is rolled back (state, after() timers, emits; kit calls already sent stay) and its error names the handler. A refused kit call answers {refused: true, reason}.\nForbidden (the load is refused): Math.random, Date / Date.now, performance.now, localStorage, document/window/globalThis, fetch, eval, setTimeout/setInterval, import. Unknown this.* members, unknown events and hook-named methods nothing calls are refused too.\nEXAMPLE (passes the lint; wire a trigger into input gemTouched, output left into a HUD Text, timeUp into a Visibility or Announce):\nexport default behaviour({\n name: 'Countdown',\n params: { seconds: 30 },\n state: { left: 30, found: 0 },\n inputs: ['gemTouched'],\n outputs: ['left', 'found', 'timeUp'],\n on: {\n start() { this.state.left = this.params.seconds; this.after(1, 'tick'); },\n gemTouched() { this.state.found += 1; }\n },\n tick() {\n this.state.left -= 1;\n if (this.state.left > 0) this.after(1, 'tick');\n else this.emit('timeUp');\n }\n});\nTake a screenshot after each change to check your work.",
4647
5134
  "inputSchema": {
4648
5135
  "type": "object",
4649
5136
  "properties": {
@@ -4748,7 +5235,7 @@
4748
5235
  },
4749
5236
  "sensor": {
4750
5237
  "type": "boolean",
4751
- "description": "true = a trigger volume: no collision response, fires On Enter/On Exit nodes"
5238
+ "description": "true = a trigger volume: no collision response, fires On Enter/On Exit nodes — for bodies AND for the player walking in (on every peer; set the node's who: player to react only to players)"
4752
5239
  },
4753
5240
  "group": {
4754
5241
  "type": "string",
@@ -5625,6 +6112,7 @@
5625
6112
  "mesh": "create_mesh",
5626
6113
  "text": "create_text",
5627
6114
  "import": "import_shape",
6115
+ "path": "create_path",
5628
6116
  "shapes": "create_shapes"
5629
6117
  },
5630
6118
  "edit_shape": {
@@ -5685,7 +6173,11 @@
5685
6173
  },
5686
6174
  "game_setup": {
5687
6175
  "spawn": "place_spawn",
5688
- "play_camera": "set_play_camera"
6176
+ "play_camera": "set_play_camera",
6177
+ "levels": "set_levels",
6178
+ "portal": "set_portal",
6179
+ "checkpoint": "set_checkpoint",
6180
+ "loading": "set_loading"
5689
6181
  }
5690
6182
  },
5691
6183
  "tools": [
@@ -6417,7 +6909,7 @@
6417
6909
  {
6418
6910
  "name": "create_shape",
6419
6911
  "title": "Make a shape",
6420
- "description": "Make shapes the basic objects cannot: a lathe (a vase, a bowl, a lamp from a profile turned around an axis), a tube along a path (a rail, a pipe, a cable), an extruded outline (a sign, a star, a wall with a hole), a mesh from your own vertices (anything else), or text = 3D words (a sign, a title: flat, or solid with depth and a bevel; any bundled or Google Fonts font); import = a glTF / GLB / OBJ model file (base64, chunks or an https url) whose named parts come back as children animate_parts can move.\nCall it as {\"action\": \"lathe\", \"lathe\": {…its fields…}}; each action's fields and limits are in its object below.\nMany at once: {\"shapes\": [{\"action\": \"lathe\", \"lathe\": {…}}, …]} with no action — one call, one undo step.\nTake a screenshot after each change to check your work.",
6912
+ "description": "Make shapes the basic objects cannot: a lathe (a vase, a bowl, a lamp from a profile turned around an axis), a tube along a path (a rail, a pipe, a cable), an extruded outline (a sign, a star, a wall with a hole), a mesh from your own vertices (anything else), or text = 3D words (a sign, a title: flat, or solid with depth and a bevel; any bundled or Google Fonts font); path = a Path object guards patrol along (points with waits, speeds, jumps and events; walkers walk it at once); import = a glTF / GLB / OBJ model file (base64, chunks or an https url) whose named parts come back as children animate_parts can move.\nCall it as {\"action\": \"lathe\", \"lathe\": {…its fields…}}; each action's fields and limits are in its object below.\nMany at once: {\"shapes\": [{\"action\": \"lathe\", \"lathe\": {…}}, …]} with no action — one call, one undo step.\nTake a screenshot after each change to check your work.",
6421
6913
  "inputSchema": {
6422
6914
  "type": "object",
6423
6915
  "properties": {
@@ -6429,7 +6921,8 @@
6429
6921
  "extrude",
6430
6922
  "mesh",
6431
6923
  "text",
6432
- "import"
6924
+ "import",
6925
+ "path"
6433
6926
  ],
6434
6927
  "description": "What to do. Put its fields in the object named after the action."
6435
6928
  },
@@ -7082,22 +7575,139 @@
7082
7575
  "type": "string",
7083
7576
  "description": "Explorer folder (default \"Imported models\")"
7084
7577
  },
7085
- "castShadow": {
7086
- "type": "boolean"
7578
+ "castShadow": {
7579
+ "type": "boolean"
7580
+ },
7581
+ "receiveShadow": {
7582
+ "type": "boolean"
7583
+ },
7584
+ "source": {
7585
+ "type": "string",
7586
+ "description": "where it came from (kept with the model)"
7587
+ },
7588
+ "licence": {
7589
+ "type": "string",
7590
+ "description": "its licence, e.g. CC0"
7591
+ }
7592
+ },
7593
+ "description": "Bring in a 3D model file: glTF 2.0 (.glb, or .gltf JSON with everything embedded) or Wavefront .obj, as data (base64; for a big file send chunk: {id, index, total} parts, each a multiple of 4 base64 characters) or an https url (public addresses only, ≤ 25 MB; the file is copied into the library first, so the scene never needs the address again). Named sub-meshes become named children, returned in parts with uuids, so animate_parts can move them (a lid, a wheel, a door). position / rotation (radians) / scale as create_objects; with parentUuid they are the group's own space. castShadow / receiveShadow apply to every mesh in it. A model is data: nothing in it runs, and a file that points at outside files is refused. One undo step; everyone sees it."
7594
+ },
7595
+ "path": {
7596
+ "type": "object",
7597
+ "properties": {
7598
+ "points": {
7599
+ "type": "array",
7600
+ "minItems": 2,
7601
+ "maxItems": 200,
7602
+ "description": "at least 2: [x,y,z] or {pos: [x,y,z], wait?, speed?, ease?, jump?, event?, facing?}",
7603
+ "items": {
7604
+ "anyOf": [
7605
+ {
7606
+ "type": "array",
7607
+ "items": {
7608
+ "type": "number"
7609
+ },
7610
+ "minItems": 3,
7611
+ "maxItems": 3
7612
+ },
7613
+ {
7614
+ "type": "object",
7615
+ "properties": {
7616
+ "pos": {
7617
+ "type": "array",
7618
+ "items": {
7619
+ "type": "number"
7620
+ },
7621
+ "minItems": 3,
7622
+ "maxItems": 3
7623
+ },
7624
+ "wait": {
7625
+ "type": "number",
7626
+ "description": "seconds to stand at this point"
7627
+ },
7628
+ "speed": {
7629
+ "type": "number",
7630
+ "description": "m/s for the stretch AFTER this point (default: the path speed)"
7631
+ },
7632
+ "ease": {
7633
+ "type": "string",
7634
+ "enum": [
7635
+ "linear",
7636
+ "in",
7637
+ "out",
7638
+ "inout"
7639
+ ],
7640
+ "description": "the stretch after this point: linear, in (speed up), out (slow down), inout"
7641
+ },
7642
+ "jump": {
7643
+ "type": "boolean",
7644
+ "description": "skip straight to the next point (no walking in between)"
7645
+ },
7646
+ "event": {
7647
+ "type": "string",
7648
+ "description": "a name fired when a walker arrives here"
7649
+ },
7650
+ "facing": {
7651
+ "type": "number",
7652
+ "description": "degrees of yaw to face while waiting (0 = +Z)"
7653
+ }
7654
+ },
7655
+ "required": [
7656
+ "pos"
7657
+ ]
7658
+ }
7659
+ ]
7660
+ }
7661
+ },
7662
+ "walk": {
7663
+ "type": "string",
7664
+ "enum": [
7665
+ "loop",
7666
+ "pingpong",
7667
+ "once",
7668
+ "random"
7669
+ ],
7670
+ "description": "default loop"
7671
+ },
7672
+ "speed": {
7673
+ "type": "number",
7674
+ "description": "m/s, default 1.5"
7675
+ },
7676
+ "closed": {
7677
+ "type": "boolean",
7678
+ "description": "join the last point back to the first (3+ points)"
7679
+ },
7680
+ "smooth": {
7681
+ "type": "boolean",
7682
+ "description": "a smooth curve through the points (default) or straight lines"
7683
+ },
7684
+ "show_in_play": {
7685
+ "type": "boolean",
7686
+ "description": "draw the line while playing (default hidden)"
7687
+ },
7688
+ "seed": {
7689
+ "type": "number",
7690
+ "description": "random walk: which random order"
7087
7691
  },
7088
- "receiveShadow": {
7089
- "type": "boolean"
7692
+ "name": {
7693
+ "type": "string"
7090
7694
  },
7091
- "source": {
7092
- "type": "string",
7093
- "description": "where it came from (kept with the model)"
7695
+ "walkers": {
7696
+ "type": "array",
7697
+ "items": {
7698
+ "type": "string"
7699
+ },
7700
+ "description": "object uuids that walk this path now"
7094
7701
  },
7095
- "licence": {
7096
- "type": "string",
7097
- "description": "its licence, e.g. CC0"
7702
+ "offset": {
7703
+ "type": "number",
7704
+ "description": "walkers: seconds between each one along the path (spreads them out)"
7098
7705
  }
7099
7706
  },
7100
- "description": "Bring in a 3D model file: glTF 2.0 (.glb, or .gltf JSON with everything embedded) or Wavefront .obj, as data (base64; for a big file send chunk: {id, index, total} parts, each a multiple of 4 base64 characters) or an https url (public addresses only, ≤ 25 MB; the file is copied into the library first, so the scene never needs the address again). Named sub-meshes become named children, returned in parts with uuids, so animate_parts can move them (a lid, a wheel, a door). position / rotation (radians) / scale as create_objects; with parentUuid they are the group's own space. castShadow / receiveShadow apply to every mesh in it. A model is data: nothing in it runs, and a file that points at outside files is refused. One undo step; everyone sees it."
7707
+ "required": [
7708
+ "points"
7709
+ ],
7710
+ "description": "Add a Path object: a line through the scene that guards patrol, animals wander along or a camera rides. Points are WORLD positions; each point may also say how long to wait there, the speed and ease of the stretch after it, jump (skip straight to the next point), an event name fired on arrival (an On Path Event node hears it) and a facing to hold while waiting. walk: loop | pingpong | once | random. Hidden in Play unless show_in_play. walkers = object uuids that walk it at once (each gets a Path patrol node). Returns the path uuid; walk it later with create_flow_nodes pathpatrol {path: \"<uuid>\", offset}."
7101
7711
  },
7102
7712
  "shapes": {
7103
7713
  "type": "array",
@@ -7828,7 +8438,7 @@
7828
8438
  },
7829
8439
  "preset": {
7830
8440
  "type": "string",
7831
- "description": "a preset: Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, or a saved one list_materials names"
8441
+ "description": "a preset: Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, or a saved one list_materials names"
7832
8442
  },
7833
8443
  "cc0": {
7834
8444
  "type": "string",
@@ -7847,7 +8457,7 @@
7847
8457
  "required": [
7848
8458
  "objects"
7849
8459
  ],
7850
- "description": "Make objects look finished: colour, roughness, metalness, emissive, opacity and texture maps, on many objects in one call. Maps take a library image hash or an https URL (https only, CORS-enabled, 16 MB, PNG/JPEG/WebP/GIF/AVIF; it becomes a library item first and is re-encoded like an upload; returned in assets). cc0 fetches a free CC0 material by id or name from Poly Haven (its texture names) or ambientCG (ids like \"Wood051\", \"Bricks076\", \"Metal032\", \"Ground037\"), or by words (\"brown planks\"); preset applies a named preset: one of Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, or one the person saved (set_look {action: 'list_materials'} lists them all). faces gives just those faces their own new material slot. One undo step."
8460
+ "description": "Make objects look finished: colour, roughness, metalness, emissive, opacity and texture maps, on many objects in one call. Maps take a library image hash or an https URL (https only, CORS-enabled, 16 MB, PNG/JPEG/WebP/GIF/AVIF; it becomes a library item first and is re-encoded like an upload; returned in assets). cc0 fetches a free CC0 material by id or name from Poly Haven (its texture names) or ambientCG (ids like \"Wood051\", \"Bricks076\", \"Metal032\", \"Ground037\"), or by words (\"brown planks\"); preset applies a named preset: one of Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, or one the person saved (set_look {action: 'list_materials'} lists them all). faces gives just those faces their own new material slot. One undo step."
7851
8461
  },
7852
8462
  "list_materials": {
7853
8463
  "type": "object",
@@ -7874,7 +8484,7 @@
7874
8484
  "maximum": 200
7875
8485
  }
7876
8486
  },
7877
- "description": "What objects wear: per object its material slots (type, colour, numbers, which maps) and shader, plus the preset names (the starters Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, and any the person saved) and shader keys. Read this before editing."
8487
+ "description": "What objects wear: per object its material slots (type, colour, numbers, which maps) and shader, plus the preset names (the starters Wood, Metal, Plastic, Glass, Stone, Rubber, Fish scales, Neon, Water, and any the person saved) and shader keys. Read this before editing."
7878
8488
  },
7879
8489
  "get_material": {
7880
8490
  "type": "object",
@@ -8630,7 +9240,7 @@
8630
9240
  "description": "most lines (default 40)"
8631
9241
  }
8632
9242
  },
8633
- "description": "The page's recent log: errors, warnings, console lines and the toasts people saw, oldest first. Pass since (the \"now\" of the previous answer) for only what is new. status shows the newest few."
9243
+ "description": "The page's recent log: errors, warnings, console lines, Announce lines (scope announce: in Edit an Announce node draws no banner, its line lands here with the node that said it) and the toasts people saw, oldest first. Pass since (the \"now\" of the previous answer) for only what is new. status shows the newest few."
8634
9244
  },
8635
9245
  "photo": {
8636
9246
  "type": "object",
@@ -9776,8 +10386,8 @@
9776
10386
  },
9777
10387
  {
9778
10388
  "name": "game_setup",
9779
- "title": "Game setup: spawn and play camera",
9780
- "description": "How the game starts: spawn = where Play starts and which way the player faces; play_camera = first person walking or flying (speed, jump, eye height) and openingView = where the editor camera starts when the scene opens.\nCall it as {\"action\": \"spawn\", \"spawn\": {…its fields…}}; each action's fields and limits are in its object below.\nTake a screenshot after each change to check your work.",
10389
+ "title": "Game setup: spawn, play camera, levels, portals, checkpoints, loading",
10390
+ "description": "How the game starts: spawn = where Play starts and which way the player faces; play_camera = first person walking or flying (speed, jump, eye height) and openingView = where the editor camera starts when the scene opens; levels = the game's one Levels table (order, scene or spawn point, goals) and what carries from level to level (score, inventory, health, named variables); portal = a doorway to a level, scene or spot (one player at a time, with a fade / iris / card); checkpoint = a pad that saves the player's progress; loading = the loading screen a level change shows.\nCall it as {\"action\": \"spawn\", \"spawn\": {…its fields…}}; each action's fields and limits are in its object below.\nTake a screenshot after each change to check your work.",
9781
10391
  "inputSchema": {
9782
10392
  "type": "object",
9783
10393
  "properties": {
@@ -9785,7 +10395,11 @@
9785
10395
  "type": "string",
9786
10396
  "enum": [
9787
10397
  "spawn",
9788
- "play_camera"
10398
+ "play_camera",
10399
+ "levels",
10400
+ "portal",
10401
+ "checkpoint",
10402
+ "loading"
9789
10403
  ],
9790
10404
  "description": "What to do. Put its fields in the object named after the action."
9791
10405
  },
@@ -9883,6 +10497,326 @@
9883
10497
  }
9884
10498
  },
9885
10499
  "description": "How Play looks and where the editor opens. mode: first = first person through the player's eyes, walking (fly: true to fly) with speed, jumpHeight, eyeHeight, gravity — a Character Controller node in the scene graph, changed in place on a second call; none = the default Play camera. third / orbit / fixed are not Play cameras yet (the answer says what to use instead). openingView (H6): where the editor camera starts when the scene opens — {position, target}, \"spawn\" (behind the player), \"frame\" (the whole scene) or null; saved with the scene, nobody's view moves now."
10500
+ },
10501
+ "levels": {
10502
+ "type": "object",
10503
+ "properties": {
10504
+ "levels": {
10505
+ "type": "array",
10506
+ "items": {
10507
+ "type": "object",
10508
+ "properties": {
10509
+ "id": {
10510
+ "type": "string",
10511
+ "description": "a stable id (default: from the name)"
10512
+ },
10513
+ "name": {
10514
+ "type": "string"
10515
+ },
10516
+ "scene": {
10517
+ "type": "string",
10518
+ "description": "a project scene name: the level is that scene"
10519
+ },
10520
+ "spawn": {
10521
+ "type": "string",
10522
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
10523
+ },
10524
+ "goal": {
10525
+ "type": "string",
10526
+ "description": "one line the player reads"
10527
+ }
10528
+ }
10529
+ }
10530
+ },
10531
+ "add": {
10532
+ "type": "array",
10533
+ "items": {
10534
+ "type": "object",
10535
+ "properties": {
10536
+ "id": {
10537
+ "type": "string",
10538
+ "description": "a stable id (default: from the name)"
10539
+ },
10540
+ "name": {
10541
+ "type": "string"
10542
+ },
10543
+ "scene": {
10544
+ "type": "string",
10545
+ "description": "a project scene name: the level is that scene"
10546
+ },
10547
+ "spawn": {
10548
+ "type": "string",
10549
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
10550
+ },
10551
+ "goal": {
10552
+ "type": "string",
10553
+ "description": "one line the player reads"
10554
+ }
10555
+ }
10556
+ }
10557
+ },
10558
+ "update": {
10559
+ "type": "array",
10560
+ "items": {
10561
+ "type": "object",
10562
+ "properties": {
10563
+ "id": {
10564
+ "type": "string",
10565
+ "description": "a stable id (default: from the name)"
10566
+ },
10567
+ "name": {
10568
+ "type": "string"
10569
+ },
10570
+ "scene": {
10571
+ "type": "string",
10572
+ "description": "a project scene name: the level is that scene"
10573
+ },
10574
+ "spawn": {
10575
+ "type": "string",
10576
+ "description": "the name of an object to start at (a Checkpoint, a Portal or any marker), in the level's scene"
10577
+ },
10578
+ "goal": {
10579
+ "type": "string",
10580
+ "description": "one line the player reads"
10581
+ }
10582
+ }
10583
+ }
10584
+ },
10585
+ "remove": {
10586
+ "type": "array",
10587
+ "items": {
10588
+ "type": "string"
10589
+ }
10590
+ },
10591
+ "keep": {
10592
+ "type": "array",
10593
+ "items": {
10594
+ "type": "string"
10595
+ }
10596
+ },
10597
+ "unlock": {
10598
+ "type": "string",
10599
+ "enum": [
10600
+ "all",
10601
+ "sequential"
10602
+ ]
10603
+ },
10604
+ "clear": {
10605
+ "type": "boolean"
10606
+ }
10607
+ },
10608
+ "description": "The game's ONE Levels table: the levels in play order, each {name, scene (a project scene), spawn (an object name to start at), goal}; keep = what carries from level to level (score, inventory, health, or \"var:<name>\" for a named variable; New game resets them); unlock = all | sequential. levels replaces the list, add appends, update [{id, …}] patches, remove [ids] drops, clear: true removes the table; no field reads it. The Go to level / Next level / Finish level nodes and portals use this same table. One undo step."
10609
+ },
10610
+ "portal": {
10611
+ "type": "object",
10612
+ "properties": {
10613
+ "position": {
10614
+ "type": "array",
10615
+ "items": {
10616
+ "type": "number"
10617
+ },
10618
+ "minItems": 3,
10619
+ "maxItems": 3,
10620
+ "description": "its base [x, y, z] (a new one)"
10621
+ },
10622
+ "at": {
10623
+ "type": "object",
10624
+ "description": "placement like create_objects: {ping: \"latest\"} = at the person's ping"
10625
+ },
10626
+ "yaw": {
10627
+ "type": "number",
10628
+ "description": "turn in radians; its arrow points -Z at 0 (arriving players face the arrow)"
10629
+ },
10630
+ "face_user": {
10631
+ "type": "boolean"
10632
+ },
10633
+ "name": {
10634
+ "type": "string"
10635
+ },
10636
+ "object": {
10637
+ "type": "string",
10638
+ "description": "uuid of an existing one to change (leave out to place a new one)"
10639
+ },
10640
+ "show": {
10641
+ "type": "boolean",
10642
+ "description": "false = invisible in Play (still works): a trigger inside your own doorway"
10643
+ },
10644
+ "level": {
10645
+ "type": "string"
10646
+ },
10647
+ "scene": {
10648
+ "type": "string"
10649
+ },
10650
+ "spawn": {
10651
+ "type": "string"
10652
+ },
10653
+ "back": {
10654
+ "type": "boolean"
10655
+ },
10656
+ "transition": {
10657
+ "type": "string",
10658
+ "enum": [
10659
+ "fade",
10660
+ "iris",
10661
+ "card",
10662
+ "none"
10663
+ ]
10664
+ },
10665
+ "loading": {
10666
+ "type": [
10667
+ "object",
10668
+ "null"
10669
+ ],
10670
+ "properties": {
10671
+ "preset": {
10672
+ "type": "string",
10673
+ "enum": [
10674
+ "fade",
10675
+ "bar",
10676
+ "logo",
10677
+ "image",
10678
+ "item"
10679
+ ]
10680
+ },
10681
+ "background": {
10682
+ "type": "string",
10683
+ "description": "#rrggbb"
10684
+ },
10685
+ "image": {
10686
+ "type": "string",
10687
+ "description": "an image URL or library item (the image preset)"
10688
+ },
10689
+ "logo": {
10690
+ "type": "string"
10691
+ },
10692
+ "textColor": {
10693
+ "type": "string"
10694
+ },
10695
+ "bar": {
10696
+ "type": "object",
10697
+ "properties": {
10698
+ "style": {
10699
+ "type": "string",
10700
+ "enum": [
10701
+ "thin",
10702
+ "thick"
10703
+ ]
10704
+ },
10705
+ "color": {
10706
+ "type": "string"
10707
+ }
10708
+ }
10709
+ },
10710
+ "tips": {
10711
+ "type": "array",
10712
+ "items": {
10713
+ "type": "string"
10714
+ }
10715
+ },
10716
+ "title": {
10717
+ "type": "string"
10718
+ }
10719
+ }
10720
+ }
10721
+ },
10722
+ "description": "A Portal: a doorway that takes the player who walks through it somewhere else, ONE player at a time. Target: level (a Levels-table row id or name), or scene (a project scene) and / or spawn (an object name to arrive at), or back: true (where they came from). transition = fade | iris | card | none (VR always fades); loading = this portal's own loading screen. New: position or at; change one: object (uuid). What the game keeps (game_setup {action: 'levels'} keep) carries through. One undo step."
10723
+ },
10724
+ "checkpoint": {
10725
+ "type": "object",
10726
+ "properties": {
10727
+ "position": {
10728
+ "type": "array",
10729
+ "items": {
10730
+ "type": "number"
10731
+ },
10732
+ "minItems": 3,
10733
+ "maxItems": 3,
10734
+ "description": "its base [x, y, z] (a new one)"
10735
+ },
10736
+ "at": {
10737
+ "type": "object",
10738
+ "description": "placement like create_objects: {ping: \"latest\"} = at the person's ping"
10739
+ },
10740
+ "yaw": {
10741
+ "type": "number",
10742
+ "description": "turn in radians; its arrow points -Z at 0 (arriving players face the arrow)"
10743
+ },
10744
+ "face_user": {
10745
+ "type": "boolean"
10746
+ },
10747
+ "name": {
10748
+ "type": "string"
10749
+ },
10750
+ "object": {
10751
+ "type": "string",
10752
+ "description": "uuid of an existing one to change (leave out to place a new one)"
10753
+ },
10754
+ "label": {
10755
+ "type": "string"
10756
+ },
10757
+ "show": {
10758
+ "type": "boolean",
10759
+ "description": "false = no message when reached (it still saves)"
10760
+ }
10761
+ },
10762
+ "description": "A Checkpoint pad: stepping on it saves THAT player's progress there; after a fall (or Back to checkpoint, or reloading an exported game) they come back to it. New: position or at; change one: object (uuid). label = what the flash says. One undo step."
10763
+ },
10764
+ "loading": {
10765
+ "type": "object",
10766
+ "properties": {
10767
+ "preset": {
10768
+ "type": "string",
10769
+ "enum": [
10770
+ "fade",
10771
+ "bar",
10772
+ "logo",
10773
+ "image",
10774
+ "item"
10775
+ ]
10776
+ },
10777
+ "background": {
10778
+ "type": "string",
10779
+ "description": "#rrggbb"
10780
+ },
10781
+ "image": {
10782
+ "type": "string",
10783
+ "description": "an image URL or library item (the image preset)"
10784
+ },
10785
+ "logo": {
10786
+ "type": "string"
10787
+ },
10788
+ "textColor": {
10789
+ "type": "string"
10790
+ },
10791
+ "bar": {
10792
+ "type": "object",
10793
+ "properties": {
10794
+ "style": {
10795
+ "type": "string",
10796
+ "enum": [
10797
+ "thin",
10798
+ "thick"
10799
+ ]
10800
+ },
10801
+ "color": {
10802
+ "type": "string"
10803
+ }
10804
+ }
10805
+ },
10806
+ "tips": {
10807
+ "type": "array",
10808
+ "items": {
10809
+ "type": "string"
10810
+ }
10811
+ },
10812
+ "title": {
10813
+ "type": "string"
10814
+ },
10815
+ "clear": {
10816
+ "type": "boolean"
10817
+ }
10818
+ },
10819
+ "description": "The loading screen every level change shows (only when the load takes a moment; at least 0.4 s once shown): preset fade | bar | logo | image | item, background, image, logo, bar {style, color}, tips (lines that rotate), title; clear: true = the default bar. Fields you leave out stay. Needs a Levels table (game_setup {action: 'levels'}). No field reads it. One undo step."
9886
10820
  }
9887
10821
  },
9888
10822
  "required": [
@@ -9890,7 +10824,7 @@
9890
10824
  ]
9891
10825
  },
9892
10826
  "annotations": {
9893
- "title": "Game setup: spawn and play camera",
10827
+ "title": "Game setup: spawn, play camera, levels, portals, checkpoints, loading",
9894
10828
  "readOnlyHint": false,
9895
10829
  "destructiveHint": true,
9896
10830
  "openWorldHint": false
@@ -10048,7 +10982,7 @@
10048
10982
  },
10049
10983
  "data": {
10050
10984
  "type": "object",
10051
- "description": "node params, e.g. spin {axis:\"y\",speed:2}; bounce {amplitude:0.5,speed:2}; pathpatrol {points:[[x,y,z],…] (>=2 world waypoints), speed:1, mode:\"loop\"|\"pingpong\"}; setcolor {color:\"#ff0000\"}; latch {initial:false}; delay {seconds:3}; sequence {delay1:0,delay2:0.5,delay3:0.5,delay4:0.5} (delays are CUMULATIVE). Omit for defaults."
10985
+ "description": "node params, e.g. spin {axis:\"y\",speed:2}; bounce {amplitude:0.5,speed:2}; pathpatrol {path:\"<Path object uuid from create_path>\", offset:0, face:true} (walks the Path: its waits/speeds/events live on the Path; legacy {points:[[x,y,z],…], speed, mode} still works); onpathevent {path, event} fires when a walker arrives at a point carrying that event; setcolor {color:\"#ff0000\"}; latch {initial:false}; delay {seconds:3}; sequence {delay1:0,delay2:0.5,delay3:0.5,delay4:0.5} (delays are CUMULATIVE). Omit for defaults."
10052
10986
  }
10053
10987
  },
10054
10988
  "required": [
@@ -10171,7 +11105,7 @@
10171
11105
  {
10172
11106
  "name": "create_behaviour",
10173
11107
  "title": "Add a code behaviour",
10174
- "description": "Create a code behaviour: game logic (rules, waves, scoring, timers, win/lose) as ONE JavaScript module, run on the session authority and replicated. Prefer it over large node graphs for game rules. Linted before it is applied; problems come back with line numbers. The result names the node id and its sockets — wire them with create_flow_nodes (an On Click / On Enter into an input; an output into HUD Text, Visibility, Announce…).\nBEHAVIOURS (create_behaviour / edit_behaviour): game logic as ONE JavaScript module, run on ONE peer (the session authority); `state` replicates to everyone.\nexport default behaviour({ name, params: {k: literal | {value, min, max, step, unit}}, state: {plain JSON}, inputs: [names], outputs: [names], on: {event(payload) {...}}, ...methods });\ninputs: a trigger wired into input \"x\" runs on.x. outputs: a state field = a value output, any other name = an event fired by this.emit(\"name\").\nA behaviour does NOT move, rotate, recolour or hide objects (no such this.*): it drives effect nodes (spin, visibility, setcolor…) via its outputs. NO per-frame hook (no onTick/update): repeat with this.after(seconds, \"method\").\nthis: params, state, kit (also bare `kit`), after(seconds, \"method\", ...args) (survives the host leaving; counts PLAY time — it holds while the game is paused), cancel(key), rand(), randInt(a,b), pick(list), now(), find(glob) / findAll(glob) -> {uuid, name, pos, tags}, object, log() — always as this.find(…) etc. (only `kit` and the helpers are bare). Helpers: dist(a,b), clamp, lerp.\nevents: load (runs on EVERY peer when the behaviour loads — local, state read-only: register things there), start (once, on the authority); grabRequest({piece, distance, hand, refuse}) (runs on the grabbing peer, read-only: call refuse(reason)); any kit event as \"piece.event\" or roundStart, go, won, lost, paused, resumed, menu, levelSelected, scored, collected, allCollected, spawned, despawned, emptied, damaged, healed, died, revived, stuck, grabRefused. Entity payloads have entity.is(glob), entity.hasTag(t).\nkit calls: kit.round.start/win(reason)/lose(reason), kit.score.add(n), kit.spawner.spawn({kind, template: uuid, at, count, hp, mover: {speed}}), kit.health.damage(id, n), kit.mover.chase(kind, \"nearestPlayer\"), kit.rules.set({reach, jump}), kit.pickups.register({id, score, respawn, radius}) — register pickups in on.load (every peer must know them, or touching one does nothing), never in start.\nForbidden (the load is refused): Math.random, Date / Date.now, performance.now, localStorage, document/window/globalThis, fetch, eval, setTimeout/setInterval, import. Unknown this.* members, unknown events and hook-named methods nothing calls are refused too.\nEXAMPLE (passes the lint; wire a trigger into input gemTouched, output left into a HUD Text, timeUp into a Visibility or Announce):\nexport default behaviour({\n name: 'Countdown',\n params: { seconds: 30 },\n state: { left: 30, found: 0 },\n inputs: ['gemTouched'],\n outputs: ['left', 'found', 'timeUp'],\n on: {\n start() { this.state.left = this.params.seconds; this.after(1, 'tick'); },\n gemTouched() { this.state.found += 1; }\n },\n tick() {\n this.state.left -= 1;\n if (this.state.left > 0) this.after(1, 'tick');\n else this.emit('timeUp');\n }\n});\nTake a screenshot after each change to check your work.",
11108
+ "description": "Create a code behaviour: game logic (rules, waves, scoring, timers, win/lose) as ONE JavaScript module, run on the session authority and replicated. Prefer it over large node graphs for game rules. Linted before it is applied; problems come back with line numbers. The result names the node id and its sockets — wire them with create_flow_nodes (an On Click / On Enter into an input; an output into HUD Text, Visibility, Announce…).\nBEHAVIOURS (create_behaviour / edit_behaviour): game logic as ONE JavaScript module, run on ONE peer (the session authority); `state` replicates to everyone.\nexport default behaviour({ name, params: {k: literal | {value, min, max, step, unit}}, state: {plain JSON}, inputs: [names], outputs: [names], on: {event(payload) {...}}, ...methods });\ninputs: a trigger wired into input \"x\" runs on.x. outputs: a state field = a value output, any other name = an event fired by this.emit(\"name\").\nA behaviour does NOT move, rotate, recolour or hide objects (no such this.*): it drives effect nodes (spin, visibility, setcolor…) via its outputs. NO per-frame hook (no onTick/update): repeat with this.after(seconds, \"method\").\nthis: params, state, kit (also bare `kit`), after(seconds, \"method\", ...args) (survives the host leaving; counts PLAY time — it holds while the game is paused), cancel(key), rand(), randInt(a,b), pick(list), now(), find(glob) / findAll(glob) -> {uuid, name, pos, tags}, object, log() — always as this.find(…) etc. (only `kit` and the helpers are bare). Helpers: dist(a,b), clamp, lerp.\nevents: load (runs on EVERY peer when the behaviour loads — local, state read-only: register things there), start (once, on the authority); grabRequest({piece, distance, hand, refuse}) (runs on the grabbing peer, read-only: call refuse(reason)); any kit event as \"piece.event\" or roundStart, go, won, lost, paused, resumed, menu, levelSelected, scored, collected, allCollected, spawned, despawned, emptied, damaged, healed, died, revived, stuck, grabRefused. Entity payloads have entity.is(glob), entity.hasTag(t).\nkit calls: kit.round.start/win(reason)/lose(reason), kit.score.add(n), kit.spawner.spawn({kind, template: uuid, at, count, hp, mover: {speed}}), kit.health.damage(id, n), kit.mover.chase(kind, \"nearestPlayer\"), kit.rules.set({reach, jump}), kit.pickups.register({id, score, respawn, radius}) — register pickups in on.load (every peer must know them, or touching one does nothing), never in start.\nA handler that throws is rolled back (state, after() timers, emits; kit calls already sent stay) and its error names the handler. A refused kit call answers {refused: true, reason}.\nForbidden (the load is refused): Math.random, Date / Date.now, performance.now, localStorage, document/window/globalThis, fetch, eval, setTimeout/setInterval, import. Unknown this.* members, unknown events and hook-named methods nothing calls are refused too.\nEXAMPLE (passes the lint; wire a trigger into input gemTouched, output left into a HUD Text, timeUp into a Visibility or Announce):\nexport default behaviour({\n name: 'Countdown',\n params: { seconds: 30 },\n state: { left: 30, found: 0 },\n inputs: ['gemTouched'],\n outputs: ['left', 'found', 'timeUp'],\n on: {\n start() { this.state.left = this.params.seconds; this.after(1, 'tick'); },\n gemTouched() { this.state.found += 1; }\n },\n tick() {\n this.state.left -= 1;\n if (this.state.left > 0) this.after(1, 'tick');\n else this.emit('timeUp');\n }\n});\nTake a screenshot after each change to check your work.",
10175
11109
  "inputSchema": {
10176
11110
  "type": "object",
10177
11111
  "properties": {
@@ -10276,7 +11210,7 @@
10276
11210
  },
10277
11211
  "sensor": {
10278
11212
  "type": "boolean",
10279
- "description": "true = a trigger volume: no collision response, fires On Enter/On Exit nodes"
11213
+ "description": "true = a trigger volume: no collision response, fires On Enter/On Exit nodes — for bodies AND for the player walking in (on every peer; set the node's who: player to react only to players)"
10280
11214
  },
10281
11215
  "group": {
10282
11216
  "type": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theprototype/agent",
3
- "version": "1.63.0",
3
+ "version": "1.64.0",
4
4
  "description": "Let an AI agent (Claude Code, Claude Desktop, any MCP host) join a theprototype.app session from its link and build the 3D scene with you.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/catalog.js CHANGED
@@ -48,6 +48,7 @@ export const TOOL_ANNOTATIONS = /** @type {Record<string, {title: string, read?:
48
48
  create_lathe: { title: 'Make a lathed shape', destructive: false },
49
49
  create_text: { title: 'Add 3D text', destructive: false, openWorld: true },
50
50
  list_fonts: { title: 'List fonts for 3D text', read: true },
51
+ create_path: { title: 'Add a path to walk along', destructive: false }, // 78 F4
51
52
  create_tube: { title: 'Make a tube along a path', destructive: false },
52
53
  extrude_shape: { title: 'Extrude an outline', destructive: false },
53
54
  create_mesh: { title: 'Make a mesh from data', destructive: false },
@@ -263,8 +264,8 @@ export const CONNECTOR_FAMILIES = Object.freeze({
263
264
  create_shape: {
264
265
  title: 'Make a shape',
265
266
  summary:
266
- 'Make shapes the basic objects cannot: a lathe (a vase, a bowl, a lamp from a profile turned around an axis), a tube along a path (a rail, a pipe, a cable), an extruded outline (a sign, a star, a wall with a hole), a mesh from your own vertices (anything else), or text = 3D words (a sign, a title: flat, or solid with depth and a bevel; any bundled or Google Fonts font); import = a glTF / GLB / OBJ model file (base64, chunks or an https url) whose named parts come back as children animate_parts can move.',
267
- actions: { lathe: 'create_lathe', tube: 'create_tube', extrude: 'extrude_shape', mesh: 'create_mesh', text: 'create_text', import: 'import_shape' },
267
+ 'Make shapes the basic objects cannot: a lathe (a vase, a bowl, a lamp from a profile turned around an axis), a tube along a path (a rail, a pipe, a cable), an extruded outline (a sign, a star, a wall with a hole), a mesh from your own vertices (anything else), or text = 3D words (a sign, a title: flat, or solid with depth and a bevel; any bundled or Google Fonts font); path = a Path object guards patrol along (points with waits, speeds, jumps and events; walkers walk it at once); import = a glTF / GLB / OBJ model file (base64, chunks or an https url) whose named parts come back as children animate_parts can move.',
268
+ actions: { lathe: 'create_lathe', tube: 'create_tube', extrude: 'extrude_shape', mesh: 'create_mesh', text: 'create_text', import: 'import_shape', path: 'create_path' }, // 78 F4: a new ACTION, no new connector tool name
268
269
  batch: { key: 'shapes', tool: 'create_shapes' }
269
270
  },
270
271
  edit_shape: {
@@ -329,10 +330,10 @@ export const CONNECTOR_FAMILIES = Object.freeze({
329
330
  },
330
331
  // 85-scene (85b): 85 H3 + H6; levels / portal / loading / checkpoint join with 91 / 93
331
332
  game_setup: {
332
- title: 'Game setup: spawn and play camera',
333
+ title: 'Game setup: spawn, play camera, levels, portals, checkpoints, loading',
333
334
  summary:
334
- 'How the game starts: spawn = where Play starts and which way the player faces; play_camera = first person walking or flying (speed, jump, eye height) and openingView = where the editor camera starts when the scene opens.',
335
- actions: { spawn: 'place_spawn', play_camera: 'set_play_camera' }
335
+ 'How the game starts: spawn = where Play starts and which way the player faces; play_camera = first person walking or flying (speed, jump, eye height) and openingView = where the editor camera starts when the scene opens; levels = the game\'s one Levels table (order, scene or spawn point, goals) and what carries from level to level (score, inventory, health, named variables); portal = a doorway to a level, scene or spot (one player at a time, with a fade / iris / card); checkpoint = a pad that saves the player\'s progress; loading = the loading screen a level change shows.',
336
+ actions: { spawn: 'place_spawn', play_camera: 'set_play_camera', levels: 'set_levels', portal: 'set_portal', checkpoint: 'set_checkpoint', loading: 'set_loading' }
336
337
  }
337
338
  });
338
339