@gotza02/seq-thinking 1.1.2 → 1.1.3

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 (69) hide show
  1. package/README.md +42 -4
  2. package/data/agents/1770106504306-dljh9ef.json +68 -0
  3. package/data/agents/1770106504310-4oarrst.json +58 -0
  4. package/data/agents/1770106540588-pvitt55.json +68 -0
  5. package/data/agents/1770106540595-z2ya871.json +58 -0
  6. package/data/agents/1770106710890-0e2naq1.json +68 -0
  7. package/data/agents/1770106710893-r076yxx.json +58 -0
  8. package/data/agents/1770109212161-4ybd0i7.json +68 -0
  9. package/data/agents/1770109212166-gkhya8h.json +58 -0
  10. package/data/sessions/1770100622009-5afiuyv.json +499 -0
  11. package/data/sessions/1770106504312-75zk750.json +107 -0
  12. package/data/sessions/1770106540597-z8e8soo.json +150 -0
  13. package/data/sessions/1770106710894-0kxgy5x.json +150 -0
  14. package/data/sessions/1770109212169-zpddeb9.json +150 -0
  15. package/dist/__tests__/sequential-thinking.test.js +21 -21
  16. package/dist/__tests__/sequential-thinking.test.js.map +1 -1
  17. package/dist/agents/base-agent.d.ts +1 -0
  18. package/dist/agents/base-agent.d.ts.map +1 -1
  19. package/dist/agents/base-agent.js +5 -3
  20. package/dist/agents/base-agent.js.map +1 -1
  21. package/dist/agents/meta-reasoning-agent.d.ts +3 -54
  22. package/dist/agents/meta-reasoning-agent.d.ts.map +1 -1
  23. package/dist/agents/meta-reasoning-agent.js +35 -328
  24. package/dist/agents/meta-reasoning-agent.js.map +1 -1
  25. package/dist/agents/synthesizer-agent.d.ts +3 -17
  26. package/dist/agents/synthesizer-agent.d.ts.map +1 -1
  27. package/dist/agents/synthesizer-agent.js +41 -139
  28. package/dist/agents/synthesizer-agent.js.map +1 -1
  29. package/dist/mcp-server.d.ts.map +1 -1
  30. package/dist/mcp-server.js +9 -6
  31. package/dist/mcp-server.js.map +1 -1
  32. package/dist/real_world_test.d.ts +2 -0
  33. package/dist/real_world_test.d.ts.map +1 -0
  34. package/dist/real_world_test.js +78 -0
  35. package/dist/real_world_test.js.map +1 -0
  36. package/dist/sequential-thinking.d.ts +5 -5
  37. package/dist/sequential-thinking.d.ts.map +1 -1
  38. package/dist/sequential-thinking.js +68 -32
  39. package/dist/sequential-thinking.js.map +1 -1
  40. package/dist/swarm-coordinator.d.ts +1 -1
  41. package/dist/swarm-coordinator.d.ts.map +1 -1
  42. package/dist/swarm-coordinator.js +39 -13
  43. package/dist/swarm-coordinator.js.map +1 -1
  44. package/dist/utils/llm-adapter.d.ts +2 -2
  45. package/dist/utils/llm-adapter.d.ts.map +1 -1
  46. package/dist/utils/llm-adapter.js +57 -33
  47. package/dist/utils/llm-adapter.js.map +1 -1
  48. package/dist/utils/logger.d.ts +20 -0
  49. package/dist/utils/logger.d.ts.map +1 -0
  50. package/dist/utils/logger.js +49 -0
  51. package/dist/utils/logger.js.map +1 -0
  52. package/dist/utils/persistence.d.ts.map +1 -1
  53. package/dist/utils/persistence.js +4 -3
  54. package/dist/utils/persistence.js.map +1 -1
  55. package/package.json +1 -1
  56. package/real_world_test.log +200 -0
  57. package/real_world_test_dynamic.log +184 -0
  58. package/real_world_test_real.log +184 -0
  59. package/src/__tests__/sequential-thinking.test.ts +21 -21
  60. package/src/agents/base-agent.ts +6 -3
  61. package/src/agents/meta-reasoning-agent.ts +38 -397
  62. package/src/agents/synthesizer-agent.ts +48 -165
  63. package/src/mcp-server.ts +9 -6
  64. package/src/real_world_test.ts +89 -0
  65. package/src/sequential-thinking.ts +87 -33
  66. package/src/swarm-coordinator.ts +41 -13
  67. package/src/utils/llm-adapter.ts +66 -32
  68. package/src/utils/logger.ts +56 -0
  69. package/src/utils/persistence.ts +4 -3
@@ -0,0 +1,150 @@
1
+ {
2
+ "id": "1770106540597-z8e8soo",
3
+ "topic": "Architecting a scalable microservices system",
4
+ "status": "completed",
5
+ "currentBranchId": "main",
6
+ "branches": {
7
+ "_type": "Map",
8
+ "data": [
9
+ [
10
+ "main",
11
+ {
12
+ "id": "main",
13
+ "sessionId": "1770106540597-z8e8soo",
14
+ "name": "Main",
15
+ "description": "Primary reasoning path",
16
+ "rootThoughtId": "",
17
+ "thoughtIds": [],
18
+ "parentBranchId": null,
19
+ "childBranchIds": [],
20
+ "status": "active",
21
+ "confidence": 0.5,
22
+ "metadata": {
23
+ "createdAt": "2026-02-03T08:15:40.597Z"
24
+ }
25
+ }
26
+ ]
27
+ ]
28
+ },
29
+ "thoughts": {
30
+ "_type": "Map",
31
+ "data": [
32
+ [
33
+ "1770106540598-485j13o",
34
+ {
35
+ "id": "1770106540598-485j13o",
36
+ "sessionId": "1770106540597-z8e8soo",
37
+ "content": "We need to break down the monolithic application into smaller services.",
38
+ "stepNumber": 1,
39
+ "thoughtType": "analysis",
40
+ "confidence": {
41
+ "overall": 0.8,
42
+ "components": {
43
+ "logicalConsistency": 0.5,
44
+ "factualAccuracy": 0.5,
45
+ "reasoningQuality": 0.5,
46
+ "evidenceStrength": 0.5
47
+ },
48
+ "uncertaintyBounds": [
49
+ 0.3,
50
+ 0.7
51
+ ],
52
+ "calibrationHistory": []
53
+ },
54
+ "parentThoughtId": null,
55
+ "childThoughtIds": [
56
+ "1770106540602-tb7es3b"
57
+ ],
58
+ "branchId": "main",
59
+ "revisionOf": null,
60
+ "revisionHistory": [],
61
+ "metadata": {
62
+ "createdAt": "2026-02-03T08:15:40.598Z",
63
+ "modifiedAt": "2026-02-03T08:15:40.598Z",
64
+ "processingTimeMs": 0,
65
+ "tokensUsed": 0
66
+ },
67
+ "tags": [],
68
+ "assumptions": [],
69
+ "dependencies": []
70
+ }
71
+ ],
72
+ [
73
+ "1770106540602-tb7es3b",
74
+ {
75
+ "id": "1770106540602-tb7es3b",
76
+ "sessionId": "1770106540597-z8e8soo",
77
+ "content": "{\n \"conclusion\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on these reasoning steps, provide a final co...\",\n \"reasoningChain\": [\n {\n \"step\": 1,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.63,\n \"isFinal\": false\n },\n {\n \"step\": 2,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.66,\n \"isFinal\": false\n },\n {\n \"step\": 3,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.69,\n \"isFinal\": false\n },\n {\n \"step\": 4,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.72,\n \"isFinal\": true\n }\n ],\n \"iterations\": 4,\n \"strategy\": \"chain_of_thought\",\n \"problem\": \"[object Object]\"\n}",
78
+ "stepNumber": 2,
79
+ "thoughtType": "synthesis",
80
+ "confidence": {
81
+ "overall": 0.675,
82
+ "components": {
83
+ "logicalConsistency": 0.5,
84
+ "factualAccuracy": 0.5,
85
+ "reasoningQuality": 0.5,
86
+ "evidenceStrength": 0.5
87
+ },
88
+ "uncertaintyBounds": [
89
+ 0.3,
90
+ 0.7
91
+ ],
92
+ "calibrationHistory": []
93
+ },
94
+ "parentThoughtId": "1770106540598-485j13o",
95
+ "childThoughtIds": [],
96
+ "branchId": "main",
97
+ "revisionOf": null,
98
+ "revisionHistory": [],
99
+ "metadata": {
100
+ "createdAt": "2026-02-03T08:15:40.602Z",
101
+ "modifiedAt": "2026-02-03T08:15:40.602Z",
102
+ "processingTimeMs": 0,
103
+ "tokensUsed": 0
104
+ },
105
+ "tags": [
106
+ "swarm-result",
107
+ "LogicMaster"
108
+ ],
109
+ "assumptions": [],
110
+ "dependencies": []
111
+ }
112
+ ]
113
+ ]
114
+ },
115
+ "metaNotes": {
116
+ "_type": "Map",
117
+ "data": []
118
+ },
119
+ "context": {
120
+ "originalProblem": "Architecting a scalable microservices system",
121
+ "constraints": [],
122
+ "relevantInformation": [],
123
+ "workingMemory": {
124
+ "_type": "Map",
125
+ "data": []
126
+ },
127
+ "longTermReferences": []
128
+ },
129
+ "settings": {
130
+ "maxBranches": 5,
131
+ "maxDepth": 20,
132
+ "confidenceThreshold": 0.6,
133
+ "enableSelfCorrection": true,
134
+ "enableMetaReasoning": true,
135
+ "enableParallelHypotheses": true,
136
+ "adaptiveGranularity": true,
137
+ "granularitySettings": {
138
+ "minStepDetail": 0.1,
139
+ "maxStepDetail": 1,
140
+ "complexityThreshold": 0.7
141
+ }
142
+ },
143
+ "metadata": {
144
+ "createdAt": "2026-02-03T08:15:40.597Z",
145
+ "lastActivityAt": "2026-02-03T08:15:40.602Z",
146
+ "totalThoughts": 2,
147
+ "totalBranches": 1,
148
+ "completedAt": "2026-02-03T08:15:40.608Z"
149
+ }
150
+ }
@@ -0,0 +1,150 @@
1
+ {
2
+ "id": "1770106710894-0kxgy5x",
3
+ "topic": "Architecting a scalable microservices system",
4
+ "status": "completed",
5
+ "currentBranchId": "main",
6
+ "branches": {
7
+ "_type": "Map",
8
+ "data": [
9
+ [
10
+ "main",
11
+ {
12
+ "id": "main",
13
+ "sessionId": "1770106710894-0kxgy5x",
14
+ "name": "Main",
15
+ "description": "Primary reasoning path",
16
+ "rootThoughtId": "",
17
+ "thoughtIds": [],
18
+ "parentBranchId": null,
19
+ "childBranchIds": [],
20
+ "status": "active",
21
+ "confidence": 0.5,
22
+ "metadata": {
23
+ "createdAt": "2026-02-03T08:18:30.894Z"
24
+ }
25
+ }
26
+ ]
27
+ ]
28
+ },
29
+ "thoughts": {
30
+ "_type": "Map",
31
+ "data": [
32
+ [
33
+ "1770106710895-2bdvni4",
34
+ {
35
+ "id": "1770106710895-2bdvni4",
36
+ "sessionId": "1770106710894-0kxgy5x",
37
+ "content": "We need to break down the monolithic application into smaller services.",
38
+ "stepNumber": 1,
39
+ "thoughtType": "analysis",
40
+ "confidence": {
41
+ "overall": 0.8,
42
+ "components": {
43
+ "logicalConsistency": 0.5,
44
+ "factualAccuracy": 0.5,
45
+ "reasoningQuality": 0.5,
46
+ "evidenceStrength": 0.5
47
+ },
48
+ "uncertaintyBounds": [
49
+ 0.3,
50
+ 0.7
51
+ ],
52
+ "calibrationHistory": []
53
+ },
54
+ "parentThoughtId": null,
55
+ "childThoughtIds": [
56
+ "1770106831083-7d0pa6v"
57
+ ],
58
+ "branchId": "main",
59
+ "revisionOf": null,
60
+ "revisionHistory": [],
61
+ "metadata": {
62
+ "createdAt": "2026-02-03T08:18:30.895Z",
63
+ "modifiedAt": "2026-02-03T08:18:30.895Z",
64
+ "processingTimeMs": 0,
65
+ "tokensUsed": 0
66
+ },
67
+ "tags": [],
68
+ "assumptions": [],
69
+ "dependencies": []
70
+ }
71
+ ],
72
+ [
73
+ "1770106831083-7d0pa6v",
74
+ {
75
+ "id": "1770106831083-7d0pa6v",
76
+ "sessionId": "1770106710894-0kxgy5x",
77
+ "content": "{\n \"conclusion\": \"Failed to generate conclusion.\",\n \"reasoningChain\": [\n {\n \"step\": 1,\n \"content\": \"Error: Command failed: gemini ask 'You are a logical reasoner. Provide one clear reasoning step.\\n\\nUser: Based on the current context, generate the next reasoning step. \\nCurrent Context: [object Object]\\nIteration: 1\\nProblem: [object Object]'\\nLoaded cached credentials.\\n=========================================\\nThis is an unexpected error. Please file a bug report using the /bug tool.\\nCRITICAL: Unhandled Promise Rejection!\\n=========================================\\nReason: TypeError: Cannot read properties of undefined (reading 'model')\\nStack trace:\\nTypeError: Cannot read properties of undefined (reading 'model')\\n at ClearcutLogger.logStartSessionEvent (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/telemetry/clearcut-logger/clearcut-logger.js:460:28)\\n at logCliConfiguration (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/telemetry/loggers.js:14:46)\\n at initializeApp (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/dist/src/core/initializer.js:23:5)\\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\\n at async main (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/dist/src/gemini.js:384:38)\\nHook registry initialized with 0 hook entries\\nServer 'memory' supports tool updates. Listening for changes...\\nAttempt 1 failed with status 429. Retrying with backoff... GaxiosError: [{\\n \\\"error\\\": {\\n \\\"code\\\": 429,\\n \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\n \\\"errors\\\": [\\n {\\n \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\n \\\"domain\\\": \\\"global\\\",\\n \\\"reason\\\": \\\"rateLimitExceeded\\\"\\n }\\n ],\\n \\\"status\\\": \\\"RESOURCE_EXHAUSTED\\\",\\n \\\"details\\\": [\\n {\\n \\\"@type\\\": \\\"type.googleapis.com/google.rpc.ErrorInfo\\\",\\n \\\"reason\\\": \\\"MODEL_CAPACITY_EXHAUSTED\\\",\\n \\\"domain\\\": \\\"cloudcode-pa.googleapis.com\\\",\\n \\\"metadata\\\": {\\n \\\"model\\\": \\\"gemini-3-pro-preview\\\"\\n }\\n }\\n ]\\n }\\n}\\n]\\n at Gaxios._request (/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/gaxios/build/src/gaxios.js:142:23)\\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\\n at async OAuth2Client.requestAsync (/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/google-auth-library/build/src/auth/oauth2client.js:429:18)\\n at async CodeAssistServer.requestStreamingPost (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/code_assist/server.js:169:21)\\n at async CodeAssistServer.generateContentStream (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/code_assist/server.js:27:27)\\n at async file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/loggingContentGenerator.js:132:26\\n at async retryWithBackoff (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/utils/retry.js:108:28)\\n at async GeminiChat.makeApiCallAndProcessStream (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:421:32)\\n at async GeminiChat.streamWithRetries (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:253:40)\\n at async Turn.run (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/turn.js:66:30) {\\n config: {\\n url: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',\\n method: 'POST',\\n params: { alt: 'sse' },\\n headers: {\\n 'Content-Type': 'application/json',\\n 'User-Agent': 'GeminiCLI/0.26.0/gemini-3-pro-preview (android; arm64) google-api-nodejs-client/9.15.1',\\n Authorization: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n 'x-goog-api-client': 'gl-node/24.13.0'\\n },\\n responseType: 'stream',\\n body: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n signal: AbortSignal { aborted: false },\\n paramsSerializer: [Function: paramsSerializer],\\n validateStatus: [Function: validateStatus],\\n errorRedactor: [Function: defaultErrorRedactor]\\n },\\n response: {\\n config: {\\n url: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',\\n method: 'POST',\\n params: [Object],\\n headers: [Object],\\n responseType: 'stream',\\n body: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n signal: [AbortSignal],\\n paramsSerializer: [Function: paramsSerializer],\\n validateStatus: [Function: validateStatus],\\n errorRedactor: [Function: defaultErrorRedactor]\\n },\\n data: '[{\\\\n' +\\n ' \\\"error\\\": {\\\\n' +\\n ' \\\"code\\\": 429,\\\\n' +\\n ' \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\\\n' +\\n ' \\\"errors\\\": [\\\\n' +\\n ' {\\\\n' +\\n ' \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\\\n' +\\n ' \\\"domain\\\": \\\"global\\\",\\\\n' +\\n ' \\\"reason\\\": \\\"rateLimitExceeded\\\"\\\\n' +\\n ' }\\\\n' +\\n ' ],\\\\n' +\\n ' \\\"status\\\": \\\"RESOURCE_EXHAUSTED\\\",\\\\n' +\\n ' \\\"details\\\": [\\\\n' +\\n ' {\\\\n' +\\n ' \\\"@type\\\": \\\"type.googleapis.com/google.rpc.ErrorInfo\\\",\\\\n' +\\n ' \\\"reason\\\": \\\"MODEL_CAPACITY_EXHAUSTED\\\",\\\\n' +\\n ' \\\"domain\\\": \\\"cloudcode-pa.googleapis.com\\\",\\\\n' +\\n ' \\\"metadata\\\": {\\\\n' +\\n ' \\\"model\\\": \\\"gemini-3-pro-preview\\\"\\\\n' +\\n ' }\\\\n' +\\n ' }\\\\n' +\\n ' ]\\\\n' +\\n ' }\\\\n' +\\n '}\\\\n' +\\n ']',\\n headers: {\\n 'alt-svc': 'h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000',\\n 'content-length': '624',\\n 'content-type': 'application/json; charset=UTF-8',\\n date: 'Tue, 03 Feb 2026 08:19:12 GMT',\\n server: 'ESF',\\n 'server-timing': 'gfet4t7; dur=6911',\\n vary: 'Origin, X-Origin, Referer',\\n 'x-cloudaicompanion-trace-id': '65bc60014730cbe1',\\n 'x-content-type-options': 'nosniff',\\n 'x-frame-options': 'SAMEORIGIN',\\n 'x-xss-protection': '0'\\n },\\n status: 429,\\n statusText: 'Too Many Requests',\\n request: {\\n responseURL: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse'\\n }\\n },\\n error: undefined,\\n status: 429,\\n Symbol(gaxios-gaxios-error): '6.7.1'\\n}\\n\",\n \"confidence\": 0.63,\n \"isFinal\": true\n }\n ],\n \"iterations\": 1,\n \"strategy\": \"chain_of_thought\",\n \"problem\": \"[object Object]\"\n}",
78
+ "stepNumber": 2,
79
+ "thoughtType": "synthesis",
80
+ "confidence": {
81
+ "overall": 0.63,
82
+ "components": {
83
+ "logicalConsistency": 0.5,
84
+ "factualAccuracy": 0.5,
85
+ "reasoningQuality": 0.5,
86
+ "evidenceStrength": 0.5
87
+ },
88
+ "uncertaintyBounds": [
89
+ 0.3,
90
+ 0.7
91
+ ],
92
+ "calibrationHistory": []
93
+ },
94
+ "parentThoughtId": "1770106710895-2bdvni4",
95
+ "childThoughtIds": [],
96
+ "branchId": "main",
97
+ "revisionOf": null,
98
+ "revisionHistory": [],
99
+ "metadata": {
100
+ "createdAt": "2026-02-03T08:20:31.083Z",
101
+ "modifiedAt": "2026-02-03T08:20:31.083Z",
102
+ "processingTimeMs": 0,
103
+ "tokensUsed": 0
104
+ },
105
+ "tags": [
106
+ "swarm-result",
107
+ "LogicMaster"
108
+ ],
109
+ "assumptions": [],
110
+ "dependencies": []
111
+ }
112
+ ]
113
+ ]
114
+ },
115
+ "metaNotes": {
116
+ "_type": "Map",
117
+ "data": []
118
+ },
119
+ "context": {
120
+ "originalProblem": "Architecting a scalable microservices system",
121
+ "constraints": [],
122
+ "relevantInformation": [],
123
+ "workingMemory": {
124
+ "_type": "Map",
125
+ "data": []
126
+ },
127
+ "longTermReferences": []
128
+ },
129
+ "settings": {
130
+ "maxBranches": 5,
131
+ "maxDepth": 20,
132
+ "confidenceThreshold": 0.6,
133
+ "enableSelfCorrection": true,
134
+ "enableMetaReasoning": true,
135
+ "enableParallelHypotheses": true,
136
+ "adaptiveGranularity": true,
137
+ "granularitySettings": {
138
+ "minStepDetail": 0.1,
139
+ "maxStepDetail": 1,
140
+ "complexityThreshold": 0.7
141
+ }
142
+ },
143
+ "metadata": {
144
+ "createdAt": "2026-02-03T08:18:30.894Z",
145
+ "lastActivityAt": "2026-02-03T08:20:31.084Z",
146
+ "totalThoughts": 2,
147
+ "totalBranches": 1,
148
+ "completedAt": "2026-02-03T08:20:53.181Z"
149
+ }
150
+ }
@@ -0,0 +1,150 @@
1
+ {
2
+ "id": "1770109212169-zpddeb9",
3
+ "topic": "Architecting a scalable microservices system",
4
+ "status": "completed",
5
+ "currentBranchId": "main",
6
+ "branches": {
7
+ "_type": "Map",
8
+ "data": [
9
+ [
10
+ "main",
11
+ {
12
+ "id": "main",
13
+ "sessionId": "1770109212169-zpddeb9",
14
+ "name": "Main",
15
+ "description": "Primary reasoning path",
16
+ "rootThoughtId": "",
17
+ "thoughtIds": [],
18
+ "parentBranchId": null,
19
+ "childBranchIds": [],
20
+ "status": "active",
21
+ "confidence": 0.5,
22
+ "metadata": {
23
+ "createdAt": "2026-02-03T09:00:12.169Z"
24
+ }
25
+ }
26
+ ]
27
+ ]
28
+ },
29
+ "thoughts": {
30
+ "_type": "Map",
31
+ "data": [
32
+ [
33
+ "1770109212171-yr9lwtj",
34
+ {
35
+ "id": "1770109212171-yr9lwtj",
36
+ "sessionId": "1770109212169-zpddeb9",
37
+ "content": "We need to break down the monolithic application into smaller services.",
38
+ "stepNumber": 1,
39
+ "thoughtType": "analysis",
40
+ "confidence": {
41
+ "overall": 0.8,
42
+ "components": {
43
+ "logicalConsistency": 0.5,
44
+ "factualAccuracy": 0.5,
45
+ "reasoningQuality": 0.5,
46
+ "evidenceStrength": 0.5
47
+ },
48
+ "uncertaintyBounds": [
49
+ 0.3,
50
+ 0.7
51
+ ],
52
+ "calibrationHistory": []
53
+ },
54
+ "parentThoughtId": null,
55
+ "childThoughtIds": [
56
+ "1770109332337-enlkj87"
57
+ ],
58
+ "branchId": "main",
59
+ "revisionOf": null,
60
+ "revisionHistory": [],
61
+ "metadata": {
62
+ "createdAt": "2026-02-03T09:00:12.171Z",
63
+ "modifiedAt": "2026-02-03T09:00:12.171Z",
64
+ "processingTimeMs": 0,
65
+ "tokensUsed": 0
66
+ },
67
+ "tags": [],
68
+ "assumptions": [],
69
+ "dependencies": []
70
+ }
71
+ ],
72
+ [
73
+ "1770109332337-enlkj87",
74
+ {
75
+ "id": "1770109332337-enlkj87",
76
+ "sessionId": "1770109212169-zpddeb9",
77
+ "content": "{\n \"conclusion\": \"Failed to generate conclusion.\",\n \"reasoningChain\": [\n {\n \"step\": 1,\n \"content\": \"Error: Command failed: gemini ask 'You are a logical reasoner. Provide one clear reasoning step.\\n\\nUser: Based on the current context, generate the next reasoning step. \\nCurrent Context: [object Object]\\nIteration: 1\\nProblem: [object Object]'\\nLoaded cached credentials.\\n=========================================\\nThis is an unexpected error. Please file a bug report using the /bug tool.\\nCRITICAL: Unhandled Promise Rejection!\\n=========================================\\nReason: TypeError: Cannot read properties of undefined (reading 'model')\\nStack trace:\\nTypeError: Cannot read properties of undefined (reading 'model')\\n at ClearcutLogger.logStartSessionEvent (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/telemetry/clearcut-logger/clearcut-logger.js:460:28)\\n at logCliConfiguration (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/telemetry/loggers.js:14:46)\\n at initializeApp (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/dist/src/core/initializer.js:23:5)\\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\\n at async main (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/dist/src/gemini.js:384:38)\\nHook registry initialized with 0 hook entries\\nServer 'memory' supports tool updates. Listening for changes...\\n(node:13925) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.\\n(Use `node --trace-deprecation ...` to show where the warning was created)\\nAttempt 1 failed with status 429. Retrying with backoff... GaxiosError: [{\\n \\\"error\\\": {\\n \\\"code\\\": 429,\\n \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\n \\\"errors\\\": [\\n {\\n \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\n \\\"domain\\\": \\\"global\\\",\\n \\\"reason\\\": \\\"rateLimitExceeded\\\"\\n }\\n ],\\n \\\"status\\\": \\\"RESOURCE_EXHAUSTED\\\",\\n \\\"details\\\": [\\n {\\n \\\"@type\\\": \\\"type.googleapis.com/google.rpc.ErrorInfo\\\",\\n \\\"reason\\\": \\\"MODEL_CAPACITY_EXHAUSTED\\\",\\n \\\"domain\\\": \\\"cloudcode-pa.googleapis.com\\\",\\n \\\"metadata\\\": {\\n \\\"model\\\": \\\"gemini-3-pro-preview\\\"\\n }\\n }\\n ]\\n }\\n}\\n]\\n at Gaxios._request (/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/gaxios/build/src/gaxios.js:142:23)\\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\\n at async OAuth2Client.requestAsync (/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/google-auth-library/build/src/auth/oauth2client.js:429:18)\\n at async CodeAssistServer.requestStreamingPost (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/code_assist/server.js:169:21)\\n at async CodeAssistServer.generateContentStream (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/code_assist/server.js:27:27)\\n at async file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/loggingContentGenerator.js:132:26\\n at async retryWithBackoff (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/utils/retry.js:108:28)\\n at async GeminiChat.makeApiCallAndProcessStream (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:421:32)\\n at async GeminiChat.streamWithRetries (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:253:40)\\n at async Turn.run (file:///data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/turn.js:66:30) {\\n config: {\\n url: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',\\n method: 'POST',\\n params: { alt: 'sse' },\\n headers: {\\n 'Content-Type': 'application/json',\\n 'User-Agent': 'GeminiCLI/0.26.0/gemini-3-pro-preview (android; arm64) google-api-nodejs-client/9.15.1',\\n Authorization: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n 'x-goog-api-client': 'gl-node/25.3.0'\\n },\\n responseType: 'stream',\\n body: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n signal: AbortSignal { aborted: false },\\n paramsSerializer: [Function: paramsSerializer],\\n validateStatus: [Function: validateStatus],\\n errorRedactor: [Function: defaultErrorRedactor]\\n },\\n response: {\\n config: {\\n url: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',\\n method: 'POST',\\n params: [Object],\\n headers: [Object],\\n responseType: 'stream',\\n body: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',\\n signal: [AbortSignal],\\n paramsSerializer: [Function: paramsSerializer],\\n validateStatus: [Function: validateStatus],\\n errorRedactor: [Function: defaultErrorRedactor]\\n },\\n data: '[{\\\\n' +\\n ' \\\"error\\\": {\\\\n' +\\n ' \\\"code\\\": 429,\\\\n' +\\n ' \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\\\n' +\\n ' \\\"errors\\\": [\\\\n' +\\n ' {\\\\n' +\\n ' \\\"message\\\": \\\"No capacity available for model gemini-3-pro-preview on the server\\\",\\\\n' +\\n ' \\\"domain\\\": \\\"global\\\",\\\\n' +\\n ' \\\"reason\\\": \\\"rateLimitExceeded\\\"\\\\n' +\\n ' }\\\\n' +\\n ' ],\\\\n' +\\n ' \\\"status\\\": \\\"RESOURCE_EXHAUSTED\\\",\\\\n' +\\n ' \\\"details\\\": [\\\\n' +\\n ' {\\\\n' +\\n ' \\\"@type\\\": \\\"type.googleapis.com/google.rpc.ErrorInfo\\\",\\\\n' +\\n ' \\\"reason\\\": \\\"MODEL_CAPACITY_EXHAUSTED\\\",\\\\n' +\\n ' \\\"domain\\\": \\\"cloudcode-pa.googleapis.com\\\",\\\\n' +\\n ' \\\"metadata\\\": {\\\\n' +\\n ' \\\"model\\\": \\\"gemini-3-pro-preview\\\"\\\\n' +\\n ' }\\\\n' +\\n ' }\\\\n' +\\n ' ]\\\\n' +\\n ' }\\\\n' +\\n '}\\\\n' +\\n ']',\\n headers: {\\n 'alt-svc': 'h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000',\\n 'content-length': '624',\\n 'content-type': 'application/json; charset=UTF-8',\\n date: 'Tue, 03 Feb 2026 09:00:59 GMT',\\n server: 'ESF',\\n 'server-timing': 'gfet4t7; dur=2624',\\n vary: 'Origin, X-Origin, Referer',\\n 'x-cloudaicompanion-trace-id': 'd0f4d263083e9676',\\n 'x-content-type-options': 'nosniff',\\n 'x-frame-options': 'SAMEORIGIN',\\n 'x-xss-protection': '0'\\n },\\n status: 429,\\n statusText: 'Too Many Requests',\\n request: {\\n responseURL: 'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse'\\n }\\n },\\n error: undefined,\\n status: 429,\\n Symbol(gaxios-gaxios-error): '6.7.1'\\n}\\n\",\n \"confidence\": 0.63,\n \"isFinal\": true\n }\n ],\n \"iterations\": 1,\n \"strategy\": \"chain_of_thought\",\n \"problem\": \"[object Object]\"\n}",
78
+ "stepNumber": 2,
79
+ "thoughtType": "synthesis",
80
+ "confidence": {
81
+ "overall": 0.63,
82
+ "components": {
83
+ "logicalConsistency": 0.5,
84
+ "factualAccuracy": 0.5,
85
+ "reasoningQuality": 0.5,
86
+ "evidenceStrength": 0.5
87
+ },
88
+ "uncertaintyBounds": [
89
+ 0.3,
90
+ 0.7
91
+ ],
92
+ "calibrationHistory": []
93
+ },
94
+ "parentThoughtId": "1770109212171-yr9lwtj",
95
+ "childThoughtIds": [],
96
+ "branchId": "main",
97
+ "revisionOf": null,
98
+ "revisionHistory": [],
99
+ "metadata": {
100
+ "createdAt": "2026-02-03T09:02:12.337Z",
101
+ "modifiedAt": "2026-02-03T09:02:12.337Z",
102
+ "processingTimeMs": 0,
103
+ "tokensUsed": 0
104
+ },
105
+ "tags": [
106
+ "swarm-result",
107
+ "LogicMaster"
108
+ ],
109
+ "assumptions": [],
110
+ "dependencies": []
111
+ }
112
+ ]
113
+ ]
114
+ },
115
+ "metaNotes": {
116
+ "_type": "Map",
117
+ "data": []
118
+ },
119
+ "context": {
120
+ "originalProblem": "Architecting a scalable microservices system",
121
+ "constraints": [],
122
+ "relevantInformation": [],
123
+ "workingMemory": {
124
+ "_type": "Map",
125
+ "data": []
126
+ },
127
+ "longTermReferences": []
128
+ },
129
+ "settings": {
130
+ "maxBranches": 5,
131
+ "maxDepth": 20,
132
+ "confidenceThreshold": 0.6,
133
+ "enableSelfCorrection": true,
134
+ "enableMetaReasoning": true,
135
+ "enableParallelHypotheses": true,
136
+ "adaptiveGranularity": true,
137
+ "granularitySettings": {
138
+ "minStepDetail": 0.1,
139
+ "maxStepDetail": 1,
140
+ "complexityThreshold": 0.7
141
+ }
142
+ },
143
+ "metadata": {
144
+ "createdAt": "2026-02-03T09:00:12.169Z",
145
+ "lastActivityAt": "2026-02-03T09:02:12.337Z",
146
+ "totalThoughts": 2,
147
+ "totalBranches": 1,
148
+ "completedAt": "2026-02-03T09:02:34.067Z"
149
+ }
150
+ }
@@ -226,9 +226,9 @@ describe('MetaReasoningEngine', () => {
226
226
  engine = new MetaReasoningEngine();
227
227
  graph = new ThoughtGraph();
228
228
  });
229
- test('should reflect on session', () => {
229
+ test('should reflect on session', async () => {
230
230
  const session = createMockSession();
231
- const reflection = engine.reflect(session);
231
+ const reflection = await engine.reflect(session);
232
232
  assert.ok(reflection.reflectionType);
233
233
  assert.ok(reflection.content);
234
234
  assert.ok(Array.isArray(reflection.insights));
@@ -247,16 +247,16 @@ describe('MetaReasoningEngine', () => {
247
247
  assert.ok(Array.isArray(metaNote.triggeredActions));
248
248
  }
249
249
  });
250
- test('should handle empty session reflection', () => {
250
+ test('should handle empty session reflection', async () => {
251
251
  const emptySession = createMockSession({ totalThoughts: 0, totalBranches: 0 });
252
- const reflection = engine.reflect(emptySession);
252
+ const reflection = await engine.reflect(emptySession);
253
253
  assert.ok(reflection);
254
254
  assert.ok(Array.isArray(reflection.insights));
255
255
  assert.ok(Array.isArray(reflection.recommendations));
256
256
  });
257
- test('should handle session with multiple branches', () => {
257
+ test('should handle session with multiple branches', async () => {
258
258
  const session = createMockSession({ totalThoughts: 10, totalBranches: 3 });
259
- const reflection = engine.reflect(session);
259
+ const reflection = await engine.reflect(session);
260
260
  assert.ok(reflection.insights.length > 0 || reflection.recommendations.length > 0);
261
261
  });
262
262
  });
@@ -267,10 +267,10 @@ describe('SelfCorrectionEngine', () => {
267
267
  engine = new SelfCorrectionEngine();
268
268
  graph = new ThoughtGraph();
269
269
  });
270
- test('should detect issues in thought', () => {
270
+ test('should detect issues in thought', async () => {
271
271
  const sessionId = 'test-session';
272
272
  const thought = graph.createThought(sessionId, 'Test thought with potential issues');
273
- const issues = engine.detectIssues(thought, graph);
273
+ const issues = await engine.detectIssues(thought, graph);
274
274
  assert.ok(Array.isArray(issues));
275
275
  issues.forEach(issue => {
276
276
  assert.ok(['logical', 'factual', 'assumption', 'calibration'].includes(issue.type));
@@ -279,13 +279,13 @@ describe('SelfCorrectionEngine', () => {
279
279
  assert.ok(issue.suggestion);
280
280
  });
281
281
  });
282
- test('should detect no issues in well-formed thought', () => {
282
+ test('should detect no issues in well-formed thought', async () => {
283
283
  const sessionId = 'test-session';
284
284
  const thought = graph.createThought(sessionId, 'Well-formed thought with clear reasoning', {
285
285
  confidence: 0.95,
286
286
  assumptions: ['valid-assumption'],
287
287
  });
288
- const issues = engine.detectIssues(thought, graph);
288
+ const issues = await engine.detectIssues(thought, graph);
289
289
  // Should either return empty array or only low severity issues
290
290
  issues.forEach(issue => {
291
291
  assert.ok(issue.severity === 'low');
@@ -324,25 +324,25 @@ describe('AdaptiveGranularityEngine', () => {
324
324
  beforeEach(() => {
325
325
  engine = new AdaptiveGranularityEngine();
326
326
  });
327
- test('should calculate granularity for simple topic', () => {
327
+ test('should calculate granularity for simple topic', async () => {
328
328
  const context = createMockContext();
329
- const result = engine.calculateGranularity('Simple topic', context, 1);
329
+ const result = await engine.calculateGranularity('Simple topic', context, 1);
330
330
  assert.ok(typeof result.detail === 'number');
331
331
  assert.ok(result.detail > 0 && result.detail <= 1);
332
332
  assert.ok(result.reasoning);
333
333
  });
334
- test('should calculate granularity for complex topic', () => {
334
+ test('should calculate granularity for complex topic', async () => {
335
335
  const context = createMockContext();
336
336
  const complexTopic = 'Analyze the implications of quantum computing on cryptographic systems';
337
- const result = engine.calculateGranularity(complexTopic, context, 1);
337
+ const result = await engine.calculateGranularity(complexTopic, context, 1);
338
338
  assert.ok(result.detail > 0);
339
339
  assert.ok(result.reasoning.length > 0);
340
340
  });
341
- test('should adjust granularity based on depth', () => {
341
+ test('should adjust granularity based on depth', async () => {
342
342
  const context = createMockContext();
343
343
  const topic = 'Test topic';
344
- const shallow = engine.calculateGranularity(topic, context, 1);
345
- const deep = engine.calculateGranularity(topic, context, 10);
344
+ const shallow = await engine.calculateGranularity(topic, context, 1);
345
+ const deep = await engine.calculateGranularity(topic, context, 10);
346
346
  // Deeper depth might suggest different granularity
347
347
  assert.ok(typeof shallow.detail === 'number');
348
348
  assert.ok(typeof deep.detail === 'number');
@@ -354,7 +354,7 @@ describe('AdaptiveGranularityEngine', () => {
354
354
  assert.ok(typeof recommendation.detail === 'number');
355
355
  assert.ok(recommendation.reasoning);
356
356
  });
357
- test('should handle empty context', () => {
357
+ test('should handle empty context', async () => {
358
358
  const emptyContext = {
359
359
  originalProblem: '',
360
360
  constraints: [],
@@ -362,11 +362,11 @@ describe('AdaptiveGranularityEngine', () => {
362
362
  workingMemory: new Map(),
363
363
  longTermReferences: [],
364
364
  };
365
- const result = engine.calculateGranularity('Topic', emptyContext, 1);
365
+ const result = await engine.calculateGranularity('Topic', emptyContext, 1);
366
366
  assert.ok(typeof result.detail === 'number');
367
367
  assert.ok(result.reasoning);
368
368
  });
369
- test('should handle very complex context', () => {
369
+ test('should handle very complex context', async () => {
370
370
  const complexContext = {
371
371
  originalProblem: 'Complex multi-faceted problem',
372
372
  constraints: Array(20).fill('constraint'),
@@ -374,7 +374,7 @@ describe('AdaptiveGranularityEngine', () => {
374
374
  workingMemory: new Map(Array(30).fill(0).map((_, i) => [`key${i}`, `value${i}`])),
375
375
  longTermReferences: Array(10).fill('ref'),
376
376
  };
377
- const result = engine.calculateGranularity('Complex topic', complexContext, 5);
377
+ const result = await engine.calculateGranularity('Complex topic', complexContext, 5);
378
378
  assert.ok(typeof result.detail === 'number');
379
379
  assert.ok(result.detail > 0 && result.detail <= 1);
380
380
  });