Some checks failed
CI / build-and-test (push) Failing after -32m5s
- Implemented TraitsTab.svelte to handle CRUD operations for agent traits. - Integrated grid for displaying traits with context menu actions for add, edit, and delete. - Added trait instruction editing functionality with a dedicated editor. - Updated AdminShell to include PersonasPage for navigation. - Enhanced AppSidebar with a new entry for Personas. - Extended ShellPage type to include 'personas'. - Defined new types for AgentPersona, AgentPart, and AgentTrait in types.ts.
42 lines
1.5 KiB
Bash
42 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
models_dir="${repo_root}/internal/generatedmodels"
|
|
projects_model="${models_dir}/sql_public_projects.go"
|
|
persona_arc_model="${models_dir}/sql_public_persona_arc.go"
|
|
|
|
if [[ ! -f "${projects_model}" ]]; then
|
|
echo "generated projects model not found: ${projects_model}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "${persona_arc_model}" ]]; then
|
|
echo "generated persona arc model not found: ${persona_arc_model}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Ensure ModelPublicProjects can scan ResolveSpec computed column "thought_count".
|
|
if ! grep -q "ThoughtCount" "${projects_model}"; then
|
|
tmp_file="$(mktemp)"
|
|
awk '
|
|
/Name[[:space:]]+resolvespec_common\.SqlString[[:space:]]+`bun:"name,type:text,notnull," json:"name"`/ {
|
|
print
|
|
print "\tThoughtCount resolvespec_common.SqlInt64 `bun:\"thought_count,scanonly\" json:\"thought_count\"`"
|
|
next
|
|
}
|
|
{ print }
|
|
' "${projects_model}" > "${tmp_file}"
|
|
mv "${tmp_file}" "${projects_model}"
|
|
fi
|
|
|
|
# relspec currently emits an incorrect int32 cast for persona_arc primary key updates.
|
|
sed -i 's/m\.PersonaID = int32(newid)/m.PersonaID = newid/' "${persona_arc_model}"
|
|
|
|
# Some join-table models import resolvespec_common without using it.
|
|
for file in "${models_dir}"/*.go; do
|
|
if ! grep -q 'resolvespec_common\.' "${file}"; then
|
|
sed -i '/^[[:space:]]*resolvespec_common "github.com\/bitechdev\/ResolveSpec\/pkg\/spectypes"$/d' "${file}"
|
|
fi
|
|
done
|