@modality-counter/core 1.4.3 → 1.4.4

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 (2) hide show
  1. package/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -700,7 +700,9 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
700
700
  ${t.cause}`),{detail:t,id:"",location:r,notes:[],pluginName:e.name,text:o}}KTa(gWt({recmaPlugins:[[Rqe,"yaml"]]}));var tOa=new l0i.NodeHtmlMarkdown({globalEscape:[/.^/,""],textReplace:[[/\\-/g,"-"]]});function Tee(e){let r=e.replace(/\r\n/g,`
701
701
  `).match(/^---\n([\s\S]+?)\n---/);if(!r||!r[1])return{};try{let i=YTa.parse(r[1]);return typeof i!="object"||i===null||Array.isArray(i)?{}:i}catch{return{}}}var $Ze=e=>{let t=XTa(Vfi(e)());return tOa.translate(t)},rOa=e=>e.endsWith(".mdx")||e.endsWith(".md")?e:`${e}.mdx`,yWt=async e=>{if(e==null)throw new Error(`Invalid file path: ${e}. Path must be relative and have .md or .mdx extension.`);let t=rOa(e),r=nOa(),i=eOa(r,t);return await iOa(i)},nOa=()=>{let e="";try{_NOT_DEFINED}catch(t){let r=t,i=r.stack?.match(/^\s*at\s+\/[^\s:()]+\.\w+:\d+:\d+$/m)?.[0].trim();if(i||(i=r.stack?.split(`
702
702
  `).filter(n=>n.indexOf("at load")!==-1).pop()),i||(i=r.stack?.split(`
703
- `).filter(n=>n.indexOf("at <anonymous>")!==-1).pop()),i){let n=/(?<path>[^\(\s]+):[0-9]+:[0-9]+/.exec(i)?.groups?.path.replace("file://","");e=QTa(n||"")}}return e||process.cwd()},iOa=async e=>{let t=await import(e);if(typeof t.default!="function")throw new Error(`MDX file at ${e} does not export a valid React component. ${t.default}`);return t.default};import{YAML as sOa}from"bun";import{jsx as d0i}from"react/jsx-runtime";function p0i(e,t){let r={...e};return bWt(e)&&bWt(t)&&Object.keys(t).forEach(i=>{Array.isArray(t[i])?Array.isArray(r[i])?r[i].push(...t[i]):r[i]=t[i]:bWt(t[i])&&i in e?r[i]=p0i(e[i],t[i]):r[i]=t[i]}),r}function bWt(e){return e&&typeof e=="object"&&!Array.isArray(e)}var m0i=async(e,t)=>{if(typeof e=="string"){let r=await yWt(e);return $Ze(d0i(r,{...t}))}else return $Ze(d0i(e,{...t}))},lC=async(e,t)=>{let r=await m0i(e,t),i=g0i(r,!0);if(typeof e=="string"){let n=f0i(e,"utf-8"),o=Tee(n);Object.assign(i,o)}return i};function cOa(e){try{let t=__dirname||aOa(__filename),r=oOa(t,"prompts",e);return f0i(r,"utf-8")}catch(t){throw console.error(`Failed to read prompt file: ${e}`,t),new Error(`Could not load prompt: ${e}`)}}function h0i(e){let t=/```(\w+)?\n?([\s\S]*?)\n?```/g,r=[],i;for(;(i=t.exec(e))!==null;)r.push({language:i[1]?.toLowerCase().trim()||"",code:i[2].trim()});return r}function g0i(e,t){let r=h0i(e).filter(i=>i.language==="yaml"||i.language==="yml");return t?r.reduce((i,n)=>{let o=sOa.parse(n.code);return p0i(i,o)},{}):r}import{existsSync as GLs}from"fs";import{join as KLs,basename as Yxr,extname as YLs,dirname as XLs}from"path";var AZe=["persona","method","workflow"],y0i=Re.object({topic:Re.string().describe("The topic for the Counter to discuss and debate"),context:Re.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:Re.array(Re.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:Re.array(Re.string()).optional().describe("CRITICAL: Array of hero names or call signs already active in current session - prevents duplicate deployment and maintains session continuity. Use when adding heroes to existing active sessions.")}).describe("Start a party mode discussion with all Counter heroes"),b0i=Re.object({method:Re.string().describe("The method name to execute"),params:Re.preprocess(e=>typeof e=="string"?JSON.parse(e):e,Re.record(Re.string(),Re.any())).optional().describe("Parameters for the method")}),v0i=Re.object({callSign:Re.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),x0i=Re.object({name:Re.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration"),_0i=Re.object({types:Re.array(Re.enum(AZe)).default(["persona"]).describe("Array of resource types to filter by. Defaults to ['persona'] for hero listings")}).describe("Get Counter resources filtered by type");kco();var Bvr=(e,t)=>(t&&Object.entries(e).forEach(([r,i])=>{let n=i.name!=null?i.name:r,{inputSchema:o,...a}=i;t.addTool({...a,parameters:o,name:n})}),e);DW();DW();var Nqc=300*1e3,Rqc={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};DW();var qLs=function(t){var r,i=(r=(t??"")[0])===null||r===void 0?void 0:r.toUpperCase();return i?i+t.slice(1):null},$mo=qLs;var BLs={code:["change","modify","develop","update","implement","add","remove","fix","improve"],"code-verify":["check","code-test"],"fix-bun-test":["bun-test"],"fresh-eyes-review":["review"],"counter-manager":["method-manager"],presentation:["ppt"],"daily-planner":["daily"],assemble:["help"],"business-edm":["b2b"],"transform-narrative":["write"],"persuade-convert":["sell"],"technical-engage":["blog"],"task-decomposer":["atomic"],"content-intelligence":["content","audit","audience"],"visual-craft":["image"],"get-cursor-codesymbol":["cursor"],"fomo-retail-investor":["fomo"],"crisis-response":["sos"]},ZLs={change:{method:"code"},modify:{method:"code"},develop:{method:"code"},update:{method:"code"},implement:{method:"code"},add:{method:"code"},remove:{method:"code"},fix:{method:"code"},improve:{method:"code"},check:{method:"code-verify"},"code-test":{method:"code-verify"},"bun-test":{method:"fix-bun-test"},review:{method:"fresh-eyes-review"},"method-manager":{method:"counter-manager",parameters:{"component-type":"method"}},daily:{method:"daily-planner",parameters:{action:"now"}},atomic:{method:"task-decomposer",parameters:{action:"ai-first"}},ppt:{method:"presentation"},help:{method:"assemble"},b2b:{method:"business-edm"},write:{method:"transform-narrative"},sell:{method:"persuade-convert"},blog:{method:"technical-engage"},content:{method:"content-intelligence",parameters:{action:"comprehensive"}},audit:{method:"content-intelligence",parameters:{action:"persuasion"}},audience:{method:"content-intelligence",parameters:{action:"audience"}},image:{method:"visual-craft"},cursor:{method:"get-cursor-codesymbol"},fomo:{method:"fomo-retail-investor"},sos:{method:"crisis-response"}},Amo=e=>BLs[e]||[],Dst=e=>ZLs[e];var Kxr={dev:"JAMES",developer:"JAMES",engineer:"JAMES",code:"JAMES",implementation:"JAMES",strategy:"FRIDAY",analyst:"FRIDAY",intel:"FRIDAY",research:"FRIDAY",po:"SARAH",design:"WANDA",designer:"WANDA",ux:"WANDA",ui:"WANDA",finance:"PEPPER",financial:"PEPPER",business:"PEPPER",cfo:"PEPPER"};function Pmo(e){let t=e.toLowerCase().trim();return Kxr[t]?.toLowerCase()||t}async function Dmo(){try{return(await ym(["persona"])).map(t=>$mo(t.name))}catch(e){return console.error("Failed to get hero names:",e),[]}}DW();import{existsSync as VLs,readFileSync as WLs}from"fs";import{basename as Nmo,dirname as HLs,join as JLs}from"path";async function IOe(e){let t={};if(!e||!VLs(e))return t;try{let r=HLs(e),i=Nmo(e),n=Yae(r,{targetFolderName:i,fileExtensions:Nst,fileNameFilter:o=>!o.toLowerCase().includes("readme")&&!o.toLowerCase().includes("summary"),excludePatterns:[".","_"]});for(let o of n)try{let a=WLs(o.fullPath,"utf-8"),s=Tee(a),c=Nmo(o.fullPath),u=s.description??"",l=s.name;t[c]={description:u,name:l,content:a}}catch(a){console.warn(`Failed to read ${o.fullPath}:`,a)}}catch(r){console.warn("Failed to scan references directory:",r)}return t}function Rmo(e,t=`${DD}({method: "*${e}", params: {reference: "<reference-name>"}})`){return`These references are NOT files on disk \u2014 they are server-side content. MANDATORY: If the user's task matches any reference by name or description, load it BEFORE answering, planning, or editing files by calling: \`${t}\` where \`<reference-name>\` is copied verbatim from the list below, including the .md extension.`}function Mmo(e){return Object.entries(e).map(([t,r])=>`\`${t}\`${r.name?` (${r.name})`:""}: ${r.description}`)}function zmo(e,t,r){return[Rmo(t,r),Mmo(e).map(i=>`- ${i}`).join(`
703
+ `).filter(n=>n.indexOf("at <anonymous>")!==-1).pop()),i){let n=/(?<path>[^\(\s]+):[0-9]+:[0-9]+/.exec(i)?.groups?.path.replace("file://","");e=QTa(n||"")}}return e||process.cwd()},iOa=async e=>{let t=await import(e);if(typeof t.default!="function")throw new Error(`MDX file at ${e} does not export a valid React component. ${t.default}`);return t.default};import{YAML as sOa}from"bun";import{jsx as d0i}from"react/jsx-runtime";function p0i(e,t){let r={...e};return bWt(e)&&bWt(t)&&Object.keys(t).forEach(i=>{Array.isArray(t[i])?Array.isArray(r[i])?r[i].push(...t[i]):r[i]=t[i]:bWt(t[i])&&i in e?r[i]=p0i(e[i],t[i]):r[i]=t[i]}),r}function bWt(e){return e&&typeof e=="object"&&!Array.isArray(e)}var m0i=async(e,t)=>{if(typeof e=="string"){let r=await yWt(e);return $Ze(d0i(r,{...t}))}else return $Ze(d0i(e,{...t}))},lC=async(e,t)=>{let r=await m0i(e,t),i=g0i(r,!0);if(typeof e=="string"){let n=f0i(e,"utf-8"),o=Tee(n);Object.assign(i,o)}return i};function cOa(e){try{let t=__dirname||aOa(__filename),r=oOa(t,"prompts",e);return f0i(r,"utf-8")}catch(t){throw console.error(`Failed to read prompt file: ${e}`,t),new Error(`Could not load prompt: ${e}`)}}function h0i(e){let t=/```(\w+)?\n?([\s\S]*?)\n?```/g,r=[],i;for(;(i=t.exec(e))!==null;)r.push({language:i[1]?.toLowerCase().trim()||"",code:i[2].trim()});return r}function g0i(e,t){let r=h0i(e).filter(i=>i.language==="yaml"||i.language==="yml");return t?r.reduce((i,n)=>{let o=sOa.parse(n.code);return p0i(i,o)},{}):r}import{existsSync as GLs}from"fs";import{join as KLs,basename as Yxr,extname as YLs,dirname as XLs}from"path";var AZe=["persona","method","workflow"],y0i=Re.object({topic:Re.string().describe("The topic for the Counter to discuss and debate"),context:Re.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:Re.array(Re.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:Re.array(Re.string()).optional().describe("CRITICAL: Array of hero names or call signs already active in current session - prevents duplicate deployment and maintains session continuity. Use when adding heroes to existing active sessions.")}).describe("Start a party mode discussion with all Counter heroes"),b0i=Re.object({method:Re.string().describe("The method name to execute"),params:Re.preprocess(e=>typeof e=="string"?JSON.parse(e):e,Re.record(Re.string(),Re.any())).optional().describe("Parameters for the method")}),v0i=Re.object({callSign:Re.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),x0i=Re.object({name:Re.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration"),_0i=Re.object({types:Re.array(Re.enum(AZe)).default(["persona"]).describe("Array of resource types to filter by. Defaults to ['persona'] for hero listings")}).describe("Get Counter resources filtered by type");kco();var Bvr=(e,t)=>(t&&Object.entries(e).forEach(([r,i])=>{let n=i.name!=null?i.name:r,{inputSchema:o,...a}=i;t.addTool({...a,parameters:o,name:n})}),e);DW();DW();var Nqc=300*1e3,Rqc={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};DW();var qLs=function(t){var r,i=(r=(t??"")[0])===null||r===void 0?void 0:r.toUpperCase();return i?i+t.slice(1):null},$mo=qLs;var BLs={code:["change","modify","develop","update","implement","add","remove","fix","improve"],"code-verify":["check","code-test"],"fix-bun-test":["bun-test"],"fresh-eyes-review":["review"],"counter-manager":["method-manager"],presentation:["ppt"],"daily-planner":["daily"],assemble:["help"],"business-edm":["b2b"],"transform-narrative":["write"],"persuade-convert":["sell"],"technical-engage":["blog"],"task-decomposer":["atomic"],"content-intelligence":["content","audit","audience"],"visual-craft":["image"],"get-cursor-codesymbol":["cursor"],"fomo-retail-investor":["fomo"],"crisis-response":["sos"]},ZLs={change:{method:"code"},modify:{method:"code"},develop:{method:"code"},update:{method:"code"},implement:{method:"code"},add:{method:"code"},remove:{method:"code"},fix:{method:"code"},improve:{method:"code"},check:{method:"code-verify"},"code-test":{method:"code-verify"},"bun-test":{method:"fix-bun-test"},review:{method:"fresh-eyes-review"},"method-manager":{method:"counter-manager",parameters:{"component-type":"method"}},daily:{method:"daily-planner",parameters:{action:"now"}},atomic:{method:"task-decomposer",parameters:{action:"ai-first"}},ppt:{method:"presentation"},help:{method:"assemble"},b2b:{method:"business-edm"},write:{method:"transform-narrative"},sell:{method:"persuade-convert"},blog:{method:"technical-engage"},content:{method:"content-intelligence",parameters:{action:"comprehensive"}},audit:{method:"content-intelligence",parameters:{action:"persuasion"}},audience:{method:"content-intelligence",parameters:{action:"audience"}},image:{method:"visual-craft"},cursor:{method:"get-cursor-codesymbol"},fomo:{method:"fomo-retail-investor"},sos:{method:"crisis-response"}},Amo=e=>BLs[e]||[],Dst=e=>ZLs[e];var Kxr={dev:"JAMES",developer:"JAMES",engineer:"JAMES",code:"JAMES",implementation:"JAMES",strategy:"FRIDAY",analyst:"FRIDAY",intel:"FRIDAY",research:"FRIDAY",po:"SARAH",design:"WANDA",designer:"WANDA",ux:"WANDA",ui:"WANDA",finance:"PEPPER",financial:"PEPPER",business:"PEPPER",cfo:"PEPPER"};function Pmo(e){let t=e.toLowerCase().trim();return Kxr[t]?.toLowerCase()||t}async function Dmo(){try{return(await ym(["persona"])).map(t=>$mo(t.name))}catch(e){return console.error("Failed to get hero names:",e),[]}}DW();import{existsSync as VLs,readFileSync as WLs}from"fs";import{basename as Nmo,dirname as HLs,join as JLs}from"path";async function IOe(e){let t={};if(!e||!VLs(e))return t;try{let r=HLs(e),i=Nmo(e),n=Yae(r,{targetFolderName:i,fileExtensions:Nst,fileNameFilter:o=>!o.toLowerCase().includes("readme")&&!o.toLowerCase().includes("summary"),excludePatterns:[".","_"]});for(let o of n)try{let a=WLs(o.fullPath,"utf-8"),s=Tee(a),c=Nmo(o.fullPath),u=s.description??"",l=s.name;t[c]={description:u,name:l,content:a}}catch(a){console.warn(`Failed to read ${o.fullPath}:`,a)}}catch(r){console.warn("Failed to scan references directory:",r)}return t}function Rmo(e,t=`${DD}({method: "*${e}", params: {reference: "<reference-name>"}})`){return`These references are content you load on demand, NOT local files for you to open \u2014 do NOT search for or read them with any file or search tool; the method call below is the ONLY supported way to load their content. MANDATORY: if the user's task matches any reference by name or description, load it BEFORE answering, planning, or editing by calling the method with ONLY a \`reference\` parameter:
704
+ \`${t}\`
705
+ Rules: (1) \`reference\` is the ONLY parameter this method reads; every other key, and the raw request text, is ignored \u2014 so the reference name goes in \`reference\` and nowhere else. (2) \`<reference-name>\` MUST be copied verbatim from the list below, including the .md extension. (3) Make this call FIRST, before any other tool or search.`}function Mmo(e){return Object.entries(e).map(([t,r])=>`\`${t}\`${r.name?` (${r.name})`:""}: ${r.description}`)}function zmo(e,t,r){return[Rmo(t,r),Mmo(e).map(i=>`- ${i}`).join(`
704
706
  `)]}async function Fmo(e,t,r){if(!e)return;let i=await IOe(JLs(e,"references"));if(!(!i||Object.keys(i).length===0))return{referenceInstruction:Rmo(t,r?.buildInvocation?.(t)),referenceItems:Mmo(i),referenceList:i}}var Nst=[".md",".mdx"],Mst=(e,t="method")=>{let r=(e.startsWith("*")?e.slice(1):e).trim().toLowerCase(),i=`${t}-`;if(t==="method"){let n=Dst(r),o=n?.parameters,a=`${i}${n?.method||r}`;return{resolveParams:o,resolveName:a}}else return{resolveName:r.startsWith(i)?r:`${t}-${r}`}};async function sT(e,t,r,i,n){let o=e.find(a=>a.callSign===t.trim());try{if(!o)return!1;let a;r?.partyMode&&(a=`**PARTY MODE ACTIVE - ENGAGE OPENING PHASE PROTOCOLS NOW!**
705
707
 
706
708
  **ACTIVE HEROES: ${r.activeHeroes||"UNKNOWN"}**
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.3",
2
+ "version": "1.4.4",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",