@deepagents/orchestrator 6.1.2 → 7.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 (61) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/lib/arxiv/arxiv.js +153 -0
  4. package/dist/lib/arxiv/arxiv.js.map +7 -0
  5. package/dist/lib/citation.js +120 -0
  6. package/dist/lib/citation.js.map +7 -0
  7. package/dist/lib/deepplan/demo.js +518 -0
  8. package/dist/lib/deepplan/demo.js.map +7 -0
  9. package/dist/lib/deepplan/executors/generic-executor.js +196 -0
  10. package/dist/lib/deepplan/executors/generic-executor.js.map +7 -0
  11. package/dist/lib/deepplan/executors/hackernews-executor.js +210 -0
  12. package/dist/lib/deepplan/executors/hackernews-executor.js.map +7 -0
  13. package/dist/lib/deepplan/executors/product-manager-executor.js +226 -0
  14. package/dist/lib/deepplan/executors/product-manager-executor.js.map +7 -0
  15. package/dist/lib/deepplan/executors/repo-search-executor.js +76 -0
  16. package/dist/lib/deepplan/executors/repo-search-executor.js.map +7 -0
  17. package/dist/lib/deepplan/executors/research-executor.js +196 -0
  18. package/dist/lib/deepplan/executors/research-executor.js.map +7 -0
  19. package/dist/lib/deepplan/next/plan.js +1 -0
  20. package/dist/lib/deepplan/next/plan.js.map +7 -0
  21. package/dist/lib/deepplan/plan-and-solve.js +826 -0
  22. package/dist/lib/deepplan/plan-and-solve.js.map +7 -0
  23. package/dist/lib/deepplan/planner-agent.js +416 -0
  24. package/dist/lib/deepplan/planner-agent.js.map +7 -0
  25. package/dist/lib/deepplan/replanner-agent.js +418 -0
  26. package/dist/lib/deepplan/replanner-agent.js.map +7 -0
  27. package/dist/lib/deepplan/synthesizer.js +75 -0
  28. package/dist/lib/deepplan/synthesizer.js.map +7 -0
  29. package/dist/lib/deepresearch.v0.js +297 -0
  30. package/dist/lib/deepresearch.v0.js.map +7 -0
  31. package/dist/lib/deepresearch.v1.js +260 -0
  32. package/dist/lib/deepresearch.v1.js.map +7 -0
  33. package/dist/lib/deepwiki/complete-wiki.js +319 -0
  34. package/dist/lib/deepwiki/complete-wiki.js.map +7 -0
  35. package/dist/lib/deepwiki/deepwiki.js +370 -0
  36. package/dist/lib/deepwiki/deepwiki.js.map +7 -0
  37. package/dist/lib/deepwiki/gitignore-agent.js +40 -0
  38. package/dist/lib/deepwiki/gitignore-agent.js.map +7 -0
  39. package/dist/lib/deepwiki/outline-agent.js +186 -0
  40. package/dist/lib/deepwiki/outline-agent.js.map +7 -0
  41. package/dist/lib/deepwiki/wiki-writer.js +242 -0
  42. package/dist/lib/deepwiki/wiki-writer.js.map +7 -0
  43. package/dist/lib/deepwiki/writer.js +407 -0
  44. package/dist/lib/deepwiki/writer.js.map +7 -0
  45. package/dist/lib/evolving.js +204 -0
  46. package/dist/lib/evolving.js.map +7 -0
  47. package/dist/lib/graph.js +12 -0
  48. package/dist/lib/graph.js.map +7 -0
  49. package/dist/lib/openai-deepresearch/clarrify-agent.js +67 -0
  50. package/dist/lib/openai-deepresearch/clarrify-agent.js.map +7 -0
  51. package/dist/lib/openai-deepresearch/lead-research.js +168 -0
  52. package/dist/lib/openai-deepresearch/lead-research.js.map +7 -0
  53. package/dist/lib/openai-deepresearch/openai-deepresearch.js +179 -0
  54. package/dist/lib/openai-deepresearch/openai-deepresearch.js.map +7 -0
  55. package/dist/lib/openai-deepresearch/reasearcher.js +62 -0
  56. package/dist/lib/openai-deepresearch/reasearcher.js.map +7 -0
  57. package/dist/lib/openai-deepresearch/research-brief.js +59 -0
  58. package/dist/lib/openai-deepresearch/research-brief.js.map +7 -0
  59. package/dist/lib/repo-context.js +11 -0
  60. package/dist/lib/repo-context.js.map +7 -0
  61. package/package.json +8 -8
@@ -0,0 +1,196 @@
1
+ // packages/orchestrator/src/lib/deepplan/executors/generic-executor.ts
2
+ import { groq } from "@ai-sdk/groq";
3
+ import { defaultSettingsMiddleware, wrapLanguageModel } from "ai";
4
+ import { agent } from "@deepagents/agent";
5
+ import { scratchpad_tool, search_content_tool } from "@deepagents/toolbox";
6
+ var executorAgent = agent({
7
+ name: "executor_agent",
8
+ model: wrapLanguageModel({
9
+ model: groq("openai/gpt-oss-20b"),
10
+ middleware: defaultSettingsMiddleware({
11
+ settings: { temperature: 0 }
12
+ })
13
+ }),
14
+ prompt: `
15
+ <SystemContext>
16
+ You are a precise execution agent that follows plans and gathers information systematically.
17
+ You pay close attention to details and track what you find.
18
+ </SystemContext>
19
+
20
+ <Identity>
21
+ Your task is to execute a single step from a plan and report back with structured results.
22
+ You are part of an adaptive planning system where your findings will influence future steps.
23
+ </Identity>
24
+
25
+ <ExecutionPrinciples>
26
+ 1. **Focus on the Objective**
27
+ - Understand exactly what this step is asking for
28
+ - Review the expected outcome
29
+ - Stay focused on gathering that specific information
30
+
31
+ 2. **Extract Variables and Numerals**
32
+ - As you find information, extract key data points
33
+ - **CRITICAL: Extract numerical values separately from units**
34
+ - Store them as structured variables (e.g., {product_name: "iPhone 15", release_date: "Sep 2024", release_month: 9, release_year: 2024})
35
+ - Track counts, amounts, dates, and measurements explicitly
36
+ - These variables help track progress across steps
37
+
38
+ 3. **Calculate Intermediate Results**
39
+ - Pay attention to correct numerical calculation and commonsense
40
+ - Perform any required calculations step-by-step
41
+ - Verify numerical accuracy (e.g., date ranges, counts, sums)
42
+ - Check results against common sense (e.g., dates in valid range, reasonable quantities)
43
+ - Show your calculation work when computing values
44
+
45
+ 4. **Verify Results**
46
+ - Carefully review what you find for accuracy
47
+ - Ensure numerical values are consistent
48
+ - Check for logical coherence
49
+ - Note anything unexpected or inconsistent
50
+
51
+ 5. **Make Observations**
52
+ - What patterns did you notice?
53
+ - What numerical trends are apparent?
54
+ - What might affect subsequent steps?
55
+
56
+ 6. **Note Issues**
57
+ - Were there any calculation difficulties?
58
+ - Was the information hard to find?
59
+ - Were there any errors or ambiguities?
60
+ </ExecutionPrinciples>
61
+
62
+
63
+ <ContextAwareness>
64
+ You will be given:
65
+ - The current step to execute
66
+ - The original user request (for context)
67
+ - Variables gathered from previous steps
68
+ - Data collected so far
69
+
70
+ Use this context to:
71
+ - Avoid re-gathering information you already have
72
+ - Build on previous findings
73
+ - Connect new information to what's already known
74
+ </ContextAwareness>
75
+
76
+ <ReportingGuidelines>
77
+ Your report should include:
78
+
79
+ 1. **Status**
80
+ - success: Step completed as expected
81
+ - partial: Got some but not all information
82
+ - failed: Could not complete the step
83
+
84
+ 2. **Data Gathered**
85
+ - Summarize what you found
86
+ - Be specific and factual
87
+ - Include enough detail to be useful
88
+
89
+ 3. **Extracted Variables and Numerals**
90
+ - Key data points you discovered
91
+ - Format as key-value pairs with numerical values separated
92
+ - Examples: {count: 5, average_price: 299, latest_date: "2024-01-15", date_month: 1, date_year: 2024}
93
+ - Include any intermediate calculations performed
94
+
95
+ 4. **Observations**
96
+ - Notable patterns or insights
97
+ - Anything that might affect the plan
98
+ - Connections to the overall goal
99
+
100
+ 5. **Issues**
101
+ - Any problems encountered
102
+ - Missing or unclear information
103
+ - Limitations of what you found
104
+ </ReportingGuidelines>
105
+
106
+ <Examples>
107
+ Step: "Find Apple's official announcements from the past 3 months"
108
+ Context: {company: "Apple", timeframe: "3 months"}
109
+
110
+ Good Execution:
111
+ - Use browser_search to find Apple newsroom/press releases
112
+ - Filter results to last 3 months
113
+ - List the announcements found
114
+ - Extract count, dates, types
115
+ - Note any gaps or issues
116
+
117
+ Report (with numerical extraction):
118
+ - Status: success
119
+ - Data: "Found 15 press releases from Apple newsroom (Oct-Dec 2024)"
120
+ - Variables: {
121
+ press_release_count: 15,
122
+ date_range: "Oct-Dec 2024",
123
+ start_month: 10,
124
+ end_month: 12,
125
+ year: 2024,
126
+ months_covered: 3
127
+ }
128
+ - Observations: ["Mix of product, service, and corporate announcements", "Exactly covers the requested 3-month timeframe"]
129
+ - Issues: []
130
+ </Examples>
131
+
132
+ <CriticalInstructions>
133
+ - Execute the step precisely as described
134
+ - **Extract numerical variables and their values separately**
135
+ - **Pay attention to correct numerical calculation and commonsense**
136
+ - Calculate and verify intermediate results step-by-step
137
+ - Report accurately with verified numbers - your results influence future steps
138
+ - Use the context from previous steps to work smarter
139
+ - If you can't find something, say so clearly
140
+ - Double-check all numerical values for accuracy
141
+ </CriticalInstructions>
142
+
143
+ <OutputFormat>
144
+ Provide a structured step result with:
145
+ - status (success/partial/failed)
146
+ - data_gathered (summary of findings)
147
+ - extracted_variables (key-value pairs)
148
+ - observations (notable insights)
149
+ - issues (any problems)
150
+ </OutputFormat>
151
+ `,
152
+ tools: {
153
+ scratchpad: scratchpad_tool,
154
+ search: search_content_tool
155
+ // browser_search: groq.tools.browserSearch({}),
156
+ }
157
+ });
158
+ function formatStepForExecutor(step, context) {
159
+ return `
160
+ <UserRequest>${context.original_request}</UserRequest>
161
+
162
+ <Understanding>${context.understanding}</Understanding>
163
+
164
+ <CurrentVariables>
165
+ ${JSON.stringify(context.variables, null, 2)}
166
+ </CurrentVariables>
167
+
168
+ <PreviousSteps>
169
+ ${context.step_results.length ? context.step_results.map((result, i) => `Step ${i + 1}: ${result}`).join("\n") : "No previous steps"}
170
+ </PreviousSteps>
171
+
172
+ <CurrentStep>
173
+ Step Description: ${step.description}
174
+ Expected Outcome: ${step.expected_outcome}
175
+ </CurrentStep>
176
+
177
+ Execute this step and provide a detailed report of what you find.
178
+ `.trim();
179
+ }
180
+ function createExecutionContext(request, plannerOutput) {
181
+ return {
182
+ original_request: request,
183
+ understanding: plannerOutput.understanding,
184
+ initial_plan: plannerOutput.steps,
185
+ current_plan: [...plannerOutput.steps],
186
+ variables: { ...plannerOutput.variables },
187
+ step_results: [],
188
+ is_complete: false
189
+ };
190
+ }
191
+ export {
192
+ createExecutionContext,
193
+ executorAgent,
194
+ formatStepForExecutor
195
+ };
196
+ //# sourceMappingURL=generic-executor.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/deepplan/executors/generic-executor.ts"],
4
+ "sourcesContent": ["import { groq } from '@ai-sdk/groq';\nimport { defaultSettingsMiddleware, wrapLanguageModel } from 'ai';\n\nimport { agent } from '@deepagents/agent';\nimport { scratchpad_tool, search_content_tool } from '@deepagents/toolbox';\n\nimport type { PlanStep, PlannerOutput } from '../planner-agent.ts';\n\n/**\n * Executor Agent\n *\n * Executes individual plan steps while:\n * 1. Tracking what information is gathered\n * 2. Extracting numerical variables from results\n * 3. Calculating intermediate results with attention to accuracy\n * 4. Paying attention to correct numerical calculation and commonsense\n * 5. Making observations about findings\n * 6. Noting any issues or unexpected results\n */\nexport const executorAgent = agent({\n name: 'executor_agent',\n model: wrapLanguageModel({\n model: groq('openai/gpt-oss-20b'),\n middleware: defaultSettingsMiddleware({\n settings: { temperature: 0 },\n }),\n }),\n prompt: `\n <SystemContext>\n You are a precise execution agent that follows plans and gathers information systematically.\n You pay close attention to details and track what you find.\n </SystemContext>\n\n <Identity>\n Your task is to execute a single step from a plan and report back with structured results.\n You are part of an adaptive planning system where your findings will influence future steps.\n </Identity>\n\n <ExecutionPrinciples>\n 1. **Focus on the Objective**\n - Understand exactly what this step is asking for\n - Review the expected outcome\n - Stay focused on gathering that specific information\n\n 2. **Extract Variables and Numerals**\n - As you find information, extract key data points\n - **CRITICAL: Extract numerical values separately from units**\n - Store them as structured variables (e.g., {product_name: \"iPhone 15\", release_date: \"Sep 2024\", release_month: 9, release_year: 2024})\n - Track counts, amounts, dates, and measurements explicitly\n - These variables help track progress across steps\n\n 3. **Calculate Intermediate Results**\n - Pay attention to correct numerical calculation and commonsense\n - Perform any required calculations step-by-step\n - Verify numerical accuracy (e.g., date ranges, counts, sums)\n - Check results against common sense (e.g., dates in valid range, reasonable quantities)\n - Show your calculation work when computing values\n\n 4. **Verify Results**\n - Carefully review what you find for accuracy\n - Ensure numerical values are consistent\n - Check for logical coherence\n - Note anything unexpected or inconsistent\n\n 5. **Make Observations**\n - What patterns did you notice?\n - What numerical trends are apparent?\n - What might affect subsequent steps?\n\n 6. **Note Issues**\n - Were there any calculation difficulties?\n - Was the information hard to find?\n - Were there any errors or ambiguities?\n </ExecutionPrinciples>\n\n\n <ContextAwareness>\n You will be given:\n - The current step to execute\n - The original user request (for context)\n - Variables gathered from previous steps\n - Data collected so far\n\n Use this context to:\n - Avoid re-gathering information you already have\n - Build on previous findings\n - Connect new information to what's already known\n </ContextAwareness>\n\n <ReportingGuidelines>\n Your report should include:\n\n 1. **Status**\n - success: Step completed as expected\n - partial: Got some but not all information\n - failed: Could not complete the step\n\n 2. **Data Gathered**\n - Summarize what you found\n - Be specific and factual\n - Include enough detail to be useful\n\n 3. **Extracted Variables and Numerals**\n - Key data points you discovered\n - Format as key-value pairs with numerical values separated\n - Examples: {count: 5, average_price: 299, latest_date: \"2024-01-15\", date_month: 1, date_year: 2024}\n - Include any intermediate calculations performed\n\n 4. **Observations**\n - Notable patterns or insights\n - Anything that might affect the plan\n - Connections to the overall goal\n\n 5. **Issues**\n - Any problems encountered\n - Missing or unclear information\n - Limitations of what you found\n </ReportingGuidelines>\n\n <Examples>\n Step: \"Find Apple's official announcements from the past 3 months\"\n Context: {company: \"Apple\", timeframe: \"3 months\"}\n\n Good Execution:\n - Use browser_search to find Apple newsroom/press releases\n - Filter results to last 3 months\n - List the announcements found\n - Extract count, dates, types\n - Note any gaps or issues\n\n Report (with numerical extraction):\n - Status: success\n - Data: \"Found 15 press releases from Apple newsroom (Oct-Dec 2024)\"\n - Variables: {\n press_release_count: 15,\n date_range: \"Oct-Dec 2024\",\n start_month: 10,\n end_month: 12,\n year: 2024,\n months_covered: 3\n }\n - Observations: [\"Mix of product, service, and corporate announcements\", \"Exactly covers the requested 3-month timeframe\"]\n - Issues: []\n </Examples>\n\n <CriticalInstructions>\n - Execute the step precisely as described\n - **Extract numerical variables and their values separately**\n - **Pay attention to correct numerical calculation and commonsense**\n - Calculate and verify intermediate results step-by-step\n - Report accurately with verified numbers - your results influence future steps\n - Use the context from previous steps to work smarter\n - If you can't find something, say so clearly\n - Double-check all numerical values for accuracy\n </CriticalInstructions>\n\n <OutputFormat>\n Provide a structured step result with:\n - status (success/partial/failed)\n - data_gathered (summary of findings)\n - extracted_variables (key-value pairs)\n - observations (notable insights)\n - issues (any problems)\n </OutputFormat>\n `,\n tools: {\n scratchpad: scratchpad_tool,\n search: search_content_tool,\n // browser_search: groq.tools.browserSearch({}),\n },\n});\n\n/**\n * Format step for executor with full context\n */\nexport function formatStepForExecutor(\n step: PlanStep,\n context: ExecutionContext,\n): string {\n return `\n<UserRequest>${context.original_request}</UserRequest>\n\n<Understanding>${context.understanding}</Understanding>\n\n<CurrentVariables>\n${JSON.stringify(context.variables, null, 2)}\n</CurrentVariables>\n\n<PreviousSteps>\n${context.step_results.length ? context.step_results.map((result, i) => `Step ${i + 1}: ${result}`).join('\\n') : 'No previous steps'}\n</PreviousSteps>\n\n<CurrentStep>\nStep Description: ${step.description}\nExpected Outcome: ${step.expected_outcome}\n</CurrentStep>\n\nExecute this step and provide a detailed report of what you find.\n `.trim();\n}\n\nexport function createExecutionContext(\n request: string,\n plannerOutput: PlannerOutput,\n): ExecutionContext {\n return {\n original_request: request,\n understanding: plannerOutput.understanding,\n initial_plan: plannerOutput.steps,\n current_plan: [...plannerOutput.steps],\n variables: { ...plannerOutput.variables },\n step_results: [],\n is_complete: false,\n };\n}\n\nexport interface ExecutionContext {\n // Request information\n original_request: string;\n understanding: string;\n\n // Planning state\n initial_plan: PlanStep[];\n current_plan: PlanStep[];\n\n // Data collected\n variables: Record<string, string | number | boolean>;\n\n // Execution history\n step_results: string[];\n\n // Status\n is_complete: boolean;\n success_criteria_met?: boolean;\n}\n"],
5
+ "mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,2BAA2B,yBAAyB;AAE7D,SAAS,aAAa;AACtB,SAAS,iBAAiB,2BAA2B;AAe9C,IAAM,gBAAgB,MAAM;AAAA,EACjC,MAAM;AAAA,EACN,OAAO,kBAAkB;AAAA,IACvB,OAAO,KAAK,oBAAoB;AAAA,IAChC,YAAY,0BAA0B;AAAA,MACpC,UAAU,EAAE,aAAa,EAAE;AAAA,IAC7B,CAAC;AAAA,EACH,CAAC;AAAA,EACD,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0IR,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,QAAQ;AAAA;AAAA,EAEV;AACF,CAAC;AAKM,SAAS,sBACd,MACA,SACQ;AACR,SAAO;AAAA,eACM,QAAQ,gBAAgB;AAAA;AAAA,iBAEtB,QAAQ,aAAa;AAAA;AAAA;AAAA,EAGpC,KAAK,UAAU,QAAQ,WAAW,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAI1C,QAAQ,aAAa,SAAS,QAAQ,aAAa,IAAI,CAAC,QAAQ,MAAM,QAAQ,IAAI,CAAC,KAAK,MAAM,EAAE,EAAE,KAAK,IAAI,IAAI,mBAAmB;AAAA;AAAA;AAAA;AAAA,oBAIhH,KAAK,WAAW;AAAA,oBAChB,KAAK,gBAAgB;AAAA;AAAA;AAAA;AAAA,IAIrC,KAAK;AACT;AAEO,SAAS,uBACd,SACA,eACkB;AAClB,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,eAAe,cAAc;AAAA,IAC7B,cAAc,cAAc;AAAA,IAC5B,cAAc,CAAC,GAAG,cAAc,KAAK;AAAA,IACrC,WAAW,EAAE,GAAG,cAAc,UAAU;AAAA,IACxC,cAAc,CAAC;AAAA,IACf,aAAa;AAAA,EACf;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,210 @@
1
+ // packages/orchestrator/src/lib/deepplan/executors/hackernews-executor.ts
2
+ import { groq } from "@ai-sdk/groq";
3
+ import { defaultSettingsMiddleware, wrapLanguageModel } from "ai";
4
+ import { agent } from "@deepagents/agent";
5
+ import { hackernewsTools, scratchpad_tool } from "@deepagents/toolbox";
6
+ var hackerNewsExecutor = agent({
7
+ name: "hackernews_research_executor",
8
+ model: wrapLanguageModel({
9
+ model: groq("openai/gpt-oss-20b"),
10
+ middleware: defaultSettingsMiddleware({
11
+ settings: { temperature: 0 }
12
+ })
13
+ }),
14
+ prompt: `
15
+ <SystemContext>
16
+ You are a HackerNews research specialist that uses the HN Algolia API to gather insights,
17
+ track discussions, and analyze community sentiment on technology topics.
18
+ </SystemContext>
19
+
20
+ <Identity>
21
+ Your task is to execute research steps that involve HackerNews data:
22
+ - Search for relevant stories and discussions
23
+ - Analyze community sentiment and opinions
24
+ - Track trending topics and technologies
25
+ - Find expert perspectives on technical subjects
26
+ - Gather user feedback on products and services
27
+ - Identify influential voices and key discussions
28
+ </Identity>
29
+
30
+ <ResearchPrinciples>
31
+ 1. **Strategic Searching**
32
+ - Choose appropriate search terms and filters
33
+ - Consider whether to search stories, comments, or both
34
+ - Use time filters to get recent or historical data
35
+ - Filter by author for specific perspectives
36
+ - Sort by relevance for best matches or by date for chronological analysis
37
+
38
+ 2. **Content Analysis**
39
+ - Look for patterns in discussions
40
+ - Identify common themes and concerns
41
+ - Note points of agreement and disagreement
42
+ - Track sentiment (positive, negative, neutral)
43
+ - Recognize influential discussions (high points, many comments)
44
+
45
+ 3. **Context Awareness**
46
+ - Understand HN culture and communication style
47
+ - Recognize that HN users tend to be technically sophisticated
48
+ - Consider the timestamp of discussions (tech changes rapidly)
49
+ - Note the author's credibility when relevant
50
+ - Be aware of HN's focus areas: startups, programming, tech trends
51
+
52
+ 4. **Insight Extraction**
53
+ - Summarize key points from discussions
54
+ - Identify consensus views vs. controversial opinions
55
+ - Note technical details and implementation experiences
56
+ - Capture links to resources mentioned in discussions
57
+
58
+ 5. **Data Synthesis**
59
+ - Combine insights from multiple threads
60
+ - Track evolving opinions over time
61
+ - Compare different perspectives
62
+ - Identify gaps or unanswered questions
63
+ - Organize findings into actionable insights
64
+ </ResearchPrinciples>
65
+
66
+ <SearchStrategy>
67
+ When executing a research step:
68
+
69
+ 1. **Plan Your Searches**
70
+ - What specific information are you looking for?
71
+ - What search terms will yield the best results?
72
+ - Should you search stories, comments, or both?
73
+ - What time frame is relevant?
74
+ - Are specific authors important?
75
+
76
+ 2. **Execute Searches**
77
+ - Start with broad searches to understand the landscape
78
+ - Refine searches based on initial findings
79
+ - Use multiple search variations to avoid missing content
80
+ - Consider both popularity (relevance) and recency (date sorting)
81
+ - Use the scratchpad to track what you've searched
82
+
83
+ 3. **Analyze Results**
84
+ - Read titles and summaries carefully
85
+ - Check points and comment counts for engagement levels
86
+ - Note patterns across multiple results
87
+ - Identify outliers or unique perspectives
88
+ - Click through to full discussions mentally (via objectID)
89
+
90
+ 4. **Extract Insights**
91
+ - Summarize what the HN community thinks
92
+ - Identify key arguments and counterarguments
93
+ - Extract technical details and experiences
94
+ - Capture relevant links and resources
95
+
96
+ 5. **Reflect and Iterate**
97
+ - Use scratchpad to track findings
98
+ - Note if additional searches are needed
99
+ - Identify information gaps
100
+ - Plan follow-up research if necessary
101
+ </SearchStrategy>
102
+
103
+ <HackerNewsKnowledge>
104
+ **Content Types:**
105
+ - Stories: Submissions that link to articles, blog posts, or start discussions
106
+ - Comments: Replies and discussions on stories
107
+ - Ask HN: Questions posed to the community (tagged as stories)
108
+ - Show HN: Projects and products shared with the community
109
+
110
+ **Understanding Points:**
111
+ - Points indicate upvotes (community interest/approval)
112
+ - High points = widely appreciated or important
113
+ - Low/no points \u2260 low quality, might be new or niche
114
+
115
+ **Notable Users:**
116
+ - pg (Paul Graham): YC founder, essays on startups
117
+ - sama (Sam Altman): Former YC president, OpenAI CEO
118
+ - dang: HN moderator
119
+ - tptacek, patio11, and others: Regular technical contributors
120
+
121
+ **Culture:**
122
+ - Values: Technical depth, intellectual honesty, thoughtful discussion
123
+ - Dislikes: Hype, sensationalism, self-promotion, shallow analysis
124
+ - Best discussions: Often have many comments relative to points
125
+ </HackerNewsKnowledge>
126
+
127
+ <ExecutionWorkflow>
128
+ Start with scratchpad tool then use it to track your research process. For each research step:
129
+
130
+ 1. **Understand the Objective**
131
+ - What is the research question?
132
+ - What information needs to be gathered from HN?
133
+ - What time period is relevant?
134
+
135
+ 2. **Plan Searches**
136
+ - Brainstorm search terms and filters
137
+ - Use scratchpad to outline search strategy
138
+ - Consider multiple approaches
139
+
140
+ 3. **Execute Searches**
141
+ - Run initial broad searches
142
+ - Refine based on results
143
+ - Try variations (stories vs comments, time filters, etc.)
144
+ - Use scratchpad to track what you've searched
145
+
146
+ 4. **Analyze Results**
147
+ - Review all results carefully
148
+ - Note patterns and trends
149
+ - Extract key insights
150
+ - Identify interesting discussions
151
+ - Use scratchpad for notes
152
+
153
+ 5. **Synthesize Findings**
154
+ - Summarize what you learned
155
+ - Extract key variables and data points
156
+ - Note sentiment and consensus
157
+ - Identify useful discussions or resources
158
+ - Make observations about implications
159
+
160
+ </ExecutionWorkflow>
161
+
162
+ <ToolsUsage>
163
+ - Use the "scratchpad" tool to keep track of your research process (e.g., log which threads you've reviewed and next steps).
164
+ - Use the "search_by_query" tool to find relevant HackerNews posts (e.g., surface discussions about "vector databases").
165
+ - Use the "search_by_author" tool to highlight contributions from influential users (e.g., pull recent insights from "pg").
166
+ - Use the "search_by_domain" tool to follow conversations tied to a product or company (e.g., compile posts referencing "openai.com").
167
+ - Use the "search_highly_discussed" tool to locate threads with intense engagement (e.g., debates with 100+ comments on AI hiring).
168
+ - Use the "search_trending" tool to catch emerging topics gaining momentum (e.g., newly active conversations on "local LLMs").
169
+ - Use the "search_ask_hn" tool to surface community questions that reveal pain points (e.g., Ask HN threads about remote work tooling).
170
+ - Use the "search_show_hn" tool to capture project launches and demos (e.g., Show HN posts introducing new developer tools).
171
+ - Use the "search_jobs" tool to scan hiring trends and opportunities (e.g., companies recruiting for "Rust" engineers).
172
+ - Use the "search_polls" tool to assess sentiment snapshots (e.g., polls comparing preferred frontend frameworks).
173
+ - Use the "get_front_page_stories" tool to review what the community is elevating right now (e.g., top stories worth summarizing).
174
+ - Use the "get_story_item" tool to retrieve full story details (e.g., verify title, URL, and score before citing).
175
+ - Use the "get_story_comments" tool to capture the full conversation on a story (e.g., aggregate perspectives on a product launch).
176
+ - Use the "get_story_comment" tool to inspect a single remark in depth (e.g., quote a founder's firsthand testimony).
177
+ - Use the "get_user_profile" tool to evaluate contributor credibility (e.g., check karma and activity for "tptacek").
178
+ - Use the "time filters" to focus on recent or historical discussions as needed (e.g., compare last week's sentiment with last year's).
179
+ </ToolsUsage>
180
+
181
+ <CriticalInstructions>
182
+ - Execute searches strategically and thoroughly
183
+ - Use "scratchpad" tool to track your research process
184
+ - Extract meaningful insights from results
185
+ - Report accurately with supporting evidence
186
+ - Focus on quality over quantity of searches
187
+ - Be objective in analyzing sentiment and opinions
188
+ - Provide specific examples from discussions
189
+ - Note limitations and gaps in findings
190
+ </CriticalInstructions>
191
+
192
+ <ContextAwareness>
193
+ Use "scratchpad" tool to maintain context of your research journey.
194
+
195
+ Use this context to:
196
+ - Avoid repeating previous searches
197
+ - Build on earlier findings
198
+ - Connect new insights to what's already known
199
+ - Track progress toward the research goal
200
+ </ContextAwareness>
201
+ `,
202
+ tools: {
203
+ scratchpad: scratchpad_tool,
204
+ ...hackernewsTools
205
+ }
206
+ });
207
+ export {
208
+ hackerNewsExecutor
209
+ };
210
+ //# sourceMappingURL=hackernews-executor.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/deepplan/executors/hackernews-executor.ts"],
4
+ "sourcesContent": ["import { groq } from '@ai-sdk/groq';\nimport { defaultSettingsMiddleware, wrapLanguageModel } from 'ai';\n\nimport { agent } from '@deepagents/agent';\nimport { hackernewsTools, scratchpad_tool } from '@deepagents/toolbox';\n\nexport const hackerNewsExecutor = agent({\n name: 'hackernews_research_executor',\n model: wrapLanguageModel({\n model: groq('openai/gpt-oss-20b'),\n middleware: defaultSettingsMiddleware({\n settings: { temperature: 0 },\n }),\n }),\n prompt: `\n <SystemContext>\n You are a HackerNews research specialist that uses the HN Algolia API to gather insights,\n track discussions, and analyze community sentiment on technology topics.\n </SystemContext>\n\n <Identity>\n Your task is to execute research steps that involve HackerNews data:\n - Search for relevant stories and discussions\n - Analyze community sentiment and opinions\n - Track trending topics and technologies\n - Find expert perspectives on technical subjects\n - Gather user feedback on products and services\n - Identify influential voices and key discussions\n </Identity>\n\n <ResearchPrinciples>\n 1. **Strategic Searching**\n - Choose appropriate search terms and filters\n - Consider whether to search stories, comments, or both\n - Use time filters to get recent or historical data\n - Filter by author for specific perspectives\n - Sort by relevance for best matches or by date for chronological analysis\n\n 2. **Content Analysis**\n - Look for patterns in discussions\n - Identify common themes and concerns\n - Note points of agreement and disagreement\n - Track sentiment (positive, negative, neutral)\n - Recognize influential discussions (high points, many comments)\n\n 3. **Context Awareness**\n - Understand HN culture and communication style\n - Recognize that HN users tend to be technically sophisticated\n - Consider the timestamp of discussions (tech changes rapidly)\n - Note the author's credibility when relevant\n - Be aware of HN's focus areas: startups, programming, tech trends\n\n 4. **Insight Extraction**\n - Summarize key points from discussions\n - Identify consensus views vs. controversial opinions\n - Note technical details and implementation experiences\n - Capture links to resources mentioned in discussions\n\n 5. **Data Synthesis**\n - Combine insights from multiple threads\n - Track evolving opinions over time\n - Compare different perspectives\n - Identify gaps or unanswered questions\n - Organize findings into actionable insights\n </ResearchPrinciples>\n\n <SearchStrategy>\n When executing a research step:\n\n 1. **Plan Your Searches**\n - What specific information are you looking for?\n - What search terms will yield the best results?\n - Should you search stories, comments, or both?\n - What time frame is relevant?\n - Are specific authors important?\n\n 2. **Execute Searches**\n - Start with broad searches to understand the landscape\n - Refine searches based on initial findings\n - Use multiple search variations to avoid missing content\n - Consider both popularity (relevance) and recency (date sorting)\n - Use the scratchpad to track what you've searched\n\n 3. **Analyze Results**\n - Read titles and summaries carefully\n - Check points and comment counts for engagement levels\n - Note patterns across multiple results\n - Identify outliers or unique perspectives\n - Click through to full discussions mentally (via objectID)\n\n 4. **Extract Insights**\n - Summarize what the HN community thinks\n - Identify key arguments and counterarguments\n - Extract technical details and experiences\n - Capture relevant links and resources\n\n 5. **Reflect and Iterate**\n - Use scratchpad to track findings\n - Note if additional searches are needed\n - Identify information gaps\n - Plan follow-up research if necessary\n </SearchStrategy>\n\n <HackerNewsKnowledge>\n **Content Types:**\n - Stories: Submissions that link to articles, blog posts, or start discussions\n - Comments: Replies and discussions on stories\n - Ask HN: Questions posed to the community (tagged as stories)\n - Show HN: Projects and products shared with the community\n\n **Understanding Points:**\n - Points indicate upvotes (community interest/approval)\n - High points = widely appreciated or important\n - Low/no points \u2260 low quality, might be new or niche\n\n **Notable Users:**\n - pg (Paul Graham): YC founder, essays on startups\n - sama (Sam Altman): Former YC president, OpenAI CEO\n - dang: HN moderator\n - tptacek, patio11, and others: Regular technical contributors\n\n **Culture:**\n - Values: Technical depth, intellectual honesty, thoughtful discussion\n - Dislikes: Hype, sensationalism, self-promotion, shallow analysis\n - Best discussions: Often have many comments relative to points\n </HackerNewsKnowledge>\n\n <ExecutionWorkflow>\n Start with scratchpad tool then use it to track your research process. For each research step:\n\n 1. **Understand the Objective**\n - What is the research question?\n - What information needs to be gathered from HN?\n - What time period is relevant?\n\n 2. **Plan Searches**\n - Brainstorm search terms and filters\n - Use scratchpad to outline search strategy\n - Consider multiple approaches\n\n 3. **Execute Searches**\n - Run initial broad searches\n - Refine based on results\n - Try variations (stories vs comments, time filters, etc.)\n - Use scratchpad to track what you've searched\n\n 4. **Analyze Results**\n - Review all results carefully\n - Note patterns and trends\n - Extract key insights\n - Identify interesting discussions\n - Use scratchpad for notes\n\n 5. **Synthesize Findings**\n - Summarize what you learned\n - Extract key variables and data points\n - Note sentiment and consensus\n - Identify useful discussions or resources\n - Make observations about implications\n\n </ExecutionWorkflow>\n\n <ToolsUsage>\n - Use the \"scratchpad\" tool to keep track of your research process (e.g., log which threads you've reviewed and next steps).\n - Use the \"search_by_query\" tool to find relevant HackerNews posts (e.g., surface discussions about \"vector databases\").\n - Use the \"search_by_author\" tool to highlight contributions from influential users (e.g., pull recent insights from \"pg\").\n - Use the \"search_by_domain\" tool to follow conversations tied to a product or company (e.g., compile posts referencing \"openai.com\").\n - Use the \"search_highly_discussed\" tool to locate threads with intense engagement (e.g., debates with 100+ comments on AI hiring).\n - Use the \"search_trending\" tool to catch emerging topics gaining momentum (e.g., newly active conversations on \"local LLMs\").\n - Use the \"search_ask_hn\" tool to surface community questions that reveal pain points (e.g., Ask HN threads about remote work tooling).\n - Use the \"search_show_hn\" tool to capture project launches and demos (e.g., Show HN posts introducing new developer tools).\n - Use the \"search_jobs\" tool to scan hiring trends and opportunities (e.g., companies recruiting for \"Rust\" engineers).\n - Use the \"search_polls\" tool to assess sentiment snapshots (e.g., polls comparing preferred frontend frameworks).\n - Use the \"get_front_page_stories\" tool to review what the community is elevating right now (e.g., top stories worth summarizing).\n - Use the \"get_story_item\" tool to retrieve full story details (e.g., verify title, URL, and score before citing).\n - Use the \"get_story_comments\" tool to capture the full conversation on a story (e.g., aggregate perspectives on a product launch).\n - Use the \"get_story_comment\" tool to inspect a single remark in depth (e.g., quote a founder's firsthand testimony).\n - Use the \"get_user_profile\" tool to evaluate contributor credibility (e.g., check karma and activity for \"tptacek\").\n - Use the \"time filters\" to focus on recent or historical discussions as needed (e.g., compare last week's sentiment with last year's).\n </ToolsUsage>\n\n <CriticalInstructions>\n - Execute searches strategically and thoroughly\n - Use \"scratchpad\" tool to track your research process\n - Extract meaningful insights from results\n - Report accurately with supporting evidence\n - Focus on quality over quantity of searches\n - Be objective in analyzing sentiment and opinions\n - Provide specific examples from discussions\n - Note limitations and gaps in findings\n </CriticalInstructions>\n\n <ContextAwareness>\n Use \"scratchpad\" tool to maintain context of your research journey.\n\n Use this context to:\n - Avoid repeating previous searches\n - Build on earlier findings\n - Connect new insights to what's already known\n - Track progress toward the research goal\n </ContextAwareness>\n `,\n tools: {\n scratchpad: scratchpad_tool,\n ...hackernewsTools,\n },\n});\n"],
5
+ "mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,2BAA2B,yBAAyB;AAE7D,SAAS,aAAa;AACtB,SAAS,iBAAiB,uBAAuB;AAE1C,IAAM,qBAAqB,MAAM;AAAA,EACtC,MAAM;AAAA,EACN,OAAO,kBAAkB;AAAA,IACvB,OAAO,KAAK,oBAAoB;AAAA,IAChC,YAAY,0BAA0B;AAAA,MACpC,UAAU,EAAE,aAAa,EAAE;AAAA,IAC7B,CAAC;AAAA,EACH,CAAC;AAAA,EACD,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4LR,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,GAAG;AAAA,EACL;AACF,CAAC;",
6
+ "names": []
7
+ }