update: studio,packages,lua (2 files)

This commit is contained in:
2025-12-26 00:50:15 +00:00
parent a32ce53112
commit 0a82b71936
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
local M = {}
function M.can_generate(user)
local role = user.role or "public"
local allowed = {
user = true,
admin = true,
god = true,
supergod = true
}
return allowed[role] == true
end
return M

View File

@@ -0,0 +1,21 @@
local M = {}
function M.prepare_zip(blueprint)
local entries = {}
local files = blueprint.files or {}
for _, file in ipairs(files) do
local content = file.content or ""
table.insert(entries, {
path = file.path,
size = string.len(content)
})
end
return {
name = blueprint.name or "project",
entries = entries
}
end
return M