@uibot/registry 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/distribution-snapshot.d.ts +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -11
- package/dist/resource-query.d.ts +4 -0
- package/dist/resources.d.ts +3 -0
- package/dist/resources.js +3 -3
- package/dist/shadcn/r/admin-apps.json +61 -0
- package/dist/shadcn/r/admin-chats.json +54 -0
- package/dist/shadcn/r/admin-error-401.json +54 -0
- package/dist/shadcn/r/admin-error-403.json +54 -0
- package/dist/shadcn/r/admin-error-404.json +54 -0
- package/dist/shadcn/r/admin-error-500.json +54 -0
- package/dist/shadcn/r/admin-error-503.json +54 -0
- package/dist/shadcn/r/admin-forgot-password.json +59 -0
- package/dist/shadcn/r/admin-help.json +53 -0
- package/dist/shadcn/r/admin-otp.json +59 -0
- package/dist/shadcn/r/admin-overview.json +62 -0
- package/dist/shadcn/r/admin-settings-account.json +61 -0
- package/dist/shadcn/r/admin-settings-appearance.json +61 -0
- package/dist/shadcn/r/admin-settings-display.json +61 -0
- package/dist/shadcn/r/admin-settings-notifications.json +61 -0
- package/dist/shadcn/r/admin-settings-profile.json +61 -0
- package/dist/shadcn/r/admin-settings.json +65 -0
- package/dist/shadcn/r/admin-shell.json +11 -5
- package/dist/shadcn/r/admin-sign-in-2.json +67 -0
- package/dist/shadcn/r/admin-sign-in.json +59 -0
- package/dist/shadcn/r/admin-sign-up.json +59 -0
- package/dist/shadcn/r/admin-tasks.json +66 -0
- package/dist/shadcn/r/admin-users.json +66 -0
- package/dist/shadcn/r/auth-01.json +24 -0
- package/dist/shadcn/r/auth-02.json +24 -0
- package/dist/shadcn/r/auth-03.json +24 -0
- package/dist/shadcn/r/auth-04.json +24 -0
- package/dist/shadcn/r/auth-05.json +24 -0
- package/dist/shadcn/r/auth-centered.json +61 -0
- package/dist/shadcn/r/auth-enterprise.json +61 -0
- package/dist/shadcn/r/auth-primitives.json +58 -0
- package/dist/shadcn/r/auth-recovery.json +64 -0
- package/dist/shadcn/r/auth-registration.json +63 -0
- package/dist/shadcn/r/auth-split.json +67 -0
- package/dist/shadcn/r/auth.json +13 -13
- package/dist/shadcn/r/charts.json +1 -1
- package/dist/shadcn/r/chat-artifact.json +49 -0
- package/dist/shadcn/r/chat-focused.json +49 -0
- package/dist/shadcn/r/chat-history.json +49 -0
- package/dist/shadcn/r/chat-knowledge.json +49 -0
- package/dist/shadcn/r/chat-support.json +49 -0
- package/dist/shadcn/r/chat-workspace.json +136 -0
- package/dist/shadcn/r/collection-cell-editor.json +6 -6
- package/dist/shadcn/r/collection-panel-drawer.json +2 -2
- package/dist/shadcn/r/collection-record-menu.json +2 -2
- package/dist/shadcn/r/collection-shared.json +2 -2
- package/dist/shadcn/r/commerce-workspace.json +69 -0
- package/dist/shadcn/r/console-billing.json +68 -0
- package/dist/shadcn/r/console-page.json +289 -0
- package/dist/shadcn/r/console-shell.json +29 -0
- package/dist/shadcn/r/content.json +1 -1
- package/dist/shadcn/r/creation-html-generation.json +3 -3
- package/dist/shadcn/r/creation-reference-generation.json +3 -3
- package/dist/shadcn/r/creation-revision-export.json +3 -3
- package/dist/shadcn/r/creation-shared.json +3 -3
- package/dist/shadcn/r/creation-variant-compare.json +4 -4
- package/dist/shadcn/r/creation-workspace.json +4 -4
- package/dist/shadcn/r/crm-workspace.json +73 -0
- package/dist/shadcn/r/dashboard.json +1 -1
- package/dist/shadcn/r/data-studio.json +1 -1
- package/dist/shadcn/r/data-table.json +25 -7
- package/dist/shadcn/r/data.json +81 -11
- package/dist/shadcn/r/document-assistant.json +54 -0
- package/dist/shadcn/r/document-library.json +49 -0
- package/dist/shadcn/r/document-reading.json +49 -0
- package/dist/shadcn/r/document-workspace.json +164 -0
- package/dist/shadcn/r/document-writing.json +49 -0
- package/dist/shadcn/r/drilldown-menu.json +233 -0
- package/dist/shadcn/r/education-workspace.json +82 -0
- package/dist/shadcn/r/feedback.json +6 -6
- package/dist/shadcn/r/field.json +1 -1
- package/dist/shadcn/r/form.json +11 -11
- package/dist/shadcn/r/grid.json +1 -1
- package/dist/shadcn/r/interactive.json +1 -1
- package/dist/shadcn/r/item-grid.json +219 -0
- package/dist/shadcn/r/kanban.json +1 -1
- package/dist/shadcn/r/layout.json +196 -16
- package/dist/shadcn/r/marketing.json +1 -1
- package/dist/shadcn/r/nav.json +3 -3
- package/dist/shadcn/r/presentation.json +1 -1
- package/dist/shadcn/r/preview-device-frame.json +2 -2
- package/dist/shadcn/r/primitives.json +2 -2
- package/dist/shadcn/r/sections.json +1 -1
- package/dist/shadcn/r/shadcn-admin-shell.json +1 -1
- package/dist/shadcn/r/shadcn-admin.json +23 -22
- package/dist/shadcn/r/sidebar-01.json +42 -0
- package/dist/shadcn/r/sidebar-02.json +42 -0
- package/dist/shadcn/r/sidebar-03.json +30 -0
- package/dist/shadcn/r/sidebar-04.json +30 -0
- package/dist/shadcn/r/sidebar-05.json +36 -0
- package/dist/shadcn/r/sidebar-06.json +42 -0
- package/dist/shadcn/r/sidebar-07.json +54 -0
- package/dist/shadcn/r/sidebar-08.json +54 -0
- package/dist/shadcn/r/sidebar-09.json +36 -0
- package/dist/shadcn/r/sidebar-10.json +66 -0
- package/dist/shadcn/r/sidebar-11.json +30 -0
- package/dist/shadcn/r/sidebar-12.json +48 -0
- package/dist/shadcn/r/sidebar-13.json +30 -0
- package/dist/shadcn/r/sidebar-14.json +30 -0
- package/dist/shadcn/r/sidebar-15.json +84 -0
- package/dist/shadcn/r/sidebar-16.json +66 -0
- package/dist/shadcn/r/sidebar-drilldown.json +29 -0
- package/dist/shadcn/r/sidebar-primitives.json +155 -0
- package/dist/shadcn/r/uibot-base.json +3 -3
- package/dist/shadcn/r/workspace.json +3 -3
- package/dist/shadcn/registry.json +987 -175
- package/dist/shadcn.d.ts +0 -39
- package/dist/solution-composition.d.ts +45 -0
- package/dist/solution-regions.d.ts +3 -0
- package/dist/solution-spec.d.ts +7 -0
- package/dist/template-source.d.ts +2 -0
- package/package.json +2 -2
package/dist/resources.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var ge={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},$t=Array.from(new Set(Object.values(ge).flat()));var K=["component","template","design-guide","example","skill","block","package","theme"],_=["experimental","candidate","recommended"],W=["declared","verified","external-consumer"],F=["missing","declared","verified","external-consumer"],w=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],me=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var Yt="uibot.registry.item.v1";var fe=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],Jt=[...fe,"radius","font-display","font-body","font-mono"];var V="uibot.resource.admission.v1",ye=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure"],Ce=["packed-install","typecheck","browser"],en=["invalid-admission-manifest","invalid-admission-record","invalid-admission-check","duplicate-admission-record","unknown-admission-resource","missing-source-metadata","missing-license-metadata","dependency-closure-failed"];class G extends Error{expected;actual;code="resource-admission-index-mismatch";constructor(e,t){super(`resource admission index mismatch: expected ${e}, received ${t}`);this.expected=e;this.actual=t;this.name="ResourceAdmissionIndexMismatchError"}}class Y extends Error{issueCount;code="resource-admission-report-rejected";constructor(e){super(`resource admission report contains ${e.toString()} issue(s)`);this.issueCount=e;this.name="ResourceAdmissionReportRejectedError"}}class Q extends Error{code="resource-admission-report-not-derived";constructor(){super("resource admission report must come directly from assessResourceAdmissions");this.name="ResourceAdmissionReportNotDerivedError"}}var be=new Set(w),he=new Set(F),J=new WeakSet,M={missing:0,declared:1,verified:2,"external-consumer":3};function xe(e,t){return e<t?-1:e>t?1:0}function S(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function L(e,t){let n=new Set(t);return Object.keys(e).every((r)=>n.has(r))}function Z(e){return[...new Set(e.map((t)=>t.trim()).filter(Boolean))].sort(xe)}function Re(e,t,n,r){if(!S(n)||!L(n,["status","evidence"])){r.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} must contain only status and evidence`});return}if(typeof n.status!=="string"||!he.has(n.status)||n.status==="missing"){r.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} status must be declared, verified or external-consumer`});return}if(!Array.isArray(n.evidence)||n.evidence.length===0||n.evidence.some((i)=>typeof i!=="string"||!i.trim())){r.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} evidence must be a non-empty string array`});return}return{status:n.status,evidence:Z(n.evidence)}}function ke(e){if(e===void 0)return;if(!S(e)||!L(e,["source","version","license"]))return;if(Object.values(e).some((n)=>n!==void 0&&typeof n!=="string"))return;return{...typeof e.source==="string"&&e.source.trim()?{source:e.source.trim()}:{},...typeof e.version==="string"&&e.version.trim()?{version:e.version.trim()}:{},...typeof e.license==="string"&&e.license.trim()?{license:e.license.trim()}:{}}}function Pe(e,t){let n=new Map,r=[];if(!S(t)||!L(t,["schemaVersion","records"])||t.schemaVersion!==V||!Array.isArray(t.records))return r.push({code:"invalid-admission-manifest",detail:`expected ${V} with a records array`}),{records:n,issues:r};let i=new Set(e.resources.map((o)=>o.id));for(let o of t.records){if(!S(o)||!L(o,["resourceId","provenance","checks"])||typeof o.resourceId!=="string"||!o.resourceId.trim()||!S(o.checks)){r.push({code:"invalid-admission-record",...S(o)&&typeof o.resourceId==="string"?{resourceId:o.resourceId}:{},detail:"record must contain only resourceId, optional provenance and checks"});continue}let a=o.resourceId.trim();if(n.has(a)){r.push({code:"duplicate-admission-record",resourceId:a,detail:a});continue}if(!i.has(a)){r.push({code:"unknown-admission-resource",resourceId:a,detail:a});continue}let c=ke(o.provenance);if(o.provenance!==void 0&&!c){r.push({code:"invalid-admission-record",resourceId:a,detail:"provenance must contain only string source, version and license fields"});continue}let l={},u=!1;for(let[m,C]of Object.entries(o.checks)){if(!be.has(m)){r.push({code:"invalid-admission-check",resourceId:a,detail:`unknown receipt check: ${m}`}),u=!0;continue}let p=m,s=Re(a,p,C,r);if(s)l[p]=s;else u=!0}if(u)continue;n.set(a,{resourceId:a,...c?{provenance:c}:{},checks:l})}return{records:n,issues:r}}function Ie(e){let t=new Map(e.resources.map((i)=>[i.id,i])),n=new Map;function r(i,o,a,c){if(n.has(i)||c.has(o))return;if(a.has(o)){n.set(i,`dependency cycle reached ${o}`);return}let l=t.get(o);if(!l){n.set(i,`missing dependency ${o}`);return}a.add(o);for(let u of l.dependencies)if(r(i,u,a,c),n.has(i))break;a.delete(o),c.add(o)}for(let i of e.resources)r(i.id,i.id,new Set,new Set);return n}var Se=/^(unknown|unlicensed|none|n\/?a)$/i,Ae=/^SPDX-License-Identifier:\s*(\S+)/im,ve=/^(?:the\s+)?(mit|apache(?:\s+license(?:\s*,?\s*version\s*2\.0)?)?|bsd-2-clause|bsd-3-clause|isc|unlicense)\b/i;function I(e){let t=e?.trim();if(!t||Se.test(t))return;return t}function we(e){if(!e?.trim())return;let t=e.match(Ae)?.[1];if(t)return I(t);let n=e.match(ve)?.[1];if(!n)return;let r=n.toLowerCase();if(r.startsWith("mit"))return"MIT";if(r.startsWith("apache"))return"Apache-2.0";if(r.startsWith("bsd-2"))return"BSD-2-Clause";if(r.startsWith("bsd-3"))return"BSD-3-Clause";if(r==="isc")return"ISC";if(r==="unlicense")return"Unlicense";return}function tn(e){return I(e.frontmatterLicense)??I(e.packageJsonLicense)??we(e.licenseFileText)}function X(e){return Boolean(I(e))}var E={states:/\b(disabled|loading|error|empty|pending|busy|children|active|muted|boolean-state)\b/i,accessibility:/\b(label|aria|accessible|alt|role)\b/i,"light-theme":/:root\b|\b(light(?:-theme)?|theme token|css variables?)\b/i,"dark-theme":/\b(dark(?:-theme)?)\b/i,responsive:/\b(size|responsive|breakpoint|sm|md|lg|xl|full)\b/i};function B(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let r of e)B(r,t);return}let n=e;for(let[r,i]of Object.entries(n)){if(t.push(r),r==="type"&&i==="boolean")t.push("boolean-state");B(i,t)}}function Ee(e){let t=[];return B(e.props,t),[e.name,e.description,...e.tags??[],...e.usageScenarios??[],...e.constraints??[],...t,...Object.keys(e.slots??{}),...Object.keys(e.events??{}),e.slots&&Object.keys(e.slots).length>0?"empty":""].join(`
|
|
3
|
-
`)}function
|
|
4
|
-
`);return{contract:Boolean(e.props&&Object.keys(e.props).length>0||e.events&&Object.keys(e.events).length>0||e.slots&&Object.keys(e.slots).length>0)?"verified":"declared",states:E.states.test(n)?"verified":"missing",accessibility:E.accessibility.test(n)?"verified":"missing","light-theme":E["light-theme"].test(n)?"verified":"missing","dark-theme":E["dark-theme"].test(n)?"verified":"missing",responsive:E.responsive.test(n)?"verified":"missing"}}function De(e){return{source:"declared",license:X(e.source.license)?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"}}function Oe(e){if(!ye.every((r)=>M[e[r]]>=M.verified))return"experimental";return Ce.every((r)=>e[r]==="external-consumer")?"recommended":"candidate"}function ee(e){let t=JSON.stringify({schemaVersion:e.schemaVersion,resources:e.resources.map((i)=>({id:i.id,kind:i.kind,title:i.title,description:i.description,...i.category?{category:i.category}:{},tags:i.tags,aliases:i.aliases,capabilities:i.capabilities,dependencies:i.dependencies,source:i.source})),aliases:e.aliases}),n=0xcbf29ce484222325n,r=0x100000001b3n;for(let i of new TextEncoder().encode(t))n^=BigInt(i),n=BigInt.asUintN(64,n*r);return`fnv1a64:${n.toString(16).padStart(16,"0")}`}function Te(e,t,n){let r=De(e),i=[`resource://${e.source.type}/${e.source.id}`,`resource://contract/${e.id}`],o=[];if(n)o.push({code:"dependency-closure-failed",resourceId:e.id,check:"dependency-closure",detail:n});else r["dependency-closure"]="verified",i.push(`resource://index/${e.id}`);if(t)for(let l of w){if(l==="dependency-closure")continue;let u=t.checks[l];if(!u)continue;if(l==="source"&&M[u.status]>=M.verified&&(!t.provenance?.source||!t.provenance.version)){o.push({code:"missing-source-metadata",resourceId:e.id,check:l,detail:"verified source requires provenance.source and provenance.version"});continue}if(l==="license"&&!X(t.provenance?.license)){o.push({code:"missing-license-metadata",resourceId:e.id,check:l,detail:"license evidence requires a concrete provenance.license"});continue}if(r[l]=u.status,i.push(...u.evidence),l==="source"&&t.provenance?.source)i.push(t.provenance.source)}let a=Oe(r),c={level:a==="recommended"?"external-consumer":a==="candidate"?"verified":"declared",maturity:a,checks:r,evidence:Z(i)};return Object.freeze(c.checks),Object.freeze(c.evidence),Object.freeze(c),Object.freeze(o),Object.freeze({resourceId:e.id,receipt:c,issues:o})}function nn(e,t){let n=Pe(e,t),r=Ie(e),i=e.resources.map((l)=>Te(l,n.records.get(l.id),r.get(l.id))),o=[...n.issues,...i.flatMap((l)=>l.issues)],a=Object.fromEntries(_.map((l)=>[l,0]));for(let l of i)a[l.receipt.maturity]+=1;Object.freeze(i),Object.freeze(a);for(let l of o)Object.freeze(l);Object.freeze(o);let c=Object.freeze({schemaVersion:V,indexFingerprint:ee(e),resources:i,counts:a,issues:o});return J.add(c),c}function on(e,t){if(!J.has(t))throw new Q;if(t.issues.length>0)throw new Y(t.issues.length);let n=ee(e);if(n!==t.indexFingerprint)throw new G(t.indexFingerprint,n);let r=new Map(t.resources.map((o)=>[o.resourceId,o.receipt])),i=e.resources.map((o)=>{let a=r.get(o.id);if(!a)return o;return Object.freeze({...o,receipt:a})});return Object.freeze(i),Object.freeze({schemaVersion:e.schemaVersion,resources:i,aliases:e.aliases})}var _e="uibot.resource.index.v1",cn=["invalid-resource-source-id","duplicate-resource-id","dangling-resource-dependency","ambiguous-resource-dependency"];class v extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function b(e,t){return e<t?-1:e>t?1:0}function f(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function Fe(e){let t=f(e).replace(/ /g,"-");if(!t)throw new v("invalid-resource-source-id",e);return t}function R(e,t){return`${e}:${Fe(t)}`}function N(e){let t=new Map;for(let n of e){let r=n?.trim();if(!r)continue;let i=f(r);if(!i||t.has(i))continue;t.set(i,r)}return[...t.entries()].sort(([n],[r])=>b(n,r)).map(([,n])=>n)}function D(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function Me(e){let t=I(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function A(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:N(e.tags),aliases:N(e.aliases),capabilities:N(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(b),source:Me(e.source),receipt:e.receipt}}function Le(e){return(e.body.split(/\r?\n/).map((n)=>n.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function Ne(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function Ve(e){let t=new Map;for(let n of Object.keys(e).sort(b)){let r=e[n];if(!r)continue;let i=R("component",n);for(let o of N([n,r.name])){let a=f(o),c=t.get(a)??[];if(!c.includes(i))c.push(i);t.set(a,c.sort(b))}}return t}function Be(e,t,n){let r=n.get(f(e))??[];if(r.length===0)throw new v("dangling-resource-dependency",`${t} -> ${R("component",e)}`);if(r.length>1)throw new v("ambiguous-resource-dependency",`${t} -> ${e}: ${r.join(",")}`);return r[0]}function je(e,t,n,r){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(r,i))return R("template",i);return Be(e,t,n)}function O(e,t,n){return I(n?.[e]??t)}function ln(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[n])=>b(t,n)).map(([t,n])=>({id:`${t}-example`,title:`${n.name} Example`,description:n.description,category:n.category,tags:n.keywords,aliases:[`${t} example`,`${n.name} example`],capabilities:["example:template"],dependencies:[R("template",t)]}))}function dn(e){let t=e.components??{},n=e.templates??{},r=e.designGuides??[],i=e.examples??[],o=e.skills??[],a=e.licenses,c=Ve(t),l=[];for(let s of Object.keys(t).sort(b)){let d=t[s];if(!d)continue;let g=R("component",s),y=O(g,void 0,a);l.push(A({id:g,kind:"component",title:d.name,description:d.description,category:d.category,tags:d.tags??[],aliases:[s,d.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:s,...y?{license:y}:{}},receipt:D(Boolean(y))}))}for(let s of Object.keys(n).sort(b)){let d=n[s];if(!d)continue;let g=R("template",s),y=O(g,void 0,a);l.push(A({id:g,kind:"template",title:d.name,description:d.description,category:d.category,tags:d.keywords,aliases:[s,d.name],capabilities:[],dependencies:(d.composedFrom??[]).map((T)=>je(T,g,c,n)),source:{type:"template-contract",id:s,...y?{license:y}:{}},receipt:D(Boolean(y))}))}for(let s of[...r].sort((d,g)=>b(d.id,g.id))){let d=R("design-guide",s.id),g=O(d,void 0,a);l.push(A({id:d,kind:"design-guide",title:s.title,description:Le(s),category:s.category,tags:s.tags,aliases:[s.id,s.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:s.id,...s.sourceUrl?{url:s.sourceUrl}:{},...g?{license:g}:{}},receipt:D(Boolean(g))}))}for(let s of[...i].sort((d,g)=>b(d.id,g.id))){let d=R("example",s.id),g=O(d,s.license,a);l.push(A({id:d,kind:"example",title:s.title,description:s.description,...s.category?{category:s.category}:{},tags:s.tags??[],aliases:[s.id,s.title,...s.aliases??[]],capabilities:s.capabilities??[],dependencies:s.dependencies??[],source:{type:"example",id:s.id,...s.version?{version:s.version}:{},...s.sourceUrl?{url:s.sourceUrl}:{},...g?{license:g}:{}},receipt:D(Boolean(g))}))}for(let s of[...o].sort((d,g)=>b(d.id,g.id))){let d=R("skill",s.id),g=O(d,void 0,a);l.push(A({id:d,kind:"skill",title:s.title,description:s.description?.trim()||s.title,tags:[...s.tags??[],...s.triggers??[]],aliases:[s.id,s.title,...s.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:s.id,...s.version?{version:s.version}:{},...g?{license:g}:{}},receipt:D(Boolean(g))}))}for(let s of e.additional??[])l.push(A(s));l.sort((s,d)=>b(s.id,d.id));let u=new Set;for(let s of l){if(u.has(s.id))throw new v("duplicate-resource-id",s.id);u.add(s.id)}for(let s of l)for(let d of s.dependencies)if(!u.has(d))throw new v("dangling-resource-dependency",`${s.id} -> ${d}`);let m=new Map;for(let s of l)for(let d of s.aliases){let g=f(d);if(!g)continue;let y=m.get(g)??new Set;y.add(s.id),m.set(g,y)}let C=Object.freeze(Object.fromEntries([...m.entries()].sort(([s],[d])=>b(s,d)).map(([s,d])=>[s,Object.freeze([...d].sort(b))]))),p=Object.freeze(l.map(Ne));return Object.freeze({schemaVersion:_e,resources:p,aliases:C})}var Ue=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],qe=Object.freeze(Ue.map((e)=>Object.freeze([...e]))),te=new Map;for(let e of qe){let t=Object.freeze([...new Set(e.map(f).filter(Boolean))].sort());for(let n of t)te.set(n,t)}function j(e){let t=f(e);return te.get(t)??Object.freeze([t])}var yn=["resource-query-empty","resource-query-invalid-limit","resource-not-found","resource-alias-ambiguous"];class x extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var H=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),ze=Object.freeze(Object.keys(H)),re=new Map(ze.map((e,t)=>[e,t])),ne=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function h(e,t){return e<t?-1:e>t?1:0}function oe(e){return new Set((e??[]).map(f).filter(Boolean))}function U(e,t){let n=oe(t);if(n.size===0)return!0;let r=oe(e);return[...n].some((i)=>r.has(i))}function He(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!U(e.tags,t.tags))return!1;if(!U(e.category?[e.category]:[],t.categories))return!1;if(!U(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function $e(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function k(e,t,n,r=H[t]){if(e.some((i)=>i.code===t&&i.value===n))return;e.push({code:t,value:n,score:r})}function q(e,t){return e.find((n)=>f(n)===t)}function z(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function Ke(e,t,n){if(Math.abs(e.length-t.length)>n)return n+1;let r=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],a=i;for(let c=1;c<=t.length;c+=1){let l=(r[c-1]??n+1)+(e[i-1]===t[c-1]?0:1),u=Math.min((r[c]??n+1)+1,(o[c-1]??n+1)+1,l);o.push(u),a=Math.min(a,u)}if(a>n)return n+1;r=o}return r[t.length]??n+1}function We(e,t){let n=f(t),r=[];if(f(e.id)===n)k(r,"exact-id",e.id);if(f(e.title)===n)k(r,"exact-title",e.title);let i=q(e.aliases,n);if(i)k(r,"alias",i);let o=q(e.tags,n);if(o)k(r,"tag",o);let a=q(e.capabilities,n);if(a)k(r,"capability",a);if(e.category&&f(e.category)===n)k(r,"category",e.category);if(!i){let u=j(n).filter((C)=>C!==n),m=new Set(z(e).map(f));if(u.some((C)=>m.has(C)))k(r,"alias",t.trim())}let c=n.split(" ").filter(Boolean),l=f(z(e).join(" "));if(c.length>0&&c.every((u)=>l.includes(u)))k(r,"token",t.trim());if(r.length===0&&n.length>=4){let u;for(let m of z(e)){let C=f(m);if(C.length<4)continue;let p=Ke(n,C,2);if(p<=2&&(!u||p<u.distance||p===u.distance&&h(m,u.value)<0))u={value:m,distance:p}}if(u)k(r,"fuzzy",u.value,H.fuzzy-u.distance)}return r.sort((u,m)=>{if(u.score!==m.score)return m.score-u.score;return(re.get(u.code)??99)-(re.get(m.code)??99)||h(u.value,m.value)})}function ie(e,t,n){if(t.has(n))return[n];let r=f(n),i=e.aliases[r];if(i?.length)return[...i];let o=new Set;for(let a of j(r))for(let c of e.aliases[a]??[])o.add(c);return[...o].sort(h)}function se(e,t){return new x("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function ae(e){let t=new Map(e.resources.map((r)=>[r.id,r]));function n(r){let i=r.trim(),o=ie(e,t,i);if(o.length===0)throw new x("resource-not-found",i);if(o.length>1)throw se(i,o);let a=o[0],c=a?t.get(a):void 0;if(!c)throw new x("resource-not-found",i);return c}return Object.freeze({manifest:()=>e,search(r){let i=r.text?.trim()??"";if(!i&&!$e(r))throw new x("resource-query-empty","text or filter is required");if(r.limit!==void 0&&(!Number.isInteger(r.limit)||r.limit<=0))throw new x("resource-query-invalid-limit",String(r.limit));let o=e.resources.filter((a)=>He(a,r)).map((a)=>{let c=i?We(a,i):[];return{resource:a,score:c.reduce((l,u)=>l+u.score,0),reasons:c}}).filter((a)=>!i||a.reasons.length>0).sort((a,c)=>c.score-a.score||h(a.resource.id,c.resource.id));return r.limit===void 0?o:o.slice(0,r.limit)},get:n,build(r){if(r.length===0||r.every((p)=>!p.trim()))throw new x("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let p of r){let s=p.trim(),d=ie(e,t,s);if(d.length===0)i.push({id:s,reason:"missing-resource"});else if(d.length>1)throw se(s,d);else{let g=d[0];if(g)o.add(g)}}let a=new Set,c=new Set,l=new Set,u=[],m=[],C=(p,s)=>{if(a.has(p))return;if(c.has(p)){i.push({id:p,...s?{requiredBy:s}:{},reason:"dependency-cycle"});return}let d=t.get(p);if(!d){i.push({id:p,...s?{requiredBy:s}:{},reason:"missing-resource"});return}c.add(p),l.add(p);let g=[...d.dependencies].sort((y,T)=>{let le=t.get(y),de=t.get(T);return(ne.get(le?.kind??"")??99)-(ne.get(de?.kind??"")??99)||h(y,T)});for(let y of g)m.push({from:p,to:y,relation:"depends-on"}),C(y,p);c.delete(p),a.add(p),u.push(p)};for(let p of[...o].sort(h))C(p);return{roots:[...o].sort(h),nodes:[...l].sort(h).map((p)=>{let s=t.get(p);if(!s)throw new x("resource-not-found",p);return{id:p,kind:s.kind,maturity:s.receipt.maturity}}),edges:m.sort((p,s)=>h(p.from,s.from)||h(p.to,s.to)),order:u,gaps:i.sort((p,s)=>h(p.id,s.id)||h(p.requiredBy??"",s.requiredBy??"")||h(p.reason,s.reason))}}})}function Ge(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Je(e);let t=e;if(t.schemaVersion!=="uibot.public-resources.v1"||typeof t.release?.version!=="string"||!/^[a-f0-9]{64}$/.test(t.release?.sourceHash)||t.index?.schemaVersion!=="uibot.resource.index.v1"||!Array.isArray(t.index.resources)||!t.index.aliases||!t.showcases)throw Error("invalid-public-resource-bundle");if(t.documents&&(!Array.isArray(t.documents)||t.documents.some((r)=>typeof r.title!=="string"||typeof r.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(r.path))))throw Error("invalid-public-documentation");let n=new Set;for(let r of t.index.resources){if(!r||typeof r.id!=="string"||n.has(r.id)||!K.includes(r.kind)||!r.id.startsWith(`${r.kind}:`)||typeof r.description!=="string"||typeof r.title!=="string"||!Array.isArray(r.dependencies)||!r.source||!r.receipt||!Array.isArray(r.aliases)||!Array.isArray(r.tags)||!Array.isArray(r.capabilities)||![r.aliases,r.dependencies,r.tags,r.capabilities].every((o)=>o.every((a)=>typeof a==="string"&&a.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(r.source.type)||typeof r.source.id!=="string"||!_.includes(r.receipt.maturity)||!W.includes(r.receipt.level)||!Array.isArray(r.receipt.evidence)||!r.receipt.evidence.every((o)=>typeof o==="string")||!w.every((o)=>F.includes(r.receipt.checks?.[o])))throw Error("invalid-public-resource");n.add(r.id);let i=t.showcases[r.id];if(!i||i.resourceId!==r.id||typeof i.docs?.zh!=="string"||typeof i.docs?.en!=="string"||!Array.isArray(i.examples)||!Array.isArray(i.distributions))throw Error("invalid-resource-showcase");if(typeof i.title?.zh!=="string"||typeof i.title?.en!=="string"||i.examples.some((o)=>!o||typeof o.id!=="string"||typeof o.title!=="string"||typeof o.code!=="string"||!["spec","tsx","source"].includes(o.mode)||!["tsx","json","yaml","css","ts"].includes(o.language)||!Array.isArray(o.dependencies)||!o.dependencies.every((a)=>typeof a==="string"))||i.distributions.some((o)=>!o||!["spec","npm","shadcn"].includes(o.channel)||typeof o.name!=="string"||!/^[@a-zA-Z0-9._/-]+$/.test(o.name)||typeof o.version!=="string"||!["source","published"].includes(o.availability)))throw Error("invalid-resource-content")}for(let[r,i]of Object.entries(t.index.aliases))if(!r||!Array.isArray(i)||i.some((o)=>!n.has(o)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((r)=>!n.has(r)))throw Error("unexpected-public-resource-showcase");for(let r of t.index.resources)for(let i of r.dependencies)if(!n.has(i))throw Error("invalid-public-resource-dependency")}function Rn(e){Ge(e),e=JSON.parse(JSON.stringify(e));let t=(i)=>{if(i&&typeof i==="object"){for(let o of Object.values(i))t(o);Object.freeze(i)}};t(e);let n=ae(e.index),r=(i)=>{let o=n.get(i),a=e.showcases[o.id];if(!a)throw new x("resource-not-found",o.id);return a};return Object.freeze({...n,docs(i,o="zh",a=1){if(o!=="zh"&&o!=="en")throw Error("unsupported-resource-locale");let c=r(i);return{resourceId:c.resourceId,locale:o,...Ye(c.docs[o],a),release:e.release}},examples(i,o=1){let a=r(i);return{resourceId:a.resourceId,...Qe(a.examples,o),release:e.release}},installPlan(i){let o=r(i);return{resourceId:o.resourceId,distributions:o.distributions,dependencies:n.build([o.resourceId]),release:e.release}}})}var P=24000;function ce(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new x("resource-query-invalid-limit","page is outside the available range")}function Ye(e,t){let n=Math.max(1,Math.ceil(e.length/P));return ce(t,n),{markdown:e.slice((t-1)*P,t*P),page:t,totalPages:n,...t<n?{nextPage:t+1}:{}}}function Qe(e,t){let n=e.flatMap((r)=>Array.from({length:Math.max(1,Math.ceil(r.code.length/P))},(i,o)=>({...r,code:r.code.slice(o*P,(o+1)*P),codeOffset:o*P,codeLength:r.code.length,complete:r.code.length<=P})));return ce(t,n.length),{examples:n.slice(t-1,t),page:t,totalPages:n.length,...t<n.length?{nextPage:t+1}:{}}}function Je(e){let t=0,n=0,r=new Set,i=(o,a)=>{if(++t>300000||a>64)throw Error("public-resource-budget-exceeded");if(typeof o==="string"){if(n+=new TextEncoder().encode(o).length,n>16777216)throw Error("public-resource-budget-exceeded")}else if(o&&typeof o==="object"){if(r.has(o))throw Error("invalid-public-resource-cycle");let c=Object.getPrototypeOf(o);if(!Array.isArray(o)&&c!==Object.prototype&&c!==null)throw Error("invalid-public-resource-object");r.add(o);for(let[l,u]of Object.entries(o))i(l,a+1),i(u,a+1);r.delete(o)}else if(o!==null&&typeof o!=="boolean"&&(typeof o!=="number"||!Number.isFinite(o)))throw Error("invalid-public-resource-json")};i(e,1)}export{cn as RESOURCE_INDEX_ERROR_CODES,_e as RESOURCE_INDEX_SCHEMA_VERSION,yn as RESOURCE_QUERY_ERROR_CODES,me as RESOURCE_QUERY_OPERATION_MANIFEST,H as RESOURCE_QUERY_SCORE_WEIGHTS,v as ResourceIndexError,x as ResourceQueryError,Ge as assertPublicResourceBundle,ln as buildExamplesFromL4Templates,dn as buildResourceIndex,Rn as createPublicResourceQueryService,ae as createResourceQueryService,f as normalizeResourceAlias,R as toResourceId};
|
|
2
|
+
var Ee={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},dn=Array.from(new Set(Object.values(Ee).flat()));var se=["component","template","design-guide","example","skill","block","package","theme"],z=["experimental","candidate","recommended"],ae=["declared","verified","external-consumer"],q=["missing","declared","verified","external-consumer"],N=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],De=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var mn="uibot.registry.item.v1";var Oe=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],yn=[...Oe,"radius","font-display","font-body","font-mono"];var S=(e)=>!!e&&typeof e==="object"&&!Array.isArray(e),C=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e),ce=(e)=>S(e)&&Object.entries(e).every(([t,o])=>C(t)&&C(o));function v(e){if(e.composition===void 0)return;let t=e.composition;if(!S(t)||t.schema!=="uibot.solution-composition.v1"||!Array.isArray(t.pages))throw Error("invalid-solution-composition");let o=new Set;for(let i of t.pages){if(!S(i)||!C(i.resourceId)||!C(i.version)||typeof i.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(i.sourceHash)||!C(i.sourcePageId)||!C(i.targetPageId)||o.has(i.targetPageId)||!S(i.baseline)||i.baseline.id!==i.targetPageId||typeof i.baseline.path!=="string"||!Array.isArray(i.baseline.blocks)||!S(i.bindings)||!["source","target"].includes(String(i.bindings.layout))||!ce(i.bindings.paths)||!ce(i.bindings.connections)||i.bindings.frame!==void 0&&(!S(i.bindings.frame)||Object.keys(i.bindings.frame).some((n)=>!["props","slots","events"].includes(n)))||i.detached!==void 0&&typeof i.detached!=="boolean"||i.configuration!==void 0&&(!S(i.configuration)||Object.entries(i.configuration).some(([n,s])=>!C(n)||!["string","number","boolean"].includes(typeof s)||typeof s==="number"&&!Number.isFinite(s))))throw Error("invalid-solution-adoption");o.add(i.targetPageId)}if(t.regions!==void 0){if(!Array.isArray(t.regions))throw Error("invalid-solution-regions");let i=new Set;for(let n of t.regions){if(!S(n)||!C(n.resourceId)||!C(n.version)||typeof n.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(n.sourceHash)||!C(n.targetPageId)||i.has(n.targetPageId)||!C(n.role)||n.target!=="page-frame"||!C(n.contentBlockId)||!S(n.baseline)||!C(n.baseline.type))throw Error("invalid-solution-region");i.add(n.targetPageId)}}}var J="uibot.resource.admission.v1",Te=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure"],_e=["packed-install","typecheck","browser"],qr=["invalid-admission-manifest","invalid-admission-record","invalid-admission-check","duplicate-admission-record","unknown-admission-resource","missing-source-metadata","missing-license-metadata","dependency-closure-failed"];class le extends Error{expected;actual;code="resource-admission-index-mismatch";constructor(e,t){super(`resource admission index mismatch: expected ${e}, received ${t}`);this.expected=e;this.actual=t;this.name="ResourceAdmissionIndexMismatchError"}}class de extends Error{issueCount;code="resource-admission-report-rejected";constructor(e){super(`resource admission report contains ${e.toString()} issue(s)`);this.issueCount=e;this.name="ResourceAdmissionReportRejectedError"}}class ue extends Error{code="resource-admission-report-not-derived";constructor(){super("resource admission report must come directly from assessResourceAdmissions");this.name="ResourceAdmissionReportNotDerivedError"}}var Fe=new Set(N),Ne=new Set(q),pe=new WeakSet,H={missing:0,declared:1,verified:2,"external-consumer":3};function Me(e,t){return e<t?-1:e>t?1:0}function O(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function K(e,t){let o=new Set(t);return Object.keys(e).every((i)=>o.has(i))}function ge(e){return[...new Set(e.map((t)=>t.trim()).filter(Boolean))].sort(Me)}function Le(e,t,o,i){if(!O(o)||!K(o,["status","evidence"])){i.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} must contain only status and evidence`});return}if(typeof o.status!=="string"||!Ne.has(o.status)||o.status==="missing"){i.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} status must be declared, verified or external-consumer`});return}if(!Array.isArray(o.evidence)||o.evidence.length===0||o.evidence.some((n)=>typeof n!=="string"||!n.trim())){i.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} evidence must be a non-empty string array`});return}return{status:o.status,evidence:ge(o.evidence)}}function Be(e){if(e===void 0)return;if(!O(e)||!K(e,["source","version","license"]))return;if(Object.values(e).some((o)=>o!==void 0&&typeof o!=="string"))return;return{...typeof e.source==="string"&&e.source.trim()?{source:e.source.trim()}:{},...typeof e.version==="string"&&e.version.trim()?{version:e.version.trim()}:{},...typeof e.license==="string"&&e.license.trim()?{license:e.license.trim()}:{}}}function je(e,t){let o=new Map,i=[];if(!O(t)||!K(t,["schemaVersion","records"])||t.schemaVersion!==J||!Array.isArray(t.records))return i.push({code:"invalid-admission-manifest",detail:`expected ${J} with a records array`}),{records:o,issues:i};let n=new Set(e.resources.map((s)=>s.id));for(let s of t.records){if(!O(s)||!K(s,["resourceId","provenance","checks"])||typeof s.resourceId!=="string"||!s.resourceId.trim()||!O(s.checks)){i.push({code:"invalid-admission-record",...O(s)&&typeof s.resourceId==="string"?{resourceId:s.resourceId}:{},detail:"record must contain only resourceId, optional provenance and checks"});continue}let r=s.resourceId.trim();if(o.has(r)){i.push({code:"duplicate-admission-record",resourceId:r,detail:r});continue}if(!n.has(r)){i.push({code:"unknown-admission-resource",resourceId:r,detail:r});continue}let a=Be(s.provenance);if(s.provenance!==void 0&&!a){i.push({code:"invalid-admission-record",resourceId:r,detail:"provenance must contain only string source, version and license fields"});continue}let c={},u=!1;for(let[p,f]of Object.entries(s.checks)){if(!Fe.has(p)){i.push({code:"invalid-admission-check",resourceId:r,detail:`unknown receipt check: ${p}`}),u=!0;continue}let m=p,l=Le(r,m,f,i);if(l)c[m]=l;else u=!0}if(u)continue;o.set(r,{resourceId:r,...a?{provenance:a}:{},checks:c})}return{records:o,issues:i}}function Ve(e){let t=new Map(e.resources.map((n)=>[n.id,n])),o=new Map;function i(n,s,r,a){if(o.has(n)||a.has(s))return;if(r.has(s)){o.set(n,`dependency cycle reached ${s}`);return}let c=t.get(s);if(!c){o.set(n,`missing dependency ${s}`);return}r.add(s);for(let u of c.dependencies)if(i(n,u,r,a),o.has(n))break;r.delete(s),a.add(s)}for(let n of e.resources)i(n.id,n.id,new Set,new Set);return o}var Ue=/^(unknown|unlicensed|none|n\/?a)$/i,ze=/^SPDX-License-Identifier:\s*(\S+)/im,qe=/^(?:the\s+)?(mit|apache(?:\s+license(?:\s*,?\s*version\s*2\.0)?)?|bsd-2-clause|bsd-3-clause|isc|unlicense)\b/i;function E(e){let t=e?.trim();if(!t||Ue.test(t))return;return t}function $e(e){if(!e?.trim())return;let t=e.match(ze)?.[1];if(t)return E(t);let o=e.match(qe)?.[1];if(!o)return;let i=o.toLowerCase();if(i.startsWith("mit"))return"MIT";if(i.startsWith("apache"))return"Apache-2.0";if(i.startsWith("bsd-2"))return"BSD-2-Clause";if(i.startsWith("bsd-3"))return"BSD-3-Clause";if(i==="isc")return"ISC";if(i==="unlicense")return"Unlicense";return}function $r(e){return E(e.frontmatterLicense)??E(e.packageJsonLicense)??$e(e.licenseFileText)}function me(e){return Boolean(E(e))}var M={states:/\b(disabled|loading|error|empty|pending|busy|children|active|muted|boolean-state)\b/i,accessibility:/\b(label|aria|accessible|alt|role)\b/i,"light-theme":/:root\b|\b(light(?:-theme)?|theme token|css variables?)\b/i,"dark-theme":/\b(dark(?:-theme)?)\b/i,responsive:/\b(size|responsive|breakpoint|sm|md|lg|xl|full)\b/i};function Z(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let i of e)Z(i,t);return}let o=e;for(let[i,n]of Object.entries(o)){if(t.push(i),i==="type"&&n==="boolean")t.push("boolean-state");Z(n,t)}}function He(e){let t=[];return Z(e.props,t),[e.name,e.description,...e.tags??[],...e.usageScenarios??[],...e.constraints??[],...t,...Object.keys(e.slots??{}),...Object.keys(e.events??{}),e.slots&&Object.keys(e.slots).length>0?"empty":""].join(`
|
|
3
|
+
`)}function Hr(e,t={}){let o=[He(e),t.sourceText??"",t.stylesText??""].join(`
|
|
4
|
+
`);return{contract:Boolean(e.props&&Object.keys(e.props).length>0||e.events&&Object.keys(e.events).length>0||e.slots&&Object.keys(e.slots).length>0)?"verified":"declared",states:M.states.test(o)?"verified":"missing",accessibility:M.accessibility.test(o)?"verified":"missing","light-theme":M["light-theme"].test(o)?"verified":"missing","dark-theme":M["dark-theme"].test(o)?"verified":"missing",responsive:M.responsive.test(o)?"verified":"missing"}}function Ke(e){return{source:"declared",license:me(e.source.license)?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"}}function We(e){if(!Te.every((i)=>H[e[i]]>=H.verified))return"experimental";return _e.every((i)=>e[i]==="external-consumer")?"recommended":"candidate"}function fe(e){let t=JSON.stringify({schemaVersion:e.schemaVersion,resources:e.resources.map((n)=>({id:n.id,kind:n.kind,title:n.title,description:n.description,...n.category?{category:n.category}:{},tags:n.tags,aliases:n.aliases,capabilities:n.capabilities,dependencies:n.dependencies,source:n.source})),aliases:e.aliases}),o=0xcbf29ce484222325n,i=0x100000001b3n;for(let n of new TextEncoder().encode(t))o^=BigInt(n),o=BigInt.asUintN(64,o*i);return`fnv1a64:${o.toString(16).padStart(16,"0")}`}function Ge(e,t,o){let i=Ke(e),n=[`resource://${e.source.type}/${e.source.id}`,`resource://contract/${e.id}`],s=[];if(o)s.push({code:"dependency-closure-failed",resourceId:e.id,check:"dependency-closure",detail:o});else i["dependency-closure"]="verified",n.push(`resource://index/${e.id}`);if(t)for(let c of N){if(c==="dependency-closure")continue;let u=t.checks[c];if(!u)continue;if(c==="source"&&H[u.status]>=H.verified&&(!t.provenance?.source||!t.provenance.version)){s.push({code:"missing-source-metadata",resourceId:e.id,check:c,detail:"verified source requires provenance.source and provenance.version"});continue}if(c==="license"&&!me(t.provenance?.license)){s.push({code:"missing-license-metadata",resourceId:e.id,check:c,detail:"license evidence requires a concrete provenance.license"});continue}if(i[c]=u.status,n.push(...u.evidence),c==="source"&&t.provenance?.source)n.push(t.provenance.source)}let r=We(i),a={level:r==="recommended"?"external-consumer":r==="candidate"?"verified":"declared",maturity:r,checks:i,evidence:ge(n)};return Object.freeze(a.checks),Object.freeze(a.evidence),Object.freeze(a),Object.freeze(s),Object.freeze({resourceId:e.id,receipt:a,issues:s})}function Kr(e,t){let o=je(e,t),i=Ve(e),n=e.resources.map((c)=>Ge(c,o.records.get(c.id),i.get(c.id))),s=[...o.issues,...n.flatMap((c)=>c.issues)],r=Object.fromEntries(z.map((c)=>[c,0]));for(let c of n)r[c.receipt.maturity]+=1;Object.freeze(n),Object.freeze(r);for(let c of s)Object.freeze(c);Object.freeze(s);let a=Object.freeze({schemaVersion:J,indexFingerprint:fe(e),resources:n,counts:r,issues:s});return pe.add(a),a}function Wr(e,t){if(!pe.has(t))throw new ue;if(t.issues.length>0)throw new de(t.issues.length);let o=fe(e);if(o!==t.indexFingerprint)throw new le(t.indexFingerprint,o);let i=new Map(t.resources.map((s)=>[s.resourceId,s.receipt])),n=e.resources.map((s)=>{let r=i.get(s.id);if(!r)return s;return Object.freeze({...s,receipt:r})});return Object.freeze(n),Object.freeze({schemaVersion:e.schemaVersion,resources:n,aliases:e.aliases})}var Ye="uibot.resource.index.v1",Qr=["invalid-resource-source-id","duplicate-resource-id","dangling-resource-dependency","ambiguous-resource-dependency"];class _ extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function x(e,t){return e<t?-1:e>t?1:0}function h(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function Qe(e){let t=h(e).replace(/ /g,"-");if(!t)throw new _("invalid-resource-source-id",e);return t}function P(e,t){return`${e}:${Qe(t)}`}function W(e){let t=new Map;for(let o of e){let i=o?.trim();if(!i)continue;let n=h(i);if(!n||t.has(n))continue;t.set(n,i)}return[...t.entries()].sort(([o],[i])=>x(o,i)).map(([,o])=>o)}function L(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function Je(e){let t=E(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.sourceHash?{sourceHash:e.sourceHash}:{},...e.packageName?{packageName:e.packageName}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function T(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:W(e.tags),aliases:W(e.aliases),capabilities:W(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(x),source:Je(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function Ze(e){return(e.body.split(/\r?\n/).map((o)=>o.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function Xe(e){if(e.solution){let t=(o)=>{if(o&&typeof o==="object"){for(let i of Object.values(o))t(i);Object.freeze(o)}};t(e.solution)}return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function et(e){let t=new Map;for(let o of Object.keys(e).sort(x)){let i=e[o];if(!i)continue;let n=P("component",o);for(let s of W([o,i.name])){let r=h(s),a=t.get(r)??[];if(!a.includes(n))a.push(n);t.set(r,a.sort(x))}}return t}function tt(e,t,o){let i=o.get(h(e))??[];if(i.length===0)throw new _("dangling-resource-dependency",`${t} -> ${P("component",e)}`);if(i.length>1)throw new _("ambiguous-resource-dependency",`${t} -> ${e}: ${i.join(",")}`);return i[0]}function nt(e,t,o,i){let n=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(i,n))return P("template",n);return tt(e,t,o)}function B(e,t,o){return E(o?.[e]??t)}function Jr(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[o])=>x(t,o)).map(([t,o])=>({id:`${t}-example`,title:`${o.name} Example`,description:o.description,category:o.category,tags:o.keywords,aliases:[`${t} example`,`${o.name} example`],capabilities:["example:template"],dependencies:[P("template",t)]}))}function Zr(e){let t=e.components??{},o=e.templates??{},i=e.designGuides??[],n=e.examples??[],s=e.skills??[],r=e.licenses,a=et(t),c=[];for(let l of Object.keys(t).sort(x)){let d=t[l];if(!d)continue;let g=P("component",l),y=B(g,void 0,r);c.push(T({id:g,kind:"component",title:d.name,description:d.description,category:d.category,tags:d.tags??[],aliases:[l,d.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:l,...y?{license:y}:{}},receipt:L(Boolean(y))}))}for(let l of Object.keys(o).sort(x)){let d=o[l];if(!d)continue;let g=P("template",l),y=B(g,void 0,r);c.push(T({id:g,kind:"template",title:d.name,description:d.description,category:d.category,tags:d.keywords,aliases:[l,d.name],capabilities:[],dependencies:(d.composedFrom??[]).map((b)=>nt(b,g,a,o)),source:{type:"template-contract",id:l,...y?{license:y}:{}},receipt:L(Boolean(y))}))}for(let l of[...i].sort((d,g)=>x(d.id,g.id))){let d=P("design-guide",l.id),g=B(d,void 0,r);c.push(T({id:d,kind:"design-guide",title:l.title,description:Ze(l),category:l.category,tags:l.tags,aliases:[l.id,l.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:l.id,...l.sourceUrl?{url:l.sourceUrl}:{},...g?{license:g}:{}},receipt:L(Boolean(g))}))}for(let l of[...n].sort((d,g)=>x(d.id,g.id))){let d=P("example",l.id),g=B(d,l.license,r);c.push(T({id:d,kind:"example",title:l.title,description:l.description,...l.category?{category:l.category}:{},tags:l.tags??[],aliases:[l.id,l.title,...l.aliases??[]],capabilities:l.capabilities??[],dependencies:l.dependencies??[],source:{type:"example",id:l.id,...l.version?{version:l.version}:{},...l.sourceUrl?{url:l.sourceUrl}:{},...g?{license:g}:{}},receipt:L(Boolean(g))}))}for(let l of[...s].sort((d,g)=>x(d.id,g.id))){let d=P("skill",l.id),g=B(d,void 0,r);c.push(T({id:d,kind:"skill",title:l.title,description:l.description?.trim()||l.title,tags:[...l.tags??[],...l.triggers??[]],aliases:[l.id,l.title,...l.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:l.id,...l.version?{version:l.version}:{},...g?{license:g}:{}},receipt:L(Boolean(g))}))}for(let l of e.additional??[])c.push(T(l));c.sort((l,d)=>x(l.id,d.id));let u=new Set;for(let l of c){if(u.has(l.id))throw new _("duplicate-resource-id",l.id);u.add(l.id)}for(let l of c)for(let d of l.dependencies)if(!u.has(d))throw new _("dangling-resource-dependency",`${l.id} -> ${d}`);let p=new Map;for(let l of c)for(let d of l.aliases){let g=h(d);if(!g)continue;let y=p.get(g)??new Set;y.add(l.id),p.set(g,y)}let f=Object.freeze(Object.fromEntries([...p.entries()].sort(([l],[d])=>x(l,d)).map(([l,d])=>[l,Object.freeze([...d].sort(x))]))),m=Object.freeze(c.map(Xe));return Object.freeze({schemaVersion:Ye,resources:m,aliases:f})}var rt=[["chat","assistant","\u804A\u5929","\u52A9\u624B","\u5BF9\u8BDD"],["document","documents","\u6587\u6863","\u5199\u4F5C"],["auth","authentication","\u8BA4\u8BC1","\u767B\u5F55"],["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],ot=Object.freeze(rt.map((e)=>Object.freeze([...e]))),ye=new Map;for(let e of ot){let t=Object.freeze([...new Set(e.map(h).filter(Boolean))].sort());for(let o of t)ye.set(o,t)}function X(e){let t=h(e);return ye.get(t)??Object.freeze([t])}var oo=["resource-query-empty","resource-query-invalid-limit","resource-not-found","resource-alias-ambiguous"];class k extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var ne=Object.freeze({function:180,scenario:180,unit:180,industry:180,"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),it=Object.freeze(Object.keys(ne)),he=new Map(it.map((e,t)=>[e,t])),be=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function R(e,t){return e<t?-1:e>t?1:0}function Ce(e){return new Set((e??[]).map(h).filter(Boolean))}function D(e,t){let o=Ce(t);if(o.size===0)return!0;let i=Ce(e);return[...o].some((n)=>i.has(n))}function st(e,t){if(!D(e.solution?.functions??[],t.functions))return!1;if(!D(e.solution?.scenarios??[],t.scenarios))return!1;if(!D(e.solution?[e.solution.unit]:[],t.units))return!1;if(!D(e.solution?.industries??[],t.industries))return!1;if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!D(e.tags,t.tags))return!1;if(!D(e.category?[e.category]:[],t.categories))return!1;if(!D(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function at(e){return Boolean(e.functions?.length||e.scenarios?.length||e.units?.length||e.industries?.length||e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function I(e,t,o,i=ne[t]){if(e.some((n)=>n.code===t&&n.value===o))return;e.push({code:t,value:o,score:i})}function ee(e,t){return e.find((o)=>h(o)===t)}function te(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities,...e.solution?.functions??[],...e.solution?.scenarios??[],...e.solution?.industries??[]]}function ct(e,t,o){if(Math.abs(e.length-t.length)>o)return o+1;let i=Array.from({length:t.length+1},(n,s)=>s);for(let n=1;n<=e.length;n+=1){let s=[n],r=n;for(let a=1;a<=t.length;a+=1){let c=(i[a-1]??o+1)+(e[n-1]===t[a-1]?0:1),u=Math.min((i[a]??o+1)+1,(s[a-1]??o+1)+1,c);s.push(u),r=Math.min(r,u)}if(r>o)return o+1;i=s}return i[t.length]??o+1}function xe(e,t){let o=h(t),i=[];if(h(e.id)===o)I(i,"exact-id",e.id);if(h(e.title)===o)I(i,"exact-title",e.title);let n=ee(e.aliases,o);if(n)I(i,"alias",n);let s=ee(e.tags,o);if(s)I(i,"tag",s);let r=ee(e.capabilities,o);if(r)I(i,"capability",r);if(e.category&&h(e.category)===o)I(i,"category",e.category);if(!n){let u=X(o).filter((f)=>f!==o),p=new Set(te(e).map(h));if(u.some((f)=>p.has(f)))I(i,"alias",t.trim())}let a=o.split(" ").filter(Boolean),c=h(te(e).join(" "));if(a.length>0&&a.every((u)=>c.includes(u)))I(i,"token",t.trim());if(i.length===0&&o.length>=4){let u;for(let p of te(e)){let f=h(p);if(f.length<4)continue;let m=ct(o,f,2);if(m<=2&&(!u||m<u.distance||m===u.distance&&R(p,u.value)<0))u={value:p,distance:m}}if(u)I(i,"fuzzy",u.value,ne.fuzzy-u.distance)}return i.sort((u,p)=>{if(u.score!==p.score)return p.score-u.score;return(he.get(u.code)??99)-(he.get(p.code)??99)||R(u.value,p.value)})}function Re(e,t,o){if(t.has(o))return[o];let i=h(o),n=e.aliases[i];if(n?.length)return[...n];let s=new Set;for(let r of X(i))for(let a of e.aliases[r]??[])s.add(a);return[...s].sort(R)}function ke(e,t){return new k("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function Ie(e){let t=new Map(e.resources.map((i)=>[i.id,i]));function o(i){let n=i.trim(),s=Re(e,t,n);if(s.length===0)throw new k("resource-not-found",n);if(s.length>1)throw ke(n,s);let r=s[0],a=r?t.get(r):void 0;if(!a)throw new k("resource-not-found",n);return a}return Object.freeze({manifest:()=>e,search(i){let n=i.text?.trim()??"";if(!n&&!at(i))throw new k("resource-query-empty","text or filter is required");if(i.limit!==void 0&&(!Number.isInteger(i.limit)||i.limit<=0))throw new k("resource-query-invalid-limit",String(i.limit));let s=e.resources.filter((r)=>st(r,i)).filter((r)=>!n||xe(r,n).length>0).map((r)=>{let a=n?xe(r,n):[];for(let[c,u]of[[i.functions,"function"],[i.scenarios,"scenario"],[i.units,"unit"],[i.industries,"industry"]])if(c?.length)I(a,u,c.join(","));return{resource:r,score:a.reduce((c,u)=>c+u.score,0),reasons:a}}).filter((r)=>!n||r.reasons.length>0).sort((r,a)=>a.score-r.score||R(r.resource.id,a.resource.id));return i.limit===void 0?s:s.slice(0,i.limit)},get:o,build(i){if(i.length===0||i.every((m)=>!m.trim()))throw new k("resource-query-empty","at least one build root is required");let n=[],s=new Set;for(let m of i){let l=m.trim(),d=Re(e,t,l);if(d.length===0)n.push({id:l,reason:"missing-resource"});else if(d.length>1)throw ke(l,d);else{let g=d[0];if(g)s.add(g)}}let r=new Set,a=new Set,c=new Set,u=[],p=[],f=(m,l)=>{if(r.has(m))return;if(a.has(m)){n.push({id:m,...l?{requiredBy:l}:{},reason:"dependency-cycle"});return}let d=t.get(m);if(!d){n.push({id:m,...l?{requiredBy:l}:{},reason:"missing-resource"});return}a.add(m),c.add(m);let g=[...d.dependencies].sort((y,b)=>{let F=t.get(y),we=t.get(b);return(be.get(F?.kind??"")??99)-(be.get(we?.kind??"")??99)||R(y,b)});for(let y of g)p.push({from:m,to:y,relation:"depends-on"}),f(y,m);a.delete(m),r.add(m),u.push(m)};for(let m of[...s].sort(R))f(m);return{roots:[...s].sort(R),nodes:[...c].sort(R).map((m)=>{let l=t.get(m);if(!l)throw new k("resource-not-found",m);return{id:m,kind:l.kind,maturity:l.receipt.maturity}}),edges:p.sort((m,l)=>R(m.from,l.from)||R(m.to,l.to)),order:u,gaps:n.sort((m,l)=>R(m.id,l.id)||R(m.requiredBy??"",l.requiredBy??"")||R(m.reason,l.reason))}}})}function lt(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");gt(e);let t=e;if(t.schemaVersion!=="uibot.public-resources.v1"||typeof t.release?.version!=="string"||!/^[a-f0-9]{64}$/.test(t.release?.sourceHash)||t.index?.schemaVersion!=="uibot.resource.index.v1"||!Array.isArray(t.index.resources)||!t.index.aliases||!t.showcases)throw Error("invalid-public-resource-bundle");if(t.documents&&(!Array.isArray(t.documents)||t.documents.some((n)=>typeof n.title!=="string"||typeof n.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(n.path))))throw Error("invalid-public-documentation");let o=new Set,i=new Set;for(let n of t.index.resources){if(!n||typeof n.id!=="string"||o.has(n.id)||!se.includes(n.kind)||!n.id.startsWith(`${n.kind}:`)||typeof n.description!=="string"||typeof n.title!=="string"||!Array.isArray(n.dependencies)||!n.source||!n.receipt||!Array.isArray(n.aliases)||!Array.isArray(n.tags)||!Array.isArray(n.capabilities)||![n.aliases,n.dependencies,n.tags,n.capabilities].every((r)=>r.every((a)=>typeof a==="string"&&a.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(n.source.type)||typeof n.source.id!=="string"||n.source.sourceHash!==void 0&&!/^[a-f0-9]{64}$/.test(n.source.sourceHash)||n.source.packageName!==void 0&&(typeof n.source.packageName!=="string"||!n.source.packageName.startsWith("@uibot/"))||!z.includes(n.receipt.maturity)||!ae.includes(n.receipt.level)||!Array.isArray(n.receipt.evidence)||!n.receipt.evidence.every((r)=>typeof r==="string")||!N.every((r)=>q.includes(n.receipt.checks?.[r])))throw Error("invalid-public-resource");if(o.add(n.id),n.solution){let r=n.solution;if(![r.functions,r.scenarios,r.industries,r.hostRequirements,r.limitations].every((a)=>Array.isArray(a)&&a.every((c)=>typeof c==="string"&&c.length>0&&c.length<=2000))||!["page","flow","industry"].includes(r.unit)||!["interactive-demo","needs-enhancement"].includes(r.readiness)||r.members!==void 0&&(!Array.isArray(r.members)||r.members.some((a)=>typeof a.resourceId!=="string"||typeof a.version!=="string"||!a.version||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))))throw Error("invalid-resource-solution")}let s=t.showcases[n.id];if(!s||s.resourceId!==n.id||typeof s.docs?.zh!=="string"||typeof s.docs?.en!=="string"||!Array.isArray(s.examples)||!Array.isArray(s.distributions))throw Error("invalid-resource-showcase");if(s.collection!==void 0){let r=s.collection;if(!r||typeof r.id!=="string"||!/^[a-z0-9-]+$/.test(r.id)||typeof r.group?.id!=="string"||!/^[a-z0-9-]+$/.test(r.group.id)||[r.title,r.group.title].some((a)=>!a||[a.zh,a.en].some((c)=>typeof c!=="string"||!c.trim()||c.length>200)))throw Error("invalid-resource-collection")}if(s.agentKit!==void 0){let r=s.agentKit;if(i.has(n.source?.id))throw Error("invalid-resource-agent-kit");if(i.add(n.source?.id),!r||!["skill","prompt","recipe"].includes(r.type)||(r.type==="skill"?n.kind!=="skill":n.kind!=="example")||!/^[a-z][a-z0-9-]*$/.test(n.source.id)||r.fileName!=={skill:"SKILL.md",prompt:"PROMPT.md",recipe:"RECIPE.md"}[r.type]||[r.summary?.zh,r.summary?.en].some((a)=>typeof a!=="string"||!a.trim())||!Array.isArray(r.resources)||new Set(r.resources.map((a)=>a?.id)).size!==r.resources.length||r.resources.some((a)=>!a||!n.dependencies.includes(a.id)||!t.index.resources.some((c)=>c.id===a.id&&(c.source.version??null)===a.version)||a.version!==null&&(typeof a.version!=="string"||!a.version)||typeof a.contentHash!=="string"||!/^[a-f0-9]{64}$/.test(a.contentHash)||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))||r.resources.length!==n.dependencies.length)throw Error("invalid-resource-agent-kit")}if(s.solutionControls!==void 0){let r=new Set;if(!Array.isArray(s.solutionControls)||s.solutionControls.some((a)=>{if(!a||typeof a.id!=="string"||r.has(a.id)||typeof a.label?.zh!=="string"||typeof a.label?.en!=="string"||!Array.isArray(a.values)||!a.values.length||a.values.some((c)=>!["string","boolean","number"].includes(typeof c)||typeof c==="number"&&!Number.isFinite(c))||typeof a.target?.pageId!=="string"||typeof a.target?.property!=="string"||["__proto__","prototype","constructor"].includes(a.target.property)||a.target.blockId!==void 0&&typeof a.target.blockId!=="string")return!0;return r.add(a.id),!1}))throw Error("invalid-solution-controls")}if(s.templateContract&&(s.templateContract.name!==n.source.id||typeof s.templateContract.description!=="string"||!["L3","L4","L5"].includes(s.templateContract.level)||!["feature","template","page","app"].includes(s.templateContract.category)||!Array.isArray(s.templateContract.keywords)))throw Error("invalid-public-template-contract");if(typeof s.title?.zh!=="string"||typeof s.title?.en!=="string"||s.examples.some((r)=>!r||typeof r.id!=="string"||typeof r.title!=="string"||typeof r.code!=="string"||!["spec","tsx","source"].includes(r.mode)||!["tsx","json","yaml","css","ts"].includes(r.language)||!Array.isArray(r.dependencies)||!r.dependencies.every((a)=>typeof a==="string"))||s.distributions.some((r)=>!r||!["spec","npm","shadcn"].includes(r.channel)||typeof r.name!=="string"||!/^[@a-zA-Z0-9._/-]+$/.test(r.name)||typeof r.version!=="string"||!["source","published"].includes(r.availability)))throw Error("invalid-resource-content")}for(let[n,s]of Object.entries(t.index.aliases))if(!n||!Array.isArray(s)||s.some((r)=>!o.has(r)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((n)=>!o.has(n)))throw Error("unexpected-public-resource-showcase");for(let n of t.index.resources)for(let s of n.dependencies)if(!o.has(s))throw Error("invalid-public-resource-dependency");if(t.distributionSnapshot){let n=t.distributionSnapshot;if(!/^[a-f0-9]{64}$/.test(n.snapshotId)||n.manifestPath!==`../snapshots/${n.snapshotId}/snapshot.json`||!n.resources||!n.unavailable||!n.external||Object.entries(n.external).some(([s,r])=>!Object.hasOwn(n.unavailable,s)||!Array.isArray(r)||r.some((a)=>typeof a!=="string"||a.startsWith("@uibot/"))))throw Error("invalid-distribution-snapshot-reference");for(let[s,r]of Object.entries(n.resources))if(!o.has(s)||r.version!==(t.index.resources.find((a)=>a.id===s)?.source.version??t.release.version)||!/^[a-f0-9]{64}$/.test(r.resourceHash)||!Array.isArray(r.entrypoints)||!r.entrypoints.length||!Array.isArray(r.closure)||![...r.entrypoints,...r.closure].every((a)=>/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(a))||r.entrypoints.some((a)=>!r.closure.includes(a)))throw Error("invalid-distribution-snapshot-resource")}}function lo(e){lt(e),e=JSON.parse(JSON.stringify(e));let t=(n)=>{if(n&&typeof n==="object"){for(let s of Object.values(n))t(s);Object.freeze(n)}};t(e);let o=Ie(e.index),i=(n)=>{let s=o.get(n),r=e.showcases[s.id];if(!r)throw new k("resource-not-found",s.id);return r};return Object.freeze({...o,get(n){let s=o.get(n),r=i(n).agentKit;return r?Object.freeze({...s,agentKit:r}):s},docs(n,s="zh",r=1){if(s!=="zh"&&s!=="en")throw Error("unsupported-resource-locale");let a=i(n);return{resourceId:a.resourceId,locale:s,...ut(a.docs[s],r),release:e.release}},examples(n,s=1){let r=i(n);return{resourceId:r.resourceId,...pt(r.examples,s),release:e.release}},installPlan(n){let s=i(n);return{resourceId:s.resourceId,distributions:s.distributions,dependencies:o.build([s.resourceId]),release:e.release,snapshot:e.distributionSnapshot&&Object.hasOwn(e.distributionSnapshot.resources,s.resourceId)?{snapshotId:e.distributionSnapshot.snapshotId,manifestPath:e.distributionSnapshot.manifestPath,...e.distributionSnapshot.resources[s.resourceId]}:null,snapshotUnavailable:e.distributionSnapshot?.unavailable[s.resourceId]??null,install:s.distributions.map((r)=>dt(r,e.distributionSnapshot,s.resourceId))}}})}function dt(e,t,o){let{channel:i,name:n,version:s}=e;if(i==="npm")return{channel:i,name:n,command:`add ${n}@${s}`,note:null};if(i==="spec")return{channel:i,name:n,command:null,note:"Read the Spec through examples and compile it strictly with the matching Catalog."};let r=!!t&&Object.hasOwn(t.resources,o),a=t?.external[o]??[];return{channel:i,name:n,command:`shadcn add @uibot/${n}`,registries:{"@uibot":"/r/{name}.json"},externalRegistryDependencies:a,note:r?"A hash-pinned snapshot exists: export and verify it, then map @uibot to the local snapshot server.":a.length?`No hash-pinned snapshot: the install also pulls stock shadcn items (${a.join(", ")}) from the host's default registry. Installing through the portal mapping still works; report the files as not snapshot-verified.`:"No hash-pinned snapshot; report the files as not snapshot-verified."}}var A=24000;function Se(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new k("resource-query-invalid-limit","page is outside the available range")}function ut(e,t){let o=Math.max(1,Math.ceil(e.length/A));return Se(t,o),{markdown:e.slice((t-1)*A,t*A),page:t,totalPages:o,...t<o?{nextPage:t+1}:{}}}function pt(e,t){let o=e.flatMap((i)=>Array.from({length:Math.max(1,Math.ceil(i.code.length/A))},(n,s)=>({...i,code:i.code.slice(s*A,(s+1)*A),codeOffset:s*A,codeLength:i.code.length,complete:i.code.length<=A})));return Se(t,o.length),{examples:o.slice(t-1,t),page:t,totalPages:o.length,...t<o.length?{nextPage:t+1}:{}}}function gt(e){let t=0,o=0,i=new Set,n=(s,r)=>{if(++t>300000||r>64)throw Error("public-resource-budget-exceeded");if(typeof s==="string"){if(o+=new TextEncoder().encode(s).length,o>16777216)throw Error("public-resource-budget-exceeded")}else if(s&&typeof s==="object"){if(i.has(s))throw Error("invalid-public-resource-cycle");let a=Object.getPrototypeOf(s);if(!Array.isArray(s)&&a!==Object.prototype&&a!==null)throw Error("invalid-public-resource-object");i.add(s);for(let[c,u]of Object.entries(s))n(c,r+1),n(u,r+1);i.delete(s)}else if(s!==null&&typeof s!=="boolean"&&(typeof s!=="number"||!Number.isFinite(s)))throw Error("invalid-public-resource-json")};n(e,1)}var mt=(e)=>e.length>0&&!["__proto__","constructor","prototype"].includes(e);function j(e){return e.flatMap((t)=>[t,...j(t.children??[]),...Object.values(t.slots??{}).flatMap(j)])}function G(e,t,o){let i=structuredClone(e);for(let[n,s]of Object.entries(o)){let r=t.find((c)=>c.id===n);if(!r?.values.includes(s)||!mt(r.target.property))throw Error(`invalid-solution-control:${n}`);let a=i.pages?.find((c)=>c.id===r.target.pageId);if(!a)throw Error(`solution-page-missing:${n}`);if(r.target.blockId){let c=j(a.blocks).filter((p)=>p.id===r.target.blockId),u=c[0];if(c.length!==1||!u)throw Error(`solution-block-missing:${n}`);u.props={...u.props,[r.target.property]:s}}else a.state={...a.state,[r.target.property]:s}}return i}function V(e,t,o={}){let i=new Set((e.pages??[]).map((a)=>a.id)),n=new Set((e.pages??[]).map((a)=>a.path)),s=new Set((e.pages??[]).flatMap((a)=>j(a.blocks).flatMap((c)=>c.id?[c.id]:[])));for(let a of t.pages??[]){if(i.has(a.id)||n.has(a.path))throw Error(`solution-page-conflict:${a.id}:${a.path}`);i.add(a.id),n.add(a.path);for(let c of j(a.blocks))if(c.id){if(s.has(c.id))throw Error(`solution-block-conflict:${c.id}`);s.add(c.id)}}if(t.connections||t.auth||t.layout)throw Error("solution-global-config-conflict");if(o.addNavigation){let a=new Set((e.menus?.items??[]).map((c)=>c.key));for(let c of t.pages)if(a.has(`solution:${c.id}`))throw Error(`solution-navigation-conflict:${c.id}`)}let r=o.addNavigation?{...structuredClone(e.menus),items:[...structuredClone(e.menus?.items??[]),...t.pages.map((a)=>({key:`solution:${a.id}`,label:a.title??a.id,path:a.path}))]}:e.menus;return{...structuredClone(e),...r?{menus:structuredClone(r)}:{},pages:[...structuredClone(e.pages??[]),...structuredClone(t.pages??[])]}}function w(e){if(Array.isArray(e))return`[${e.map(w).join(",")}]`;if(e&&typeof e==="object")return`{${Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[o])=>t<o?-1:t>o?1:0).map(([t,o])=>`${JSON.stringify(t)}:${w(o)}`).join(",")}}`;return JSON.stringify(e)??"null"}var Y=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e);function Pe(e){if(!Y(e.resourceId)||!Y(e.version)||!/^[a-f0-9]{64}$/.test(e.sourceHash))throw Error("invalid-solution-identity")}function re(e,t,o,i=e.id){let n=structuredClone(e);if(n.id=i,n.path=o.paths[e.path]??e.path,!Y(n.id)||typeof n.path!=="string"||!n.path.startsWith("/"))throw Error("invalid-solution-page-target");if(o.frame)n.blocks=n.blocks.map((r)=>r.type==="PageLayout"?{...r,props:{...r.props,...structuredClone(o.frame?.props)},slots:{...r.slots,...structuredClone(o.frame?.slots)},events:{...r.events,...structuredClone(o.frame?.events)}}:r);let s=(r)=>{if(!r||typeof r!=="object")return;for(let[a,c]of Object.entries(r))if(typeof c==="string"){if(a==="connectionId"&&o.connections[c])r[a]=o.connections[c];else if(["href","path","url","redirect","currentPath"].includes(a)&&o.paths[c])r[a]=o.paths[c]}else s(c)};if(s(n),o.layout==="source"&&t.layout&&n.blocks.some((r)=>r.type==="PageLayout"))n.layout={...structuredClone(t.layout),...n.layout,inherit:!1};return n}function Q(e,t,o){let i=structuredClone(e.connections??[]);for(let n of t.connections??[]){let s=o[n.id];if(!s||!Y(s))throw Error(`solution-connection-binding-required:${n.id}`);let r=i.find((a)=>a.id===s);if(r&&r.type!==n.type)throw Error(`solution-connection-type-conflict:${n.id}:${s}`);if(!r)i.push({id:s,type:n.type})}return i}function oe(e,t,o,i){let n=new Set([...e.pages,...o].map((c)=>c.path)),s=new Set(t.pages.map((c)=>i.paths[c.path]??c.path)),r=new Set(Q(e,t,i.connections).map((c)=>c.id)),a=(c)=>{if(!c||typeof c!=="object")return;for(let[u,p]of Object.entries(c))if(typeof p==="string"){if(u==="connectionId"&&!r.has(p))throw Error(`solution-connection-missing:${p}`);if(["href","url","redirect","path"].includes(u)&&s.has(p)&&!n.has(p))throw Error(`solution-route-dependency-missing:${p}`)}else a(p)};for(let c of o)a(c)}function fo(e,t,o){if(Pe(t.identity),v(e),t.spec.auth)throw Error("solution-host-auth-required");let i=G(t.spec,t.controls??[],o.configuration??{}),n={paths:{...o.paths},connections:{...o.connections},layout:o.layout,...o.frame?{frame:structuredClone(o.frame)}:{}},s=Q(e,i,n.connections),r=o.selectedPageIds?i.pages.filter((p)=>o.selectedPageIds?.includes(p.id)):i.pages;if(!r.length||o.selectedPageIds&&r.length!==new Set(o.selectedPageIds).size)throw Error("solution-select-pages");let a=r.map((p)=>re(p,i,n,o.pageIds?.[p.id]??p.id));oe(e,t.spec,a,n);let c=V(e,{version:"2.0",pages:a},{addNavigation:o.addNavigation??!1}),u=r.map((p,f)=>({...t.identity,sourcePageId:p.id,targetPageId:a[f]?.id??p.id,baseline:structuredClone(a[f]),bindings:structuredClone(n),...o.configuration?{configuration:structuredClone(o.configuration)}:{}}));if(c.composition={...structuredClone(e.composition),schema:"uibot.solution-composition.v1",pages:[...structuredClone(e.composition?.pages??[]),...u]},s.length)c.connections=s;return{spec:c,pages:a.map((p)=>({id:p.id,path:p.path})),connections:s.filter((p)=>!e.connections?.some((f)=>f.id===p.id)),layout:o.layout}}function ft(e,t,o={}){Pe(t.identity),v(e);let i=[];for(let n of e.composition?.pages??[]){if(n.resourceId!==t.identity.resourceId||n.detached)continue;let s=e.pages.find((c)=>c.id===n.targetPageId),r=t.spec.pages.find((c)=>c.id===n.sourcePageId),a={pageId:n.targetPageId,path:s?.path??n.baseline.path,from:{resourceId:n.resourceId,version:n.version,sourceHash:n.sourceHash},to:t.identity};if(!s){i.push({...a,status:"deleted-locally"});continue}if(!r){i.push({...a,status:"removed"});continue}try{let c=G(t.spec,t.controls??[],n.configuration??{}),u={...n.bindings,connections:{...n.bindings.connections,...o}};if(Q(e,c,u.connections),c.auth)throw Error("solution-host-auth-required");let p=re(c.pages.find((d)=>d.id===r.id),c,u,s.id),f=e.pages.flatMap((d)=>{if(d.id===s.id)return[];let g=e.composition?.pages.find((b)=>b.resourceId===t.identity.resourceId&&b.targetPageId===d.id&&!b.detached),y=c.pages.find((b)=>b.id===g?.sourcePageId);return g&&y?[{...d,path:g.bindings.paths[y.path]??y.path}]:[d]});oe({...e,pages:f},c,[p],u);let m=w(s)!==w(n.baseline),l=w(p)!==w(n.baseline);i.push({...a,nextPath:p.path,incoming:p,status:m?l?"conflict":"customized":l?"update":"unchanged"})}catch(c){i.push({...a,status:"blocked",error:String(c)})}}return{pages:i,tracked:i.length>0}}function yo(e,t,o,i={}){let n=ft(e,t,i),s=structuredClone(e);if(n.pages.some((r)=>["conflict","removed","deleted-locally"].includes(r.status)&&!o[r.pageId]))throw Error("solution-upgrade-unresolved");for(let[r,a]of Object.entries(o)){let c=n.pages.find((d)=>d.pageId===r),u=s.composition?.pages.find((d)=>d.targetPageId===r);if(!c||!u)throw Error(`solution-untracked-page:${r}`);if(c.status==="blocked")throw Error(`solution-upgrade-blocked:${r}`);if(a==="detach"){u.detached=!0;continue}if(["removed","deleted-locally"].includes(c.status))throw Error(`solution-upgrade-detach-required:${r}`);if(a==="update"&&["conflict","customized"].includes(c.status))throw Error(`solution-upgrade-conflict:${r}`);if(!["update","replace","keep"].includes(a))throw Error("invalid-solution-upgrade-decision");let p=G(t.spec,t.controls??[],u.configuration??{});u.bindings.connections={...u.bindings.connections,...i};let f=p.pages.find((d)=>d.id===u.sourcePageId);if(!f)throw Error(`solution-page-missing:${r}`);let m=re(f,p,u.bindings,r);if(a!=="keep"){let d=s.pages.find((g)=>g.id===r)?.path;if(s.pages=s.pages.map((g)=>g.id===r?m:g),d&&d!==m.path){let g=(y)=>{if(!y||typeof y!=="object")return;for(let[b,F]of Object.entries(y))if(["path","href"].includes(b)&&F===d)y[b]=m.path;else if(typeof F==="object")g(F)};g(s.menus);for(let y of s.pages)for(let b of y.blocks)if(b.type==="PageLayout")g(b.props?.routes),g(b.slots?.sidebar)}}u.baseline=structuredClone(m),Object.assign(u,t.identity);let l=Q(s,p,u.bindings.connections);if(l.length)s.connections=l}V({version:"2.0",pages:[]},{version:"2.0",pages:s.pages});for(let[r,a]of Object.entries(o))if(a!=="detach"){let c=s.composition?.pages.find((p)=>p.targetPageId===r),u=s.pages.find((p)=>p.id===r);if(c&&u)oe(s,{...t.spec,pages:[...t.spec.pages,...e.pages]},s.pages,c.bindings)}return s}function U(e){return e.flatMap((t)=>[t,...U(t.children??[]),...Object.values(t.slots??{}).flatMap(U)])}function ie(e,t){let o=U([e]).filter((i)=>i.id===t);if(o.length!==1||!o[0]||o[0].type!=="Box"||o[0].template||o[0].slots||o[0].events||o[0].visible!==void 0)throw Error("solution-region-slot-invalid");return o[0]}function ko(e,t,o){if(v(e),!t.identity.resourceId||!t.identity.version||!/^[a-f0-9]{64}$/.test(t.identity.sourceHash))throw Error("invalid-solution-identity");let i=Object.entries(o);if(!i.length||i.some(([s,r])=>!s||!r)||new Set(i.map(([,s])=>s)).size!==i.length)throw Error("solution-region-explicit-mapping-required");let n=structuredClone(e);for(let[s,r]of i){let a=n.pages.find((d)=>d.id===r);if(!a||U(a.blocks).some((d)=>d.type==="PageLayout"))throw Error(`solution-region-independent-page-required:${r}`);let c=a.blocks,u=n.composition?.regions?.find((d)=>d.targetPageId===r);if(u){if(a.blocks.length!==1||!a.blocks[0])throw Error("solution-region-frame-customized");let d=structuredClone(a.blocks[0]),g=ie(d,u.contentBlockId);if(c=g.children??[],g.children=[],w(d)!==w(u.baseline))throw Error("solution-region-frame-customized")}let p=structuredClone(t.frame);if(ie(p,t.contentBlockId).children?.length)throw Error("solution-region-slot-not-empty");for(let d of U([p]))if(d.id)d.id=`${r}-${d.id}`;let f=`${r}-${t.contentBlockId}`,m=structuredClone(p);ie(p,f).children=structuredClone(c),a.blocks=[p];let l={...t.identity,targetPageId:r,role:s,target:"page-frame",contentBlockId:f,baseline:m};n.composition??={schema:"uibot.solution-composition.v1",pages:[]},n.composition.regions=[...(n.composition.regions??[]).filter((d)=>d.targetPageId!==r),l]}return V({version:"2.0",pages:[]},{version:"2.0",pages:n.pages}),v(n),n}export{Qr as RESOURCE_INDEX_ERROR_CODES,Ye as RESOURCE_INDEX_SCHEMA_VERSION,oo as RESOURCE_QUERY_ERROR_CODES,De as RESOURCE_QUERY_OPERATION_MANIFEST,ne as RESOURCE_QUERY_SCORE_WEIGHTS,_ as ResourceIndexError,k as ResourceQueryError,V as appendSolutionPages,yo as applySolutionUpgrade,lt as assertPublicResourceBundle,v as assertSolutionComposition,Jr as buildExamplesFromL4Templates,Zr as buildResourceIndex,fo as composeSolutionSpec,G as configureSolutionSpec,lo as createPublicResourceQueryService,Ie as createResourceQueryService,h as normalizeResourceAlias,ft as planSolutionUpgrade,ko as replaceSolutionPageFrames,w as solutionContentKey,P as toResourceId};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-apps",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Integration settings: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/field",
|
|
9
|
+
"@uibot/form",
|
|
10
|
+
"@uibot/layout",
|
|
11
|
+
"@uibot/workspace"
|
|
12
|
+
],
|
|
13
|
+
"files": [
|
|
14
|
+
{
|
|
15
|
+
"path": "lib/uibot/templates/admin-apps.uibot.yaml",
|
|
16
|
+
"target": "lib/uibot/templates/admin-apps.uibot.yaml",
|
|
17
|
+
"content": "version: \"2.0\"\nlayout:\n navigation: sidebar\n container: fluid\n navigationStyle: attached\n offcanvas: attached\n sidebar: expanded\npages:\n - id: apps\n path: /apps\n title: Apps\n state:\n direction: ltr\n font: Inter\n submitted: false\n theme: light\n currentPath: /apps\n integrationSettings: []\n editorOpen: false\n draft: {}\n saving: false\n uiError: null\n blocks:\n - type: PageLayout\n children:\n - type: Box\n props:\n className: \"!flex-row items-start justify-between gap-4 mb-6\"\n children:\n - type: Box\n props:\n gap: xs\n children:\n - type: Heading\n props:\n level: 1\n text: App Integrations\n - type: Paragraph\n props:\n text: Here’s a list of your apps for the integration!\n muted: true\n size: sm\n - type: IntegrationGrid\n props:\n items:\n - id: telegram\n brand: telegram\n name: Telegram\n description: Connect with Telegram for real-time communication.\n icon: boxes\n available: false\n connected: false\n - id: notion\n brand: notion\n name: Notion\n description: Sync Notion pages for collaboration.\n icon: boxes\n available: false\n connected: false\n - id: figma\n brand: figma\n name: Figma\n description: View and collaborate on Figma designs in one place.\n icon: boxes\n available: false\n connected: false\n - id: trello\n brand: trello\n name: Trello\n description: Sync Trello cards for project management.\n icon: boxes\n available: false\n connected: false\n - id: slack\n brand: slack\n name: Slack\n description: Integrate Slack for team communication.\n icon: boxes\n available: false\n connected: false\n - id: zoom\n brand: zoom\n name: Zoom\n description: Host Zoom meetings from your dashboard.\n icon: boxes\n available: false\n connected: false\n - id: stripe\n brand: stripe\n name: Stripe\n description: Manage Stripe transactions and payments.\n icon: boxes\n available: false\n connected: false\n - id: gmail\n brand: gmail\n name: Gmail\n description: Access and manage Gmail messages.\n icon: boxes\n available: false\n connected: false\n - id: medium\n brand: medium\n name: Medium\n description: Explore and share Medium stories.\n icon: boxes\n available: false\n connected: false\n - id: skype\n brand: skype\n name: Skype\n description: Connect with Skype contacts.\n icon: boxes\n available: false\n connected: false\n - id: docker\n brand: docker\n name: Docker\n description: Manage Docker containers.\n icon: boxes\n available: false\n connected: false\n - id: github\n brand: github\n name: GitHub\n description: Connect your repositories and issues.\n icon: boxes\n available: false\n connected: false\n - id: gitlab\n brand: gitlab\n name: GitLab\n description: Coordinate projects with GitLab.\n icon: boxes\n available: false\n connected: false\n - id: discord\n brand: discord\n name: Discord\n description: Connect with your Discord community.\n icon: boxes\n available: false\n connected: false\n - id: whatsapp\n brand: whatsapp\n name: WhatsApp\n description: Keep in touch with your contacts.\n icon: boxes\n available: false\n connected: false\n configurable: true\n configurations:\n _state: integrationSettings\n pending:\n _state: saving\n error:\n _state: uiError.message\n events:\n onConfigure:\n - action: SetState\n params:\n path: draft\n value:\n _event: values\n - action: SetState\n params:\n path: uiError\n value: null\n - action: SetState\n params:\n path: editorOpen\n value: true\n - type: Drawer\n props:\n title: Integration preferences\n description: Save workspace configuration. External provider authorization\n remains unavailable.\n open:\n _state: editorOpen\n pending:\n _state: saving\n events:\n onClose:\n - action: SetState\n params:\n path: editorOpen\n value: false\n children:\n - type: Form\n props:\n label: Integration preferences\n pending:\n _state: saving\n idempotent: true\n children:\n - type: Field\n props:\n name: enabled\n label: Enable in workspace\n kind: switch\n value:\n _bindState: draft.enabled\n - type: Field\n props:\n name: label\n label: Display label\n kind: text\n value:\n _bindState: draft.label\n - type: Field\n props:\n name: channel\n label: Channel\n kind: text\n value:\n _bindState: draft.channel\n - type: Paragraph\n props:\n text:\n _state: uiError.message\n visible:\n _state: uiError\n - type: Form.Submit\n props:\n label: Save preferences\n disabled:\n _state: saving\n events:\n onSubmit:\n - action: SetState\n params:\n path: submitted\n value:\n _event: values\n - action: Request\n params:\n connectionId: integrations-db\n request:\n id: save-integration\n connectionId: integrations-db\n payload:\n operation:\n _if:\n - _state: draft.id\n - UpdateOne\n - InsertOne\n filter:\n id:\n _state: draft.id\n expectedVersion:\n _state: draft.version\n idempotencyKey:\n _event: value\n data:\n provider:\n _state: draft.provider\n enabled:\n _state: submitted.enabled\n config:\n label:\n _state: submitted.label\n channel:\n _state: submitted.channel\n loadingPath: saving\n errorPath: uiError\n onSuccess:\n - action: Request\n params:\n connectionId: integrations-db\n request:\n id: load-integrations\n connectionId: integrations-db\n payload:\n operation: FindAll\n responsePath: integrationSettings\n loadingPath: loading\n errorPath: uiError\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\n - action: SetState\n params:\n path: editorOpen\n value: false\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\n events:\n onThemeChange:\n - action: SetState\n params:\n path: theme\n value:\n _event: value\n props:\n headerLinks:\n - label: Apps\n href: /apps\n appearance: admin\n routes:\n - label: Apps\n href: /apps\n theme:\n _state: theme\n direction:\n _state: direction\n font:\n _state: font\n lifecycle:\n onMount:\n - action: Request\n params:\n connectionId: integrations-db\n request:\n id: load-integrations\n connectionId: integrations-db\n payload:\n operation: FindAll\n responsePath: integrationSettings\n loadingPath: loading\n errorPath: uiError\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\nconnections:\n - id: integrations-db\n type: NowAPI.Collection\n",
|
|
18
|
+
"type": "registry:lib"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "lib/uibot/templates/admin-apps.uibot.json",
|
|
22
|
+
"target": "lib/uibot/templates/admin-apps.uibot.json",
|
|
23
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-apps\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-apps.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-apps\",\n \"description\": \"Integration settings: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-apps\",\n \"集成目录与配置\",\n \"Integration settings\",\n \"settings\",\n \"integrations\"\n ],\n \"composedFrom\": [\n \"PageLayout\",\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"IntegrationGrid\",\n \"Drawer\",\n \"Form\",\n \"Field\",\n \"Form.Submit\"\n ]\n }\n }\n}\n",
|
|
24
|
+
"type": "registry:lib"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"meta": {
|
|
28
|
+
"uibot": {
|
|
29
|
+
"schema": "uibot.registry.item.v1",
|
|
30
|
+
"item": "admin-apps",
|
|
31
|
+
"channel": "public",
|
|
32
|
+
"template": {
|
|
33
|
+
"file": "admin-apps.uibot.yaml",
|
|
34
|
+
"contract": {
|
|
35
|
+
"name": "admin-apps",
|
|
36
|
+
"description": "Integration settings: shared UiBot Admin page source.",
|
|
37
|
+
"level": "L4",
|
|
38
|
+
"category": "page",
|
|
39
|
+
"keywords": [
|
|
40
|
+
"admin-apps",
|
|
41
|
+
"集成目录与配置",
|
|
42
|
+
"Integration settings",
|
|
43
|
+
"settings",
|
|
44
|
+
"integrations"
|
|
45
|
+
],
|
|
46
|
+
"composedFrom": [
|
|
47
|
+
"PageLayout",
|
|
48
|
+
"Box",
|
|
49
|
+
"Heading",
|
|
50
|
+
"Paragraph",
|
|
51
|
+
"IntegrationGrid",
|
|
52
|
+
"Drawer",
|
|
53
|
+
"Form",
|
|
54
|
+
"Field",
|
|
55
|
+
"Form.Submit"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-chats",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Team conversations: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/layout",
|
|
9
|
+
"@uibot/workspace"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/uibot/templates/admin-chats.uibot.yaml",
|
|
14
|
+
"target": "lib/uibot/templates/admin-chats.uibot.yaml",
|
|
15
|
+
"content": "version: \"2.0\"\nlayout:\n navigation: sidebar\n container: fluid\n navigationStyle: attached\n offcanvas: attached\n sidebar: expanded\npages:\n - id: chats\n path: /chats\n title: Chats\n state:\n currentUserId: user-demo\n direction: ltr\n font: Inter\n messageSubmission: null\n theme: light\n currentPath: /chats\n conversations:\n - id: conversation-0\n name: Alex Johnson\n initials: AJ\n preview: Hey, how’s it going?\n - id: conversation-1\n name: Sarah Wilson\n initials: SW\n preview: Did you see the new design?\n - id: conversation-2\n name: Michael Brown\n initials: MB\n preview: Thanks for your help!\n - id: conversation-3\n name: Emily Davis\n initials: ED\n preview: Let’s catch up tomorrow.\n - id: conversation-4\n name: David Miller\n initials: DM\n preview: The update looks great.\n - id: conversation-5\n name: Jessica Garcia\n initials: JG\n preview: Can you review my pull request?\n messages:\n - id: m1\n conversationId: conversation-0\n text: Hey, how’s it going?\n time: 10:30 AM\n own: false\n - id: m2\n conversationId: conversation-0\n text: Pretty good! Working on the dashboard.\n time: 10:31 AM\n own: true\n draft: \"\"\n selectedId: \"\"\n sending: false\n uiError: null\n blocks:\n - type: PageLayout\n children:\n - type: ChatPanel\n props:\n conversations:\n _state: conversations\n messages:\n _state: messages\n selectedId:\n _state: selectedId\n draft:\n _state: draft\n pending:\n _state: sending\n error:\n _state: uiError.message\n canSend: true\n currentUserId:\n _state: currentUserId\n events:\n onSelect:\n - action: SetState\n params:\n path: selectedId\n value:\n _event: value\n onDraftChange:\n - action: SetState\n params:\n path: draft\n value:\n _event: value\n onSend:\n - action: SetState\n params:\n path: messageSubmission\n value:\n _event: values\n - action: Request\n params:\n connectionId: messages-db\n request:\n id: send-message\n connectionId: messages-db\n payload:\n operation: InsertOne\n data:\n conversationId:\n _state: messageSubmission.conversationId\n text:\n _state: messageSubmission.text\n idempotencyKey:\n _state: messageSubmission.requestId\n loadingPath: sending\n errorPath: uiError\n onSuccess:\n - action: Request\n params:\n connectionId: messages-db\n request:\n id: load-messages\n connectionId: messages-db\n payload:\n operation: FindAll\n responsePath: messages\n errorPath: uiError\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\n - action: SetState\n params:\n path: draft\n value: \"\"\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\n - type: Paragraph\n props:\n text: Workspace messages are stored here. External delivery is not configured.\n muted: true\n size: sm\n events:\n onThemeChange:\n - action: SetState\n params:\n path: theme\n value:\n _event: value\n props:\n headerLinks:\n - label: Chats\n href: /chats\n appearance: admin\n routes:\n - label: Chats\n href: /chats\n theme:\n _state: theme\n direction:\n _state: direction\n font:\n _state: font\n lifecycle:\n onMount:\n - action: Request\n params:\n connectionId: conversations-db\n request:\n id: load-conversations\n connectionId: conversations-db\n payload:\n operation: FindAll\n responsePath: conversations\n errorPath: uiError\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\n - action: Request\n params:\n connectionId: messages-db\n request:\n id: load-messages\n connectionId: messages-db\n payload:\n operation: FindAll\n responsePath: messages\n errorPath: uiError\n onError:\n - action: SetState\n params:\n path: requestFailed\n value: true\nconnections:\n - id: conversations-db\n type: NowAPI.Collection\n - id: messages-db\n type: NowAPI.Collection\n",
|
|
16
|
+
"type": "registry:lib"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-chats.uibot.json",
|
|
20
|
+
"target": "lib/uibot/templates/admin-chats.uibot.json",
|
|
21
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-chats\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-chats.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-chats\",\n \"description\": \"Team conversations: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-chats\",\n \"团队会话与消息\",\n \"Team conversations\",\n \"collaboration\",\n \"chat\",\n \"conversations\"\n ],\n \"composedFrom\": [\n \"PageLayout\",\n \"ChatPanel\",\n \"Paragraph\"\n ]\n }\n }\n}\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"uibot": {
|
|
27
|
+
"schema": "uibot.registry.item.v1",
|
|
28
|
+
"item": "admin-chats",
|
|
29
|
+
"channel": "public",
|
|
30
|
+
"template": {
|
|
31
|
+
"file": "admin-chats.uibot.yaml",
|
|
32
|
+
"contract": {
|
|
33
|
+
"name": "admin-chats",
|
|
34
|
+
"description": "Team conversations: shared UiBot Admin page source.",
|
|
35
|
+
"level": "L4",
|
|
36
|
+
"category": "page",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"admin-chats",
|
|
39
|
+
"团队会话与消息",
|
|
40
|
+
"Team conversations",
|
|
41
|
+
"collaboration",
|
|
42
|
+
"chat",
|
|
43
|
+
"conversations"
|
|
44
|
+
],
|
|
45
|
+
"composedFrom": [
|
|
46
|
+
"PageLayout",
|
|
47
|
+
"ChatPanel",
|
|
48
|
+
"Paragraph"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-error-401",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Unauthorized: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/layout",
|
|
9
|
+
"@uibot/nav"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/uibot/templates/admin-error-401.uibot.yaml",
|
|
14
|
+
"target": "lib/uibot/templates/admin-error-401.uibot.yaml",
|
|
15
|
+
"content": "version: \"2.0\"\npages:\n - id: error-401\n path: /errors/401\n title: Unauthorized\n state:\n currentPath: /errors/401\n blocks:\n - type: Box\n props:\n className: min-h-dvh items-center justify-center px-6 text-center\n gap: lg\n children:\n - type: Heading\n props:\n level: 1\n text: \"401\"\n className: \"!text-[7rem] !leading-tight !font-bold\"\n - type: Heading\n props:\n level: 2\n text: Unauthorized\n - type: Paragraph\n props:\n text: Please log in with the appropriate credentials to access this resource.\n muted: true\n - type: Link\n props:\n label: Back to Home\n href: /\n variant: button\n",
|
|
16
|
+
"type": "registry:lib"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-error-401.uibot.json",
|
|
20
|
+
"target": "lib/uibot/templates/admin-error-401.uibot.json",
|
|
21
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-error-401\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-error-401.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-error-401\",\n \"description\": \"Unauthorized: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-error-401\",\n \"未登录提示\",\n \"Unauthorized\",\n \"system\",\n \"unauthorized\"\n ],\n \"composedFrom\": [\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Link\"\n ]\n }\n }\n}\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"uibot": {
|
|
27
|
+
"schema": "uibot.registry.item.v1",
|
|
28
|
+
"item": "admin-error-401",
|
|
29
|
+
"channel": "public",
|
|
30
|
+
"template": {
|
|
31
|
+
"file": "admin-error-401.uibot.yaml",
|
|
32
|
+
"contract": {
|
|
33
|
+
"name": "admin-error-401",
|
|
34
|
+
"description": "Unauthorized: shared UiBot Admin page source.",
|
|
35
|
+
"level": "L4",
|
|
36
|
+
"category": "page",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"admin-error-401",
|
|
39
|
+
"未登录提示",
|
|
40
|
+
"Unauthorized",
|
|
41
|
+
"system",
|
|
42
|
+
"unauthorized"
|
|
43
|
+
],
|
|
44
|
+
"composedFrom": [
|
|
45
|
+
"Box",
|
|
46
|
+
"Heading",
|
|
47
|
+
"Paragraph",
|
|
48
|
+
"Link"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-error-403",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Access forbidden: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/layout",
|
|
9
|
+
"@uibot/nav"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/uibot/templates/admin-error-403.uibot.yaml",
|
|
14
|
+
"target": "lib/uibot/templates/admin-error-403.uibot.yaml",
|
|
15
|
+
"content": "version: \"2.0\"\npages:\n - id: error-403\n path: /errors/403\n title: Access Forbidden\n state:\n currentPath: /errors/403\n blocks:\n - type: Box\n props:\n className: min-h-dvh items-center justify-center px-6 text-center\n gap: lg\n children:\n - type: Heading\n props:\n level: 1\n text: \"403\"\n className: \"!text-[7rem] !leading-tight !font-bold\"\n - type: Heading\n props:\n level: 2\n text: Access Forbidden\n - type: Paragraph\n props:\n text: You don’t have the necessary permission to view this page.\n muted: true\n - type: Link\n props:\n label: Back to Home\n href: /\n variant: button\n",
|
|
16
|
+
"type": "registry:lib"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-error-403.uibot.json",
|
|
20
|
+
"target": "lib/uibot/templates/admin-error-403.uibot.json",
|
|
21
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-error-403\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-error-403.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-error-403\",\n \"description\": \"Access forbidden: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-error-403\",\n \"无权限提示\",\n \"Access forbidden\",\n \"system\",\n \"forbidden\"\n ],\n \"composedFrom\": [\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Link\"\n ]\n }\n }\n}\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"uibot": {
|
|
27
|
+
"schema": "uibot.registry.item.v1",
|
|
28
|
+
"item": "admin-error-403",
|
|
29
|
+
"channel": "public",
|
|
30
|
+
"template": {
|
|
31
|
+
"file": "admin-error-403.uibot.yaml",
|
|
32
|
+
"contract": {
|
|
33
|
+
"name": "admin-error-403",
|
|
34
|
+
"description": "Access forbidden: shared UiBot Admin page source.",
|
|
35
|
+
"level": "L4",
|
|
36
|
+
"category": "page",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"admin-error-403",
|
|
39
|
+
"无权限提示",
|
|
40
|
+
"Access forbidden",
|
|
41
|
+
"system",
|
|
42
|
+
"forbidden"
|
|
43
|
+
],
|
|
44
|
+
"composedFrom": [
|
|
45
|
+
"Box",
|
|
46
|
+
"Heading",
|
|
47
|
+
"Paragraph",
|
|
48
|
+
"Link"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-error-404",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Page not found: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/layout",
|
|
9
|
+
"@uibot/nav"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/uibot/templates/admin-error-404.uibot.yaml",
|
|
14
|
+
"target": "lib/uibot/templates/admin-error-404.uibot.yaml",
|
|
15
|
+
"content": "version: \"2.0\"\npages:\n - id: error-404\n path: /errors/404\n title: Oops! Page Not Found!\n state:\n currentPath: /errors/404\n blocks:\n - type: Box\n props:\n className: min-h-dvh items-center justify-center px-6 text-center\n gap: lg\n children:\n - type: Heading\n props:\n level: 1\n text: \"404\"\n className: \"!text-[7rem] !leading-tight !font-bold\"\n - type: Heading\n props:\n level: 2\n text: Oops! Page Not Found!\n - type: Paragraph\n props:\n text: It seems like the page you’re looking for does not exist or might have\n been removed.\n muted: true\n - type: Link\n props:\n label: Back to Home\n href: /\n variant: button\n",
|
|
16
|
+
"type": "registry:lib"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-error-404.uibot.json",
|
|
20
|
+
"target": "lib/uibot/templates/admin-error-404.uibot.json",
|
|
21
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-error-404\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-error-404.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-error-404\",\n \"description\": \"Page not found: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-error-404\",\n \"页面不存在\",\n \"Page not found\",\n \"system\",\n \"not-found\"\n ],\n \"composedFrom\": [\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Link\"\n ]\n }\n }\n}\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"uibot": {
|
|
27
|
+
"schema": "uibot.registry.item.v1",
|
|
28
|
+
"item": "admin-error-404",
|
|
29
|
+
"channel": "public",
|
|
30
|
+
"template": {
|
|
31
|
+
"file": "admin-error-404.uibot.yaml",
|
|
32
|
+
"contract": {
|
|
33
|
+
"name": "admin-error-404",
|
|
34
|
+
"description": "Page not found: shared UiBot Admin page source.",
|
|
35
|
+
"level": "L4",
|
|
36
|
+
"category": "page",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"admin-error-404",
|
|
39
|
+
"页面不存在",
|
|
40
|
+
"Page not found",
|
|
41
|
+
"system",
|
|
42
|
+
"not-found"
|
|
43
|
+
],
|
|
44
|
+
"composedFrom": [
|
|
45
|
+
"Box",
|
|
46
|
+
"Heading",
|
|
47
|
+
"Paragraph",
|
|
48
|
+
"Link"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-error-500",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Server error: shared UiBot Admin page source.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/data",
|
|
8
|
+
"@uibot/layout",
|
|
9
|
+
"@uibot/nav"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/uibot/templates/admin-error-500.uibot.yaml",
|
|
14
|
+
"target": "lib/uibot/templates/admin-error-500.uibot.yaml",
|
|
15
|
+
"content": "version: \"2.0\"\npages:\n - id: error-500\n path: /errors/500\n title: Oops! Something went wrong\n state:\n currentPath: /errors/500\n blocks:\n - type: Box\n props:\n className: min-h-dvh items-center justify-center px-6 text-center\n gap: lg\n children:\n - type: Heading\n props:\n level: 1\n text: \"500\"\n className: \"!text-[7rem] !leading-tight !font-bold\"\n - type: Heading\n props:\n level: 2\n text: Oops! Something went wrong\n - type: Paragraph\n props:\n text: We apologize for the inconvenience. Please try again later.\n muted: true\n - type: Link\n props:\n label: Back to Home\n href: /\n variant: button\n",
|
|
16
|
+
"type": "registry:lib"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-error-500.uibot.json",
|
|
20
|
+
"target": "lib/uibot/templates/admin-error-500.uibot.json",
|
|
21
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-error-500\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-error-500.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-error-500\",\n \"description\": \"Server error: shared UiBot Admin page source.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"admin-error-500\",\n \"服务异常\",\n \"Server error\",\n \"system\",\n \"server-error\"\n ],\n \"composedFrom\": [\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Link\"\n ]\n }\n }\n}\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"uibot": {
|
|
27
|
+
"schema": "uibot.registry.item.v1",
|
|
28
|
+
"item": "admin-error-500",
|
|
29
|
+
"channel": "public",
|
|
30
|
+
"template": {
|
|
31
|
+
"file": "admin-error-500.uibot.yaml",
|
|
32
|
+
"contract": {
|
|
33
|
+
"name": "admin-error-500",
|
|
34
|
+
"description": "Server error: shared UiBot Admin page source.",
|
|
35
|
+
"level": "L4",
|
|
36
|
+
"category": "page",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"admin-error-500",
|
|
39
|
+
"服务异常",
|
|
40
|
+
"Server error",
|
|
41
|
+
"system",
|
|
42
|
+
"server-error"
|
|
43
|
+
],
|
|
44
|
+
"composedFrom": [
|
|
45
|
+
"Box",
|
|
46
|
+
"Heading",
|
|
47
|
+
"Paragraph",
|
|
48
|
+
"Link"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|