Lux.Company (Lux v0.4.0)

View Source

Defines the core company functionality and structure. A company is the highest-level organizational unit that coordinates agent-based workflows.

Summary

Functions

Assigns an agent to a role.

Returns a specification to start this module under a supervisor.

Gets a specific objective by ID.

Gets the artifacts produced by an objective.

Gets the status of an objective.

Gets a specific role by ID.

Updates the status of an objective. This is called by the objective process, not internally.

Lists all objectives in the company.

Lists all roles in the company.

Runs a company with the given configuration. This starts all necessary processes and initializes the company state.

Runs an objective in the company.

Starts a company with the given configuration.

Updates the progress of an objective.

Types

t()

@type t() :: %Lux.Company{
  agent_hub: term(),
  ceo: map(),
  id: String.t(),
  metadata: map(),
  mission: String.t(),
  module: module(),
  name: String.t(),
  objectives: [Lux.Company.Objective.t()],
  roles: [map()],
  signal_router: term()
}

Functions

assign_agent(company, role_id, agent)

Assigns an agent to a role.

assign_agent_to_objective(company, objective_id, agent_id)

Assigns an agent to an objective.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

complete_objective(company, objective_id)

Completes an objective.

fail_objective(company, objective_id, reason \\ nil)

Marks an objective as failed.

get_objective(company, objective_id)

Gets a specific objective by ID.

get_objective_artifacts(company, objective_id)

Gets the artifacts produced by an objective.

get_objective_status(company, objective_id)

Gets the status of an objective.

get_role(company, role_id)

Gets a specific role by ID.

handle_call(msg, from, state)

Updates the status of an objective. This is called by the objective process, not internally.

list_objectives(company)

Lists all objectives in the company.

list_roles(company)

Lists all roles in the company.

run(company, opts \\ [])

Runs a company with the given configuration. This starts all necessary processes and initializes the company state.

Options

  • :router - The signal router to use for agent communication (required)
  • :hub - The agent hub to use for agent management (required)
  • :timeout - Timeout for agent initialization (default: 30_000)

run_objective(company, objective_id, input \\ %{})

Runs an objective in the company.

start_link(module, opts \\ [])

Starts a company with the given configuration.

start_objective(company, objective_id)

Starts an objective.

update_objective_progress(company, objective_id, progress)

Updates the progress of an objective.