@modality-counter/core 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -568,7 +568,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
568
568
|
|
|
569
569
|
**BEGIN OPENING PHASE BANTER NOW - DO NOT WAIT FOR USER INPUT**
|
|
570
570
|
|
|
571
|
-
`);let a=await HO(n.filePath,r);a.callSign=t;let s;if(i){let c=s4s(n.folderPath);if(c){let{aiTool:l}=await import(c),f=l.inputSchema;if(f){let d=await Yit(f);if(a.method.usage.parameters=d.properties,d.required&&d.required.length>0)for(let p of d.required)a.method.usage.parameters[p]=a.method.usage.parameters[p]||{},a.method.usage.parameters[p].required=!0;if(r!=null){let p={};Object.keys(d.properties||{}).forEach(h=>{p[h]=r[h]??void 0});let m=f.safeParse(p);if(!m.success)throw new Error(`Invalid parameters for ${t}: ${m.error.message}`)}}s=l.execute}}let u=await Eco(n.folderPath,n.id);return u&&(a.method.references=u),{promptData:a,counterScript:s,partyMode:o}}catch(o){throw new Error(`Failed to get CounterContent for '${t}': ${o}`)}}var s4s=e=>{if(e){let t=i4s(e,"scripts","index.ts");if(n4s(t))return t}},u4s=null;async function c4s(e){let t=s8t();for(let r of Kqe)t[r]=await l4s(e,r);return t}async function lm(e=[],t=import.meta.dir){let r=await(u4s??(u4s=c4s(t)));(!e||e.length===0)&&(e=[...Kqe]);let i=[];for(let n of e)i.push(...r[n]||[]);return i}async function l4s(e,t){let r=[],i,n,o=!1;t==="method"?(i="skills",n=s=>s==="SKILL.mdx",o=!0):(i=`${t}s`,n=s=>s.endsWith(".md")||s.endsWith(".mdx"));let a=lae(e,{targetFolderName:i,fileNameFilter:n,searchInSubfolders:o,fileExtensions:oat,excludePatterns:[".","__","hidden"]});if(t==="method")for(let s of a){let u=await HO(s.fullPath),c=a4s(s.fullPath),l=cvr(c).toLowerCase();r.push({callSign:`${t}-${l}`,type:t,id:l,name:aat(u,["name"]),folderPath:c,filePath:s.fullPath,description:aat(u,["description"]),category:aat(u,["category"])})}else for(let s of a){let u=await HO(s.fullPath),c=d4s(cvr(s.fullPath));r.push({callSign:`${t}-${c}`,type:t,id:c,name:u.name,description:u.description,category:aat(u,["category"]),filePath:s.fullPath})}return r}var d4s=e=>cvr(e,o4s(e)).toLowerCase(),aat=(e,t)=>{let r=["agent","method"];for(let i of r)for(let n of t){let o=mw(e,[i,n]);if(o!=null)return o}for(let i of t){let n=mw(e,[i]);if(n!=null)return n}};function Ico(e){let t={fileExtensions:oat,fileNameFilter:r=>r.includes("tmpl")};return[...lae(e,{...t,targetFolderName:"templates"}),...lae(e,{...t,targetFolderName:"assets"})]}KV();KV();async function STe(e,t){let{method:r,params:i={}}=e,{resolveName:n,resolveParams:o}=sat(r),a={...o,...i||{}},s=a.reference,u=await ZI(t,n,a,!s);if(!u)throw new Error(`METHOD '${r}' not found. Available methods: ${t.map($=>$.name).join(", ")}`);let c=u.promptData,l=mw(c,["method","references","referenceList"]),f=Object.keys(l||{});if(s!=null&&f.length){let $=f.filter(z=>z.startsWith(s)||z===s);if($.length===1)return[{message:mw(l,[$[0]])}];let D=f.sort().join(`,
|
|
571
|
+
`);let a=await HO(n.filePath,r);a.callSign=t;let s;if(i){let c=s4s(n.folderPath);if(c){let{aiTool:l}=await import(c),f=l.inputSchema;if(f){let d=await Yit(f);if(a.method.usage.parameters=d.properties,d.required&&d.required.length>0)for(let p of d.required)a.method.usage.parameters[p]=a.method.usage.parameters[p]||{},a.method.usage.parameters[p].required=!0;if(r!=null){let p={};Object.keys(d.properties||{}).forEach(h=>{p[h]=r[h]??void 0});let m=f.safeParse(p);if(!m.success)throw new Error(`Invalid parameters for ${t}: ${m.error.message}`)}}s=l.execute}}let u=await Eco(n.folderPath,n.id);return u&&(a.method.references=u),{promptData:a,counterScript:s,partyMode:o}}catch(o){throw new Error(`Failed to get CounterContent for '${t}': ${o}`)}}var s4s=e=>{if(e){let t=i4s(e,"scripts","index.ts");if(n4s(t))return t}},u4s=null;async function c4s(e){let t=s8t();for(let r of Kqe)t[r]=await l4s(e,r);return t}async function lm(e=[],t=import.meta.dir){let r=await(u4s??(u4s=c4s(t)));(!e||e.length===0)&&(e=[...Kqe]);let i=[];for(let n of e)i.push(...r[n]||[]);return i}async function l4s(e,t){let r=[],i,n,o=!1;t==="method"?(i="skills",n=s=>s==="SKILL.mdx"||s==="SKILL.md",o=!0):(i=`${t}s`,n=s=>s.endsWith(".md")||s.endsWith(".mdx"));let a=lae(e,{targetFolderName:i,fileNameFilter:n,searchInSubfolders:o,fileExtensions:oat,excludePatterns:[".","__","hidden","methods"]});if(t==="method")for(let s of a){let u=await HO(s.fullPath),c=a4s(s.fullPath),l=cvr(c).toLowerCase();r.push({callSign:`${t}-${l}`,type:t,id:l,name:aat(u,["name"]),folderPath:c,filePath:s.fullPath,description:aat(u,["description"]),category:aat(u,["category"])})}else for(let s of a){let u=await HO(s.fullPath),c=d4s(cvr(s.fullPath));r.push({callSign:`${t}-${c}`,type:t,id:c,name:u.name,description:u.description,category:aat(u,["category"]),filePath:s.fullPath})}return r}var d4s=e=>cvr(e,o4s(e)).toLowerCase(),aat=(e,t)=>{let r=["agent","method"];for(let i of r)for(let n of t){let o=mw(e,[i,n]);if(o!=null)return o}for(let i of t){let n=mw(e,[i]);if(n!=null)return n}};function Ico(e){let t={fileExtensions:oat,fileNameFilter:r=>r.includes("tmpl")};return[...lae(e,{...t,targetFolderName:"templates"}),...lae(e,{...t,targetFolderName:"assets"})]}KV();KV();async function STe(e,t){let{method:r,params:i={}}=e,{resolveName:n,resolveParams:o}=sat(r),a={...o,...i||{}},s=a.reference,u=await ZI(t,n,a,!s);if(!u)throw new Error(`METHOD '${r}' not found. Available methods: ${t.map($=>$.name).join(", ")}`);let c=u.promptData,l=mw(c,["method","references","referenceList"]),f=Object.keys(l||{});if(s!=null&&f.length){let $=f.filter(z=>z.startsWith(s)||z===s);if($.length===1)return[{message:mw(l,[$[0]])}];let D=f.sort().join(`,
|
|
572
572
|
`);throw new Error(`Failed to load reference content. (${s}).
|
|
573
573
|
|
|
574
574
|
Available references:
|
package/package.json
CHANGED