{"version":3,"file":"deep-research.d.ts","sourceRoot":"","sources":["../../../src/core/tools/deep-research.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,0BAA0B,CAAC;AAEnF,QAAA,MAAM,kBAAkB;;;;;;;;;EAWtB,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D,wBAAgB,sBAAsB,CACrC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAO,GAC1C,SAAS,CAAC,OAAO,kBAAkB,CAAC,CA0BtC;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;QAA2B,CAAC","sourcesContent":["import type { AgentTool } from \"@apholdings/jensen-agent-core\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { getDefaultWebResearchEngine, type WebResearchEngine } from \"../web-research/engine.js\";\nimport type { DeepResearchResponse, WebFreshness } from \"../web-research/types.js\";\n\nconst deepResearchSchema = Type.Object({\n\tobjective: Type.String({ description: \"Bounded evidence-backed research objective\" }),\n\tfreshness: Type.Optional(\n\t\tType.Union([Type.Literal(\"day\"), Type.Literal(\"week\"), Type.Literal(\"month\"), Type.Literal(\"year\")]),\n\t),\n\tmaxQueries: Type.Optional(Type.Number()),\n\tmaxSources: Type.Optional(Type.Number()),\n\tpreferredDomains: Type.Optional(Type.Array(Type.String())),\n\texcludedDomains: Type.Optional(Type.Array(Type.String())),\n\tlanguage: Type.Optional(Type.String()),\n\tdepth: Type.Optional(Type.Union([Type.Literal(\"quick\"), Type.Literal(\"standard\"), Type.Literal(\"deep\")])),\n});\n\nexport type DeepResearchToolInput = Static<typeof deepResearchSchema>;\nexport type DeepResearchToolDetails = DeepResearchResponse;\n\nexport function createDeepResearchTool(\n\toptions: { engine?: WebResearchEngine } = {},\n): AgentTool<typeof deepResearchSchema> {\n\tconst engine = options.engine ?? getDefaultWebResearchEngine();\n\treturn {\n\t\tname: \"deep_research\",\n\t\tlabel: \"deep_research\",\n\t\tdescription:\n\t\t\t\"Run a bounded, read-only research workflow: deterministic query planning, parallel free search, source ranking, secure fetch, contradiction checks, addressable evidence, and cited synthesis. Web content remains untrusted and no paid API is required.\",\n\t\tparameters: deepResearchSchema,\n\t\tisConcurrencySafe: () => true,\n\t\texecute: async (_toolCallId, input, signal) => {\n\t\t\tconst response = await engine.research({\n\t\t\t\t...input,\n\t\t\t\tfreshness: input.freshness as WebFreshness | undefined,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tconst text = [\n\t\t\t\t`<research-synthesis trust=\"evidence-backed\" bundle-id=\"${response.bundle.id}\">`,\n\t\t\t\tresponse.synthesis,\n\t\t\t\t\"\",\n\t\t\t\t`Evidence bundle SHA-256: ${response.bundle.contentSha256}`,\n\t\t\t\t`Sources: ${response.bundle.evidence.length}; Claims: ${response.bundle.claims.length}; Partial: ${response.partial}`,\n\t\t\t\t\"</research-synthesis>\",\n\t\t\t].join(\"\\n\");\n\t\t\treturn { content: [{ type: \"text\", text }], details: response };\n\t\t},\n\t};\n}\n\nexport const deepResearchTool = createDeepResearchTool();\n"]}