feat(kol): expand variable schema and polish KOL UI

- Add length/range limits to KOL variable definitions: max_length and
  default_value for input/textarea, min_value/max_value/default_number
  for number. Backend validates and normalizes; frontend renders limit
  inputs in KolVariableConfig and applies limits at runtime in
  KolDynamicForm.
- Sort workspace cards by most recent prompt/package update, falling
  back to granted_at. Adds updated_at to KolWorkspaceCard.
- Polish TemplatesView, WorkspaceView, and KOL package management UI;
  route create/update/publish/archive/delete toasts through i18n and
  expand package form copy and status labels.
- Remove stale KnowledgeView.vue.patch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 15:01:40 +08:00
parent 1dd316a34b
commit 79c65c1da7
26 changed files with 1506 additions and 235 deletions
@@ -14,7 +14,7 @@ import {
ClockCircleOutlined,
ExclamationCircleOutlined,
} from "@ant-design/icons-vue";
import { kolMarketplaceApi } from "@/lib/api";
import { kolMarketplaceApi, resolveApiURL } from "@/lib/api";
import { formatError } from "@/lib/errors";
const route = useRoute();
@@ -47,6 +47,7 @@ const subscribeMutation = useMutation({
});
const pkg = computed(() => packageQuery.data.value);
const resolvedCoverUrl = computed(() => resolveApiURL(pkg.value?.cover_url));
const subscription = computed(() => pkg.value?.subscription);
const subscriptionStatusMeta = computed(() => {
@@ -102,8 +103,8 @@ function goBack() {
<a-row :gutter="24">
<a-col :xs="24" :lg="16">
<section class="main-card">
<div class="package-cover" v-if="pkg.cover_url">
<img :src="pkg.cover_url" alt="cover" />
<div class="package-cover" v-if="resolvedCoverUrl">
<img :src="resolvedCoverUrl" alt="cover" />
</div>
<div class="package-info">
<div class="package-title-row">