{"id":"nazumahk/weave","name":"weave","scope":"nazumahk","platform":"roblox","description":"Weave For Roblox","version":"1.3.0","latest":"1.3.0","versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.3.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"nazumahk/byteflow":{"version":"^2.0.0","alias":"ByteFlow"},"nazumahk/signal":{"version":"^1.0.0","alias":"Signal"},"nazumahk/vow":{"version":"^1.0.0","alias":"Vow"}},"integrity":"c22115bf0a69ff083ba3b52c21f1b423d21bfb8e81ff3764a395c447491768f5","likes":0,"downloads":0,"install":"forest install nazumahk/weave","url":"https://forest.dev/p/roblox/nazumahk/weave","files":"https://api.forest.dev/ai/package/roblox/nazumahk/weave/files","readme":"# Weave\n\nA high-performance, strictly-typed game framework for Roblox featuring **Contract-based** binary networking via **ByteFlow 2.1**.\n\n## Features\n\n- **Contract-Based Networking**: Define your communication interface in a shared module. Weave handles the serialization, routing, and type-safety based on this contract.\n- **Auto Bit-Packing**: Powered by ByteFlow 2.1. Consecutive `bool` fields within a struct are automatically packed into single bytes, reducing bandwidth consumption by up to 800% for state flags.\n- **Lazy Service Proxies**: `GetService` returns a transparent proxy that dynamically binds to its service upon registration. This eliminates \"Service not found\" errors during the client boot sequence.\n- **Transactional Writes**: Packets are written atomically. If a write fails, the buffer cursor is rolled back to prevent corruption of the global packet stream.\n- **Unified Lifecycle Hooks**: Services and Controllers can implement `OnHeartbeat`, `OnStepped`, and `OnRenderStepped` directly, reducing manual `RunService` connection boilerplate.\n- **Deterministic ID Generation**: Alphabetical sorting and FNV-1a hashing of contract members ensure perfect parity between server and client without manual IDs.\n\n## Installation\n\nAdd to your `wally.toml`:\n\n```toml\n[dependencies]\nWeave = \"nazumahk/weave@1.3.0\"\n```\n\n## Quick Start\n\n### 1. The Contract (`Shared/EnemyContract.luau`)\n\n```luau\nlocal Weave = require(Packages.Weave)\nlocal t = Weave.t\n\nreturn function()\n    return {\n        -- Automatically packed into 1 byte\n        UpdateState = Weave.Signal(t.struct({\n            isStunned = t.bool,\n            isBurning = t.bool,\n            isFrozen = t.bool,\n            isSlowed = t.bool,\n        })),\n        GetEnemyCount = Weave.Method({ request = t.none, response = t.uint16 })\n    }\nend\n```\n\n### 2. Server Implementation\n\n```luau\nlocal EnemyContract = require(Shared.EnemyContract)\nlocal EnemyService = Weave.CreateService({\n    Name = \"EnemyService\",\n    Client = EnemyContract()\n})\n\nfunction EnemyService:OnHeartbeat(dt)\n    -- Automated heartbeat logic\nend\n\nfunction EnemyService.Client.GetEnemyCount:onInvoke(function()\n    return #allEnemies\nend)\n```\n\n### 3. Client Consumption\n\n```luau\nlocal EnemyController = Weave.CreateController({ Name = \"EnemyController\" })\n\nfunction EnemyController:WeaveStart()\n    -- Lazy proxy: resolvable even if the service module is required later\n    local EnemyService = Weave.GetService(\"EnemyService\")\n    \n    -- Methods can be called directly as functions\n    local count = EnemyService.GetEnemyCount()\n    \n    EnemyService.UpdateState:Connect(function(state)\n        print(\"Updated state:\", state)\n    end)\nend\n```\n\n## Documentation\n\n- [Why Use Weave?](docs/WhyUseWeave.md) -- Benefits and Comparison\n- [Technical Architecture](docs/Architecture.md) -- Internal Design & Bit-Packing\n- [API Reference](docs/API.md) -- Full Method Specification\n\n## License\n\nMIT","readmeTruncated":false}