@zhama/tego-plugin-sdk 1.36.2 → 1.37.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/agent/RULES.md +123 -0
- package/agent/guides/access.md +39 -0
- package/agent/guides/backend.md +76 -0
- package/agent/guides/claw.md +18 -0
- package/agent/guides/desktop-web.md +48 -0
- package/agent/guides/frontend.md +83 -0
- package/agent/guides/host-api-versions.md +34 -0
- package/agent/guides/i18n.md +17 -0
- package/agent/guides/manifest.md +26 -0
- package/agent/guides/migrations.md +17 -0
- package/agent/guides/storage.md +18 -0
- package/agent/guides/testing.md +17 -0
- package/agent/guides/ui.md +22 -0
- package/agent/reference/plugin-sdk-api.md +561 -0
- package/bin/tego-plugin-pack.mjs +1 -1
- package/bin/tego-plugin.mjs +4 -2
- package/dist/chunk-2NTAWYCG.js +1 -0
- package/dist/chunk-2P6UEAPV.cjs +1 -0
- package/dist/chunk-45Y4CR4R.cjs +1 -0
- package/dist/{chunk-PWSTCQRN.cjs → chunk-4LKRXDYY.cjs} +13 -12
- package/dist/{chunk-7XHF3YSK.js → chunk-56QOZQTY.js} +1 -1
- package/dist/{chunk-C2OCOPZQ.cjs → chunk-6HNG5OZI.cjs} +1 -1
- package/dist/{chunk-2ORO36BY.js → chunk-DEGQDJF6.js} +1 -1
- package/dist/chunk-EIVA5BR6.js +1 -0
- package/dist/{chunk-P2Q2AKWP.js → chunk-FCYAAOHC.js} +17 -16
- package/dist/chunk-HZ4YWRYX.cjs +5 -0
- package/dist/chunk-I5Z3ECC4.js +5 -0
- package/dist/chunk-INCA3GFW.js +1 -0
- package/dist/chunk-IVJECPGG.js +1 -0
- package/dist/{chunk-KMN5RHLX.cjs → chunk-MWMGJJ74.cjs} +1 -1
- package/dist/chunk-N4SXZZPY.cjs +1 -0
- package/dist/chunk-SKNPNPJP.cjs +1 -0
- package/dist/dev.cjs +88 -5
- package/dist/dev.d.cts +37 -1
- package/dist/dev.d.ts +37 -1
- package/dist/dev.js +91 -8
- package/dist/doctor.cjs +8 -0
- package/dist/doctor.d.cts +62 -0
- package/dist/doctor.d.ts +62 -0
- package/dist/doctor.js +8 -0
- package/dist/frontend.d.cts +33 -1
- package/dist/frontend.d.ts +33 -1
- package/dist/hono.cjs +1 -0
- package/dist/hono.d.cts +84 -0
- package/dist/hono.d.ts +84 -0
- package/dist/hono.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1 -1
- package/dist/manifest.cjs +1 -1
- package/dist/manifest.d.cts +55 -2
- package/dist/manifest.d.ts +55 -2
- package/dist/manifest.js +1 -1
- package/dist/migrations-sync.cjs +1 -0
- package/dist/migrations-sync.d.cts +20 -0
- package/dist/migrations-sync.d.ts +20 -0
- package/dist/migrations-sync.js +1 -0
- package/dist/pack.cjs +1 -1
- package/dist/pack.d.cts +5 -0
- package/dist/pack.d.ts +5 -0
- package/dist/pack.js +1 -1
- package/dist/publish.cjs +1 -1
- package/dist/publish.js +1 -1
- package/dist/react.cjs +1 -0
- package/dist/react.d.cts +101 -0
- package/dist/react.d.ts +101 -0
- package/dist/react.js +1 -0
- package/dist/scaffold.cjs +671 -17
- package/dist/scaffold.d.cts +42 -18
- package/dist/scaffold.d.ts +42 -18
- package/dist/scaffold.js +673 -19
- package/dist/server-runtime.cjs +1 -1
- package/dist/server-runtime.d.cts +27 -2
- package/dist/server-runtime.d.ts +27 -2
- package/dist/server-runtime.js +1 -1
- package/dist/testing.cjs +6 -2
- package/dist/testing.d.cts +19 -1
- package/dist/testing.d.ts +19 -1
- package/dist/testing.js +6 -2
- package/dist/verify-FF2RD2MV.cjs +1 -0
- package/dist/verify-W7ZTUCO4.js +1 -0
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +27 -1
- package/dist/vite.d.ts +27 -1
- package/dist/vite.js +1 -1
- package/package.json +31 -3
- package/dist/chunk-3WA3M347.cjs +0 -1
- package/dist/chunk-5CU33JVY.js +0 -1
- package/dist/chunk-7K37PVGV.js +0 -5
- package/dist/chunk-BTHXQWHT.js +0 -1
- package/dist/chunk-ROFUQLOZ.cjs +0 -1
- package/dist/chunk-W7C357A6.cjs +0 -5
package/dist/chunk-3WA3M347.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var l=(e,o)=>p(e,"name",{value:o,configurable:!0});var chunkROFUQLOZ_cjs=require("./chunk-ROFUQLOZ.cjs"),chunkC2OCOPZQ_cjs=require("./chunk-C2OCOPZQ.cjs"),chunkAJY7ZHXK_cjs=require("./chunk-AJY7ZHXK.cjs"),net=require("net"),zod=require("zod");function checkPluginAccessCatalog(e,o){const t=`access.catalog (${e.access?.catalog??"?"})`,s=chunkAJY7ZHXK_cjs.validateAccessCatalog(o);if(!s.ok)return{ok:!1,errors:s.issues.map(n=>`${t}: ${n.path}: ${n.message}`)};const a=new Set((e.parts.frontend?.nav??[]).map(n=>n.key)),i=Object.keys(s.catalog.menus).filter(n=>!a.has(n)).map(n=>`${t}: menus.${n}: no parts.frontend.nav entry has this key`);return i.length>0?{ok:!1,errors:i}:{ok:!0,catalog:s.catalog}}l(checkPluginAccessCatalog,"checkPluginAccessCatalog");var PYTHON_RUNNER_VERSION={major:3,minor:12},RUNNER_GLIBC_MINOR=36,PYTHON_LOCK_FILENAME="requirements.lock",PYTHON_WHEELS_DIR="wheels";function normalizePackageName(e){return e.toLowerCase().replace(/[-_.]+/g,"-")}l(normalizePackageName,"normalizePackageName");function parseRequirementsLock(e){const o=[],t=[],s=e.replace(/\\\r?\n/g," ").split(/\r?\n/).map(a=>a.replace(/(^|\s)#.*$/,"").trim()).filter(Boolean);for(const a of s){const[i="",...n]=a.split(/\s+/),r=/^([A-Za-z0-9][A-Za-z0-9._-]*)(?:\[[^\]]*\])?==([^\s;]+)$/.exec(i);if(!r||a.includes(";")){t.push(`${PYTHON_LOCK_FILENAME}: "${a.slice(0,80)}" is not a pinned "name==version" requirement without markers`);continue}const c=[];for(const d of n){const u=/^--hash=sha256:([0-9a-f]{64})$/.exec(d);u?.[1]?c.push(u[1]):t.push(`${PYTHON_LOCK_FILENAME}: unsupported option "${d.slice(0,40)}" on ${r[1]}`)}c.length===0&&t.push(`${PYTHON_LOCK_FILENAME}: ${r[1]}==${r[2]} has no --hash; compile with --generate-hashes`),o.push({name:normalizePackageName(r[1]),version:r[2].toLowerCase(),hashes:c})}return{requirements:o,errors:t}}l(parseRequirementsLock,"parseRequirementsLock");function parseWheelFilename(e){if(!e.endsWith(".whl"))return null;const o=e.slice(0,-4).split("-");if(o.length!==5&&o.length!==6)return null;const[t,s]=o,[a,i,n]=o.slice(-3);return!t||!s||!a||!i||!n?null:{name:normalizePackageName(t),version:s.toLowerCase(),pythonTags:a.split("."),abiTags:i.split("."),platformTags:n.split(".")}}l(parseWheelFilename,"parseWheelFilename");function supportsInterpreter(e){const{major:o,minor:t}=PYTHON_RUNNER_VERSION,s=`${o}${t}`;return e.pythonTags.some(a=>{if(a===`py${o}`||a===`py${s}`||a===`cp${s}`)return!0;const i=/^cp3(\d+)$/.exec(a);return i?.[1]!==void 0&&Number(i[1])<=t&&e.abiTags.includes("abi3")})}l(supportsInterpreter,"supportsInterpreter");function supportsPlatform(e,o){const t=o==="linux/amd64"?"x86_64":"aarch64";return e.platformTags.some(s=>{if(s==="any"||s===`manylinux2014_${t}`||t==="x86_64"&&/^manylinux(1|2010)_x86_64$/.test(s))return!0;const a=/^manylinux_2_(\d+)_(x86_64|aarch64)$/.exec(s);return a?.[2]===t&&Number(a[1])<=RUNNER_GLIBC_MINOR})}l(supportsPlatform,"supportsPlatform");function checkPythonVendoring(e){if(e.lockText===null)return[`Python backend ships no ${PYTHON_LOCK_FILENAME}. The runner installs offline from it with --require-hashes.`];const{requirements:o,errors:t}=parseRequirementsLock(e.lockText),s=e.wheels.map(a=>({...a,parsed:parseWheelFilename(a.filename)}));for(const a of s){if(!a.parsed){t.push(`"${a.filename}" is not a valid wheel filename`);continue}const i=o.find(n=>n.name===a.parsed.name&&n.version===a.parsed.version);i?i.hashes.includes(a.sha256)||t.push(`"${a.filename}" does not match any --hash locked for ${i.name}==${i.version}`):t.push(`"${a.filename}" is not in ${PYTHON_LOCK_FILENAME}; ship only locked wheels`)}for(const a of o){const i=s.filter(n=>n.parsed?.name===a.name&&n.parsed.version===a.version&&supportsInterpreter(n.parsed));for(const n of e.platforms)i.some(r=>supportsPlatform(r.parsed,n))||t.push(`No wheel for ${a.name}==${a.version} on ${n} (python ${PYTHON_RUNNER_VERSION.major}.${PYTHON_RUNNER_VERSION.minor})`)}return t}l(checkPythonVendoring,"checkPythonVendoring");var PLUGIN_ID_PATTERN=/^[a-z0-9][a-z0-9._-]*$/,DIRECTORY_READ="directory.read",ACCESS_HOST_API_VERSION="1.22.0",MAX_PLUGIN_ID_LENGTH=128,RELATIVE_PATH_PATTERN=/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/,relativePathSchema=zod.z.string().min(1).max(256).regex(RELATIVE_PATH_PATTERN,"must be a relative path inside the package").refine(e=>!e.split("/").some(o=>o===".."||o==="."),{message:'must not contain "." or ".." segments'}),localizedTextSchema=zod.z.union([zod.z.string().min(1),zod.z.record(zod.z.string().min(1),zod.z.string().min(1))]),semanticVersionSchema=zod.z.string().refine(e=>{try{return chunkC2OCOPZQ_cjs.parseSemanticVersion(e),!0}catch{return!1}},{message:"must be a valid semantic version"}),navKeySchema=zod.z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/,"must be lowercase alphanumeric with hyphens"),navEntrySchema=zod.z.object({key:navKeySchema,labelKey:zod.z.string().min(1).max(200),icon:zod.z.enum(chunkROFUQLOZ_cjs.PLUGIN_NAV_ICONS).optional(),order:zod.z.number().int().min(0).max(1e4).optional(),path:zod.z.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).optional()}).strict(),configPropertyNameSchema=zod.z.string().min(1).max(64).regex(/^[a-zA-Z][a-zA-Z0-9_]*$/,"must be a plain identifier: a letter followed by letters, digits or underscores"),configFieldSchema=zod.z.object({type:zod.z.enum(["string","number","integer","boolean","array"]),title:zod.z.string().min(1).max(200).optional(),description:zod.z.string().min(1).max(1e3).optional(),default:zod.z.unknown().optional(),enum:zod.z.array(zod.z.union([zod.z.string().max(200),zod.z.number()])).min(1).max(50).optional(),minLength:zod.z.number().int().min(0).max(1e4).optional(),maxLength:zod.z.number().int().min(1).max(1e4).optional(),pattern:zod.z.string().min(1).max(500).optional(),format:zod.z.enum(["uri","email"]).optional(),minimum:zod.z.number().optional(),maximum:zod.z.number().optional(),items:zod.z.object({type:zod.z.literal("string"),enum:zod.z.array(zod.z.string().max(200)).min(1).max(50).optional()}).strict().optional(),maxItems:zod.z.number().int().min(1).max(200).optional()}).strict().superRefine((e,o)=>{e.type==="array"&&e.items===void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["items"],message:'an array field must declare { "type": "string" } items'}),e.type!=="array"&&e.items!==void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["items"],message:"only an array field may declare items"}),e.enum&&e.default!==void 0&&(e.enum.some(s=>Object.is(s,e.default))||o.addIssue({code:zod.z.ZodIssueCode.custom,path:["default"],message:"must be one of the declared enum values"}))}),localizedHintTextSchema=zod.z.union([zod.z.string().min(1).max(500),zod.z.record(zod.z.string().min(1),zod.z.string().min(1).max(500))]),configUiHintSchema=zod.z.object({label:localizedHintTextSchema.optional(),help:localizedHintTextSchema.optional(),placeholder:localizedHintTextSchema.optional(),order:zod.z.number().int().min(0).max(1e4).optional(),advanced:zod.z.boolean().optional(),sensitive:zod.z.boolean().optional()}).strict(),configDeclarationSchema=zod.z.object({schema:zod.z.object({type:zod.z.literal("object"),properties:zod.z.record(configPropertyNameSchema,configFieldSchema),required:zod.z.array(configPropertyNameSchema).max(50).optional(),additionalProperties:zod.z.literal(!1).optional()}).strict(),uiHints:zod.z.record(configPropertyNameSchema,configUiHintSchema).optional()}).strict().superRefine((e,o)=>{const t=Object.keys(e.schema.properties);t.length>50&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["schema","properties"],message:"a config section is limited to 50 fields"});for(const s of e.schema.required??[])t.includes(s)||o.addIssue({code:zod.z.ZodIssueCode.custom,path:["schema","required"],message:`"${s}" is required but not declared in properties`});for(const s of Object.keys(e.uiHints??{}))t.includes(s)||o.addIssue({code:zod.z.ZodIssueCode.custom,path:["uiHints",s],message:"no such field in the section schema"})}),frontendPartSchema=zod.z.object({dir:relativePathSchema.optional(),entry:relativePathSchema.optional(),i18nDir:relativePathSchema.optional(),icon:zod.z.enum(chunkROFUQLOZ_cjs.PLUGIN_NAV_ICONS).optional(),nav:zod.z.array(navEntrySchema).max(20).optional(),config:configDeclarationSchema.optional()}).strict().superRefine((e,o)=>{for(const[t,s]of Object.entries(e.config?.uiHints??{}))s.sensitive===!0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["config","uiHints",t,"sensitive"],message:"the frontend config section is delivered to the browser, so it cannot hold secrets \u2014 declare this field in the backend section instead"})}).refine(e=>{const o=(e.nav??[]).map(t=>t.key);return new Set(o).size===o.length},{message:"nav entries must have unique keys",path:["nav"]}),backendLimitsSchema=zod.z.object({memoryMb:zod.z.number().int().min(64).max(4096).optional(),cpuMs:zod.z.number().int().min(100).max(6e5).optional(),requestTimeoutMs:zod.z.number().int().min(100).max(12e4).optional()}).strict(),EGRESS_HOST_PATTERN=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,61}[a-z0-9]$/,egressHostSchema=zod.z.string().max(259).refine(e=>{if(e==="*")return!0;const o=/^\[([0-9a-f:]+)\]:([1-9]\d{0,4})$/.exec(e);if(o)return net.isIP(o[1])===6&&Number(o[2])<=65535;const t=/^([^:]+)(?::([1-9]\d{0,4}))?$/.exec(e);if(!t)return!1;const[,s,a]=t;return a&&Number(a)>65535?!1:a&&net.isIP(s)===4||EGRESS_HOST_PATTERN.test(s)},"must be *, a lowercase hostname, hostname:port, or IP:port"),publicRouteSchema=zod.z.object({method:zod.z.enum(chunkROFUQLOZ_cjs.PLUGIN_PUBLIC_ROUTE_METHODS),path:zod.z.string().max(256).superRefine((e,o)=>{const t=chunkROFUQLOZ_cjs.publicRoutePathProblem(e);t&&o.addIssue({code:zod.z.ZodIssueCode.custom,message:t})})}).strict(),backendPartSchema=zod.z.object({dir:relativePathSchema.optional(),runtime:zod.z.enum(["node","python"]).optional(),entry:relativePathSchema.optional(),platforms:zod.z.array(zod.z.enum(["linux/amd64","linux/arm64"])).min(1).optional(),egress:zod.z.array(egressHostSchema).max(20).refine(e=>!e.includes("*")||e.length===1,{message:"the * wildcard must be the only egress entry"}).optional(),migrationsDir:relativePathSchema.optional(),compatibilityRepairs:zod.z.array(zod.z.object({id:zod.z.string().regex(/^[a-z][a-z0-9_-]{0,99}$/),sqlFile:relativePathSchema.refine(e=>e.startsWith("repairs/")&&e.endsWith(".sql"),"Use a SQL file under repairs/"),table:zod.z.string().regex(/^[a-z][a-z0-9_]{0,62}$/),column:zod.z.string().regex(/^[a-z][a-z0-9_]{0,62}$/),postgresType:zod.z.enum(["integer","text","boolean","bigint","jsonb"])}).strict()).max(100).refine(e=>new Set(e.map(o=>o.id)).size===e.length,"Repair IDs must be unique").optional(),healthPath:zod.z.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).optional(),limits:backendLimitsSchema.optional(),publicRoutes:zod.z.array(publicRouteSchema).max(100).optional(),config:configDeclarationSchema.optional()}).strict().superRefine((e,o)=>{const t=e.publicRoutes??[];t.forEach((s,a)=>{const i=t.slice(0,a).find(n=>chunkROFUQLOZ_cjs.publicRoutesOverlap(n,s));i&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["publicRoutes",a],message:`"${chunkROFUQLOZ_cjs.formatPublicRoute(s)}" can match the same requests as "${chunkROFUQLOZ_cjs.formatPublicRoute(i)}"`})}),e.platforms&&(e.runtime??"node")!=="python"&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["platforms"],message:'only applies to runtime "python"'})}),clawPartSchema=zod.z.object({dir:relativePathSchema.optional(),hooks:zod.z.object({allowPromptInjection:zod.z.boolean().optional(),allowConversationAccess:zod.z.boolean().optional()}).strict().optional()}).strict();function containsPath(e,o){return o===e||o.startsWith(`${e}/`)}l(containsPath,"containsPath");var publicFrontendPartSchema=zod.z.object({dir:relativePathSchema.optional()}).strict(),partsSchema=zod.z.object({frontend:frontendPartSchema.optional(),backend:backendPartSchema.optional(),claw:clawPartSchema.optional(),publicFrontend:publicFrontendPartSchema.optional()}).strict().refine(e=>e.frontend!==void 0||e.backend!==void 0||e.claw!==void 0,{message:"a plugin must declare at least one of frontend, backend, claw"}).superRefine((e,o)=>{const t=[["frontend",e.frontend?.dir??chunkROFUQLOZ_cjs.PLUGIN_PART_DEFAULTS.frontend.dir],["backend",e.backend?.dir??chunkROFUQLOZ_cjs.PLUGIN_PART_DEFAULTS.backend.dir],["claw",e.claw?.dir??chunkROFUQLOZ_cjs.PLUGIN_PART_DEFAULTS.claw.dir],["publicFrontend",e.publicFrontend?.dir??chunkROFUQLOZ_cjs.PLUGIN_PART_DEFAULTS.publicFrontend.dir]].filter(([s])=>e[s]!==void 0);for(const[s,a]of t)for(const[i,n]of t)s!==i&&containsPath(a,n)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:[i,"dir"],message:a===n?`must not be the same directory as the ${s} part ("${a}")`:`must not sit inside the ${s} part's directory ("${a}")`})}),permissionsSchema=zod.z.object({required:zod.z.array(zod.z.string().min(1).max(128)).max(50).optional()}).strict(),declaresSchema=zod.z.object({database:zod.z.boolean().optional(),storage:zod.z.boolean().optional(),events:zod.z.boolean().optional(),notifications:zod.z.boolean().optional()}).strict(),tegoPluginManifestSchema=zod.z.object({manifestVersion:zod.z.literal(1),id:zod.z.string().max(MAX_PLUGIN_ID_LENGTH).regex(PLUGIN_ID_PATTERN,"must be lowercase letters, digits, dot, underscore or hyphen, starting with a letter or digit"),version:semanticVersionSchema,displayName:localizedTextSchema,description:localizedTextSchema.optional(),author:zod.z.string().max(200).optional(),homepage:zod.z.string().url().max(500).optional(),icon:relativePathSchema.optional(),category:zod.z.string().min(1).max(64).optional(),tags:zod.z.array(zod.z.string().min(1).max(64)).max(20).optional(),hostApiRange:zod.z.string().refine(chunkC2OCOPZQ_cjs.isValidHostApiRange,{message:'must be a caret range like "^1.2.0" or an exact "1.2.0"'}).optional(),scope:zod.z.enum(["avatar","tenant"]),declares:declaresSchema.optional(),parts:partsSchema,permissions:permissionsSchema.optional(),access:zod.z.object({catalog:relativePathSchema}).strict().optional(),audit:zod.z.object({tools:zod.z.record(zod.z.string().min(1).max(128),zod.z.object({category:zod.z.enum(["read","write","search","browse","exec","knowledge","memory","message","schedule","delegate","document","plugin"]).optional(),title:localizedTextSchema.optional(),target:zod.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).optional(),risk:zod.z.enum(["low","medium","high"]).optional(),dataClasses:zod.z.array(zod.z.string().min(1).max(32)).max(10).optional()}).strict()).optional()}).strict().optional(),agentTemplates:zod.z.array(zod.z.object({key:navKeySchema,entry:relativePathSchema,icon:relativePathSchema.optional()}).strict()).max(20).optional(),workDelegation:zod.z.object({allowedAvatarRoles:zod.z.array(zod.z.string().min(1).max(100)).min(1).max(20),settingsRoute:zod.z.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).refine(e=>!e.startsWith("//"),"must be a plugin page").optional(),summary:localizedTextSchema.refine(e=>(typeof e=="string"?[e]:Object.values(e)).every(o=>o.length<=120),"must be at most 120 characters in every locale").optional(),privacyPolicyUrl:zod.z.string().url().max(2048).refine(e=>e.startsWith("https://"),"must be an https URL").optional(),conversationCapture:zod.z.boolean().optional()}).strict().optional(),conversationRecordRoutes:zod.z.array(zod.z.object({entity:navKeySchema,path:relativePathSchema,contextQuery:zod.z.string().max(200).regex(/^[A-Za-z0-9_=&-]+$/).optional(),labelFields:zod.z.array(zod.z.string().regex(/^[A-Za-z][A-Za-z0-9_]*$/)).min(1).max(3).optional()}).strict()).max(30).optional(),agentReadiness:zod.z.object({path:relativePathSchema}).strict().optional()}).strict().superRefine((e,o)=>{const t=new Set;for(const[r,c]of(e.agentTemplates??[]).entries())t.has(c.key)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["agentTemplates",r,"key"],message:"duplicate template key"}),t.add(c.key);const s=new Set;for(const[r,c]of(e.conversationRecordRoutes??[]).entries())s.has(c.entity)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["conversationRecordRoutes",r,"entity"],message:"duplicate conversation entity"}),s.add(c.entity);(e.parts.frontend!==void 0||e.parts.backend!==void 0)&&e.hostApiRange===void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"required when a frontend or backend part is declared, so the host can refuse incompatible releases"});const i=e.parts.backend?.publicRoutes??[];if(e.parts.publicFrontend!==void 0&&i.length===0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["parts","publicFrontend"],message:"requires parts.backend.publicRoutes for the pages to call"}),e.parts.backend===void 0&&e.declares)for(const r of["database","storage","events"])e.declares[r]===!0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["declares",r],message:"requires a backend part"});e.permissions?.required?.includes("knowledge.manage")&&(!e.parts.backend||!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.23.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"knowledge.manage requires a backend and host API ^1.23.0 or later"}),e.permissions?.required?.includes("proactive.emit")&&(!e.parts.backend||!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.26.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"proactive.emit requires a backend and host API ^1.26.0 or later"}),e.permissions?.required?.includes("attention.request")&&(!e.parts.backend||!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.34.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"attention.request requires a backend and host API ^1.34.0 or later"}),e.permissions?.required?.includes("mail.send")&&(!e.parts.backend||!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.29.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"mail.send requires a backend and host API ^1.29.0 or later"}),e.agentReadiness!==void 0&&e.parts.backend===void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["agentReadiness"],message:"requires a backend part to answer it"}),(e.agentReadiness!==void 0||e.workDelegation?.settingsRoute!==void 0)&&(!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.30.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"agentReadiness and workDelegation.settingsRoute require host API ^1.30.0 or later"}),e.workDelegation!==void 0&&e.parts.backend===void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["workDelegation"],message:"requires a backend part to act on it"});const n=e.workDelegation;(n?.summary!==void 0||n?.privacyPolicyUrl!==void 0||n?.conversationCapture!==void 0)&&(!e.hostApiRange||chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),"1.33.0")<0)&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:"workDelegation.summary, privacyPolicyUrl and conversationCapture require host API ^1.33.0 or later"}),e.access!==void 0&&(e.parts.backend===void 0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["access"],message:"requires a backend part to enforce it"}),e.permissions?.required?.includes(DIRECTORY_READ)||o.addIssue({code:zod.z.ZodIssueCode.custom,path:["permissions","required"],message:`must include "${DIRECTORY_READ}" when access is declared`}),e.hostApiRange!==void 0&&chunkC2OCOPZQ_cjs.isValidHostApiRange(e.hostApiRange)&&chunkC2OCOPZQ_cjs.compareSkillSemanticVersions(chunkC2OCOPZQ_cjs.hostApiRangeMinimum(e.hostApiRange),ACCESS_HOST_API_VERSION)<0&&o.addIssue({code:zod.z.ZodIssueCode.custom,path:["hostApiRange"],message:`access needs host API ${ACCESS_HOST_API_VERSION} \u2014 declare "^${ACCESS_HOST_API_VERSION}" or later`})),(e.parts.frontend?.nav??[]).forEach((r,c)=>{const d=chunkROFUQLOZ_cjs.pluginMenuPermission(e.id,r.key);d.length<=chunkROFUQLOZ_cjs.MAX_PLUGIN_MENU_PERMISSION_LENGTH||o.addIssue({code:zod.z.ZodIssueCode.custom,path:["parts","frontend","nav",c,"key"],message:`together with the plugin id this derives "${d}" (${d.length} chars), over the ${chunkROFUQLOZ_cjs.MAX_PLUGIN_MENU_PERMISSION_LENGTH}-char limit \u2014 shorten the id or the key`})})});function formatIssues(e){return e.issues.map(o=>{const t=o.path.join(".");return t?`${t}: ${o.message}`:o.message})}l(formatIssues,"formatIssues");function parseTegoPluginManifest(e){const o=tegoPluginManifestSchema.safeParse(e);return o.success?{ok:!0,manifest:o.data,errors:[]}:{ok:!1,errors:formatIssues(o.error)}}l(parseTegoPluginManifest,"parseTegoPluginManifest"),exports.PYTHON_LOCK_FILENAME=PYTHON_LOCK_FILENAME,exports.PYTHON_RUNNER_VERSION=PYTHON_RUNNER_VERSION,exports.PYTHON_WHEELS_DIR=PYTHON_WHEELS_DIR,exports.checkPluginAccessCatalog=checkPluginAccessCatalog,exports.checkPythonVendoring=checkPythonVendoring,exports.normalizePackageName=normalizePackageName,exports.parseRequirementsLock=parseRequirementsLock,exports.parseTegoPluginManifest=parseTegoPluginManifest,exports.parseWheelFilename=parseWheelFilename,exports.tegoPluginManifestSchema=tegoPluginManifestSchema;
|
package/dist/chunk-5CU33JVY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var N=Object.defineProperty;var u=(o,t)=>N(o,"name",{value:t,configurable:!0});import{PLUGIN_NAV_ICONS as _,publicRoutePathProblem as E,PLUGIN_PUBLIC_ROUTE_METHODS as L,publicRoutesOverlap as H,formatPublicRoute as w,PLUGIN_PART_DEFAULTS as b,pluginMenuPermission as O,MAX_PLUGIN_MENU_PERMISSION_LENGTH as P}from"./chunk-BTHXQWHT.js";import{parseSemanticVersion as D,isValidHostApiRange as p,compareSkillSemanticVersions as m,hostApiRangeMinimum as h}from"./chunk-7XHF3YSK.js";import{validateAccessCatalog as U}from"./chunk-VMCGDDGP.js";import{isIP as C}from"net";import{z as e}from"zod";function M(o,t){const a=`access.catalog (${o.access?.catalog??"?"})`,n=U(t);if(!n.ok)return{ok:!1,errors:n.issues.map(r=>`${a}: ${r.path}: ${r.message}`)};const s=new Set((o.parts.frontend?.nav??[]).map(r=>r.key)),i=Object.keys(n.catalog.menus).filter(r=>!s.has(r)).map(r=>`${a}: menus.${r}: no parts.frontend.nav entry has this key`);return i.length>0?{ok:!1,errors:i}:{ok:!0,catalog:n.catalog}}u(M,"checkPluginAccessCatalog");var v={major:3,minor:12},F=36,f="requirements.lock",G="wheels";function I(o){return o.toLowerCase().replace(/[-_.]+/g,"-")}u(I,"normalizePackageName");function S(o){const t=[],a=[],n=o.replace(/\\\r?\n/g," ").split(/\r?\n/).map(s=>s.replace(/(^|\s)#.*$/,"").trim()).filter(Boolean);for(const s of n){const[i="",...r]=s.split(/\s+/),c=/^([A-Za-z0-9][A-Za-z0-9._-]*)(?:\[[^\]]*\])?==([^\s;]+)$/.exec(i);if(!c||s.includes(";")){a.push(`${f}: "${s.slice(0,80)}" is not a pinned "name==version" requirement without markers`);continue}const l=[];for(const g of r){const x=/^--hash=sha256:([0-9a-f]{64})$/.exec(g);x?.[1]?l.push(x[1]):a.push(`${f}: unsupported option "${g.slice(0,40)}" on ${c[1]}`)}l.length===0&&a.push(`${f}: ${c[1]}==${c[2]} has no --hash; compile with --generate-hashes`),t.push({name:I(c[1]),version:c[2].toLowerCase(),hashes:l})}return{requirements:t,errors:a}}u(S,"parseRequirementsLock");function Z(o){if(!o.endsWith(".whl"))return null;const t=o.slice(0,-4).split("-");if(t.length!==5&&t.length!==6)return null;const[a,n]=t,[s,i,r]=t.slice(-3);return!a||!n||!s||!i||!r?null:{name:I(a),version:n.toLowerCase(),pythonTags:s.split("."),abiTags:i.split("."),platformTags:r.split(".")}}u(Z,"parseWheelFilename");function V(o){const{major:t,minor:a}=v,n=`${t}${a}`;return o.pythonTags.some(s=>{if(s===`py${t}`||s===`py${n}`||s===`cp${n}`)return!0;const i=/^cp3(\d+)$/.exec(s);return i?.[1]!==void 0&&Number(i[1])<=a&&o.abiTags.includes("abi3")})}u(V,"supportsInterpreter");function W(o,t){const a=t==="linux/amd64"?"x86_64":"aarch64";return o.platformTags.some(n=>{if(n==="any"||n===`manylinux2014_${a}`||a==="x86_64"&&/^manylinux(1|2010)_x86_64$/.test(n))return!0;const s=/^manylinux_2_(\d+)_(x86_64|aarch64)$/.exec(n);return s?.[2]===a&&Number(s[1])<=F})}u(W,"supportsPlatform");function B(o){if(o.lockText===null)return[`Python backend ships no ${f}. The runner installs offline from it with --require-hashes.`];const{requirements:t,errors:a}=S(o.lockText),n=o.wheels.map(s=>({...s,parsed:Z(s.filename)}));for(const s of n){if(!s.parsed){a.push(`"${s.filename}" is not a valid wheel filename`);continue}const i=t.find(r=>r.name===s.parsed.name&&r.version===s.parsed.version);i?i.hashes.includes(s.sha256)||a.push(`"${s.filename}" does not match any --hash locked for ${i.name}==${i.version}`):a.push(`"${s.filename}" is not in ${f}; ship only locked wheels`)}for(const s of t){const i=n.filter(r=>r.parsed?.name===s.name&&r.parsed.version===s.version&&V(r.parsed));for(const r of o.platforms)i.some(c=>W(c.parsed,r))||a.push(`No wheel for ${s.name}==${s.version} on ${r} (python ${v.major}.${v.minor})`)}return a}u(B,"checkPythonVendoring");var K=/^[a-z0-9][a-z0-9._-]*$/,T="directory.read",R="1.22.0",Y=128,Q=/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/,d=e.string().min(1).max(256).regex(Q,"must be a relative path inside the package").refine(o=>!o.split("/").some(t=>t===".."||t==="."),{message:'must not contain "." or ".." segments'}),y=e.union([e.string().min(1),e.record(e.string().min(1),e.string().min(1))]),X=e.string().refine(o=>{try{return D(o),!0}catch{return!1}},{message:"must be a valid semantic version"}),k=e.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/,"must be lowercase alphanumeric with hyphens"),J=e.object({key:k,labelKey:e.string().min(1).max(200),icon:e.enum(_).optional(),order:e.number().int().min(0).max(1e4).optional(),path:e.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).optional()}).strict(),A=e.string().min(1).max(64).regex(/^[a-zA-Z][a-zA-Z0-9_]*$/,"must be a plain identifier: a letter followed by letters, digits or underscores"),ee=e.object({type:e.enum(["string","number","integer","boolean","array"]),title:e.string().min(1).max(200).optional(),description:e.string().min(1).max(1e3).optional(),default:e.unknown().optional(),enum:e.array(e.union([e.string().max(200),e.number()])).min(1).max(50).optional(),minLength:e.number().int().min(0).max(1e4).optional(),maxLength:e.number().int().min(1).max(1e4).optional(),pattern:e.string().min(1).max(500).optional(),format:e.enum(["uri","email"]).optional(),minimum:e.number().optional(),maximum:e.number().optional(),items:e.object({type:e.literal("string"),enum:e.array(e.string().max(200)).min(1).max(50).optional()}).strict().optional(),maxItems:e.number().int().min(1).max(200).optional()}).strict().superRefine((o,t)=>{o.type==="array"&&o.items===void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["items"],message:'an array field must declare { "type": "string" } items'}),o.type!=="array"&&o.items!==void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["items"],message:"only an array field may declare items"}),o.enum&&o.default!==void 0&&(o.enum.some(n=>Object.is(n,o.default))||t.addIssue({code:e.ZodIssueCode.custom,path:["default"],message:"must be one of the declared enum values"}))}),$=e.union([e.string().min(1).max(500),e.record(e.string().min(1),e.string().min(1).max(500))]),oe=e.object({label:$.optional(),help:$.optional(),placeholder:$.optional(),order:e.number().int().min(0).max(1e4).optional(),advanced:e.boolean().optional(),sensitive:e.boolean().optional()}).strict(),j=e.object({schema:e.object({type:e.literal("object"),properties:e.record(A,ee),required:e.array(A).max(50).optional(),additionalProperties:e.literal(!1).optional()}).strict(),uiHints:e.record(A,oe).optional()}).strict().superRefine((o,t)=>{const a=Object.keys(o.schema.properties);a.length>50&&t.addIssue({code:e.ZodIssueCode.custom,path:["schema","properties"],message:"a config section is limited to 50 fields"});for(const n of o.schema.required??[])a.includes(n)||t.addIssue({code:e.ZodIssueCode.custom,path:["schema","required"],message:`"${n}" is required but not declared in properties`});for(const n of Object.keys(o.uiHints??{}))a.includes(n)||t.addIssue({code:e.ZodIssueCode.custom,path:["uiHints",n],message:"no such field in the section schema"})}),te=e.object({dir:d.optional(),entry:d.optional(),i18nDir:d.optional(),icon:e.enum(_).optional(),nav:e.array(J).max(20).optional(),config:j.optional()}).strict().superRefine((o,t)=>{for(const[a,n]of Object.entries(o.config?.uiHints??{}))n.sensitive===!0&&t.addIssue({code:e.ZodIssueCode.custom,path:["config","uiHints",a,"sensitive"],message:"the frontend config section is delivered to the browser, so it cannot hold secrets \u2014 declare this field in the backend section instead"})}).refine(o=>{const t=(o.nav??[]).map(a=>a.key);return new Set(t).size===t.length},{message:"nav entries must have unique keys",path:["nav"]}),ae=e.object({memoryMb:e.number().int().min(64).max(4096).optional(),cpuMs:e.number().int().min(100).max(6e5).optional(),requestTimeoutMs:e.number().int().min(100).max(12e4).optional()}).strict(),q=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,61}[a-z0-9]$/,se=e.string().max(259).refine(o=>{if(o==="*")return!0;const t=/^\[([0-9a-f:]+)\]:([1-9]\d{0,4})$/.exec(o);if(t)return C(t[1])===6&&Number(t[2])<=65535;const a=/^([^:]+)(?::([1-9]\d{0,4}))?$/.exec(o);if(!a)return!1;const[,n,s]=a;return s&&Number(s)>65535?!1:s&&C(n)===4||q.test(n)},"must be *, a lowercase hostname, hostname:port, or IP:port"),ne=e.object({method:e.enum(L),path:e.string().max(256).superRefine((o,t)=>{const a=E(o);a&&t.addIssue({code:e.ZodIssueCode.custom,message:a})})}).strict(),re=e.object({dir:d.optional(),runtime:e.enum(["node","python"]).optional(),entry:d.optional(),platforms:e.array(e.enum(["linux/amd64","linux/arm64"])).min(1).optional(),egress:e.array(se).max(20).refine(o=>!o.includes("*")||o.length===1,{message:"the * wildcard must be the only egress entry"}).optional(),migrationsDir:d.optional(),compatibilityRepairs:e.array(e.object({id:e.string().regex(/^[a-z][a-z0-9_-]{0,99}$/),sqlFile:d.refine(o=>o.startsWith("repairs/")&&o.endsWith(".sql"),"Use a SQL file under repairs/"),table:e.string().regex(/^[a-z][a-z0-9_]{0,62}$/),column:e.string().regex(/^[a-z][a-z0-9_]{0,62}$/),postgresType:e.enum(["integer","text","boolean","bigint","jsonb"])}).strict()).max(100).refine(o=>new Set(o.map(t=>t.id)).size===o.length,"Repair IDs must be unique").optional(),healthPath:e.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).optional(),limits:ae.optional(),publicRoutes:e.array(ne).max(100).optional(),config:j.optional()}).strict().superRefine((o,t)=>{const a=o.publicRoutes??[];a.forEach((n,s)=>{const i=a.slice(0,s).find(r=>H(r,n));i&&t.addIssue({code:e.ZodIssueCode.custom,path:["publicRoutes",s],message:`"${w(n)}" can match the same requests as "${w(i)}"`})}),o.platforms&&(o.runtime??"node")!=="python"&&t.addIssue({code:e.ZodIssueCode.custom,path:["platforms"],message:'only applies to runtime "python"'})}),ie=e.object({dir:d.optional(),hooks:e.object({allowPromptInjection:e.boolean().optional(),allowConversationAccess:e.boolean().optional()}).strict().optional()}).strict();function ce(o,t){return t===o||t.startsWith(`${o}/`)}u(ce,"containsPath");var de=e.object({dir:d.optional()}).strict(),le=e.object({frontend:te.optional(),backend:re.optional(),claw:ie.optional(),publicFrontend:de.optional()}).strict().refine(o=>o.frontend!==void 0||o.backend!==void 0||o.claw!==void 0,{message:"a plugin must declare at least one of frontend, backend, claw"}).superRefine((o,t)=>{const a=[["frontend",o.frontend?.dir??b.frontend.dir],["backend",o.backend?.dir??b.backend.dir],["claw",o.claw?.dir??b.claw.dir],["publicFrontend",o.publicFrontend?.dir??b.publicFrontend.dir]].filter(([n])=>o[n]!==void 0);for(const[n,s]of a)for(const[i,r]of a)n!==i&&ce(s,r)&&t.addIssue({code:e.ZodIssueCode.custom,path:[i,"dir"],message:s===r?`must not be the same directory as the ${n} part ("${s}")`:`must not sit inside the ${n} part's directory ("${s}")`})}),ue=e.object({required:e.array(e.string().min(1).max(128)).max(50).optional()}).strict(),pe=e.object({database:e.boolean().optional(),storage:e.boolean().optional(),events:e.boolean().optional(),notifications:e.boolean().optional()}).strict(),z=e.object({manifestVersion:e.literal(1),id:e.string().max(Y).regex(K,"must be lowercase letters, digits, dot, underscore or hyphen, starting with a letter or digit"),version:X,displayName:y,description:y.optional(),author:e.string().max(200).optional(),homepage:e.string().url().max(500).optional(),icon:d.optional(),category:e.string().min(1).max(64).optional(),tags:e.array(e.string().min(1).max(64)).max(20).optional(),hostApiRange:e.string().refine(p,{message:'must be a caret range like "^1.2.0" or an exact "1.2.0"'}).optional(),scope:e.enum(["avatar","tenant"]),declares:pe.optional(),parts:le,permissions:ue.optional(),access:e.object({catalog:d}).strict().optional(),audit:e.object({tools:e.record(e.string().min(1).max(128),e.object({category:e.enum(["read","write","search","browse","exec","knowledge","memory","message","schedule","delegate","document","plugin"]).optional(),title:y.optional(),target:e.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).optional(),risk:e.enum(["low","medium","high"]).optional(),dataClasses:e.array(e.string().min(1).max(32)).max(10).optional()}).strict()).optional()}).strict().optional(),agentTemplates:e.array(e.object({key:k,entry:d,icon:d.optional()}).strict()).max(20).optional(),workDelegation:e.object({allowedAvatarRoles:e.array(e.string().min(1).max(100)).min(1).max(20),settingsRoute:e.string().regex(/^\/[A-Za-z0-9/_-]*$/,'must start with "/"').max(256).refine(o=>!o.startsWith("//"),"must be a plugin page").optional(),summary:y.refine(o=>(typeof o=="string"?[o]:Object.values(o)).every(t=>t.length<=120),"must be at most 120 characters in every locale").optional(),privacyPolicyUrl:e.string().url().max(2048).refine(o=>o.startsWith("https://"),"must be an https URL").optional(),conversationCapture:e.boolean().optional()}).strict().optional(),conversationRecordRoutes:e.array(e.object({entity:k,path:d,contextQuery:e.string().max(200).regex(/^[A-Za-z0-9_=&-]+$/).optional(),labelFields:e.array(e.string().regex(/^[A-Za-z][A-Za-z0-9_]*$/)).min(1).max(3).optional()}).strict()).max(30).optional(),agentReadiness:e.object({path:d}).strict().optional()}).strict().superRefine((o,t)=>{const a=new Set;for(const[c,l]of(o.agentTemplates??[]).entries())a.has(l.key)&&t.addIssue({code:e.ZodIssueCode.custom,path:["agentTemplates",c,"key"],message:"duplicate template key"}),a.add(l.key);const n=new Set;for(const[c,l]of(o.conversationRecordRoutes??[]).entries())n.has(l.entity)&&t.addIssue({code:e.ZodIssueCode.custom,path:["conversationRecordRoutes",c,"entity"],message:"duplicate conversation entity"}),n.add(l.entity);(o.parts.frontend!==void 0||o.parts.backend!==void 0)&&o.hostApiRange===void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"required when a frontend or backend part is declared, so the host can refuse incompatible releases"});const i=o.parts.backend?.publicRoutes??[];if(o.parts.publicFrontend!==void 0&&i.length===0&&t.addIssue({code:e.ZodIssueCode.custom,path:["parts","publicFrontend"],message:"requires parts.backend.publicRoutes for the pages to call"}),o.parts.backend===void 0&&o.declares)for(const c of["database","storage","events"])o.declares[c]===!0&&t.addIssue({code:e.ZodIssueCode.custom,path:["declares",c],message:"requires a backend part"});o.permissions?.required?.includes("knowledge.manage")&&(!o.parts.backend||!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.23.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"knowledge.manage requires a backend and host API ^1.23.0 or later"}),o.permissions?.required?.includes("proactive.emit")&&(!o.parts.backend||!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.26.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"proactive.emit requires a backend and host API ^1.26.0 or later"}),o.permissions?.required?.includes("attention.request")&&(!o.parts.backend||!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.34.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"attention.request requires a backend and host API ^1.34.0 or later"}),o.permissions?.required?.includes("mail.send")&&(!o.parts.backend||!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.29.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"mail.send requires a backend and host API ^1.29.0 or later"}),o.agentReadiness!==void 0&&o.parts.backend===void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["agentReadiness"],message:"requires a backend part to answer it"}),(o.agentReadiness!==void 0||o.workDelegation?.settingsRoute!==void 0)&&(!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.30.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"agentReadiness and workDelegation.settingsRoute require host API ^1.30.0 or later"}),o.workDelegation!==void 0&&o.parts.backend===void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["workDelegation"],message:"requires a backend part to act on it"});const r=o.workDelegation;(r?.summary!==void 0||r?.privacyPolicyUrl!==void 0||r?.conversationCapture!==void 0)&&(!o.hostApiRange||p(o.hostApiRange)&&m(h(o.hostApiRange),"1.33.0")<0)&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:"workDelegation.summary, privacyPolicyUrl and conversationCapture require host API ^1.33.0 or later"}),o.access!==void 0&&(o.parts.backend===void 0&&t.addIssue({code:e.ZodIssueCode.custom,path:["access"],message:"requires a backend part to enforce it"}),o.permissions?.required?.includes(T)||t.addIssue({code:e.ZodIssueCode.custom,path:["permissions","required"],message:`must include "${T}" when access is declared`}),o.hostApiRange!==void 0&&p(o.hostApiRange)&&m(h(o.hostApiRange),R)<0&&t.addIssue({code:e.ZodIssueCode.custom,path:["hostApiRange"],message:`access needs host API ${R} \u2014 declare "^${R}" or later`})),(o.parts.frontend?.nav??[]).forEach((c,l)=>{const g=O(o.id,c.key);g.length<=P||t.addIssue({code:e.ZodIssueCode.custom,path:["parts","frontend","nav",l,"key"],message:`together with the plugin id this derives "${g}" (${g.length} chars), over the ${P}-char limit \u2014 shorten the id or the key`})})});function me(o){return o.issues.map(t=>{const a=t.path.join(".");return a?`${a}: ${t.message}`:t.message})}u(me,"formatIssues");function he(o){const t=z.safeParse(o);return t.success?{ok:!0,manifest:t.data,errors:[]}:{ok:!1,errors:me(t.error)}}u(he,"parseTegoPluginManifest");export{f as PYTHON_LOCK_FILENAME,v as PYTHON_RUNNER_VERSION,G as PYTHON_WHEELS_DIR,M as checkPluginAccessCatalog,B as checkPythonVendoring,I as normalizePackageName,S as parseRequirementsLock,he as parseTegoPluginManifest,Z as parseWheelFilename,z as tegoPluginManifestSchema};
|
package/dist/chunk-7K37PVGV.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var f=Object.defineProperty;var s=(e,t)=>f(e,"name",{value:t,configurable:!0});import{SHARED_MODULE_IDS as l}from"./chunk-7XHF3YSK.js";import g from"magic-string";import{createRequire as h}from"module";import{join as p,dirname as E}from"path";var m="@tego/ui",d="@tego/ui/tailwind-preset",y=["@tego/plugin-access-ui"],O="**/*.{js,cjs}";function v({pluginId:e,root:t,content:n}){const i=h(p(t,"vite.config.ts")),o=s(u=>p(E(i.resolve(u)),O),"compiledCodeOf");let r;try{r=i(d)}catch(u){throw new Error(`tegoPluginTailwind: cannot resolve ${d} from ${t}; install ${m} in the plugin`,{cause:u})}const a=y.flatMap(u=>{try{return[o(u)]}catch{return[]}});return{presets:[r],content:[...n,o(m),...a],corePlugins:{preflight:!1},important:`.${e}`}}s(v,"tegoPluginTailwind");var _="tego-shared:",S=["chrome87","firefox78","safari14","edge88"],c={mode:"development",build:{minify:!1,sourcemap:"inline"}};function D(e){return{name:"tego-plugin-inline-css",enforce:"post",generateBundle(t,n){const i=Object.entries(n).filter(([r,a])=>a.type==="asset"&&r.endsWith(".css")).map(([r,a])=>(delete n[r],String(a.source))).join(`
|
|
2
|
-
`);if(!i)return;const o=Object.values(n).find(r=>r.type==="chunk"&&r.isEntry);o?.type==="chunk"&&(o.code=`(function(){try{var s=document.createElement('style');s.setAttribute('data-tego-plugin',${JSON.stringify(e)});s.textContent=${JSON.stringify(i)};document.head.appendChild(s)}catch(e){}})();
|
|
3
|
-
${o.code}`)}}}s(D,"inlineCss");function C(){return{name:"tego-plugin-isolate-chunk-scope",renderChunk:{order:"post",handler(e){const t=new g(e);return t.prepend(`(function(){
|
|
4
|
-
`),t.append(`
|
|
5
|
-
})();`),{code:t.toString(),map:t.generateMap({hires:!0})}}}}}s(C,"isolateChunkScope");function P(e){const t=Object.fromEntries(l.map(i=>[i,`${_}${i}`])),n=e.development??!1;return{plugins:[D(e.pluginId??""),C()],mode:n?c.mode:"production",esbuild:{jsx:"automatic",jsxDev:!1},build:{outDir:e.outDir??"dist",emptyOutDir:!0,target:S,sourcemap:n?c.build.sourcemap:!1,minify:n?c.build.minify:!0,cssCodeSplit:!1,rollupOptions:{input:e.entry,external:[...l],output:{format:"system",paths:t,entryFileNames:"index.js",chunkFileNames:"[name]-[hash].js",assetFileNames:"[name]-[hash][extname]"},preserveEntrySignatures:"exports-only"}}}}s(P,"tegoPluginFrontend");export{c as TEGO_PLUGIN_DEV_OVERRIDES,P as tegoPluginFrontend,v as tegoPluginTailwind};
|
package/dist/chunk-BTHXQWHT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var U=Object.defineProperty;var a=(t,n)=>U(t,"name",{value:n,configurable:!0});var k=["bar-chart","bell","bookmark","book-open","bot","briefcase","building","calendar","chart-pie","clipboard-list","clock","contact","credit-card","database","file-text","folder","globe","handshake","inbox","key","layers","layout-dashboard","library","link","list-todo","mail","map-pin","message-square","mic","package","phone","puzzle","receipt","search","settings","shield","shopping-cart","sliders","sparkles","star","table","tag","target","trending-up","truck","users","wallet","workflow","wrench","zap"],E="puzzle",y=["node","python"],b=["linux/amd64","linux/arm64"],R="tego.plugin.json",_="openclaw.plugin.json",c={frontend:{dir:"frontend",entry:"index.js",i18nDir:"i18n"},backend:{dir:"backend",runtime:"node",entry:{node:"index.js",python:"app.py"},migrationsDir:"migrations",healthPath:"/healthz"},claw:{dir:"claw"},publicFrontend:{dir:"public-frontend",entry:"index.html"}};function G(t){return t.scope??(t.parts.claw?"avatar":"tenant")}a(G,"resolvePluginScope");function O(t){const n=t.declares??{};return{database:n.database??t.parts.backend!==void 0,storage:n.storage??!1,events:n.events??!1,notifications:n.notifications??!1}}a(O,"resolvePluginDeclares");var A=["frontend","backend","claw","publicFrontend"];function S(t){return A.filter(n=>t.parts[n]!==void 0)}a(S,"declaredPartNames");function C(t){const n={},e=t.parts.frontend;if(e){const i=e.dir??c.frontend.dir;n.frontend={dir:i,entryPath:`${i}/${e.entry??c.frontend.entry}`,i18nDirPath:`${i}/${e.i18nDir??c.frontend.i18nDir}`,nav:e.nav??[],...e.config?{config:e.config}:{}}}const r=t.parts.backend;if(r){const i=r.dir??c.backend.dir,l=r.runtime??c.backend.runtime;n.backend={dir:i,runtime:l,entryPath:`${i}/${r.entry??c.backend.entry[l]}`,platforms:l==="python"?[...r.platforms??b]:[],egress:[...new Set(r.egress??[])].sort(),migrationsDirPath:`${i}/${r.migrationsDir??c.backend.migrationsDir}`,...r.compatibilityRepairs?{compatibilityRepairs:r.compatibilityRepairs}:{},healthPath:r.healthPath??c.backend.healthPath,limits:r.limits??{},publicRoutes:r.publicRoutes??[],...r.config?{config:r.config}:{}}}const o=t.parts.claw;if(o){const i=o.dir??c.claw.dir;n.claw={dir:i,manifestPath:`${i}/${_}`,...o.hooks?{hooks:o.hooks}:{}}}const s=t.parts.publicFrontend;if(s){const i=s.dir??c.publicFrontend.dir;n.publicFrontend={dir:i,entryPath:`${i}/${c.publicFrontend.entry}`}}return n}a(C,"resolvePluginParts");var w=["GET","POST","PUT","PATCH","DELETE"],$="/public/plugins/api",P="/public/plugins/pages",m="/public/plugins/avatars/api",g="/public/plugins/avatars/pages",D=/^(?:\/(?:[A-Za-z0-9._~-]+|:[A-Za-z_][A-Za-z0-9_]*))+$/;function p(t){return t.split("/").slice(1)}a(p,"segments");function d(t){return t.startsWith(":")}a(d,"isParam");function I(t){return`${t.method} ${t.path}`}a(I,"formatPublicRoute");function F(t){if(!D.test(t))return'must be "/"-separated literal segments or ":name" parameters, e.g. "/public/inspections/:token"';const n=p(t);if(n.some(r=>/^\.+$/.test(r)))return'must not contain "." or ".." segments';const e=n.filter(d);return new Set(e).size!==e.length?"must not repeat a parameter name":null}a(F,"publicRoutePathProblem");function z(t,n){if(t.method!==n.method)return!1;const e=p(t.path),r=p(n.path);return e.length!==r.length?!1:e.every((o,s)=>{const i=r[s];return d(o)||d(i)||o===i})}a(z,"publicRoutesOverlap");function M(t,n,e){const r=n.toUpperCase(),o=p(e.startsWith("/")?e:`/${e}`);if(o.some(s=>s===""))return null;for(const s of t){if(s.method!==r)continue;const i=p(s.path);if(i.length!==o.length)continue;const l={};if(i.every((u,T)=>{const h=o[T];return d(u)?(l[u.slice(1)]=h,!0):u===h}))return{route:I(s),params:l}}return null}a(M,"matchPublicRoute");function x(t){const n=t.indexOf(`${g}/`);if(n!==-1){const i=t.slice(n+g.length+1),[l,f,u]=i.split("/");return!l||!f||!u?null:`${t.slice(0,n)}${m}/${l}/${f}/${u}`}const e=t.indexOf(`${P}/`);if(e===-1)return null;const r=t.slice(e+P.length+1),[o,s]=r.split("/");return!o||!s?null:`${t.slice(0,e)}${$}/${o}/${s}`}a(x,"publicApiBaseFromPagePath");var B="/p",H="plugin-api",j=["zh-CN","zh-TW","en","ja","ko","de","es","fr","it","pt"];function N(t){return`plugin.${t}`}a(N,"pluginI18nNamespace");function K(t,n){return`${N(t)}:${n}`}a(K,"pluginI18nKey");function v(t,n){return`plugin-${t}-${n}`}a(v,"pluginMenuKey");var W=100;function L(t){return`${B}/${t}`}a(L,"pluginBasePath");function V(t,n){const e=L(t);return!n||n==="/"?e:`${e}${n}`}a(V,"pluginNavPath");function Z(t,n="/"){const e=n.startsWith("/")?n:`/${n}`;return`${H}/${t}${e==="/"?"":e}`}a(Z,"pluginApiPath");function q(t,n="zh-CN"){return typeof t=="string"?t:t[n]??t.en??Object.values(t)[0]??""}a(q,"localizedTextToString");function X(t,n){return`menu.${v(t,n)}`}a(X,"pluginMenuPermission");export{_ as CLAW_MANIFEST_FILENAME,W as MAX_PLUGIN_MENU_PERMISSION_LENGTH,m as PLUGIN_AVATAR_PUBLIC_API_PATH,g as PLUGIN_AVATAR_PUBLIC_PAGES_PATH,b as PLUGIN_BACKEND_PLATFORMS,y as PLUGIN_BACKEND_RUNTIMES,R as PLUGIN_MANIFEST_FILENAME,k as PLUGIN_NAV_ICONS,E as PLUGIN_NAV_ICON_FALLBACK,c as PLUGIN_PART_DEFAULTS,A as PLUGIN_PART_NAMES,$ as PLUGIN_PUBLIC_API_PATH,P as PLUGIN_PUBLIC_PAGES_PATH,w as PLUGIN_PUBLIC_ROUTE_METHODS,j as PLUGIN_SUPPORTED_LOCALES,S as declaredPartNames,I as formatPublicRoute,q as localizedTextToString,M as matchPublicRoute,Z as pluginApiPath,L as pluginBasePath,K as pluginI18nKey,N as pluginI18nNamespace,v as pluginMenuKey,X as pluginMenuPermission,V as pluginNavPath,x as publicApiBaseFromPagePath,F as publicRoutePathProblem,z as publicRoutesOverlap,O as resolvePluginDeclares,C as resolvePluginParts,G as resolvePluginScope};
|
package/dist/chunk-ROFUQLOZ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var o=(t,e)=>d(t,"name",{value:e,configurable:!0});var PLUGIN_NAV_ICONS=["bar-chart","bell","bookmark","book-open","bot","briefcase","building","calendar","chart-pie","clipboard-list","clock","contact","credit-card","database","file-text","folder","globe","handshake","inbox","key","layers","layout-dashboard","library","link","list-todo","mail","map-pin","message-square","mic","package","phone","puzzle","receipt","search","settings","shield","shopping-cart","sliders","sparkles","star","table","tag","target","trending-up","truck","users","wallet","workflow","wrench","zap"],PLUGIN_NAV_ICON_FALLBACK="puzzle",PLUGIN_BACKEND_RUNTIMES=["node","python"],PLUGIN_BACKEND_PLATFORMS=["linux/amd64","linux/arm64"],PLUGIN_MANIFEST_FILENAME="tego.plugin.json",CLAW_MANIFEST_FILENAME="openclaw.plugin.json",PLUGIN_PART_DEFAULTS={frontend:{dir:"frontend",entry:"index.js",i18nDir:"i18n"},backend:{dir:"backend",runtime:"node",entry:{node:"index.js",python:"app.py"},migrationsDir:"migrations",healthPath:"/healthz"},claw:{dir:"claw"},publicFrontend:{dir:"public-frontend",entry:"index.html"}};function resolvePluginScope(t){return t.scope??(t.parts.claw?"avatar":"tenant")}o(resolvePluginScope,"resolvePluginScope");function resolvePluginDeclares(t){const e=t.declares??{};return{database:e.database??t.parts.backend!==void 0,storage:e.storage??!1,events:e.events??!1,notifications:e.notifications??!1}}o(resolvePluginDeclares,"resolvePluginDeclares");var PLUGIN_PART_NAMES=["frontend","backend","claw","publicFrontend"];function declaredPartNames(t){return PLUGIN_PART_NAMES.filter(e=>t.parts[e]!==void 0)}o(declaredPartNames,"declaredPartNames");function resolvePluginParts(t){const e={},n=t.parts.frontend;if(n){const i=n.dir??PLUGIN_PART_DEFAULTS.frontend.dir;e.frontend={dir:i,entryPath:`${i}/${n.entry??PLUGIN_PART_DEFAULTS.frontend.entry}`,i18nDirPath:`${i}/${n.i18nDir??PLUGIN_PART_DEFAULTS.frontend.i18nDir}`,nav:n.nav??[],...n.config?{config:n.config}:{}}}const r=t.parts.backend;if(r){const i=r.dir??PLUGIN_PART_DEFAULTS.backend.dir,l=r.runtime??PLUGIN_PART_DEFAULTS.backend.runtime;e.backend={dir:i,runtime:l,entryPath:`${i}/${r.entry??PLUGIN_PART_DEFAULTS.backend.entry[l]}`,platforms:l==="python"?[...r.platforms??PLUGIN_BACKEND_PLATFORMS]:[],egress:[...new Set(r.egress??[])].sort(),migrationsDirPath:`${i}/${r.migrationsDir??PLUGIN_PART_DEFAULTS.backend.migrationsDir}`,...r.compatibilityRepairs?{compatibilityRepairs:r.compatibilityRepairs}:{},healthPath:r.healthPath??PLUGIN_PART_DEFAULTS.backend.healthPath,limits:r.limits??{},publicRoutes:r.publicRoutes??[],...r.config?{config:r.config}:{}}}const s=t.parts.claw;if(s){const i=s.dir??PLUGIN_PART_DEFAULTS.claw.dir;e.claw={dir:i,manifestPath:`${i}/${CLAW_MANIFEST_FILENAME}`,...s.hooks?{hooks:s.hooks}:{}}}const a=t.parts.publicFrontend;if(a){const i=a.dir??PLUGIN_PART_DEFAULTS.publicFrontend.dir;e.publicFrontend={dir:i,entryPath:`${i}/${PLUGIN_PART_DEFAULTS.publicFrontend.entry}`}}return e}o(resolvePluginParts,"resolvePluginParts");var PLUGIN_PUBLIC_ROUTE_METHODS=["GET","POST","PUT","PATCH","DELETE"],PLUGIN_PUBLIC_API_PATH="/public/plugins/api",PLUGIN_PUBLIC_PAGES_PATH="/public/plugins/pages",PLUGIN_AVATAR_PUBLIC_API_PATH="/public/plugins/avatars/api",PLUGIN_AVATAR_PUBLIC_PAGES_PATH="/public/plugins/avatars/pages",PUBLIC_ROUTE_PATH_PATTERN=/^(?:\/(?:[A-Za-z0-9._~-]+|:[A-Za-z_][A-Za-z0-9_]*))+$/;function segments(t){return t.split("/").slice(1)}o(segments,"segments");function isParam(t){return t.startsWith(":")}o(isParam,"isParam");function formatPublicRoute(t){return`${t.method} ${t.path}`}o(formatPublicRoute,"formatPublicRoute");function publicRoutePathProblem(t){if(!PUBLIC_ROUTE_PATH_PATTERN.test(t))return'must be "/"-separated literal segments or ":name" parameters, e.g. "/public/inspections/:token"';const e=segments(t);if(e.some(r=>/^\.+$/.test(r)))return'must not contain "." or ".." segments';const n=e.filter(isParam);return new Set(n).size!==n.length?"must not repeat a parameter name":null}o(publicRoutePathProblem,"publicRoutePathProblem");function publicRoutesOverlap(t,e){if(t.method!==e.method)return!1;const n=segments(t.path),r=segments(e.path);return n.length!==r.length?!1:n.every((s,a)=>{const i=r[a];return isParam(s)||isParam(i)||s===i})}o(publicRoutesOverlap,"publicRoutesOverlap");function matchPublicRoute(t,e,n){const r=e.toUpperCase(),s=segments(n.startsWith("/")?n:`/${n}`);if(s.some(a=>a===""))return null;for(const a of t){if(a.method!==r)continue;const i=segments(a.path);if(i.length!==s.length)continue;const l={};if(i.every((c,P)=>{const p=s[P];return isParam(c)?(l[c.slice(1)]=p,!0):c===p}))return{route:formatPublicRoute(a),params:l}}return null}o(matchPublicRoute,"matchPublicRoute");function publicApiBaseFromPagePath(t){const e=t.indexOf(`${PLUGIN_AVATAR_PUBLIC_PAGES_PATH}/`);if(e!==-1){const i=t.slice(e+PLUGIN_AVATAR_PUBLIC_PAGES_PATH.length+1),[l,u,c]=i.split("/");return!l||!u||!c?null:`${t.slice(0,e)}${PLUGIN_AVATAR_PUBLIC_API_PATH}/${l}/${u}/${c}`}const n=t.indexOf(`${PLUGIN_PUBLIC_PAGES_PATH}/`);if(n===-1)return null;const r=t.slice(n+PLUGIN_PUBLIC_PAGES_PATH.length+1),[s,a]=r.split("/");return!s||!a?null:`${t.slice(0,n)}${PLUGIN_PUBLIC_API_PATH}/${s}/${a}`}o(publicApiBaseFromPagePath,"publicApiBaseFromPagePath");var PLUGIN_ROUTE_ROOT="/p",PLUGIN_API_ROOT="plugin-api",PLUGIN_SUPPORTED_LOCALES=["zh-CN","zh-TW","en","ja","ko","de","es","fr","it","pt"];function pluginI18nNamespace(t){return`plugin.${t}`}o(pluginI18nNamespace,"pluginI18nNamespace");function pluginI18nKey(t,e){return`${pluginI18nNamespace(t)}:${e}`}o(pluginI18nKey,"pluginI18nKey");function pluginMenuKey(t,e){return`plugin-${t}-${e}`}o(pluginMenuKey,"pluginMenuKey");var MAX_PLUGIN_MENU_PERMISSION_LENGTH=100;function pluginBasePath(t){return`${PLUGIN_ROUTE_ROOT}/${t}`}o(pluginBasePath,"pluginBasePath");function pluginNavPath(t,e){const n=pluginBasePath(t);return!e||e==="/"?n:`${n}${e}`}o(pluginNavPath,"pluginNavPath");function pluginApiPath(t,e="/"){const n=e.startsWith("/")?e:`/${e}`;return`${PLUGIN_API_ROOT}/${t}${n==="/"?"":n}`}o(pluginApiPath,"pluginApiPath");function localizedTextToString(t,e="zh-CN"){return typeof t=="string"?t:t[e]??t.en??Object.values(t)[0]??""}o(localizedTextToString,"localizedTextToString");function pluginMenuPermission(t,e){return`menu.${pluginMenuKey(t,e)}`}o(pluginMenuPermission,"pluginMenuPermission"),exports.CLAW_MANIFEST_FILENAME=CLAW_MANIFEST_FILENAME,exports.MAX_PLUGIN_MENU_PERMISSION_LENGTH=MAX_PLUGIN_MENU_PERMISSION_LENGTH,exports.PLUGIN_AVATAR_PUBLIC_API_PATH=PLUGIN_AVATAR_PUBLIC_API_PATH,exports.PLUGIN_AVATAR_PUBLIC_PAGES_PATH=PLUGIN_AVATAR_PUBLIC_PAGES_PATH,exports.PLUGIN_BACKEND_PLATFORMS=PLUGIN_BACKEND_PLATFORMS,exports.PLUGIN_BACKEND_RUNTIMES=PLUGIN_BACKEND_RUNTIMES,exports.PLUGIN_MANIFEST_FILENAME=PLUGIN_MANIFEST_FILENAME,exports.PLUGIN_NAV_ICONS=PLUGIN_NAV_ICONS,exports.PLUGIN_NAV_ICON_FALLBACK=PLUGIN_NAV_ICON_FALLBACK,exports.PLUGIN_PART_DEFAULTS=PLUGIN_PART_DEFAULTS,exports.PLUGIN_PART_NAMES=PLUGIN_PART_NAMES,exports.PLUGIN_PUBLIC_API_PATH=PLUGIN_PUBLIC_API_PATH,exports.PLUGIN_PUBLIC_PAGES_PATH=PLUGIN_PUBLIC_PAGES_PATH,exports.PLUGIN_PUBLIC_ROUTE_METHODS=PLUGIN_PUBLIC_ROUTE_METHODS,exports.PLUGIN_SUPPORTED_LOCALES=PLUGIN_SUPPORTED_LOCALES,exports.declaredPartNames=declaredPartNames,exports.formatPublicRoute=formatPublicRoute,exports.localizedTextToString=localizedTextToString,exports.matchPublicRoute=matchPublicRoute,exports.pluginApiPath=pluginApiPath,exports.pluginBasePath=pluginBasePath,exports.pluginI18nKey=pluginI18nKey,exports.pluginI18nNamespace=pluginI18nNamespace,exports.pluginMenuKey=pluginMenuKey,exports.pluginMenuPermission=pluginMenuPermission,exports.pluginNavPath=pluginNavPath,exports.publicApiBaseFromPagePath=publicApiBaseFromPagePath,exports.publicRoutePathProblem=publicRoutePathProblem,exports.publicRoutesOverlap=publicRoutesOverlap,exports.resolvePluginDeclares=resolvePluginDeclares,exports.resolvePluginParts=resolvePluginParts,exports.resolvePluginScope=resolvePluginScope;
|
package/dist/chunk-W7C357A6.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var s=(e,t)=>l(e,"name",{value:t,configurable:!0});var chunkC2OCOPZQ_cjs=require("./chunk-C2OCOPZQ.cjs"),MagicString=require("magic-string"),module$1=require("module"),path=require("path");function _interopDefault(e){return e&&e.__esModule?e:{default:e}}s(_interopDefault,"_interopDefault");var MagicString__default=_interopDefault(MagicString),UI_PACKAGE="@tego/ui",UI_PRESET="@tego/ui/tailwind-preset",OPTIONAL_COMPONENT_PACKAGES=["@tego/plugin-access-ui"],COMPILED_CODE_GLOB="**/*.{js,cjs}";function tegoPluginTailwind({pluginId:e,root:t,content:n}){const i=module$1.createRequire(path.join(t,"vite.config.ts")),a=s(u=>path.join(path.dirname(i.resolve(u)),COMPILED_CODE_GLOB),"compiledCodeOf");let r;try{r=i(UI_PRESET)}catch(u){throw new Error(`tegoPluginTailwind: cannot resolve ${UI_PRESET} from ${t}; install ${UI_PACKAGE} in the plugin`,{cause:u})}const o=OPTIONAL_COMPONENT_PACKAGES.flatMap(u=>{try{return[a(u)]}catch{return[]}});return{presets:[r],content:[...n,a(UI_PACKAGE),...o],corePlugins:{preflight:!1},important:`.${e}`}}s(tegoPluginTailwind,"tegoPluginTailwind");var SHARED_MODULE_URL_PREFIX="tego-shared:",BROWSER_TARGET=["chrome87","firefox78","safari14","edge88"],TEGO_PLUGIN_DEV_OVERRIDES={mode:"development",build:{minify:!1,sourcemap:"inline"}};function inlineCss(e){return{name:"tego-plugin-inline-css",enforce:"post",generateBundle(t,n){const i=Object.entries(n).filter(([r,o])=>o.type==="asset"&&r.endsWith(".css")).map(([r,o])=>(delete n[r],String(o.source))).join(`
|
|
2
|
-
`);if(!i)return;const a=Object.values(n).find(r=>r.type==="chunk"&&r.isEntry);a?.type==="chunk"&&(a.code=`(function(){try{var s=document.createElement('style');s.setAttribute('data-tego-plugin',${JSON.stringify(e)});s.textContent=${JSON.stringify(i)};document.head.appendChild(s)}catch(e){}})();
|
|
3
|
-
${a.code}`)}}}s(inlineCss,"inlineCss");function isolateChunkScope(){return{name:"tego-plugin-isolate-chunk-scope",renderChunk:{order:"post",handler(e){const t=new MagicString__default.default(e);return t.prepend(`(function(){
|
|
4
|
-
`),t.append(`
|
|
5
|
-
})();`),{code:t.toString(),map:t.generateMap({hires:!0})}}}}}s(isolateChunkScope,"isolateChunkScope");function tegoPluginFrontend(e){const t=Object.fromEntries(chunkC2OCOPZQ_cjs.SHARED_MODULE_IDS.map(i=>[i,`${SHARED_MODULE_URL_PREFIX}${i}`])),n=e.development??!1;return{plugins:[inlineCss(e.pluginId??""),isolateChunkScope()],mode:n?TEGO_PLUGIN_DEV_OVERRIDES.mode:"production",esbuild:{jsx:"automatic",jsxDev:!1},build:{outDir:e.outDir??"dist",emptyOutDir:!0,target:BROWSER_TARGET,sourcemap:n?TEGO_PLUGIN_DEV_OVERRIDES.build.sourcemap:!1,minify:n?TEGO_PLUGIN_DEV_OVERRIDES.build.minify:!0,cssCodeSplit:!1,rollupOptions:{input:e.entry,external:[...chunkC2OCOPZQ_cjs.SHARED_MODULE_IDS],output:{format:"system",paths:t,entryFileNames:"index.js",chunkFileNames:"[name]-[hash].js",assetFileNames:"[name]-[hash][extname]"},preserveEntrySignatures:"exports-only"}}}}s(tegoPluginFrontend,"tegoPluginFrontend"),exports.TEGO_PLUGIN_DEV_OVERRIDES=TEGO_PLUGIN_DEV_OVERRIDES,exports.tegoPluginFrontend=tegoPluginFrontend,exports.tegoPluginTailwind=tegoPluginTailwind;
|