# CyberM.npcs — client runtime

Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.

5 functions.

## all

```lua
CyberM.npcs.all()
```

`GAME` — Requires a live game instance.

Lists server-owned NPCs currently known by this client.

Canonical creation, tasks, health and removal are server-only; see wiki/npcs.md.

Returns: `array of NPC snapshots`

Registered in `ResourceHost.cpp` (line 6716) as `LuaNpcsAll`.

## currentTask

```lua
CyberM.npcs.currentTask(id)
```

`GAME` — Requires a live game instance.

Returns the canonical active task ID for an NPC.

Returns the last CyberM NPC task snapshot currently presented for a network NPC. It requires `npcs.read`; task state is ephemeral and can disappear when the NPC leaves the streaming set.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `id` | `integer` | required | — |

Returns: `task id, or nil`

Registered in `ResourceHost.cpp` (line 6719) as `LuaNpcCurrentTask`.

## entity

```lua
CyberM.npcs.entity(id)
```

`GAME` — Requires a live game instance.

Returns the ephemeral local CyberM entity handle for an NPC projection.

Returns nil before readiness and after stream-out. Never cache this handle across lifecycle changes.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `id` | `integer` | required | — |

Returns: `entity, or nil`

Registered in `ResourceHost.cpp` (line 6718) as `LuaNpcEntity`.

## get

```lua
CyberM.npcs.get(id)
```

`GAME` — Requires a live game instance.

Reads one server-owned NPC currently known by this client.

Read-only and guarded by npcs.read. The local entity handle is generation-checked and becomes invalid after stream-out.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `id` | `integer` | required | — |

Returns: `NPC snapshot, or nil`

Registered in `ResourceHost.cpp` (line 6715) as `LuaNpcGet`.

## isStreamedIn

```lua
CyberM.npcs.isStreamedIn(id)
```

`GAME` — Requires a live game instance.

Whether an NPC projection is attached and ready locally.

Reports whether a network NPC currently has a live client proxy in this player's streaming scope. It does not request streaming or prove that the server NPC record no longer exists.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `id` | `integer` | required | — |

Returns: `boolean`

Registered in `ResourceHost.cpp` (line 6717) as `LuaNpcIsStreamedIn`.

