4310207738
- README, .gitignore, CLAUDE.md (project conventions) - docs/PHASE0.md — full Phase 0 manifest (locked substrate) - 10 root .lua modules + 4 ffi/ bindings, all stubs raising NotImplemented with module-scoped responsibilities matching the manifest - config.lua wired to current dirac/hossenfelder endpoints (qwen-coder-7b snappy/32k + cloud via OpenRouter through hossenfelder) File names match docs/PHASE0.md §4 exactly. Module bodies fill in across later phases; the tree shape is locked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
33 lines
996 B
Lua
33 lines
996 B
Lua
-- main.lua — entry point
|
|
-- Phase 0: arg parsing, config load, REPL start.
|
|
-- See docs/PHASE0.md §4, §10.
|
|
|
|
local function load_config()
|
|
-- Resolution order per PHASE0.md §10:
|
|
-- 1. --config <path> 2. $AISH_CONFIG
|
|
-- 3. ~/.config/aish/config.lua 4. ./config.lua
|
|
-- Phase 0 stub: pick the first existing path; no CLI parsing yet.
|
|
local home = os.getenv("HOME") or ""
|
|
local candidates = {
|
|
os.getenv("AISH_CONFIG"),
|
|
home .. "/.config/aish/config.lua",
|
|
"./config.lua",
|
|
}
|
|
for _, path in ipairs(candidates) do
|
|
if path then
|
|
local f = io.open(path, "r")
|
|
if f then f:close(); return dofile(path), path end
|
|
end
|
|
end
|
|
error("aish: no config.lua found in any standard location")
|
|
end
|
|
|
|
local function main()
|
|
local config, config_path = load_config()
|
|
io.stderr:write(("aish: loaded config from %s\n"):format(config_path))
|
|
local repl = require("repl")
|
|
repl.run(config)
|
|
end
|
|
|
|
main()
|