CyberM.resource

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

client runtime6 functionsMarkdown

CyberM.resource.generation([resource])

Generation number, incremented on every reload.

With no argument, returns the current resource generation. Pass a resource name to inspect that resource, or receive nil when it is missing.

Parameters

  • resourcestringoptional

Returns

  • integer, or nil

Registered in ResourceHost.cpp as LuaResourceGeneration (line 6518).

CyberM.resource.hasPermission(permission)

Whether the resource holds this permission.

Checks whether the current resource manifest grants an exact CyberM capability. It is a read-only convenience check; native APIs still enforce their own permission and must handle refusal results.

Parameters

  • permissionstringrequired

Returns

  • boolean

Registered in ResourceHost.cpp as LuaHasPermission (line 6522).

name

SHARED

CyberM.resource.name()

Name of the current resource.

Returns the current resource's immutable manifest name. This is equivalent to GetCurrentResourceName() and remains stable for the lifetime of the resource definition.

Returns

  • string

Registered in ResourceHost.cpp as LuaResourceName (line 6517).

readFile

SHARED

CyberM.resource.readFile(path)

Reads a file from the resource, within its declared allowlist.

Reads a file declared by the current resource manifest through a safe relative path. Undeclared files, traversal, oversized content and host filesystem paths are rejected.

Parameters

  • pathstringrequired

Returns

  • contents, or nil
  • reason

Registered in ResourceHost.cpp as LuaReadFile (line 6521).

state

SHARED

CyberM.resource.state([resource])

State of a resource.

Returns the lifecycle state known for a resource name, or for the current resource when omitted. It is an immediate snapshot and does not wait for dependencies or mutate lifecycle state.

Parameters

  • resourcestringoptional

Returns

  • string

Registered in ResourceHost.cpp as LuaGetResourceState (line 6520).

version

SHARED

CyberM.resource.version()

Version declared in cyberm.lua.

Returns the version string declared by the current resource manifest. It is package metadata and is unrelated to the CyberM runtime or Lua interpreter version.

Returns

  • string

Registered in ResourceHost.cpp as LuaResourceVersion (line 6519).

For agents and LLMs: this page as Markdown · llms.txt · llms-full.txt