@ourofoundation/ouro-js 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/chunk-7F26V24D.js +2 -0
  2. package/dist/chunk-7F26V24D.js.map +1 -0
  3. package/dist/chunk-CONKY65O.cjs +2 -0
  4. package/dist/chunk-CONKY65O.cjs.map +1 -0
  5. package/dist/chunk-JKTQY4RU.js +2 -0
  6. package/dist/chunk-JKTQY4RU.js.map +1 -0
  7. package/dist/chunk-JW7FACNZ.cjs +2 -0
  8. package/dist/chunk-JW7FACNZ.cjs.map +1 -0
  9. package/dist/chunk-XWXLCG4E.cjs +2 -0
  10. package/dist/chunk-XWXLCG4E.cjs.map +1 -0
  11. package/dist/chunk-Z3ALIFYO.js +2 -0
  12. package/dist/chunk-Z3ALIFYO.js.map +1 -0
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.cts +2 -1
  15. package/dist/index.d.ts +2 -1
  16. package/dist/index.js +1 -1
  17. package/dist/schema/quests.cjs +1 -1
  18. package/dist/schema/quests.d.cts +406 -29
  19. package/dist/schema/quests.d.ts +406 -29
  20. package/dist/schema/quests.js +1 -1
  21. package/dist/schema/services.cjs +1 -1
  22. package/dist/schema/services.d.cts +117 -5
  23. package/dist/schema/services.d.ts +117 -5
  24. package/dist/schema/services.js +1 -1
  25. package/dist/utils/quest-submission.cjs +2 -0
  26. package/dist/utils/quest-submission.cjs.map +1 -0
  27. package/dist/utils/quest-submission.d.cts +134 -0
  28. package/dist/utils/quest-submission.d.ts +134 -0
  29. package/dist/utils/quest-submission.js +2 -0
  30. package/dist/utils/quest-submission.js.map +1 -0
  31. package/package.json +1 -1
  32. package/dist/chunk-36UOEIZN.js +0 -2
  33. package/dist/chunk-36UOEIZN.js.map +0 -1
  34. package/dist/chunk-4KDHR4VP.js +0 -2
  35. package/dist/chunk-4KDHR4VP.js.map +0 -1
  36. package/dist/chunk-IU7AKVYI.cjs +0 -2
  37. package/dist/chunk-IU7AKVYI.cjs.map +0 -1
  38. package/dist/chunk-NRZCTFCQ.cjs +0 -2
  39. package/dist/chunk-NRZCTFCQ.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ import {b as b$1,c,d as d$1,a as a$1}from'./chunk-G2MXCB7Q.js';import {a,j}from'./chunk-WRHPQNEL.js';import {enum as _enum,object,optional,string,nullable,array,boolean,any,record,number,uuid}from'zod';var v=_enum(["Personal Access Token","Ouro","None","OAuth 2.0"]),z=object({authentication:v,base_url:string(),version:optional(nullable(string())),spec_path:optional(nullable(string())),spec_url:optional(nullable(string())),auth_url:optional(nullable(string()))}),A=z.extend(b$1.partial().shape),D=c.extend({asset_type:a.refine(u=>u==="service"),metadata:A}),C=d$1.extend({asset_type:a.refine(u=>u==="service"),metadata:A}).transform(u=>a$1(u)),w=D.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true}).extend({last_updated:string().default(()=>new Date().toISOString())}).transform(u=>a$1(u)),x=_enum(["sync","async"]),d=_enum(["file","dataset","post"]),R=_enum(["audio","video","image","pdf","3d model","atomic structure"]),T=object({asset_type:d,primary:optional(boolean()),input_filter:optional(nullable(R)),file_extensions:optional(nullable(array(string()))),contains_file_extensions:optional(nullable(array(string())))}).catchall(any()),O=object({asset_type:d,primary:optional(boolean()),file_extensions:optional(nullable(array(string()))),contains_file_extensions:optional(nullable(array(string())))}).catchall(any()),b=record(string(),T),g=record(string(),O),M=object({id:string(),user_id:string(),service_id:string(),path:string(),method:_enum(["GET","POST","PUT","PATCH","DELETE"]),summary:optional(nullable(string())),parameters:optional(nullable(array(record(string(),any())))),request_body:optional(nullable(record(string(),any()))),responses:optional(nullable(array(record(string(),any())))),input_assets:optional(nullable(b)),input_type:optional(nullable(d)),input_filter:optional(nullable(R)),input_file_extension:optional(nullable(string())),input_file_extensions:optional(nullable(array(string()))),output_assets:optional(nullable(g)),output_type:optional(nullable(d)),output_file_extension:optional(nullable(string())),security:optional(nullable(record(string(),any()))),rate_limit:optional(nullable(number())),execution_mode:optional(x).default("sync"),observed_execution_mode:optional(nullable(x)),last_updated:string()}),E=object({avg_ack_ms:optional(nullable(number())),p95_ack_ms:optional(nullable(number())),avg_completion_ms:optional(nullable(number())),p95_completion_ms:optional(nullable(number())),latency_sample_count:optional(nullable(number()))}),F=c.extend({asset_type:a.refine(u=>u==="route"),route:M,metrics:optional(nullable(E))}),U=object({id:uuid(),user_id:uuid(),route_id:uuid(),metadata:optional(nullable(record(string(),any()))),response:optional(nullable(record(string(),any()))),side_effects:boolean().default(true),input_asset_id:optional(nullable(uuid())),output_asset_id:optional(nullable(uuid())),input_asset:optional(nullable(c)),input_assets:optional(nullable(array(record(string(),any())))),output_asset:optional(nullable(c)),output_assets:optional(nullable(array(record(string(),any())))),webhook_url:optional(nullable(string())),webhook_token:optional(nullable(string())),status:j,created_at:string(),last_updated:string(),started_at:optional(nullable(string())),ack_at:optional(nullable(string())),upstream_status_code:optional(nullable(number())),finished_at:optional(nullable(string()))});export{D as a,C as b,w as c,x as d,T as e,O as f,b as g,g as h,E as i,F as j,U as k};//# sourceMappingURL=chunk-7F26V24D.js.map
2
+ //# sourceMappingURL=chunk-7F26V24D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/services.ts"],"names":["AuthType","zodEnum","BaseServiceMetadataSchema","object","string","optional","nullable","ServiceMetadataSchema","AssetMetadataSchema","ServiceSchema","AssetSchema","AssetTypeSchema","x","CreateServiceSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateServiceSchema","ExecutionModeSchema","RouteAssetType","RouteInputFilter","RouteInputAssetDeclarationSchema","boolean","array","any","RouteOutputAssetDeclarationSchema","RouteInputAssetsSchema","record","RouteOutputAssetsSchema","RouteDetailSchema","number","RouteMetricsSchema","RouteSchema","ActionSchema","uuid","StatusSchema"],"mappings":"0MAuBA,IAAMA,EAAWC,KAAQ,CAAA,CAAC,uBAAyB,CAAA,MAAA,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U,OAAQ,CAAA,IAAI,CACpC,CAAA,cAAA,CAAgBjB,SAASC,QAAS4B,CAAAA,IAAAA,EAAM,CAAC,EACzC,eAAiB7B,CAAAA,QAAAA,CAASC,QAAS4B,CAAAA,IAAAA,EAAM,CAAC,CAAA,CAC1C,WAAa7B,CAAAA,QAAAA,CAASC,SAASI,CAAW,CAAC,CAC3C,CAAA,YAAA,CAAcL,SAASC,QAASiB,CAAAA,KAAAA,CAAMI,MAAOvB,CAAAA,MAAAA,GAAUoB,GAAI,EAAC,CAAC,CAAC,CAAC,CAC/D,CAAA,YAAA,CAAcnB,QAASC,CAAAA,QAAAA,CAASI,CAAW,CAAC,CAAA,CAC5C,aAAeL,CAAAA,QAAAA,CAASC,SAASiB,KAAMI,CAAAA,MAAAA,CAAOvB,MAAO,EAAA,CAAGoB,KAAK,CAAC,CAAC,CAAC,EAChE,WAAanB,CAAAA,QAAAA,CAASC,QAASF,CAAAA,MAAAA,EAAQ,CAAC,CAAA,CACxC,aAAeC,CAAAA,QAAAA,CAASC,SAASF,MAAO,EAAC,CAAC,CAAA,CAC1C,OAAQ+B,CACR,CAAA,UAAA,CAAY/B,MAAO,EAAA,CACnB,aAAcA,MAAO,EAAA,CACrB,UAAYC,CAAAA,QAAAA,CAASC,SAASF,MAAO,EAAC,CAAC,CAAA,CAIvC,OAAQC,QAASC,CAAAA,QAAAA,CAASF,MAAO,EAAC,CAAC,CAEnC,CAAA,oBAAA,CAAsBC,QAASC,CAAAA,QAAAA,CAASwB,QAAQ,CAAC,CACjD,CAAA,WAAA,CAAazB,SAASC,QAASF,CAAAA,MAAAA,EAAQ,CAAC,CAC1C,CAAC","file":"chunk-7F26V24D.js","sourcesContent":["import {\n object,\n string,\n uuid,\n number,\n array,\n type z,\n record,\n any,\n enum as zodEnum,\n optional,\n nullable,\n boolean\n} from \"zod\";\n\nimport { AssetTypeSchema, StatusSchema } from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\n\nconst AuthType = zodEnum([\"Personal Access Token\", \"Ouro\", \"None\", \"OAuth 2.0\"]);\n\nconst BaseServiceMetadataSchema = object({\n authentication: AuthType,\n base_url: string(),\n version: optional(nullable(string())),\n spec_path: optional(nullable(string())),\n spec_url: optional(nullable(string())),\n auth_url: optional(nullable(string())),\n});\n\nconst ServiceMetadataSchema = BaseServiceMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ServiceSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n});\n\nconst CreateServiceSchema = CreateAssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateServiceSchema = ServiceSchema.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 })\n .extend({\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst ExecutionModeSchema = zodEnum([\"sync\", \"async\"]);\n\n// Asset type accepted in keyed `input_assets` / `output_assets` declarations.\nconst RouteAssetType = zodEnum([\"file\", \"dataset\", \"post\"]);\n\n// File-type filter accepted on file-input declarations.\nconst RouteInputFilter = zodEnum([\n \"audio\",\n \"video\",\n \"image\",\n \"pdf\",\n \"3d model\",\n \"atomic structure\",\n]);\n\n// Shape of a single keyed declaration in `routes.input_assets`. Plural\n// declarations are canonical; the legacy `input_type` and `input_file_*`\n// columns on the route row stay in sync as primary projections.\nconst RouteInputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n input_filter: optional(nullable(RouteInputFilter)),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\n// Shape of a single keyed declaration in `routes.output_assets`.\nconst RouteOutputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\nconst RouteInputAssetsSchema = record(\n string(),\n RouteInputAssetDeclarationSchema\n);\n\nconst RouteOutputAssetsSchema = record(\n string(),\n RouteOutputAssetDeclarationSchema\n);\n\nconst RouteDetailSchema = object({\n id: string(),\n user_id: string(),\n service_id: string(),\n path: string(),\n method: zodEnum([\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"]),\n summary: optional(nullable(string())),\n parameters: optional(nullable(array(record(string(), any())))),\n request_body: optional(nullable(record(string(), any()))),\n responses: optional(nullable(array(record(string(), any())))),\n // Canonical plural input declarations keyed by request body field name.\n input_assets: optional(nullable(RouteInputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `input_assets` for\n // older clients, indexing, and quick asset-type lookups.\n input_type: optional(nullable(RouteAssetType)),\n input_filter: optional(nullable(RouteInputFilter)),\n input_file_extension: optional(nullable(string())),\n input_file_extensions: optional(nullable(array(string()))),\n // Canonical plural output declarations keyed by response body field name.\n output_assets: optional(nullable(RouteOutputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `output_assets`.\n output_type: optional(nullable(RouteAssetType)),\n output_file_extension: optional(nullable(string())),\n security: optional(nullable(record(string(), any()))),\n rate_limit: optional(nullable(number())),\n // Author-declared execution model: 'sync' = upstream returns the result\n // inline; 'async' = upstream returns 202 quickly and webhooks completion.\n execution_mode: optional(ExecutionModeSchema).default(\"sync\"),\n // Empirical mode derived by the platform from recent action history; null\n // until enough samples have been observed. When this differs from\n // execution_mode the route is misconfigured.\n observed_execution_mode: optional(nullable(ExecutionModeSchema)),\n last_updated: string(),\n});\n\n// Per-route latency aggregates surfaced from asset_metrics. All fields are\n// nullable because they don't exist until the platform has observed at least\n// one completed action for the route.\nconst RouteMetricsSchema = object({\n // Average HTTP-hop latency in milliseconds: time from request start until\n // upstream returned 200 or 202.\n avg_ack_ms: optional(nullable(number())),\n p95_ack_ms: optional(nullable(number())),\n // Average end-to-end latency in milliseconds: started_at to finished_at,\n // includes webhook completion for async routes. This is the value an\n // agent should consider when deciding whether to wait or poll.\n avg_completion_ms: optional(nullable(number())),\n p95_completion_ms: optional(nullable(number())),\n latency_sample_count: optional(nullable(number())),\n});\n\nconst RouteSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"route\" === x),\n route: RouteDetailSchema,\n // Latency aggregates joined from asset_metrics; null when no samples yet.\n metrics: optional(nullable(RouteMetricsSchema)),\n});\n\nconst ActionSchema = object({\n id: uuid(),\n user_id: uuid(),\n route_id: uuid(),\n metadata: optional(nullable(record(string(), any()))),\n response: optional(nullable(record(string(), any()))),\n side_effects: boolean().default(true),\n input_asset_id: optional(nullable(uuid())),\n output_asset_id: optional(nullable(uuid())),\n input_asset: optional(nullable(AssetSchema)),\n input_assets: optional(nullable(array(record(string(), any())))),\n output_asset: optional(nullable(AssetSchema)),\n output_assets: optional(nullable(array(record(string(), any())))),\n webhook_url: optional(nullable(string())),\n webhook_token: optional(nullable(string())),\n status: StatusSchema,\n created_at: string(),\n last_updated: string(),\n started_at: optional(nullable(string())),\n // When the upstream service first responded (200 or 202). For sync routes\n // this is approximately equal to finished_at; for async routes the gap\n // between ack_at and finished_at is the out-of-band wait time.\n ack_at: optional(nullable(string())),\n // HTTP status code returned by the upstream service at ack time.\n upstream_status_code: optional(nullable(number())),\n finished_at: optional(nullable(string())),\n});\n\nexport {\n RouteSchema,\n RouteInputAssetDeclarationSchema,\n RouteOutputAssetDeclarationSchema,\n RouteInputAssetsSchema,\n RouteOutputAssetsSchema,\n ServiceSchema,\n CreateServiceSchema,\n UpdateServiceSchema,\n ActionSchema,\n RouteMetricsSchema,\n ExecutionModeSchema,\n};\nexport type Service = z.infer<typeof ServiceSchema>;\nexport type Route = z.infer<typeof RouteSchema>;\nexport type RouteDetail = z.infer<typeof RouteDetailSchema>;\nexport type RouteMetrics = z.infer<typeof RouteMetricsSchema>;\nexport type RouteInputAssetDeclaration = z.infer<typeof RouteInputAssetDeclarationSchema>;\nexport type RouteOutputAssetDeclaration = z.infer<typeof RouteOutputAssetDeclarationSchema>;\nexport type RouteInputAssets = z.infer<typeof RouteInputAssetsSchema>;\nexport type RouteOutputAssets = z.infer<typeof RouteOutputAssetsSchema>;\nexport type ExecutionMode = z.infer<typeof ExecutionModeSchema>;\nexport type AuthType = z.infer<typeof AuthType>;\nexport type Action = z.infer<typeof ActionSchema>;\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkJW7FACNZ_cjs=require('./chunk-JW7FACNZ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');function m(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function k(e){if(!e)return null;let t=e.replace(/^\.+/,"").trim().toLowerCase().replace(/[^a-z0-9]/g,"");return !t||/^\d+$/.test(t)||t.length>12?null:t}function I(e){let s=Array.isArray(e)?e:typeof e=="string"?e.split(/[\s,]+/):[];return Array.from(new Set(s.map(t=>k(t)).filter(t=>!!t)))}var P=zod.record(zod.string(),zod.object({asset_id:zod.uuid(),asset_type:chunk43KB23BA_cjs.a})),K=zod.union([zod.uuid(),zod.object({asset_id:zod.uuid(),asset_type:zod.optional(chunk43KB23BA_cjs.a)})]),E=zod.record(zod.string(),K),q=chunkJW7FACNZ_cjs.e.extend({required:zod.optional(zod.boolean()).default(true)});function S(e){return I([...Array.isArray(e.file_extensions)?e.file_extensions:[],...Array.isArray(e.input_file_extensions)?e.input_file_extensions:[]].join(","))}function R(e){return e.input_filter||e.filter||void 0}function T(e){var n;let s=e==null?void 0:e.route;if(!s)return {};let t=s.input_assets;if(m(t)){let i=Object.entries(t).filter(([,r])=>m(r));if(i.length>0)return Object.fromEntries(i)}return s.input_type?{[s.input_type]:{asset_type:s.input_type,primary:true,input_filter:s.input_filter,input_file_extensions:(n=s.input_file_extensions)!=null?n:null}}:{}}function j(e){let s=S(e),t=R(e);return {asset_type:e.asset_type,primary:e.primary,input_filter:t!=null?t:null,file_extensions:s.length>0?s:null,required:true}}function Q(e,s){let t=new Set(s),n={};for(let[i,r]of Object.entries(e))t.has(i)||(n[i]=j(r));return n}function L(e){let s=Object.entries(e);if(!s.length)return null;let t=s.find(([,n])=>n.primary===true);return t?t[0]:(s.length===1,s[0][0])}function B(e,s){var i,r;let t=(i=e.eval_static_inputs)!=null?i:{};if(e.eval_route_id&&s){let a=T(s),l=Object.keys(t),u=e.submission_assets&&Object.keys(e.submission_assets).length>0?e.submission_assets:Q(a,l);return {contributorKeys:Object.keys(u),declarations:u,pinned:t}}let n=(r=e.submission_assets)!=null?r:{};return {contributorKeys:Object.keys(n),declarations:n,pinned:t}}function F(e){if(!e)return null;let s=e.asset_type||void 0;if(!s)return null;let t={assetType:s,hasConstraints:false};if(s==="file"){let n=S(e);n.length>0&&(t.extensions=n,t.hasConstraints=true);let i=R(e);i&&(t.fileType=i,t.hasConstraints=true);}return t}function V(e,s){var i,r,a,l,u,p;if(!s||!e)return true;let t=F(s);if(!t)return true;let n=(i=e.assetType)!=null?i:e.asset_type;if(t.assetType&&n!==t.assetType)return false;if(t.assetType==="file"){let c=(a=(r=e.asset)==null?void 0:r.metadata)!=null?a:{};if(t.extensions&&t.extensions.length>0){let o=String((l=c.extension)!=null?l:"").toLowerCase();if(!o||!t.extensions.includes(o))return false}if(t.fileType){let o=String((p=(u=c.file_type)!=null?u:c.type)!=null?p:"").toLowerCase().split("/")[0],f=t.fileType.toLowerCase();if(o&&f&&!o.includes(f)&&o!==f)return false}}return true}function M(e,s){if(!e||!Object.keys(e).length)return null;let t=s&&L(s)||Object.keys(e)[0],n=e[t];return n?{key:t,asset_id:n.asset_id,asset_type:n.asset_type}:null}function $(e){return e?Object.fromEntries(Object.entries(e).map(([s,t])=>[s,{assetId:t.asset_id,assetType:t.asset_type}])):{}}exports.a=P;exports.b=K;exports.c=E;exports.d=q;exports.e=T;exports.f=j;exports.g=Q;exports.h=L;exports.i=B;exports.j=F;exports.k=V;exports.l=M;exports.m=$;//# sourceMappingURL=chunk-CONKY65O.cjs.map
2
+ //# sourceMappingURL=chunk-CONKY65O.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/quest-submission.ts"],"names":["isPlainObject","value","normalizeFileExtension","safe","normalizeFileExtensions","rawValues","entry","KeyedAssetRefsSchema","record","string","object","uuid","AssetTypeSchema","KeyedAssetInputValueSchema","union","optional","KeyedAssetInputSchema","QuestSubmissionAssetDeclarationSchema","RouteInputAssetDeclarationSchema","boolean","readDeclarationExtensions","declaration","readDeclarationFilter","getRouteInputDeclarationsFromRoute","route","_a","detail","inputs","entries","declarationToSubmissionDeclaration","extensions","filter","materializeContributorSubmissionAssets","routeInputs","pinnedKeys","pinned","out","key","getPrimaryDeclarationKey","declarations","primary","d","getSubmissionAssetShape","item","_b","materialized","declarationToPickerFilters","assetType","filters","fileType","assetMatchesDeclaration","asset","_c","_d","_e","_f","metadata","ext","type","expected","getPrimaryAssetRef","refs","ref","toRouteInputAssets"],"mappings":"wIAeA,SAASA,EAAcC,CAAkD,CAAA,CACvE,OAAO,CAAQA,CAAAA,CAAAA,EAAU,OAAOA,CAAU,EAAA,QAAA,EAAY,CAAC,KAAM,CAAA,OAAA,CAAQA,CAAK,CAC5E,CAEA,SAASC,CAAuBD,CAAAA,CAAAA,CAAiD,CAC/E,GAAI,CAACA,EAAO,OAAO,IAAA,CAEnB,IAAME,CADaF,CAAAA,CAAAA,CAAM,QAAQ,MAAQ,CAAA,EAAE,EAAE,IAAK,EAAA,CAAE,aAC5B,CAAA,OAAA,CAAQ,aAAc,EAAE,CAAA,CAChD,OAAI,CAACE,CAAAA,EAAQ,QAAQ,IAAKA,CAAAA,CAAI,GAAKA,CAAK,CAAA,MAAA,CAAS,GAAW,IACrDA,CAAAA,CACT,CAEA,SAASC,CAAAA,CACPH,EACU,CACV,IAAMI,EAAY,KAAM,CAAA,OAAA,CAAQJ,CAAK,CACjCA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,OAAKA,CAAAA,CACE,OAAO,WACZ,CAAA,MAAA,CAAO,QAAQA,CAAI,CAAA,CAAE,IAAI,CAAC,CAACxB,EAAKyB,CAAG,CAAA,GAAM,CACvCzB,CACA,CAAA,CAAE,QAASyB,CAAI,CAAA,QAAA,CAAU,UAAWA,CAAI,CAAA,UAAW,CACrD,CAAC,CACH,CANkB,CAAA,EAOpB","file":"chunk-CONKY65O.cjs","sourcesContent":["import {\n object,\n string,\n record,\n optional,\n boolean,\n array,\n uuid,\n union,\n type z,\n} from \"zod\";\n\nimport { AssetTypeSchema } from \"../schema/common\";\nimport { RouteInputAssetDeclarationSchema } from \"../schema/services\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction normalizeFileExtension(value: string | null | undefined): string | null {\n if (!value) return null;\n const normalized = value.replace(/^\\.+/, \"\").trim().toLowerCase();\n const safe = normalized.replace(/[^a-z0-9]/g, \"\");\n if (!safe || /^\\d+$/.test(safe) || safe.length > 12) return null;\n return safe;\n}\n\nfunction normalizeFileExtensions(\n value: string | string[] | null | undefined\n): string[] {\n const rawValues = Array.isArray(value)\n ? value\n : typeof value === \"string\"\n ? value.split(/[\\s,]+/)\n : [];\n return Array.from(\n new Set(\n rawValues\n .map((entry) => normalizeFileExtension(entry))\n .filter((entry): entry is string => Boolean(entry))\n )\n );\n}\n\n/** Stored on entries and eval_static_inputs after server normalization. */\nexport const KeyedAssetRefsSchema = record(\n string(),\n object({\n asset_id: uuid(),\n asset_type: AssetTypeSchema,\n })\n);\n\n/** Accepted on POST /quests/:id/entries/create — server fills asset_type. */\nexport const KeyedAssetInputValueSchema = union([\n uuid(),\n object({\n asset_id: uuid(),\n asset_type: optional(AssetTypeSchema),\n }),\n]);\n\nexport const KeyedAssetInputSchema = record(\n string(),\n KeyedAssetInputValueSchema\n);\n\nexport const QuestSubmissionAssetDeclarationSchema =\n RouteInputAssetDeclarationSchema.extend({\n required: optional(boolean()).default(true),\n });\n\nexport type KeyedAssetRefs = z.infer<typeof KeyedAssetRefsSchema>;\nexport type KeyedAssetInput = z.infer<typeof KeyedAssetInputSchema>;\nexport type QuestSubmissionAssetDeclaration = z.infer<\n typeof QuestSubmissionAssetDeclarationSchema\n>;\n\nexport type AssetDeclarationPickerFilters = {\n assetType?: string;\n fileType?: string;\n extensions?: string[];\n hasConstraints: boolean;\n};\n\nexport type QuestSubmissionItemInput = {\n eval_route_id?: string | null;\n submission_assets?: Record<string, QuestSubmissionAssetDeclaration> | null;\n eval_static_inputs?: KeyedAssetRefs | null;\n expected_asset_type?: string | null;\n};\n\nexport type RouteInputDeclarationLike = {\n asset_type?: string | null;\n primary?: boolean;\n input_filter?: string | null;\n filter?: string | null;\n file_extensions?: string[] | null;\n input_file_extensions?: string[] | null;\n};\n\nexport type RouteForSubmissionShape = {\n route?: {\n input_assets?: Record<string, RouteInputDeclarationLike> | null;\n input_type?: string | null;\n input_filter?: string | null;\n input_file_extensions?: string[] | null;\n } | null;\n} | null;\n\nfunction readDeclarationExtensions(\n declaration: RouteInputDeclarationLike\n): string[] {\n return normalizeFileExtensions([\n ...(Array.isArray(declaration.file_extensions)\n ? declaration.file_extensions\n : []),\n ...(Array.isArray(declaration.input_file_extensions)\n ? declaration.input_file_extensions\n : []),\n ].join(\",\"));\n}\n\nfunction readDeclarationFilter(\n declaration: RouteInputDeclarationLike\n): string | undefined {\n return declaration.input_filter || declaration.filter || undefined;\n}\n\n/** Route keyed inputs as a flat map (includes legacy input_type fallback). */\nexport function getRouteInputDeclarationsFromRoute(\n route: RouteForSubmissionShape\n): Record<string, RouteInputDeclarationLike> {\n const detail = route?.route;\n if (!detail) return {};\n\n const inputs = detail.input_assets;\n if (isPlainObject(inputs)) {\n const entries = Object.entries(inputs).filter(([, value]) =>\n isPlainObject(value)\n ) as [string, RouteInputDeclarationLike][];\n if (entries.length > 0) {\n return Object.fromEntries(entries);\n }\n }\n\n if (detail.input_type) {\n return {\n [detail.input_type]: {\n asset_type: detail.input_type,\n primary: true,\n input_filter: detail.input_filter,\n input_file_extensions: detail.input_file_extensions ?? null,\n },\n };\n }\n\n return {};\n}\n\nexport function declarationToSubmissionDeclaration(\n declaration: RouteInputDeclarationLike\n): QuestSubmissionAssetDeclaration {\n const extensions = readDeclarationExtensions(declaration);\n const filter = readDeclarationFilter(declaration);\n return {\n asset_type: declaration.asset_type as QuestSubmissionAssetDeclaration[\"asset_type\"],\n primary: declaration.primary,\n input_filter: (filter ?? null) as QuestSubmissionAssetDeclaration[\"input_filter\"],\n file_extensions: extensions.length > 0 ? extensions : null,\n required: true,\n };\n}\n\n/** Materialize contributor declarations from route inputs minus pinned keys. */\nexport function materializeContributorSubmissionAssets(\n routeInputs: Record<string, RouteInputDeclarationLike>,\n pinnedKeys: string[]\n): Record<string, QuestSubmissionAssetDeclaration> {\n const pinned = new Set(pinnedKeys);\n const out: Record<string, QuestSubmissionAssetDeclaration> = {};\n for (const [key, declaration] of Object.entries(routeInputs)) {\n if (pinned.has(key)) continue;\n out[key] = declarationToSubmissionDeclaration(declaration);\n }\n return out;\n}\n\nexport function getPrimaryDeclarationKey(\n declarations: Record<string, QuestSubmissionAssetDeclaration>\n): string | null {\n const entries = Object.entries(declarations);\n if (!entries.length) return null;\n const primary = entries.find(([, d]) => d.primary === true);\n if (primary) return primary[0];\n if (entries.length === 1) return entries[0][0];\n return entries[0][0];\n}\n\nexport function getSubmissionAssetShape(\n item: QuestSubmissionItemInput,\n route?: RouteForSubmissionShape | null\n): {\n contributorKeys: string[];\n declarations: Record<string, QuestSubmissionAssetDeclaration>;\n pinned: KeyedAssetRefs;\n} {\n const pinned: KeyedAssetRefs = item.eval_static_inputs ?? {};\n\n if (item.eval_route_id && route) {\n const routeInputs = getRouteInputDeclarationsFromRoute(route);\n const pinnedKeys = Object.keys(pinned);\n const materialized =\n item.submission_assets &&\n Object.keys(item.submission_assets).length > 0\n ? item.submission_assets\n : materializeContributorSubmissionAssets(routeInputs, pinnedKeys);\n const contributorKeys = Object.keys(materialized);\n return {\n contributorKeys,\n declarations: materialized,\n pinned,\n };\n }\n\n const declarations = item.submission_assets ?? {};\n return {\n contributorKeys: Object.keys(declarations),\n declarations,\n pinned,\n };\n}\n\nexport function declarationToPickerFilters(\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): AssetDeclarationPickerFilters | null {\n if (!declaration) return null;\n const assetType = declaration.asset_type || undefined;\n if (!assetType) return null;\n\n const filters: AssetDeclarationPickerFilters = {\n assetType,\n hasConstraints: false,\n };\n\n if (assetType === \"file\") {\n const extensions = readDeclarationExtensions(declaration);\n if (extensions.length > 0) {\n filters.extensions = extensions;\n filters.hasConstraints = true;\n }\n const fileType = readDeclarationFilter(declaration);\n if (fileType) {\n filters.fileType = fileType;\n filters.hasConstraints = true;\n }\n }\n\n return filters;\n}\n\nexport function assetMatchesDeclaration(\n asset:\n | {\n assetType?: string | null;\n asset_type?: string | null;\n asset?: { metadata?: Record<string, unknown> } | null;\n }\n | null\n | undefined,\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): boolean {\n if (!declaration || !asset) return true;\n const filters = declarationToPickerFilters(declaration);\n if (!filters) return true;\n\n const assetType = asset.assetType ?? asset.asset_type;\n if (filters.assetType && assetType !== filters.assetType) return false;\n\n if (filters.assetType === \"file\") {\n const metadata = asset.asset?.metadata ?? {};\n if (filters.extensions && filters.extensions.length > 0) {\n const ext = String(metadata.extension ?? \"\").toLowerCase();\n if (!ext || !filters.extensions.includes(ext)) return false;\n }\n if (filters.fileType) {\n const type = String(metadata.file_type ?? metadata.type ?? \"\")\n .toLowerCase()\n .split(\"/\")[0];\n const expected = filters.fileType.toLowerCase();\n if (type && expected && !type.includes(expected) && type !== expected) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function getPrimaryAssetRef(\n refs: KeyedAssetRefs | null | undefined,\n declarations?: Record<string, QuestSubmissionAssetDeclaration> | null\n): { key: string; asset_id: string; asset_type: string } | null {\n if (!refs || !Object.keys(refs).length) return null;\n const key =\n (declarations && getPrimaryDeclarationKey(declarations)) ||\n Object.keys(refs)[0];\n const ref = refs[key];\n if (!ref) return null;\n return { key, asset_id: ref.asset_id, asset_type: ref.asset_type };\n}\n\nexport function toRouteInputAssets(\n refs: KeyedAssetRefs | null | undefined\n): Record<string, { assetId: string; assetType: string }> {\n if (!refs) return {};\n return Object.fromEntries(\n Object.entries(refs).map(([key, ref]) => [\n key,\n { assetId: ref.asset_id, assetType: ref.asset_type },\n ])\n );\n}\n\n/** @deprecated Use declarationToPickerFilters */\nexport type EvalSubmissionFilters = AssetDeclarationPickerFilters;\n"]}
@@ -0,0 +1,2 @@
1
+ import {e}from'./chunk-7F26V24D.js';import {a}from'./chunk-WRHPQNEL.js';import {record,string,object,uuid,union,optional,boolean}from'zod';function m(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function k(e){if(!e)return null;let t=e.replace(/^\.+/,"").trim().toLowerCase().replace(/[^a-z0-9]/g,"");return !t||/^\d+$/.test(t)||t.length>12?null:t}function I(e){let s=Array.isArray(e)?e:typeof e=="string"?e.split(/[\s,]+/):[];return Array.from(new Set(s.map(t=>k(t)).filter(t=>!!t)))}var P=record(string(),object({asset_id:uuid(),asset_type:a})),K=union([uuid(),object({asset_id:uuid(),asset_type:optional(a)})]),E=record(string(),K),q=e.extend({required:optional(boolean()).default(true)});function S(e){return I([...Array.isArray(e.file_extensions)?e.file_extensions:[],...Array.isArray(e.input_file_extensions)?e.input_file_extensions:[]].join(","))}function R(e){return e.input_filter||e.filter||void 0}function T(e){var n;let s=e==null?void 0:e.route;if(!s)return {};let t=s.input_assets;if(m(t)){let i=Object.entries(t).filter(([,r])=>m(r));if(i.length>0)return Object.fromEntries(i)}return s.input_type?{[s.input_type]:{asset_type:s.input_type,primary:true,input_filter:s.input_filter,input_file_extensions:(n=s.input_file_extensions)!=null?n:null}}:{}}function j(e){let s=S(e),t=R(e);return {asset_type:e.asset_type,primary:e.primary,input_filter:t!=null?t:null,file_extensions:s.length>0?s:null,required:true}}function Q(e,s){let t=new Set(s),n={};for(let[i,r]of Object.entries(e))t.has(i)||(n[i]=j(r));return n}function L(e){let s=Object.entries(e);if(!s.length)return null;let t=s.find(([,n])=>n.primary===true);return t?t[0]:(s.length===1,s[0][0])}function B(e,s){var i,r;let t=(i=e.eval_static_inputs)!=null?i:{};if(e.eval_route_id&&s){let a=T(s),l=Object.keys(t),u=e.submission_assets&&Object.keys(e.submission_assets).length>0?e.submission_assets:Q(a,l);return {contributorKeys:Object.keys(u),declarations:u,pinned:t}}let n=(r=e.submission_assets)!=null?r:{};return {contributorKeys:Object.keys(n),declarations:n,pinned:t}}function F(e){if(!e)return null;let s=e.asset_type||void 0;if(!s)return null;let t={assetType:s,hasConstraints:false};if(s==="file"){let n=S(e);n.length>0&&(t.extensions=n,t.hasConstraints=true);let i=R(e);i&&(t.fileType=i,t.hasConstraints=true);}return t}function V(e,s){var i,r,a,l,u,p;if(!s||!e)return true;let t=F(s);if(!t)return true;let n=(i=e.assetType)!=null?i:e.asset_type;if(t.assetType&&n!==t.assetType)return false;if(t.assetType==="file"){let c=(a=(r=e.asset)==null?void 0:r.metadata)!=null?a:{};if(t.extensions&&t.extensions.length>0){let o=String((l=c.extension)!=null?l:"").toLowerCase();if(!o||!t.extensions.includes(o))return false}if(t.fileType){let o=String((p=(u=c.file_type)!=null?u:c.type)!=null?p:"").toLowerCase().split("/")[0],f=t.fileType.toLowerCase();if(o&&f&&!o.includes(f)&&o!==f)return false}}return true}function M(e,s){if(!e||!Object.keys(e).length)return null;let t=s&&L(s)||Object.keys(e)[0],n=e[t];return n?{key:t,asset_id:n.asset_id,asset_type:n.asset_type}:null}function $(e){return e?Object.fromEntries(Object.entries(e).map(([s,t])=>[s,{assetId:t.asset_id,assetType:t.asset_type}])):{}}export{P as a,K as b,E as c,q as d,T as e,j as f,Q as g,L as h,B as i,F as j,V as k,M as l,$ as m};//# sourceMappingURL=chunk-JKTQY4RU.js.map
2
+ //# sourceMappingURL=chunk-JKTQY4RU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/quest-submission.ts"],"names":["isPlainObject","value","normalizeFileExtension","safe","normalizeFileExtensions","rawValues","entry","KeyedAssetRefsSchema","record","string","object","uuid","AssetTypeSchema","KeyedAssetInputValueSchema","union","optional","KeyedAssetInputSchema","QuestSubmissionAssetDeclarationSchema","RouteInputAssetDeclarationSchema","boolean","readDeclarationExtensions","declaration","readDeclarationFilter","getRouteInputDeclarationsFromRoute","route","_a","detail","inputs","entries","declarationToSubmissionDeclaration","extensions","filter","materializeContributorSubmissionAssets","routeInputs","pinnedKeys","pinned","out","key","getPrimaryDeclarationKey","declarations","primary","d","getSubmissionAssetShape","item","_b","materialized","declarationToPickerFilters","assetType","filters","fileType","assetMatchesDeclaration","asset","_c","_d","_e","_f","metadata","ext","type","expected","getPrimaryAssetRef","refs","ref","toRouteInputAssets"],"mappings":"2IAeA,SAASA,EAAcC,CAAkD,CAAA,CACvE,OAAO,CAAQA,CAAAA,CAAAA,EAAU,OAAOA,CAAU,EAAA,QAAA,EAAY,CAAC,KAAM,CAAA,OAAA,CAAQA,CAAK,CAC5E,CAEA,SAASC,CAAuBD,CAAAA,CAAAA,CAAiD,CAC/E,GAAI,CAACA,EAAO,OAAO,IAAA,CAEnB,IAAME,CADaF,CAAAA,CAAAA,CAAM,QAAQ,MAAQ,CAAA,EAAE,EAAE,IAAK,EAAA,CAAE,aAC5B,CAAA,OAAA,CAAQ,aAAc,EAAE,CAAA,CAChD,OAAI,CAACE,CAAAA,EAAQ,QAAQ,IAAKA,CAAAA,CAAI,GAAKA,CAAK,CAAA,MAAA,CAAS,GAAW,IACrDA,CAAAA,CACT,CAEA,SAASC,CAAAA,CACPH,EACU,CACV,IAAMI,EAAY,KAAM,CAAA,OAAA,CAAQJ,CAAK,CACjCA,CAAAA,CAAAA,CACA,OAAOA,CAAU,EAAA,QAAA,CACfA,EAAM,KAAM,CAAA,Q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,IAAI,CAAC,CAACxB,EAAKyB,CAAG,CAAA,GAAM,CACvCzB,CACA,CAAA,CAAE,QAASyB,CAAI,CAAA,QAAA,CAAU,UAAWA,CAAI,CAAA,UAAW,CACrD,CAAC,CACH,CANkB,CAAA,EAOpB","file":"chunk-JKTQY4RU.js","sourcesContent":["import {\n object,\n string,\n record,\n optional,\n boolean,\n array,\n uuid,\n union,\n type z,\n} from \"zod\";\n\nimport { AssetTypeSchema } from \"../schema/common\";\nimport { RouteInputAssetDeclarationSchema } from \"../schema/services\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction normalizeFileExtension(value: string | null | undefined): string | null {\n if (!value) return null;\n const normalized = value.replace(/^\\.+/, \"\").trim().toLowerCase();\n const safe = normalized.replace(/[^a-z0-9]/g, \"\");\n if (!safe || /^\\d+$/.test(safe) || safe.length > 12) return null;\n return safe;\n}\n\nfunction normalizeFileExtensions(\n value: string | string[] | null | undefined\n): string[] {\n const rawValues = Array.isArray(value)\n ? value\n : typeof value === \"string\"\n ? value.split(/[\\s,]+/)\n : [];\n return Array.from(\n new Set(\n rawValues\n .map((entry) => normalizeFileExtension(entry))\n .filter((entry): entry is string => Boolean(entry))\n )\n );\n}\n\n/** Stored on entries and eval_static_inputs after server normalization. */\nexport const KeyedAssetRefsSchema = record(\n string(),\n object({\n asset_id: uuid(),\n asset_type: AssetTypeSchema,\n })\n);\n\n/** Accepted on POST /quests/:id/entries/create — server fills asset_type. */\nexport const KeyedAssetInputValueSchema = union([\n uuid(),\n object({\n asset_id: uuid(),\n asset_type: optional(AssetTypeSchema),\n }),\n]);\n\nexport const KeyedAssetInputSchema = record(\n string(),\n KeyedAssetInputValueSchema\n);\n\nexport const QuestSubmissionAssetDeclarationSchema =\n RouteInputAssetDeclarationSchema.extend({\n required: optional(boolean()).default(true),\n });\n\nexport type KeyedAssetRefs = z.infer<typeof KeyedAssetRefsSchema>;\nexport type KeyedAssetInput = z.infer<typeof KeyedAssetInputSchema>;\nexport type QuestSubmissionAssetDeclaration = z.infer<\n typeof QuestSubmissionAssetDeclarationSchema\n>;\n\nexport type AssetDeclarationPickerFilters = {\n assetType?: string;\n fileType?: string;\n extensions?: string[];\n hasConstraints: boolean;\n};\n\nexport type QuestSubmissionItemInput = {\n eval_route_id?: string | null;\n submission_assets?: Record<string, QuestSubmissionAssetDeclaration> | null;\n eval_static_inputs?: KeyedAssetRefs | null;\n expected_asset_type?: string | null;\n};\n\nexport type RouteInputDeclarationLike = {\n asset_type?: string | null;\n primary?: boolean;\n input_filter?: string | null;\n filter?: string | null;\n file_extensions?: string[] | null;\n input_file_extensions?: string[] | null;\n};\n\nexport type RouteForSubmissionShape = {\n route?: {\n input_assets?: Record<string, RouteInputDeclarationLike> | null;\n input_type?: string | null;\n input_filter?: string | null;\n input_file_extensions?: string[] | null;\n } | null;\n} | null;\n\nfunction readDeclarationExtensions(\n declaration: RouteInputDeclarationLike\n): string[] {\n return normalizeFileExtensions([\n ...(Array.isArray(declaration.file_extensions)\n ? declaration.file_extensions\n : []),\n ...(Array.isArray(declaration.input_file_extensions)\n ? declaration.input_file_extensions\n : []),\n ].join(\",\"));\n}\n\nfunction readDeclarationFilter(\n declaration: RouteInputDeclarationLike\n): string | undefined {\n return declaration.input_filter || declaration.filter || undefined;\n}\n\n/** Route keyed inputs as a flat map (includes legacy input_type fallback). */\nexport function getRouteInputDeclarationsFromRoute(\n route: RouteForSubmissionShape\n): Record<string, RouteInputDeclarationLike> {\n const detail = route?.route;\n if (!detail) return {};\n\n const inputs = detail.input_assets;\n if (isPlainObject(inputs)) {\n const entries = Object.entries(inputs).filter(([, value]) =>\n isPlainObject(value)\n ) as [string, RouteInputDeclarationLike][];\n if (entries.length > 0) {\n return Object.fromEntries(entries);\n }\n }\n\n if (detail.input_type) {\n return {\n [detail.input_type]: {\n asset_type: detail.input_type,\n primary: true,\n input_filter: detail.input_filter,\n input_file_extensions: detail.input_file_extensions ?? null,\n },\n };\n }\n\n return {};\n}\n\nexport function declarationToSubmissionDeclaration(\n declaration: RouteInputDeclarationLike\n): QuestSubmissionAssetDeclaration {\n const extensions = readDeclarationExtensions(declaration);\n const filter = readDeclarationFilter(declaration);\n return {\n asset_type: declaration.asset_type as QuestSubmissionAssetDeclaration[\"asset_type\"],\n primary: declaration.primary,\n input_filter: (filter ?? null) as QuestSubmissionAssetDeclaration[\"input_filter\"],\n file_extensions: extensions.length > 0 ? extensions : null,\n required: true,\n };\n}\n\n/** Materialize contributor declarations from route inputs minus pinned keys. */\nexport function materializeContributorSubmissionAssets(\n routeInputs: Record<string, RouteInputDeclarationLike>,\n pinnedKeys: string[]\n): Record<string, QuestSubmissionAssetDeclaration> {\n const pinned = new Set(pinnedKeys);\n const out: Record<string, QuestSubmissionAssetDeclaration> = {};\n for (const [key, declaration] of Object.entries(routeInputs)) {\n if (pinned.has(key)) continue;\n out[key] = declarationToSubmissionDeclaration(declaration);\n }\n return out;\n}\n\nexport function getPrimaryDeclarationKey(\n declarations: Record<string, QuestSubmissionAssetDeclaration>\n): string | null {\n const entries = Object.entries(declarations);\n if (!entries.length) return null;\n const primary = entries.find(([, d]) => d.primary === true);\n if (primary) return primary[0];\n if (entries.length === 1) return entries[0][0];\n return entries[0][0];\n}\n\nexport function getSubmissionAssetShape(\n item: QuestSubmissionItemInput,\n route?: RouteForSubmissionShape | null\n): {\n contributorKeys: string[];\n declarations: Record<string, QuestSubmissionAssetDeclaration>;\n pinned: KeyedAssetRefs;\n} {\n const pinned: KeyedAssetRefs = item.eval_static_inputs ?? {};\n\n if (item.eval_route_id && route) {\n const routeInputs = getRouteInputDeclarationsFromRoute(route);\n const pinnedKeys = Object.keys(pinned);\n const materialized =\n item.submission_assets &&\n Object.keys(item.submission_assets).length > 0\n ? item.submission_assets\n : materializeContributorSubmissionAssets(routeInputs, pinnedKeys);\n const contributorKeys = Object.keys(materialized);\n return {\n contributorKeys,\n declarations: materialized,\n pinned,\n };\n }\n\n const declarations = item.submission_assets ?? {};\n return {\n contributorKeys: Object.keys(declarations),\n declarations,\n pinned,\n };\n}\n\nexport function declarationToPickerFilters(\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): AssetDeclarationPickerFilters | null {\n if (!declaration) return null;\n const assetType = declaration.asset_type || undefined;\n if (!assetType) return null;\n\n const filters: AssetDeclarationPickerFilters = {\n assetType,\n hasConstraints: false,\n };\n\n if (assetType === \"file\") {\n const extensions = readDeclarationExtensions(declaration);\n if (extensions.length > 0) {\n filters.extensions = extensions;\n filters.hasConstraints = true;\n }\n const fileType = readDeclarationFilter(declaration);\n if (fileType) {\n filters.fileType = fileType;\n filters.hasConstraints = true;\n }\n }\n\n return filters;\n}\n\nexport function assetMatchesDeclaration(\n asset:\n | {\n assetType?: string | null;\n asset_type?: string | null;\n asset?: { metadata?: Record<string, unknown> } | null;\n }\n | null\n | undefined,\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): boolean {\n if (!declaration || !asset) return true;\n const filters = declarationToPickerFilters(declaration);\n if (!filters) return true;\n\n const assetType = asset.assetType ?? asset.asset_type;\n if (filters.assetType && assetType !== filters.assetType) return false;\n\n if (filters.assetType === \"file\") {\n const metadata = asset.asset?.metadata ?? {};\n if (filters.extensions && filters.extensions.length > 0) {\n const ext = String(metadata.extension ?? \"\").toLowerCase();\n if (!ext || !filters.extensions.includes(ext)) return false;\n }\n if (filters.fileType) {\n const type = String(metadata.file_type ?? metadata.type ?? \"\")\n .toLowerCase()\n .split(\"/\")[0];\n const expected = filters.fileType.toLowerCase();\n if (type && expected && !type.includes(expected) && type !== expected) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function getPrimaryAssetRef(\n refs: KeyedAssetRefs | null | undefined,\n declarations?: Record<string, QuestSubmissionAssetDeclaration> | null\n): { key: string; asset_id: string; asset_type: string } | null {\n if (!refs || !Object.keys(refs).length) return null;\n const key =\n (declarations && getPrimaryDeclarationKey(declarations)) ||\n Object.keys(refs)[0];\n const ref = refs[key];\n if (!ref) return null;\n return { key, asset_id: ref.asset_id, asset_type: ref.asset_type };\n}\n\nexport function toRouteInputAssets(\n refs: KeyedAssetRefs | null | undefined\n): Record<string, { assetId: string; assetType: string }> {\n if (!refs) return {};\n return Object.fromEntries(\n Object.entries(refs).map(([key, ref]) => [\n key,\n { assetId: ref.asset_id, assetType: ref.asset_type },\n ])\n );\n}\n\n/** @deprecated Use declarationToPickerFilters */\nexport type EvalSubmissionFilters = AssetDeclarationPickerFilters;\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkIP4OVRZB_cjs=require('./chunk-IP4OVRZB.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var v=zod.enum(["Personal Access Token","Ouro","None","OAuth 2.0"]),z=zod.object({authentication:v,base_url:zod.string(),version:zod.optional(zod.nullable(zod.string())),spec_path:zod.optional(zod.nullable(zod.string())),spec_url:zod.optional(zod.nullable(zod.string())),auth_url:zod.optional(zod.nullable(zod.string()))}),A=z.extend(chunkIP4OVRZB_cjs.b.partial().shape),D=chunkIP4OVRZB_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.refine(u=>u==="service"),metadata:A}),C=chunkIP4OVRZB_cjs.d.extend({asset_type:chunk43KB23BA_cjs.a.refine(u=>u==="service"),metadata:A}).transform(u=>chunkIP4OVRZB_cjs.a(u)),w=D.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true}).extend({last_updated:zod.string().default(()=>new Date().toISOString())}).transform(u=>chunkIP4OVRZB_cjs.a(u)),x=zod.enum(["sync","async"]),d=zod.enum(["file","dataset","post"]),R=zod.enum(["audio","video","image","pdf","3d model","atomic structure"]),T=zod.object({asset_type:d,primary:zod.optional(zod.boolean()),input_filter:zod.optional(zod.nullable(R)),file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),contains_file_extensions:zod.optional(zod.nullable(zod.array(zod.string())))}).catchall(zod.any()),O=zod.object({asset_type:d,primary:zod.optional(zod.boolean()),file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),contains_file_extensions:zod.optional(zod.nullable(zod.array(zod.string())))}).catchall(zod.any()),b=zod.record(zod.string(),T),g=zod.record(zod.string(),O),M=zod.object({id:zod.string(),user_id:zod.string(),service_id:zod.string(),path:zod.string(),method:zod.enum(["GET","POST","PUT","PATCH","DELETE"]),summary:zod.optional(zod.nullable(zod.string())),parameters:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),request_body:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),responses:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),input_assets:zod.optional(zod.nullable(b)),input_type:zod.optional(zod.nullable(d)),input_filter:zod.optional(zod.nullable(R)),input_file_extension:zod.optional(zod.nullable(zod.string())),input_file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),output_assets:zod.optional(zod.nullable(g)),output_type:zod.optional(zod.nullable(d)),output_file_extension:zod.optional(zod.nullable(zod.string())),security:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),rate_limit:zod.optional(zod.nullable(zod.number())),execution_mode:zod.optional(x).default("sync"),observed_execution_mode:zod.optional(zod.nullable(x)),last_updated:zod.string()}),E=zod.object({avg_ack_ms:zod.optional(zod.nullable(zod.number())),p95_ack_ms:zod.optional(zod.nullable(zod.number())),avg_completion_ms:zod.optional(zod.nullable(zod.number())),p95_completion_ms:zod.optional(zod.nullable(zod.number())),latency_sample_count:zod.optional(zod.nullable(zod.number()))}),F=chunkIP4OVRZB_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.refine(u=>u==="route"),route:M,metrics:zod.optional(zod.nullable(E))}),U=zod.object({id:zod.uuid(),user_id:zod.uuid(),route_id:zod.uuid(),metadata:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),response:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),side_effects:zod.boolean().default(true),input_asset_id:zod.optional(zod.nullable(zod.uuid())),output_asset_id:zod.optional(zod.nullable(zod.uuid())),input_asset:zod.optional(zod.nullable(chunkIP4OVRZB_cjs.c)),input_assets:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),output_asset:zod.optional(zod.nullable(chunkIP4OVRZB_cjs.c)),output_assets:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),webhook_url:zod.optional(zod.nullable(zod.string())),webhook_token:zod.optional(zod.nullable(zod.string())),status:chunk43KB23BA_cjs.j,created_at:zod.string(),last_updated:zod.string(),started_at:zod.optional(zod.nullable(zod.string())),ack_at:zod.optional(zod.nullable(zod.string())),upstream_status_code:zod.optional(zod.nullable(zod.number())),finished_at:zod.optional(zod.nullable(zod.string()))});exports.a=D;exports.b=C;exports.c=w;exports.d=x;exports.e=T;exports.f=O;exports.g=b;exports.h=g;exports.i=E;exports.j=F;exports.k=U;//# sourceMappingURL=chunk-JW7FACNZ.cjs.map
2
+ //# sourceMappingURL=chunk-JW7FACNZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/services.ts"],"names":["AuthType","zodEnum","BaseServiceMetadataSchema","object","string","optional","nullable","ServiceMetadataSchema","AssetMetadataSchema","ServiceSchema","AssetSchema","AssetTypeSchema","x","CreateServiceSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateServiceSchema","ExecutionModeSchema","RouteAssetType","RouteInputFilter","RouteInputAssetDeclarationSchema","boolean","array","any","RouteOutputAssetDeclarationSchema","RouteInputAssetsSchema","record","RouteOutputAssetsSchema","RouteDetailSchema","number","RouteMetricsSchema","RouteSchema","ActionSchema","uuid","StatusSchema"],"mappings":"wIAuBA,IAAMA,EAAWC,QAAQ,CAAA,CAAC,uBAAyB,CAAA,MAAA,CAAQ,OAAQ,WAAW,CAAC,CAEzEC,CAAAA,CAAAA,CAA4BC,WAAO,CACvC,cAAA,CAAgBH,CAChB,CAAA,QAAA,CAAUI,YACV,CAAA,OAAA,CAASC,Y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ASC,YAAS4B,CAAAA,QAAAA,EAAM,CAAC,CAAA,CAC1C,WAAa7B,CAAAA,YAAAA,CAASC,aAASI,mBAAW,CAAC,CAC3C,CAAA,YAAA,CAAcL,aAASC,YAASiB,CAAAA,SAAAA,CAAMI,UAAOvB,CAAAA,UAAAA,GAAUoB,OAAI,EAAC,CAAC,CAAC,CAAC,CAC/D,CAAA,YAAA,CAAcnB,YAASC,CAAAA,YAAAA,CAASI,mBAAW,CAAC,CAAA,CAC5C,aAAeL,CAAAA,YAAAA,CAASC,aAASiB,SAAMI,CAAAA,UAAAA,CAAOvB,UAAO,EAAA,CAAGoB,SAAK,CAAC,CAAC,CAAC,EAChE,WAAanB,CAAAA,YAAAA,CAASC,YAASF,CAAAA,UAAAA,EAAQ,CAAC,CAAA,CACxC,aAAeC,CAAAA,YAAAA,CAASC,aAASF,UAAO,EAAC,CAAC,CAAA,CAC1C,OAAQ+B,mBACR,CAAA,UAAA,CAAY/B,UAAO,EAAA,CACnB,aAAcA,UAAO,EAAA,CACrB,UAAYC,CAAAA,YAAAA,CAASC,aAASF,UAAO,EAAC,CAAC,CAAA,CAIvC,OAAQC,YAASC,CAAAA,YAAAA,CAASF,UAAO,EAAC,CAAC,CAEnC,CAAA,oBAAA,CAAsBC,YAASC,CAAAA,YAAAA,CAASwB,YAAQ,CAAC,CACjD,CAAA,WAAA,CAAazB,aAASC,YAASF,CAAAA,UAAAA,EAAQ,CAAC,CAC1C,CAAC","file":"chunk-JW7FACNZ.cjs","sourcesContent":["import {\n object,\n string,\n uuid,\n number,\n array,\n type z,\n record,\n any,\n enum as zodEnum,\n optional,\n nullable,\n boolean\n} from \"zod\";\n\nimport { AssetTypeSchema, StatusSchema } from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\n\nconst AuthType = zodEnum([\"Personal Access Token\", \"Ouro\", \"None\", \"OAuth 2.0\"]);\n\nconst BaseServiceMetadataSchema = object({\n authentication: AuthType,\n base_url: string(),\n version: optional(nullable(string())),\n spec_path: optional(nullable(string())),\n spec_url: optional(nullable(string())),\n auth_url: optional(nullable(string())),\n});\n\nconst ServiceMetadataSchema = BaseServiceMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ServiceSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n});\n\nconst CreateServiceSchema = CreateAssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateServiceSchema = ServiceSchema.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 })\n .extend({\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst ExecutionModeSchema = zodEnum([\"sync\", \"async\"]);\n\n// Asset type accepted in keyed `input_assets` / `output_assets` declarations.\nconst RouteAssetType = zodEnum([\"file\", \"dataset\", \"post\"]);\n\n// File-type filter accepted on file-input declarations.\nconst RouteInputFilter = zodEnum([\n \"audio\",\n \"video\",\n \"image\",\n \"pdf\",\n \"3d model\",\n \"atomic structure\",\n]);\n\n// Shape of a single keyed declaration in `routes.input_assets`. Plural\n// declarations are canonical; the legacy `input_type` and `input_file_*`\n// columns on the route row stay in sync as primary projections.\nconst RouteInputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n input_filter: optional(nullable(RouteInputFilter)),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\n// Shape of a single keyed declaration in `routes.output_assets`.\nconst RouteOutputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\nconst RouteInputAssetsSchema = record(\n string(),\n RouteInputAssetDeclarationSchema\n);\n\nconst RouteOutputAssetsSchema = record(\n string(),\n RouteOutputAssetDeclarationSchema\n);\n\nconst RouteDetailSchema = object({\n id: string(),\n user_id: string(),\n service_id: string(),\n path: string(),\n method: zodEnum([\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"]),\n summary: optional(nullable(string())),\n parameters: optional(nullable(array(record(string(), any())))),\n request_body: optional(nullable(record(string(), any()))),\n responses: optional(nullable(array(record(string(), any())))),\n // Canonical plural input declarations keyed by request body field name.\n input_assets: optional(nullable(RouteInputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `input_assets` for\n // older clients, indexing, and quick asset-type lookups.\n input_type: optional(nullable(RouteAssetType)),\n input_filter: optional(nullable(RouteInputFilter)),\n input_file_extension: optional(nullable(string())),\n input_file_extensions: optional(nullable(array(string()))),\n // Canonical plural output declarations keyed by response body field name.\n output_assets: optional(nullable(RouteOutputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `output_assets`.\n output_type: optional(nullable(RouteAssetType)),\n output_file_extension: optional(nullable(string())),\n security: optional(nullable(record(string(), any()))),\n rate_limit: optional(nullable(number())),\n // Author-declared execution model: 'sync' = upstream returns the result\n // inline; 'async' = upstream returns 202 quickly and webhooks completion.\n execution_mode: optional(ExecutionModeSchema).default(\"sync\"),\n // Empirical mode derived by the platform from recent action history; null\n // until enough samples have been observed. When this differs from\n // execution_mode the route is misconfigured.\n observed_execution_mode: optional(nullable(ExecutionModeSchema)),\n last_updated: string(),\n});\n\n// Per-route latency aggregates surfaced from asset_metrics. All fields are\n// nullable because they don't exist until the platform has observed at least\n// one completed action for the route.\nconst RouteMetricsSchema = object({\n // Average HTTP-hop latency in milliseconds: time from request start until\n // upstream returned 200 or 202.\n avg_ack_ms: optional(nullable(number())),\n p95_ack_ms: optional(nullable(number())),\n // Average end-to-end latency in milliseconds: started_at to finished_at,\n // includes webhook completion for async routes. This is the value an\n // agent should consider when deciding whether to wait or poll.\n avg_completion_ms: optional(nullable(number())),\n p95_completion_ms: optional(nullable(number())),\n latency_sample_count: optional(nullable(number())),\n});\n\nconst RouteSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"route\" === x),\n route: RouteDetailSchema,\n // Latency aggregates joined from asset_metrics; null when no samples yet.\n metrics: optional(nullable(RouteMetricsSchema)),\n});\n\nconst ActionSchema = object({\n id: uuid(),\n user_id: uuid(),\n route_id: uuid(),\n metadata: optional(nullable(record(string(), any()))),\n response: optional(nullable(record(string(), any()))),\n side_effects: boolean().default(true),\n input_asset_id: optional(nullable(uuid())),\n output_asset_id: optional(nullable(uuid())),\n input_asset: optional(nullable(AssetSchema)),\n input_assets: optional(nullable(array(record(string(), any())))),\n output_asset: optional(nullable(AssetSchema)),\n output_assets: optional(nullable(array(record(string(), any())))),\n webhook_url: optional(nullable(string())),\n webhook_token: optional(nullable(string())),\n status: StatusSchema,\n created_at: string(),\n last_updated: string(),\n started_at: optional(nullable(string())),\n // When the upstream service first responded (200 or 202). For sync routes\n // this is approximately equal to finished_at; for async routes the gap\n // between ack_at and finished_at is the out-of-band wait time.\n ack_at: optional(nullable(string())),\n // HTTP status code returned by the upstream service at ack time.\n upstream_status_code: optional(nullable(number())),\n finished_at: optional(nullable(string())),\n});\n\nexport {\n RouteSchema,\n RouteInputAssetDeclarationSchema,\n RouteOutputAssetDeclarationSchema,\n RouteInputAssetsSchema,\n RouteOutputAssetsSchema,\n ServiceSchema,\n CreateServiceSchema,\n UpdateServiceSchema,\n ActionSchema,\n RouteMetricsSchema,\n ExecutionModeSchema,\n};\nexport type Service = z.infer<typeof ServiceSchema>;\nexport type Route = z.infer<typeof RouteSchema>;\nexport type RouteDetail = z.infer<typeof RouteDetailSchema>;\nexport type RouteMetrics = z.infer<typeof RouteMetricsSchema>;\nexport type RouteInputAssetDeclaration = z.infer<typeof RouteInputAssetDeclarationSchema>;\nexport type RouteOutputAssetDeclaration = z.infer<typeof RouteOutputAssetDeclarationSchema>;\nexport type RouteInputAssets = z.infer<typeof RouteInputAssetsSchema>;\nexport type RouteOutputAssets = z.infer<typeof RouteOutputAssetsSchema>;\nexport type ExecutionMode = z.infer<typeof ExecutionModeSchema>;\nexport type AuthType = z.infer<typeof AuthType>;\nexport type Action = z.infer<typeof ActionSchema>;\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkCONKY65O_cjs=require('./chunk-CONKY65O.cjs'),chunkIP4OVRZB_cjs=require('./chunk-IP4OVRZB.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(),chunkCONKY65O_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunkCONKY65O_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(),chunkCONKY65O_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunkCONKY65O_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=chunkIP4OVRZB_cjs.c.extend({asset_type:zod.literal("quest").default("quest"),metadata:zod.optional(zod.nullable(chunkIP4OVRZB_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=chunkIP4OVRZB_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=>chunkIP4OVRZB_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}).extend({asset_type:zod.literal("quest").default("quest"),last_updated:zod.string().default(()=>new Date().toISOString())}).transform(u=>chunkIP4OVRZB_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(chunkCONKY65O_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(chunkCONKY65O_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-XWXLCG4E.cjs.map
2
+ //# sourceMappingURL=chunk-XWXLCG4E.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":"8LAkCMA,CAAkBC,CAAAA,QAAAA,CAAQ,CAAC,UAAY,CAAA,YAAY,CAAC,CAAA,CACpDC,CAAoBD,CAAAA,QAAAA,CAAQ,CAAC,OAAS,CAAA,MAAA,CAAQ,QAAU,CAAA,WAAW,CAAC,CAAA,CAEpEE,EAAwBF,QAAQ,CAAA,CACpC,SACA,CAAA,aAAA,CACA,MACA,CAAA,SACF,CAAC,CAEKG,CAAAA,CAAAA,CAAuBH,SAAQ,CAAC,KAAA,CAAO,KAAK,CAAC,CAAA,CAE7CI,CAAwBJ,CAAAA,QAAAA,CAAQ,CACpC,SAAA,CACA,UACA,QACA,CAAA,QAAA,CACA,SACF,CAAC,CAAA,CAEKK,EAAoBL,QAAQ,CAAA,CAAC,WAAa,CAAA,UAAA,CAAY,UAAU,CAAC,EAMjEM,CAA2BC,CAAAA,UAAAA,CAAO,CACtC,IAAMC,CAAAA,UAAAA,GACN,OAASC,CAAAA,YAAAA,CAASC,SAAMC,CAAAA,OAAAA,EAAK,CAAC,EAC9B,KAAOF,CAAAA,YAAAA,CAASG,UAAOJ,CAAAA,UAAAA,EAAUG,CAAAA,OAAAA,EAAK,CAAC,CAAA,CACvC,KAAOF,CAAAA,YAAAA,CAASC,SAAMC,CAAAA,OAAAA,EAAK,CAA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AC/C,WAAaZ,CAAAA,YAAAA,CAASQ,aAASJ,CAAa,CAAC,EAC7C,MAAQJ,CAAAA,YAAAA,CAASQ,YAASJ,CAAAA,CAAa,CAAC,CAAA,CACxC,OAAQR,CACR,CAAA,WAAA,CAAaI,aAASQ,YAASD,CAAAA,QAAAA,EAAM,CAAC,CAAA,CACtC,WAAaP,CAAAA,YAAAA,CAASQ,YAAST,CAAAA,UAAAA,EAAQ,CAAC,CAAA,CACxC,eAAgBC,YAASQ,CAAAA,YAAAA,CAASD,UAAM,CAAC,CACzC,CAAA,UAAA,CAAYP,YAASQ,CAAAA,YAAAA,CAASC,YAAQ,CAAC,CACvC,CAAA,WAAA,CAAaT,YAASQ,CAAAA,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-XWXLCG4E.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 })\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
+ import {a,d,c as c$1}from'./chunk-JKTQY4RU.js';import {c,b,d as d$1,a as a$2}from'./chunk-G2MXCB7Q.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}).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-Z3ALIFYO.js.map
2
+ //# sourceMappingURL=chunk-Z3ALIFYO.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":"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,Q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AAQP,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-Z3ALIFYO.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 // `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 })\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'),chunkN6AJDETI_cjs=require('./chunk-N6AJDETI.cjs'),chunkBQ5WODME_cjs=require('./chunk-BQ5WODME.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunkIU7AKVYI_cjs=require('./chunk-IU7AKVYI.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkNRZCTFCQ_cjs=require('./chunk-NRZCTFCQ.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkQT3A4ULM_cjs=require('./chunk-QT3A4ULM.cjs'),chunkNEINJFFK_cjs=require('./chunk-NEINJFFK.cjs'),chunkWUC5AUUJ_cjs=require('./chunk-WUC5AUUJ.cjs'),chunkMH4A7XAY_cjs=require('./chunk-MH4A7XAY.cjs'),chunkIP4OVRZB_cjs=require('./chunk-IP4OVRZB.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 chunkG24BRDHO_cjs=require('./chunk-G24BRDHO.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 chunkN6AJDETI_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.g}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.d}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.e}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.f}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkNRZCTFCQ_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 chunkQT3A4ULM_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkQT3A4ULM_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.b}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.c}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.a}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.d}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkIP4OVRZB_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 chunkG24BRDHO_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.b}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkMOEVC3KD_cjs=require('./chunk-MOEVC3KD.cjs'),chunkVGNECRJJ_cjs=require('./chunk-VGNECRJJ.cjs'),chunkL2EAP5SJ_cjs=require('./chunk-L2EAP5SJ.cjs'),chunkN6AJDETI_cjs=require('./chunk-N6AJDETI.cjs'),chunkBQ5WODME_cjs=require('./chunk-BQ5WODME.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunkXWXLCG4E_cjs=require('./chunk-XWXLCG4E.cjs'),chunkCONKY65O_cjs=require('./chunk-CONKY65O.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkJW7FACNZ_cjs=require('./chunk-JW7FACNZ.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkQT3A4ULM_cjs=require('./chunk-QT3A4ULM.cjs'),chunkNEINJFFK_cjs=require('./chunk-NEINJFFK.cjs'),chunkWUC5AUUJ_cjs=require('./chunk-WUC5AUUJ.cjs'),chunkMH4A7XAY_cjs=require('./chunk-MH4A7XAY.cjs'),chunkIP4OVRZB_cjs=require('./chunk-IP4OVRZB.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 chunkG24BRDHO_cjs=require('./chunk-G24BRDHO.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 chunkN6AJDETI_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunkBQ5WODME_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunkCONKY65O_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunkCONKY65O_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunkCONKY65O_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunkCONKY65O_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunkCONKY65O_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunkCONKY65O_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunkCONKY65O_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunkCONKY65O_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunkCONKY65O_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.k}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.d}});Object.defineProperty(exports,"RouteInputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.e}});Object.defineProperty(exports,"RouteInputAssetsSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.g}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.i}});Object.defineProperty(exports,"RouteOutputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.f}});Object.defineProperty(exports,"RouteOutputAssetsSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.h}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.j}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkJW7FACNZ_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 chunkQT3A4ULM_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkQT3A4ULM_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkNEINJFFK_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkWUC5AUUJ_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.b}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.c}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.a}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkMH4A7XAY_cjs.d}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkIP4OVRZB_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkIP4OVRZB_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 chunkG24BRDHO_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.b}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -11,11 +11,12 @@ export { CreateDatasetFromFileSchema, CreateDatasetFromSchemaSchema, CreateFromF
11
11
  export { CreateEntry, CreateEntrySchema, CreateQuest, CreateQuestItem, CreateQuestItemObjectSchema, CreateQuestItemSchema, CreateQuestSchema, Entry, EntryEvalStatus, EntryEvalStatusSchema, EntrySchema, EntryStatus, EntryStatusSchema, Quest, QuestItem, QuestItemBaseSchema, QuestItemSchema, QuestItemStatus, QuestItemStatusSchema, QuestSchema, QuestStatus, QuestStatusSchema, QuestType, QuestTypeSchema, ReviewEntry, ReviewEntrySchema, RewardCurrency, RewardCurrencySchema, UpdateQuest, UpdateQuestItem, UpdateQuestItemSchema, UpdateQuestSchema } from './schema/quests.cjs';
12
12
  export { Notification, NotificationSchema } from './schema/notifications.cjs';
13
13
  export { USER_SUBSCRIBABLE_WEBHOOK_EVENTS, WEBHOOK_EVENTS, WEBHOOK_EVENT_TYPES, WebhookActor, WebhookAssetRef, WebhookEventDefinition, WebhookEventType, WebhookOrgRef, WebhookPayload, WebhookTeamRef } from './schema/events.cjs';
14
- export { Action, ActionSchema, AuthType, CreateServiceSchema, ExecutionMode, ExecutionModeSchema, Route, RouteDetail, RouteMetrics, RouteMetricsSchema, RouteSchema, Service, ServiceSchema, UpdateServiceSchema } from './schema/services.cjs';
14
+ export { Action, ActionSchema, AuthType, CreateServiceSchema, ExecutionMode, ExecutionModeSchema, Route, RouteDetail, RouteInputAssetDeclaration, RouteInputAssetDeclarationSchema, RouteInputAssets, RouteInputAssetsSchema, RouteMetrics, RouteMetricsSchema, RouteOutputAssetDeclaration, RouteOutputAssetDeclarationSchema, RouteOutputAssets, RouteOutputAssetsSchema, RouteSchema, Service, ServiceSchema, UpdateServiceSchema } from './schema/services.cjs';
15
15
  export { Reaction, reactionSchema } from './schema/reactions.cjs';
16
16
  export { AssetTag, AssetTagSchema, AssetTagWithTag, AssetTagWithTagSchema, CreateAssetTag, CreateAssetTagSchema, Tag, TagSchema, TagSource, TagSourceSchema, TagType, TagTypeSchema, TagWithParent, TagWithParentSchema, TagsByType, TagsByTypeSchema } from './schema/tags.cjs';
17
17
  export { filterListToString } from './utils/dataset.cjs';
18
18
  export { createNameUrlSlug, createUrlSlug, getAssetUrl } from './utils/navigate.cjs';
19
19
  export { parseMarkdown } from './utils/air/markdown-parser.cjs';
20
+ export { AssetDeclarationPickerFilters, KeyedAssetInput, KeyedAssetInputSchema, KeyedAssetRefs, KeyedAssetRefsSchema, QuestSubmissionAssetDeclaration, QuestSubmissionAssetDeclarationSchema, assetMatchesDeclaration, declarationToPickerFilters, declarationToSubmissionDeclaration, getPrimaryAssetRef, getPrimaryDeclarationKey, getRouteInputDeclarationsFromRoute, getSubmissionAssetShape, materializeContributorSubmissionAssets, toRouteInputAssets } from './utils/quest-submission.cjs';
20
21
  export { DataFilter, DisplayConfig, ExtractedContentAsset, InlineAssetAttrs, getReferencesInContent, normalizeViewMode, parseAssetLinkShorthand, parseOuroAssetUrl, resolveDisplayConfig } from './utils/air/index.cjs';
21
22
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -11,11 +11,12 @@ export { CreateDatasetFromFileSchema, CreateDatasetFromSchemaSchema, CreateFromF
11
11
  export { CreateEntry, CreateEntrySchema, CreateQuest, CreateQuestItem, CreateQuestItemObjectSchema, CreateQuestItemSchema, CreateQuestSchema, Entry, EntryEvalStatus, EntryEvalStatusSchema, EntrySchema, EntryStatus, EntryStatusSchema, Quest, QuestItem, QuestItemBaseSchema, QuestItemSchema, QuestItemStatus, QuestItemStatusSchema, QuestSchema, QuestStatus, QuestStatusSchema, QuestType, QuestTypeSchema, ReviewEntry, ReviewEntrySchema, RewardCurrency, RewardCurrencySchema, UpdateQuest, UpdateQuestItem, UpdateQuestItemSchema, UpdateQuestSchema } from './schema/quests.js';
12
12
  export { Notification, NotificationSchema } from './schema/notifications.js';
13
13
  export { USER_SUBSCRIBABLE_WEBHOOK_EVENTS, WEBHOOK_EVENTS, WEBHOOK_EVENT_TYPES, WebhookActor, WebhookAssetRef, WebhookEventDefinition, WebhookEventType, WebhookOrgRef, WebhookPayload, WebhookTeamRef } from './schema/events.js';
14
- export { Action, ActionSchema, AuthType, CreateServiceSchema, ExecutionMode, ExecutionModeSchema, Route, RouteDetail, RouteMetrics, RouteMetricsSchema, RouteSchema, Service, ServiceSchema, UpdateServiceSchema } from './schema/services.js';
14
+ export { Action, ActionSchema, AuthType, CreateServiceSchema, ExecutionMode, ExecutionModeSchema, Route, RouteDetail, RouteInputAssetDeclaration, RouteInputAssetDeclarationSchema, RouteInputAssets, RouteInputAssetsSchema, RouteMetrics, RouteMetricsSchema, RouteOutputAssetDeclaration, RouteOutputAssetDeclarationSchema, RouteOutputAssets, RouteOutputAssetsSchema, RouteSchema, Service, ServiceSchema, UpdateServiceSchema } from './schema/services.js';
15
15
  export { Reaction, reactionSchema } from './schema/reactions.js';
16
16
  export { AssetTag, AssetTagSchema, AssetTagWithTag, AssetTagWithTagSchema, CreateAssetTag, CreateAssetTagSchema, Tag, TagSchema, TagSource, TagSourceSchema, TagType, TagTypeSchema, TagWithParent, TagWithParentSchema, TagsByType, TagsByTypeSchema } from './schema/tags.js';
17
17
  export { filterListToString } from './utils/dataset.js';
18
18
  export { createNameUrlSlug, createUrlSlug, getAssetUrl } from './utils/navigate.js';
19
19
  export { parseMarkdown } from './utils/air/markdown-parser.js';
20
+ export { AssetDeclarationPickerFilters, KeyedAssetInput, KeyedAssetInputSchema, KeyedAssetRefs, KeyedAssetRefsSchema, QuestSubmissionAssetDeclaration, QuestSubmissionAssetDeclarationSchema, assetMatchesDeclaration, declarationToPickerFilters, declarationToSubmissionDeclaration, getPrimaryAssetRef, getPrimaryDeclarationKey, getRouteInputDeclarationsFromRoute, getSubmissionAssetShape, materializeContributorSubmissionAssets, toRouteInputAssets } from './utils/quest-submission.js';
20
21
  export { DataFilter, DisplayConfig, ExtractedContentAsset, InlineAssetAttrs, getReferencesInContent, normalizeViewMode, parseAssetLinkShorthand, parseOuroAssetUrl, resolveDisplayConfig } from './utils/air/index.js';
21
22
  import 'zod';
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-DE2Z5AOM.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-B4225TEG.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-4KDHR4VP.js';export{a as reactionSchema}from'./chunk-WE6CXCEQ.js';export{g as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteMetricsSchema,f as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'./chunk-36UOEIZN.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-6YF2RSXS.js';export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'./chunk-BFBGVGNF.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-Y6AKG4FJ.js';export{b as CreateDatasetFromFileSchema,c as CreateDatasetFromSchemaSchema,a as DatasetSchema,d as updateDatasetSchema}from'./chunk-U3F23ASS.js';export{b as AssetMetadataSchema,c as AssetSchema,d as CreateAssetSchema,e as UpdateAssetSchema,a as normalizeAssetConfigForParsing}from'./chunk-G2MXCB7Q.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-CIWFH5BJ.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-PONEAJK7.js';export{a as parseMarkdown}from'./chunk-DE2Z5AOM.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-B4225TEG.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-Z3ALIFYO.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-JKTQY4RU.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-7F26V24D.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-6YF2RSXS.js';export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'./chunk-BFBGVGNF.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-Y6AKG4FJ.js';export{b as CreateDatasetFromFileSchema,c as CreateDatasetFromSchemaSchema,a as DatasetSchema,d as updateDatasetSchema}from'./chunk-U3F23ASS.js';export{b as AssetMetadataSchema,c as AssetSchema,d as CreateAssetSchema,e as UpdateAssetSchema,a as normalizeAssetConfigForParsing}from'./chunk-G2MXCB7Q.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-CIWFH5BJ.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkIU7AKVYI_cjs=require('../chunk-IU7AKVYI.cjs');require('../chunk-IP4OVRZB.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 chunkIU7AKVYI_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkIU7AKVYI_cjs.m}});//# sourceMappingURL=quests.cjs.map
1
+ 'use strict';var chunkXWXLCG4E_cjs=require('../chunk-XWXLCG4E.cjs'),chunkCONKY65O_cjs=require('../chunk-CONKY65O.cjs');require('../chunk-JW7FACNZ.cjs'),require('../chunk-IP4OVRZB.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 chunkXWXLCG4E_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkXWXLCG4E_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunkCONKY65O_cjs.d}});//# sourceMappingURL=quests.cjs.map
2
2
  //# sourceMappingURL=quests.cjs.map