deepthinking-mcp 6.1.0 → 6.1.2

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
@@ -1243,13 +1243,10 @@ var init_sanitization = __esm({
1243
1243
  }
1244
1244
  });
1245
1245
 
1246
- // src/utils/logger.ts
1247
- function createLogger(config) {
1248
- return new Logger(config);
1249
- }
1250
- var LogLevel, DEFAULT_CONFIG, Logger;
1251
- var init_logger = __esm({
1252
- "src/utils/logger.ts"() {
1246
+ // src/utils/logger-types.ts
1247
+ var LogLevel;
1248
+ var init_logger_types = __esm({
1249
+ "src/utils/logger-types.ts"() {
1253
1250
  init_esm_shims();
1254
1251
  LogLevel = /* @__PURE__ */ ((LogLevel2) => {
1255
1252
  LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
@@ -1259,6 +1256,18 @@ var init_logger = __esm({
1259
1256
  LogLevel2[LogLevel2["SILENT"] = 4] = "SILENT";
1260
1257
  return LogLevel2;
1261
1258
  })(LogLevel || {});
1259
+ }
1260
+ });
1261
+
1262
+ // src/utils/logger.ts
1263
+ function createLogger(config) {
1264
+ return new Logger(config);
1265
+ }
1266
+ var DEFAULT_CONFIG, Logger;
1267
+ var init_logger = __esm({
1268
+ "src/utils/logger.ts"() {
1269
+ init_esm_shims();
1270
+ init_logger_types();
1262
1271
  DEFAULT_CONFIG = {
1263
1272
  minLevel: 1 /* INFO */,
1264
1273
  enableConsole: true,
@@ -2834,11 +2843,16 @@ var init_ThoughtFactory = __esm({
2834
2843
  bestExplanation: input.bestExplanation
2835
2844
  };
2836
2845
  case "causal":
2846
+ const inputAny = input;
2847
+ const causalGraph = input.causalGraph || {
2848
+ nodes: inputAny.nodes || [],
2849
+ edges: inputAny.edges || []
2850
+ };
2837
2851
  return {
2838
2852
  ...baseThought,
2839
2853
  mode: "causal" /* CAUSAL */,
2840
2854
  thoughtType: toExtendedThoughtType(input.thoughtType, "problem_definition"),
2841
- causalGraph: input.causalGraph,
2855
+ causalGraph,
2842
2856
  interventions: input.interventions || [],
2843
2857
  mechanisms: input.mechanisms || [],
2844
2858
  confounders: input.confounders || []
@@ -3085,6 +3099,10 @@ function causalGraphToDOT(thought, includeLabels, includeMetrics) {
3085
3099
  let dot = "digraph CausalGraph {\n";
3086
3100
  dot += " rankdir=TB;\n";
3087
3101
  dot += " node [shape=box, style=rounded];\n\n";
3102
+ if (!thought.causalGraph || !thought.causalGraph.nodes) {
3103
+ dot += ' NoData [label="No causal graph data"];\n}\n';
3104
+ return dot;
3105
+ }
3088
3106
  for (const node of thought.causalGraph.nodes) {
3089
3107
  const nodeId = sanitizeId(node.id);
3090
3108
  const label = includeLabels ? node.name : nodeId;
@@ -3124,6 +3142,9 @@ function causalGraphToDOT(thought, includeLabels, includeMetrics) {
3124
3142
  function causalGraphToASCII(thought) {
3125
3143
  let ascii = "Causal Graph:\n";
3126
3144
  ascii += "=============\n\n";
3145
+ if (!thought.causalGraph || !thought.causalGraph.nodes) {
3146
+ return ascii + "No causal graph data\n";
3147
+ }
3127
3148
  ascii += "Nodes:\n";
3128
3149
  for (const node of thought.causalGraph.nodes) {
3129
3150
  ascii += ` [${node.type.toUpperCase()}] ${node.name}: ${node.description}
@@ -8403,8 +8424,48 @@ var ProbabilisticSchema = BaseThoughtSchema.extend({
8403
8424
 
8404
8425
  // src/tools/schemas/modes/causal.ts
8405
8426
  init_esm_shims();
8427
+ var CausalNodeSchema = z.object({
8428
+ id: z.string(),
8429
+ name: z.string(),
8430
+ description: z.string().optional(),
8431
+ type: z.enum(["cause", "effect", "mediator", "confounder"]).optional()
8432
+ });
8433
+ var CausalEdgeSchema = z.object({
8434
+ from: z.string(),
8435
+ to: z.string(),
8436
+ type: z.string().optional(),
8437
+ strength: z.number().min(0).max(1).optional()
8438
+ });
8439
+ var CounterfactualSchema = z.object({
8440
+ actual: z.string().optional(),
8441
+ hypothetical: z.string().optional(),
8442
+ consequence: z.string().optional()
8443
+ });
8444
+ var InterventionSchema = z.object({
8445
+ node: z.string(),
8446
+ value: z.string().optional(),
8447
+ effect: z.string().optional()
8448
+ });
8406
8449
  var CausalSchema = BaseThoughtSchema.extend({
8407
- mode: z.enum(["causal", "counterfactual", "abductive"])
8450
+ mode: z.enum(["causal", "counterfactual", "abductive"]),
8451
+ // Causal graph properties (top-level for JSON schema compatibility)
8452
+ nodes: z.array(CausalNodeSchema).optional(),
8453
+ edges: z.array(CausalEdgeSchema).optional(),
8454
+ // Nested causalGraph for backwards compatibility
8455
+ causalGraph: z.object({
8456
+ nodes: z.array(CausalNodeSchema),
8457
+ edges: z.array(CausalEdgeSchema)
8458
+ }).optional(),
8459
+ // Counterfactual properties
8460
+ counterfactual: CounterfactualSchema.optional(),
8461
+ // Intervention properties
8462
+ interventions: z.array(InterventionSchema).optional(),
8463
+ // Observations for abductive reasoning
8464
+ observations: z.array(z.string()).optional(),
8465
+ explanations: z.array(z.object({
8466
+ hypothesis: z.string(),
8467
+ plausibility: z.number().min(0).max(1).optional()
8468
+ })).optional()
8408
8469
  });
8409
8470
 
8410
8471
  // src/tools/schemas/modes/strategic.ts