@deepagents/orchestrator 7.29.0 → 7.30.1

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/lib/deepplan/demo.js +8 -166
  2. package/dist/lib/deepplan/demo.js.map +4 -4
  3. package/dist/lib/deepplan/executors/generic-executor.d.ts +0 -12
  4. package/dist/lib/deepplan/executors/generic-executor.d.ts.map +1 -1
  5. package/dist/lib/deepplan/executors/generic-executor.js +0 -157
  6. package/dist/lib/deepplan/executors/generic-executor.js.map +2 -2
  7. package/dist/lib/deepplan/plan-and-solve.js +10 -166
  8. package/dist/lib/deepplan/plan-and-solve.js.map +3 -3
  9. package/dist/lib/deepplan/planner-agent.js +3 -159
  10. package/dist/lib/deepplan/planner-agent.js.map +3 -3
  11. package/dist/lib/deepplan/replanner-agent.js +3 -163
  12. package/dist/lib/deepplan/replanner-agent.js.map +4 -4
  13. package/package.json +4 -6
  14. package/dist/lib/arxiv/arxiv.d.ts +0 -14
  15. package/dist/lib/arxiv/arxiv.d.ts.map +0 -1
  16. package/dist/lib/arxiv/arxiv.js +0 -145
  17. package/dist/lib/arxiv/arxiv.js.map +0 -7
  18. package/dist/lib/citation.d.ts +0 -2
  19. package/dist/lib/citation.d.ts.map +0 -1
  20. package/dist/lib/citation.js +0 -117
  21. package/dist/lib/citation.js.map +0 -7
  22. package/dist/lib/deepplan/executors/product-manager-executor.d.ts +0 -13
  23. package/dist/lib/deepplan/executors/product-manager-executor.d.ts.map +0 -1
  24. package/dist/lib/deepplan/executors/product-manager-executor.js +0 -226
  25. package/dist/lib/deepplan/executors/product-manager-executor.js.map +0 -7
  26. package/dist/lib/deepplan/executors/repo-search-executor.d.ts +0 -11
  27. package/dist/lib/deepplan/executors/repo-search-executor.d.ts.map +0 -1
  28. package/dist/lib/deepplan/executors/repo-search-executor.js +0 -76
  29. package/dist/lib/deepplan/executors/repo-search-executor.js.map +0 -7
  30. package/dist/lib/deepresearch.v0.d.ts +0 -3
  31. package/dist/lib/deepresearch.v0.d.ts.map +0 -1
  32. package/dist/lib/deepresearch.v0.js +0 -300
  33. package/dist/lib/deepresearch.v0.js.map +0 -7
  34. package/dist/lib/deepwiki/complete-wiki.d.ts +0 -20
  35. package/dist/lib/deepwiki/complete-wiki.d.ts.map +0 -1
  36. package/dist/lib/deepwiki/complete-wiki.js +0 -321
  37. package/dist/lib/deepwiki/complete-wiki.js.map +0 -7
  38. package/dist/lib/deepwiki/deepwiki.d.ts +0 -2
  39. package/dist/lib/deepwiki/deepwiki.d.ts.map +0 -1
  40. package/dist/lib/deepwiki/deepwiki.js +0 -372
  41. package/dist/lib/deepwiki/deepwiki.js.map +0 -7
  42. package/dist/lib/deepwiki/gitignore-agent.d.ts +0 -6
  43. package/dist/lib/deepwiki/gitignore-agent.d.ts.map +0 -1
  44. package/dist/lib/deepwiki/gitignore-agent.js +0 -39
  45. package/dist/lib/deepwiki/gitignore-agent.js.map +0 -7
  46. package/dist/lib/deepwiki/outline-agent.d.ts +0 -22
  47. package/dist/lib/deepwiki/outline-agent.d.ts.map +0 -1
  48. package/dist/lib/deepwiki/outline-agent.js +0 -188
  49. package/dist/lib/deepwiki/outline-agent.js.map +0 -7
  50. package/dist/lib/deepwiki/wiki-writer.d.ts +0 -9
  51. package/dist/lib/deepwiki/wiki-writer.d.ts.map +0 -1
  52. package/dist/lib/deepwiki/wiki-writer.js +0 -244
  53. package/dist/lib/deepwiki/wiki-writer.js.map +0 -7
  54. package/dist/lib/deepwiki/writer.d.ts +0 -12
  55. package/dist/lib/deepwiki/writer.d.ts.map +0 -1
  56. package/dist/lib/deepwiki/writer.js +0 -407
  57. package/dist/lib/deepwiki/writer.js.map +0 -7
  58. package/dist/lib/graph.d.ts +0 -5
  59. package/dist/lib/graph.d.ts.map +0 -1
  60. package/dist/lib/graph.js +0 -12
  61. package/dist/lib/graph.js.map +0 -7
@@ -1,160 +1,4 @@
1
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
2
  function formatStepForExecutor(step, context) {
159
3
  return `
160
4
  <UserRequest>${context.original_request}</UserRequest>
@@ -190,7 +34,6 @@ function createExecutionContext(request, plannerOutput) {
190
34
  }
191
35
  export {
192
36
  createExecutionContext,
193
- executorAgent,
194
37
  formatStepForExecutor
195
38
  };
196
39
  //# sourceMappingURL=generic-executor.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
4
+ "sourcesContent": ["import type { PlanStep, PlannerOutput } from '../planner-agent.ts';\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": ";AAKO,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
6
  "names": []
7
7
  }
@@ -6,162 +6,6 @@ import {
6
6
  } from "@deepagents/agent";
7
7
 
8
8
  // packages/orchestrator/src/lib/deepplan/executors/generic-executor.ts
9
- import { groq } from "@ai-sdk/groq";
10
- import { defaultSettingsMiddleware, wrapLanguageModel } from "ai";
11
- import { agent } from "@deepagents/agent";
12
- import { scratchpad_tool, search_content_tool } from "@deepagents/toolbox";
13
- var executorAgent = agent({
14
- name: "executor_agent",
15
- model: wrapLanguageModel({
16
- model: groq("openai/gpt-oss-20b"),
17
- middleware: defaultSettingsMiddleware({
18
- settings: { temperature: 0 }
19
- })
20
- }),
21
- prompt: `
22
- <SystemContext>
23
- You are a precise execution agent that follows plans and gathers information systematically.
24
- You pay close attention to details and track what you find.
25
- </SystemContext>
26
-
27
- <Identity>
28
- Your task is to execute a single step from a plan and report back with structured results.
29
- You are part of an adaptive planning system where your findings will influence future steps.
30
- </Identity>
31
-
32
- <ExecutionPrinciples>
33
- 1. **Focus on the Objective**
34
- - Understand exactly what this step is asking for
35
- - Review the expected outcome
36
- - Stay focused on gathering that specific information
37
-
38
- 2. **Extract Variables and Numerals**
39
- - As you find information, extract key data points
40
- - **CRITICAL: Extract numerical values separately from units**
41
- - Store them as structured variables (e.g., {product_name: "iPhone 15", release_date: "Sep 2024", release_month: 9, release_year: 2024})
42
- - Track counts, amounts, dates, and measurements explicitly
43
- - These variables help track progress across steps
44
-
45
- 3. **Calculate Intermediate Results**
46
- - Pay attention to correct numerical calculation and commonsense
47
- - Perform any required calculations step-by-step
48
- - Verify numerical accuracy (e.g., date ranges, counts, sums)
49
- - Check results against common sense (e.g., dates in valid range, reasonable quantities)
50
- - Show your calculation work when computing values
51
-
52
- 4. **Verify Results**
53
- - Carefully review what you find for accuracy
54
- - Ensure numerical values are consistent
55
- - Check for logical coherence
56
- - Note anything unexpected or inconsistent
57
-
58
- 5. **Make Observations**
59
- - What patterns did you notice?
60
- - What numerical trends are apparent?
61
- - What might affect subsequent steps?
62
-
63
- 6. **Note Issues**
64
- - Were there any calculation difficulties?
65
- - Was the information hard to find?
66
- - Were there any errors or ambiguities?
67
- </ExecutionPrinciples>
68
-
69
-
70
- <ContextAwareness>
71
- You will be given:
72
- - The current step to execute
73
- - The original user request (for context)
74
- - Variables gathered from previous steps
75
- - Data collected so far
76
-
77
- Use this context to:
78
- - Avoid re-gathering information you already have
79
- - Build on previous findings
80
- - Connect new information to what's already known
81
- </ContextAwareness>
82
-
83
- <ReportingGuidelines>
84
- Your report should include:
85
-
86
- 1. **Status**
87
- - success: Step completed as expected
88
- - partial: Got some but not all information
89
- - failed: Could not complete the step
90
-
91
- 2. **Data Gathered**
92
- - Summarize what you found
93
- - Be specific and factual
94
- - Include enough detail to be useful
95
-
96
- 3. **Extracted Variables and Numerals**
97
- - Key data points you discovered
98
- - Format as key-value pairs with numerical values separated
99
- - Examples: {count: 5, average_price: 299, latest_date: "2024-01-15", date_month: 1, date_year: 2024}
100
- - Include any intermediate calculations performed
101
-
102
- 4. **Observations**
103
- - Notable patterns or insights
104
- - Anything that might affect the plan
105
- - Connections to the overall goal
106
-
107
- 5. **Issues**
108
- - Any problems encountered
109
- - Missing or unclear information
110
- - Limitations of what you found
111
- </ReportingGuidelines>
112
-
113
- <Examples>
114
- Step: "Find Apple's official announcements from the past 3 months"
115
- Context: {company: "Apple", timeframe: "3 months"}
116
-
117
- Good Execution:
118
- - Use browser_search to find Apple newsroom/press releases
119
- - Filter results to last 3 months
120
- - List the announcements found
121
- - Extract count, dates, types
122
- - Note any gaps or issues
123
-
124
- Report (with numerical extraction):
125
- - Status: success
126
- - Data: "Found 15 press releases from Apple newsroom (Oct-Dec 2024)"
127
- - Variables: {
128
- press_release_count: 15,
129
- date_range: "Oct-Dec 2024",
130
- start_month: 10,
131
- end_month: 12,
132
- year: 2024,
133
- months_covered: 3
134
- }
135
- - Observations: ["Mix of product, service, and corporate announcements", "Exactly covers the requested 3-month timeframe"]
136
- - Issues: []
137
- </Examples>
138
-
139
- <CriticalInstructions>
140
- - Execute the step precisely as described
141
- - **Extract numerical variables and their values separately**
142
- - **Pay attention to correct numerical calculation and commonsense**
143
- - Calculate and verify intermediate results step-by-step
144
- - Report accurately with verified numbers - your results influence future steps
145
- - Use the context from previous steps to work smarter
146
- - If you can't find something, say so clearly
147
- - Double-check all numerical values for accuracy
148
- </CriticalInstructions>
149
-
150
- <OutputFormat>
151
- Provide a structured step result with:
152
- - status (success/partial/failed)
153
- - data_gathered (summary of findings)
154
- - extracted_variables (key-value pairs)
155
- - observations (notable insights)
156
- - issues (any problems)
157
- </OutputFormat>
158
- `,
159
- tools: {
160
- scratchpad: scratchpad_tool,
161
- search: search_content_tool
162
- // browser_search: groq.tools.browserSearch({}),
163
- }
164
- });
165
9
  function formatStepForExecutor(step, context) {
166
10
  return `
167
11
  <UserRequest>${context.original_request}</UserRequest>
@@ -197,7 +41,7 @@ function createExecutionContext(request, plannerOutput) {
197
41
  }
198
42
 
199
43
  // packages/orchestrator/src/lib/deepplan/planner-agent.ts
200
- import { defaultSettingsMiddleware as defaultSettingsMiddleware2, wrapLanguageModel as wrapLanguageModel2 } from "ai";
44
+ import { defaultSettingsMiddleware, wrapLanguageModel } from "ai";
201
45
  import z from "zod";
202
46
  import { lmstudio } from "@deepagents/agent";
203
47
  import {
@@ -221,10 +65,10 @@ var PlannerOutputSchema = z.object({
221
65
  success_criteria: z.string().describe("How to know if the task was completed successfully"),
222
66
  steps: z.array(PlanStepSchema).min(1).max(4).describe("Ordered list of steps to execute")
223
67
  });
224
- var plannerModel = wrapLanguageModel2({
68
+ var plannerModel = wrapLanguageModel({
225
69
  model: lmstudio("google/gemma-3-12b"),
226
70
  // model: groq('moonshotai/kimi-k2-instruct-0905'),
227
- middleware: defaultSettingsMiddleware2({
71
+ middleware: defaultSettingsMiddleware({
228
72
  settings: { temperature: 0.3 }
229
73
  // Slightly creative for better planning
230
74
  })
@@ -435,7 +279,7 @@ async function plan(userRequest, state = {}) {
435
279
  }
436
280
 
437
281
  // packages/orchestrator/src/lib/deepplan/replanner-agent.ts
438
- import { defaultSettingsMiddleware as defaultSettingsMiddleware3, wrapLanguageModel as wrapLanguageModel3 } from "ai";
282
+ import { defaultSettingsMiddleware as defaultSettingsMiddleware2, wrapLanguageModel as wrapLanguageModel2 } from "ai";
439
283
  import z2 from "zod";
440
284
  import { lmstudio as lmstudio2 } from "@deepagents/agent";
441
285
  import {
@@ -456,10 +300,10 @@ var ReplanDecisionSchema = z2.object({
456
300
  remaining_steps: z2.array(PlanStepSchema2).max(4).describe("Updated list of remaining steps"),
457
301
  new_insights: z2.string().describe("New insights learned that affected the plan")
458
302
  });
459
- var replannerModel = wrapLanguageModel3({
303
+ var replannerModel = wrapLanguageModel2({
460
304
  // model: groq('moonshotai/kimi-k2-instruct-0905'),
461
305
  model: lmstudio2("google/gemma-3-12b"),
462
- middleware: defaultSettingsMiddleware3({
306
+ middleware: defaultSettingsMiddleware2({
463
307
  settings: { temperature: 0.1 }
464
308
  })
465
309
  });
@@ -688,8 +532,8 @@ async function replan(context) {
688
532
  }
689
533
 
690
534
  // packages/orchestrator/src/lib/deepplan/synthesizer.ts
691
- import { agent as agent2, execute, lmstudio as lmstudio3, user as user3 } from "@deepagents/agent";
692
- var synthesizer = agent2({
535
+ import { agent, execute, lmstudio as lmstudio3, user as user3 } from "@deepagents/agent";
536
+ var synthesizer = agent({
693
537
  name: "synthesizer_agent",
694
538
  model: lmstudio3("google/gemma-3-12b"),
695
539
  prompt: `
@@ -760,9 +604,9 @@ ${stepResultsText}
760
604
  }
761
605
 
762
606
  // packages/orchestrator/src/lib/deepplan/plan-and-solve.ts
763
- async function runExecutor(agent3, context, step, state) {
607
+ async function runExecutor(agent2, context, step, state) {
764
608
  const { text } = await generate(
765
- agent3,
609
+ agent2,
766
610
  [user4(formatStepForExecutor(step, context))],
767
611
  state
768
612
  );