@modality-counter/core 1.3.0 → 1.3.1
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
CHANGED
|
@@ -700,7 +700,7 @@ 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}}qTa(hWt({recmaPlugins:[[Nqe,"yaml"]]}));var HTa=new u0i.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=BTa.parse(r[1]);return typeof i!="object"||i===null||Array.isArray(i)?{}:i}catch{return{}}}var CZe=e=>{let t=ZTa(Zfi(e)());return HTa.translate(t)},JTa=e=>e.endsWith(".mdx")||e.endsWith(".md")?e:`${e}.mdx`,gWt=async e=>{if(e==null)throw new Error(`Invalid file path: ${e}. Path must be relative and have .md or .mdx extension.`);let t=JTa(e),r=GTa(),i=WTa(r,t);return await KTa(i)},GTa=()=>{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=VTa(n||"")}}return e||process.cwd()},KTa=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 QTa}from"bun";import{jsx as l0i}from"react/jsx-runtime";function f0i(e,t){let r={...e};return yWt(e)&&yWt(t)&&Object.keys(t).forEach(i=>{Array.isArray(t[i])?Array.isArray(r[i])?r[i].push(...t[i]):r[i]=t[i]:yWt(t[i])&&i in e?r[i]=f0i(e[i],t[i]):r[i]=t[i]}),r}function yWt(e){return e&&typeof e=="object"&&!Array.isArray(e)}var p0i=async(e,t)=>{if(typeof e=="string"){let r=await gWt(e);return CZe(l0i(r,{...t}))}else return CZe(l0i(e,{...t}))},lC=async(e,t)=>{let r=await p0i(e,t),i=h0i(r,!0);if(typeof e=="string"){let n=d0i(e,"utf-8"),o=Tee(n);Object.assign(i,o)}return i};function eOa(e){try{let t=__dirname||XTa(__filename),r=YTa(t,"prompts",e);return d0i(r,"utf-8")}catch(t){throw console.error(`Failed to read prompt file: ${e}`,t),new Error(`Could not load prompt: ${e}`)}}function m0i(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 h0i(e,t){let r=m0i(e).filter(i=>i.language==="yaml"||i.language==="yml");return t?r.reduce((i,n)=>{let o=QTa.parse(n.code);return f0i(i,o)},{}):r}import{existsSync as ULs}from"fs";import{join as qLs,basename as Kxr,extname as BLs,dirname as ZLs}from"path";var $Ze=["persona","method","workflow"],g0i=Ae.object({topic:Ae.string().describe("The topic for the Counter to discuss and debate"),context:Ae.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:Ae.array(Ae.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:Ae.array(Ae.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"),y0i=Ae.object({method:Ae.string().describe("The method name to execute"),params:Ae.preprocess(e=>typeof e=="string"?JSON.parse(e):e,Ae.record(Ae.string(),Ae.any())).optional().describe("Parameters for the method")}),b0i=Ae.object({callSign:Ae.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),v0i=Ae.object({name:Ae.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration"),x0i=Ae.object({types:Ae.array(Ae.enum($Ze)).default(["persona"]).describe("Array of resource types to filter by. Defaults to ['persona'] for hero listings")}).describe("Get Counter resources filtered by type");wco();var qvr=(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 Tqc=300*1e3,Oqc={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};DW();var NLs=function(t){var r,i=(r=(t??"")[0])===null||r===void 0?void 0:r.toUpperCase();return i?i+t.slice(1):null},Cmo=NLs;var RLs={code:["change","modify","develop","update","implement","add","remove","fix","improve"],"code-verify":["check","code-test"],"fix-bun-test":["bun-test"],"counter-manager":["method-manager"],presentation:["ppt"],"daily-planner":["daily"],
|
|
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=VTa(n||"")}}return e||process.cwd()},KTa=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 QTa}from"bun";import{jsx as l0i}from"react/jsx-runtime";function f0i(e,t){let r={...e};return yWt(e)&&yWt(t)&&Object.keys(t).forEach(i=>{Array.isArray(t[i])?Array.isArray(r[i])?r[i].push(...t[i]):r[i]=t[i]:yWt(t[i])&&i in e?r[i]=f0i(e[i],t[i]):r[i]=t[i]}),r}function yWt(e){return e&&typeof e=="object"&&!Array.isArray(e)}var p0i=async(e,t)=>{if(typeof e=="string"){let r=await gWt(e);return CZe(l0i(r,{...t}))}else return CZe(l0i(e,{...t}))},lC=async(e,t)=>{let r=await p0i(e,t),i=h0i(r,!0);if(typeof e=="string"){let n=d0i(e,"utf-8"),o=Tee(n);Object.assign(i,o)}return i};function eOa(e){try{let t=__dirname||XTa(__filename),r=YTa(t,"prompts",e);return d0i(r,"utf-8")}catch(t){throw console.error(`Failed to read prompt file: ${e}`,t),new Error(`Could not load prompt: ${e}`)}}function m0i(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 h0i(e,t){let r=m0i(e).filter(i=>i.language==="yaml"||i.language==="yml");return t?r.reduce((i,n)=>{let o=QTa.parse(n.code);return f0i(i,o)},{}):r}import{existsSync as ULs}from"fs";import{join as qLs,basename as Kxr,extname as BLs,dirname as ZLs}from"path";var $Ze=["persona","method","workflow"],g0i=Ae.object({topic:Ae.string().describe("The topic for the Counter to discuss and debate"),context:Ae.string().optional().describe("Optional additional context or background for the discussion"),recommendedHeroes:Ae.array(Ae.string()).optional().describe("Optional array of recommended hero names or call signs to prioritize for the discussion"),deployedHeroes:Ae.array(Ae.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"),y0i=Ae.object({method:Ae.string().describe("The method name to execute"),params:Ae.preprocess(e=>typeof e=="string"?JSON.parse(e):e,Ae.record(Ae.string(),Ae.any())).optional().describe("Parameters for the method")}),b0i=Ae.object({callSign:Ae.string().describe("The callSign to deploy (e.g., 'SARAH', 'JAMES')")}).describe("Deploy a specific Counter hero persona"),v0i=Ae.object({name:Ae.string().describe("The workflow identifier to deploy (e.g., 'team-architect')")}).describe("Execute a specific Counter workflow for multi-step task orchestration"),x0i=Ae.object({types:Ae.array(Ae.enum($Ze)).default(["persona"]).describe("Array of resource types to filter by. Defaults to ['persona'] for hero listings")}).describe("Get Counter resources filtered by type");wco();var qvr=(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 Tqc=300*1e3,Oqc={initialize:1800*1e3,"tools/list":300*1e3,"resources/list":60*1e3,"prompts/list":300*1e3};DW();var NLs=function(t){var r,i=(r=(t??"")[0])===null||r===void 0?void 0:r.toUpperCase();return i?i+t.slice(1):null},Cmo=NLs;var RLs={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"]},MLs={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"}},$mo=e=>RLs[e]||[],Pst=e=>MLs[e];var Gxr={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 Amo(e){let t=e.toLowerCase().trim();return Gxr[t]?.toLowerCase()||t}async function Pmo(){try{return(await ym(["persona"])).map(t=>Cmo(t.name))}catch(e){return console.error("Failed to get hero names:",e),[]}}DW();import{existsSync as zLs,readFileSync as FLs}from"fs";import{basename as Dmo,dirname as jLs}from"path";async function LLs(e){let t={};if(!e||!zLs(e))return t;try{let r=jLs(e),i=Dmo(e),n=Yae(r,{targetFolderName:i,fileExtensions:Dst,fileNameFilter:o=>!o.toLowerCase().includes("readme")&&!o.toLowerCase().includes("summary"),excludePatterns:[".","_"]});for(let o of n)try{let a=FLs(o.fullPath,"utf-8"),s=Tee(a),c=Dmo(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}async function Nmo(e,t){if(!e)return;let r=await LLs(e+"/references");if(!r||Object.keys(r).length===0)return;let i=Object.entries(r).map(([n,o])=>`- ${n}: ${o.description||""}`).join(`
|
|
704
704
|
|
|
705
705
|
`);return{referenceInstructions:[`Review these available references. MANDATORY: If the user's task matches any reference by filename, name, or description, load the relevant reference BEFORE answering, planning, or editing files using: ${_5}(method: "*${t}", params: {reference: "<filename.md>"})`,i],referenceList:r}}var Dst=[".md",".mdx"],Rst=(e,t="method")=>{let r=(e.startsWith("*")?e.slice(1):e).trim().toLowerCase(),i=`${t}-`;if(t==="method"){let n=Pst(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){let n=e.find(o=>o.callSign===t.trim());try{if(!n)return!1;let o;r?.partyMode&&(o=`**PARTY MODE ACTIVE - ENGAGE OPENING PHASE PROTOCOLS NOW!**
|
|
706
706
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,10 +11,11 @@ declare const METHOD_TO_ALIASES: {
|
|
|
11
11
|
readonly code: readonly ["change", "modify", "develop", "update", "implement", "add", "remove", "fix", "improve"];
|
|
12
12
|
readonly "code-verify": readonly ["check", "code-test"];
|
|
13
13
|
readonly "fix-bun-test": readonly ["bun-test"];
|
|
14
|
+
readonly "fresh-eyes-review": readonly ["review"];
|
|
14
15
|
readonly "counter-manager": readonly ["method-manager"];
|
|
15
16
|
readonly presentation: readonly ["ppt"];
|
|
16
17
|
readonly "daily-planner": readonly ["daily"];
|
|
17
|
-
readonly
|
|
18
|
+
readonly assemble: readonly ["help"];
|
|
18
19
|
readonly "business-edm": readonly ["b2b"];
|
|
19
20
|
readonly "transform-narrative": readonly ["write"];
|
|
20
21
|
readonly "persuade-convert": readonly ["sell"];
|
package/package.json
CHANGED