Brokkr/surfaces/unity
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 68319ddaf8 A1: BrokkrEditorService is the one command owner; the sink is off by default
Deleted: the window's command drain (OnEditorUpdate poll, Poll Mirror Command,
PublishCommandAndPoll executing), the window's own second mirror, and the
machine-global AutoPollCommands setting. The mirror lost its Watch-fed queue
and its in-memory dedup sets; BrokkrCommandLedger derives "pending" from the
cache on every call.

BrokkrEditorService ([InitializeOnLoad], one EditorApplication.update
registration, no asset-import or reload-script hooks) owns the mirror, the
one-second pull and the drain. AgentCommandsEnabled is per project and false
until the operator ticks the window toggle; loading the package opens no
store. The flag is published in the host snapshot. The mirror uses the
directory store with StartServer=false, so there is no listener.

The store path preference is now keyed by project too: it was one value for
every project on the machine, so enabling the sink in one project could have
opened another project's .brokkr.

Not compiled: Unity code is checked by the operator (see the A1 smoke steps).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 14:20:36 +02:00
..
Packages/com.gamecult.brokkr A1: BrokkrEditorService is the one command owner; the sink is off by default 2026-09-29 14:20:36 +02:00
README.md Drop the vendored CultMesh DLLs; depend on org.gamecult.cultlib 2026-09-29 13:50:23 +02:00

Brokkr Unity Adapter

This package lets the Unity Editor publish its scene, component, asset, command, receipt, Quest, and Eve/CultUI state as typed CultCache documents synced through CultMesh.

Install By Local Path

Add this package to a Unity project's Packages/manifest.json:

"com.gamecult.brokkr": "file:F:/Projects/Brokkr/surfaces/unity/Packages/com.gamecult.brokkr"

The package ships no assemblies. Its CultCache, CultNet and CultMesh runtime comes from org.gamecult.cultlib, which the host manifest must also resolve:

"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.60"

Then open GameCult > Brokkr.

Local Smoke

In Unity:

  1. Open GameCult > Brokkr.
  2. Confirm Broker URI is cultmesh://brokkr.
  3. Confirm CultMesh Cache points at .brokkr/unity-editor.ccmp.
  4. Click Start CultMesh Mirror.
  5. Click Capture Snapshot.
  6. Click Publish Mirror.
  7. To create a ScriptableObject through the mirror, fill ScriptableObject Type, Asset Name, and Asset Path, then click Create ScriptableObject Asset.
  8. To instantiate or variant a prefab through the mirror, fill Prefab Asset Path, optional Instance Name, and optional Variant Path, then click the matching prefab command.
  9. To publish object sync policy, select a GameObject, set the object lane toggles including transform, parent, active state, material, and property lanes, then click Publish Object Sync.
  10. With the mirror running, run brokkr-daemon sync-once or sync-loop, then click Poll Sync Receipt or leave the window open to show the latest daemon sync pass receipt.
  11. To publish an ad hoc sync variable, fill Ad Hoc Sync Var with a binding id or leave it blank for a generated id, set kind/paths/authority/interpolation, then click Publish Sync Var.

The Unity adapter writes the latest editor snapshot to:

unity/host/current

Brokkr daemon sync receipts are read from:

sync/receipts/{receiptId}

Ad hoc sync variables are written to:

sync/vars/{syncVarId}

Verse-side command clients write brokkr.unity.command_intent.v0 documents to:

unity/commands/{commandId}

Unity watches those command intents, mutates the editor, and publishes receipts to:

unity/receipts/{commandId}

Recognized Unity asset commands include:

  • instantiatePrefab
  • createPrefabVariant
  • createScriptableObject

The Unity plugin is still an adapter. Unity owns Unity editor truth; Brokkr owns provider discovery; CultCache and CultMesh own the live mirror lane.