A mech game prototype, pushed by GPT-6-Astra
agent (cont.)
+1:07exec_commandcat kit/build.py && cat kit/lab/assembly.py && cat kit/lab/pilotlab.py (+2 more)
command
cat kit/build.py && cat kit/lab/assembly.py && cat kit/lab/pilotlab.py cat src/render/mech.ts | head -230 && cat src/render/ship.ts | head -130 && cat src/render/palette.ts | head -130 cat docs/housekeeping.md && cat vite.config.ts && ls -lh public/assets/striker* public/assets/ship* public/assets/lab_pilot* && ~/.local/bin/blender -b --version && command -v ffmpeg
result, 9 lines
Script completed Wall time 0.2 seconds Output: Warning: truncated output (original token count: 11504) Total output lines: 3 {"status":"fulfilled","value":{"chunk_id":"34cf69","wall_time_seconds":0.00000526,"exit_code":0,"original_token_count":4028,"output":"\"\"\"Build every model into public/assets/*.glb.\n\n npm run kit # everything\n npm run kit -- striker ship # just these\n npm run kit -- block_dummy # a block model, kit/blocks/dummy.py\n\"\"\"\nimport os\nimport sys\nimport time\n\nsys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))\n\nimport lib # noqa: E402\nfrom block import build_block # noqa: E402\nfrom cockpit import build_cockpit # noqa: E402\nfrom cockpit_light import build_cockpit_light # noqa: E402\nfrom mech import build_striker # noqa: E402\nfrom heavy import build_heavy, build_heavy_lab # noqa: E402\nfrom props import build_cannon, build_drone, build_rifle # noqa: E402\nfrom ship import build_ship # noqa: E402\nfrom station import build_station # noqa: E402\nfrom salvage import build_salvage_pod, build_wreck_field # noqa: E402\nfrom escape_pod import build_escape_pod # noqa: E402\nfrom light import build_light, build_light_lab # noqa: E402\nfrom automaton import build_automaton, build_automaton_lab # noqa: E402\nfrom alien import build_alien, build_alien_lab # noqa: E402\nsys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), \"lab\"))\nfrom heads import build_head_lab, build_head_lab2 # noqa: E402\nfrom headkit import build_head_lab3, build_head_lab4, build_head_lab5, build_head_lab6, build_head_lab7, build_head_lab8 # noqa: E402\nfrom sizes import build_sizes # noqa: E402\nfrom pilotlab import build_pilot_lab # noqa: E402\nfrom assembly import build_assembly_lab, build_back_lab, build_chest_frames, build_show, game_frame # noqa: E402\nfrom raider import build_raider, build_raider_lab # noqa: E402\nfrom pattern_lab import build_pattern_lab, build_pattern_m # noqa: E402\nfrom atelier_lab import build_atelier_lab # noqa: E402\nfrom atelier_board import build_atelier_line # noqa: E402\nfrom bodykit import build_chest_lab, build_chest_lab2, build_foot_lab, build_foot_lab2, build_chest_lab3, build_foot_lab3 # noqa: E402\n\nOUT = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\", \"public\", \"assets\")\nASSETS = {\"striker\": build_striker, \"striker_a\": lambda: game_frame(0), \"striker_b\": lambda: game_frame(1), \"rifle\": build_rifle, \"cannon\": build_cannon, \"drone\": build_drone,\n \"cockpit\": build_cockpit, \"cockpit_light\": build_cockpit_light, \"ship\": build_ship, \"station\": build_station,\n \"wreck_field\": build_wreck_field, \"salvage_pod\": build_salvage_pod, \"escape_pod\": build_escape_pod,\n \"light\": lambda: build_light(\"knight\"), \"light_line\": lambda: build_light(\"line\"), \"light_lancer\": lambda: build_light(\"lancer\"),\n \"heavy\": lambda: build_heavy(\"A\"), \"heavy_B\": lambda: build_heavy(\"B\"), \"heavy_C\": lambda: build_heavy(\"C\"),\n \"lab_heads\": build_head_lab, \"lab_heads2\": build_head_lab2, \"lab_heads3\": build_head_lab3, \"lab_heads4\": build_head_lab4, \"lab_heads5\": build_head_lab5, \"lab_heads6\": build_head_lab6, \"lab_heads7\": build_head_lab7, \"lab_heads8\": build_head_lab8, \"lab_chests\": build_chest_lab, \"lab_feet\": build_foot_lab, \"lab_chests2\": build_chest_lab2, \"lab_feet2\": build_foot_lab2, \"lab_chests3\": build_chest_lab3, \"lab_feet3\": build_foot_lab3, \"lab_frames\": build_assembly_lab, \"lab_backs\": build_back_lab, \"lab_chests4\": build_chest_frames,\n \"lab_show\": build_show, \"lab_show_v\": lambda: build_show(formation=True),\n \"lab_heavy\": build_heavy_lab, \"lab_light\": build_light_lab, \"lab_sizes\": build_sizes, \"lab_pilot\": build_pilot_lab,\n \"auto_tally\": lambda: build_automaton(\"tally\"), \"auto_tick\": lambda: build_automaton(\"tick\"),\n \"auto_ledger\": lambda: build_automaton(\"ledger\"),\n \"alien_acicular\": lambda: build_alien(\"acicular\"), \"alien_druse\": lambda: build_alien(\"druse\"),\n \"alien_druse_mimic\": lambda: build_alien(\"druse_mimic\"), \"alien_geode\": lambda: build_alien(\"geode\"),\n \"raider_grunt\": lambda: build_raider(\"grunt\"), \"raider_brawler\": lambda: build_raider(\"brawler\"),\n \"raider_boss\": lambda: build_raider(\"boss\"),\n \"pattern_m\": build_pattern_m, \"lab_pattern\": build_pattern_lab, \"lab_atelier\": build_atelier_lab, \"lab_atelier_a\": lambda: build_atelier_line(\"a\"), \"lab_atelier_b\": lambda: build_atelier_line(\"b\"),\n \"lab_atelier_c\": lambda: build_atelier_line(\"c\"), \"lab_atelier_d\": lambda: build_atelier_line(\"d\"),\n \"lab_auto\": build_automaton_lab, \"lab_alien\": build_alien_lab, \"lab_raider\": build_raider_lab}\n\n\ndef main(names):\n os.makedirs(OUT, exist_ok=True)\n for name in names or [n for n in ASSETS if not n.startswith(\"lab\")]:\n t = time.time()\n lib.reset()\n if name.startswith(\"block_\"): # scratch models, kit/blocks/<name>.py\n build_block(name)\n else:\n ASSETS[name]()\n path = os.path.normpath(os.path.join(OUT, f\"{name}.glb\"))\n lib.export(path)\n print(f\"kit: {name} -> {path} ({os.path.getsize(path) // 1024} KB, {time.time() - t:.1f}s)\")\n\n\nmain(sys.argv[sys.argv.index(\"--\") + 1:] if \"--\" in sys.argv else [])\n\"\"\"Fit lab variants onto the full striker frame: its head, chest armour and feet are removed and\nvariants built onto the same joints. This is part swapping, the way the game will do it.\"\"\"\nimport re\n\nimport bpy\nfrom mathutils import Matrix, Vector\n\nimport backkit\nimport bodykit\nimport chestkit\nimport headkit\nfrom lib import attach, empty\nfrom mech import build_striker\n\n# striker parts replaced by a chest variant (base names; Blender may add .001 suffixes)\nCHEST_PARTS = {\"chest_plate.L\", \"chest_plate.R\", \"chest_strip.L\", \"chest_strip.R\", \"rib_plate0.L\", \"rib_plate0.R\", \"rib_plate1.L\",\n \"rib_plate1.R\", \"side_plate.L\", \"side_plate.R\", \"belly\", \"belly_vent\", \"lens_socket\", \"lens\", \"lens_core\", \"hatch\",\n \"collar.L\", \"collar.R\", \"collar_side.L\", \"collar_side.R\", \"collar_vent.L\", \"collar_vent.R\", \"back_plate\", \"neck_guard\"}\n\n\ndef base(name):\n return re.sub(r\"\\.\\d{3}$\", \"\", name)\n\n\ndef joint(frame, name):\n for o in frame.children_recursive:\n if o.type == \"EMPTY\" and base(o.name) == name:\n return o\n raise KeyError(name)\n\n\ndef remove(objs):\n for o in objs:\n bpy.data.objects.remove(o, do_unlink=True)\n\n\ndef fit(build, at, parent):\n \"\"\"Build a variant into a temporary empty at `at`, then hand its parts to a frame joint.\"\"\"\n tmp = empty(\"_fit\", at)\n build(tmp)\n for ob in list(tmp.children):\n ob.matrix_parent_inverse = Matrix.Identity(4)\n ob.location = (0, 0, 0)\n bpy.context.view_layer.update()\n for ob in list(tmp.children):\n attach(ob, parent)\n bpy.data.objects.remove(tmp, do_unlink=True)\n\n\ndef assemble(head_parts, chest, foot, n, extras=(), fold=0.0):\n frame = build_striker()\n bpy.context.view_layer.update()\n head_j, torso_j = joint(frame, \"head\"), joint(frame, \"torso\")\n remove([o for o in head_j.children_recursive if o.type == \"MESH\"])\n remove([o for o in torso_j.children if o.type == \"MESH\" and base(o.name) in CHEST_PARTS])\n for s in (\"L\", \"R\"):\n remove([o for o in joint(frame, f\"foot.{s}\").children_recursive if o.type == \"MESH\" and base(o.name) != f\"ankle.{s}\"])\n bodykit.CONTEXT = False\n try:\n fit(lambda r: headkit.head_gen4(r, f\"{n}h\", head_parts, extras, fold), (0, -.05, 15.55), head_j)\n fit(lambda r: chest(r, f\"{n}c\"), (0, 0, 11.9), torso_j)\n for s, sx in ((\"L\", 1), (\"R\", -1)):\n fit(lambda r, s=s: foot(r, f\"{n}f{s}\"), (1.2 * sx, .1, .15), joint(frame, f\"foot.{s}\"))\n finally:\n bodykit.CONTEXT = True\n return frame\n\n\nH = dict(headkit.GEN4)\nCOMBOS = [\n (\"A\", \"Mantle IV\", lambda r, n: bodykit.chest_hatch3(r, n, diamond=True), bodykit.foot_claw3),\n (\"B\", \"Duelist IV\", bodykit.chest_swept3, bodykit.foot_raptor),\n (\"C\", \"Sentinel IV\", bodykit.chest_cuirass3, bodykit.foot_sabaton2),\n (\"D\", \"Warden IV\", bodykit.chest_hatch3, bodykit.foot_talon),\n (\"E\", \"Tracker IV\", bodykit.chest_swept3, bodykit.foot_skid),\n (\"F\", \"Lancer IV\", bodykit.chest_cuirass3, bodykit.foot_boot2),\n]\n\n\ndef build_assembly_lab():\n root = empty(\"lab\", (0, 0, 0))\n for i, (tag, head, chest, foot) in enumerate(COMBOS):\n frame = assemble(H[head], chest, foot, f\"a{i}\")\n slot = empty(f\"slot{i}\", (i * 11.0, 0, 0), root, label=f\"{tag}: {head}\")\n attach(frame, slot)\n frame.matrix_parent_inverse = Matrix.Identity(4)\n frame.location = (0, 0, 0)\n bpy.context.view_layer.update()\n return root\n\n\n# striker shoulder-shell parts replaced by a shoulder variant (block, trunnion and forks stay)\nSHOULDER_PARTS = {\"shell0\", \"shell1\", \"shell_under\", \"shell_blade\", \"shell_edge\", \"shell_fin\"}\n\n\ndef move(j, at):\n j.location = j.parent.matrix_world.inverted() @ Vector(at)\n bpy.context.view_layer.update()\n\n\ndef refit_back(frame, pack, shoulder, n):\n \"\"\"Swap a frame's backpack and shoulder shells. Variants build into roots at the origin in world\n coordinates; the binder joints move to the pack's hinge before the parts are handed over.\"\"\"\n pack_j = joint(frame, \"backpack\")\n J = {\"P\": pack_j, \"L\": joint(frame, \"binder.L\"), \"R\": joint(frame, \"binder.R\"),\n \"SL\": joint(frame, \"shoulder.L\"), \"SR\": joint(frame, \"shoulder.R\")}\n remove([o for o in pack_j.children_recursive if o.type == \"MESH\" or base(o.name).startswith(\"nozzle\")])\n for k in (\"SL\", \"SR\"):\n remove([o for o in J[k].children if o.type == \"MESH\" and base(o.name).rsplit(\".\", 1)[0] in SHOULDER_PARTS])\n roots = {k: empty(f\"_{k}\") for k in J}\n x, y, z = pack(roots, f\"{n}p\")\n move(J[\"L\"], (x, y, z))\n move(J[\"R\"], (-x, y, z))\n shoulder(roots, f\"{n}s\")\n for k, root in roots.items():\n for ob in list(root.children):\n attach(ob, J[k])\n bpy.data.objects.remove(root, do_unlink=True)\n\n\ndef assemble_back(pack, shoulder, n):\n \"\"\"Frame A with a backpack and shoulder variant.\"\"\"\n frame = assemble(H[\"Mantle IV\"], COMBOS[0][2], bodykit.foot_claw3, n)\n if pack is not None:\n refit_back(frame, pack, shoulder, n)\n return frame\n\n\ndef build_back_lab():\n root = empty(\"lab\", (0, 0, 0))\n combos = [(\"now\", \"current pack and shoulders\", None, None)] + [\n (chr(65 + i), f\"{p} + {s}\", pf, sf) for i, ((p, pf), (s, sf)) in enumerate(zip(backkit.PACKS, backkit.SHOULDERS))]\n for i, (tag, label, pack, shoulder) in enumerate(combos):\n frame = assemble_back(pack, shoulder, f\"b{i}\")\n slot = empty(f\"slot{i}\", (i * 11.0, 0, 0), root, label=f\"{tag}: {label}\")\n attach(frame, slot)\n frame.matrix_parent_inverse = Matrix.Identity(4)\n frame.location = (0, 0, 0)\n bpy.context.view_layer.update()\n return root\n\n\ndef build_chest_frames():\n \"\"\"Round 14: each new chest with one of the angled heads, on the wing pack and swept shoulders.\"\"\"\n root = empty(\"lab\", (0, 0, 0))\n for i, ((chest, cf), (head, parts, extras, fold)) in enumerate(zip(chestkit.CHESTS4, headkit.GEN5)):\n frame = assemble(parts, cf, bodykit.foot_claw3, f\"c{i}\", extras, fold)\n refit_back(frame, backkit.pack_wings, backkit.shoulder_swept, f\"c{i}\")\n slot = empty(f\"slot{i}\", (i * 11.0, 0, 0), root, label=f\"{chr(65 + i)}: {chest} chest, {head}\")\n attach(frame, slot)\n frame.matrix_parent_inverse = Matrix.Identity(4)\n frame.location = (0, 0, 0)\n bpy.context.view_layer.update()\n return root\n\n\nSHOW = [(\"A\", \"Mantle V\", \"Hatch IV\", \"Wings\", \"Swept\", \"Claw II\"),\n (\"B\", \"Duelist V\", \"Prow\", \"Sunk drive\", \"Thruster\", \"Raptor\"),\n (\"C\", \"Warden V\", \"Layered\", \"Fairing\", \"Shield\", \"Sabaton II\"),\n (\"D\", \"Surveyor V\", \"Intakes\", \"Keel\", \"Sode\", \"Skid\"),\n (\"E\", \"Sentinel V\", \"Gorget\", \"Rack\", \"Round\", \"Boot II\"),\n (\"F\", \"Lancer V\", \"Frame\", \"Saddle\", \"Open frame\", \"Talon\"),\n (\"G\", \"Tracker V\", \"Intakes\", \"Saddle\", \"Swept\", \"Talon\")]\n\n\ndef show_frame(i, n=None):\n \"\"\"One SHOW mix as a game model: frame A is SHOW[0]. The root is tagged striker_a, striker_b...\"\"\"\n tag, head, chest, pack, shoulder, foot = SHOW[i]\n parts, extras, fold = {h[0]: h[1:] for h in headkit.GEN5}[head]\n n = n or f\"f{tag.lower()}\"\n frame = assemble(parts, dict(chestkit.CHESTS4)[chest], dict(bodykit.FEET3)[foot], n, extras, fold)\n refit_back(frame, dict(backkit.PACKS)[pack], dict(backkit.SHOULDERS)[shoulder], n)\n frame[\"frame\"] = f\"striker_{tag.lower()}\"\n return frame\n\n\ndef game_frame(i):\n \"\"\"A SHOW mix built alone as a game model (striker_a, striker_b): every node keeps its exact name.\"\"\"\n frame = show_frame(i)\n # a pack's binder bells are named like the binder joints and come out binder.L.001: name them as\n # the striker does, so a game model has no suffixed node\n for o in frame.children_recursive:\n if o.type == \"MESH\" and base(o.name) != o.name:\n stem, side = base(o.name).rsplit(\".\", 1)\n o.name = f\"{stem}_nozzle.{side}\"\n assert not [o.name for o in frame.children_recursive if base(o.name) != o.name]\n return frame\n\n\ndef build_show(formation=False):\n \"\"\"Round 15: the round 13 and 14 parts mixed into seven frames. In a row 13 m apart, or in a V\n behind frame A with the outer frames turned in a little.\"\"\"\n heads = {h[0]: h[1:] for h in headkit.GEN5}\n chests, packs, shoulders, feet = (dict(x) for x in (chestkit.CHESTS4, backkit.PACKS, backkit.SHOULDERS, bodykit.FEET3))\n root = empty(\"lab\", (0, 0, 0))\n for i, (tag, head, chest, pack, shoulder, foot) in enumerate(SHOW):\n parts, extras, fold = heads[head]\n frame = assemble(parts, chests[chest], feet[foot], f\"s{i}\", extras, fold)\n refit_back(frame, packs[pack], shoulders[shoulder], f\"s{i}\")\n side, rank = (1 if i % 2 else -1), (i + 1) // 2\n at = (9.0 * side * rank, 6.0 * rank, 0) if formation else (i * 13.0, 0, 0)\n slot = empty(f\"slot{i}\", at, root, label=f\"{tag}: {head}, {chest}, {pack}, {shoulder}, {foot}\")\n attach(frame, slot)\n frame.matrix_parent_inverse = Matrix.Identity(4)\n frame.location = (0, 0, 0)\n if formation:\n slot.rotation_euler.z = -.17 * side * min(rank, 1)\n bpy.context.view_layer.update()\n return root\n\"\"\"Pilot lab: the 1.75 m pilot standing, and seated on a bike-style seat with its grips and foot pegs\n(the light cockpit's posture), on a plinth so the seated pose reads at a glance.\"\"\"\n\nfrom lib import cylinder, empty, loft, merge, octo, solid, subd\nfrom figure import pilot, points\n\n\ndef bike_rig(pts, parent, n):\n \"\"\"Seat, grips and pegs placed from a posed pilot's points.\"\"\"\n s = pts[\"seat\"]\n seat = subd(loft([(s.z - .1, octo(.2, .4, .08, x=s.x, y=s.y + .04)), (s.z - .03, octo(.22, .42, .09, x=s.x, y=s.y + .04)),\n (s.z - .005, octo(.18, .36, .08, x=s.x, y=s.y + .05))]), 2, sharp=50)\n solid(f\"{n}_seat\", seat, \"frame\", parent, smooth=True)\n post = loft([(s.z - .62, octo(.08, .08, .02, x=s.x, y=s.y + .08)), (s.z - .1, octo(.07, .07, .02, x=s.x, y=s.y + .06))])\n solid(f\"{n}_post\", post, \"joint\", parent, .006)\n bars = []\n for k in (\"L\", \"R\"):\n g = pts[f\"grip.{k}\"]\n bars.append(cylinder(.017, g.x - .06, g.x + .06, 10, axis=\"x\", at=(g.y, g.z)))\n bars.append(loft([(g.z - .5, octo(.04, .04, .01, x=g.x * .9, y=g.y + .02)), (g.z - .02, octo(.035, .035, .01, x=g.x * .9, y=g.y + .02))]))\n p = pts[f\"peg.{k}\"]\n bars.append(cylinder(.016, p.x - .06, p.x + .06, 8, axis=\"x\", at=(p.y + .02, p.z - .02)))\n solid(f\"{n}_grips\", merge(*bars), \"metal\", parent, .004)\n\n\ndef build_pilot_lab():\n root = empty(\"lab\", (0, 0, 0))\n a = empty(\"slot0\", (-.55, 0, 0), root, label=\"standing\")\n pilot(a, at=(-.55, 0.0))\n b = empty(\"slot1\", (.55, 0, 0), root, label=\"seated, bike\")\n # lift the seated pilot so its foot pegs stand on a plinth 0.1 m high\n lowest = min(v.z for v in (points(\"bike\")[\"peg.L\"], points(\"bike\")[\"peg.R\"]))\n pts = pilot(b, at=(.55, 0.0), pose=\"bike\", z=.12 - lowest)\n bike_rig(pts, b, \"bike\")\n solid(\"plinth\", loft([(0, octo(.7, .9, .05, x=.55, y=.0)), (.1, octo(.7, .9, .05, x=.55, y=.0))]), \"deck\", b, .01)\n return root\n"}} {"status":"fulfilled","value":{"chunk_id":"d542fd","wall_time_seconds":0.00000403,"exit_code":0,"original_token_count":5065,"output":"import * as THREE from 'three';\nimport { find, nodes } from './assets';\nimport { Exhaust, KINDS, type NozzleKind, type ThrustReading } from './exhaust';\nimport { PALETTES, type PaletteName } from './palette';\nimport { PLUME_HULL, plumeMaterial, plumeVisible, setPlume } from './plume';\n\n/** Joint rotations in degrees, glTF axes: X pitches a limb (negative swings it forward), Z swings it\n * sideways (positive moves a left limb outward), Y twists. */\nexport type Pose = Partial<Record<Joint, [number, number, number]>>;\n\nexport const JOINTS = [\n 'pelvis', 'waist', 'torso', 'neck', 'head', 'backpack',\n 'shoulder.L', 'upperarm.L', 'forearm.L', 'hand.L', 'shoulder.R', 'upperarm.R', 'forearm.R', 'hand.R',\n 'thigh.L', 'shin.L', 'foot.L', 'thigh.R', 'shin.R', 'foot.R', 'binder.L', 'binder.R',\n] as const;\nexport type Joint = (typeof JOINTS)[number];\n\nexport const POSES = {\n stand: {\n 'upperarm.L': [0, 0, 6], 'upperarm.R': [0, 0, -6], 'forearm.L': [-12, 0, 0], 'forearm.R': [-12, 0, 0],\n },\n /** Standing on the catapult: knees bent, leaning into the launch. */\n launch: {\n pelvis: [8, 0, 0], torso: [10, 0, 0], head: [-14, 0, 0],\n 'thigh.L': [-38, 0, 2], 'thigh.R': [-38, 0, -2], 'shin.L': [58, 0, 0], 'shin.R': [58, 0, 0],\n 'foot.L': [-20, 0, 0], 'foot.R': [-20, 0, 0],\n 'upperarm.L': [-18, 0, 14], 'forearm.L': [-40, 0, 0], 'upperarm.R': [-30, 0, -8], 'forearm.R': [-50, 0, 0],\n 'binder.L': [18, 0, 0], 'binder.R': [18, 0, 0],\n },\n /** The launch crouch for a heavy: 24 m in a 26 m tube, so knees deep, head down and binders folded,\n * which brings it under the tube's signal box. */\n launch_heavy: {\n pelvis: [12, 0, 0], torso: [12, 0, 0], head: [-20, 0, 0],\n 'thigh.L': [-58, 0, 3], 'thigh.R': [-58, 0, -3], 'shin.L': [106, 0, 0], 'shin.R': [106, 0, 0],\n 'foot.L': [-48, 0, 0], 'foot.R': [-48, 0, 0],\n 'upperarm.L': [-18, 0, 14], 'forearm.L': [-40, 0, 0], 'upperarm.R': [-30, 0, -8], 'forearm.R': [-50, 0, 0],\n 'binder.L': [40, 0, 0], 'binder.R': [40, 0, 0],\n },\n /** Free flight, rifle up. */\n flight: {\n pelvis: [6, 0, 0], torso: [-4, 0, 0], head: [-2, 0, 0],\n 'thigh.L': [-22, 0, 4], 'thigh.R': [6, 0, -3], 'shin.L': [42, 0, 0], 'shin.R': [30, 0, 0],\n 'foot.L': [8, 0, 0], 'foot.R': [18, 0, 0],\n 'upperarm.L': [-22, 0, 16], 'forearm.L': [-46, 0, 0],\n 'upperarm.R': [-62, -8, -6], 'forearm.R': [-26, 0, 0], 'hand.R': [0, 0, 0],\n 'binder.L': [-6, 0, 0], 'binder.R': [-6, 0, 0],\n },\n} satisfies Record<string, Pose>;\nexport type PoseName = keyof typeof POSES;\n\n/** The catapult pose for a size class: the striker's, with a deeper crouch for heavies. */\nexport cons…1504 tokens truncated…umes[n.kind];\n const k = (Math.min(1, p.level) * (1 + 0.5 * p.heavy) + 0.4 * p.flash) * (n.radius * s) ** 2;\n if (k <= 0 || !n.plume.visible) continue;\n // a little way downstream, where the plume is brightest\n n.plume.localToWorld(_at.set(0, 0, 2.5));\n _sum.addScaledVector(_at, k);\n w += k;\n }\n light.visible = true;\n light.color.copy(this.exhaustColor).lerp(_white, 0.4);\n light.intensity = w > 0 ? w * 35 * strength : 0;\n if (w > 0) light.position.copy(_sum).divideScalar(w);\n }\n}\nimport * as THREE from 'three';\nimport { signal, LAUNCH, type LaunchState } from '../sim/launch';\nimport type { FrameClassId } from '../sim/frames';\nimport { find, model, nodes } from './assets';\n\nconst CLASSES: FrameClassId[] = ['light', 'standard', 'heavy'];\n/** Node name suffix per class in kit/ship.py. */\nconst TAG: Record<FrameClassId, string> = { light: 'light', standard: 'std', heavy: 'heavy' };\n\n/** Where frames of each class stand in a bay, and its work platform heights (ship space). */\nexport interface BaySlots {\n light: THREE.Vector3[];\n standard: THREE.Vector3[];\n heavy: THREE.Vector3[];\n platforms: Record<FrameClassId, number[]>;\n}\n\n/**\n * Show one gantry fit per bay and the shuttle clamps for the frame riding it (kit/ship.py). Light\n * frames ride a sled on top of the striker clamps, heavies swap them for their own set.\n */\nexport function fitShip(root: THREE.Object3D, bays: readonly FrameClassId[], frame: FrameClassId) {\n const map = nodes(root);\n for (const [i, fit] of bays.entries()) {\n for (const c of CLASSES) {\n const g = find(map, `gantry.${i + 1}.${TAG[c]}`);\n if (g) g.visible = c === fit;\n }\n }\n for (const c of CLASSES) {\n const g = find(map, `clamps.${TAG[c]}`);\n if (g) g.visible = c === frame || (c === 'standard' && frame === 'light');\n }\n}\n\n/** The ship model with its moving parts driven by the launch state. */\nexport class ShipRig {\n readonly root: THREE.Object3D;\n private doors: { node: THREE.Object3D; slide: THREE.Vector3; base: THREE.Vector3 }[] = [];\n private shuttle: THREE.Object3D | null;\n private shuttleBase = new THREE.Vector3();\n private lamps: Record<'red' | 'green', THREE.Object3D | undefined>;\n readonly start = new THREE.Vector3();\n readonly bays: THREE.Vector3[] = [];\n /** Standing points per bay and class. */\n readonly slots: BaySlots[] = [];\n private starts: Partial<Record<FrameClassId, THREE.Vector3>> = {};\n /** The hangar and tube lights. */\n readonly lights: THREE.PointLight[] = [];\n\n private constructor(root: THREE.Object3D) {\n this.root = root;\n const map = nodes(root);\n root.updateMatrixWorld(true);\n for (const s of ['L', 'R']) {\n const n = find(map, `door.${s}`);\n if (n) this.doors.push({ node: n, slide: new THREE.Vector3(...(n.userData.slide as [number, number, number])), base: n.position.clone() });\n }\n this.shuttle = find(map, 'shuttle') ?? null;\n if (this.shuttle) this.shuttleBase.copy(this.shuttle.position);\n this.lamps = { red: find(map, 'signal.red'), green: find(map, 'signal.green') };\n find(map, 'launch.start')?.getWorldPosition(this.start);\n const at = (name: string) => find(map, name)?.getWorldPosition(new THREE.Vector3());\n for (const c of CLASSES) {\n const p = at(`launch.start.${TAG[c]}`);\n if (p) this.starts[c] = p;\n }\n for (const b of ['bay.1', 'bay.2']) {\n const n = find(map, b);\n if (!n) continue;\n this.bays.push(n.getWorldPosition(new THREE.Vector3()));\n const slot: BaySlots = { light: [], standard: [], heavy: [], platforms: { light: [], standard: [], heavy: [] } };\n for (const name of [`${b}.light.a`, `${b}.light.b`, `${b}.std`, `${b}.heavy`]) {\n const m = find(map, name);\n if (!m) continue;\n const c = m.userData.cls as FrameClassId;\n slot[c].push(m.getWorldPosition(new THREE.Vector3()));\n slot.platforms[c] = (m.userData.platforms as number[]) ?? [];\n }\n this.slots.push(slot);\n }\n fitShip(root, ['standard', 'standard'], 'standard');\n // Hangar and tube lights from the kit's markers.\n root.traverse((o) => {\n if (!/^light/.test(o.name) || !o.userData.color) return;\n const [r, g, b] = o.userData.color as number[];\n const l = new THREE.PointLight(new THREE.Color(r, g, b), 320 * (o.userData.power ?? 1), 0, 2);\n o.add(l);\n this.lights.push(l);\n });\n }\n\n /** Fit the bays (one class per bay) and the shuttle clamps for the frame riding it. */\n configure(bays: readonly FrameClassId[], frame: FrameClassId) {\n fitShip(this.root, bays, frame);\n }\n\n /** Where a frame of this class stands on the shuttle: on the light sled, on the clamps otherwise. */\n startFor(c: FrameClassId): THREE.Vector3 {\n return this.starts[c] ?? this.start;\n }\n\n static async load(): Promise<ShipRig> {\n return new ShipRig(await model('ship'));\n }\n\n update(s: LaunchState) {\n const open = THREE.MathUtils.smoothstep(s.door, 0, 1);\n for (const d of this.doors) d.node.position.copy(d.base).addScaledVector(d.slide, open * 10.5);\n if (this.shuttle) {\n // the shuttle runs with the mech, then brakes to a stop at the end of the tube\n const travel = s.phase === 'released' ? LAUNCH.length : s.shuttle;\n this.shuttle.position.copy(this.shuttleBase).add(new THREE.Vector3(0, 0, travel));\n }\n const sig = signal(s, LAUNCH);\n if (this.lamps.red) this.lamps.red.visible = sig === 'red' || sig === 'amber';\n if (this.lamps.green) this.lamps.green.visible = sig === 'green' || sig === 'amber';\n }\n}\n// Material roles are named in the kit (kit/lib.py). A palette paints every role; factions and\n// companies get their own palettes, the models stay the same.\n\nexport type Role =\n | 'main' | 'accent' | 'trim' | 'frame' | 'joint' | 'visor' | 'metal' | 'sensor'\n | 'glow_eye' | 'glow_core' | 'glow_thruster' | 'glow_beam' | 'glow_exhaust'\n | 'hull' | 'hull_dark' | 'interior' | 'deck' | 'hazard' | 'light' | 'screen' | 'glass'\n | 'lamp_red' | 'lamp_green' | 'suit' | 'glow_hot'\n // raider salvage: paint from the donor machines, primer patches, bare rust and hand paint\n | 'donor_a' | 'donor_b' | 'donor_c' | 'primer' | 'rust' | 'handpaint' | 'warpaint'\n | 'crystal' | 'crystal_lit' | 'glow_violet'\n // markings on plates: pattern codes, service text, unit codes\n | 'stencil';\n\nexport interface Paint {\n color: string;\n /** Emissive roles: brightness multiplier, values above 1 feed the bloom. */\n glow?: number;\n /** Physically based surface: roughness, metalness, clearcoat (paint sheen). */\n rough?: number;\n metal?: number;\n coat?: number;\n /** Rust blotches and streaks over the surface, 0..1 (raider salvage). */\n rust?: number;\n /** A lit surface that also gives off its own colour at this strength (lit from inside). */\n emit?: number;\n /** Painted roles: a lacquered finish, 0..1, kept under every look: roughness no higher than `rough`, less\n * weathering of the colour, and from 0.5 a clear coat this strong. */\n lacquer?: number;\n}\n\nexport type Palette = Record<Role, Paint>;\n\nconst paint = (color: string, rough = 0.42, coat = 0.35): Paint => ({ color, rough, metal: 0, coat });\nconst metal = (color: string, rough = 0.42, m = 0.85): Paint => ({ color, rough, metal: m });\n\nconst base: Palette = {\n main: paint('#d9dce1'),\n accent: paint('#27527a'),\n trim: paint('#c9452f', 0.4),\n frame: metal('#5b6069', 0.48, 0.8),\n joint: metal('#33363c', 0.55, 0.9),\n visor: { color: '#06080b', rough: 0.22, metal: 0.2, coat: 1 },\n metal: metal('#9aa0a8', 0.3, 1),\n sensor: { color: '#1d6b5c', rough: 0.2, metal: 0.3, coat: 1 },\n glow_eye: { color: '#7ef7e6', glow: 4 },\n glow_core: { color: '#7ef7e6', glow: 2.4 },\n /** The lit throat inside a thruster bell, the exhaust's colour. */\n glow_thruster: { color: '#9cc6ff', glow: 3 },\n /** Thruster plumes (render/plume.ts): the mantle colour, the core runs it to white. Glow scales\n * the whole plume. A maker or faction tints its drives here. */\n glow_exhaust: { color: '#4f8fff', glow: 1 },\n glow_beam: { color: '#ff5ccf', glow: 5 },\n hull: paint('#a9adb4', 0.55, 0.15),\n hull_dark: metal('#4a4f57', 0.6, 0.6),\n interior: metal('#5e6168', 0.7, 0.3),\n deck: metal('#3f434a', 0.7, 0.6),\n hazard: paint('#e3b62b', 0.6, 0),\n light: { color: '#fff3df', glow: 1.7 },\n screen: { color: '#4fd8cc', glow: 1.6 },\n glass: { color: '#8f9fc4', rough: 0.22, metal: 0.1, coat: 1 },\n lamp_red: { color: '#ff3a2e', glow: 4 },\n lamp_green: { color: '#48ff6c', glow: 4 },\n suit: paint('#1f2a4f', 0.6, 0),\n /** The white-hot core inside an eye or sensor lamp. */\n glow_hot: { color: '#eafffb', glow: 2.6 },\n /** Donor paint on salvaged parts: in a clean palette, the merc's own colours and an olive. */\n donor_a: paint('#d9dce1'),\n donor_b: paint('#27527a'),\n donor_c: paint('#5c6143'),\n primer: paint('#8a8d84', 0.7, 0),\n rust: metal('#6a3a20', 0.85, 0.35),\n handpaint: paint('#ece4cc', 0.7, 0),\n warpaint: paint('#c9452f', 0.6, 0),\n /** The aliens' one material: unpainted silver, no seams. */\n crystal: metal('#c6c9d0', 0.44, 0.95),\n /** Alien crystal lit from inside by the core, the lining of an opened geode. */\n crystal_lit: { color: '#a796dc', rough: 0.4, metal: 0.9, emit: 0.42 },\n /** The alien core light. */\n glow_violet: { color: '#7b3dff', glow: 2.6 },\n /** Stencilled markings: dark ink on light plates, light ink on dark ones. */\n stencil: { color: '#23272d', rough: 0.7, metal: 0 },\n};\n\nconst worn = (color: string, rust: number, rough = 0.6): Paint => ({ color, rough, metal: 0, coat: 0, rust });\n\nexport const PALETTES = {\n /** The player's default frame paint. */\n merc: base,\n /** The Administration: gate white plates, petrol blue accent blocks (the chest, the boots, the cheeks),\n * gate cyan lights and trim. A light livery, so the frame goes darker to keep the value step. */\n admin: {\n ...base,\n main: paint('#e4e8eb'),\n accent: paint('#1b5c5a', 0.45),\n trim: paint('#3fa7c9', 0.35),\n frame: metal('#3a3e45', 0.5, 0.8),\n joint: metal('#24262b', 0.55, 0.9),\n glow_eye: { color: '#5fd0f0', glow: 4 },\n glow_core: { color: '#5fd0f0', glow: 2.4 },\n glow_hot: { color: '#e6fbff', glow: 2.6 },\n glow_thruster: { color: '#9ee6ff', glow: 3 },\n glow_exhaust: { color: '#3fc4ff', glow: 1 },\n },\n /** The houses: lacquered wine plates, ivory accent fields (the crest, the breastplate, the back panel, the\n * tabard and the shield pale), warm gold trim on the hems and the crest's edge, emerald lenses and pale gold\n * drives. The wine is lifted a step and lacquered so its curves carry highlights, the frame is a darker, less\n * metallic steel so the plates keep a value step above it in shade too (docs/study-atelier.md). */\n houses: {\n ...base,\n main: { ...paint('#781c33', 0.36, 0.5), lacquer: 0.45 },\n accent: { ...paint('#ece3cc', 0.38, 0.4), lacquer: 0.4 },\n trim: metal('#e6b84a', 0.3, 0.75),\n frame: metal('#4c5058', 0.55, 0.4),\n joint: metal('#3a3c42', 0.55, 0.9),\n metal: metal('#b5ab98', 0.3, 1),\n stencil: { color: '#e6dcc4', rough: 0.7, metal: 0 },\n glow_eye: { color: '#4dffa6', glow: 4 },\n // the reactor glow through the chest sides stays low, the lenses carry the green\n glow_core: { color: '#2fb877', glow: 0.7 },\n glow_hot: { color: '#eafff2', glow: 2.6 },\n glow_thruster: { color: '#ffe3a8', glow: 3 },\n glow_exhaust: { color: '#ffcf6a', glow: 1 },\n },\n /** Automated pilotless frames: black and gunmetal shell, red only in lenses, seam lines and stencils. The\n * gunmetal is light enough to read as a block against the black at range. */\n automaton: {\n ...base,\n main: paint('#1d1e23', 0.38),\n accent: paint('#5e646c', 0.34),\n"}} {"status":"fulfilled","value":{"chunk_id":"9aaf94","wall_time_seconds":0.00912274,"exit_code":0,"original_token_count":1931,"output":"# Housekeeping\n\nState of the repo on 2026-11-08, for the one-mech restart. A snapshot, not a rule. Nothing was deleted.\nHow to work is in [handbook.md](handbook.md).\n\n## Docs\n\n| File | Status | Notes |\n|---|---|---|\n| [handbook.md](handbook.md) | Current | Start here |\n| [lore.md](lore.md) | Current | Agreed with the owner, names and \"Open\" still open |\n| [manufacturers.md](manufacturers.md) | Current | Roster agreed, stat leanings guessed |\n| [wiki.html](wiki.html) | Behind | Last changed 10-25. Lacks the atelier's house lines from 10-28. Published page, republish after syncing |\n| [thrusters.md](thrusters.md) | Current | The owner is happy with the result |\n| [sizes.md](sizes.md) | Current | Describes the shipped classes. 6 m and 24 m never confirmed by the owner |\n| [light-frames.md](light-frames.md) | Reference | Knightmare measurements, used by the light class |\n| [heads.md](heads.md) | Reference | The section on what the owner settled is earned, the principles are mine |\n| [factions.md](factions.md) | Reference | Applied to the shipped automatons, raiders and aliens |\n| [critique-factions.md](critique-factions.md) | Stale | Critique of a 10-25 round, kept as history |\n| [proposals/contracts.md](proposals/contracts.md) | Stale | Proposal, partly built since. The code and README are the truth |\n| [study-phantom-brigade.md](study-phantom-brigade.md) | Reference | Study notes. Its takeaways are proposals and the parts system is still open |\n| [visual-language.md](visual-language.md) | Parked | Mostly guessed rules, doesn't bind the restart |\n| [study-proportions.md](study-proportions.md) | Parked | Measurements usable, the targets are guessed |\n| [study-atelier.md](study-atelier.md) | Parked | Same: findings useful, rules guessed |\n\n## Tools\n\n| File | Status | Notes |\n|---|---|---|\n| `tools/outlines.mjs`, `outlines-lib.mjs` | New | Outline sheets. `tools/fixtures/outlines-test.json` is a test, not a design |\n| `tools/clip.mjs`, `src/view/clip.ts`, `clip-plan.ts` | New | Review clips of any rigged model |\n| `kit/block.py`, `kit/blocks/` | New | Block models. `dummy.py` is a test fixture, not a design |\n| `tools/show.sh`, `tools/log.sh` | New | Open a file for the owner, timestamp a step |\n| `tools/shoot.mjs` | Current | Stills, needs a dev server on 5199 |\n| `tools/c1-render.sh`, `tools/c1/remote.sh` | Current | Stills on C1, syncs the working tree there |\n| `tools/thruster-sheets.sh` | Current | Thruster bench sheets, needs a dev server |\n| `tools/artifact.mjs`, `tools/squeeze.mjs` | Unchecked | The playable page build. Last used in October, not run today |\n| `tools/turntable.py` | Looks dead | Nothing calls it. Kept |\n| `src/view/sheet.ts` (`?sheet=`) | Looks dead | Line art design sheets, last touched in the first days. Not run today. Kept |\n\nReel scripts used for the thruster videos lived in a session scratchpad and are gone. `tools/clip.mjs` replaces them.\n\n## Models\n\n- **In the game:** `striker`, `striker_a`, `striker_b`, `light*`, `heavy*`, `auto_*`, `alien_*`, `raider_*`, props, ship, station.\n- **Parked, not in the game:** `pattern_m` and everything from `kit/frame_std.py`, `kit/makers/`, `kit/lab/atelier_*`, `board_*`, `knightkit.py`.\n- **Review history:** 32 `lab_*.glb` files, none loaded by the game. The kit modules behind the head, chest\n and foot labs also feed `striker_a` and `striker_b` through `kit/lab/assembly.py`, so they aren't dead.\n- **Scratch:** `public/assets/block_*.glb`, gitignored.\n\n## Where big files sit\n\n| Where | Size | In git | Notes |\n|---|---|---|---|\n| `public/assets/` | 170 MB | Yes | 141 MB of it is `lab_*.glb`, review only. Rebuildable, so could leave git one day, the owner's call |\n| `.git/` | 76 MB | | Old model versions |\n| `review/out/` | 532 MB | No | Local reference and render history. **Holds third-party art, never publish.** Biggest: `pb` 141 MB, `refs` 104 MB |\n| `.claude/worktrees/` | 1.7 GB | No | Four finished agent worktrees, three locked |\n| `~/Projects/sortie-wt/atelier-board` | 196 MB | No | Finished worker's worktree |\n| `Downloads\\citadel-shots\\` | about 440 MB for sortie | No | `pattern-r*`, `atelier-r*`, `thrusters`, `proportions`, `pb-study`. `sheet_refs*` holds third-party art |\n| C1 `~/ci/sortie/` | Not measured | No | A source tree per checkout, plus render runs |\n\n## Branches\n\nAll local branches are merged into main, and so are the remote ones. Safe to remove when wanted, nothing\ndone: `atelier-board`, `harken-fixes-2`, `pattern-proportions`, the four `worktree-agent-*`, and on origin\n`pattern-proportions`, `thruster-plumes`, `worktree-agent-af68eccd1ec3c364c`. Remove the worktrees first, the\nlocked ones need `git worktree unlock`.\n\n## Open led todos, suggestions only\n\n| Todo | Suggestion | Why |\n|---|---|---|\n| #1005 owner picks: standard parts r13 to 15, sizes, naming, carry limits, `.q` fallback | **Split it** | Standard part picks are dead, those parts belong to the old striker work. Sizes, naming and carry limits still matter, but after the restart. `.q` is a separate technical check |\n| #981 pilot in a 00 style suit, from the lowmarch pipeline | Keep, someday | Unrelated to the restart. A code-built pilot (`kit/figure.py`) stands in, and clips use it for scale |\n| #982 ship and hangar look pass, flat explosions | Keep, someday | Unrelated to the restart. Not re-checked today |\n| #1369 project trackers | Not this session's | Belongs to personal/trackers |\n\nWorth adding, the owner's or lead's call: one todo for the one-mech restart, tied to this session.\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n // relative paths so the build runs from any folder (an artifact page, a static host)\n base: './',\n server: { port: 5199 },\n test: { environment: 'node', include: ['src/**/*.test.ts', 'tools/**/*.test.mjs'] },\n} as never);\n-rw------- 1 runner runner 2.3M Nov 15 03:12 public/assets/lab_pilot.glb\n-rw------- 1 runner runner 1.3M Nov 15 03:12 public/assets/ship.glb\n-rw------- 1 runner runner 985K Nov 15 03:12 public/assets/striker.glb\n-rw------- 1 runner runner 1.3M Nov 15 03:12 public/assets/striker_a.glb\n-rw------- 1 runner runner 1.2M Nov 15 03:12 public/assets/striker_b.glb\nBlender 5.2.3 LTS (hash e13b728c6880 built 2026-10-22 01:35:05)\nBlender 5.2.3 LTS\n\tbuild date: 2026-10-22\n\tbuild time: 01:35:05\n\tbuild commit date: 2026-10-21\n\tbuild commit time: 09:21\n\tbuild hash: e13b728c6880\n\tbuild branch: blender-v5.2-release\n\tbuild platform: Linux\n\tbuild type: Release\n\tbuild c flags: -Wall -Werror=implicit-function-declaration -Wstrict-prototypes -Werror=return-type -Werror=vla -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wno-stringop-overread -Wno-stringop-overflow -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wimplicit-fallthrough=5 -Wno-error=unused-but-set-variable -march=x86-64-v2 -std=gnu11 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off \n\tbuild c++ flags: -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=x86-64-v2 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off \n\tbuild link flags: \n\tbuild system: CMake\n/usr/bin/ffmpeg\n"}}