@mytheo-my/portfolio 1.0.37 → 1.0.38
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/cli.js +2 -15
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -121,25 +121,12 @@ return fn.apply(this, arguments)
|
|
|
121
121
|
- Returns the recommended portfolio ID (port_id) for use in subsequent calls
|
|
122
122
|
|
|
123
123
|
## When to use this tool:
|
|
124
|
-
- After user has answered all profile questions
|
|
124
|
+
- After user has answered all 5 profile questions.
|
|
125
125
|
- User must provide answers to all 5 questions
|
|
126
126
|
|
|
127
|
-
## Input Requirements:
|
|
128
|
-
|
|
129
|
-
**profileAnswer** (REQUIRED): Array of answers with 5 items (one for each question)
|
|
130
|
-
- Each item must have questionId (number) and answer (string)
|
|
131
|
-
|
|
132
|
-
## Answer Format:
|
|
133
|
-
|
|
134
|
-
Question 1 (AGE): Numeric value as string (e.g., "30")
|
|
135
|
-
Question 2 (RETIRED): "1" (No) or "2" (Yes)
|
|
136
|
-
Question 3 (TOTASSET): "1" (<100k), "2" (100k-300k), or "3" (>300k)
|
|
137
|
-
Question 4 (RISK): "1" (Low), "3" (Medium), or "5" (High)
|
|
138
|
-
Question 5 (INVPERIOD): "1" (<3 years), "2" (3-5 years), "3" (6-10 years), or "4" (>10 years)
|
|
139
|
-
|
|
140
127
|
## Important Notes:
|
|
141
128
|
- profileGrpId and profileVersionNo are handled internally
|
|
142
|
-
- The returned port_id will be used in get_portfolio_weights`,inputSchema:{type:"object",properties:{profileAnswer:{type:"array",description:"Array of answers (REQUIRED)",items:{type:"object",properties:{questionId:{type:"number",description:"Question ID (1-5)"},answer:{type:"string",description:"User answer as string"}},required:["questionId","answer"]}},metadata:{type:"object",description:"REQUIRED: Metadata for internal processing (provided by system, not user-facing). MUST be included if available from the system.",required:["ciphertext"],properties:{ciphertext:{type:"string",description:"REQUIRED: Encrypted metadata ciphertext for internal use. MUST be included if metadata is available."}}}},required:["profileAnswer","metadata"]}}};function bT(a){if(!a)return E("Missing profileAnswer",Fo.MISSING_ANSWERS);if(!Array.isArray(a))return E("Invalid profileAnswer format",Fo.INVALID_ANSWERS_FORMAT);if(a.length===0)return E("Empty profileAnswer",Fo.EMPTY_ANSWERS);for(let e of a)if(typeof e.questionId!="number"||typeof e.answer!="string")return E("Invalid answer format",Fo.INVALID_ANSWER_FORMAT);return null}async function Ec(a){try{let e=a,i=bT(e.profileAnswer);if(i)return i;let n=e.profileGrpId||"",o=e.profileVersionNo||"",{profileAnswer:s}=e,t=await L.submitProfileAnswers(n,o,s);return N({message:"Profile
|
|
129
|
+
- The returned port_id will be used in get_portfolio_weights and do not mention it to user`,inputSchema:{type:"object",properties:{profileAnswer:{type:"array",description:"Array of answers (REQUIRED)",items:{type:"object",properties:{questionId:{type:"number",description:"Question ID (1-5)"},answer:{type:"string",description:"User answer as string"}},required:["questionId","answer"]}},metadata:{type:"object",description:"REQUIRED: Metadata for internal processing (provided by system, not user-facing). MUST be included if available from the system.",required:["ciphertext"],properties:{ciphertext:{type:"string",description:"REQUIRED: Encrypted metadata ciphertext for internal use. MUST be included if metadata is available."}}}},required:["profileAnswer","metadata"]}}};function bT(a){if(!a)return E("Missing profileAnswer",Fo.MISSING_ANSWERS);if(!Array.isArray(a))return E("Invalid profileAnswer format",Fo.INVALID_ANSWERS_FORMAT);if(a.length===0)return E("Empty profileAnswer",Fo.EMPTY_ANSWERS);for(let e of a)if(typeof e.questionId!="number"||typeof e.answer!="string")return E("Invalid answer format",Fo.INVALID_ANSWER_FORMAT);return null}async function Ec(a){try{let e=a,i=bT(e.profileAnswer);if(i)return i;let n=e.profileGrpId||"",o=e.profileVersionNo||"",{profileAnswer:s}=e,t=await L.submitProfileAnswers(n,o,s);return N({message:"Your **Profile** created successfully!",suggestion:"Next, you can select a portfolio to view its allocation.",port_id_for_internal_use:t?.portId})}catch(e){let i=e instanceof Error?e.message:"Unknown error occurred";return E("Failed to submit profile answers",i)}}var Tc={MISSING_PORT_ID:"port_id is required",MISSING_PRODUCT_ID:"product_id is required",INVALID_PORT_ID:"port_id must be a positive number"},Uo={name:"get_portfolio_weights",definition:{title:"Get Portfolio Weights",description:`Get portfolio asset allocation weights.
|
|
143
130
|
|
|
144
131
|
## What this tool does:
|
|
145
132
|
- Retrieves the asset allocation breakdown for a specific portfolio
|