@ourofoundation/ouro-js 3.5.6 → 3.5.8

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.
Files changed (38) hide show
  1. package/dist/chunk-4UE3XIYR.js +2 -0
  2. package/dist/chunk-4UE3XIYR.js.map +1 -0
  3. package/dist/chunk-DBEBXFQI.cjs +2 -0
  4. package/dist/chunk-DBEBXFQI.cjs.map +1 -0
  5. package/dist/chunk-LQOKGPEK.js +2 -0
  6. package/dist/chunk-LQOKGPEK.js.map +1 -0
  7. package/dist/{chunk-R2W4NEEJ.js → chunk-NABNY2EN.js} +2 -2
  8. package/dist/chunk-NABNY2EN.js.map +1 -0
  9. package/dist/chunk-TUZS3DKI.cjs +2 -0
  10. package/dist/chunk-TUZS3DKI.cjs.map +1 -0
  11. package/dist/chunk-USO3MLKI.cjs +2 -0
  12. package/dist/chunk-USO3MLKI.cjs.map +1 -0
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/schema/conversations.cjs +1 -1
  16. package/dist/schema/conversations.d.cts +7 -7
  17. package/dist/schema/conversations.d.ts +7 -7
  18. package/dist/schema/conversations.js +1 -1
  19. package/dist/schema/quests.cjs +1 -1
  20. package/dist/schema/quests.d.cts +12 -0
  21. package/dist/schema/quests.d.ts +12 -0
  22. package/dist/schema/quests.js +1 -1
  23. package/dist/utils/air/index.cjs +1 -1
  24. package/dist/utils/air/index.d.cts +4 -2
  25. package/dist/utils/air/index.d.ts +4 -2
  26. package/dist/utils/air/index.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/chunk-BWAEBQKV.cjs +0 -2
  29. package/dist/chunk-BWAEBQKV.cjs.map +0 -1
  30. package/dist/chunk-L2EAP5SJ.cjs +0 -2
  31. package/dist/chunk-L2EAP5SJ.cjs.map +0 -1
  32. package/dist/chunk-PONEAJK7.js +0 -2
  33. package/dist/chunk-PONEAJK7.js.map +0 -1
  34. package/dist/chunk-QR2BSJ2C.js +0 -2
  35. package/dist/chunk-QR2BSJ2C.js.map +0 -1
  36. package/dist/chunk-R2W4NEEJ.js.map +0 -1
  37. package/dist/chunk-W73NWPCZ.cjs +0 -2
  38. package/dist/chunk-W73NWPCZ.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-IWOXGKK4.js';import {b,c,d,a as a$1}from'./chunk-SR5UZ4NP.js';import {b as b$1}from'./chunk-3N56ERWF.js';import {a,b as b$2,d as d$1}from'./chunk-WRHPQNEL.js';import {object,array,string,optional,nullable,literal,uuid,number,record,any}from'zod';var z=object({members:array(string())}),v=z.extend(b.partial().shape),U=c.extend({asset_type:a.default("conversation"),name:nullable(string()),metadata:v,users:optional(nullable(array(b$1)))}),S=d.extend({asset_type:literal("conversation").default("conversation"),monetization:d$1.default("none"),visibility:b$2.default("private"),name:string().optional().nullable().default("").transform(e=>e==null?void 0:e.trim()).transform(e=>e||null),metadata:v}),j=S.transform(e=>a$1(e)),B=S.omit({id:true,org_id:true,team_id:true}).partial().transform(e=>a$1(e)),P=object({id:uuid(),conversation_id:uuid(),turn_id:uuid(),seq:number(),user_id:uuid(),user:optional(nullable(b$1)),type:string().default("message"),created_at:string(),last_updated:string(),viewers:array(uuid()),json:a$2,text:string(),metadata:optional(nullable(record(string(),any())))});export{U as a,j as b,B as c,P as d};//# sourceMappingURL=chunk-4UE3XIYR.js.map
2
+ //# sourceMappingURL=chunk-4UE3XIYR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/conversations.ts"],"names":["BaseConversationMetadataSchema","object","array","string","ConversationMetadataSchema","AssetMetadataSchema","ConversationSchema","AssetSchema","AssetTypeSchema","nullable","optional","ProfileSchema","BaseCreateConversationSchema","CreateAssetSchema","literal","MonetizationSchema","VisibilitySchema","x","CreateConversationSchema","value","normalizeAssetConfigForParsing","UpdateConversationSchema","MessageSchema","uuid","number","TipTapSchema","record","any"],"mappings":"oRA4BMA,IAAAA,CAAAA,CAAiCC,OAAO,C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AiBA,CAAAA,IAAAA,GACjB,OAASA,CAAAA,IAAAA,GACT,GAAKC,CAAAA,MAAAA,GACL,OAASD,CAAAA,IAAAA,GACT,IAAMb,CAAAA,QAAAA,CAASD,SAASE,GAAa,CAAC,EACtC,IAAMR,CAAAA,MAAAA,GAAS,OAAQ,CAAA,SAAS,CAChC,CAAA,UAAA,CAAYA,MAAO,EAAA,CACnB,aAAcA,MAAO,EAAA,CACrB,QAASD,KAAMqB,CAAAA,IAAAA,EAAM,CACrB,CAAA,IAAA,CAAME,GACN,CAAA,IAAA,CAAMtB,MAAO,EAAA,CACb,SAAUO,QAASD,CAAAA,QAAAA,CAASiB,OAAOvB,MAAO,EAAA,CAAGwB,KAAK,CAAC,CAAC,CACtD,CAAC","file":"chunk-4UE3XIYR.js","sourcesContent":["import {\n object,\n string,\n number,\n uuid,\n array,\n type z,\n record,\n any,\n optional,\n nullable,\n literal\n} from \"zod\";\n\nimport {\n AssetTypeSchema,\n MonetizationSchema,\n VisibilitySchema,\n} from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { TipTapSchema } from \"./posts\";\nimport { ProfileSchema } from \"./users\";\n\nconst BaseConversationMetadataSchema = object({\n members: array(string()),\n});\n\nconst ConversationMetadataSchema = BaseConversationMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ConversationSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.default(\"conversation\"),\n // Agents often name conversations after the first exchange; allow null until then.\n name: nullable(string()),\n metadata: ConversationMetadataSchema,\n users: optional(nullable(array(ProfileSchema))),\n});\n\nconst BaseCreateConversationSchema = CreateAssetSchema.extend({\n asset_type: literal(\"conversation\").default(\"conversation\"),\n monetization: MonetizationSchema.default(\"none\"),\n visibility: VisibilitySchema.default(\"private\"),\n // Optional like posts — leave blank and let a responding agent name it.\n name: string()\n .optional()\n .nullable()\n .default(\"\")\n .transform((x) => x?.trim())\n .transform((x) => x || null),\n metadata: ConversationMetadataSchema,\n});\n\nconst CreateConversationSchema = BaseCreateConversationSchema\n .transform((value) => normalizeAssetConfigForParsing(value));\n\n// Partial because we can make updates to conversations without providing all fields\nconst UpdateConversationSchema = BaseCreateConversationSchema.omit({\n id: true,\n org_id: true,\n team_id: true,\n // team: true,\n // user: true,\n // organization: true,\n // slug: true,\n}).partial().transform((value) => normalizeAssetConfigForParsing(value));\n\nconst MessageSchema = object({\n id: uuid(),\n conversation_id: uuid(),\n turn_id: uuid(),\n seq: number(),\n user_id: uuid(),\n user: optional(nullable(ProfileSchema)),\n type: string().default(\"message\"),\n created_at: string(),\n last_updated: string(),\n viewers: array(uuid()),\n json: TipTapSchema,\n text: string(),\n metadata: optional(nullable(record(string(), any()))),\n});\n\nexport {\n MessageSchema,\n UpdateConversationSchema,\n CreateConversationSchema,\n ConversationSchema,\n};\nexport type Conversation = z.infer<typeof ConversationSchema>;\nexport type CreateConversation = z.infer<typeof CreateConversationSchema>;\nexport type UpdateConversation = z.infer<typeof UpdateConversationSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkF5CWCYOP_cjs=require('./chunk-F5CWCYOP.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var z=zod.object({members:zod.array(zod.string())}),v=z.extend(chunkROMY5WNQ_cjs.b.partial().shape),U=chunkROMY5WNQ_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.default("conversation"),name:zod.nullable(zod.string()),metadata:v,users:zod.optional(zod.nullable(zod.array(chunkGY6SLMMJ_cjs.b)))}),S=chunkROMY5WNQ_cjs.d.extend({asset_type:zod.literal("conversation").default("conversation"),monetization:chunk43KB23BA_cjs.d.default("none"),visibility:chunk43KB23BA_cjs.b.default("private"),name:zod.string().optional().nullable().default("").transform(e=>e==null?void 0:e.trim()).transform(e=>e||null),metadata:v}),j=S.transform(e=>chunkROMY5WNQ_cjs.a(e)),B=S.omit({id:true,org_id:true,team_id:true}).partial().transform(e=>chunkROMY5WNQ_cjs.a(e)),P=zod.object({id:zod.uuid(),conversation_id:zod.uuid(),turn_id:zod.uuid(),seq:zod.number(),user_id:zod.uuid(),user:zod.optional(zod.nullable(chunkGY6SLMMJ_cjs.b)),type:zod.string().default("message"),created_at:zod.string(),last_updated:zod.string(),viewers:zod.array(zod.uuid()),json:chunkF5CWCYOP_cjs.a,text:zod.string(),metadata:zod.optional(zod.nullable(zod.record(zod.string(),zod.any())))});exports.a=U;exports.b=j;exports.c=B;exports.d=P;//# sourceMappingURL=chunk-DBEBXFQI.cjs.map
2
+ //# sourceMappingURL=chunk-DBEBXFQI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/conversations.ts"],"names":["BaseConversationMetadataSchema","object","array","string","ConversationMetadataSchema","AssetMetadataSchema","ConversationSchema","AssetSchema","AssetTypeSchema","nullable","optional","ProfileSchema","BaseCreateConversationSchema","CreateAssetSchema","literal","MonetizationSchema","VisibilitySchema","x","CreateConversationSchema","value","normalizeAssetConfigForParsing","UpdateConversationSchema","MessageSchema","uuid","number","TipTapSchema","record","any"],"mappings":"4OA4BMA,IAAAA,CAAAA,CAAiCC,WAAO,CAC5C,OAAA,CAASC,UAAMC,UAAO,EAAC,CACzB,CAAC,CAAA,CAEKC,EAA6BJ,CAA+B,CAAA,MAAA,CAChEK,oBAAoB,OAAQ,EAAA,CAAE,KAChC,CAEMC,CAAAA,CAAAA,CAAqBC,oBAAY,MAAO,CAAA,CAC5C,UAAYC,CAAAA,mBAAAA,CAAgB,OAAQ,CAAA,cAAc,EAElD,IAAMC,CAAAA,YAAAA,CAASN,YAAQ,CAAA,CACvB,SAAUC,CACV,CAAA,KAAA,CAAOM,aAASD,YAASP,CAAAA,SAAAA,CAAMS,mBAAa,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MtB,UAAO,EAAA,CACb,SAAUO,YAASD,CAAAA,YAAAA,CAASiB,WAAOvB,UAAO,EAAA,CAAGwB,SAAK,CAAC,CAAC,CACtD,CAAC","file":"chunk-DBEBXFQI.cjs","sourcesContent":["import {\n object,\n string,\n number,\n uuid,\n array,\n type z,\n record,\n any,\n optional,\n nullable,\n literal\n} from \"zod\";\n\nimport {\n AssetTypeSchema,\n MonetizationSchema,\n VisibilitySchema,\n} from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { TipTapSchema } from \"./posts\";\nimport { ProfileSchema } from \"./users\";\n\nconst BaseConversationMetadataSchema = object({\n members: array(string()),\n});\n\nconst ConversationMetadataSchema = BaseConversationMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ConversationSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.default(\"conversation\"),\n // Agents often name conversations after the first exchange; allow null until then.\n name: nullable(string()),\n metadata: ConversationMetadataSchema,\n users: optional(nullable(array(ProfileSchema))),\n});\n\nconst BaseCreateConversationSchema = CreateAssetSchema.extend({\n asset_type: literal(\"conversation\").default(\"conversation\"),\n monetization: MonetizationSchema.default(\"none\"),\n visibility: VisibilitySchema.default(\"private\"),\n // Optional like posts — leave blank and let a responding agent name it.\n name: string()\n .optional()\n .nullable()\n .default(\"\")\n .transform((x) => x?.trim())\n .transform((x) => x || null),\n metadata: ConversationMetadataSchema,\n});\n\nconst CreateConversationSchema = BaseCreateConversationSchema\n .transform((value) => normalizeAssetConfigForParsing(value));\n\n// Partial because we can make updates to conversations without providing all fields\nconst UpdateConversationSchema = BaseCreateConversationSchema.omit({\n id: true,\n org_id: true,\n team_id: true,\n // team: true,\n // user: true,\n // organization: true,\n // slug: true,\n}).partial().transform((value) => normalizeAssetConfigForParsing(value));\n\nconst MessageSchema = object({\n id: uuid(),\n conversation_id: uuid(),\n turn_id: uuid(),\n seq: number(),\n user_id: uuid(),\n user: optional(nullable(ProfileSchema)),\n type: string().default(\"message\"),\n created_at: string(),\n last_updated: string(),\n viewers: array(uuid()),\n json: TipTapSchema,\n text: string(),\n metadata: optional(nullable(record(string(), any()))),\n});\n\nexport {\n MessageSchema,\n UpdateConversationSchema,\n CreateConversationSchema,\n ConversationSchema,\n};\nexport type Conversation = z.infer<typeof ConversationSchema>;\nexport type CreateConversation = z.infer<typeof CreateConversationSchema>;\nexport type UpdateConversation = z.infer<typeof UpdateConversationSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\n"]}
@@ -0,0 +1,2 @@
1
+ function T(e){return e==="default"?"card":e==="chart"?"preview":e==="preview"||e==="interactive"||e==="card"||e==="list"?e:"card"}function E(e){let s={};if(e.displayConfig&&(s=typeof e.displayConfig=="string"?JSON.parse(e.displayConfig):{...e.displayConfig}),s.visualizationId===void 0&&e.visualizationId&&(s.visualizationId=e.visualizationId),s.filters===void 0&&e.filters){let r=e.filters;s.filters=typeof r=="string"?JSON.parse(r):r;}return s}var v="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",C=new RegExp(`^(post|dataset|file|service|route):(${v})$`,"i"),h=new RegExp(`^asset:(${v})$`,"i"),A=new Set(["post","dataset","file","service","route"]);function I(e){let s=C.exec(e);if(s){let l=s[1].toLowerCase();return A.has(l)?{id:s[2],assetType:l,legacy:false}:null}let r=h.exec(e);return r?{id:r[1],legacy:true}:null}function x(e,s){let r;try{if(e.startsWith("/"))r=e;else {let c=new URL(e);if(s){let g=new URL(s).host;if(c.host!==g)return null}r=c.pathname;}}catch{return null}let l=r.match(/^\/(\w+)s\/([^/]+)\/([^/?#]+)/);if(!l)return null;let[,o,d,p]=l;return A.has(o)?{assetType:o,entity:decodeURIComponent(d),slug:decodeURIComponent(p)}:null}var y=e=>Array.isArray(e)?e.map(y):e!=null&&e.content?Array.isArray(e.content)?e.content.map(y).flat():y(e.content):e;function k(e,s){var g;if(!e||!(e!=null&&e.content))return {users:[],assets:[],linkedAssets:[]};let r=e.content.map(y).flat(),l=r.filter(t=>t.type==="mention").map(t=>{var n,i,f;return {user_id:(n=t.attrs)==null?void 0:n.id,username:((i=t.attrs)==null?void 0:i.label)||((f=t.attrs)==null?void 0:f.username)}}).reduce((t,n)=>(t.some(i=>i.user_id&&n.user_id&&i.user_id===n.user_id||i.username&&n.username&&i.username===n.username)||t.push(n),t),[]),o=r.filter(t=>{var n,i;return t.type==="assetComponent"&&((n=t.attrs)==null?void 0:n.id)&&!((i=t.attrs)!=null&&i.partial)}).map(({attrs:t})=>({id:t.id,assetType:t.assetType,via:"embed"})).reduce((t,n)=>(t.some(i=>i.id===n.id)||t.push(n),t),[]),d=[],p=new Set(o.map(t=>t.id)),c=new Set;for(let t of r){if((t==null?void 0:t.type)!=="text"||!(t!=null&&t.marks))continue;let n=t.marks.find(a=>a.type==="link");if(!((g=n==null?void 0:n.attrs)!=null&&g.href))continue;let i=n.attrs.href,f=I(i);if(f){let a=f.id;p.has(a)||(p.add(a),f.legacy?o.push({id:a,via:"link",legacy:true}):o.push({id:a,assetType:f.assetType,via:"link",legacy:false}));continue}let u=x(i,s==null?void 0:s.siteUrl);if(u){let a=`${u.assetType}:${u.entity}:${u.slug}`;c.has(a)||(c.add(a),d.push(u));}}return {users:l,assets:o,linkedAssets:d}}export{T as a,E as b,I as c,x as d,k as e};//# sourceMappingURL=chunk-LQOKGPEK.js.map
2
+ //# sourceMappingURL=chunk-LQOKGPEK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/air/index.ts"],"names":["normalizeViewMode","raw","resolveDisplayConfig","attrs","base","UUID_RE","TYPED_ASSET_LINK_RE","LEGACY_ASSET_LINK_RE","VALID_ASSET_TYPES","parseAssetLinkShorthand","href","typed","assetType","legacy","parseOuroAssetUrl","siteUrl","pathname","url","siteHost","match","entity","slug","extractContent","item","getReferencesInContent","json","options","_a","content","users","_b","_c","unique","u","assets","linkedAssets","seenAssetIds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CAAM,CAAA,CAAA,EAAGD,EAAO,SAAS,CAAA,CAAA,EAAIA,CAAO,CAAA,MAAM,IAAIA,CAAO,CAAA,IAAI,CAC1DL,CAAAA,CAAAA,CAAAA,CAAe,IAAIM,CAAG,CAAA,GACzBN,CAAe,CAAA,GAAA,CAAIM,CAAG,CACtBT,CAAAA,CAAAA,CAAa,IAAKQ,CAAAA,CAAM,GAE5B,CACF,CAEA,OAAO,CACL,MAAAd,CACA,CAAA,MAAA,CAAAK,CACA,CAAA,YAAA,CAAAC,CACF,CACF","file":"chunk-LQOKGPEK.js","sourcesContent":["import { Content } from \"../../schema/posts\";\nimport { Profile } from \"../../schema/users\";\n\nexport interface DataFilter {\n column: string;\n value: string;\n operator: string;\n active?: boolean;\n}\n\nexport interface DisplayConfig {\n /** Dataset: ID of a saved visualization to render instead of the default chart. */\n visualizationId?: string | null;\n /** Dataset: column filters applied to the data. */\n filters?: DataFilter[];\n /** Route: ID of a specific action to preview (status, logs, side-effect assets). */\n actionId?: string | null;\n /** Route: author-provided defaults for an interactive route form. */\n defaultValues?: Record<string, unknown>;\n}\n\n/**\n * Normalize legacy viewMode values to the current set.\n * \"chart\" → \"preview\", \"default\" → \"card\", anything else → \"card\".\n */\nexport function normalizeViewMode(\n raw: string | undefined | null\n): \"card\" | \"preview\" | \"interactive\" | \"list\" {\n if (raw === \"default\") return \"card\";\n if (raw === \"chart\") return \"preview\";\n if (\n raw === \"preview\" ||\n raw === \"interactive\" ||\n raw === \"card\" ||\n raw === \"list\"\n )\n return raw;\n return \"card\";\n}\n\n/**\n * Build a DisplayConfig from node/element attributes, handling the legacy\n * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.\n * Prefers values inside `displayConfig` when present.\n */\nexport function resolveDisplayConfig(attrs: {\n displayConfig?: DisplayConfig | string | null;\n visualizationId?: string | null;\n filters?: DataFilter[] | string | null;\n}): DisplayConfig {\n let base: DisplayConfig = {};\n\n if (attrs.displayConfig) {\n base =\n typeof attrs.displayConfig === \"string\"\n ? JSON.parse(attrs.displayConfig)\n : { ...attrs.displayConfig };\n }\n\n // Fall back to legacy flat attrs when displayConfig doesn't carry them\n if (base.visualizationId === undefined && attrs.visualizationId) {\n base.visualizationId = attrs.visualizationId;\n }\n if (base.filters === undefined && attrs.filters) {\n const raw = attrs.filters;\n base.filters =\n typeof raw === \"string\" ? JSON.parse(raw) : raw;\n }\n\n return base;\n}\n\nexport interface InlineAssetAttrs {\n id: string;\n assetType: string;\n viewMode: \"card\" | \"preview\" | \"interactive\" | \"list\";\n displayConfig?: DisplayConfig | null;\n /** @deprecated Use displayConfig.filters */\n filters?: any;\n /** @deprecated Use displayConfig.visualizationId */\n visualizationId?: string | null;\n partial?: boolean;\n}\n\n/** Assets pulled from Air JSON: embedded blocks or link href shorthands. */\nexport type ExtractedContentAsset =\n | { id: string; assetType: string; via: \"embed\" }\n | { id: string; assetType: string; via: \"link\"; legacy: false }\n | { id: string; via: \"link\"; legacy: true };\n\ninterface LinkedAssetRef {\n assetType: string;\n entity: string;\n slug: string;\n}\n\n/** UUID v4 pattern for inline link hrefs */\nconst UUID_RE =\n \"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\";\n\n/** Shorthand link hrefs: `post:<uuid>`, `file:<uuid>`, … (preferred over legacy `asset:<uuid>`). */\nconst TYPED_ASSET_LINK_RE = new RegExp(\n `^(post|dataset|file|service|route):(${UUID_RE})$`,\n \"i\"\n);\n\n/** @deprecated Prefer `post:<uuid>` etc.; still supported and resolved server-side. */\nconst LEGACY_ASSET_LINK_RE = new RegExp(`^asset:(${UUID_RE})$`, \"i\");\n\nconst VALID_ASSET_TYPES = new Set([\n \"post\",\n \"dataset\",\n \"file\",\n \"service\",\n \"route\",\n]);\n\n/**\n * Parse an inline link `href` for Ouro asset shorthands.\n * - `post:<uuid>`, `file:<uuid>`, … → typed (asset type known from prefix)\n * - `asset:<uuid>` → legacy (type resolved via DB when creating connections)\n */\nfunction parseAssetLinkShorthand(\n href: string\n):\n | { id: string; assetType: string; legacy: false }\n | { id: string; legacy: true }\n | null {\n const typed = TYPED_ASSET_LINK_RE.exec(href);\n if (typed) {\n const assetType = typed[1].toLowerCase();\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n return { id: typed[2], assetType, legacy: false };\n }\n const legacy = LEGACY_ASSET_LINK_RE.exec(href);\n if (legacy) return { id: legacy[1], legacy: true };\n return null;\n}\n\n/**\n * Parse an Ouro site URL into its asset components.\n * Accepts both absolute URLs (https://ouro.foundation/posts/entity/slug)\n * and relative paths (/posts/entity/slug).\n */\nfunction parseOuroAssetUrl(\n href: string,\n siteUrl?: string\n): LinkedAssetRef | null {\n let pathname: string;\n try {\n if (href.startsWith(\"/\")) {\n pathname = href;\n } else {\n const url = new URL(href);\n if (siteUrl) {\n const siteHost = new URL(siteUrl).host;\n if (url.host !== siteHost) return null;\n }\n pathname = url.pathname;\n }\n } catch {\n return null;\n }\n\n // Pattern: /{assetType}s/{entity}/{slug}\n const match = pathname.match(\n /^\\/(\\w+)s\\/([^/]+)\\/([^/?#]+)/\n );\n if (!match) return null;\n\n const [, assetType, entity, slug] = match;\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n\n return { assetType, entity: decodeURIComponent(entity), slug: decodeURIComponent(slug) };\n}\n\nconst extractContent = (item: any): any => {\n if (Array.isArray(item)) return item.map(extractContent);\n if (item?.content) {\n if (Array.isArray(item.content))\n return item.content.map(extractContent).flat();\n else return extractContent(item.content);\n } else return item; // leaf\n};\n\nfunction getReferencesInContent(\n json: Content[\"json\"],\n options?: { siteUrl?: string }\n) {\n if (!json || !json?.content)\n return { users: [], assets: [], linkedAssets: [] };\n const content = json.content.map(extractContent).flat();\n\n const users = content\n .filter((item: any) => item.type === \"mention\")\n .map((item: any) => ({\n user_id: item.attrs?.id,\n username: item.attrs?.label || item.attrs?.username,\n }))\n .reduce((unique: any[], item: any) => {\n if (\n !unique.some(\n (u) =>\n (u.user_id && item.user_id && u.user_id === item.user_id) ||\n (u.username && item.username && u.username === item.username)\n )\n ) {\n unique.push(item);\n }\n return unique;\n }, []) as Partial<Profile>[];\n\n const assets: ExtractedContentAsset[] = content\n .filter(\n (item: any) =>\n item.type === \"assetComponent\" && item.attrs?.id && !item.attrs?.partial\n )\n .map(({ attrs }: { attrs: InlineAssetAttrs }) => ({\n id: attrs.id,\n assetType: attrs.assetType,\n via: \"embed\" as const,\n }))\n .reduce((unique: ExtractedContentAsset[], item: ExtractedContentAsset) => {\n if (!unique.some((u) => u.id === item.id)) {\n unique.push(item);\n }\n return unique;\n }, []);\n\n // Extract asset references from link marks\n const linkedAssets: LinkedAssetRef[] = [];\n const seenAssetIds = new Set(assets.map((a) => a.id));\n const seenLinkedKeys = new Set<string>();\n\n for (const item of content) {\n if (item?.type !== \"text\" || !item?.marks) continue;\n const linkMark = item.marks.find((m: any) => m.type === \"link\");\n if (!linkMark?.attrs?.href) continue;\n\n const href: string = linkMark.attrs.href;\n\n const shorthand = parseAssetLinkShorthand(href);\n if (shorthand) {\n const id = shorthand.id;\n if (!seenAssetIds.has(id)) {\n seenAssetIds.add(id);\n if (shorthand.legacy) {\n assets.push({ id, via: \"link\", legacy: true });\n } else {\n assets.push({\n id,\n assetType: shorthand.assetType,\n via: \"link\",\n legacy: false,\n });\n }\n }\n continue;\n }\n\n // Check for Ouro site URLs\n const parsed = parseOuroAssetUrl(href, options?.siteUrl);\n if (parsed) {\n const key = `${parsed.assetType}:${parsed.entity}:${parsed.slug}`;\n if (!seenLinkedKeys.has(key)) {\n seenLinkedKeys.add(key);\n linkedAssets.push(parsed);\n }\n }\n }\n\n return {\n users,\n assets,\n linkedAssets,\n };\n}\n\nexport {\n getReferencesInContent,\n parseAssetLinkShorthand,\n parseOuroAssetUrl,\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {a,d,c as c$1}from'./chunk-TYOQ32UV.js';import {c,b,d as d$1,a as a$2}from'./chunk-SR5UZ4NP.js';import {a as a$1}from'./chunk-WRHPQNEL.js';import {enum as _enum,object,optional,string,array,any,record,literal,number,uuid,nullable,boolean,union}from'zod';var E=_enum(["closable","continuous"]),w=_enum(["draft","open","closed","cancelled"]),f=_enum(["pending","in_progress","done","skipped"]),C=_enum(["btc","usd"]),I=_enum(["skipped","running","passed","failed","errored"]),q=_enum(["submitted","accepted","rejected"]),T=object({type:string(),content:optional(array(any())),attrs:optional(record(string(),any())),marks:optional(array(any())),text:optional(string())}),p=object({json:object({type:literal("doc"),content:array(T)}),text:string()}),k=object({id:uuid(),quest_id:uuid(),description:string(),status:f.default("pending"),auto_skipped:optional(nullable(string().or(any()))),status_before_auto_skip:optional(nullable(f)),sort_order:number().default(0),type:string().default("task"),created_by:uuid(),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:number().int().nonnegative().default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string())),contributor_keys:optional(nullable(array(object({key:string(),required:boolean().default(true),filters:object({assetType:optional(string()),fileType:optional(string()),extensions:optional(array(string())),hasConstraints:boolean().default(false)})})))),created_at:string(),updated_at:string()}),A=k,S=object({description:string().min(1,{message:"Item description cannot be empty"}),type:optional(string()).default("task"),sort_order:optional(number().int()),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:optional(number().int().nonnegative()).default(0),reward_currency:optional(C).default("btc"),reward_amount:optional(number().int().nonnegative()).default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string()))}),R=union([string().transform(u=>({description:u})),S]).pipe(S),U=object({type:E.default("closable"),status:w.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),closed_at:optional(nullable(string()))}),j=c.extend({asset_type:literal("quest").default("quest"),metadata:optional(nullable(b.partial())),quest:optional(U.partial()),items:optional(array(A.partial())),progress:optional(object({total:number(),done:number(),remaining:number()}))}),Z=d$1.extend({asset_type:literal("quest").default("quest"),name:optional(nullable(string())).default(null),description:optional(nullable(p)),type:E.default("closable"),status:w.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),items:optional(array(R)).default([])}).transform(u=>a$2(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:literal("quest").default("quest"),last_updated:string().default(()=>new Date().toISOString())}).transform(u=>a$2(u)),M=S.partial().extend({status:optional(f)}),N=object({id:uuid(),quest_id:uuid(),user_id:uuid(),item_id:optional(nullable(uuid())),asset_id:optional(nullable(uuid())),asset_type:optional(nullable(a$1)),assets:optional(nullable(a)),description:optional(nullable(p)),review:optional(nullable(p)),status:q,reviewer_id:optional(nullable(uuid())),reviewed_at:optional(nullable(string())),eval_action_id:optional(nullable(uuid())),eval_score:optional(nullable(number())),eval_status:optional(nullable(I)),created_at:string(),updated_at:string()}),P=object({item_id:uuid(),assets:optional(nullable(c$1)),description:optional(nullable(union([string(),p])))}),G=object({status:_enum(["accepted","rejected"]),review:optional(nullable(union([string(),p])))});export{E as a,w as b,f as c,C as d,I as e,q as f,k as g,A as h,S as i,R as j,j as k,Z as l,F as m,M as n,N as o,P as p,G as q};//# sourceMappingURL=chunk-R2W4NEEJ.js.map
2
- //# sourceMappingURL=chunk-R2W4NEEJ.js.map
1
+ import {a,d,c as c$1}from'./chunk-TYOQ32UV.js';import {c,b,d as d$1,a as a$2}from'./chunk-SR5UZ4NP.js';import {a as a$1}from'./chunk-WRHPQNEL.js';import {enum as _enum,object,optional,string,array,any,record,literal,number,uuid,nullable,boolean,union}from'zod';var z=_enum(["closable","continuous"]),E=_enum(["draft","open","closed","cancelled"]),_=_enum(["pending","in_progress","done","skipped"]),C=_enum(["btc","usd"]),I=_enum(["skipped","running","passed","failed","errored"]),q=_enum(["submitted","accepted","rejected"]),k=object({type:string(),content:optional(array(any())),attrs:optional(record(string(),any())),marks:optional(array(any())),text:optional(string())}),p=object({json:object({type:literal("doc"),content:array(k)}),text:string()}),T=object({id:uuid(),quest_id:uuid(),description:string(),status:_.default("pending"),auto_skipped:optional(nullable(string().or(any()))),status_before_auto_skip:optional(nullable(_)),sort_order:number().default(0),type:string().default("task"),created_by:uuid(),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:number().int().nonnegative().default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string())),contributor_keys:optional(nullable(array(object({key:string(),required:boolean().default(true),filters:object({assetType:optional(string()),fileType:optional(string()),extensions:optional(array(string())),hasConstraints:boolean().default(false)})})))),created_at:string(),updated_at:string()}),A=T,S=object({description:string().min(1,{message:"Item description cannot be empty"}),type:optional(string()).default("task"),sort_order:optional(number().int()),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:optional(number().int().nonnegative()).default(0),reward_currency:optional(C).default("btc"),reward_amount:optional(number().int().nonnegative()).default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string()))}),R=union([string().transform(u=>({description:u})),S]).pipe(S),U=object({type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),closed_at:optional(nullable(string()))}),j=c.extend({asset_type:literal("quest").default("quest"),metadata:optional(nullable(b.partial())),quest:optional(U.partial()),items:optional(array(A.partial())),progress:optional(object({total:number(),done:number(),remaining:number(),items:optional(array(object({id:string(),status:_,waiting_on:optional(nullable(string())),waiting_until:optional(nullable(string())),waiting_check_every:optional(nullable(string()))}).partial()))}))}),Z=d$1.extend({asset_type:literal("quest").default("quest"),name:optional(nullable(string())).default(null),description:optional(nullable(p)),type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),items:optional(array(R)).default([])}).transform(u=>a$2(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:literal("quest").default("quest"),last_updated:string().default(()=>new Date().toISOString())}).transform(u=>a$2(u)),M=S.partial().extend({status:optional(_)}),N=object({id:uuid(),quest_id:uuid(),user_id:uuid(),item_id:optional(nullable(uuid())),asset_id:optional(nullable(uuid())),asset_type:optional(nullable(a$1)),assets:optional(nullable(a)),description:optional(nullable(p)),review:optional(nullable(p)),status:q,reviewer_id:optional(nullable(uuid())),reviewed_at:optional(nullable(string())),eval_action_id:optional(nullable(uuid())),eval_score:optional(nullable(number())),eval_status:optional(nullable(I)),created_at:string(),updated_at:string()}),P=object({item_id:uuid(),assets:optional(nullable(c$1)),description:optional(nullable(union([string(),p])))}),G=object({status:_enum(["accepted","rejected"]),review:optional(nullable(union([string(),p])))});export{z as a,E as b,_ as c,C as d,I as e,q as f,T as g,A as h,S as i,R as j,j as k,Z as l,F as m,M as n,N as o,P as p,G as q};//# sourceMappingURL=chunk-NABNY2EN.js.map
2
+ //# sourceMappingURL=chunk-NABNY2EN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/quests.ts"],"names":["QuestTypeSchema","zodEnum","QuestStatusSchema","QuestItemStatusSchema","RewardCurrencySchema","EntryEvalStatusSchema","EntryStatusSchema","TipTapNode","object","string","optional","array","any","record","ContentSchema","literal","QuestItemBaseSchema","uuid","nullable","number","AssetTypeSchema","QuestSubmissionAssetDeclarationSchema","KeyedAssetRefsSchema","zodBoolean","QuestItemSchema","CreateQuestItemObjectSchema","CreateQuestItemSchema","union","s","QuestSpecificsSchema","QuestSchema","AssetSchema","AssetMetadataSchema","CreateQuestSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateQuestSchema","UpdateQuestItemSchema","EntrySchema","CreateEntrySchema","KeyedAssetInputSchema","ReviewEntrySchema"],"mappings":"qQAkCA,IAAMA,CAAkBC,CAAAA,KAAAA,CAAQ,CAAC,UAAA,CAAY,YAAY,CAAC,CAAA,CACpDC,CAAoBD,CAAAA,KAAAA,CAAQ,CAAC,OAAA,CAAS,OAAQ,QAAU,CAAA,WAAW,CAAC,CAAA,CAEpEE,CAAwBF,CAAAA,KAAAA,CAAQ,CACpC,SACA,CAAA,aAAA,CACA,MACA,CAAA,SACF,CAAC,CAAA,CAEKG,EAAuBH,KAAQ,CAAA,CAAC,KAAO,CAAA,KAAK,CAAC,CAAA,CAE7CI,EAAwBJ,KAAQ,CAAA,CACpC,SACA,CAAA,SAAA,CACA,QACA,CAAA,QAAA,CACA,SACF,CAAC,CAAA,CAEKK,CAAoBL,CAAAA,KAAAA,CAAQ,CAAC,WAAA,CAAa,WAAY,UAAU,CAAC,CAMjEM,CAAAA,CAAAA,CAA2BC,MAAO,CAAA,CACtC,KAAMC,MAAO,EAAA,CACb,OAASC,CAAAA,QAAAA,CAASC,KAAMC,CAAAA,GAAAA,EAAK,CAAC,CAAA,CAC9B,KAAOF,CAAAA,QAAAA,CAASG,MAAOJ,CAAAA,MAAAA,GAAUG,GAAI,EAAC,CAAC,CAAA,CACvC,KAAOF,CAAAA,QAAAA,CAASC,MAAMC,GAAI,EAAC,CAAC,CAAA,CAC5B,IAAMF,CAAAA,QAAAA,CAASD,QAAQ,CACzB,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B,CAAAA,CAAAA,CAAoBlC,MAAO,CAAA,CAC/B,OAAQP,KAAQ,CAAA,CAAC,UAAY,CAAA,UAAU,CAAC,CAAA,CACxC,OAAQS,QAASQ,CAAAA,QAAAA,CAASS,KAAM,CAAA,CAAClB,MAAO,EAAA,CAAGK,CAAa,CAAC,CAAC,CAAC,CAC7D,CAAC","file":"chunk-NABNY2EN.js","sourcesContent":["import {\n object,\n string,\n number,\n array,\n literal,\n record,\n type z,\n any,\n optional,\n nullable,\n union,\n uuid,\n boolean as zodBoolean,\n enum as zodEnum,\n type ZodType,\n} from \"zod\";\n\nimport {\n AssetSchema,\n AssetMetadataSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { AssetTypeSchema } from \"./common\";\nimport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n} from \"../utils/quest-submission\";\n\n// ── Enums ──────────────────────────────────────────────────────────────\n\n/** closable: one active entry per item per user; continuous: unlimited per item */\nconst QuestTypeSchema = zodEnum([\"closable\", \"continuous\"]);\nconst QuestStatusSchema = zodEnum([\"draft\", \"open\", \"closed\", \"cancelled\"]);\n\nconst QuestItemStatusSchema = zodEnum([\n \"pending\",\n \"in_progress\",\n \"done\",\n \"skipped\",\n]);\n\nconst RewardCurrencySchema = zodEnum([\"btc\", \"usd\"]);\n\nconst EntryEvalStatusSchema = zodEnum([\n \"skipped\",\n \"running\",\n \"passed\",\n \"failed\",\n \"errored\",\n]);\n\nconst EntryStatusSchema = zodEnum([\"submitted\", \"accepted\", \"rejected\"]);\n\n// ── Content (TipTap) ───────────────────────────────────────────────────\n// Posts/quests share the same rich description shape: { json, text }.\n// We mirror it locally here so the quest schema doesn't depend on posts.\n\nconst TipTapNode: ZodType<any> = object({\n type: string(),\n content: optional(array(any())),\n attrs: optional(record(string(), any())),\n marks: optional(array(any())),\n text: optional(string()),\n});\n\nconst ContentSchema = object({\n json: object({\n type: literal(\"doc\"),\n content: array(TipTapNode),\n }),\n text: string(),\n});\n\n// ── Quest items ────────────────────────────────────────────────────────\n\nconst QuestItemBaseSchema = object({\n id: uuid(),\n quest_id: uuid(),\n description: string(),\n status: QuestItemStatusSchema.default(\"pending\"),\n auto_skipped: optional(nullable(string().or(any()))),\n status_before_auto_skip: optional(nullable(QuestItemStatusSchema)),\n sort_order: number().default(0),\n type: string().default(\"task\"),\n created_by: uuid(),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: number().int().nonnegative().default(0),\n reward_currency: RewardCurrencySchema.default(\"btc\"),\n reward_amount: number().int().nonnegative().default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n contributor_keys: optional(\n nullable(\n array(\n object({\n key: string(),\n required: zodBoolean().default(true),\n filters: object({\n assetType: optional(string()),\n fileType: optional(string()),\n extensions: optional(array(string())),\n hasConstraints: zodBoolean().default(false),\n }),\n }),\n ),\n ),\n ),\n created_at: string(),\n updated_at: string(),\n});\n\nconst QuestItemSchema = QuestItemBaseSchema;\n\n/**\n * Shape used by `POST /quests/create` (inline items) and\n * `POST /quests/:id/items` (batch add). The controller fills in\n * `quest_id`, `created_by`, and lifecycle-derived fields\n * (`auto_skipped`, `status_before_auto_skip`).\n *\n * Accepts a plain description string as a convenience — it's lifted\n * into `{ description }` by the `union` below.\n */\nconst CreateQuestItemObjectSchema = object({\n description: string().min(1, { message: \"Item description cannot be empty\" }),\n type: optional(string()).default(\"task\"),\n sort_order: optional(number().int()),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: optional(number().int().nonnegative()).default(0),\n reward_currency: optional(RewardCurrencySchema).default(\"btc\"),\n // Amount is in minor units of `reward_currency`: sats for BTC, cents\n // for USD. Both fit in JS numbers comfortably for our reward sizes;\n // the underlying column is `bigint`.\n reward_amount: optional(number().int().nonnegative()).default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n});\n\nconst CreateQuestItemSchema = union([\n string().transform((s) => ({ description: s })),\n CreateQuestItemObjectSchema,\n]).pipe(CreateQuestItemObjectSchema);\n\n// ── Quest ──────────────────────────────────────────────────────────────\n\nconst QuestSpecificsSchema = object({\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n closed_at: optional(nullable(string())),\n});\n\nconst QuestSchema = AssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n metadata: optional(nullable(AssetMetadataSchema.partial())),\n // List and detail both nest specifics under `quest`. Detail also hoists\n // full items to the top level. Progress (counts + bar segments) is always\n // top-level `progress` on list and detail responses.\n quest: optional(QuestSpecificsSchema.partial()),\n items: optional(array(QuestItemSchema.partial())),\n progress: optional(\n object({\n total: number(),\n done: number(),\n remaining: number(),\n // Lightweight per-item segments for progress bars (list + detail).\n items: optional(\n array(\n object({\n id: string(),\n status: QuestItemStatusSchema,\n waiting_on: optional(nullable(string())),\n waiting_until: optional(nullable(string())),\n waiting_check_every: optional(nullable(string())),\n }).partial()\n )\n ),\n })\n ),\n});\n\n/**\n * Schema used by the backend controller and SDK clients to validate /\n * default the body of `POST /quests/create`. Mirrors how\n * `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers\n * don't have to know about `GLOBAL_ORG_ID`.\n *\n * The `items` field accepts either plain strings or full item objects —\n * the backend `createQuestItems`/`createQuest` paths already handle both\n * shapes, and `CreateQuestItemSchema` normalizes strings into\n * `{ description }`.\n */\nconst CreateQuestSchema = CreateAssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n name: optional(nullable(string())).default(null),\n description: optional(nullable(ContentSchema)),\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n items: optional(array(CreateQuestItemSchema)).default([]),\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestSchema = QuestSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n items: true,\n progress: true,\n is_pinned_in_team: true,\n })\n .extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestItemSchema = CreateQuestItemObjectSchema.partial().extend({\n status: optional(QuestItemStatusSchema),\n});\n\n// ── Entries ────────────────────────────────────────────────────────────\n\nconst EntrySchema = object({\n id: uuid(),\n quest_id: uuid(),\n user_id: uuid(),\n item_id: optional(nullable(uuid())),\n asset_id: optional(nullable(uuid())),\n asset_type: optional(nullable(AssetTypeSchema)),\n assets: optional(nullable(KeyedAssetRefsSchema)),\n description: optional(nullable(ContentSchema)),\n review: optional(nullable(ContentSchema)),\n status: EntryStatusSchema,\n reviewer_id: optional(nullable(uuid())),\n reviewed_at: optional(nullable(string())),\n eval_action_id: optional(nullable(uuid())),\n eval_score: optional(nullable(number())),\n eval_status: optional(nullable(EntryEvalStatusSchema)),\n created_at: string(),\n updated_at: string(),\n});\n\nconst CreateEntrySchema = object({\n item_id: uuid(),\n assets: optional(nullable(KeyedAssetInputSchema)),\n description: optional(nullable(union([string(), ContentSchema]))),\n});\n\nconst ReviewEntrySchema = object({\n status: zodEnum([\"accepted\", \"rejected\"]),\n review: optional(nullable(union([string(), ContentSchema]))),\n});\n\n// ── Exports ────────────────────────────────────────────────────────────\n\nexport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n QuestTypeSchema,\n QuestStatusSchema,\n QuestItemStatusSchema,\n RewardCurrencySchema,\n EntryEvalStatusSchema,\n EntryStatusSchema,\n QuestSchema,\n QuestItemSchema,\n QuestItemBaseSchema,\n CreateQuestSchema,\n CreateQuestItemSchema,\n CreateQuestItemObjectSchema,\n UpdateQuestSchema,\n UpdateQuestItemSchema,\n EntrySchema,\n CreateEntrySchema,\n ReviewEntrySchema,\n};\n\nexport type QuestType = z.infer<typeof QuestTypeSchema>;\nexport type QuestStatus = z.infer<typeof QuestStatusSchema>;\nexport type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;\nexport type RewardCurrency = z.infer<typeof RewardCurrencySchema>;\nexport type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;\nexport type EntryStatus = z.infer<typeof EntryStatusSchema>;\nexport type Quest = z.infer<typeof QuestSchema>;\nexport type QuestItem = z.infer<typeof QuestItemSchema>;\nexport type CreateQuest = z.infer<typeof CreateQuestSchema>;\nexport type CreateQuestItem = z.infer<typeof CreateQuestItemSchema>;\nexport type UpdateQuest = z.infer<typeof UpdateQuestSchema>;\nexport type UpdateQuestItem = z.infer<typeof UpdateQuestItemSchema>;\nexport type Entry = z.infer<typeof EntrySchema>;\nexport type CreateEntry = z.infer<typeof CreateEntrySchema>;\nexport type ReviewEntry = z.infer<typeof ReviewEntrySchema>;\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';function T(e){return e==="default"?"card":e==="chart"?"preview":e==="preview"||e==="interactive"||e==="card"||e==="list"?e:"card"}function E(e){let s={};if(e.displayConfig&&(s=typeof e.displayConfig=="string"?JSON.parse(e.displayConfig):{...e.displayConfig}),s.visualizationId===void 0&&e.visualizationId&&(s.visualizationId=e.visualizationId),s.filters===void 0&&e.filters){let r=e.filters;s.filters=typeof r=="string"?JSON.parse(r):r;}return s}var v="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",C=new RegExp(`^(post|dataset|file|service|route):(${v})$`,"i"),h=new RegExp(`^asset:(${v})$`,"i"),A=new Set(["post","dataset","file","service","route"]);function I(e){let s=C.exec(e);if(s){let l=s[1].toLowerCase();return A.has(l)?{id:s[2],assetType:l,legacy:false}:null}let r=h.exec(e);return r?{id:r[1],legacy:true}:null}function x(e,s){let r;try{if(e.startsWith("/"))r=e;else {let c=new URL(e);if(s){let g=new URL(s).host;if(c.host!==g)return null}r=c.pathname;}}catch{return null}let l=r.match(/^\/(\w+)s\/([^/]+)\/([^/?#]+)/);if(!l)return null;let[,o,d,p]=l;return A.has(o)?{assetType:o,entity:decodeURIComponent(d),slug:decodeURIComponent(p)}:null}var y=e=>Array.isArray(e)?e.map(y):e!=null&&e.content?Array.isArray(e.content)?e.content.map(y).flat():y(e.content):e;function k(e,s){var g;if(!e||!(e!=null&&e.content))return {users:[],assets:[],linkedAssets:[]};let r=e.content.map(y).flat(),l=r.filter(t=>t.type==="mention").map(t=>{var n,i,f;return {user_id:(n=t.attrs)==null?void 0:n.id,username:((i=t.attrs)==null?void 0:i.label)||((f=t.attrs)==null?void 0:f.username)}}).reduce((t,n)=>(t.some(i=>i.user_id&&n.user_id&&i.user_id===n.user_id||i.username&&n.username&&i.username===n.username)||t.push(n),t),[]),o=r.filter(t=>{var n,i;return t.type==="assetComponent"&&((n=t.attrs)==null?void 0:n.id)&&!((i=t.attrs)!=null&&i.partial)}).map(({attrs:t})=>({id:t.id,assetType:t.assetType,via:"embed"})).reduce((t,n)=>(t.some(i=>i.id===n.id)||t.push(n),t),[]),d=[],p=new Set(o.map(t=>t.id)),c=new Set;for(let t of r){if((t==null?void 0:t.type)!=="text"||!(t!=null&&t.marks))continue;let n=t.marks.find(a=>a.type==="link");if(!((g=n==null?void 0:n.attrs)!=null&&g.href))continue;let i=n.attrs.href,f=I(i);if(f){let a=f.id;p.has(a)||(p.add(a),f.legacy?o.push({id:a,via:"link",legacy:true}):o.push({id:a,assetType:f.assetType,via:"link",legacy:false}));continue}let u=x(i,s==null?void 0:s.siteUrl);if(u){let a=`${u.assetType}:${u.entity}:${u.slug}`;c.has(a)||(c.add(a),d.push(u));}}return {users:l,assets:o,linkedAssets:d}}exports.a=T;exports.b=E;exports.c=I;exports.d=x;exports.e=k;//# sourceMappingURL=chunk-TUZS3DKI.cjs.map
2
+ //# sourceMappingURL=chunk-TUZS3DKI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/air/index.ts"],"names":["normalizeViewMode","raw","resolveDisplayConfig","attrs","base","UUID_RE","TYPED_ASSET_LINK_RE","LEGACY_ASSET_LINK_RE","VALID_ASSET_TYPES","parseAssetLinkShorthand","href","typed","assetType","legacy","parseOuroAssetUrl","siteUrl","pathname","url","siteHost","match","entity","slug","extractContent","item","getReferencesInContent","json","options","_a","content","users","_b","_c","unique","u","assets","linkedAssets","seenAssetIds","a","seenLinkedKeys","linkMark","m","shorthand","id","parsed","key"],"mappings":"aAyBO,SAASA,CACdC,CAAAA,CAAAA,CAC6C,CAC7C,OAAIA,IAAQ,SAAkB,CAAA,MAAA,CAC1BA,CAAQ,GAAA,OAAA,CAAgB,UAE1BA,CAAQ,GAAA,SAAA,EACRA,CAAQ,GAAA,aAAA,EACRA,IAAQ,MACRA,EAAAA,CAAAA,GAAQ,MAEDA,CAAAA,CAAAA,CACF,MACT,CAOO,SAASC,CAAAA,CAAqBC,EAInB,CAChB,IAAIC,CAAsB,CAAA,GAa1B,GAXID,CAAAA,CAAM,aACRC,GAAAA,CAAAA,CACE,OAAOD,CAAM,CAAA,aAAA,EAAkB,QAC3B,CAAA,IAAA,CAAK,KAAMA,CAAAA,CAAAA,CAAM,aAAa,CAAA,CAC9B,CAAE,GAAGA,CAAAA,CAAM,aA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AAAA,CAAe6B,EAAS,KAAM,CAAA,IAAA,CAE9BE,CAAYhC,CAAAA,CAAAA,CAAwBC,CAAI,CAAA,CAC9C,GAAI+B,CAAAA,CAAW,CACb,IAAMC,CAAAA,CAAKD,CAAU,CAAA,EAAA,CAChBL,EAAa,GAAIM,CAAAA,CAAE,CACtBN,GAAAA,CAAAA,CAAa,IAAIM,CAAE,CAAA,CACfD,CAAU,CAAA,MAAA,CACZP,CAAO,CAAA,IAAA,CAAK,CAAE,EAAA,CAAAQ,EAAI,GAAK,CAAA,MAAA,CAAQ,MAAQ,CAAA,IAAK,CAAC,CAE7CR,CAAAA,CAAAA,CAAO,IAAK,CAAA,CACV,GAAAQ,CACA,CAAA,SAAA,CAAWD,CAAU,CAAA,SAAA,CACrB,GAAK,CAAA,MAAA,CACL,MAAQ,CAAA,KACV,CAAC,CAGL,CAAA,CAAA,QACF,CAGA,IAAME,EAAS7B,CAAkBJ,CAAAA,CAAAA,CAAMgB,CAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,EAAS,OAAO,CAAA,CACvD,GAAIiB,CAAAA,CAAQ,CACV,IAAMC,CAAM,CAAA,CAAA,EAAGD,EAAO,SAAS,CAAA,CAAA,EAAIA,CAAO,CAAA,MAAM,IAAIA,CAAO,CAAA,IAAI,CAC1DL,CAAAA,CAAAA,CAAAA,CAAe,IAAIM,CAAG,CAAA,GACzBN,CAAe,CAAA,GAAA,CAAIM,CAAG,CACtBT,CAAAA,CAAAA,CAAa,IAAKQ,CAAAA,CAAM,GAE5B,CACF,CAEA,OAAO,CACL,MAAAd,CACA,CAAA,MAAA,CAAAK,CACA,CAAA,YAAA,CAAAC,CACF,CACF","file":"chunk-TUZS3DKI.cjs","sourcesContent":["import { Content } from \"../../schema/posts\";\nimport { Profile } from \"../../schema/users\";\n\nexport interface DataFilter {\n column: string;\n value: string;\n operator: string;\n active?: boolean;\n}\n\nexport interface DisplayConfig {\n /** Dataset: ID of a saved visualization to render instead of the default chart. */\n visualizationId?: string | null;\n /** Dataset: column filters applied to the data. */\n filters?: DataFilter[];\n /** Route: ID of a specific action to preview (status, logs, side-effect assets). */\n actionId?: string | null;\n /** Route: author-provided defaults for an interactive route form. */\n defaultValues?: Record<string, unknown>;\n}\n\n/**\n * Normalize legacy viewMode values to the current set.\n * \"chart\" → \"preview\", \"default\" → \"card\", anything else → \"card\".\n */\nexport function normalizeViewMode(\n raw: string | undefined | null\n): \"card\" | \"preview\" | \"interactive\" | \"list\" {\n if (raw === \"default\") return \"card\";\n if (raw === \"chart\") return \"preview\";\n if (\n raw === \"preview\" ||\n raw === \"interactive\" ||\n raw === \"card\" ||\n raw === \"list\"\n )\n return raw;\n return \"card\";\n}\n\n/**\n * Build a DisplayConfig from node/element attributes, handling the legacy\n * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.\n * Prefers values inside `displayConfig` when present.\n */\nexport function resolveDisplayConfig(attrs: {\n displayConfig?: DisplayConfig | string | null;\n visualizationId?: string | null;\n filters?: DataFilter[] | string | null;\n}): DisplayConfig {\n let base: DisplayConfig = {};\n\n if (attrs.displayConfig) {\n base =\n typeof attrs.displayConfig === \"string\"\n ? JSON.parse(attrs.displayConfig)\n : { ...attrs.displayConfig };\n }\n\n // Fall back to legacy flat attrs when displayConfig doesn't carry them\n if (base.visualizationId === undefined && attrs.visualizationId) {\n base.visualizationId = attrs.visualizationId;\n }\n if (base.filters === undefined && attrs.filters) {\n const raw = attrs.filters;\n base.filters =\n typeof raw === \"string\" ? JSON.parse(raw) : raw;\n }\n\n return base;\n}\n\nexport interface InlineAssetAttrs {\n id: string;\n assetType: string;\n viewMode: \"card\" | \"preview\" | \"interactive\" | \"list\";\n displayConfig?: DisplayConfig | null;\n /** @deprecated Use displayConfig.filters */\n filters?: any;\n /** @deprecated Use displayConfig.visualizationId */\n visualizationId?: string | null;\n partial?: boolean;\n}\n\n/** Assets pulled from Air JSON: embedded blocks or link href shorthands. */\nexport type ExtractedContentAsset =\n | { id: string; assetType: string; via: \"embed\" }\n | { id: string; assetType: string; via: \"link\"; legacy: false }\n | { id: string; via: \"link\"; legacy: true };\n\ninterface LinkedAssetRef {\n assetType: string;\n entity: string;\n slug: string;\n}\n\n/** UUID v4 pattern for inline link hrefs */\nconst UUID_RE =\n \"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\";\n\n/** Shorthand link hrefs: `post:<uuid>`, `file:<uuid>`, … (preferred over legacy `asset:<uuid>`). */\nconst TYPED_ASSET_LINK_RE = new RegExp(\n `^(post|dataset|file|service|route):(${UUID_RE})$`,\n \"i\"\n);\n\n/** @deprecated Prefer `post:<uuid>` etc.; still supported and resolved server-side. */\nconst LEGACY_ASSET_LINK_RE = new RegExp(`^asset:(${UUID_RE})$`, \"i\");\n\nconst VALID_ASSET_TYPES = new Set([\n \"post\",\n \"dataset\",\n \"file\",\n \"service\",\n \"route\",\n]);\n\n/**\n * Parse an inline link `href` for Ouro asset shorthands.\n * - `post:<uuid>`, `file:<uuid>`, … → typed (asset type known from prefix)\n * - `asset:<uuid>` → legacy (type resolved via DB when creating connections)\n */\nfunction parseAssetLinkShorthand(\n href: string\n):\n | { id: string; assetType: string; legacy: false }\n | { id: string; legacy: true }\n | null {\n const typed = TYPED_ASSET_LINK_RE.exec(href);\n if (typed) {\n const assetType = typed[1].toLowerCase();\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n return { id: typed[2], assetType, legacy: false };\n }\n const legacy = LEGACY_ASSET_LINK_RE.exec(href);\n if (legacy) return { id: legacy[1], legacy: true };\n return null;\n}\n\n/**\n * Parse an Ouro site URL into its asset components.\n * Accepts both absolute URLs (https://ouro.foundation/posts/entity/slug)\n * and relative paths (/posts/entity/slug).\n */\nfunction parseOuroAssetUrl(\n href: string,\n siteUrl?: string\n): LinkedAssetRef | null {\n let pathname: string;\n try {\n if (href.startsWith(\"/\")) {\n pathname = href;\n } else {\n const url = new URL(href);\n if (siteUrl) {\n const siteHost = new URL(siteUrl).host;\n if (url.host !== siteHost) return null;\n }\n pathname = url.pathname;\n }\n } catch {\n return null;\n }\n\n // Pattern: /{assetType}s/{entity}/{slug}\n const match = pathname.match(\n /^\\/(\\w+)s\\/([^/]+)\\/([^/?#]+)/\n );\n if (!match) return null;\n\n const [, assetType, entity, slug] = match;\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n\n return { assetType, entity: decodeURIComponent(entity), slug: decodeURIComponent(slug) };\n}\n\nconst extractContent = (item: any): any => {\n if (Array.isArray(item)) return item.map(extractContent);\n if (item?.content) {\n if (Array.isArray(item.content))\n return item.content.map(extractContent).flat();\n else return extractContent(item.content);\n } else return item; // leaf\n};\n\nfunction getReferencesInContent(\n json: Content[\"json\"],\n options?: { siteUrl?: string }\n) {\n if (!json || !json?.content)\n return { users: [], assets: [], linkedAssets: [] };\n const content = json.content.map(extractContent).flat();\n\n const users = content\n .filter((item: any) => item.type === \"mention\")\n .map((item: any) => ({\n user_id: item.attrs?.id,\n username: item.attrs?.label || item.attrs?.username,\n }))\n .reduce((unique: any[], item: any) => {\n if (\n !unique.some(\n (u) =>\n (u.user_id && item.user_id && u.user_id === item.user_id) ||\n (u.username && item.username && u.username === item.username)\n )\n ) {\n unique.push(item);\n }\n return unique;\n }, []) as Partial<Profile>[];\n\n const assets: ExtractedContentAsset[] = content\n .filter(\n (item: any) =>\n item.type === \"assetComponent\" && item.attrs?.id && !item.attrs?.partial\n )\n .map(({ attrs }: { attrs: InlineAssetAttrs }) => ({\n id: attrs.id,\n assetType: attrs.assetType,\n via: \"embed\" as const,\n }))\n .reduce((unique: ExtractedContentAsset[], item: ExtractedContentAsset) => {\n if (!unique.some((u) => u.id === item.id)) {\n unique.push(item);\n }\n return unique;\n }, []);\n\n // Extract asset references from link marks\n const linkedAssets: LinkedAssetRef[] = [];\n const seenAssetIds = new Set(assets.map((a) => a.id));\n const seenLinkedKeys = new Set<string>();\n\n for (const item of content) {\n if (item?.type !== \"text\" || !item?.marks) continue;\n const linkMark = item.marks.find((m: any) => m.type === \"link\");\n if (!linkMark?.attrs?.href) continue;\n\n const href: string = linkMark.attrs.href;\n\n const shorthand = parseAssetLinkShorthand(href);\n if (shorthand) {\n const id = shorthand.id;\n if (!seenAssetIds.has(id)) {\n seenAssetIds.add(id);\n if (shorthand.legacy) {\n assets.push({ id, via: \"link\", legacy: true });\n } else {\n assets.push({\n id,\n assetType: shorthand.assetType,\n via: \"link\",\n legacy: false,\n });\n }\n }\n continue;\n }\n\n // Check for Ouro site URLs\n const parsed = parseOuroAssetUrl(href, options?.siteUrl);\n if (parsed) {\n const key = `${parsed.assetType}:${parsed.entity}:${parsed.slug}`;\n if (!seenLinkedKeys.has(key)) {\n seenLinkedKeys.add(key);\n linkedAssets.push(parsed);\n }\n }\n }\n\n return {\n users,\n assets,\n linkedAssets,\n };\n}\n\nexport {\n getReferencesInContent,\n parseAssetLinkShorthand,\n parseOuroAssetUrl,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk6ZJQTECB_cjs=require('./chunk-6ZJQTECB.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var z=zod.enum(["closable","continuous"]),E=zod.enum(["draft","open","closed","cancelled"]),_=zod.enum(["pending","in_progress","done","skipped"]),C=zod.enum(["btc","usd"]),I=zod.enum(["skipped","running","passed","failed","errored"]),q=zod.enum(["submitted","accepted","rejected"]),k=zod.object({type:zod.string(),content:zod.optional(zod.array(zod.any())),attrs:zod.optional(zod.record(zod.string(),zod.any())),marks:zod.optional(zod.array(zod.any())),text:zod.optional(zod.string())}),p=zod.object({json:zod.object({type:zod.literal("doc"),content:zod.array(k)}),text:zod.string()}),T=zod.object({id:zod.uuid(),quest_id:zod.uuid(),description:zod.string(),status:_.default("pending"),auto_skipped:zod.optional(zod.nullable(zod.string().or(zod.any()))),status_before_auto_skip:zod.optional(zod.nullable(_)),sort_order:zod.number().default(0),type:zod.string().default("task"),created_by:zod.uuid(),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),reward_xp:zod.number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:zod.number().int().nonnegative().default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunk6ZJQTECB_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),notes:zod.optional(zod.nullable(zod.string())),contributor_keys:zod.optional(zod.nullable(zod.array(zod.object({key:zod.string(),required:zod.boolean().default(true),filters:zod.object({assetType:zod.optional(zod.string()),fileType:zod.optional(zod.string()),extensions:zod.optional(zod.array(zod.string())),hasConstraints:zod.boolean().default(false)})})))),created_at:zod.string(),updated_at:zod.string()}),A=T,S=zod.object({description:zod.string().min(1,{message:"Item description cannot be empty"}),type:zod.optional(zod.string()).default("task"),sort_order:zod.optional(zod.number().int()),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),reward_xp:zod.optional(zod.number().int().nonnegative()).default(0),reward_currency:zod.optional(C).default("btc"),reward_amount:zod.optional(zod.number().int().nonnegative()).default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunk6ZJQTECB_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),notes:zod.optional(zod.nullable(zod.string()))}),R=zod.union([zod.string().transform(u=>({description:u})),S]).pipe(S),U=zod.object({type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),closed_at:zod.optional(zod.nullable(zod.string()))}),j=chunkROMY5WNQ_cjs.c.extend({asset_type:zod.literal("quest").default("quest"),metadata:zod.optional(zod.nullable(chunkROMY5WNQ_cjs.b.partial())),quest:zod.optional(U.partial()),items:zod.optional(zod.array(A.partial())),progress:zod.optional(zod.object({total:zod.number(),done:zod.number(),remaining:zod.number(),items:zod.optional(zod.array(zod.object({id:zod.string(),status:_,waiting_on:zod.optional(zod.nullable(zod.string())),waiting_until:zod.optional(zod.nullable(zod.string())),waiting_check_every:zod.optional(zod.nullable(zod.string()))}).partial()))}))}),Z=chunkROMY5WNQ_cjs.d.extend({asset_type:zod.literal("quest").default("quest"),name:zod.optional(zod.nullable(zod.string())).default(null),description:zod.optional(zod.nullable(p)),type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),items:zod.optional(zod.array(R)).default([])}).transform(u=>chunkROMY5WNQ_cjs.a(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:zod.literal("quest").default("quest"),last_updated:zod.string().default(()=>new Date().toISOString())}).transform(u=>chunkROMY5WNQ_cjs.a(u)),M=S.partial().extend({status:zod.optional(_)}),N=zod.object({id:zod.uuid(),quest_id:zod.uuid(),user_id:zod.uuid(),item_id:zod.optional(zod.nullable(zod.uuid())),asset_id:zod.optional(zod.nullable(zod.uuid())),asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),assets:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),description:zod.optional(zod.nullable(p)),review:zod.optional(zod.nullable(p)),status:q,reviewer_id:zod.optional(zod.nullable(zod.uuid())),reviewed_at:zod.optional(zod.nullable(zod.string())),eval_action_id:zod.optional(zod.nullable(zod.uuid())),eval_score:zod.optional(zod.nullable(zod.number())),eval_status:zod.optional(zod.nullable(I)),created_at:zod.string(),updated_at:zod.string()}),P=zod.object({item_id:zod.uuid(),assets:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.c)),description:zod.optional(zod.nullable(zod.union([zod.string(),p])))}),G=zod.object({status:zod.enum(["accepted","rejected"]),review:zod.optional(zod.nullable(zod.union([zod.string(),p])))});exports.a=z;exports.b=E;exports.c=_;exports.d=C;exports.e=I;exports.f=q;exports.g=T;exports.h=A;exports.i=S;exports.j=R;exports.k=j;exports.l=Z;exports.m=F;exports.n=M;exports.o=N;exports.p=P;exports.q=G;//# sourceMappingURL=chunk-USO3MLKI.cjs.map
2
+ //# sourceMappingURL=chunk-USO3MLKI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/quests.ts"],"names":["QuestTypeSchema","zodEnum","QuestStatusSchema","QuestItemStatusSchema","RewardCurrencySchema","EntryEvalStatusSchema","EntryStatusSchema","TipTapNode","object","string","optional","array","any","record","ContentSchema","literal","QuestItemBaseSchema","uuid","nullable","number","AssetTypeSchema","QuestSubmissionAssetDeclarationSchema","KeyedAssetRefsSchema","zodBoolean","QuestItemSchema","CreateQuestItemObjectSchema","CreateQuestItemSchema","union","s","QuestSpecificsSchema","QuestSchema","AssetSchema","AssetMetadataSchema","CreateQuestSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateQuestSchema","UpdateQuestItemSchema","EntrySchema","CreateEntrySchema","KeyedAssetInputSchema","ReviewEntrySchema"],"mappings":"0LAkCA,IAAMA,CAAkBC,CAAAA,QAAAA,CAAQ,CAAC,UAAA,CAAY,YAAY,CAAC,CAAA,CACpDC,CAAoBD,CAAAA,QAAAA,CAAQ,CAAC,OAAA,CAAS,OAAQ,QAAU,CAAA,WAAW,CAAC,CAAA,CAEpEE,CAAwBF,CAAAA,QAAAA,CAAQ,CACpC,SACA,CAAA,aAAA,CACA,MACA,CAAA,SACF,CA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AAAA,EAAM,CAAC,CACtC,CAAA,WAAA,CAAaP,aAASQ,YAAST,CAAAA,UAAAA,EAAQ,CAAC,CACxC,CAAA,cAAA,CAAgBC,aAASQ,YAASD,CAAAA,QAAAA,EAAM,CAAC,CACzC,CAAA,UAAA,CAAYP,aAASQ,YAASC,CAAAA,UAAAA,EAAQ,CAAC,CACvC,CAAA,WAAA,CAAaT,aAASQ,YAASb,CAAAA,CAAqB,CAAC,CAAA,CACrD,UAAYI,CAAAA,UAAAA,GACZ,UAAYA,CAAAA,UAAAA,EACd,CAAC,CAEK+B,CAAAA,CAAAA,CAAoBhC,WAAO,CAC/B,OAAA,CAASS,QAAK,EAAA,CACd,MAAQP,CAAAA,YAAAA,CAASQ,aAASuB,mBAAqB,CAAC,CAChD,CAAA,WAAA,CAAa/B,YAASQ,CAAAA,YAAAA,CAASS,UAAM,CAAClB,UAAAA,EAAUK,CAAAA,CAAa,CAAC,CAAC,CAAC,CAClE,CAAC,CAEK4B,CAAAA,CAAAA,CAAoBlC,UAAO,CAAA,CAC/B,OAAQP,QAAQ,CAAA,CAAC,UAAY,CAAA,UAAU,CAAC,CAAA,CACxC,OAAQS,YAASQ,CAAAA,YAAAA,CAASS,SAAM,CAAA,CAAClB,UAAO,EAAA,CAAGK,CAAa,CAAC,CAAC,CAAC,CAC7D,CAAC","file":"chunk-USO3MLKI.cjs","sourcesContent":["import {\n object,\n string,\n number,\n array,\n literal,\n record,\n type z,\n any,\n optional,\n nullable,\n union,\n uuid,\n boolean as zodBoolean,\n enum as zodEnum,\n type ZodType,\n} from \"zod\";\n\nimport {\n AssetSchema,\n AssetMetadataSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { AssetTypeSchema } from \"./common\";\nimport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n} from \"../utils/quest-submission\";\n\n// ── Enums ──────────────────────────────────────────────────────────────\n\n/** closable: one active entry per item per user; continuous: unlimited per item */\nconst QuestTypeSchema = zodEnum([\"closable\", \"continuous\"]);\nconst QuestStatusSchema = zodEnum([\"draft\", \"open\", \"closed\", \"cancelled\"]);\n\nconst QuestItemStatusSchema = zodEnum([\n \"pending\",\n \"in_progress\",\n \"done\",\n \"skipped\",\n]);\n\nconst RewardCurrencySchema = zodEnum([\"btc\", \"usd\"]);\n\nconst EntryEvalStatusSchema = zodEnum([\n \"skipped\",\n \"running\",\n \"passed\",\n \"failed\",\n \"errored\",\n]);\n\nconst EntryStatusSchema = zodEnum([\"submitted\", \"accepted\", \"rejected\"]);\n\n// ── Content (TipTap) ───────────────────────────────────────────────────\n// Posts/quests share the same rich description shape: { json, text }.\n// We mirror it locally here so the quest schema doesn't depend on posts.\n\nconst TipTapNode: ZodType<any> = object({\n type: string(),\n content: optional(array(any())),\n attrs: optional(record(string(), any())),\n marks: optional(array(any())),\n text: optional(string()),\n});\n\nconst ContentSchema = object({\n json: object({\n type: literal(\"doc\"),\n content: array(TipTapNode),\n }),\n text: string(),\n});\n\n// ── Quest items ────────────────────────────────────────────────────────\n\nconst QuestItemBaseSchema = object({\n id: uuid(),\n quest_id: uuid(),\n description: string(),\n status: QuestItemStatusSchema.default(\"pending\"),\n auto_skipped: optional(nullable(string().or(any()))),\n status_before_auto_skip: optional(nullable(QuestItemStatusSchema)),\n sort_order: number().default(0),\n type: string().default(\"task\"),\n created_by: uuid(),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: number().int().nonnegative().default(0),\n reward_currency: RewardCurrencySchema.default(\"btc\"),\n reward_amount: number().int().nonnegative().default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n contributor_keys: optional(\n nullable(\n array(\n object({\n key: string(),\n required: zodBoolean().default(true),\n filters: object({\n assetType: optional(string()),\n fileType: optional(string()),\n extensions: optional(array(string())),\n hasConstraints: zodBoolean().default(false),\n }),\n }),\n ),\n ),\n ),\n created_at: string(),\n updated_at: string(),\n});\n\nconst QuestItemSchema = QuestItemBaseSchema;\n\n/**\n * Shape used by `POST /quests/create` (inline items) and\n * `POST /quests/:id/items` (batch add). The controller fills in\n * `quest_id`, `created_by`, and lifecycle-derived fields\n * (`auto_skipped`, `status_before_auto_skip`).\n *\n * Accepts a plain description string as a convenience — it's lifted\n * into `{ description }` by the `union` below.\n */\nconst CreateQuestItemObjectSchema = object({\n description: string().min(1, { message: \"Item description cannot be empty\" }),\n type: optional(string()).default(\"task\"),\n sort_order: optional(number().int()),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: optional(number().int().nonnegative()).default(0),\n reward_currency: optional(RewardCurrencySchema).default(\"btc\"),\n // Amount is in minor units of `reward_currency`: sats for BTC, cents\n // for USD. Both fit in JS numbers comfortably for our reward sizes;\n // the underlying column is `bigint`.\n reward_amount: optional(number().int().nonnegative()).default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n});\n\nconst CreateQuestItemSchema = union([\n string().transform((s) => ({ description: s })),\n CreateQuestItemObjectSchema,\n]).pipe(CreateQuestItemObjectSchema);\n\n// ── Quest ──────────────────────────────────────────────────────────────\n\nconst QuestSpecificsSchema = object({\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n closed_at: optional(nullable(string())),\n});\n\nconst QuestSchema = AssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n metadata: optional(nullable(AssetMetadataSchema.partial())),\n // List and detail both nest specifics under `quest`. Detail also hoists\n // full items to the top level. Progress (counts + bar segments) is always\n // top-level `progress` on list and detail responses.\n quest: optional(QuestSpecificsSchema.partial()),\n items: optional(array(QuestItemSchema.partial())),\n progress: optional(\n object({\n total: number(),\n done: number(),\n remaining: number(),\n // Lightweight per-item segments for progress bars (list + detail).\n items: optional(\n array(\n object({\n id: string(),\n status: QuestItemStatusSchema,\n waiting_on: optional(nullable(string())),\n waiting_until: optional(nullable(string())),\n waiting_check_every: optional(nullable(string())),\n }).partial()\n )\n ),\n })\n ),\n});\n\n/**\n * Schema used by the backend controller and SDK clients to validate /\n * default the body of `POST /quests/create`. Mirrors how\n * `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers\n * don't have to know about `GLOBAL_ORG_ID`.\n *\n * The `items` field accepts either plain strings or full item objects —\n * the backend `createQuestItems`/`createQuest` paths already handle both\n * shapes, and `CreateQuestItemSchema` normalizes strings into\n * `{ description }`.\n */\nconst CreateQuestSchema = CreateAssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n name: optional(nullable(string())).default(null),\n description: optional(nullable(ContentSchema)),\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n items: optional(array(CreateQuestItemSchema)).default([]),\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestSchema = QuestSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n items: true,\n progress: true,\n is_pinned_in_team: true,\n })\n .extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestItemSchema = CreateQuestItemObjectSchema.partial().extend({\n status: optional(QuestItemStatusSchema),\n});\n\n// ── Entries ────────────────────────────────────────────────────────────\n\nconst EntrySchema = object({\n id: uuid(),\n quest_id: uuid(),\n user_id: uuid(),\n item_id: optional(nullable(uuid())),\n asset_id: optional(nullable(uuid())),\n asset_type: optional(nullable(AssetTypeSchema)),\n assets: optional(nullable(KeyedAssetRefsSchema)),\n description: optional(nullable(ContentSchema)),\n review: optional(nullable(ContentSchema)),\n status: EntryStatusSchema,\n reviewer_id: optional(nullable(uuid())),\n reviewed_at: optional(nullable(string())),\n eval_action_id: optional(nullable(uuid())),\n eval_score: optional(nullable(number())),\n eval_status: optional(nullable(EntryEvalStatusSchema)),\n created_at: string(),\n updated_at: string(),\n});\n\nconst CreateEntrySchema = object({\n item_id: uuid(),\n assets: optional(nullable(KeyedAssetInputSchema)),\n description: optional(nullable(union([string(), ContentSchema]))),\n});\n\nconst ReviewEntrySchema = object({\n status: zodEnum([\"accepted\", \"rejected\"]),\n review: optional(nullable(union([string(), ContentSchema]))),\n});\n\n// ── Exports ────────────────────────────────────────────────────────────\n\nexport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n QuestTypeSchema,\n QuestStatusSchema,\n QuestItemStatusSchema,\n RewardCurrencySchema,\n EntryEvalStatusSchema,\n EntryStatusSchema,\n QuestSchema,\n QuestItemSchema,\n QuestItemBaseSchema,\n CreateQuestSchema,\n CreateQuestItemSchema,\n CreateQuestItemObjectSchema,\n UpdateQuestSchema,\n UpdateQuestItemSchema,\n EntrySchema,\n CreateEntrySchema,\n ReviewEntrySchema,\n};\n\nexport type QuestType = z.infer<typeof QuestTypeSchema>;\nexport type QuestStatus = z.infer<typeof QuestStatusSchema>;\nexport type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;\nexport type RewardCurrency = z.infer<typeof RewardCurrencySchema>;\nexport type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;\nexport type EntryStatus = z.infer<typeof EntryStatusSchema>;\nexport type Quest = z.infer<typeof QuestSchema>;\nexport type QuestItem = z.infer<typeof QuestItemSchema>;\nexport type CreateQuest = z.infer<typeof CreateQuestSchema>;\nexport type CreateQuestItem = z.infer<typeof CreateQuestItemSchema>;\nexport type UpdateQuest = z.infer<typeof UpdateQuestSchema>;\nexport type UpdateQuestItem = z.infer<typeof UpdateQuestItemSchema>;\nexport type Entry = z.infer<typeof EntrySchema>;\nexport type CreateEntry = z.infer<typeof CreateEntrySchema>;\nexport type ReviewEntry = z.infer<typeof ReviewEntrySchema>;\n"]}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkMOEVC3KD_cjs=require('./chunk-MOEVC3KD.cjs'),chunkVGNECRJJ_cjs=require('./chunk-VGNECRJJ.cjs'),chunkL2EAP5SJ_cjs=require('./chunk-L2EAP5SJ.cjs'),chunkNSKBXBRD_cjs=require('./chunk-NSKBXBRD.cjs'),chunk6GPIZJ4T_cjs=require('./chunk-6GPIZJ4T.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunkBWAEBQKV_cjs=require('./chunk-BWAEBQKV.cjs'),chunk6ZJQTECB_cjs=require('./chunk-6ZJQTECB.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkV73EW77Y_cjs=require('./chunk-V73EW77Y.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkFRMPLGE4_cjs=require('./chunk-FRMPLGE4.cjs'),chunkW73NWPCZ_cjs=require('./chunk-W73NWPCZ.cjs'),chunkF5CWCYOP_cjs=require('./chunk-F5CWCYOP.cjs'),chunkYKA3RUTN_cjs=require('./chunk-YKA3RUTN.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkUY43EQTO_cjs=require('./chunk-UY43EQTO.cjs'),chunkVOY623ZD_cjs=require('./chunk-VOY623ZD.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs');require('./chunk-7HF5VHUN.cjs');var chunkFLOHG4H4_cjs=require('./chunk-FLOHG4H4.cjs');Object.defineProperty(exports,"createNameUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.a}});Object.defineProperty(exports,"createUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.b}});Object.defineProperty(exports,"getAssetUrl",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.c}});Object.defineProperty(exports,"filterListToString",{enumerable:true,get:function(){return chunkVGNECRJJ_cjs.a}});Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.b}});Object.defineProperty(exports,"parseMarkdown",{enumerable:true,get:function(){return chunkNSKBXBRD_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.k}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.d}});Object.defineProperty(exports,"RouteInputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.e}});Object.defineProperty(exports,"RouteInputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.g}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.i}});Object.defineProperty(exports,"RouteOutputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.f}});Object.defineProperty(exports,"RouteOutputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.h}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.j}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.c}});Object.defineProperty(exports,"AssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.e}});Object.defineProperty(exports,"AssetTagWithTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.f}});Object.defineProperty(exports,"CreateAssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.g}});Object.defineProperty(exports,"TagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.c}});Object.defineProperty(exports,"TagSourceSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.b}});Object.defineProperty(exports,"TagTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.a}});Object.defineProperty(exports,"TagWithParentSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.d}});Object.defineProperty(exports,"TagsByTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.h}});Object.defineProperty(exports,"CommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.i}});Object.defineProperty(exports,"DatasetEnumColumnsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.c}});Object.defineProperty(exports,"DatasetRefsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.b}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.g}});Object.defineProperty(exports,"EnrichedDatasetSchemaFieldSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.d}});Object.defineProperty(exports,"RefKindSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.a}});Object.defineProperty(exports,"ResolvedRefSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.e}});Object.defineProperty(exports,"ResolvedRefsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.f}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.j}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.a}});Object.defineProperty(exports,"CreateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.b}});Object.defineProperty(exports,"ReadTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.c}});Object.defineProperty(exports,"ReadTeamsSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.d}});Object.defineProperty(exports,"TeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.a}});Object.defineProperty(exports,"UpdateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.e}});Object.defineProperty(exports,"ActorTypePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.a}});Object.defineProperty(exports,"MembershipSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.d}});Object.defineProperty(exports,"OrganizationsSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.c}});Object.defineProperty(exports,"SourcePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.b}});Object.defineProperty(exports,"ActorTypeSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.a}});Object.defineProperty(exports,"ProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.b}});Object.defineProperty(exports,"ReadProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.c}});Object.defineProperty(exports,"UpdateProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.d}});Object.defineProperty(exports,"AssetTypeSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.a}});Object.defineProperty(exports,"ConnectionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.g}});Object.defineProperty(exports,"EmbeddingSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.f}});Object.defineProperty(exports,"MonetizationSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.d}});Object.defineProperty(exports,"PermissionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.i}});Object.defineProperty(exports,"PriceCurrencySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.e}});Object.defineProperty(exports,"PurchaseAssetSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.h}});Object.defineProperty(exports,"RoleSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.c}});Object.defineProperty(exports,"SourceSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.k}});Object.defineProperty(exports,"StatusSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.j}});Object.defineProperty(exports,"VisibilitySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.b}});Object.defineProperty(exports,"USER_SUBSCRIBABLE_WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.b}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkMOEVC3KD_cjs=require('./chunk-MOEVC3KD.cjs'),chunkVGNECRJJ_cjs=require('./chunk-VGNECRJJ.cjs'),chunkTUZS3DKI_cjs=require('./chunk-TUZS3DKI.cjs'),chunkNSKBXBRD_cjs=require('./chunk-NSKBXBRD.cjs'),chunk6GPIZJ4T_cjs=require('./chunk-6GPIZJ4T.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunkUSO3MLKI_cjs=require('./chunk-USO3MLKI.cjs'),chunk6ZJQTECB_cjs=require('./chunk-6ZJQTECB.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkV73EW77Y_cjs=require('./chunk-V73EW77Y.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkFRMPLGE4_cjs=require('./chunk-FRMPLGE4.cjs'),chunkDBEBXFQI_cjs=require('./chunk-DBEBXFQI.cjs'),chunkF5CWCYOP_cjs=require('./chunk-F5CWCYOP.cjs'),chunkYKA3RUTN_cjs=require('./chunk-YKA3RUTN.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkUY43EQTO_cjs=require('./chunk-UY43EQTO.cjs'),chunkVOY623ZD_cjs=require('./chunk-VOY623ZD.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs');require('./chunk-7HF5VHUN.cjs');var chunkFLOHG4H4_cjs=require('./chunk-FLOHG4H4.cjs');Object.defineProperty(exports,"createNameUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.a}});Object.defineProperty(exports,"createUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.b}});Object.defineProperty(exports,"getAssetUrl",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.c}});Object.defineProperty(exports,"filterListToString",{enumerable:true,get:function(){return chunkVGNECRJJ_cjs.a}});Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.b}});Object.defineProperty(exports,"parseMarkdown",{enumerable:true,get:function(){return chunkNSKBXBRD_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.k}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.d}});Object.defineProperty(exports,"RouteInputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.e}});Object.defineProperty(exports,"RouteInputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.g}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.i}});Object.defineProperty(exports,"RouteOutputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.f}});Object.defineProperty(exports,"RouteOutputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.h}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.j}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.c}});Object.defineProperty(exports,"AssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.e}});Object.defineProperty(exports,"AssetTagWithTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.f}});Object.defineProperty(exports,"CreateAssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.g}});Object.defineProperty(exports,"TagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.c}});Object.defineProperty(exports,"TagSourceSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.b}});Object.defineProperty(exports,"TagTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.a}});Object.defineProperty(exports,"TagWithParentSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.d}});Object.defineProperty(exports,"TagsByTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.h}});Object.defineProperty(exports,"CommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.i}});Object.defineProperty(exports,"DatasetEnumColumnsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.c}});Object.defineProperty(exports,"DatasetRefsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.b}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.g}});Object.defineProperty(exports,"EnrichedDatasetSchemaFieldSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.d}});Object.defineProperty(exports,"RefKindSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.a}});Object.defineProperty(exports,"ResolvedRefSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.e}});Object.defineProperty(exports,"ResolvedRefsSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.f}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkYKA3RUTN_cjs.j}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.a}});Object.defineProperty(exports,"CreateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.b}});Object.defineProperty(exports,"ReadTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.c}});Object.defineProperty(exports,"ReadTeamsSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.d}});Object.defineProperty(exports,"TeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.a}});Object.defineProperty(exports,"UpdateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.e}});Object.defineProperty(exports,"ActorTypePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.a}});Object.defineProperty(exports,"MembershipSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.d}});Object.defineProperty(exports,"OrganizationsSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.c}});Object.defineProperty(exports,"SourcePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.b}});Object.defineProperty(exports,"ActorTypeSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.a}});Object.defineProperty(exports,"ProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.b}});Object.defineProperty(exports,"ReadProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.c}});Object.defineProperty(exports,"UpdateProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.d}});Object.defineProperty(exports,"AssetTypeSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.a}});Object.defineProperty(exports,"ConnectionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.g}});Object.defineProperty(exports,"EmbeddingSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.f}});Object.defineProperty(exports,"MonetizationSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.d}});Object.defineProperty(exports,"PermissionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.i}});Object.defineProperty(exports,"PriceCurrencySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.e}});Object.defineProperty(exports,"PurchaseAssetSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.h}});Object.defineProperty(exports,"RoleSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.c}});Object.defineProperty(exports,"SourceSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.k}});Object.defineProperty(exports,"StatusSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.j}});Object.defineProperty(exports,"VisibilitySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.b}});Object.defineProperty(exports,"USER_SUBSCRIBABLE_WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkFLOHG4H4_cjs.b}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as createNameUrlSlug,b as createUrlSlug,c as getAssetUrl}from'./chunk-EY4OFSDP.js';export{a as filterListToString}from'./chunk-OJQM6MWS.js';export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'./chunk-PONEAJK7.js';export{a as parseMarkdown}from'./chunk-KXYKN3TY.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-KCVE35IO.js';export{a as NotificationSchema}from'./chunk-JISPX5A6.js';export{p as CreateEntrySchema,i as CreateQuestItemObjectSchema,j as CreateQuestItemSchema,l as CreateQuestSchema,e as EntryEvalStatusSchema,o as EntrySchema,f as EntryStatusSchema,g as QuestItemBaseSchema,h as QuestItemSchema,c as QuestItemStatusSchema,k as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,q as ReviewEntrySchema,d as RewardCurrencySchema,n as UpdateQuestItemSchema,m as UpdateQuestSchema}from'./chunk-R2W4NEEJ.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema,k as assetMatchesDeclaration,j as declarationToPickerFilters,f as declarationToSubmissionDeclaration,l as getPrimaryAssetRef,h as getPrimaryDeclarationKey,e as getRouteInputDeclarationsFromRoute,i as getSubmissionAssetShape,g as materializeContributorSubmissionAssets,m as toRouteInputAssets}from'./chunk-TYOQ32UV.js';export{a as reactionSchema}from'./chunk-WE6CXCEQ.js';export{k as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteInputAssetDeclarationSchema,g as RouteInputAssetsSchema,i as RouteMetricsSchema,f as RouteOutputAssetDeclarationSchema,h as RouteOutputAssetsSchema,j as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'./chunk-MLTO7TMM.js';export{e as AssetTagSchema,f as AssetTagWithTagSchema,g as CreateAssetTagSchema,c as TagSchema,b as TagSourceSchema,a as TagTypeSchema,d as TagWithParentSchema,h as TagsByTypeSchema}from'./chunk-EEXD7LGK.js';export{a as CommentSchema,b as CreateCommentSchema}from'./chunk-G3VMEPTP.js';export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'./chunk-QR2BSJ2C.js';export{b as ContentSchema,d as CreatePostSchema,g as ListPostsSchema,c as PostSchema,e as ReadPostSchema,f as ReadPostsSchema,a as TipTapSchema,h as UpdatePostSchema}from'./chunk-IWOXGKK4.js';export{h as CreateDatasetFromFileSchema,i as CreateDatasetFromSchemaSchema,c as DatasetEnumColumnsSchema,b as DatasetRefsSchema,g as DatasetSchema,d as EnrichedDatasetSchemaFieldSchema,a as RefKindSchema,e as ResolvedRefSchema,f as ResolvedRefsSchema,j as updateDatasetSchema}from'./chunk-WNYOQITO.js';export{b as AssetMetadataSchema,c as AssetSchema,d as CreateAssetSchema,e as UpdateAssetSchema,a as normalizeAssetConfigForParsing}from'./chunk-SR5UZ4NP.js';export{b as CreateTeamSchema,c as ReadTeamSchema,d as ReadTeamsSchema,a as TeamSchema,e as UpdateTeamSchema}from'./chunk-CF56NFUG.js';export{a as ActorTypePolicySchema,d as MembershipSchema,c as OrganizationsSchema,b as SourcePolicySchema}from'./chunk-WLGOABHV.js';export{a as ActorTypeSchema,b as ProfileSchema,c as ReadProfileSchema,d as UpdateProfileSchema}from'./chunk-3N56ERWF.js';export{a as AssetTypeSchema,g as ConnectionSchema,f as EmbeddingSchema,d as MonetizationSchema,i as PermissionSchema,e as PriceCurrencySchema,h as PurchaseAssetSchema,c as RoleSchema,k as SourceSchema,j as StatusSchema,b as VisibilitySchema}from'./chunk-WRHPQNEL.js';import'./chunk-DUBPWSCA.js';export{c as USER_SUBSCRIBABLE_WEBHOOK_EVENTS,a as WEBHOOK_EVENTS,b as WEBHOOK_EVENT_TYPES}from'./chunk-X2PI5PAT.js';//# sourceMappingURL=index.js.map
1
+ export{a as createNameUrlSlug,b as createUrlSlug,c as getAssetUrl}from'./chunk-EY4OFSDP.js';export{a as filterListToString}from'./chunk-OJQM6MWS.js';export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'./chunk-LQOKGPEK.js';export{a as parseMarkdown}from'./chunk-KXYKN3TY.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-KCVE35IO.js';export{a as NotificationSchema}from'./chunk-JISPX5A6.js';export{p as CreateEntrySchema,i as CreateQuestItemObjectSchema,j as CreateQuestItemSchema,l as CreateQuestSchema,e as EntryEvalStatusSchema,o as EntrySchema,f as EntryStatusSchema,g as QuestItemBaseSchema,h as QuestItemSchema,c as QuestItemStatusSchema,k as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,q as ReviewEntrySchema,d as RewardCurrencySchema,n as UpdateQuestItemSchema,m as UpdateQuestSchema}from'./chunk-NABNY2EN.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema,k as assetMatchesDeclaration,j as declarationToPickerFilters,f as declarationToSubmissionDeclaration,l as getPrimaryAssetRef,h as getPrimaryDeclarationKey,e as getRouteInputDeclarationsFromRoute,i as getSubmissionAssetShape,g as materializeContributorSubmissionAssets,m as toRouteInputAssets}from'./chunk-TYOQ32UV.js';export{a as reactionSchema}from'./chunk-WE6CXCEQ.js';export{k as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteInputAssetDeclarationSchema,g as RouteInputAssetsSchema,i as RouteMetricsSchema,f as RouteOutputAssetDeclarationSchema,h as RouteOutputAssetsSchema,j as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'./chunk-MLTO7TMM.js';export{e as AssetTagSchema,f as AssetTagWithTagSchema,g as CreateAssetTagSchema,c as TagSchema,b as TagSourceSchema,a as TagTypeSchema,d as TagWithParentSchema,h as TagsByTypeSchema}from'./chunk-EEXD7LGK.js';export{a as CommentSchema,b as CreateCommentSchema}from'./chunk-G3VMEPTP.js';export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'./chunk-4UE3XIYR.js';export{b as ContentSchema,d as CreatePostSchema,g as ListPostsSchema,c as PostSchema,e as ReadPostSchema,f as ReadPostsSchema,a as TipTapSchema,h as UpdatePostSchema}from'./chunk-IWOXGKK4.js';export{h as CreateDatasetFromFileSchema,i as CreateDatasetFromSchemaSchema,c as DatasetEnumColumnsSchema,b as DatasetRefsSchema,g as DatasetSchema,d as EnrichedDatasetSchemaFieldSchema,a as RefKindSchema,e as ResolvedRefSchema,f as ResolvedRefsSchema,j as updateDatasetSchema}from'./chunk-WNYOQITO.js';export{b as AssetMetadataSchema,c as AssetSchema,d as CreateAssetSchema,e as UpdateAssetSchema,a as normalizeAssetConfigForParsing}from'./chunk-SR5UZ4NP.js';export{b as CreateTeamSchema,c as ReadTeamSchema,d as ReadTeamsSchema,a as TeamSchema,e as UpdateTeamSchema}from'./chunk-CF56NFUG.js';export{a as ActorTypePolicySchema,d as MembershipSchema,c as OrganizationsSchema,b as SourcePolicySchema}from'./chunk-WLGOABHV.js';export{a as ActorTypeSchema,b as ProfileSchema,c as ReadProfileSchema,d as UpdateProfileSchema}from'./chunk-3N56ERWF.js';export{a as AssetTypeSchema,g as ConnectionSchema,f as EmbeddingSchema,d as MonetizationSchema,i as PermissionSchema,e as PriceCurrencySchema,h as PurchaseAssetSchema,c as RoleSchema,k as SourceSchema,j as StatusSchema,b as VisibilitySchema}from'./chunk-WRHPQNEL.js';import'./chunk-DUBPWSCA.js';export{c as USER_SUBSCRIBABLE_WEBHOOK_EVENTS,a as WEBHOOK_EVENTS,b as WEBHOOK_EVENT_TYPES}from'./chunk-X2PI5PAT.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkW73NWPCZ_cjs=require('../chunk-W73NWPCZ.cjs');require('../chunk-F5CWCYOP.cjs'),require('../chunk-ROMY5WNQ.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkW73NWPCZ_cjs.c}});//# sourceMappingURL=conversations.cjs.map
1
+ 'use strict';var chunkDBEBXFQI_cjs=require('../chunk-DBEBXFQI.cjs');require('../chunk-F5CWCYOP.cjs'),require('../chunk-ROMY5WNQ.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkDBEBXFQI_cjs.c}});//# sourceMappingURL=conversations.cjs.map
2
2
  //# sourceMappingURL=conversations.cjs.map
@@ -174,7 +174,6 @@ declare const ConversationSchema: z.ZodObject<{
174
174
  parent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
175
175
  license_id: z.ZodString;
176
176
  license: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
177
- name: z.ZodString;
178
177
  name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
178
  slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
179
  description: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -235,6 +234,7 @@ declare const ConversationSchema: z.ZodObject<{
235
234
  comment: "comment";
236
235
  conversation: "conversation";
237
236
  }>>;
237
+ name: z.ZodNullable<z.ZodString>;
238
238
  metadata: z.ZodObject<{
239
239
  members: z.ZodArray<z.ZodString>;
240
240
  doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -300,7 +300,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
300
300
  id: z.ZodDefault<z.ZodUUID>;
301
301
  team_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
302
302
  org_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
303
- name: z.ZodString;
304
303
  name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
304
  state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
306
305
  success: "success";
@@ -328,6 +327,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
328
327
  monetized: "monetized";
329
328
  inherit: "inherit";
330
329
  }>>;
330
+ name: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>, z.ZodTransform<string | undefined, string | null>>, z.ZodTransform<string | null, string | undefined>>;
331
331
  metadata: z.ZodObject<{
332
332
  members: z.ZodArray<z.ZodString>;
333
333
  doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -346,7 +346,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
346
346
  id: string;
347
347
  team_id: string | null;
348
348
  org_id: string | null;
349
- name: string;
350
349
  state: "success" | "queued" | "in-progress" | "timed-out" | "error";
351
350
  source: "api" | "web";
352
351
  created_at: string;
@@ -354,6 +353,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
354
353
  asset_type: "conversation";
355
354
  monetization: "none" | "pay-to-unlock" | "pay-per-use";
356
355
  visibility: "organization" | "public" | "private" | "monetized" | "inherit";
356
+ name: string | null;
357
357
  metadata: {
358
358
  members: string[];
359
359
  doi_url?: string | null | undefined;
@@ -385,7 +385,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
385
385
  id: string;
386
386
  team_id: string | null;
387
387
  org_id: string | null;
388
- name: string;
389
388
  state: "success" | "queued" | "in-progress" | "timed-out" | "error";
390
389
  source: "api" | "web";
391
390
  created_at: string;
@@ -393,6 +392,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
393
392
  asset_type: "conversation";
394
393
  monetization: "none" | "pay-to-unlock" | "pay-per-use";
395
394
  visibility: "organization" | "public" | "private" | "monetized" | "inherit";
395
+ name: string | null;
396
396
  metadata: {
397
397
  members: string[];
398
398
  doi_url?: string | null | undefined;
@@ -440,7 +440,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
440
440
  }, z.core.$strip>>;
441
441
  created_at: z.ZodOptional<z.ZodDefault<z.ZodString>>;
442
442
  last_updated: z.ZodOptional<z.ZodDefault<z.ZodString>>;
443
- name: z.ZodOptional<z.ZodString>;
443
+ name: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>, z.ZodTransform<string | undefined, string | null>>, z.ZodTransform<string | null, string | undefined>>>;
444
444
  visibility: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
445
445
  organization: "organization";
446
446
  public: "public";
@@ -501,7 +501,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
501
501
  } | undefined;
502
502
  created_at?: string | undefined;
503
503
  last_updated?: string | undefined;
504
- name?: string | undefined;
504
+ name?: string | null | undefined;
505
505
  visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
506
506
  description?: {
507
507
  json: Record<string, any>;
@@ -537,7 +537,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
537
537
  } | undefined;
538
538
  created_at?: string | undefined;
539
539
  last_updated?: string | undefined;
540
- name?: string | undefined;
540
+ name?: string | null | undefined;
541
541
  visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
542
542
  description?: {
543
543
  json: Record<string, any>;
@@ -174,7 +174,6 @@ declare const ConversationSchema: z.ZodObject<{
174
174
  parent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
175
175
  license_id: z.ZodString;
176
176
  license: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
177
- name: z.ZodString;
178
177
  name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
178
  slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
179
  description: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -235,6 +234,7 @@ declare const ConversationSchema: z.ZodObject<{
235
234
  comment: "comment";
236
235
  conversation: "conversation";
237
236
  }>>;
237
+ name: z.ZodNullable<z.ZodString>;
238
238
  metadata: z.ZodObject<{
239
239
  members: z.ZodArray<z.ZodString>;
240
240
  doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -300,7 +300,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
300
300
  id: z.ZodDefault<z.ZodUUID>;
301
301
  team_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
302
302
  org_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
303
- name: z.ZodString;
304
303
  name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
304
  state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
306
305
  success: "success";
@@ -328,6 +327,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
328
327
  monetized: "monetized";
329
328
  inherit: "inherit";
330
329
  }>>;
330
+ name: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>, z.ZodTransform<string | undefined, string | null>>, z.ZodTransform<string | null, string | undefined>>;
331
331
  metadata: z.ZodObject<{
332
332
  members: z.ZodArray<z.ZodString>;
333
333
  doi_url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -346,7 +346,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
346
346
  id: string;
347
347
  team_id: string | null;
348
348
  org_id: string | null;
349
- name: string;
350
349
  state: "success" | "queued" | "in-progress" | "timed-out" | "error";
351
350
  source: "api" | "web";
352
351
  created_at: string;
@@ -354,6 +353,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
354
353
  asset_type: "conversation";
355
354
  monetization: "none" | "pay-to-unlock" | "pay-per-use";
356
355
  visibility: "organization" | "public" | "private" | "monetized" | "inherit";
356
+ name: string | null;
357
357
  metadata: {
358
358
  members: string[];
359
359
  doi_url?: string | null | undefined;
@@ -385,7 +385,6 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
385
385
  id: string;
386
386
  team_id: string | null;
387
387
  org_id: string | null;
388
- name: string;
389
388
  state: "success" | "queued" | "in-progress" | "timed-out" | "error";
390
389
  source: "api" | "web";
391
390
  created_at: string;
@@ -393,6 +392,7 @@ declare const CreateConversationSchema: z.ZodPipe<z.ZodObject<{
393
392
  asset_type: "conversation";
394
393
  monetization: "none" | "pay-to-unlock" | "pay-per-use";
395
394
  visibility: "organization" | "public" | "private" | "monetized" | "inherit";
395
+ name: string | null;
396
396
  metadata: {
397
397
  members: string[];
398
398
  doi_url?: string | null | undefined;
@@ -440,7 +440,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
440
440
  }, z.core.$strip>>;
441
441
  created_at: z.ZodOptional<z.ZodDefault<z.ZodString>>;
442
442
  last_updated: z.ZodOptional<z.ZodDefault<z.ZodString>>;
443
- name: z.ZodOptional<z.ZodString>;
443
+ name: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>, z.ZodTransform<string | undefined, string | null>>, z.ZodTransform<string | null, string | undefined>>>;
444
444
  visibility: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
445
445
  organization: "organization";
446
446
  public: "public";
@@ -501,7 +501,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
501
501
  } | undefined;
502
502
  created_at?: string | undefined;
503
503
  last_updated?: string | undefined;
504
- name?: string | undefined;
504
+ name?: string | null | undefined;
505
505
  visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
506
506
  description?: {
507
507
  json: Record<string, any>;
@@ -537,7 +537,7 @@ declare const UpdateConversationSchema: z.ZodPipe<z.ZodObject<{
537
537
  } | undefined;
538
538
  created_at?: string | undefined;
539
539
  last_updated?: string | undefined;
540
- name?: string | undefined;
540
+ name?: string | null | undefined;
541
541
  visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
542
542
  description?: {
543
543
  json: Record<string, any>;
@@ -1,2 +1,2 @@
1
- export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'../chunk-QR2BSJ2C.js';import'../chunk-IWOXGKK4.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=conversations.js.map
1
+ export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'../chunk-4UE3XIYR.js';import'../chunk-IWOXGKK4.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=conversations.js.map
2
2
  //# sourceMappingURL=conversations.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkBWAEBQKV_cjs=require('../chunk-BWAEBQKV.cjs'),chunk6ZJQTECB_cjs=require('../chunk-6ZJQTECB.cjs');require('../chunk-V73EW77Y.cjs'),require('../chunk-ROMY5WNQ.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});//# sourceMappingURL=quests.cjs.map
1
+ 'use strict';var chunkUSO3MLKI_cjs=require('../chunk-USO3MLKI.cjs'),chunk6ZJQTECB_cjs=require('../chunk-6ZJQTECB.cjs');require('../chunk-V73EW77Y.cjs'),require('../chunk-ROMY5WNQ.cjs'),require('../chunk-UY43EQTO.cjs'),require('../chunk-VOY623ZD.cjs'),require('../chunk-GY6SLMMJ.cjs'),require('../chunk-43KB23BA.cjs'),require('../chunk-7HF5VHUN.cjs');Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkUSO3MLKI_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});//# sourceMappingURL=quests.cjs.map
2
2
  //# sourceMappingURL=quests.cjs.map
@@ -778,6 +778,18 @@ declare const QuestSchema: z.ZodObject<{
778
778
  total: z.ZodNumber;
779
779
  done: z.ZodNumber;
780
780
  remaining: z.ZodNumber;
781
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
782
+ id: z.ZodOptional<z.ZodString>;
783
+ status: z.ZodOptional<z.ZodEnum<{
784
+ pending: "pending";
785
+ in_progress: "in_progress";
786
+ done: "done";
787
+ skipped: "skipped";
788
+ }>>;
789
+ waiting_on: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
790
+ waiting_until: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
791
+ waiting_check_every: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
792
+ }, z.core.$strip>>>;
781
793
  }, z.core.$strip>>;
782
794
  }, z.core.$strip>;
783
795
  /**
@@ -778,6 +778,18 @@ declare const QuestSchema: z.ZodObject<{
778
778
  total: z.ZodNumber;
779
779
  done: z.ZodNumber;
780
780
  remaining: z.ZodNumber;
781
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
782
+ id: z.ZodOptional<z.ZodString>;
783
+ status: z.ZodOptional<z.ZodEnum<{
784
+ pending: "pending";
785
+ in_progress: "in_progress";
786
+ done: "done";
787
+ skipped: "skipped";
788
+ }>>;
789
+ waiting_on: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
790
+ waiting_until: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
791
+ waiting_check_every: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
792
+ }, z.core.$strip>>>;
781
793
  }, z.core.$strip>>;
782
794
  }, z.core.$strip>;
783
795
  /**
@@ -1,2 +1,2 @@
1
- export{p as CreateEntrySchema,i as CreateQuestItemObjectSchema,j as CreateQuestItemSchema,l as CreateQuestSchema,e as EntryEvalStatusSchema,o as EntrySchema,f as EntryStatusSchema,g as QuestItemBaseSchema,h as QuestItemSchema,c as QuestItemStatusSchema,k as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,q as ReviewEntrySchema,d as RewardCurrencySchema,n as UpdateQuestItemSchema,m as UpdateQuestSchema}from'../chunk-R2W4NEEJ.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema}from'../chunk-TYOQ32UV.js';import'../chunk-MLTO7TMM.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=quests.js.map
1
+ export{p as CreateEntrySchema,i as CreateQuestItemObjectSchema,j as CreateQuestItemSchema,l as CreateQuestSchema,e as EntryEvalStatusSchema,o as EntrySchema,f as EntryStatusSchema,g as QuestItemBaseSchema,h as QuestItemSchema,c as QuestItemStatusSchema,k as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,q as ReviewEntrySchema,d as RewardCurrencySchema,n as UpdateQuestItemSchema,m as UpdateQuestSchema}from'../chunk-NABNY2EN.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema}from'../chunk-TYOQ32UV.js';import'../chunk-MLTO7TMM.js';import'../chunk-SR5UZ4NP.js';import'../chunk-CF56NFUG.js';import'../chunk-WLGOABHV.js';import'../chunk-3N56ERWF.js';import'../chunk-WRHPQNEL.js';import'../chunk-DUBPWSCA.js';//# sourceMappingURL=quests.js.map
2
2
  //# sourceMappingURL=quests.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkL2EAP5SJ_cjs=require('../../chunk-L2EAP5SJ.cjs');Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.b}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkTUZS3DKI_cjs=require('../../chunk-TUZS3DKI.cjs');Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkTUZS3DKI_cjs.b}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -14,12 +14,14 @@ interface DisplayConfig {
14
14
  filters?: DataFilter[];
15
15
  /** Route: ID of a specific action to preview (status, logs, side-effect assets). */
16
16
  actionId?: string | null;
17
+ /** Route: author-provided defaults for an interactive route form. */
18
+ defaultValues?: Record<string, unknown>;
17
19
  }
18
20
  /**
19
21
  * Normalize legacy viewMode values to the current set.
20
22
  * "chart" → "preview", "default" → "card", anything else → "card".
21
23
  */
22
- declare function normalizeViewMode(raw: string | undefined | null): "card" | "preview" | "list";
24
+ declare function normalizeViewMode(raw: string | undefined | null): "card" | "preview" | "interactive" | "list";
23
25
  /**
24
26
  * Build a DisplayConfig from node/element attributes, handling the legacy
25
27
  * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.
@@ -33,7 +35,7 @@ declare function resolveDisplayConfig(attrs: {
33
35
  interface InlineAssetAttrs {
34
36
  id: string;
35
37
  assetType: string;
36
- viewMode: "card" | "preview" | "list";
38
+ viewMode: "card" | "preview" | "interactive" | "list";
37
39
  displayConfig?: DisplayConfig | null;
38
40
  /** @deprecated Use displayConfig.filters */
39
41
  filters?: any;
@@ -14,12 +14,14 @@ interface DisplayConfig {
14
14
  filters?: DataFilter[];
15
15
  /** Route: ID of a specific action to preview (status, logs, side-effect assets). */
16
16
  actionId?: string | null;
17
+ /** Route: author-provided defaults for an interactive route form. */
18
+ defaultValues?: Record<string, unknown>;
17
19
  }
18
20
  /**
19
21
  * Normalize legacy viewMode values to the current set.
20
22
  * "chart" → "preview", "default" → "card", anything else → "card".
21
23
  */
22
- declare function normalizeViewMode(raw: string | undefined | null): "card" | "preview" | "list";
24
+ declare function normalizeViewMode(raw: string | undefined | null): "card" | "preview" | "interactive" | "list";
23
25
  /**
24
26
  * Build a DisplayConfig from node/element attributes, handling the legacy
25
27
  * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.
@@ -33,7 +35,7 @@ declare function resolveDisplayConfig(attrs: {
33
35
  interface InlineAssetAttrs {
34
36
  id: string;
35
37
  assetType: string;
36
- viewMode: "card" | "preview" | "list";
38
+ viewMode: "card" | "preview" | "interactive" | "list";
37
39
  displayConfig?: DisplayConfig | null;
38
40
  /** @deprecated Use displayConfig.filters */
39
41
  filters?: any;
@@ -1,2 +1,2 @@
1
- export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'../../chunk-PONEAJK7.js';//# sourceMappingURL=index.js.map
1
+ export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'../../chunk-LQOKGPEK.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ourofoundation/ouro-js",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "description": "Interact with the Ouro platform in browser and node.js environments",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.cjs",
@@ -1,2 +0,0 @@
1
- 'use strict';var chunk6ZJQTECB_cjs=require('./chunk-6ZJQTECB.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var E=zod.enum(["closable","continuous"]),w=zod.enum(["draft","open","closed","cancelled"]),f=zod.enum(["pending","in_progress","done","skipped"]),C=zod.enum(["btc","usd"]),I=zod.enum(["skipped","running","passed","failed","errored"]),q=zod.enum(["submitted","accepted","rejected"]),T=zod.object({type:zod.string(),content:zod.optional(zod.array(zod.any())),attrs:zod.optional(zod.record(zod.string(),zod.any())),marks:zod.optional(zod.array(zod.any())),text:zod.optional(zod.string())}),p=zod.object({json:zod.object({type:zod.literal("doc"),content:zod.array(T)}),text:zod.string()}),k=zod.object({id:zod.uuid(),quest_id:zod.uuid(),description:zod.string(),status:f.default("pending"),auto_skipped:zod.optional(zod.nullable(zod.string().or(zod.any()))),status_before_auto_skip:zod.optional(zod.nullable(f)),sort_order:zod.number().default(0),type:zod.string().default("task"),created_by:zod.uuid(),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),reward_xp:zod.number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:zod.number().int().nonnegative().default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunk6ZJQTECB_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),notes:zod.optional(zod.nullable(zod.string())),contributor_keys:zod.optional(zod.nullable(zod.array(zod.object({key:zod.string(),required:zod.boolean().default(true),filters:zod.object({assetType:zod.optional(zod.string()),fileType:zod.optional(zod.string()),extensions:zod.optional(zod.array(zod.string())),hasConstraints:zod.boolean().default(false)})})))),created_at:zod.string(),updated_at:zod.string()}),A=k,S=zod.object({description:zod.string().min(1,{message:"Item description cannot be empty"}),type:zod.optional(zod.string()).default("task"),sort_order:zod.optional(zod.number().int()),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),reward_xp:zod.optional(zod.number().int().nonnegative()).default(0),reward_currency:zod.optional(C).default("btc"),reward_amount:zod.optional(zod.number().int().nonnegative()).default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunk6ZJQTECB_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),notes:zod.optional(zod.nullable(zod.string()))}),R=zod.union([zod.string().transform(u=>({description:u})),S]).pipe(S),U=zod.object({type:E.default("closable"),status:w.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),closed_at:zod.optional(zod.nullable(zod.string()))}),j=chunkROMY5WNQ_cjs.c.extend({asset_type:zod.literal("quest").default("quest"),metadata:zod.optional(zod.nullable(chunkROMY5WNQ_cjs.b.partial())),quest:zod.optional(U.partial()),items:zod.optional(zod.array(A.partial())),progress:zod.optional(zod.object({total:zod.number(),done:zod.number(),remaining:zod.number()}))}),Z=chunkROMY5WNQ_cjs.d.extend({asset_type:zod.literal("quest").default("quest"),name:zod.optional(zod.nullable(zod.string())).default(null),description:zod.optional(zod.nullable(p)),type:E.default("closable"),status:w.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),items:zod.optional(zod.array(R)).default([])}).transform(u=>chunkROMY5WNQ_cjs.a(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:zod.literal("quest").default("quest"),last_updated:zod.string().default(()=>new Date().toISOString())}).transform(u=>chunkROMY5WNQ_cjs.a(u)),M=S.partial().extend({status:zod.optional(f)}),N=zod.object({id:zod.uuid(),quest_id:zod.uuid(),user_id:zod.uuid(),item_id:zod.optional(zod.nullable(zod.uuid())),asset_id:zod.optional(zod.nullable(zod.uuid())),asset_type:zod.optional(zod.nullable(chunk43KB23BA_cjs.a)),assets:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.a)),description:zod.optional(zod.nullable(p)),review:zod.optional(zod.nullable(p)),status:q,reviewer_id:zod.optional(zod.nullable(zod.uuid())),reviewed_at:zod.optional(zod.nullable(zod.string())),eval_action_id:zod.optional(zod.nullable(zod.uuid())),eval_score:zod.optional(zod.nullable(zod.number())),eval_status:zod.optional(zod.nullable(I)),created_at:zod.string(),updated_at:zod.string()}),P=zod.object({item_id:zod.uuid(),assets:zod.optional(zod.nullable(chunk6ZJQTECB_cjs.c)),description:zod.optional(zod.nullable(zod.union([zod.string(),p])))}),G=zod.object({status:zod.enum(["accepted","rejected"]),review:zod.optional(zod.nullable(zod.union([zod.string(),p])))});exports.a=E;exports.b=w;exports.c=f;exports.d=C;exports.e=I;exports.f=q;exports.g=k;exports.h=A;exports.i=S;exports.j=R;exports.k=j;exports.l=Z;exports.m=F;exports.n=M;exports.o=N;exports.p=P;exports.q=G;//# sourceMappingURL=chunk-BWAEBQKV.cjs.map
2
- //# sourceMappingURL=chunk-BWAEBQKV.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schema/quests.ts"],"names":["QuestTypeSchema","zodEnum","QuestStatusSchema","QuestItemStatusSchema","RewardCurrencySchema","EntryEvalStatusSchema","EntryStatusSchema","TipTapNode","object","string","optional","array","any","record","ContentSchema","literal","QuestItemBaseSchema","uuid","nullable","number","AssetTypeSchema","QuestSubmissionAssetDeclarationSchema","KeyedAssetRefsSchema","zodBoolean","QuestItemSchema","CreateQuestItemObjectSchema","CreateQuestItemSchema","union","s","QuestSpecificsSchema","QuestSchema","AssetSchema","AssetMetadataSchema","CreateQuestSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateQuestSchema","UpdateQuestItemSchema","EntrySchema","CreateEntrySchema","KeyedAssetInputSchema","ReviewEntrySchema"],"mappings":"8LAkCMA,CAAkBC,CAAAA,QAAA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AAAA,YAAAA,CAASb,CAAqB,CAAC,CAAA,CACrD,UAAYI,CAAAA,UAAAA,EACZ,CAAA,UAAA,CAAYA,YACd,CAAC,EAEK+B,CAAoBhC,CAAAA,UAAAA,CAAO,CAC/B,OAASS,CAAAA,QAAAA,EACT,CAAA,MAAA,CAAQP,YAASQ,CAAAA,YAAAA,CAASuB,mBAAqB,CAAC,CAAA,CAChD,WAAa/B,CAAAA,YAAAA,CAASQ,YAASS,CAAAA,SAAAA,CAAM,CAAClB,UAAO,EAAA,CAAGK,CAAa,CAAC,CAAC,CAAC,CAClE,CAAC,CAAA,CAEK4B,EAAoBlC,UAAO,CAAA,CAC/B,OAAQP,QAAQ,CAAA,CAAC,UAAY,CAAA,UAAU,CAAC,CAAA,CACxC,OAAQS,YAASQ,CAAAA,YAAAA,CAASS,SAAM,CAAA,CAAClB,UAAO,EAAA,CAAGK,CAAa,CAAC,CAAC,CAAC,CAC7D,CAAC","file":"chunk-BWAEBQKV.cjs","sourcesContent":["import {\n object,\n string,\n number,\n array,\n literal,\n record,\n type z,\n any,\n optional,\n nullable,\n union,\n uuid,\n boolean as zodBoolean,\n enum as zodEnum,\n type ZodType,\n} from \"zod\";\n\nimport {\n AssetSchema,\n AssetMetadataSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { AssetTypeSchema } from \"./common\";\nimport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n} from \"../utils/quest-submission\";\n\n// ── Enums ──────────────────────────────────────────────────────────────\n\n/** closable: one active entry per item per user; continuous: unlimited per item */\nconst QuestTypeSchema = zodEnum([\"closable\", \"continuous\"]);\nconst QuestStatusSchema = zodEnum([\"draft\", \"open\", \"closed\", \"cancelled\"]);\n\nconst QuestItemStatusSchema = zodEnum([\n \"pending\",\n \"in_progress\",\n \"done\",\n \"skipped\",\n]);\n\nconst RewardCurrencySchema = zodEnum([\"btc\", \"usd\"]);\n\nconst EntryEvalStatusSchema = zodEnum([\n \"skipped\",\n \"running\",\n \"passed\",\n \"failed\",\n \"errored\",\n]);\n\nconst EntryStatusSchema = zodEnum([\"submitted\", \"accepted\", \"rejected\"]);\n\n// ── Content (TipTap) ───────────────────────────────────────────────────\n// Posts/quests share the same rich description shape: { json, text }.\n// We mirror it locally here so the quest schema doesn't depend on posts.\n\nconst TipTapNode: ZodType<any> = object({\n type: string(),\n content: optional(array(any())),\n attrs: optional(record(string(), any())),\n marks: optional(array(any())),\n text: optional(string()),\n});\n\nconst ContentSchema = object({\n json: object({\n type: literal(\"doc\"),\n content: array(TipTapNode),\n }),\n text: string(),\n});\n\n// ── Quest items ────────────────────────────────────────────────────────\n\nconst QuestItemBaseSchema = object({\n id: uuid(),\n quest_id: uuid(),\n description: string(),\n status: QuestItemStatusSchema.default(\"pending\"),\n auto_skipped: optional(nullable(string().or(any()))),\n status_before_auto_skip: optional(nullable(QuestItemStatusSchema)),\n sort_order: number().default(0),\n type: string().default(\"task\"),\n created_by: uuid(),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: number().int().nonnegative().default(0),\n reward_currency: RewardCurrencySchema.default(\"btc\"),\n reward_amount: number().int().nonnegative().default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n contributor_keys: optional(\n nullable(\n array(\n object({\n key: string(),\n required: zodBoolean().default(true),\n filters: object({\n assetType: optional(string()),\n fileType: optional(string()),\n extensions: optional(array(string())),\n hasConstraints: zodBoolean().default(false),\n }),\n }),\n ),\n ),\n ),\n created_at: string(),\n updated_at: string(),\n});\n\nconst QuestItemSchema = QuestItemBaseSchema;\n\n/**\n * Shape used by `POST /quests/create` (inline items) and\n * `POST /quests/:id/items` (batch add). The controller fills in\n * `quest_id`, `created_by`, and lifecycle-derived fields\n * (`auto_skipped`, `status_before_auto_skip`).\n *\n * Accepts a plain description string as a convenience — it's lifted\n * into `{ description }` by the `union` below.\n */\nconst CreateQuestItemObjectSchema = object({\n description: string().min(1, { message: \"Item description cannot be empty\" }),\n type: optional(string()).default(\"task\"),\n sort_order: optional(number().int()),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: optional(number().int().nonnegative()).default(0),\n reward_currency: optional(RewardCurrencySchema).default(\"btc\"),\n // Amount is in minor units of `reward_currency`: sats for BTC, cents\n // for USD. Both fit in JS numbers comfortably for our reward sizes;\n // the underlying column is `bigint`.\n reward_amount: optional(number().int().nonnegative()).default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n});\n\nconst CreateQuestItemSchema = union([\n string().transform((s) => ({ description: s })),\n CreateQuestItemObjectSchema,\n]).pipe(CreateQuestItemObjectSchema);\n\n// ── Quest ──────────────────────────────────────────────────────────────\n\nconst QuestSpecificsSchema = object({\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n closed_at: optional(nullable(string())),\n});\n\nconst QuestSchema = AssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n metadata: optional(nullable(AssetMetadataSchema.partial())),\n // `read /quests/:id` returns the quest specifics nested under `quest`\n // and hoists items to the top level for convenience.\n quest: optional(QuestSpecificsSchema.partial()),\n items: optional(array(QuestItemSchema.partial())),\n progress: optional(\n object({\n total: number(),\n done: number(),\n remaining: number(),\n }),\n ),\n});\n\n/**\n * Schema used by the backend controller and SDK clients to validate /\n * default the body of `POST /quests/create`. Mirrors how\n * `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers\n * don't have to know about `GLOBAL_ORG_ID`.\n *\n * The `items` field accepts either plain strings or full item objects —\n * the backend `createQuestItems`/`createQuest` paths already handle both\n * shapes, and `CreateQuestItemSchema` normalizes strings into\n * `{ description }`.\n */\nconst CreateQuestSchema = CreateAssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n name: optional(nullable(string())).default(null),\n description: optional(nullable(ContentSchema)),\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n items: optional(array(CreateQuestItemSchema)).default([]),\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestSchema = QuestSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n items: true,\n progress: true,\n is_pinned_in_team: true,\n })\n .extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestItemSchema = CreateQuestItemObjectSchema.partial().extend({\n status: optional(QuestItemStatusSchema),\n});\n\n// ── Entries ────────────────────────────────────────────────────────────\n\nconst EntrySchema = object({\n id: uuid(),\n quest_id: uuid(),\n user_id: uuid(),\n item_id: optional(nullable(uuid())),\n asset_id: optional(nullable(uuid())),\n asset_type: optional(nullable(AssetTypeSchema)),\n assets: optional(nullable(KeyedAssetRefsSchema)),\n description: optional(nullable(ContentSchema)),\n review: optional(nullable(ContentSchema)),\n status: EntryStatusSchema,\n reviewer_id: optional(nullable(uuid())),\n reviewed_at: optional(nullable(string())),\n eval_action_id: optional(nullable(uuid())),\n eval_score: optional(nullable(number())),\n eval_status: optional(nullable(EntryEvalStatusSchema)),\n created_at: string(),\n updated_at: string(),\n});\n\nconst CreateEntrySchema = object({\n item_id: uuid(),\n assets: optional(nullable(KeyedAssetInputSchema)),\n description: optional(nullable(union([string(), ContentSchema]))),\n});\n\nconst ReviewEntrySchema = object({\n status: zodEnum([\"accepted\", \"rejected\"]),\n review: optional(nullable(union([string(), ContentSchema]))),\n});\n\n// ── Exports ────────────────────────────────────────────────────────────\n\nexport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n QuestTypeSchema,\n QuestStatusSchema,\n QuestItemStatusSchema,\n RewardCurrencySchema,\n EntryEvalStatusSchema,\n EntryStatusSchema,\n QuestSchema,\n QuestItemSchema,\n QuestItemBaseSchema,\n CreateQuestSchema,\n CreateQuestItemSchema,\n CreateQuestItemObjectSchema,\n UpdateQuestSchema,\n UpdateQuestItemSchema,\n EntrySchema,\n CreateEntrySchema,\n ReviewEntrySchema,\n};\n\nexport type QuestType = z.infer<typeof QuestTypeSchema>;\nexport type QuestStatus = z.infer<typeof QuestStatusSchema>;\nexport type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;\nexport type RewardCurrency = z.infer<typeof RewardCurrencySchema>;\nexport type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;\nexport type EntryStatus = z.infer<typeof EntryStatusSchema>;\nexport type Quest = z.infer<typeof QuestSchema>;\nexport type QuestItem = z.infer<typeof QuestItemSchema>;\nexport type CreateQuest = z.infer<typeof CreateQuestSchema>;\nexport type CreateQuestItem = z.infer<typeof CreateQuestItemSchema>;\nexport type UpdateQuest = z.infer<typeof UpdateQuestSchema>;\nexport type UpdateQuestItem = z.infer<typeof UpdateQuestItemSchema>;\nexport type Entry = z.infer<typeof EntrySchema>;\nexport type CreateEntry = z.infer<typeof CreateEntrySchema>;\nexport type ReviewEntry = z.infer<typeof ReviewEntrySchema>;\n"]}
@@ -1,2 +0,0 @@
1
- 'use strict';function T(e){return e==="default"?"card":e==="chart"?"preview":e==="preview"||e==="card"||e==="list"?e:"card"}function E(e){let s={};if(e.displayConfig&&(s=typeof e.displayConfig=="string"?JSON.parse(e.displayConfig):{...e.displayConfig}),s.visualizationId===void 0&&e.visualizationId&&(s.visualizationId=e.visualizationId),s.filters===void 0&&e.filters){let r=e.filters;s.filters=typeof r=="string"?JSON.parse(r):r;}return s}var A="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",v=new RegExp(`^(post|dataset|file|service|route):(${A})$`,"i"),h=new RegExp(`^asset:(${A})$`,"i"),C=new Set(["post","dataset","file","service","route"]);function I(e){let s=v.exec(e);if(s){let l=s[1].toLowerCase();return C.has(l)?{id:s[2],assetType:l,legacy:false}:null}let r=h.exec(e);return r?{id:r[1],legacy:true}:null}function x(e,s){let r;try{if(e.startsWith("/"))r=e;else {let c=new URL(e);if(s){let y=new URL(s).host;if(c.host!==y)return null}r=c.pathname;}}catch{return null}let l=r.match(/^\/(\w+)s\/([^/]+)\/([^/?#]+)/);if(!l)return null;let[,o,u,p]=l;return C.has(o)?{assetType:o,entity:decodeURIComponent(u),slug:decodeURIComponent(p)}:null}var g=e=>Array.isArray(e)?e.map(g):e!=null&&e.content?Array.isArray(e.content)?e.content.map(g).flat():g(e.content):e;function _(e,s){var y;if(!e||!(e!=null&&e.content))return {users:[],assets:[],linkedAssets:[]};let r=e.content.map(g).flat(),l=r.filter(t=>t.type==="mention").map(t=>{var n,i,f;return {user_id:(n=t.attrs)==null?void 0:n.id,username:((i=t.attrs)==null?void 0:i.label)||((f=t.attrs)==null?void 0:f.username)}}).reduce((t,n)=>(t.some(i=>i.user_id&&n.user_id&&i.user_id===n.user_id||i.username&&n.username&&i.username===n.username)||t.push(n),t),[]),o=r.filter(t=>{var n,i;return t.type==="assetComponent"&&((n=t.attrs)==null?void 0:n.id)&&!((i=t.attrs)!=null&&i.partial)}).map(({attrs:t})=>({id:t.id,assetType:t.assetType,via:"embed"})).reduce((t,n)=>(t.some(i=>i.id===n.id)||t.push(n),t),[]),u=[],p=new Set(o.map(t=>t.id)),c=new Set;for(let t of r){if((t==null?void 0:t.type)!=="text"||!(t!=null&&t.marks))continue;let n=t.marks.find(a=>a.type==="link");if(!((y=n==null?void 0:n.attrs)!=null&&y.href))continue;let i=n.attrs.href,f=I(i);if(f){let a=f.id;p.has(a)||(p.add(a),f.legacy?o.push({id:a,via:"link",legacy:true}):o.push({id:a,assetType:f.assetType,via:"link",legacy:false}));continue}let d=x(i,s==null?void 0:s.siteUrl);if(d){let a=`${d.assetType}:${d.entity}:${d.slug}`;c.has(a)||(c.add(a),u.push(d));}}return {users:l,assets:o,linkedAssets:u}}exports.a=T;exports.b=E;exports.c=I;exports.d=x;exports.e=_;//# sourceMappingURL=chunk-L2EAP5SJ.cjs.map
2
- //# sourceMappingURL=chunk-L2EAP5SJ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/air/index.ts"],"names":["normalizeViewMode","raw","resolveDisplayConfig","attrs","base","UUID_RE","TYPED_ASSET_LINK_RE","LEGACY_ASSET_LINK_RE","VALID_ASSET_TYPES","parseAssetLinkShorthand","href","typed","assetType","legacy","parseOuroAssetUrl","siteUrl","pathname","url","siteHost","match","entity","slug","extractContent","item","getReferencesInContent","json","options","_a","content","users","_b","_c","unique","u","assets","linkedAssets","seenAssetIds","a","seenLinkedKeys","linkMark","m","shorthand","id","parsed","key"],"mappings":"aAwBO,SAASA,CACdC,CAAAA,CAAAA,CAC6B,CAC7B,OAAIA,IAAQ,SAAkB,CAAA,MAAA,CAC1BA,CAAQ,GAAA,OAAA,CAAgB,SACxBA,CAAAA,CAAAA,GAAQ,SAAaA,EAAAA,CAAAA,GAAQ,QAAUA,CAAQ,GAAA,MAAA,CAAeA,CAC3D,CAAA,MACT,CAOO,SAASC,CAAqBC,CAAAA,CAAAA,CAInB,CAChB,IAAIC,CAAAA,CAAsB,EAAC,CAa3B,GAXID,CA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ile } from \"../../schema/users\";\n\nexport interface DataFilter {\n column: string;\n value: string;\n operator: string;\n active?: boolean;\n}\n\nexport interface DisplayConfig {\n /** Dataset: ID of a saved visualization to render instead of the default chart. */\n visualizationId?: string | null;\n /** Dataset: column filters applied to the data. */\n filters?: DataFilter[];\n /** Route: ID of a specific action to preview (status, logs, side-effect assets). */\n actionId?: string | null;\n // Future: showForm?: boolean -- render UseRouteForm inline\n}\n\n/**\n * Normalize legacy viewMode values to the current set.\n * \"chart\" → \"preview\", \"default\" → \"card\", anything else → \"card\".\n */\nexport function normalizeViewMode(\n raw: string | undefined | null\n): \"card\" | \"preview\" | \"list\" {\n if (raw === \"default\") return \"card\";\n if (raw === \"chart\") return \"preview\";\n if (raw === \"preview\" || raw === \"card\" || raw === \"list\") return raw;\n return \"card\";\n}\n\n/**\n * Build a DisplayConfig from node/element attributes, handling the legacy\n * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.\n * Prefers values inside `displayConfig` when present.\n */\nexport function resolveDisplayConfig(attrs: {\n displayConfig?: DisplayConfig | string | null;\n visualizationId?: string | null;\n filters?: DataFilter[] | string | null;\n}): DisplayConfig {\n let base: DisplayConfig = {};\n\n if (attrs.displayConfig) {\n base =\n typeof attrs.displayConfig === \"string\"\n ? JSON.parse(attrs.displayConfig)\n : { ...attrs.displayConfig };\n }\n\n // Fall back to legacy flat attrs when displayConfig doesn't carry them\n if (base.visualizationId === undefined && attrs.visualizationId) {\n base.visualizationId = attrs.visualizationId;\n }\n if (base.filters === undefined && attrs.filters) {\n const raw = attrs.filters;\n base.filters =\n typeof raw === \"string\" ? JSON.parse(raw) : raw;\n }\n\n return base;\n}\n\nexport interface InlineAssetAttrs {\n id: string;\n assetType: string;\n viewMode: \"card\" | \"preview\" | \"list\";\n displayConfig?: DisplayConfig | null;\n /** @deprecated Use displayConfig.filters */\n filters?: any;\n /** @deprecated Use displayConfig.visualizationId */\n visualizationId?: string | null;\n partial?: boolean;\n}\n\n/** Assets pulled from Air JSON: embedded blocks or link href shorthands. */\nexport type ExtractedContentAsset =\n | { id: string; assetType: string; via: \"embed\" }\n | { id: string; assetType: string; via: \"link\"; legacy: false }\n | { id: string; via: \"link\"; legacy: true };\n\ninterface LinkedAssetRef {\n assetType: string;\n entity: string;\n slug: string;\n}\n\n/** UUID v4 pattern for inline link hrefs */\nconst UUID_RE =\n \"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\";\n\n/** Shorthand link hrefs: `post:<uuid>`, `file:<uuid>`, … (preferred over legacy `asset:<uuid>`). */\nconst TYPED_ASSET_LINK_RE = new RegExp(\n `^(post|dataset|file|service|route):(${UUID_RE})$`,\n \"i\"\n);\n\n/** @deprecated Prefer `post:<uuid>` etc.; still supported and resolved server-side. */\nconst LEGACY_ASSET_LINK_RE = new RegExp(`^asset:(${UUID_RE})$`, \"i\");\n\nconst VALID_ASSET_TYPES = new Set([\n \"post\",\n \"dataset\",\n \"file\",\n \"service\",\n \"route\",\n]);\n\n/**\n * Parse an inline link `href` for Ouro asset shorthands.\n * - `post:<uuid>`, `file:<uuid>`, … → typed (asset type known from prefix)\n * - `asset:<uuid>` → legacy (type resolved via DB when creating connections)\n */\nfunction parseAssetLinkShorthand(\n href: string\n):\n | { id: string; assetType: string; legacy: false }\n | { id: string; legacy: true }\n | null {\n const typed = TYPED_ASSET_LINK_RE.exec(href);\n if (typed) {\n const assetType = typed[1].toLowerCase();\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n return { id: typed[2], assetType, legacy: false };\n }\n const legacy = LEGACY_ASSET_LINK_RE.exec(href);\n if (legacy) return { id: legacy[1], legacy: true };\n return null;\n}\n\n/**\n * Parse an Ouro site URL into its asset components.\n * Accepts both absolute URLs (https://ouro.foundation/posts/entity/slug)\n * and relative paths (/posts/entity/slug).\n */\nfunction parseOuroAssetUrl(\n href: string,\n siteUrl?: string\n): LinkedAssetRef | null {\n let pathname: string;\n try {\n if (href.startsWith(\"/\")) {\n pathname = href;\n } else {\n const url = new URL(href);\n if (siteUrl) {\n const siteHost = new URL(siteUrl).host;\n if (url.host !== siteHost) return null;\n }\n pathname = url.pathname;\n }\n } catch {\n return null;\n }\n\n // Pattern: /{assetType}s/{entity}/{slug}\n const match = pathname.match(\n /^\\/(\\w+)s\\/([^/]+)\\/([^/?#]+)/\n );\n if (!match) return null;\n\n const [, assetType, entity, slug] = match;\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n\n return { assetType, entity: decodeURIComponent(entity), slug: decodeURIComponent(slug) };\n}\n\nconst extractContent = (item: any): any => {\n if (Array.isArray(item)) return item.map(extractContent);\n if (item?.content) {\n if (Array.isArray(item.content))\n return item.content.map(extractContent).flat();\n else return extractContent(item.content);\n } else return item; // leaf\n};\n\nfunction getReferencesInContent(\n json: Content[\"json\"],\n options?: { siteUrl?: string }\n) {\n if (!json || !json?.content)\n return { users: [], assets: [], linkedAssets: [] };\n const content = json.content.map(extractContent).flat();\n\n const users = content\n .filter((item: any) => item.type === \"mention\")\n .map((item: any) => ({\n user_id: item.attrs?.id,\n username: item.attrs?.label || item.attrs?.username,\n }))\n .reduce((unique: any[], item: any) => {\n if (\n !unique.some(\n (u) =>\n (u.user_id && item.user_id && u.user_id === item.user_id) ||\n (u.username && item.username && u.username === item.username)\n )\n ) {\n unique.push(item);\n }\n return unique;\n }, []) as Partial<Profile>[];\n\n const assets: ExtractedContentAsset[] = content\n .filter(\n (item: any) =>\n item.type === \"assetComponent\" && item.attrs?.id && !item.attrs?.partial\n )\n .map(({ attrs }: { attrs: InlineAssetAttrs }) => ({\n id: attrs.id,\n assetType: attrs.assetType,\n via: \"embed\" as const,\n }))\n .reduce((unique: ExtractedContentAsset[], item: ExtractedContentAsset) => {\n if (!unique.some((u) => u.id === item.id)) {\n unique.push(item);\n }\n return unique;\n }, []);\n\n // Extract asset references from link marks\n const linkedAssets: LinkedAssetRef[] = [];\n const seenAssetIds = new Set(assets.map((a) => a.id));\n const seenLinkedKeys = new Set<string>();\n\n for (const item of content) {\n if (item?.type !== \"text\" || !item?.marks) continue;\n const linkMark = item.marks.find((m: any) => m.type === \"link\");\n if (!linkMark?.attrs?.href) continue;\n\n const href: string = linkMark.attrs.href;\n\n const shorthand = parseAssetLinkShorthand(href);\n if (shorthand) {\n const id = shorthand.id;\n if (!seenAssetIds.has(id)) {\n seenAssetIds.add(id);\n if (shorthand.legacy) {\n assets.push({ id, via: \"link\", legacy: true });\n } else {\n assets.push({\n id,\n assetType: shorthand.assetType,\n via: \"link\",\n legacy: false,\n });\n }\n }\n continue;\n }\n\n // Check for Ouro site URLs\n const parsed = parseOuroAssetUrl(href, options?.siteUrl);\n if (parsed) {\n const key = `${parsed.assetType}:${parsed.entity}:${parsed.slug}`;\n if (!seenLinkedKeys.has(key)) {\n seenLinkedKeys.add(key);\n linkedAssets.push(parsed);\n }\n }\n }\n\n return {\n users,\n assets,\n linkedAssets,\n };\n}\n\nexport {\n getReferencesInContent,\n parseAssetLinkShorthand,\n parseOuroAssetUrl,\n};\n"]}
@@ -1,2 +0,0 @@
1
- function T(e){return e==="default"?"card":e==="chart"?"preview":e==="preview"||e==="card"||e==="list"?e:"card"}function E(e){let s={};if(e.displayConfig&&(s=typeof e.displayConfig=="string"?JSON.parse(e.displayConfig):{...e.displayConfig}),s.visualizationId===void 0&&e.visualizationId&&(s.visualizationId=e.visualizationId),s.filters===void 0&&e.filters){let r=e.filters;s.filters=typeof r=="string"?JSON.parse(r):r;}return s}var A="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",v=new RegExp(`^(post|dataset|file|service|route):(${A})$`,"i"),h=new RegExp(`^asset:(${A})$`,"i"),C=new Set(["post","dataset","file","service","route"]);function I(e){let s=v.exec(e);if(s){let l=s[1].toLowerCase();return C.has(l)?{id:s[2],assetType:l,legacy:false}:null}let r=h.exec(e);return r?{id:r[1],legacy:true}:null}function x(e,s){let r;try{if(e.startsWith("/"))r=e;else {let c=new URL(e);if(s){let y=new URL(s).host;if(c.host!==y)return null}r=c.pathname;}}catch{return null}let l=r.match(/^\/(\w+)s\/([^/]+)\/([^/?#]+)/);if(!l)return null;let[,o,u,p]=l;return C.has(o)?{assetType:o,entity:decodeURIComponent(u),slug:decodeURIComponent(p)}:null}var g=e=>Array.isArray(e)?e.map(g):e!=null&&e.content?Array.isArray(e.content)?e.content.map(g).flat():g(e.content):e;function _(e,s){var y;if(!e||!(e!=null&&e.content))return {users:[],assets:[],linkedAssets:[]};let r=e.content.map(g).flat(),l=r.filter(t=>t.type==="mention").map(t=>{var n,i,f;return {user_id:(n=t.attrs)==null?void 0:n.id,username:((i=t.attrs)==null?void 0:i.label)||((f=t.attrs)==null?void 0:f.username)}}).reduce((t,n)=>(t.some(i=>i.user_id&&n.user_id&&i.user_id===n.user_id||i.username&&n.username&&i.username===n.username)||t.push(n),t),[]),o=r.filter(t=>{var n,i;return t.type==="assetComponent"&&((n=t.attrs)==null?void 0:n.id)&&!((i=t.attrs)!=null&&i.partial)}).map(({attrs:t})=>({id:t.id,assetType:t.assetType,via:"embed"})).reduce((t,n)=>(t.some(i=>i.id===n.id)||t.push(n),t),[]),u=[],p=new Set(o.map(t=>t.id)),c=new Set;for(let t of r){if((t==null?void 0:t.type)!=="text"||!(t!=null&&t.marks))continue;let n=t.marks.find(a=>a.type==="link");if(!((y=n==null?void 0:n.attrs)!=null&&y.href))continue;let i=n.attrs.href,f=I(i);if(f){let a=f.id;p.has(a)||(p.add(a),f.legacy?o.push({id:a,via:"link",legacy:true}):o.push({id:a,assetType:f.assetType,via:"link",legacy:false}));continue}let d=x(i,s==null?void 0:s.siteUrl);if(d){let a=`${d.assetType}:${d.entity}:${d.slug}`;c.has(a)||(c.add(a),u.push(d));}}return {users:l,assets:o,linkedAssets:u}}export{T as a,E as b,I as c,x as d,_ as e};//# sourceMappingURL=chunk-PONEAJK7.js.map
2
- //# sourceMappingURL=chunk-PONEAJK7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/air/index.ts"],"names":["normalizeViewMode","raw","resolveDisplayConfig","attrs","base","UUID_RE","TYPED_ASSET_LINK_RE","LEGACY_ASSET_LINK_RE","VALID_ASSET_TYPES","parseAssetLinkShorthand","href","typed","assetType","legacy","parseOuroAssetUrl","siteUrl","pathname","url","siteHost","match","entity","slug","extractContent","item","getReferencesInContent","json","options","_a","content","users","_b","_c","unique","u","assets","linkedAssets","seenAssetIds","a","seenLinkedKeys","linkMark","m","shorthand","id","parsed","key"],"mappings":"AAwBO,SAASA,CACdC,CAAAA,CAAAA,CAC6B,CAC7B,OAAIA,IAAQ,SAAkB,CAAA,MAAA,CAC1BA,CAAQ,GAAA,OAAA,CAAgB,SACxBA,CAAAA,CAAAA,GAAQ,SAAaA,EAAAA,CAAAA,GAAQ,QAAUA,CAAQ,GAAA,MAAA,CAAeA,CAC3D,CAAA,MACT,CAOO,SAASC,CAAqBC,CAAAA,CAAAA,CAInB,CAChB,IAAIC,CAAAA,CAAsB,EAAC,CAa3B,GAXID,CAAM,CAAA,aAAA,GACRC,CACE,CAAA,OAAOD,EAAM,aAAkB,EAAA,QAAA,CAC3B,IAAK,CAAA,KAAA,CAAMA,CAAM,CAAA,aAAa,CAC9B,CAAA,CAAE,GAAGA,CAAM,CAAA,aAAc,CAI7BC,CAAAA,CAAAA,CAAAA,CAAK,kBAAoB,MAAaD,EAAAA,CAAAA,CAAM,eAC9CC,GAAAA,CAAAA,CAAK,gBAAkBD,CAAM,CAAA,eAAA,CAAA,CAE3BC,CAAK,CAAA,OAAA,GAAY,MAAaD,EAAAA,CAAAA,CAAM,OAAS,CAAA,CAC/C,IAAMF,CAAME,CAAAA,CAAAA,CAAM,OAClBC,CAAAA,CAAAA,CAAK,QACH,OAAOH,CAAAA,EAAQ,QAAW,CAAA,IAAA,CAAK,MAAMA,CAAG,CAAA,CAAIA,EAChD,CAEA,OAAOG,CACT,CA2BA,IAAMC,EACJ,8DAGIC,CAAAA,CAAAA,CAAsB,IAAI,M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CAAK,MACL,CAAA,MAAA,CAAQ,KACV,CAAC,GAGL,QACF,CAGA,IAAME,CAAAA,CAAS7B,EAAkBJ,CAAMgB,CAAAA,CAAAA,EAAA,IAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAS,OAAO,CACvD,CAAA,GAAIiB,CAAQ,CAAA,CACV,IAAMC,CAAAA,CAAM,CAAGD,EAAAA,CAAAA,CAAO,SAAS,CAAIA,CAAAA,EAAAA,CAAAA,CAAO,MAAM,CAAA,CAAA,EAAIA,EAAO,IAAI,CAAA,CAAA,CAC1DL,CAAe,CAAA,GAAA,CAAIM,CAAG,CACzBN,GAAAA,CAAAA,CAAe,GAAIM,CAAAA,CAAG,CACtBT,CAAAA,CAAAA,CAAa,IAAKQ,CAAAA,CAAM,GAE5B,CACF,CAEA,OAAO,CACL,MAAAd,CACA,CAAA,MAAA,CAAAK,CACA,CAAA,YAAA,CAAAC,CACF,CACF","file":"chunk-PONEAJK7.js","sourcesContent":["import { Content } from \"../../schema/posts\";\nimport { Profile } from \"../../schema/users\";\n\nexport interface DataFilter {\n column: string;\n value: string;\n operator: string;\n active?: boolean;\n}\n\nexport interface DisplayConfig {\n /** Dataset: ID of a saved visualization to render instead of the default chart. */\n visualizationId?: string | null;\n /** Dataset: column filters applied to the data. */\n filters?: DataFilter[];\n /** Route: ID of a specific action to preview (status, logs, side-effect assets). */\n actionId?: string | null;\n // Future: showForm?: boolean -- render UseRouteForm inline\n}\n\n/**\n * Normalize legacy viewMode values to the current set.\n * \"chart\" → \"preview\", \"default\" → \"card\", anything else → \"card\".\n */\nexport function normalizeViewMode(\n raw: string | undefined | null\n): \"card\" | \"preview\" | \"list\" {\n if (raw === \"default\") return \"card\";\n if (raw === \"chart\") return \"preview\";\n if (raw === \"preview\" || raw === \"card\" || raw === \"list\") return raw;\n return \"card\";\n}\n\n/**\n * Build a DisplayConfig from node/element attributes, handling the legacy\n * flat `visualizationId` / `filters` attrs and the new `displayConfig` object.\n * Prefers values inside `displayConfig` when present.\n */\nexport function resolveDisplayConfig(attrs: {\n displayConfig?: DisplayConfig | string | null;\n visualizationId?: string | null;\n filters?: DataFilter[] | string | null;\n}): DisplayConfig {\n let base: DisplayConfig = {};\n\n if (attrs.displayConfig) {\n base =\n typeof attrs.displayConfig === \"string\"\n ? JSON.parse(attrs.displayConfig)\n : { ...attrs.displayConfig };\n }\n\n // Fall back to legacy flat attrs when displayConfig doesn't carry them\n if (base.visualizationId === undefined && attrs.visualizationId) {\n base.visualizationId = attrs.visualizationId;\n }\n if (base.filters === undefined && attrs.filters) {\n const raw = attrs.filters;\n base.filters =\n typeof raw === \"string\" ? JSON.parse(raw) : raw;\n }\n\n return base;\n}\n\nexport interface InlineAssetAttrs {\n id: string;\n assetType: string;\n viewMode: \"card\" | \"preview\" | \"list\";\n displayConfig?: DisplayConfig | null;\n /** @deprecated Use displayConfig.filters */\n filters?: any;\n /** @deprecated Use displayConfig.visualizationId */\n visualizationId?: string | null;\n partial?: boolean;\n}\n\n/** Assets pulled from Air JSON: embedded blocks or link href shorthands. */\nexport type ExtractedContentAsset =\n | { id: string; assetType: string; via: \"embed\" }\n | { id: string; assetType: string; via: \"link\"; legacy: false }\n | { id: string; via: \"link\"; legacy: true };\n\ninterface LinkedAssetRef {\n assetType: string;\n entity: string;\n slug: string;\n}\n\n/** UUID v4 pattern for inline link hrefs */\nconst UUID_RE =\n \"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\";\n\n/** Shorthand link hrefs: `post:<uuid>`, `file:<uuid>`, … (preferred over legacy `asset:<uuid>`). */\nconst TYPED_ASSET_LINK_RE = new RegExp(\n `^(post|dataset|file|service|route):(${UUID_RE})$`,\n \"i\"\n);\n\n/** @deprecated Prefer `post:<uuid>` etc.; still supported and resolved server-side. */\nconst LEGACY_ASSET_LINK_RE = new RegExp(`^asset:(${UUID_RE})$`, \"i\");\n\nconst VALID_ASSET_TYPES = new Set([\n \"post\",\n \"dataset\",\n \"file\",\n \"service\",\n \"route\",\n]);\n\n/**\n * Parse an inline link `href` for Ouro asset shorthands.\n * - `post:<uuid>`, `file:<uuid>`, … → typed (asset type known from prefix)\n * - `asset:<uuid>` → legacy (type resolved via DB when creating connections)\n */\nfunction parseAssetLinkShorthand(\n href: string\n):\n | { id: string; assetType: string; legacy: false }\n | { id: string; legacy: true }\n | null {\n const typed = TYPED_ASSET_LINK_RE.exec(href);\n if (typed) {\n const assetType = typed[1].toLowerCase();\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n return { id: typed[2], assetType, legacy: false };\n }\n const legacy = LEGACY_ASSET_LINK_RE.exec(href);\n if (legacy) return { id: legacy[1], legacy: true };\n return null;\n}\n\n/**\n * Parse an Ouro site URL into its asset components.\n * Accepts both absolute URLs (https://ouro.foundation/posts/entity/slug)\n * and relative paths (/posts/entity/slug).\n */\nfunction parseOuroAssetUrl(\n href: string,\n siteUrl?: string\n): LinkedAssetRef | null {\n let pathname: string;\n try {\n if (href.startsWith(\"/\")) {\n pathname = href;\n } else {\n const url = new URL(href);\n if (siteUrl) {\n const siteHost = new URL(siteUrl).host;\n if (url.host !== siteHost) return null;\n }\n pathname = url.pathname;\n }\n } catch {\n return null;\n }\n\n // Pattern: /{assetType}s/{entity}/{slug}\n const match = pathname.match(\n /^\\/(\\w+)s\\/([^/]+)\\/([^/?#]+)/\n );\n if (!match) return null;\n\n const [, assetType, entity, slug] = match;\n if (!VALID_ASSET_TYPES.has(assetType)) return null;\n\n return { assetType, entity: decodeURIComponent(entity), slug: decodeURIComponent(slug) };\n}\n\nconst extractContent = (item: any): any => {\n if (Array.isArray(item)) return item.map(extractContent);\n if (item?.content) {\n if (Array.isArray(item.content))\n return item.content.map(extractContent).flat();\n else return extractContent(item.content);\n } else return item; // leaf\n};\n\nfunction getReferencesInContent(\n json: Content[\"json\"],\n options?: { siteUrl?: string }\n) {\n if (!json || !json?.content)\n return { users: [], assets: [], linkedAssets: [] };\n const content = json.content.map(extractContent).flat();\n\n const users = content\n .filter((item: any) => item.type === \"mention\")\n .map((item: any) => ({\n user_id: item.attrs?.id,\n username: item.attrs?.label || item.attrs?.username,\n }))\n .reduce((unique: any[], item: any) => {\n if (\n !unique.some(\n (u) =>\n (u.user_id && item.user_id && u.user_id === item.user_id) ||\n (u.username && item.username && u.username === item.username)\n )\n ) {\n unique.push(item);\n }\n return unique;\n }, []) as Partial<Profile>[];\n\n const assets: ExtractedContentAsset[] = content\n .filter(\n (item: any) =>\n item.type === \"assetComponent\" && item.attrs?.id && !item.attrs?.partial\n )\n .map(({ attrs }: { attrs: InlineAssetAttrs }) => ({\n id: attrs.id,\n assetType: attrs.assetType,\n via: \"embed\" as const,\n }))\n .reduce((unique: ExtractedContentAsset[], item: ExtractedContentAsset) => {\n if (!unique.some((u) => u.id === item.id)) {\n unique.push(item);\n }\n return unique;\n }, []);\n\n // Extract asset references from link marks\n const linkedAssets: LinkedAssetRef[] = [];\n const seenAssetIds = new Set(assets.map((a) => a.id));\n const seenLinkedKeys = new Set<string>();\n\n for (const item of content) {\n if (item?.type !== \"text\" || !item?.marks) continue;\n const linkMark = item.marks.find((m: any) => m.type === \"link\");\n if (!linkMark?.attrs?.href) continue;\n\n const href: string = linkMark.attrs.href;\n\n const shorthand = parseAssetLinkShorthand(href);\n if (shorthand) {\n const id = shorthand.id;\n if (!seenAssetIds.has(id)) {\n seenAssetIds.add(id);\n if (shorthand.legacy) {\n assets.push({ id, via: \"link\", legacy: true });\n } else {\n assets.push({\n id,\n assetType: shorthand.assetType,\n via: \"link\",\n legacy: false,\n });\n }\n }\n continue;\n }\n\n // Check for Ouro site URLs\n const parsed = parseOuroAssetUrl(href, options?.siteUrl);\n if (parsed) {\n const key = `${parsed.assetType}:${parsed.entity}:${parsed.slug}`;\n if (!seenLinkedKeys.has(key)) {\n seenLinkedKeys.add(key);\n linkedAssets.push(parsed);\n }\n }\n }\n\n return {\n users,\n assets,\n linkedAssets,\n };\n}\n\nexport {\n getReferencesInContent,\n parseAssetLinkShorthand,\n parseOuroAssetUrl,\n};\n"]}
@@ -1,2 +0,0 @@
1
- import {a as a$2}from'./chunk-IWOXGKK4.js';import {b,c,d,a as a$1}from'./chunk-SR5UZ4NP.js';import {b as b$1}from'./chunk-3N56ERWF.js';import {a,b as b$2,d as d$1}from'./chunk-WRHPQNEL.js';import {object,array,string,optional,nullable,literal,uuid,number,record,any}from'zod';var g=object({members:array(string())}),l=g.extend(b.partial().shape),U=c.extend({asset_type:a.default("conversation"),metadata:l,users:optional(nullable(array(b$1)))}),C=d.extend({asset_type:literal("conversation").default("conversation"),monetization:d$1.default("none"),visibility:b$2.default("private"),metadata:l}),j=C.transform(a=>a$1(a)),B=C.omit({id:true,org_id:true,team_id:true}).partial().transform(a=>a$1(a)),P=object({id:uuid(),conversation_id:uuid(),turn_id:uuid(),seq:number(),user_id:uuid(),user:optional(nullable(b$1)),type:string().default("message"),created_at:string(),last_updated:string(),viewers:array(uuid()),json:a$2,text:string(),metadata:optional(nullable(record(string(),any())))});export{U as a,j as b,B as c,P as d};//# sourceMappingURL=chunk-QR2BSJ2C.js.map
2
- //# sourceMappingURL=chunk-QR2BSJ2C.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schema/conversations.ts"],"names":["BaseConversationMetadataSchema","object","array","string","ConversationMetadataSchema","AssetMetadataSchema","ConversationSchema","AssetSchema","AssetTypeSchema","optional","nullable","ProfileSchema","BaseCreateConversationSchema","CreateAssetSchema","literal","MonetizationSchema","VisibilitySchema","CreateConversationSchema","value","normalizeAssetConfigForParsing","UpdateConversationSchema","MessageSchema","uuid","number","TipTapSchema","record","any"],"mappings":"wRA4BMA,CAAiCC,CAAAA,MAAAA,CAAO,CAC5C,OAASC,CAAAA,KAAAA,CAAMC,QAAQ,CACzB,CAAC,CAAA,CAEKC,EAA6BJ,CAA+B,CAAA,MAAA,CAChEK,EAAoB,OAAQ,EAAA,CAAE,KAChC,CAEMC,CAAAA,CAAAA,CAAqBC,CAAY,CAAA,MAAA,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ACtD,CAAC","file":"chunk-QR2BSJ2C.js","sourcesContent":["import {\n object,\n string,\n number,\n uuid,\n array,\n type z,\n record,\n any,\n optional,\n nullable,\n literal\n} from \"zod\";\n\nimport {\n AssetTypeSchema,\n MonetizationSchema,\n VisibilitySchema,\n} from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { TipTapSchema } from \"./posts\";\nimport { ProfileSchema } from \"./users\";\n\nconst BaseConversationMetadataSchema = object({\n members: array(string()),\n});\n\nconst ConversationMetadataSchema = BaseConversationMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ConversationSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.default(\"conversation\"),\n metadata: ConversationMetadataSchema,\n users: optional(nullable(array(ProfileSchema))),\n});\n\nconst BaseCreateConversationSchema = CreateAssetSchema.extend({\n asset_type: literal(\"conversation\").default(\"conversation\"),\n monetization: MonetizationSchema.default(\"none\"),\n visibility: VisibilitySchema.default(\"private\"),\n metadata: ConversationMetadataSchema,\n});\n\nconst CreateConversationSchema = BaseCreateConversationSchema\n .transform((value) => normalizeAssetConfigForParsing(value));\n\n// Partial because we can make updates to conversations without providing all fields\nconst UpdateConversationSchema = BaseCreateConversationSchema.omit({\n id: true,\n org_id: true,\n team_id: true,\n // team: true,\n // user: true,\n // organization: true,\n // slug: true,\n}).partial().transform((value) => normalizeAssetConfigForParsing(value));\n\nconst MessageSchema = object({\n id: uuid(),\n conversation_id: uuid(),\n turn_id: uuid(),\n seq: number(),\n user_id: uuid(),\n user: optional(nullable(ProfileSchema)),\n type: string().default(\"message\"),\n created_at: string(),\n last_updated: string(),\n viewers: array(uuid()),\n json: TipTapSchema,\n text: string(),\n metadata: optional(nullable(record(string(), any()))),\n});\n\nexport {\n MessageSchema,\n UpdateConversationSchema,\n CreateConversationSchema,\n ConversationSchema,\n};\nexport type Conversation = z.infer<typeof ConversationSchema>;\nexport type CreateConversation = z.infer<typeof CreateConversationSchema>;\nexport type UpdateConversation = z.infer<typeof UpdateConversationSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schema/quests.ts"],"names":["QuestTypeSchema","zodEnum","QuestStatusSchema","QuestItemStatusSchema","RewardCurrencySchema","EntryEvalStatusSchema","EntryStatusSchema","TipTapNode","object","string","optional","array","any","record","ContentSchema","literal","QuestItemBaseSchema","uuid","nullable","number","AssetTypeSchema","QuestSubmissionAssetDeclarationSchema","KeyedAssetRefsSchema","zodBoolean","QuestItemSchema","CreateQuestItemObjectSchema","CreateQuestItemSchema","union","s","QuestSpecificsSchema","QuestSchema","AssetSchema","AssetMetadataSchema","CreateQuestSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateQuestSchema","UpdateQuestItemSchema","EntrySchema","CreateEntrySchema","KeyedAssetInputSchema","ReviewEntrySchema"],"mappings":"yQAkCMA,CAAkBC,CAAAA,KAAAA,CAAQ,CAAC,UAAY,CAAA,YAAY,CAAC,CAAA,CACpDC,CAAoBD,CAAAA,KAAAA,CAAQ,CAAC,OAAS,CAAA,MAAA,CAAQ,QAAU,CAAA,WAAW,CAAC,CAAA,CAEpEE,EAAwBF,KAAQ,CAAA,CACpC,SACA,CAAA,aAAA,CACA,MACA,CAAA,SACF,CAAC,CAEKG,CAAAA,CAAAA,CAAuBH,MAAQ,CAAC,KAAA,CAAO,KAAK,CAAC,CAAA,CAE7CI,CAAwBJ,CAAAA,KAAAA,CAAQ,CACpC,SAAA,CACA,UACA,QACA,CAAA,QAAA,CACA,SACF,CAAC,CAAA,CAEKK,EAAoBL,KAAQ,CAAA,CAAC,WAAa,CAAA,UAAA,CAAY,UAAU,CAAC,EAMjEM,CAA2BC,CAAAA,MAAAA,CAAO,CACtC,IAAMC,CAAAA,MAAAA,GACN,OAASC,CAAAA,QAAAA,CAASC,KAAMC,CAAAA,GAAAA,EAAK,CAAC,EAC9B,KAA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string,\n number,\n array,\n literal,\n record,\n type z,\n any,\n optional,\n nullable,\n union,\n uuid,\n boolean as zodBoolean,\n enum as zodEnum,\n type ZodType,\n} from \"zod\";\n\nimport {\n AssetSchema,\n AssetMetadataSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { AssetTypeSchema } from \"./common\";\nimport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n} from \"../utils/quest-submission\";\n\n// ── Enums ──────────────────────────────────────────────────────────────\n\n/** closable: one active entry per item per user; continuous: unlimited per item */\nconst QuestTypeSchema = zodEnum([\"closable\", \"continuous\"]);\nconst QuestStatusSchema = zodEnum([\"draft\", \"open\", \"closed\", \"cancelled\"]);\n\nconst QuestItemStatusSchema = zodEnum([\n \"pending\",\n \"in_progress\",\n \"done\",\n \"skipped\",\n]);\n\nconst RewardCurrencySchema = zodEnum([\"btc\", \"usd\"]);\n\nconst EntryEvalStatusSchema = zodEnum([\n \"skipped\",\n \"running\",\n \"passed\",\n \"failed\",\n \"errored\",\n]);\n\nconst EntryStatusSchema = zodEnum([\"submitted\", \"accepted\", \"rejected\"]);\n\n// ── Content (TipTap) ───────────────────────────────────────────────────\n// Posts/quests share the same rich description shape: { json, text }.\n// We mirror it locally here so the quest schema doesn't depend on posts.\n\nconst TipTapNode: ZodType<any> = object({\n type: string(),\n content: optional(array(any())),\n attrs: optional(record(string(), any())),\n marks: optional(array(any())),\n text: optional(string()),\n});\n\nconst ContentSchema = object({\n json: object({\n type: literal(\"doc\"),\n content: array(TipTapNode),\n }),\n text: string(),\n});\n\n// ── Quest items ────────────────────────────────────────────────────────\n\nconst QuestItemBaseSchema = object({\n id: uuid(),\n quest_id: uuid(),\n description: string(),\n status: QuestItemStatusSchema.default(\"pending\"),\n auto_skipped: optional(nullable(string().or(any()))),\n status_before_auto_skip: optional(nullable(QuestItemStatusSchema)),\n sort_order: number().default(0),\n type: string().default(\"task\"),\n created_by: uuid(),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: number().int().nonnegative().default(0),\n reward_currency: RewardCurrencySchema.default(\"btc\"),\n reward_amount: number().int().nonnegative().default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n contributor_keys: optional(\n nullable(\n array(\n object({\n key: string(),\n required: zodBoolean().default(true),\n filters: object({\n assetType: optional(string()),\n fileType: optional(string()),\n extensions: optional(array(string())),\n hasConstraints: zodBoolean().default(false),\n }),\n }),\n ),\n ),\n ),\n created_at: string(),\n updated_at: string(),\n});\n\nconst QuestItemSchema = QuestItemBaseSchema;\n\n/**\n * Shape used by `POST /quests/create` (inline items) and\n * `POST /quests/:id/items` (batch add). The controller fills in\n * `quest_id`, `created_by`, and lifecycle-derived fields\n * (`auto_skipped`, `status_before_auto_skip`).\n *\n * Accepts a plain description string as a convenience — it's lifted\n * into `{ description }` by the `union` below.\n */\nconst CreateQuestItemObjectSchema = object({\n description: string().min(1, { message: \"Item description cannot be empty\" }),\n type: optional(string()).default(\"task\"),\n sort_order: optional(number().int()),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: optional(number().int().nonnegative()).default(0),\n reward_currency: optional(RewardCurrencySchema).default(\"btc\"),\n // Amount is in minor units of `reward_currency`: sats for BTC, cents\n // for USD. Both fit in JS numbers comfortably for our reward sizes;\n // the underlying column is `bigint`.\n reward_amount: optional(number().int().nonnegative()).default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n});\n\nconst CreateQuestItemSchema = union([\n string().transform((s) => ({ description: s })),\n CreateQuestItemObjectSchema,\n]).pipe(CreateQuestItemObjectSchema);\n\n// ── Quest ──────────────────────────────────────────────────────────────\n\nconst QuestSpecificsSchema = object({\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n closed_at: optional(nullable(string())),\n});\n\nconst QuestSchema = AssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n metadata: optional(nullable(AssetMetadataSchema.partial())),\n // `read /quests/:id` returns the quest specifics nested under `quest`\n // and hoists items to the top level for convenience.\n quest: optional(QuestSpecificsSchema.partial()),\n items: optional(array(QuestItemSchema.partial())),\n progress: optional(\n object({\n total: number(),\n done: number(),\n remaining: number(),\n }),\n ),\n});\n\n/**\n * Schema used by the backend controller and SDK clients to validate /\n * default the body of `POST /quests/create`. Mirrors how\n * `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers\n * don't have to know about `GLOBAL_ORG_ID`.\n *\n * The `items` field accepts either plain strings or full item objects —\n * the backend `createQuestItems`/`createQuest` paths already handle both\n * shapes, and `CreateQuestItemSchema` normalizes strings into\n * `{ description }`.\n */\nconst CreateQuestSchema = CreateAssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n name: optional(nullable(string())).default(null),\n description: optional(nullable(ContentSchema)),\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n items: optional(array(CreateQuestItemSchema)).default([]),\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestSchema = QuestSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n items: true,\n progress: true,\n is_pinned_in_team: true,\n })\n .extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestItemSchema = CreateQuestItemObjectSchema.partial().extend({\n status: optional(QuestItemStatusSchema),\n});\n\n// ── Entries ────────────────────────────────────────────────────────────\n\nconst EntrySchema = object({\n id: uuid(),\n quest_id: uuid(),\n user_id: uuid(),\n item_id: optional(nullable(uuid())),\n asset_id: optional(nullable(uuid())),\n asset_type: optional(nullable(AssetTypeSchema)),\n assets: optional(nullable(KeyedAssetRefsSchema)),\n description: optional(nullable(ContentSchema)),\n review: optional(nullable(ContentSchema)),\n status: EntryStatusSchema,\n reviewer_id: optional(nullable(uuid())),\n reviewed_at: optional(nullable(string())),\n eval_action_id: optional(nullable(uuid())),\n eval_score: optional(nullable(number())),\n eval_status: optional(nullable(EntryEvalStatusSchema)),\n created_at: string(),\n updated_at: string(),\n});\n\nconst CreateEntrySchema = object({\n item_id: uuid(),\n assets: optional(nullable(KeyedAssetInputSchema)),\n description: optional(nullable(union([string(), ContentSchema]))),\n});\n\nconst ReviewEntrySchema = object({\n status: zodEnum([\"accepted\", \"rejected\"]),\n review: optional(nullable(union([string(), ContentSchema]))),\n});\n\n// ── Exports ────────────────────────────────────────────────────────────\n\nexport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n QuestTypeSchema,\n QuestStatusSchema,\n QuestItemStatusSchema,\n RewardCurrencySchema,\n EntryEvalStatusSchema,\n EntryStatusSchema,\n QuestSchema,\n QuestItemSchema,\n QuestItemBaseSchema,\n CreateQuestSchema,\n CreateQuestItemSchema,\n CreateQuestItemObjectSchema,\n UpdateQuestSchema,\n UpdateQuestItemSchema,\n EntrySchema,\n CreateEntrySchema,\n ReviewEntrySchema,\n};\n\nexport type QuestType = z.infer<typeof QuestTypeSchema>;\nexport type QuestStatus = z.infer<typeof QuestStatusSchema>;\nexport type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;\nexport type RewardCurrency = z.infer<typeof RewardCurrencySchema>;\nexport type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;\nexport type EntryStatus = z.infer<typeof EntryStatusSchema>;\nexport type Quest = z.infer<typeof QuestSchema>;\nexport type QuestItem = z.infer<typeof QuestItemSchema>;\nexport type CreateQuest = z.infer<typeof CreateQuestSchema>;\nexport type CreateQuestItem = z.infer<typeof CreateQuestItemSchema>;\nexport type UpdateQuest = z.infer<typeof UpdateQuestSchema>;\nexport type UpdateQuestItem = z.infer<typeof UpdateQuestItemSchema>;\nexport type Entry = z.infer<typeof EntrySchema>;\nexport type CreateEntry = z.infer<typeof CreateEntrySchema>;\nexport type ReviewEntry = z.infer<typeof ReviewEntrySchema>;\n"]}
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkF5CWCYOP_cjs=require('./chunk-F5CWCYOP.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var g=zod.object({members:zod.array(zod.string())}),l=g.extend(chunkROMY5WNQ_cjs.b.partial().shape),U=chunkROMY5WNQ_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.default("conversation"),metadata:l,users:zod.optional(zod.nullable(zod.array(chunkGY6SLMMJ_cjs.b)))}),C=chunkROMY5WNQ_cjs.d.extend({asset_type:zod.literal("conversation").default("conversation"),monetization:chunk43KB23BA_cjs.d.default("none"),visibility:chunk43KB23BA_cjs.b.default("private"),metadata:l}),j=C.transform(a=>chunkROMY5WNQ_cjs.a(a)),B=C.omit({id:true,org_id:true,team_id:true}).partial().transform(a=>chunkROMY5WNQ_cjs.a(a)),P=zod.object({id:zod.uuid(),conversation_id:zod.uuid(),turn_id:zod.uuid(),seq:zod.number(),user_id:zod.uuid(),user:zod.optional(zod.nullable(chunkGY6SLMMJ_cjs.b)),type:zod.string().default("message"),created_at:zod.string(),last_updated:zod.string(),viewers:zod.array(zod.uuid()),json:chunkF5CWCYOP_cjs.a,text:zod.string(),metadata:zod.optional(zod.nullable(zod.record(zod.string(),zod.any())))});exports.a=U;exports.b=j;exports.c=B;exports.d=P;//# sourceMappingURL=chunk-W73NWPCZ.cjs.map
2
- //# sourceMappingURL=chunk-W73NWPCZ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schema/conversations.ts"],"names":["BaseConversationMetadataSchema","object","array","string","ConversationMetadataSchema","AssetMetadataSchema","ConversationSchema","AssetSchema","AssetTypeSchema","optional","nullable","ProfileSchema","BaseCreateConversationSchema","CreateAssetSchema","literal","MonetizationSchema","VisibilitySchema","CreateConversationSchema","value","normalizeAssetConfigForParsing","UpdateConversationSchema","MessageSchema","uuid","number","TipTapSchema","record","any"],"mappings":"gPA4BMA,CAAiCC,CAAAA,UAAAA,CAAO,CAC5C,OAASC,CAAAA,SAAAA,CAAMC,YAAQ,CACzB,CAAC,CAAA,CAEKC,EAA6BJ,CAA+B,CAAA,MAAA,CAChEK,oBAAoB,OAAQ,EAAA,CAAE,KAChC,CAEMC,CAAAA,CAAAA,CAAqBC,mBAAY,CAAA,MAAA,CAAO,CAC5C,UAAYC,CAAAA,mBAAAA,CAAgB,QAAQ,cAAc,CAAA,CAClD,SAAUJ,CACV,CAAA,KAAA,CAAOK,YAASC,CAAAA,YAAAA,CAASR,UAAMS,mBAAa,CAAC,CAAC,CAChD,CAAC,EAEKC,CAA+BC,CAAAA,mBAAAA,CAAkB,MAAO,CAAA,CAC5D,WAAYC,WAAQ,CAAA,cAAc,EAAE,OAAQ,CAAA,cAAc,EAC1D,YAAcC,CAAAA,mBAAAA,CAAmB,OAAQ,CAAA,MAAM,EAC/C,UAAYC,CAAAA,mBAAAA,CAAiB,QAAQ,SAAS,CAAA,CAC9C,SAAUZ,CACZ,CAAC,CAEKa,CAAAA,CAAAA,CAA2BL,EAC9B,SAAWM,CAAAA,CAAAA,EAAUC,oBAA+BD,CAAK,CAAC,EAGvDE,CAA2BR,CAAAA,CAAAA,CAA6B,IAAK,CAAA,CACjE,GAAI,IACJ,CAAA,MAAA,CAAQ,KACR,OAAS,CAAA,IAKX,CAAC,CAAE,CAAA,OAAA,EAAU,CAAA,SAAA,CAAWM,GAAUC,mBAA+BD,CAAAA,CAAK,CAAC,CAEjEG,CAAAA,CAAAA,CAAgBpB,WAAO,CAC3B,EAAA,CAAIqB,QAAK,EAAA,CACT,gBAAiBA,QAAK,EAAA,CACtB,QAASA,QAAK,EAAA,CACd,IAAKC,UAAO,EAAA,CACZ,OAASD,CAAAA,QAAAA,GACT,IAAMb,CAAAA,YAAAA,CAASC,aAASC,mBAAa,CAAC,EACtC,IAAMR,CAAAA,UAAAA,EAAS,CAAA,OAAA,CAAQ,SAAS,CAChC,CAAA,UAAA,CAAYA,YACZ,CAAA,YAAA,CAAcA,YACd,CAAA,OAAA,CAASD,SAAMoB,CAAAA,QAAAA,EAAM,CACrB,CAAA,IAAA,CAAME,oBACN,IAAMrB,CAAAA,UAAAA,GACN,QAAUM,CAAAA,YAAAA,CAASC,YAASe,CAAAA,UAAAA,CAAOtB,YAAUuB,CAAAA,OAAAA,EAAK,CAAC,CAAC,CACtD,CAAC","file":"chunk-W73NWPCZ.cjs","sourcesContent":["import {\n object,\n string,\n number,\n uuid,\n array,\n type z,\n record,\n any,\n optional,\n nullable,\n literal\n} from \"zod\";\n\nimport {\n AssetTypeSchema,\n MonetizationSchema,\n VisibilitySchema,\n} from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { TipTapSchema } from \"./posts\";\nimport { ProfileSchema } from \"./users\";\n\nconst BaseConversationMetadataSchema = object({\n members: array(string()),\n});\n\nconst ConversationMetadataSchema = BaseConversationMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ConversationSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.default(\"conversation\"),\n metadata: ConversationMetadataSchema,\n users: optional(nullable(array(ProfileSchema))),\n});\n\nconst BaseCreateConversationSchema = CreateAssetSchema.extend({\n asset_type: literal(\"conversation\").default(\"conversation\"),\n monetization: MonetizationSchema.default(\"none\"),\n visibility: VisibilitySchema.default(\"private\"),\n metadata: ConversationMetadataSchema,\n});\n\nconst CreateConversationSchema = BaseCreateConversationSchema\n .transform((value) => normalizeAssetConfigForParsing(value));\n\n// Partial because we can make updates to conversations without providing all fields\nconst UpdateConversationSchema = BaseCreateConversationSchema.omit({\n id: true,\n org_id: true,\n team_id: true,\n // team: true,\n // user: true,\n // organization: true,\n // slug: true,\n}).partial().transform((value) => normalizeAssetConfigForParsing(value));\n\nconst MessageSchema = object({\n id: uuid(),\n conversation_id: uuid(),\n turn_id: uuid(),\n seq: number(),\n user_id: uuid(),\n user: optional(nullable(ProfileSchema)),\n type: string().default(\"message\"),\n created_at: string(),\n last_updated: string(),\n viewers: array(uuid()),\n json: TipTapSchema,\n text: string(),\n metadata: optional(nullable(record(string(), any()))),\n});\n\nexport {\n MessageSchema,\n UpdateConversationSchema,\n CreateConversationSchema,\n ConversationSchema,\n};\nexport type Conversation = z.infer<typeof ConversationSchema>;\nexport type CreateConversation = z.infer<typeof CreateConversationSchema>;\nexport type UpdateConversation = z.infer<typeof UpdateConversationSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\n"]}