Lux.Beams.AgenticCompany.SetupCompanyBeam (Lux v0.5.0)
View SourceA beam that sets up a new company with initial job openings.
This beam takes a configuration with company details and initial job openings, creates the company using the AgenticCompanyFactory contract, and then creates all the specified job openings.
Example Configuration
company:
name: Blockchain Solutions Inc
agent_token: "0x0000000000000000000000000000000000000000" # zero address for no token
ceo_wallet_address: "0x1234..." # optional, defaults to WALLET_ADDRESS set in the environment variable.
jobs:
- name: Senior Smart Contract Developer
- name: Blockchain Security Analyst
- name: DeFi Protocol Engineer
Example Usage
# Create a company with three job openings
{:ok, result, execution_log} = Lux.Beams.AgenticCompany.SetupCompanyBeam.run(%{
company: %{
name: "Blockchain Solutions Inc",
agent_token: "0x0000000000000000000000000000000000000000",
ceo_wallet_address: "0x1234..." # optional
},
jobs: [
%{name: "Senior Smart Contract Developer"},
%{name: "Blockchain Security Analyst"},
%{name: "DeFi Protocol Engineer"}
]
})
# The result will look like:
%{
company_address: "0x1234...", # The address of the newly created company
jobs: [
%{
name: "Senior Smart Contract Developer",
job_id: "0xabcd..." # The ID of the created job
},
%{
name: "Blockchain Security Analyst",
job_id: "0xdef0..."
},
%{
name: "DeFi Protocol Engineer",
job_id: "0x9876..."
}
]
}
# The execution_log contains detailed information about each step:
%{
beam_id: "b54a67b8-7da6-4e53-a90c-4363c721a2c3",
started_by: "system",
started_at: ~U[2024-02-12 06:30:32.034005Z],
completed_at: ~U[2024-02-12 06:30:32.034607Z],
status: :completed,
steps: [
%{
id: :create_company,
status: :completed,
output: %{company_address: "0x1234..."}
},
%{
id: :create_jobs,
status: :completed,
output: %{jobs: [...]}
},
%{
id: :format_output,
status: :completed,
output: %{company_address: "0x1234...", jobs: [...]}
}
]
}