@mytheo-my/portfolio 1.0.39 → 1.0.40

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/cli.js +32 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -118,14 +118,43 @@ return fn.apply(this, arguments)
118
118
  - Submits user's answers to the profile questions
119
119
  - Stores answers in MYTHEO system
120
120
  - Completes the profile onboarding step
121
- - Returns the recommended portfolio ID (port_id) for use in subsequent calls
122
121
 
123
122
  ## When to use this tool:
124
- - After user has answered all 5 profile questions.
123
+ - After user has answered all profile questions from get_profile_questions
125
124
  - User must provide answers to all 5 questions
126
125
 
126
+ ## Input Requirements:
127
+
128
+ **profileAnswer** (REQUIRED): Array of answers
129
+ - Must be an array with 5 items (one for each question)
130
+ - Each item must have:
131
+ - questionId (number): The question ID (1-5)
132
+ - answer (string): User's answer
133
+
134
+ ## Answer Format:
135
+ You need help user to map the number of string to the answer if required.
136
+ ### Example
137
+ Question 1 (AGE): Numeric value as string (e.g., "30")
138
+ Question 2 (RETIRED): "1" (No) or "2" (Yes)
139
+ Question 3 (TOTASSET): "1" (<100k), "2" (100k-300k), or "3" (>300k)
140
+
127
141
  ## Important Notes:
128
- - profileGrpId and profileVersionNo are handled internally`,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 nT(a){if(!a)return A("Missing profileAnswer",Oo.MISSING_ANSWERS);if(!Array.isArray(a))return A("Invalid profileAnswer format",Oo.INVALID_ANSWERS_FORMAT);if(a.length===0)return A("Empty profileAnswer",Oo.EMPTY_ANSWERS);for(let e of a)if(typeof e.questionId!="number"||typeof e.answer!="string")return A("Invalid answer format",Oo.INVALID_ANSWER_FORMAT);return null}async function bc(a){try{let e=a,i=nT(e.profileAnswer);if(i)return i;let n=e.profileGrpId||"",o=e.profileVersionNo||"",{profileAnswer:s}=e;return await Z.submitProfileAnswers(n,o,s),X({message:"Your **Profile** has been created successfully!",suggestion:"Next, you can select a portfolio to view its allocation."})}catch(e){let i=e instanceof Error?e.message:"Unknown error occurred";return A("Failed to submit profile answers",i)}}var oT={MISSING_PRODUCT_ID:"product_id is required"},zo={name:"show_portfolio_weights",definition:{title:"Show Portfolio Weights",description:`Get portfolio asset allocation weights.
142
+ - profileGrpId and profileVersionNo are handled internally and should be left blank
143
+ - Do not ask user for these values
144
+
145
+ ## Example Usage:
146
+
147
+ User provides answers: Age 30, Not retired, Assets 100k-300k, Medium risk, 3-5 years investment
148
+ AI: [Calls tool with:]
149
+ {
150
+ "profileAnswer": [
151
+ { "questionId": 1, "answer": "30" },
152
+ { "questionId": 2, "answer": "1" },
153
+ { "questionId": 3, "answer": "2" },
154
+ { "questionId": 4, "answer": "3" },
155
+ { "questionId": 5, "answer": "2" }
156
+ ]
157
+ }`,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 nT(a){if(!a)return A("Missing profileAnswer",Oo.MISSING_ANSWERS);if(!Array.isArray(a))return A("Invalid profileAnswer format",Oo.INVALID_ANSWERS_FORMAT);if(a.length===0)return A("Empty profileAnswer",Oo.EMPTY_ANSWERS);for(let e of a)if(typeof e.questionId!="number"||typeof e.answer!="string")return A("Invalid answer format",Oo.INVALID_ANSWER_FORMAT);return null}async function bc(a){try{let e=a,i=nT(e.profileAnswer);if(i)return i;let n=e.profileGrpId||"",o=e.profileVersionNo||"",{profileAnswer:s}=e;return await Z.submitProfileAnswers(n,o,s),X({message:"Your **Profile** has been created successfully!",suggestion:"Next, you can select a portfolio to view its allocation."})}catch(e){let i=e instanceof Error?e.message:"Unknown error occurred";return A("Failed to submit profile answers",i)}}var oT={MISSING_PRODUCT_ID:"product_id is required"},zo={name:"show_portfolio_weights",definition:{title:"Show Portfolio Weights",description:`Get portfolio asset allocation weights.
129
158
 
130
159
  ## What this tool does:
131
160
  - Retrieves the asset allocation breakdown for a specific portfolio
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mytheo-my/portfolio",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "nx": {
5
5
  "name": "portfolio",
6
6
  "targets": {