equilibria-mcp-server 1.0.0

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 (164) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/LICENSE +21 -0
  3. package/README.md +240 -0
  4. package/dist/builders/YAMLBuilder.d.ts +77 -0
  5. package/dist/builders/YAMLBuilder.d.ts.map +1 -0
  6. package/dist/builders/YAMLBuilder.js +251 -0
  7. package/dist/builders/YAMLBuilder.js.map +1 -0
  8. package/dist/economics/constants.d.ts +39 -0
  9. package/dist/economics/constants.d.ts.map +1 -0
  10. package/dist/economics/constants.js +46 -0
  11. package/dist/economics/constants.js.map +1 -0
  12. package/dist/economics/formulas.d.ts +19 -0
  13. package/dist/economics/formulas.d.ts.map +1 -0
  14. package/dist/economics/formulas.js +260 -0
  15. package/dist/economics/formulas.js.map +1 -0
  16. package/dist/economics/index.d.ts +9 -0
  17. package/dist/economics/index.d.ts.map +1 -0
  18. package/dist/economics/index.js +9 -0
  19. package/dist/economics/index.js.map +1 -0
  20. package/dist/economics/validators.d.ts +18 -0
  21. package/dist/economics/validators.d.ts.map +1 -0
  22. package/dist/economics/validators.js +111 -0
  23. package/dist/economics/validators.js.map +1 -0
  24. package/dist/errors/index.d.ts +172 -0
  25. package/dist/errors/index.d.ts.map +1 -0
  26. package/dist/errors/index.js +313 -0
  27. package/dist/errors/index.js.map +1 -0
  28. package/dist/formatters/index.d.ts +8 -0
  29. package/dist/formatters/index.d.ts.map +1 -0
  30. package/dist/formatters/index.js +8 -0
  31. package/dist/formatters/index.js.map +1 -0
  32. package/dist/formatters/redux.d.ts +15 -0
  33. package/dist/formatters/redux.d.ts.map +1 -0
  34. package/dist/formatters/redux.js +35 -0
  35. package/dist/formatters/redux.js.map +1 -0
  36. package/dist/formatters/yaml.d.ts +18 -0
  37. package/dist/formatters/yaml.d.ts.map +1 -0
  38. package/dist/formatters/yaml.js +40 -0
  39. package/dist/formatters/yaml.js.map +1 -0
  40. package/dist/index.d.ts +11 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +19 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/server.d.ts +14 -0
  45. package/dist/server.d.ts.map +1 -0
  46. package/dist/server.js +86 -0
  47. package/dist/server.js.map +1 -0
  48. package/dist/templates/advancedMicro.d.ts +8 -0
  49. package/dist/templates/advancedMicro.d.ts.map +1 -0
  50. package/dist/templates/advancedMicro.js +834 -0
  51. package/dist/templates/advancedMicro.js.map +1 -0
  52. package/dist/templates/consumer.d.ts +12 -0
  53. package/dist/templates/consumer.d.ts.map +1 -0
  54. package/dist/templates/consumer.js +1978 -0
  55. package/dist/templates/consumer.js.map +1 -0
  56. package/dist/templates/elasticity.d.ts +8 -0
  57. package/dist/templates/elasticity.d.ts.map +1 -0
  58. package/dist/templates/elasticity.js +500 -0
  59. package/dist/templates/elasticity.js.map +1 -0
  60. package/dist/templates/externalities.d.ts +11 -0
  61. package/dist/templates/externalities.d.ts.map +1 -0
  62. package/dist/templates/externalities.js +997 -0
  63. package/dist/templates/externalities.js.map +1 -0
  64. package/dist/templates/financeBehavioral.d.ts +8 -0
  65. package/dist/templates/financeBehavioral.d.ts.map +1 -0
  66. package/dist/templates/financeBehavioral.js +860 -0
  67. package/dist/templates/financeBehavioral.js.map +1 -0
  68. package/dist/templates/growth.d.ts +8 -0
  69. package/dist/templates/growth.d.ts.map +1 -0
  70. package/dist/templates/growth.js +740 -0
  71. package/dist/templates/growth.js.map +1 -0
  72. package/dist/templates/index.d.ts +31 -0
  73. package/dist/templates/index.d.ts.map +1 -0
  74. package/dist/templates/index.js +91 -0
  75. package/dist/templates/index.js.map +1 -0
  76. package/dist/templates/inequality.d.ts +8 -0
  77. package/dist/templates/inequality.d.ts.map +1 -0
  78. package/dist/templates/inequality.js +562 -0
  79. package/dist/templates/inequality.js.map +1 -0
  80. package/dist/templates/intertemporalMacro.d.ts +8 -0
  81. package/dist/templates/intertemporalMacro.d.ts.map +1 -0
  82. package/dist/templates/intertemporalMacro.js +550 -0
  83. package/dist/templates/intertemporalMacro.js.map +1 -0
  84. package/dist/templates/isLM.d.ts +8 -0
  85. package/dist/templates/isLM.d.ts.map +1 -0
  86. package/dist/templates/isLM.js +747 -0
  87. package/dist/templates/isLM.js.map +1 -0
  88. package/dist/templates/macro.d.ts +8 -0
  89. package/dist/templates/macro.d.ts.map +1 -0
  90. package/dist/templates/macro.js +600 -0
  91. package/dist/templates/macro.js.map +1 -0
  92. package/dist/templates/marketStructures.d.ts +11 -0
  93. package/dist/templates/marketStructures.d.ts.map +1 -0
  94. package/dist/templates/marketStructures.js +1135 -0
  95. package/dist/templates/marketStructures.js.map +1 -0
  96. package/dist/templates/newKeynesian.d.ts +8 -0
  97. package/dist/templates/newKeynesian.d.ts.map +1 -0
  98. package/dist/templates/newKeynesian.js +633 -0
  99. package/dist/templates/newKeynesian.js.map +1 -0
  100. package/dist/templates/oligopoly.d.ts +11 -0
  101. package/dist/templates/oligopoly.d.ts.map +1 -0
  102. package/dist/templates/oligopoly.js +1113 -0
  103. package/dist/templates/oligopoly.js.map +1 -0
  104. package/dist/templates/ppf.d.ts +8 -0
  105. package/dist/templates/ppf.d.ts.map +1 -0
  106. package/dist/templates/ppf.js +439 -0
  107. package/dist/templates/ppf.js.map +1 -0
  108. package/dist/templates/producer.d.ts +11 -0
  109. package/dist/templates/producer.d.ts.map +1 -0
  110. package/dist/templates/producer.js +979 -0
  111. package/dist/templates/producer.js.map +1 -0
  112. package/dist/templates/production.d.ts +8 -0
  113. package/dist/templates/production.d.ts.map +1 -0
  114. package/dist/templates/production.js +574 -0
  115. package/dist/templates/production.js.map +1 -0
  116. package/dist/templates/supplyDemand.d.ts +8 -0
  117. package/dist/templates/supplyDemand.d.ts.map +1 -0
  118. package/dist/templates/supplyDemand.js +1282 -0
  119. package/dist/templates/supplyDemand.js.map +1 -0
  120. package/dist/templates/tradeGrowth.d.ts +8 -0
  121. package/dist/templates/tradeGrowth.d.ts.map +1 -0
  122. package/dist/templates/tradeGrowth.js +637 -0
  123. package/dist/templates/tradeGrowth.js.map +1 -0
  124. package/dist/tools/index.d.ts +25 -0
  125. package/dist/tools/index.d.ts.map +1 -0
  126. package/dist/tools/index.js +54 -0
  127. package/dist/tools/index.js.map +1 -0
  128. package/dist/tools/models.d.ts +8 -0
  129. package/dist/tools/models.d.ts.map +1 -0
  130. package/dist/tools/models.js +828 -0
  131. package/dist/tools/models.js.map +1 -0
  132. package/dist/tools/output.d.ts +8 -0
  133. package/dist/tools/output.d.ts.map +1 -0
  134. package/dist/tools/output.js +236 -0
  135. package/dist/tools/output.js.map +1 -0
  136. package/dist/tools/templates.d.ts +8 -0
  137. package/dist/tools/templates.d.ts.map +1 -0
  138. package/dist/tools/templates.js +247 -0
  139. package/dist/tools/templates.js.map +1 -0
  140. package/dist/tools/validation.d.ts +8 -0
  141. package/dist/tools/validation.d.ts.map +1 -0
  142. package/dist/tools/validation.js +181 -0
  143. package/dist/tools/validation.js.map +1 -0
  144. package/dist/types/index.d.ts +187 -0
  145. package/dist/types/index.d.ts.map +1 -0
  146. package/dist/types/index.js +7 -0
  147. package/dist/types/index.js.map +1 -0
  148. package/dist/utils/cache.d.ts +99 -0
  149. package/dist/utils/cache.d.ts.map +1 -0
  150. package/dist/utils/cache.js +192 -0
  151. package/dist/utils/cache.js.map +1 -0
  152. package/dist/utils/index.d.ts +8 -0
  153. package/dist/utils/index.d.ts.map +1 -0
  154. package/dist/utils/index.js +8 -0
  155. package/dist/utils/index.js.map +1 -0
  156. package/dist/utils/logger.d.ts +128 -0
  157. package/dist/utils/logger.d.ts.map +1 -0
  158. package/dist/utils/logger.js +251 -0
  159. package/dist/utils/logger.js.map +1 -0
  160. package/dist/validation/index.d.ts +42 -0
  161. package/dist/validation/index.d.ts.map +1 -0
  162. package/dist/validation/index.js +282 -0
  163. package/dist/validation/index.js.map +1 -0
  164. package/package.json +73 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/economics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Economic Validators
3
+ *
4
+ * Validates that economic configurations make sense.
5
+ */
6
+ import type { ValidationError } from '../types/index.js';
7
+ /**
8
+ * Validate economic constraints
9
+ */
10
+ export declare function validateEconomicConstraints(config: Record<string, unknown>): ValidationError[];
11
+ /**
12
+ * Validate that equilibrium exists
13
+ */
14
+ export declare function validateEquilibriumExists(demandIntercept: number, demandSlope: number, supplyIntercept: number, supplySlope: number): {
15
+ exists: boolean;
16
+ error?: string;
17
+ };
18
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/economics/validators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,eAAe,EAAE,CAiFnB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,GAClB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA+BrC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Economic Validators
3
+ *
4
+ * Validates that economic configurations make sense.
5
+ */
6
+ /**
7
+ * Validate economic constraints
8
+ */
9
+ export function validateEconomicConstraints(config) {
10
+ const errors = [];
11
+ // Check for negative prices
12
+ if (typeof config.price === 'number' && config.price < 0) {
13
+ errors.push({
14
+ path: 'price',
15
+ message: 'Price cannot be negative',
16
+ suggestion: 'Set price to a non-negative value',
17
+ });
18
+ }
19
+ // Check for negative quantities
20
+ if (typeof config.quantity === 'number' && config.quantity < 0) {
21
+ errors.push({
22
+ path: 'quantity',
23
+ message: 'Quantity cannot be negative',
24
+ suggestion: 'Set quantity to a non-negative value',
25
+ });
26
+ }
27
+ // Check demand slope (should be negative or positive b for Qd = a - bP)
28
+ if (typeof config.demandSlope === 'number' && config.demandSlope <= 0) {
29
+ errors.push({
30
+ path: 'demandSlope',
31
+ message: 'Demand slope should be positive (for Qd = a - b*P form)',
32
+ suggestion: 'Use absolute value of slope',
33
+ });
34
+ }
35
+ // Check supply slope (should be positive)
36
+ if (typeof config.supplySlope === 'number' && config.supplySlope < 0) {
37
+ errors.push({
38
+ path: 'supplySlope',
39
+ message: 'Supply slope should be non-negative for standard supply curve',
40
+ });
41
+ }
42
+ // Check elasticity bounds
43
+ if (typeof config.elasticity === 'number') {
44
+ if (config.elasticity > 0 && config.elasticityType === 'demand') {
45
+ errors.push({
46
+ path: 'elasticity',
47
+ message: 'Price elasticity of demand is typically negative',
48
+ suggestion: 'Use negative value or absolute value notation',
49
+ });
50
+ }
51
+ }
52
+ // Check Cobb-Douglas alpha (0 < alpha < 1)
53
+ if (typeof config.alpha === 'number') {
54
+ if (config.alpha <= 0 || config.alpha >= 1) {
55
+ errors.push({
56
+ path: 'alpha',
57
+ message: 'Cobb-Douglas alpha should be between 0 and 1',
58
+ suggestion: 'Use a value like 0.3 (typical capital share)',
59
+ });
60
+ }
61
+ }
62
+ // Check saving rate (0 < s < 1)
63
+ if (typeof config.savingRate === 'number') {
64
+ if (config.savingRate <= 0 || config.savingRate >= 1) {
65
+ errors.push({
66
+ path: 'savingRate',
67
+ message: 'Saving rate should be between 0 and 1',
68
+ });
69
+ }
70
+ }
71
+ // Check depreciation rate (0 < delta < 1)
72
+ if (typeof config.depreciation === 'number') {
73
+ if (config.depreciation < 0 || config.depreciation > 1) {
74
+ errors.push({
75
+ path: 'depreciation',
76
+ message: 'Depreciation rate should be between 0 and 1',
77
+ });
78
+ }
79
+ }
80
+ return errors;
81
+ }
82
+ /**
83
+ * Validate that equilibrium exists
84
+ */
85
+ export function validateEquilibriumExists(demandIntercept, demandSlope, supplyIntercept, supplySlope) {
86
+ // For equilibrium to exist with positive Q and P:
87
+ // Q* = (a - c) / (b + d) > 0 requires a > c (demand intercept > supply intercept)
88
+ // P* = c + d * Q* > 0 is automatically satisfied if c >= 0 and Q* > 0
89
+ if (demandSlope + supplySlope === 0) {
90
+ return {
91
+ exists: false,
92
+ error: 'Parallel curves: demand and supply slopes sum to zero',
93
+ };
94
+ }
95
+ const eqQuantity = (demandIntercept - supplyIntercept) / (demandSlope + supplySlope);
96
+ if (eqQuantity <= 0) {
97
+ return {
98
+ exists: false,
99
+ error: 'No positive equilibrium quantity: demand intercept must exceed supply intercept',
100
+ };
101
+ }
102
+ const eqPrice = supplyIntercept + supplySlope * eqQuantity;
103
+ if (eqPrice < 0) {
104
+ return {
105
+ exists: false,
106
+ error: 'Equilibrium price is negative',
107
+ };
108
+ }
109
+ return { exists: true };
110
+ }
111
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/economics/validators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAA+B;IAE/B,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,4BAA4B;IAC5B,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,0BAA0B;YACnC,UAAU,EAAE,mCAAmC;SAChD,CAAC,CAAC;IAC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AAC;IAED,MAAM,OAAO,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC;IAE3D,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,OAAO;YACL,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,+BAA+B;SACvC,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Error Handling Module
3
+ *
4
+ * Provides enhanced error messages with recovery suggestions,
5
+ * error categorization, and debugging utilities.
6
+ */
7
+ import type { ValidationError } from '../types/index.js';
8
+ /**
9
+ * Error categories for better organization and handling
10
+ */
11
+ export type ErrorCategory = 'syntax' | 'reference' | 'economic' | 'schema' | 'dependency' | 'runtime' | 'configuration';
12
+ /**
13
+ * Enhanced error with additional context
14
+ */
15
+ export interface EnhancedError extends ValidationError {
16
+ category: ErrorCategory;
17
+ code: string;
18
+ recoverySteps?: string[];
19
+ examples?: string[];
20
+ documentation?: string;
21
+ }
22
+ /**
23
+ * Error codes with descriptions
24
+ */
25
+ export declare const ERROR_CODES: {
26
+ readonly E001: {
27
+ readonly code: "E001";
28
+ readonly category: "syntax";
29
+ readonly message: "Invalid expression syntax";
30
+ };
31
+ readonly E002: {
32
+ readonly code: "E002";
33
+ readonly category: "syntax";
34
+ readonly message: "Unbalanced parentheses";
35
+ };
36
+ readonly E003: {
37
+ readonly code: "E003";
38
+ readonly category: "syntax";
39
+ readonly message: "Invalid operator usage";
40
+ };
41
+ readonly E004: {
42
+ readonly code: "E004";
43
+ readonly category: "syntax";
44
+ readonly message: "Invalid function call";
45
+ };
46
+ readonly E101: {
47
+ readonly code: "E101";
48
+ readonly category: "reference";
49
+ readonly message: "Unknown parameter";
50
+ };
51
+ readonly E102: {
52
+ readonly code: "E102";
53
+ readonly category: "reference";
54
+ readonly message: "Unknown element ID";
55
+ };
56
+ readonly E103: {
57
+ readonly code: "E103";
58
+ readonly category: "reference";
59
+ readonly message: "Unknown chart ID";
60
+ };
61
+ readonly E104: {
62
+ readonly code: "E104";
63
+ readonly category: "reference";
64
+ readonly message: "Undefined variable in expression";
65
+ };
66
+ readonly E201: {
67
+ readonly code: "E201";
68
+ readonly category: "economic";
69
+ readonly message: "Invalid economic constraint";
70
+ };
71
+ readonly E202: {
72
+ readonly code: "E202";
73
+ readonly category: "economic";
74
+ readonly message: "No equilibrium exists";
75
+ };
76
+ readonly E203: {
77
+ readonly code: "E203";
78
+ readonly category: "economic";
79
+ readonly message: "Negative price or quantity";
80
+ };
81
+ readonly E204: {
82
+ readonly code: "E204";
83
+ readonly category: "economic";
84
+ readonly message: "Invalid elasticity value";
85
+ };
86
+ readonly E205: {
87
+ readonly code: "E205";
88
+ readonly category: "economic";
89
+ readonly message: "Invalid parameter range";
90
+ };
91
+ readonly E301: {
92
+ readonly code: "E301";
93
+ readonly category: "schema";
94
+ readonly message: "Missing required field";
95
+ };
96
+ readonly E302: {
97
+ readonly code: "E302";
98
+ readonly category: "schema";
99
+ readonly message: "Invalid field type";
100
+ };
101
+ readonly E303: {
102
+ readonly code: "E303";
103
+ readonly category: "schema";
104
+ readonly message: "Invalid enum value";
105
+ };
106
+ readonly E304: {
107
+ readonly code: "E304";
108
+ readonly category: "schema";
109
+ readonly message: "Value out of range";
110
+ };
111
+ readonly E401: {
112
+ readonly code: "E401";
113
+ readonly category: "dependency";
114
+ readonly message: "Circular dependency detected";
115
+ };
116
+ readonly E402: {
117
+ readonly code: "E402";
118
+ readonly category: "dependency";
119
+ readonly message: "Missing dependency";
120
+ };
121
+ readonly E501: {
122
+ readonly code: "E501";
123
+ readonly category: "runtime";
124
+ readonly message: "No document started";
125
+ };
126
+ readonly E502: {
127
+ readonly code: "E502";
128
+ readonly category: "runtime";
129
+ readonly message: "No chart selected";
130
+ };
131
+ readonly E503: {
132
+ readonly code: "E503";
133
+ readonly category: "runtime";
134
+ readonly message: "Template not found";
135
+ };
136
+ readonly E601: {
137
+ readonly code: "E601";
138
+ readonly category: "configuration";
139
+ readonly message: "Invalid configuration";
140
+ };
141
+ };
142
+ /**
143
+ * Create an enhanced error with recovery suggestions
144
+ */
145
+ export declare function createEnhancedError(code: keyof typeof ERROR_CODES, path: string, details?: string, context?: Record<string, unknown>): EnhancedError;
146
+ /**
147
+ * Format an enhanced error for display
148
+ */
149
+ export declare function formatEnhancedError(error: EnhancedError): string;
150
+ /**
151
+ * Format multiple errors for display
152
+ */
153
+ export declare function formatErrors(errors: EnhancedError[]): string;
154
+ /**
155
+ * Convert simple ValidationError to EnhancedError
156
+ */
157
+ export declare function enhanceError(error: ValidationError, code: keyof typeof ERROR_CODES, context?: Record<string, unknown>): EnhancedError;
158
+ /**
159
+ * Quick error creators for common scenarios
160
+ */
161
+ export declare const Errors: {
162
+ unknownModel: (modelId: string, closestMatch?: string) => EnhancedError;
163
+ unknownParameter: (param: string, closestMatch?: string) => EnhancedError;
164
+ noDocument: () => EnhancedError;
165
+ noChart: (chartId?: string) => EnhancedError;
166
+ invalidExpression: (expression: string, details: string) => EnhancedError;
167
+ circularDependency: (cycle: string[]) => EnhancedError;
168
+ noEquilibrium: (reason: string) => EnhancedError;
169
+ missingRequired: (field: string) => EnhancedError;
170
+ invalidRange: (field: string, value: number, min: number, max: number) => EnhancedError;
171
+ };
172
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCd,CAAC;AAEX;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,OAAO,WAAW,EAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,aAAa,CAmBf;AAsOD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CA2BhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAY5D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,OAAO,WAAW,EAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,aAAa,CASf;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;4BACO,MAAM,iBAAiB,MAAM;8BAG3B,MAAM,iBAAiB,MAAM;;wBAMnC,MAAM;oCAGM,MAAM,WAAW,MAAM;gCAG3B,MAAM,EAAE;4BAGZ,MAAM;6BAGL,MAAM;0BAGT,MAAM,SAAS,MAAM,OAAO,MAAM,OAAO,MAAM;CAEtE,CAAC"}
@@ -0,0 +1,313 @@
1
+ /**
2
+ * Error Handling Module
3
+ *
4
+ * Provides enhanced error messages with recovery suggestions,
5
+ * error categorization, and debugging utilities.
6
+ */
7
+ /**
8
+ * Error codes with descriptions
9
+ */
10
+ export const ERROR_CODES = {
11
+ // Syntax errors
12
+ E001: { code: 'E001', category: 'syntax', message: 'Invalid expression syntax' },
13
+ E002: { code: 'E002', category: 'syntax', message: 'Unbalanced parentheses' },
14
+ E003: { code: 'E003', category: 'syntax', message: 'Invalid operator usage' },
15
+ E004: { code: 'E004', category: 'syntax', message: 'Invalid function call' },
16
+ // Reference errors
17
+ E101: { code: 'E101', category: 'reference', message: 'Unknown parameter' },
18
+ E102: { code: 'E102', category: 'reference', message: 'Unknown element ID' },
19
+ E103: { code: 'E103', category: 'reference', message: 'Unknown chart ID' },
20
+ E104: { code: 'E104', category: 'reference', message: 'Undefined variable in expression' },
21
+ // Economic errors
22
+ E201: { code: 'E201', category: 'economic', message: 'Invalid economic constraint' },
23
+ E202: { code: 'E202', category: 'economic', message: 'No equilibrium exists' },
24
+ E203: { code: 'E203', category: 'economic', message: 'Negative price or quantity' },
25
+ E204: { code: 'E204', category: 'economic', message: 'Invalid elasticity value' },
26
+ E205: { code: 'E205', category: 'economic', message: 'Invalid parameter range' },
27
+ // Schema errors
28
+ E301: { code: 'E301', category: 'schema', message: 'Missing required field' },
29
+ E302: { code: 'E302', category: 'schema', message: 'Invalid field type' },
30
+ E303: { code: 'E303', category: 'schema', message: 'Invalid enum value' },
31
+ E304: { code: 'E304', category: 'schema', message: 'Value out of range' },
32
+ // Dependency errors
33
+ E401: { code: 'E401', category: 'dependency', message: 'Circular dependency detected' },
34
+ E402: { code: 'E402', category: 'dependency', message: 'Missing dependency' },
35
+ // Runtime errors
36
+ E501: { code: 'E501', category: 'runtime', message: 'No document started' },
37
+ E502: { code: 'E502', category: 'runtime', message: 'No chart selected' },
38
+ E503: { code: 'E503', category: 'runtime', message: 'Template not found' },
39
+ // Configuration errors
40
+ E601: { code: 'E601', category: 'configuration', message: 'Invalid configuration' },
41
+ };
42
+ /**
43
+ * Create an enhanced error with recovery suggestions
44
+ */
45
+ export function createEnhancedError(code, path, details, context) {
46
+ const errorDef = ERROR_CODES[code];
47
+ const error = {
48
+ code: errorDef.code,
49
+ category: errorDef.category,
50
+ path,
51
+ message: details ? `${errorDef.message}: ${details}` : errorDef.message,
52
+ recoverySteps: getRecoverySteps(code, context),
53
+ examples: getExamples(code, context),
54
+ documentation: getDocumentationLink(code),
55
+ };
56
+ const suggestion = getSuggestion(code, context);
57
+ if (suggestion) {
58
+ error.suggestion = suggestion;
59
+ }
60
+ return error;
61
+ }
62
+ /**
63
+ * Get recovery steps for an error
64
+ */
65
+ function getRecoverySteps(code, context) {
66
+ switch (code) {
67
+ case 'E001':
68
+ return [
69
+ 'Check for missing operators between terms',
70
+ 'Ensure all parentheses are balanced',
71
+ 'Verify function names are spelled correctly',
72
+ 'Use * for multiplication (e.g., 2*x not 2x)',
73
+ ];
74
+ case 'E002':
75
+ return [
76
+ 'Count opening and closing parentheses',
77
+ 'Add missing parenthesis at the end',
78
+ 'Check for nested function calls',
79
+ ];
80
+ case 'E101':
81
+ return [
82
+ 'Check parameter spelling',
83
+ 'Use list_available_models to see template parameters',
84
+ 'Use get_model_schema to see available parameters',
85
+ 'Add the parameter using add_parameter tool',
86
+ ];
87
+ case 'E102':
88
+ return [
89
+ 'Verify element ID exists in the chart',
90
+ 'Add the element before referencing it',
91
+ 'Check for typos in element ID',
92
+ ];
93
+ case 'E103':
94
+ return [
95
+ 'Create the chart first using create_chart',
96
+ 'Check chart ID spelling',
97
+ 'Use export_document to see current charts',
98
+ ];
99
+ case 'E201':
100
+ return [
101
+ 'Check parameter values are economically sensible',
102
+ 'Ensure prices and quantities are non-negative',
103
+ 'Verify slopes have correct signs',
104
+ ];
105
+ case 'E202':
106
+ return [
107
+ 'Increase demand intercept relative to supply intercept',
108
+ 'Adjust slopes to allow intersection',
109
+ 'Ensure curves can intersect in positive quadrant',
110
+ ];
111
+ case 'E301':
112
+ return [
113
+ 'Add the required field to your input',
114
+ 'Check documentation for required fields',
115
+ `Required: ${context?.required || 'unknown'}`,
116
+ ];
117
+ case 'E401':
118
+ return [
119
+ 'Identify which parameters reference each other',
120
+ 'Break the cycle by using a constant value',
121
+ 'Restructure parameter dependencies',
122
+ `Cycle: ${context?.cycle || 'unknown'}`,
123
+ ];
124
+ case 'E501':
125
+ return [
126
+ 'Call create_chart first to start a document',
127
+ 'Use generate_economic_model for template-based generation',
128
+ ];
129
+ case 'E502':
130
+ return [
131
+ 'Specify chartId parameter',
132
+ 'Call create_chart first',
133
+ ];
134
+ case 'E503':
135
+ return [
136
+ 'Use list_available_models to see valid templates',
137
+ 'Check template ID spelling',
138
+ ];
139
+ default:
140
+ return ['Check the documentation for more information'];
141
+ }
142
+ }
143
+ /**
144
+ * Get examples for an error
145
+ */
146
+ function getExamples(code, _context) {
147
+ switch (code) {
148
+ case 'E001':
149
+ return [
150
+ 'Valid: 100 - 2*x',
151
+ 'Valid: sqrt(x^2 + y^2)',
152
+ 'Valid: slope * x + intercept',
153
+ 'Invalid: 2x (missing *)',
154
+ 'Invalid: sin x (missing parentheses)',
155
+ ];
156
+ case 'E101':
157
+ return [
158
+ 'With template: { model: "supply_demand_basic", parameters: { demandIntercept: 100 } }',
159
+ 'With builder: add_parameter({ name: "slope", value: 2 })',
160
+ ];
161
+ case 'E103':
162
+ return [
163
+ 'create_chart({ id: "main", xAxis: { label: "Q", min: 0, max: 100 }, ... })',
164
+ 'add_curve({ id: "demand", equation: "100 - x", chartId: "main" })',
165
+ ];
166
+ case 'E202':
167
+ return [
168
+ 'Working: demandIntercept=100, supplyIntercept=0 (demand > supply intercept)',
169
+ 'Failing: demandIntercept=50, supplyIntercept=80 (supply > demand intercept)',
170
+ ];
171
+ case 'E401':
172
+ return [
173
+ 'Circular: a = b + 1, b = a - 1',
174
+ 'Fixed: a = 10, b = a + 1',
175
+ ];
176
+ default:
177
+ return [];
178
+ }
179
+ }
180
+ /**
181
+ * Get a suggestion for an error
182
+ */
183
+ function getSuggestion(code, context) {
184
+ switch (code) {
185
+ case 'E001':
186
+ return 'Check expression syntax. Use * for multiplication and proper function syntax.';
187
+ case 'E002':
188
+ return 'Add missing parenthesis or remove extra one.';
189
+ case 'E101':
190
+ if (context?.closestMatch) {
191
+ return `Did you mean "${context.closestMatch}"?`;
192
+ }
193
+ return 'Check available parameters with get_model_schema.';
194
+ case 'E102':
195
+ if (context?.closestMatch) {
196
+ return `Did you mean "${context.closestMatch}"?`;
197
+ }
198
+ return 'Verify element exists before referencing.';
199
+ case 'E103':
200
+ if (context?.availableCharts) {
201
+ return `Available charts: ${context.availableCharts.join(', ')}`;
202
+ }
203
+ return 'Create the chart first with create_chart.';
204
+ case 'E201':
205
+ return 'Ensure economic parameters follow standard constraints (positive prices, proper elasticities, etc.)';
206
+ case 'E202':
207
+ return 'Adjust demand/supply curves to allow positive equilibrium. Demand intercept should exceed supply intercept.';
208
+ case 'E203':
209
+ return 'Use non-negative values for prices and quantities.';
210
+ case 'E301':
211
+ return `Add required field: ${context?.field || 'unknown'}`;
212
+ case 'E401':
213
+ return 'Break the dependency cycle by using constant values.';
214
+ case 'E501':
215
+ return 'Start with create_chart or generate_economic_model.';
216
+ case 'E503':
217
+ if (context?.closestMatch) {
218
+ return `Did you mean "${context.closestMatch}"?`;
219
+ }
220
+ return 'Use list_available_models to see valid templates.';
221
+ default:
222
+ return undefined;
223
+ }
224
+ }
225
+ /**
226
+ * Get documentation link for an error
227
+ */
228
+ function getDocumentationLink(code) {
229
+ const category = ERROR_CODES[code].category;
230
+ switch (category) {
231
+ case 'syntax':
232
+ return 'docs/TOOL_REFERENCE.md#expression-syntax';
233
+ case 'reference':
234
+ return 'docs/TOOL_REFERENCE.md#error-handling';
235
+ case 'economic':
236
+ return 'docs/ECONOMIC_MODELS.md';
237
+ case 'schema':
238
+ return 'docs/API.md#typescript-api';
239
+ case 'dependency':
240
+ return 'docs/TOOL_REFERENCE.md#check_dependencies';
241
+ case 'runtime':
242
+ return 'docs/TOOL_REFERENCE.md#model-building-tools';
243
+ default:
244
+ return 'docs/TOOL_REFERENCE.md';
245
+ }
246
+ }
247
+ /**
248
+ * Format an enhanced error for display
249
+ */
250
+ export function formatEnhancedError(error) {
251
+ let output = `[${error.code}] ${error.message}\n`;
252
+ output += ` Path: ${error.path}\n`;
253
+ if (error.suggestion) {
254
+ output += ` Suggestion: ${error.suggestion}\n`;
255
+ }
256
+ if (error.recoverySteps && error.recoverySteps.length > 0) {
257
+ output += ` Recovery steps:\n`;
258
+ for (const step of error.recoverySteps) {
259
+ output += ` - ${step}\n`;
260
+ }
261
+ }
262
+ if (error.examples && error.examples.length > 0) {
263
+ output += ` Examples:\n`;
264
+ for (const example of error.examples) {
265
+ output += ` ${example}\n`;
266
+ }
267
+ }
268
+ if (error.documentation) {
269
+ output += ` Documentation: ${error.documentation}\n`;
270
+ }
271
+ return output;
272
+ }
273
+ /**
274
+ * Format multiple errors for display
275
+ */
276
+ export function formatErrors(errors) {
277
+ if (errors.length === 0) {
278
+ return 'No errors';
279
+ }
280
+ let output = `Found ${errors.length} error(s):\n\n`;
281
+ for (let i = 0; i < errors.length; i++) {
282
+ output += `${i + 1}. ${formatEnhancedError(errors[i])}\n`;
283
+ }
284
+ return output;
285
+ }
286
+ /**
287
+ * Convert simple ValidationError to EnhancedError
288
+ */
289
+ export function enhanceError(error, code, context) {
290
+ return {
291
+ ...error,
292
+ code: ERROR_CODES[code].code,
293
+ category: ERROR_CODES[code].category,
294
+ recoverySteps: getRecoverySteps(code, context),
295
+ examples: getExamples(code, context),
296
+ documentation: getDocumentationLink(code),
297
+ };
298
+ }
299
+ /**
300
+ * Quick error creators for common scenarios
301
+ */
302
+ export const Errors = {
303
+ unknownModel: (modelId, closestMatch) => createEnhancedError('E503', 'model', `Template "${modelId}" not found`, { closestMatch }),
304
+ unknownParameter: (param, closestMatch) => createEnhancedError('E101', `expression.${param}`, `Unknown parameter "${param}"`, { closestMatch }),
305
+ noDocument: () => createEnhancedError('E501', 'document', 'No document started'),
306
+ noChart: (chartId) => createEnhancedError('E502', 'chart', chartId ? `Chart "${chartId}" not found` : 'No chart selected'),
307
+ invalidExpression: (expression, details) => createEnhancedError('E001', 'expression', `"${expression}": ${details}`),
308
+ circularDependency: (cycle) => createEnhancedError('E401', 'parameters', `Cycle: ${cycle.join(' -> ')}`, { cycle }),
309
+ noEquilibrium: (reason) => createEnhancedError('E202', 'economic', reason),
310
+ missingRequired: (field) => createEnhancedError('E301', field, `Missing required field: ${field}`, { field }),
311
+ invalidRange: (field, value, min, max) => createEnhancedError('E304', field, `Value ${value} out of range [${min}, ${max}]`),
312
+ };
313
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2BH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,gBAAgB;IAChB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAiB,EAAE,OAAO,EAAE,2BAA2B,EAAE;IACzF,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAiB,EAAE,OAAO,EAAE,wBAAwB,EAAE;IACtF,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAiB,EAAE,OAAO,EAAE,wBAAwB,EAAE;IACtF,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAiB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAErF,mBAAmB;IACnB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAoB,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACpF,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAoB,EAAE,OAAO,EAAE,oBAAoB,EAAE;IACrF,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAoB,EAAE,OAAO,EAAE,kBAAkB,EAAE;IACnF,IAAI,EAAE,EAAE,IAAI,E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EtF,aAAa,EAAE,CAAC,MAAc,EAAE,EAAE,CAChC,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC;IAEjD,eAAe,EAAE,CAAC,KAAa,EAAE,EAAE,CACjC,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,2BAA2B,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IAEnF,YAAY,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CACvE,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,kBAAkB,GAAG,KAAK,GAAG,GAAG,CAAC;CACrF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Formatters Index
3
+ *
4
+ * Re-exports all formatters.
5
+ */
6
+ export { formatAsYAML, formatAsAnnotatedYAML, formatMinimalYAML } from './yaml.js';
7
+ export { formatAsRedux, formatAsAPICalls } from './redux.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}