@feelingmindful/thinking-graph 1.15.1 → 1.15.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/tools/research.js +23 -3
- package/package.json +1 -1
package/dist/tools/research.js
CHANGED
|
@@ -65,6 +65,18 @@ function searchFlags(input, recencyDefault) {
|
|
|
65
65
|
}
|
|
66
66
|
return flags.length ? ` ${flags.join(' ')}` : '';
|
|
67
67
|
}
|
|
68
|
+
// `parallel-cli research run` has no recency/domain flags (unlike `search`), so
|
|
69
|
+
// fold those constraints into the prompt text to avoid silently dropping them.
|
|
70
|
+
function withResearchConstraints(query, input) {
|
|
71
|
+
const parts = [];
|
|
72
|
+
const afterDate = afterDateFor(input.recencyFilter);
|
|
73
|
+
if (afterDate)
|
|
74
|
+
parts.push(`Only use sources published on or after ${afterDate}.`);
|
|
75
|
+
if (input.domainFilter?.length) {
|
|
76
|
+
parts.push(`Restrict sources to these domains: ${input.domainFilter.join(', ')}.`);
|
|
77
|
+
}
|
|
78
|
+
return parts.length ? `${query} ${parts.join(' ')}` : query;
|
|
79
|
+
}
|
|
68
80
|
function buildGroundedSteps(input) {
|
|
69
81
|
const steps = [];
|
|
70
82
|
const query = input.query;
|
|
@@ -103,8 +115,16 @@ function buildActionPlan(input) {
|
|
|
103
115
|
if (shouldPrependGrounded) {
|
|
104
116
|
steps.push(...buildGroundedSteps(input));
|
|
105
117
|
}
|
|
106
|
-
// grounded_qa
|
|
118
|
+
// grounded_qa prefers NotebookLM, but must still work when NotebookLM isn't
|
|
119
|
+
// installed or has no matching notebook — append a web-grounded fallback.
|
|
107
120
|
if (input.intent === 'grounded_qa') {
|
|
121
|
+
steps.push({
|
|
122
|
+
tool: 'Bash',
|
|
123
|
+
description: 'Fallback (use only if NotebookLM is unavailable or returned no matching notebook): cited answer via parallel-cli research run',
|
|
124
|
+
args: {
|
|
125
|
+
command: `parallel-cli research run --text ${shq(withResearchConstraints(query, input))} --processor pro -o .premium/research/research-grounded`,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
108
128
|
return steps;
|
|
109
129
|
}
|
|
110
130
|
// Choose the parallel-cli command based on intent.
|
|
@@ -124,7 +144,7 @@ function buildActionPlan(input) {
|
|
|
124
144
|
tool: 'Bash',
|
|
125
145
|
description: 'Step-by-step comparison with web grounding via parallel-cli research run',
|
|
126
146
|
args: {
|
|
127
|
-
command: `parallel-cli research run --text ${shq(query)} --text-description ${shq('step-by-step reasoning')} --processor pro -o .premium/research/research-compare`,
|
|
147
|
+
command: `parallel-cli research run --text ${shq(withResearchConstraints(query, input))} --text-description ${shq('step-by-step reasoning')} --processor pro -o .premium/research/research-compare`,
|
|
128
148
|
},
|
|
129
149
|
});
|
|
130
150
|
break;
|
|
@@ -133,7 +153,7 @@ function buildActionPlan(input) {
|
|
|
133
153
|
tool: 'Bash',
|
|
134
154
|
description: 'Deep multi-source research (30s+) via parallel-cli research run',
|
|
135
155
|
args: {
|
|
136
|
-
command: `parallel-cli research run --text ${shq(query)} --processor pro -o .premium/research/research-explore`,
|
|
156
|
+
command: `parallel-cli research run --text ${shq(withResearchConstraints(query, input))} --processor pro -o .premium/research/research-explore`,
|
|
137
157
|
},
|
|
138
158
|
});
|
|
139
159
|
break;
|
package/package.json
CHANGED