---
title: "bundle"
description: "The bundle namespace — the engine's Luau API reference for bundle."
section: "API Reference"
slug: "api-bundle"
canonical: "https://origozero.ai/docs/api-bundle"
updated: "2026-09-05T23:13:46.248465765+00:00"
tags: ["api", "reference"]
---

# bundle

The `bundle` namespace — 2 functions.

## globals/bundle/update {#globals-bundle-update}

```lua
bundle.update(entityId: string, bundleRef: BundleRef?) -> any
```

Re-compose a bundle from an entity's current hierarchy and write
it back to the bundle's on-disk path. The VFS write triggers the
engine's generic asset hot-reload pipeline, which fires
`onAssetReload(field)` on every component subscribed to this
bundle's guid via a declared asset field — those components
reconcile per their own policy.

**Parameters**

- `entityId` `string` — The entity whose hierarchy is captured into the bundle.
- `bundleRef` `BundleRef` _(optional)_ — Optional. When omitted, the ref is inferred from the
entity's `Asset.source` field. When given, the explicit ref wins.

**Returns** `any` — True on success (forwarded from the bundle assetType's `:update`).

```lua
bundle.update(entityId)                     -- infer from Asset
bundle.update(entityId, { guid = "..." })   -- explicit ref
```

## typed/builtin//modules/bundle_update/bundle/update {#typed-builtin-modules-bundle-update-bundle-update}

```lua
bundle.update(entityId: string, bundleRef: BundleRef?) -> any
```

Re-compose a bundle from an entity's current hierarchy and write
it back to the bundle's on-disk path. The VFS write triggers the
engine's generic asset hot-reload pipeline, which fires
`onAssetReload(field)` on every component subscribed to this
bundle's guid via a declared asset field — those components
reconcile per their own policy.

**Parameters**

- `entityId` `string` — The entity whose hierarchy is captured into the bundle.
- `bundleRef` `BundleRef` _(optional)_ — Optional. When omitted, the ref is inferred from the
entity's `Asset.source` field. When given, the explicit ref wins.

**Returns** `any` — True on success (forwarded from the bundle assetType's `:update`).

```lua
bundle.update(entityId)                     -- infer from Asset
bundle.update(entityId, { guid = "..." })   -- explicit ref
```
