@staticn0va/wigolo 0.6.3 → 0.6.4

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 (194) hide show
  1. package/SKILL.md +30 -8
  2. package/dist/cli/index.d.ts +1 -1
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +12 -1
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/init.d.ts +2 -0
  7. package/dist/cli/init.d.ts.map +1 -0
  8. package/dist/cli/init.js +162 -0
  9. package/dist/cli/init.js.map +1 -0
  10. package/dist/cli/setup-mcp.d.ts +2 -0
  11. package/dist/cli/setup-mcp.d.ts.map +1 -0
  12. package/dist/cli/setup-mcp.js +116 -0
  13. package/dist/cli/setup-mcp.js.map +1 -0
  14. package/dist/cli/status.d.ts +2 -0
  15. package/dist/cli/status.d.ts.map +1 -0
  16. package/dist/cli/status.js +32 -0
  17. package/dist/cli/status.js.map +1 -0
  18. package/dist/cli/tui/agents-types.d.ts +28 -0
  19. package/dist/cli/tui/agents-types.d.ts.map +1 -0
  20. package/dist/cli/tui/agents-types.js +2 -0
  21. package/dist/cli/tui/agents-types.js.map +1 -0
  22. package/dist/cli/tui/agents.d.ts +11 -0
  23. package/dist/cli/tui/agents.d.ts.map +1 -0
  24. package/dist/cli/tui/agents.js +101 -0
  25. package/dist/cli/tui/agents.js.map +1 -0
  26. package/dist/cli/tui/banner.d.ts +3 -0
  27. package/dist/cli/tui/banner.d.ts.map +1 -0
  28. package/dist/cli/tui/banner.js +25 -0
  29. package/dist/cli/tui/banner.js.map +1 -0
  30. package/dist/cli/tui/config-writer-cli.d.ts +12 -0
  31. package/dist/cli/tui/config-writer-cli.d.ts.map +1 -0
  32. package/dist/cli/tui/config-writer-cli.js +33 -0
  33. package/dist/cli/tui/config-writer-cli.js.map +1 -0
  34. package/dist/cli/tui/config-writer-json.d.ts +16 -0
  35. package/dist/cli/tui/config-writer-json.d.ts.map +1 -0
  36. package/dist/cli/tui/config-writer-json.js +89 -0
  37. package/dist/cli/tui/config-writer-json.js.map +1 -0
  38. package/dist/cli/tui/config-writer-toml.d.ts +16 -0
  39. package/dist/cli/tui/config-writer-toml.d.ts.map +1 -0
  40. package/dist/cli/tui/config-writer-toml.js +88 -0
  41. package/dist/cli/tui/config-writer-toml.js.map +1 -0
  42. package/dist/cli/tui/config-writer.d.ts +25 -0
  43. package/dist/cli/tui/config-writer.d.ts.map +1 -0
  44. package/dist/cli/tui/config-writer.js +98 -0
  45. package/dist/cli/tui/config-writer.js.map +1 -0
  46. package/dist/cli/tui/detect-helpers.d.ts +6 -0
  47. package/dist/cli/tui/detect-helpers.d.ts.map +1 -0
  48. package/dist/cli/tui/detect-helpers.js +44 -0
  49. package/dist/cli/tui/detect-helpers.js.map +1 -0
  50. package/dist/cli/tui/flags-types.d.ts +19 -0
  51. package/dist/cli/tui/flags-types.d.ts.map +1 -0
  52. package/dist/cli/tui/flags-types.js +19 -0
  53. package/dist/cli/tui/flags-types.js.map +1 -0
  54. package/dist/cli/tui/flags.d.ts +5 -0
  55. package/dist/cli/tui/flags.d.ts.map +1 -0
  56. package/dist/cli/tui/flags.js +124 -0
  57. package/dist/cli/tui/flags.js.map +1 -0
  58. package/dist/cli/tui/format.d.ts +14 -0
  59. package/dist/cli/tui/format.d.ts.map +1 -0
  60. package/dist/cli/tui/format.js +28 -0
  61. package/dist/cli/tui/format.js.map +1 -0
  62. package/dist/cli/tui/reporter-auto.d.ts +7 -0
  63. package/dist/cli/tui/reporter-auto.d.ts.map +1 -0
  64. package/dist/cli/tui/reporter-auto.js +15 -0
  65. package/dist/cli/tui/reporter-auto.js.map +1 -0
  66. package/dist/cli/tui/reporter.d.ts +26 -0
  67. package/dist/cli/tui/reporter.d.ts.map +1 -0
  68. package/dist/cli/tui/reporter.js +31 -0
  69. package/dist/cli/tui/reporter.js.map +1 -0
  70. package/dist/cli/tui/run-command.d.ts +14 -0
  71. package/dist/cli/tui/run-command.d.ts.map +1 -0
  72. package/dist/cli/tui/run-command.js +73 -0
  73. package/dist/cli/tui/run-command.js.map +1 -0
  74. package/dist/cli/tui/select-agents.d.ts +6 -0
  75. package/dist/cli/tui/select-agents.d.ts.map +1 -0
  76. package/dist/cli/tui/select-agents.js +28 -0
  77. package/dist/cli/tui/select-agents.js.map +1 -0
  78. package/dist/cli/tui/status-agents.d.ts +11 -0
  79. package/dist/cli/tui/status-agents.d.ts.map +1 -0
  80. package/dist/cli/tui/status-agents.js +53 -0
  81. package/dist/cli/tui/status-agents.js.map +1 -0
  82. package/dist/cli/tui/status-cache.d.ts +6 -0
  83. package/dist/cli/tui/status-cache.d.ts.map +1 -0
  84. package/dist/cli/tui/status-cache.js +39 -0
  85. package/dist/cli/tui/status-cache.js.map +1 -0
  86. package/dist/cli/tui/status-format.d.ts +15 -0
  87. package/dist/cli/tui/status-format.d.ts.map +1 -0
  88. package/dist/cli/tui/status-format.js +45 -0
  89. package/dist/cli/tui/status-format.js.map +1 -0
  90. package/dist/cli/tui/status-python.d.ts +7 -0
  91. package/dist/cli/tui/status-python.d.ts.map +1 -0
  92. package/dist/cli/tui/status-python.js +24 -0
  93. package/dist/cli/tui/status-python.js.map +1 -0
  94. package/dist/cli/tui/system-check.d.ts +24 -0
  95. package/dist/cli/tui/system-check.d.ts.map +1 -0
  96. package/dist/cli/tui/system-check.js +101 -0
  97. package/dist/cli/tui/system-check.js.map +1 -0
  98. package/dist/cli/tui/tui-reporter.d.ts +19 -0
  99. package/dist/cli/tui/tui-reporter.d.ts.map +1 -0
  100. package/dist/cli/tui/tui-reporter.js +94 -0
  101. package/dist/cli/tui/tui-reporter.js.map +1 -0
  102. package/dist/cli/tui/verify-suggestions.d.ts +5 -0
  103. package/dist/cli/tui/verify-suggestions.d.ts.map +1 -0
  104. package/dist/cli/tui/verify-suggestions.js +25 -0
  105. package/dist/cli/tui/verify-suggestions.js.map +1 -0
  106. package/dist/cli/tui/verify.d.ts +19 -0
  107. package/dist/cli/tui/verify.d.ts.map +1 -0
  108. package/dist/cli/tui/verify.js +138 -0
  109. package/dist/cli/tui/verify.js.map +1 -0
  110. package/dist/cli/tui/version.d.ts +2 -0
  111. package/dist/cli/tui/version.d.ts.map +1 -0
  112. package/dist/cli/tui/version.js +12 -0
  113. package/dist/cli/tui/version.js.map +1 -0
  114. package/dist/cli/warmup.d.ts +2 -1
  115. package/dist/cli/warmup.d.ts.map +1 -1
  116. package/dist/cli/warmup.js +147 -208
  117. package/dist/cli/warmup.js.map +1 -1
  118. package/dist/daemon/http-server.js +1 -1
  119. package/dist/daemon/http-server.js.map +1 -1
  120. package/dist/embedding/embed.d.ts +0 -1
  121. package/dist/embedding/embed.d.ts.map +1 -1
  122. package/dist/embedding/embed.js +0 -3
  123. package/dist/embedding/embed.js.map +1 -1
  124. package/dist/extraction/extract.d.ts.map +1 -1
  125. package/dist/extraction/extract.js +6 -0
  126. package/dist/extraction/extract.js.map +1 -1
  127. package/dist/extraction/markdown.d.ts +2 -0
  128. package/dist/extraction/markdown.d.ts.map +1 -1
  129. package/dist/extraction/markdown.js +70 -0
  130. package/dist/extraction/markdown.js.map +1 -1
  131. package/dist/extraction/pipeline.d.ts.map +1 -1
  132. package/dist/extraction/pipeline.js +32 -7
  133. package/dist/extraction/pipeline.js.map +1 -1
  134. package/dist/extraction/readability.d.ts +1 -1
  135. package/dist/extraction/readability.d.ts.map +1 -1
  136. package/dist/extraction/readability.js +1 -1
  137. package/dist/extraction/readability.js.map +1 -1
  138. package/dist/extraction/site-extractors/github.js +1 -1
  139. package/dist/extraction/site-extractors/github.js.map +1 -1
  140. package/dist/extraction/site-extractors/mdn.js +1 -1
  141. package/dist/extraction/site-extractors/mdn.js.map +1 -1
  142. package/dist/extraction/site-extractors/stackoverflow.js +1 -1
  143. package/dist/extraction/site-extractors/stackoverflow.js.map +1 -1
  144. package/dist/extraction/structured.d.ts +4 -0
  145. package/dist/extraction/structured.d.ts.map +1 -0
  146. package/dist/extraction/structured.js +206 -0
  147. package/dist/extraction/structured.js.map +1 -0
  148. package/dist/fetch/lightpanda.js +1 -1
  149. package/dist/fetch/lightpanda.js.map +1 -1
  150. package/dist/index.js +18 -0
  151. package/dist/index.js.map +1 -1
  152. package/dist/instructions.d.ts +6 -6
  153. package/dist/instructions.d.ts.map +1 -1
  154. package/dist/instructions.js +54 -51
  155. package/dist/instructions.js.map +1 -1
  156. package/dist/research/brief.d.ts +3 -0
  157. package/dist/research/brief.d.ts.map +1 -0
  158. package/dist/research/brief.js +79 -0
  159. package/dist/research/brief.js.map +1 -0
  160. package/dist/research/pipeline.d.ts.map +1 -1
  161. package/dist/research/pipeline.js +8 -0
  162. package/dist/research/pipeline.js.map +1 -1
  163. package/dist/research/synthesize.js +1 -1
  164. package/dist/research/synthesize.js.map +1 -1
  165. package/dist/search/find-similar.d.ts.map +1 -1
  166. package/dist/search/find-similar.js +41 -1
  167. package/dist/search/find-similar.js.map +1 -1
  168. package/dist/search/highlights.d.ts +10 -0
  169. package/dist/search/highlights.d.ts.map +1 -0
  170. package/dist/search/highlights.js +103 -0
  171. package/dist/search/highlights.js.map +1 -0
  172. package/dist/searxng/docker.d.ts.map +1 -1
  173. package/dist/searxng/docker.js +6 -2
  174. package/dist/searxng/docker.js.map +1 -1
  175. package/dist/server.d.ts.map +1 -1
  176. package/dist/server.js +8 -4
  177. package/dist/server.js.map +1 -1
  178. package/dist/tools/agent.d.ts +2 -2
  179. package/dist/tools/agent.d.ts.map +1 -1
  180. package/dist/tools/agent.js +1 -1
  181. package/dist/tools/agent.js.map +1 -1
  182. package/dist/tools/extract.d.ts.map +1 -1
  183. package/dist/tools/extract.js +19 -1
  184. package/dist/tools/extract.js.map +1 -1
  185. package/dist/tools/research.d.ts +1 -1
  186. package/dist/tools/research.d.ts.map +1 -1
  187. package/dist/tools/research.js +1 -1
  188. package/dist/tools/research.js.map +1 -1
  189. package/dist/tools/search.d.ts.map +1 -1
  190. package/dist/tools/search.js +55 -27
  191. package/dist/tools/search.js.map +1 -1
  192. package/dist/types.d.ts +54 -4
  193. package/dist/types.d.ts.map +1 -1
  194. package/package.json +7 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured.js","sourceRoot":"","sources":["../../src/extraction/structured.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,0EAA0E;AAC1E,0EAA0E;AAC1E,wBAAwB;AACxB,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,eAAe,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO;QACL,MAAM;QACN,WAAW;QACX,MAAM;QACN,WAAW;QACX,eAAe;KAChB,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,0EAA0E;AAC1E,SAAS,kBAAkB,CAAC,GAAa;IACvC,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC1C,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,OAAO,GAAkB,IAAI,CA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CAAC;IACnD,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CACjB,IAAoB,EACpB,IAAiB,EACjB,IAAkB;IAElB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACpE,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,IAAI,SAAS,CAAC,MAAM,IAAI,aAAa;QAAE,OAAO,SAAS,CAAC;IACxD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AACrD,CAAC"}
@@ -143,7 +143,7 @@ export class LightpandaAdapter {
143
143
  try {
144
144
  if (!this.browser)
145
145
  return false;
146
- if (typeof this.browser.isConnected === 'function') {
146
+ if ('isConnected' in this.browser && typeof this.browser.isConnected === 'function') {
147
147
  if (!this.browser.isConnected())
148
148
  return false;
149
149
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lightpanda.js","sourceRoot":"","sources":["../../src/fetch/lightpanda.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqC,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MA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AAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO;oBAAE,OAAO,IAAI,CAAC;YACtD,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACzC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC5C,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACrE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
package/dist/index.js CHANGED
@@ -7,6 +7,9 @@ import { runDoctor } from './cli/doctor.js';
7
7
  import { runShell } from './cli/shell.js';
8
8
  import { runAuth } from './cli/auth.js';
9
9
  import { runPluginCommand } from './cli/plugin.js';
10
+ import { runInit } from './cli/init.js';
11
+ import { runSetupMcp } from './cli/setup-mcp.js';
12
+ import { runStatus } from './cli/status.js';
10
13
  import { getConfig } from './config.js';
11
14
  import { startServer } from './server.js';
12
15
  const { command, args } = parseCommand(process.argv.slice(2));
@@ -38,6 +41,21 @@ switch (command) {
38
41
  case 'plugin':
39
42
  runPluginCommand(args);
40
43
  break;
44
+ case 'init': {
45
+ const initCode = await runInit(args);
46
+ process.exit(initCode);
47
+ break;
48
+ }
49
+ case 'setup': {
50
+ const code = await runSetupMcp(args);
51
+ process.exit(code);
52
+ break;
53
+ }
54
+ case 'status': {
55
+ const code = await runStatus(args);
56
+ process.exit(code);
57
+ break;
58
+ }
41
59
  case 'mcp': {
42
60
  const config = getConfig();
43
61
  try {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version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BAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM;IAER,KAAK,MAAM,CAAC,CAAC,CAAC;QACZ,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,MAAM;IACR,CAAC;IAED,KAAK,OAAO,CAAC,CAAC,CAAC;QACb,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM;IACR,CAAC;IAED,KAAK,QAAQ,CAAC,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM;IACR,CAAC;IAED,KAAK,KAAK,CAAC,CAAC,CAAC;QACX,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,IAAI,CAAC;YACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;YAC/D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5E,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,+BAA+B,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,GAAG;oBACxE,YAAY,MAAM,CAAC,MAAM,0DAA0D,CACpF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,2EAA2E;QAC7E,CAAC;QAED,MAAM,WAAW,EAAE,CAAC;QACpB,MAAM;IACR,CAAC;AACH,CAAC"}
@@ -14,15 +14,15 @@
14
14
  * Parameter schemas (types, enums, required/optional) belong on the JSON
15
15
  * Schema, not here. Installation/configuration is for humans, not LLMs.
16
16
  */
17
- export declare const WIGOLO_INSTRUCTIONS = "Wigolo is a local-first web access layer: search the open web, fetch pages, crawl sites, extract structured data, find related content, run multi-step research, and execute agent-driven data gathering. All results land in a local SQLite cache that persists across sessions.\n\n## When to use which tool\n\n- `search` -- you need information on a topic but do not have a URL yet. Pass a query string or an array of 3-5 semantically varied keyword forms for broader coverage.\n- `fetch` -- you already have a specific URL to read.\n- `crawl` -- you need multiple pages from the same site (docs, wikis, references).\n- `cache` -- you want to know if the content is already on disk from an earlier read.\n- `extract` -- you need specific data points (tables, metadata, schema-shaped fields) rather than a whole page as markdown.\n- `find_similar` -- you have a URL or concept and want related content from the cache or web. Useful for \"more like this\" discovery.\n- `research` -- you have a complex question that needs multi-step investigation: question decomposition, parallel search, source synthesis into a report. Set `depth` to control thoroughness.\n- `agent` -- you need to gather structured or unstructured data from multiple sources based on a natural-language prompt. Provides full step transparency.\n\n## Routing by intent\n\n| Intent | Tool | Key parameters |\n|--------|------|----------------|\n| Documentation lookup | `search` | `include_domains: [\"react.dev\", \"nextjs.org\"]` -- scope to the project's official site, do not rely on `category: \"docs\"` alone |\n| Error debugging | `search` | exact error string as query, `category: \"code\"` (no domain scoping -- errors appear everywhere) |\n| Library research | `crawl` | seed URL of docs site, `strategy: \"sitemap\"`, then `cache` for later queries |\n| Related content | `find_similar` | `url` of a known good page, or `concept` as free text |\n| Direct answer | `search` | `format: \"answer\"` for a synthesized direct response |\n| Comprehensive research | `research` | `depth: \"comprehensive\"`, optional `include_domains` to scope |\n| Data gathering | `agent` | natural-language `prompt`, optional `schema` for structured output |\n| Structured extraction | `extract` | `mode: \"schema\"` with a JSON Schema, or `mode: \"tables\"` |\n| Site inventory | `crawl` | `strategy: \"map\"` for URL-only discovery, no content fetched |\n\n## Rapidly changing content\n\nFor news, prices, status pages, or release notes, bypass the cache with `force_refresh: true`:\n\n search({ query: \"...\", force_refresh: true })\n fetch({ url: \"...\", force_refresh: true })\n\nFor docs, tutorials, and reference pages, let the cache work -- much faster.\n\n## Check the cache before going to the network\n\nBefore every `search` or `fetch`, consider a `cache` call. Pages read this session or earlier return instantly with full markdown -- no network. `research` and `agent` check the cache internally.\n\n## Multi-query search strategy\n\nFor broad queries, pass an array of 3-5 semantically varied keyword forms rather than one natural-language question. Example: instead of \"how does React handle state management\", pass `[\"react state management\", \"useState useReducer\", \"react hooks state\", \"react context vs redux\"]`. Sub-queries are deduplicated automatically.\n\n## Pick the right strategy\n\n- For docs sites, prefer `crawl` with `strategy: \"sitemap\"` -- faster and more complete than BFS.\n- For URL discovery only, use `crawl` with `strategy: \"map\"` -- URLs only, no content. Follow with targeted `fetch` calls.\n- For structured data (prices, specs, table rows), use `extract` with `mode: \"schema\"` or `mode: \"tables\"`. Use `fetch` only when you want the whole page as markdown.\n- For multi-source synthesis, use `research` instead of chaining `search` + `fetch` manually.\n- For natural-language data gathering (\"find pricing for top 5 CRM tools\"), use `agent` with optional `schema`.\n\n## Scope searches by domain \u2014 biggest single quality lever\n\nFor framework, library, SDK, or tool-specific queries, **always pass `include_domains` with the project's official site(s)**. Unscoped queries return generic results from sites that happen to mention the keywords (MDN glossary entries, Docker images, unrelated tutorials). Domain scoping is the single biggest quality improvement for these queries.\n\nExamples:\n\n search({ query: \"Next.js authentication App Router\", include_domains: [\"nextjs.org\", \"authjs.dev\", \"clerk.com\"] })\n search({ query: \"react server components\", include_domains: [\"react.dev\", \"nextjs.org\"] })\n search({ query: \"prisma migrations\", include_domains: [\"prisma.io\"] })\n search({ query: \"stripe webhooks\", include_domains: [\"stripe.com\", \"docs.stripe.com\"] })\n\nWhen NOT to scope:\n\n- Error strings (errors surface across many sites)\n- Broad exploration (\"state management 2026\")\n- News and current events\n\nIf a first unscoped `search` returns noisy results, retry with `include_domains` scoped to the official source rather than rephrasing the query.\n\n`category` (`\"general\"`, `\"news\"`, `\"code\"`, `\"docs\"`, `\"papers\"`) is a coarse content-type filter and is no substitute for domain scoping. `category: \"docs\"` on its own returns generic documentation portals, not the docs you want -- pair it with `include_domains` or omit it.\n\n## Performance\n\n- `max_results: 3` for focused lookups; `5` default; `10+` only for broad research.\n- `max_content_chars: 3000` on `search` or `fetch` smart-truncates each result's markdown at a paragraph/heading boundary with a `[... content truncated]` marker. Keeps context compact for AI agents. Prefer this over raw `max_chars` slicing.\n- `fetch` with `section: \"Heading Name\"` returns content under that heading -- cheaper than the whole page.\n- Repeated fetches of the same URL are free (SQLite cache).\n- `research` with `depth: \"quick\"` (~15s) suits most factual questions; reserve `\"comprehensive\"` for deep investigation.\n- `agent` respects `max_pages` (default 10) and `max_time_ms` (default 60s).\n\n## Capabilities worth knowing\n\n- Localhost URLs work: `http://localhost:3000`, `http://127.0.0.1:8080`, and similar. Useful for reading local dev servers and internal docs.\n- `use_auth: true` on `fetch` and `crawl` reuses the user's configured browser session for pages behind a login.\n- `cache` accepts FTS5 query syntax (`AND`, `OR`, `NOT`, `\"exact phrase\"`) for precise lookups.\n- `crawl` accepts regex `include_patterns` and `exclude_patterns` to stay inside a section of a large site.\n- `find_similar` uses cached embeddings when available -- no network call needed if the content has been seen before.\n- `research` and `agent` use MCP requestSampling for intelligent decomposition and synthesis when the client supports it. Without sampling support, they return raw sources in context format.";
17
+ export declare const WIGOLO_INSTRUCTIONS = "Wigolo is a local-first web access layer: search the open web, fetch pages, crawl sites, extract structured data, find related content, run multi-step research, and execute agent-driven data gathering. All results land in a local SQLite cache that persists across sessions.\n\n## Host-LLM synthesis pattern (read this first)\n\nWigolo has no internal LLM. It returns *structured evidence* so YOU (the host LLM) write the final answer. Fold structure into your reply:\n\n- `search` `format: \"highlights\"` \u2192 FlashRank-scored passages + `citations`. Quote [N].\n- `research` \u2192 `brief` with `topics`, `highlights`, `key_findings` when sampling unavailable. Use as report scaffold.\n- `find_similar` \u2192 `cold_start` string when local signals are weak. Pass to user verbatim.\n- `extract` `mode: \"structured\"` \u2192 tables + definitions + jsonld + chart_hints + key_value_pairs in one call.\n- `fetch` metadata \u2192 `og_type`, `canonical_url`, `og_image` when present.\n\n## When to use which tool\n\n- `search` -- you need information on a topic but do not have a URL yet. Pass a query string or an array of 3-5 semantically varied keyword forms for broader coverage.\n- `fetch` -- you already have a specific URL to read.\n- `crawl` -- you need multiple pages from the same site (docs, wikis, references).\n- `cache` -- you want to know if the content is already on disk from an earlier read.\n- `extract` -- you need specific data points (tables, metadata, schema-shaped fields) rather than a whole page as markdown.\n- `find_similar` -- you have a URL or concept and want related content from the cache or web. Useful for \"more like this\" discovery.\n- `research` -- you have a complex question that needs multi-step investigation: question decomposition, parallel search, source synthesis into a report. Set `depth` to control thoroughness.\n- `agent` -- you need to gather structured or unstructured data from multiple sources based on a natural-language prompt. Provides full step transparency.\n\n## Routing by intent\n\n| Intent | Tool | Key parameters |\n|--------|------|----------------|\n| Documentation lookup | `search` | `include_domains: [\"react.dev\", \"nextjs.org\"]` -- scope to the project's official site, do not rely on `category: \"docs\"` alone |\n| Error debugging | `search` | exact error string as query, `category: \"code\"` (no domain scoping -- errors appear everywhere) |\n| Library research | `crawl` | seed URL of docs site, `strategy: \"sitemap\"`, then `cache` for later queries |\n| Related content | `find_similar` | `url` of a known good page, or `concept` as free text |\n| Direct quote | `search` | `format: \"highlights\"` returns FlashRank-scored passages with citations; cite [N] in your reply |\n| Direct answer | `search` | `format: \"answer\"` if client supports sampling, else falls back to `highlights` (not plain context) |\n| Comprehensive research | `research` | `depth: \"comprehensive\"`, optional `include_domains` to scope |\n| Data gathering | `agent` | natural-language `prompt`, optional `schema` for structured output |\n| Structured extraction | `extract` | `mode: \"structured\"` (tables + dl + JSON-LD + chart hints + kv pairs), or `mode: \"schema\"` with a JSON Schema |\n| Site inventory | `crawl` | `strategy: \"map\"` for URL-only discovery, no content fetched |\n\n## Rapidly changing content\n\nFor news, prices, status pages, or release notes, bypass the cache with `force_refresh: true`:\n\n search({ query: \"...\", force_refresh: true })\n fetch({ url: \"...\", force_refresh: true })\n\nFor docs, tutorials, and reference pages, let the cache work -- much faster.\n\n## Check the cache before going to the network\n\nBefore every `search` or `fetch`, consider a `cache` call. Pages read this session or earlier return instantly with full markdown -- no network. `research` and `agent` check the cache internally.\n\n## Multi-query search strategy\n\nFor broad queries, pass an array of 3-5 semantically varied keyword forms rather than one natural-language question. Example: instead of \"how does React handle state management\", pass `[\"react state management\", \"useState useReducer\", \"react hooks state\", \"react context vs redux\"]`. Sub-queries are deduplicated automatically.\n\n## Pick the right strategy\n\n- For docs sites, prefer `crawl` with `strategy: \"sitemap\"` -- faster and more complete than BFS.\n- For URL discovery only, use `crawl` with `strategy: \"map\"` -- URLs only, no content. Follow with targeted `fetch` calls.\n- For structured data (prices, specs, table rows), use `extract` with `mode: \"schema\"` or `mode: \"tables\"`. Use `fetch` only when you want the whole page as markdown.\n- For multi-source synthesis, use `research` instead of chaining `search` + `fetch` manually.\n- For natural-language data gathering, use `agent` with optional `schema`.\n- `crawl` accepts regex `include_patterns` and `exclude_patterns` to stay inside a section of a large site.\n\n## Scope searches by domain\n\nFor library/framework/SDK queries, **always pass `include_domains`** with official sites. Unscoped queries return generic noise. `category: \"docs\"` alone returns generic portals -- pair with `include_domains` or omit. Skip domain scoping for error strings, broad exploration, and news.\n\n## Performance\n\n- `max_results: 3` for focused lookups; `5` default; `10+` only for broad research.\n- `max_content_chars: 3000` on `search` or `fetch` smart-truncates each result's markdown at a paragraph/heading boundary with a `[... content truncated]` marker. Keeps context compact for AI agents. Prefer this over raw `max_chars` slicing.\n- `fetch` with `section: \"Heading Name\"` returns content under that heading -- cheaper than the whole page.\n- Repeated fetches of the same URL are free (SQLite cache).\n- `research` with `depth: \"quick\"` (~15s) suits most factual questions; reserve `\"comprehensive\"` for deep investigation.\n- `agent` respects `max_pages` (default 10) and `max_time_ms` (default 60s).\n\n## Extras\n\n- Localhost URLs (`localhost:3000`, `127.0.0.1:8080`) work for local dev servers.\n- `use_auth: true` on `fetch`/`crawl` reuses browser session for logged-in pages.\n- `cache` supports FTS5 syntax (`AND`, `OR`, `NOT`, `\"phrase\"`).\n- `research`/`agent` use MCP sampling when supported; fall back to structured data for host-LLM synthesis.";
18
18
  export declare const TOOL_DESCRIPTIONS: {
19
- readonly fetch: "Fetch a single URL and return clean markdown. Use when you have a specific URL to read. Automatically detects if JavaScript rendering is needed.\n\nKey parameters:\n- section: extract content under a specific heading (e.g., section: \"API Reference\") -- faster than reading the whole page\n- max_content_chars: smart-truncate markdown at a paragraph/heading boundary with a `[... content truncated]` marker (e.g., 3000 for compact context). Preferred over max_chars for AI agents.\n- use_auth: true to use stored browser session for authenticated/private pages\n- render_js: \"auto\" (default, detects JS need), \"always\" (force browser), \"never\" (HTTP only, fastest)\n- headers: custom HTTP headers if needed\n- force_refresh: true to bypass cache and fetch fresh content from the network\n\nReturns title, markdown content, links, images, and metadata. Result is cached locally -- subsequent fetches of the same URL return instantly. Works with localhost URLs (localhost:3000, etc.) for reading local dev servers.\n\nUse force_refresh: true for pages that change frequently (news sites, changelogs, dashboards, API status pages). By default, previously fetched pages are served from local cache for speed.";
20
- readonly search: "Search the web and return full markdown content from top results. Use for finding information on any topic -- returns extracted page content, not just snippets.\n\nKey parameters:\n- query: a search string, or an array of 3-5 semantically varied keyword forms for broader coverage. Arrays are deduplicated and merged automatically.\n- include_domains/exclude_domains: scope results to specific sites (e.g., [\"react.dev\", \"nextjs.org\"]). For framework/library queries, ALWAYS scope to the official site -- unscoped queries return noise.\n- category: \"general\", \"news\", \"code\", \"docs\", \"papers\" -- coarse content-type filter. \"docs\" alone returns generic portals; pair with include_domains or omit.\n- from_date/to_date: ISO dates for time-bounded queries\n- max_results: default 5. Use 3 for focused queries, 10+ for research.\n- format: \"full\" (default), \"context\", \"answer\" (sampling synthesis; heuristic key-point summary if unsupported), \"stream_answer\" (answer + progress notifications)\n- max_content_chars: smart-truncate each result markdown at a paragraph boundary with a `[... content truncated]` marker (e.g., 3000). Preferred for AI agent context budgets.\n- force_refresh: true to bypass all caches (search results and page content)\n\nThe \"answer\" format uses the MCP client's sampling capability to synthesize a direct response from search results. If sampling is not supported, falls back to \"context\" format. \"stream_answer\" emits notifications/progress messages at each pipeline phase (search, fetch, synthesize) when the client provides a progressToken via request._meta token-level streaming of the LLM response is not supported by MCP sampling, so the answer itself still arrives as one block.\n\nResults include title, URL, relevance_score, and full markdown_content per result. Previously fetched pages are served from local cache.\n\nUse force_refresh: true when you need current information that may have changed since the last search. Default behavior uses cached results when available.";
19
+ readonly fetch: "Fetch a single URL and return clean markdown. Use when you have a specific URL to read. Automatically detects if JavaScript rendering is needed.\n\nKey parameters:\n- section: extract content under a specific heading (e.g., section: \"API Reference\") -- faster than reading the whole page\n- max_content_chars: smart-truncate markdown at a paragraph/heading boundary with a `[... content truncated]` marker (e.g., 3000 for compact context). Preferred over max_chars for AI agents.\n- use_auth: true to use stored browser session for authenticated/private pages\n- render_js: \"auto\" (default, detects JS need), \"always\" (force browser), \"never\" (HTTP only, fastest)\n- headers: custom HTTP headers if needed\n- force_refresh: true to bypass cache and fetch fresh content from the network\n\nReturns title, markdown, links, images, metadata (og_image, og_type, canonical_url, keywords). Decorative images filtered, relative URLs resolved. Cached locally; repeat fetches are instant. Localhost URLs work.\n\nUse force_refresh: true for frequently changing content. Default serves from cache.";
20
+ readonly search: "Search the web and return full markdown content from top results. Returns extracted page content, not just snippets.\n\nKey parameters:\n- query: string or string[] array (3-5 keyword variants for broader coverage; deduplicated automatically)\n- include_domains/exclude_domains: scope to specific sites. ALWAYS scope library/framework queries.\n- category: \"general\" | \"news\" | \"code\" | \"docs\" | \"papers\" coarse filter, pair with include_domains.\n- from_date/to_date: ISO YYYY-MM-DD for time-bounded queries\n- max_results: default 5; use 3 for focused, 10+ for research\n- format: \"full\" (default), \"context\", \"highlights\" (FlashRank-scored passages + [N] citations), \"answer\" (sampling synthesis; falls back to highlights), \"stream_answer\"\n- max_highlights: cap highlights count (default 10)\n- max_content_chars: smart-truncate markdown at paragraph boundary (e.g., 3000)\n- force_refresh: true to bypass all caches\n\n\"answer\" falls back to \"highlights\" when sampling unsupported (most clients). Results include title, URL, relevance_score, and full markdown_content. Cache serves previously fetched pages instantly.";
21
21
  readonly crawl: "Crawl a website starting from a URL and return content from multiple pages. Use for indexing documentation sites, wikis, or any multi-page resource.\n\nKey parameters:\n- strategy: \"bfs\" (breadth-first, default), \"dfs\" (depth-first), \"sitemap\" (use sitemap.xml -- fastest for doc sites), \"map\" (URL discovery only, no content -- fastest for scoping a site)\n- max_depth: how many links deep to follow (default 2)\n- max_pages: maximum pages to fetch (default 20)\n- include_patterns/exclude_patterns: regex filters on URLs\n\nReturns an array of pages with title, markdown, and depth. Content is deduplicated across pages (repeated nav/headers/footers stripped). All pages are cached for later cache queries.";
22
22
  readonly cache: "Search previously fetched content without hitting the network. Use before searching the web -- if relevant content was already fetched or crawled, this returns it instantly.\n\nKey parameters:\n- query: full-text search over cached markdown and titles (supports FTS5 syntax: AND, OR, NOT, \"phrase match\")\n- url_pattern: glob filter on URLs (e.g., \"*example.com*\")\n- since: ISO date -- only results cached after this date\n- stats: true to get cache size, entry count, oldest/newest dates\n- clear: true to delete matching entries\n\nReturns matching cached pages with full markdown content. Cache persists across sessions in local SQLite.";
23
- readonly extract: "Extract structured data from a URL or raw HTML. Use when you need specific data points, tables, or metadata rather than full page markdown.\n\nKey parameters:\n- mode: \"selector\" (CSS selector -> text), \"tables\" (HTML tables -> JSON rows), \"metadata\" (title/author/date/description), \"schema\" (JSON Schema -> heuristic field extraction)\n- css_selector: required for mode=\"selector\" -- any valid CSS selector\n- schema: for mode=\"schema\", a JSON Schema object describing the fields to extract\n- multiple: true to return array of all matches (mode=\"selector\" only)\n\nFor mode=\"tables\", returns array of table objects with headers and row data. For mode=\"schema\", pass { price: \"string\", name: \"string\" } and get structured fields extracted from the page.";
24
- readonly find_similar: "Find content related to a URL or concept. Use when you have a known-good page or topic and want to discover similar resources from the cache or web.\n\nKey parameters:\n- url: a URL to find content similar to. The page's content and embeddings are used for similarity matching.\n- concept: free-text description of what you want similar content for. Use when you do not have a specific URL.\n- max_results: number of similar items to return (default 5)\n- include_cached: true (default) to search the local cache first, false to skip cache and search the web only\n- threshold: minimum similarity score (0-1, default 0.5) -- higher values return fewer, more relevant results\n\nProvide either url or concept (not both). Results are ranked by cosine similarity of embeddings. Cached content with embeddings is searched first for instant results. If fewer than max_results are found in cache, a web search supplements the results.\n\nReturns title, URL, similarity_score, and markdown_content per result.";
25
- readonly research: "Run multi-step research on a complex question. Decomposes the question into sub-queries, searches in parallel, fetches top sources, and synthesizes a report with citations.\n\nKey parameters:\n- question: the research question to investigate\n- depth: \"quick\" (~15s, 2 sub-queries, 5-8 sources), \"standard\" (~40s, 4 sub-queries, 10-15 sources, default), \"comprehensive\" (~80s, 7 sub-queries, 20-25 sources)\n- max_sources: override the default source count for the chosen depth\n- include_domains/exclude_domains: scope research to specific sites\n- schema: optional JSON Schema -- if provided, the report is structured to extract fields matching the schema\n- stream: true to receive progress notifications as each research phase completes\n\nThe pipeline: (1) decompose question into sub-queries, (2) parallel search across sub-queries, (3) fetch and extract top unique sources, (4) synthesize report with citations from all sources, (5) optionally structure report fields if schema is provided.\n\nUses MCP requestSampling for intelligent decomposition and synthesis. Without sampling support, returns raw sources in context format with sampling_supported: false.\n\nReturns report (markdown), citations array, sources with full content, sub_queries used, depth level, and total_time_ms.";
23
+ readonly extract: "Extract structured data from a URL or raw HTML. Use when you need specific data points, tables, or metadata rather than full page markdown.\n\nKey parameters:\n- mode: \"selector\" (CSS selector -> text), \"tables\" (HTML tables only), \"metadata\" (title/author/date/description/og_* + JSON-LD), \"schema\" (JSON Schema -> heuristic field extraction), \"structured\" (ONE-SHOT: tables + <dl> definitions + JSON-LD + chart hints from SVG/figure + microdata/data-attr/grid key-value pairs)\n- css_selector: required for mode=\"selector\" -- any valid CSS selector\n- schema: for mode=\"schema\", a JSON Schema object describing the fields to extract\n- multiple: true to return array of all matches (mode=\"selector\" only)\n\nPrefer mode=\"structured\" over chaining multiple extract calls — it returns every structured pattern on the page in one response:\n { tables, definitions, jsonld, chart_hints, key_value_pairs }\n\nchart_hints surfaces SVG titles, aria-labels, and figcaptions — host LLMs use these to describe data visualizations even when the underlying data is rendered by JavaScript.\n\nFor mode=\"tables\", returns array of table objects with headers and row data. For mode=\"schema\", pass { price: \"string\", name: \"string\" } and get structured fields extracted from the page.";
24
+ readonly find_similar: "Find content related to a URL or concept. Use when you have a known-good page or topic and want to discover similar resources from the cache or web.\n\nKey parameters:\n- url: a URL to find content similar to. The page's content and embeddings are used for similarity matching.\n- concept: free-text description of what you want similar content for. Use when you do not have a specific URL.\n- max_results: number of similar items to return (default 5)\n- include_cached: true (default) to search the local cache first, false to skip cache and search the web only\n- threshold: minimum similarity score (0-1, default 0.5) -- higher values return fewer, more relevant results\n\nProvide either url or concept (not both). Results are fused from three signals via 3-way RRF: FTS5 keyword match, sentence-transformer embeddings, and (if local hits are sparse) a live web search. Each result carries `match_signals` with `embedding_rank`, `fts5_rank`, and `fused_score` so you can explain ranking to the user.\n\nThe response may include a `cold_start` string when local signals are weak (empty cache, embeddings unavailable, < 20 cached pages). Pass this verbatim to the user — it explains why results came from web search and how to warm the cache.\n\nReturns results array, method used (\"hybrid\" | \"embedding\" | \"fts5\" | \"search\"), cache_hits, search_hits, embedding_available, and total_time_ms.";
25
+ readonly research: "Run multi-step research on a complex question. Decomposes the question into sub-queries, searches in parallel, fetches top sources, and synthesizes a report with citations.\n\nKey parameters:\n- question: the research question to investigate\n- depth: \"quick\" (~15s, 2 sub-queries, 5-8 sources), \"standard\" (~40s, 4 sub-queries, 10-15 sources, default), \"comprehensive\" (~80s, 7 sub-queries, 20-25 sources)\n- max_sources: override the default source count for the chosen depth\n- include_domains/exclude_domains: scope research to specific sites\n- schema: optional JSON Schema -- if provided, the report is structured to extract fields matching the schema\n- stream: true to receive progress notifications as each research phase completes\n\nThe pipeline: (1) decompose question into sub-queries, (2) parallel search across sub-queries, (3) fetch and extract top unique sources, (4) synthesize report with citations from all sources, (5) optionally structure report fields if schema is provided.\n\nUses MCP requestSampling for intelligent decomposition and synthesis when available. Without sampling support (the common case), the output includes a `brief` field with:\n - `topics`: sub-query labels or distilled source-title topics\n - `highlights`: FlashRank-scored passages with source_index, source_url, relevance_score\n - `key_findings`: first substantive paragraph per source, ordered by relevance\n - `per_source_char_cap` / `total_sources_char_cap`: budget hints so you know what was trimmed\n\nThe host LLM (you) should build its final report from the brief rather than re-reading every source — the brief is the structured scaffold this tool produces when it cannot synthesize internally.\n\nReturns report (markdown), citations array, sources with full content, sub_queries used, depth level, total_time_ms, sampling_supported flag, and optional brief.";
26
26
  readonly agent: "Execute a natural-language data gathering task. Plans search queries and URLs from a prompt, executes them in parallel, and synthesizes results. Full step transparency.\n\nKey parameters:\n- prompt: natural-language description of what data to gather (e.g., \"find pricing for the top 5 CRM tools\")\n- urls: optional array of specific URLs to include in the gathering\n- schema: optional JSON Schema -- if provided, extracts structured data matching the schema from each page and merges results\n- max_pages: maximum pages to fetch (default 10)\n- max_time_ms: maximum execution time in milliseconds (default 60000)\n- stream: true to receive progress notifications as each step completes\n\nThe pipeline: (1) plan -- interpret prompt to determine search queries and URLs to visit, (2) execute -- run searches and fetch URLs in parallel within budget, (3) extract -- if schema provided, apply schema extraction to each page and merge, (4) synthesize -- produce natural-language or structured result.\n\nThe steps array in the output provides full transparency into every action taken (plan, search, fetch, extract, synthesize) with timing. This differentiates from black-box alternatives.\n\nUses MCP requestSampling for planning and synthesis. Without sampling support, uses keyword extraction for planning and returns raw content.\n\nReturns result (string or structured object), sources array, pages_fetched count, steps array with action/detail/time_ms, total_time_ms, and sampling_supported flag.";
27
27
  };
28
28
  export type ToolName = keyof typeof TOOL_DESCRIPTIONS;
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,mBAAmB,wyNAyFmK,CAAC;AAEpM,eAAO,MAAM,iBAAiB;;;;;;;;;CA8GpB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,mBAAmB,iwMAkF+E,CAAC;AAEhH,eAAO,MAAM,iBAAiB;;;;;;;;;CAwHpB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
@@ -16,6 +16,16 @@
16
16
  */
17
17
  export const WIGOLO_INSTRUCTIONS = `Wigolo is a local-first web access layer: search the open web, fetch pages, crawl sites, extract structured data, find related content, run multi-step research, and execute agent-driven data gathering. All results land in a local SQLite cache that persists across sessions.
18
18
 
19
+ ## Host-LLM synthesis pattern (read this first)
20
+
21
+ Wigolo has no internal LLM. It returns *structured evidence* so YOU (the host LLM) write the final answer. Fold structure into your reply:
22
+
23
+ - \`search\` \`format: "highlights"\` → FlashRank-scored passages + \`citations\`. Quote [N].
24
+ - \`research\` → \`brief\` with \`topics\`, \`highlights\`, \`key_findings\` when sampling unavailable. Use as report scaffold.
25
+ - \`find_similar\` → \`cold_start\` string when local signals are weak. Pass to user verbatim.
26
+ - \`extract\` \`mode: "structured"\` → tables + definitions + jsonld + chart_hints + key_value_pairs in one call.
27
+ - \`fetch\` metadata → \`og_type\`, \`canonical_url\`, \`og_image\` when present.
28
+
19
29
  ## When to use which tool
20
30
 
21
31
  - \`search\` -- you need information on a topic but do not have a URL yet. Pass a query string or an array of 3-5 semantically varied keyword forms for broader coverage.
@@ -35,10 +45,11 @@ export const WIGOLO_INSTRUCTIONS = `Wigolo is a local-first web access layer: se
35
45
  | Error debugging | \`search\` | exact error string as query, \`category: "code"\` (no domain scoping -- errors appear everywhere) |
36
46
  | Library research | \`crawl\` | seed URL of docs site, \`strategy: "sitemap"\`, then \`cache\` for later queries |
37
47
  | Related content | \`find_similar\` | \`url\` of a known good page, or \`concept\` as free text |
38
- | Direct answer | \`search\` | \`format: "answer"\` for a synthesized direct response |
48
+ | Direct quote | \`search\` | \`format: "highlights"\` returns FlashRank-scored passages with citations; cite [N] in your reply |
49
+ | Direct answer | \`search\` | \`format: "answer"\` if client supports sampling, else falls back to \`highlights\` (not plain context) |
39
50
  | Comprehensive research | \`research\` | \`depth: "comprehensive"\`, optional \`include_domains\` to scope |
40
51
  | Data gathering | \`agent\` | natural-language \`prompt\`, optional \`schema\` for structured output |
41
- | Structured extraction | \`extract\` | \`mode: "schema"\` with a JSON Schema, or \`mode: "tables"\` |
52
+ | Structured extraction | \`extract\` | \`mode: "structured"\` (tables + dl + JSON-LD + chart hints + kv pairs), or \`mode: "schema"\` with a JSON Schema |
42
53
  | Site inventory | \`crawl\` | \`strategy: "map"\` for URL-only discovery, no content fetched |
43
54
 
44
55
  ## Rapidly changing content
@@ -64,28 +75,12 @@ For broad queries, pass an array of 3-5 semantically varied keyword forms rather
64
75
  - For URL discovery only, use \`crawl\` with \`strategy: "map"\` -- URLs only, no content. Follow with targeted \`fetch\` calls.
65
76
  - For structured data (prices, specs, table rows), use \`extract\` with \`mode: "schema"\` or \`mode: "tables"\`. Use \`fetch\` only when you want the whole page as markdown.
66
77
  - For multi-source synthesis, use \`research\` instead of chaining \`search\` + \`fetch\` manually.
67
- - For natural-language data gathering ("find pricing for top 5 CRM tools"), use \`agent\` with optional \`schema\`.
68
-
69
- ## Scope searches by domain — biggest single quality lever
70
-
71
- For framework, library, SDK, or tool-specific queries, **always pass \`include_domains\` with the project's official site(s)**. Unscoped queries return generic results from sites that happen to mention the keywords (MDN glossary entries, Docker images, unrelated tutorials). Domain scoping is the single biggest quality improvement for these queries.
72
-
73
- Examples:
74
-
75
- search({ query: "Next.js authentication App Router", include_domains: ["nextjs.org", "authjs.dev", "clerk.com"] })
76
- search({ query: "react server components", include_domains: ["react.dev", "nextjs.org"] })
77
- search({ query: "prisma migrations", include_domains: ["prisma.io"] })
78
- search({ query: "stripe webhooks", include_domains: ["stripe.com", "docs.stripe.com"] })
79
-
80
- When NOT to scope:
81
-
82
- - Error strings (errors surface across many sites)
83
- - Broad exploration ("state management 2026")
84
- - News and current events
78
+ - For natural-language data gathering, use \`agent\` with optional \`schema\`.
79
+ - \`crawl\` accepts regex \`include_patterns\` and \`exclude_patterns\` to stay inside a section of a large site.
85
80
 
86
- If a first unscoped \`search\` returns noisy results, retry with \`include_domains\` scoped to the official source rather than rephrasing the query.
81
+ ## Scope searches by domain
87
82
 
88
- \`category\` (\`"general"\`, \`"news"\`, \`"code"\`, \`"docs"\`, \`"papers"\`) is a coarse content-type filter and is no substitute for domain scoping. \`category: "docs"\` on its own returns generic documentation portals, not the docs you want -- pair it with \`include_domains\` or omit it.
83
+ For library/framework/SDK queries, **always pass \`include_domains\`** with official sites. Unscoped queries return generic noise. \`category: "docs"\` alone returns generic portals -- pair with \`include_domains\` or omit. Skip domain scoping for error strings, broad exploration, and news.
89
84
 
90
85
  ## Performance
91
86
 
@@ -96,14 +91,12 @@ If a first unscoped \`search\` returns noisy results, retry with \`include_domai
96
91
  - \`research\` with \`depth: "quick"\` (~15s) suits most factual questions; reserve \`"comprehensive"\` for deep investigation.
97
92
  - \`agent\` respects \`max_pages\` (default 10) and \`max_time_ms\` (default 60s).
98
93
 
99
- ## Capabilities worth knowing
94
+ ## Extras
100
95
 
101
- - Localhost URLs work: \`http://localhost:3000\`, \`http://127.0.0.1:8080\`, and similar. Useful for reading local dev servers and internal docs.
102
- - \`use_auth: true\` on \`fetch\` and \`crawl\` reuses the user's configured browser session for pages behind a login.
103
- - \`cache\` accepts FTS5 query syntax (\`AND\`, \`OR\`, \`NOT\`, \`"exact phrase"\`) for precise lookups.
104
- - \`crawl\` accepts regex \`include_patterns\` and \`exclude_patterns\` to stay inside a section of a large site.
105
- - \`find_similar\` uses cached embeddings when available -- no network call needed if the content has been seen before.
106
- - \`research\` and \`agent\` use MCP requestSampling for intelligent decomposition and synthesis when the client supports it. Without sampling support, they return raw sources in context format.`;
96
+ - Localhost URLs (\`localhost:3000\`, \`127.0.0.1:8080\`) work for local dev servers.
97
+ - \`use_auth: true\` on \`fetch\`/\`crawl\` reuses browser session for logged-in pages.
98
+ - \`cache\` supports FTS5 syntax (\`AND\`, \`OR\`, \`NOT\`, \`"phrase"\`).
99
+ - \`research\`/\`agent\` use MCP sampling when supported; fall back to structured data for host-LLM synthesis.`;
107
100
  export const TOOL_DESCRIPTIONS = {
108
101
  fetch: `Fetch a single URL and return clean markdown. Use when you have a specific URL to read. Automatically detects if JavaScript rendering is needed.
109
102
 
@@ -115,26 +108,23 @@ Key parameters:
115
108
  - headers: custom HTTP headers if needed
116
109
  - force_refresh: true to bypass cache and fetch fresh content from the network
117
110
 
118
- Returns title, markdown content, links, images, and metadata. Result is cached locally -- subsequent fetches of the same URL return instantly. Works with localhost URLs (localhost:3000, etc.) for reading local dev servers.
111
+ Returns title, markdown, links, images, metadata (og_image, og_type, canonical_url, keywords). Decorative images filtered, relative URLs resolved. Cached locally; repeat fetches are instant. Localhost URLs work.
119
112
 
120
- Use force_refresh: true for pages that change frequently (news sites, changelogs, dashboards, API status pages). By default, previously fetched pages are served from local cache for speed.`,
121
- search: `Search the web and return full markdown content from top results. Use for finding information on any topic -- returns extracted page content, not just snippets.
113
+ Use force_refresh: true for frequently changing content. Default serves from cache.`,
114
+ search: `Search the web and return full markdown content from top results. Returns extracted page content, not just snippets.
122
115
 
123
116
  Key parameters:
124
- - query: a search string, or an array of 3-5 semantically varied keyword forms for broader coverage. Arrays are deduplicated and merged automatically.
125
- - include_domains/exclude_domains: scope results to specific sites (e.g., ["react.dev", "nextjs.org"]). For framework/library queries, ALWAYS scope to the official site -- unscoped queries return noise.
126
- - category: "general", "news", "code", "docs", "papers" -- coarse content-type filter. "docs" alone returns generic portals; pair with include_domains or omit.
127
- - from_date/to_date: ISO dates for time-bounded queries
128
- - max_results: default 5. Use 3 for focused queries, 10+ for research.
129
- - format: "full" (default), "context", "answer" (sampling synthesis; heuristic key-point summary if unsupported), "stream_answer" (answer + progress notifications)
130
- - max_content_chars: smart-truncate each result markdown at a paragraph boundary with a \`[... content truncated]\` marker (e.g., 3000). Preferred for AI agent context budgets.
131
- - force_refresh: true to bypass all caches (search results and page content)
132
-
133
- The "answer" format uses the MCP client's sampling capability to synthesize a direct response from search results. If sampling is not supported, falls back to "context" format. "stream_answer" emits notifications/progress messages at each pipeline phase (search, fetch, synthesize) when the client provides a progressToken via request._meta — token-level streaming of the LLM response is not supported by MCP sampling, so the answer itself still arrives as one block.
134
-
135
- Results include title, URL, relevance_score, and full markdown_content per result. Previously fetched pages are served from local cache.
136
-
137
- Use force_refresh: true when you need current information that may have changed since the last search. Default behavior uses cached results when available.`,
117
+ - query: string or string[] array (3-5 keyword variants for broader coverage; deduplicated automatically)
118
+ - include_domains/exclude_domains: scope to specific sites. ALWAYS scope library/framework queries.
119
+ - category: "general" | "news" | "code" | "docs" | "papers" coarse filter, pair with include_domains.
120
+ - from_date/to_date: ISO YYYY-MM-DD for time-bounded queries
121
+ - max_results: default 5; use 3 for focused, 10+ for research
122
+ - format: "full" (default), "context", "highlights" (FlashRank-scored passages + [N] citations), "answer" (sampling synthesis; falls back to highlights), "stream_answer"
123
+ - max_highlights: cap highlights count (default 10)
124
+ - max_content_chars: smart-truncate markdown at paragraph boundary (e.g., 3000)
125
+ - force_refresh: true to bypass all caches
126
+
127
+ "answer" falls back to "highlights" when sampling unsupported (most clients). Results include title, URL, relevance_score, and full markdown_content. Cache serves previously fetched pages instantly.`,
138
128
  crawl: `Crawl a website starting from a URL and return content from multiple pages. Use for indexing documentation sites, wikis, or any multi-page resource.
139
129
 
140
130
  Key parameters:
@@ -157,11 +147,16 @@ Returns matching cached pages with full markdown content. Cache persists across
157
147
  extract: `Extract structured data from a URL or raw HTML. Use when you need specific data points, tables, or metadata rather than full page markdown.
158
148
 
159
149
  Key parameters:
160
- - mode: "selector" (CSS selector -> text), "tables" (HTML tables -> JSON rows), "metadata" (title/author/date/description), "schema" (JSON Schema -> heuristic field extraction)
150
+ - mode: "selector" (CSS selector -> text), "tables" (HTML tables only), "metadata" (title/author/date/description/og_* + JSON-LD), "schema" (JSON Schema -> heuristic field extraction), "structured" (ONE-SHOT: tables + <dl> definitions + JSON-LD + chart hints from SVG/figure + microdata/data-attr/grid key-value pairs)
161
151
  - css_selector: required for mode="selector" -- any valid CSS selector
162
152
  - schema: for mode="schema", a JSON Schema object describing the fields to extract
163
153
  - multiple: true to return array of all matches (mode="selector" only)
164
154
 
155
+ Prefer mode="structured" over chaining multiple extract calls — it returns every structured pattern on the page in one response:
156
+ { tables, definitions, jsonld, chart_hints, key_value_pairs }
157
+
158
+ chart_hints surfaces SVG titles, aria-labels, and figcaptions — host LLMs use these to describe data visualizations even when the underlying data is rendered by JavaScript.
159
+
165
160
  For mode="tables", returns array of table objects with headers and row data. For mode="schema", pass { price: "string", name: "string" } and get structured fields extracted from the page.`,
166
161
  find_similar: `Find content related to a URL or concept. Use when you have a known-good page or topic and want to discover similar resources from the cache or web.
167
162
 
@@ -172,9 +167,11 @@ Key parameters:
172
167
  - include_cached: true (default) to search the local cache first, false to skip cache and search the web only
173
168
  - threshold: minimum similarity score (0-1, default 0.5) -- higher values return fewer, more relevant results
174
169
 
175
- Provide either url or concept (not both). Results are ranked by cosine similarity of embeddings. Cached content with embeddings is searched first for instant results. If fewer than max_results are found in cache, a web search supplements the results.
170
+ Provide either url or concept (not both). Results are fused from three signals via 3-way RRF: FTS5 keyword match, sentence-transformer embeddings, and (if local hits are sparse) a live web search. Each result carries \`match_signals\` with \`embedding_rank\`, \`fts5_rank\`, and \`fused_score\` so you can explain ranking to the user.
176
171
 
177
- Returns title, URL, similarity_score, and markdown_content per result.`,
172
+ The response may include a \`cold_start\` string when local signals are weak (empty cache, embeddings unavailable, < 20 cached pages). Pass this verbatim to the user — it explains why results came from web search and how to warm the cache.
173
+
174
+ Returns results array, method used ("hybrid" | "embedding" | "fts5" | "search"), cache_hits, search_hits, embedding_available, and total_time_ms.`,
178
175
  research: `Run multi-step research on a complex question. Decomposes the question into sub-queries, searches in parallel, fetches top sources, and synthesizes a report with citations.
179
176
 
180
177
  Key parameters:
@@ -187,9 +184,15 @@ Key parameters:
187
184
 
188
185
  The pipeline: (1) decompose question into sub-queries, (2) parallel search across sub-queries, (3) fetch and extract top unique sources, (4) synthesize report with citations from all sources, (5) optionally structure report fields if schema is provided.
189
186
 
190
- Uses MCP requestSampling for intelligent decomposition and synthesis. Without sampling support, returns raw sources in context format with sampling_supported: false.
187
+ Uses MCP requestSampling for intelligent decomposition and synthesis when available. Without sampling support (the common case), the output includes a \`brief\` field with:
188
+ - \`topics\`: sub-query labels or distilled source-title topics
189
+ - \`highlights\`: FlashRank-scored passages with source_index, source_url, relevance_score
190
+ - \`key_findings\`: first substantive paragraph per source, ordered by relevance
191
+ - \`per_source_char_cap\` / \`total_sources_char_cap\`: budget hints so you know what was trimmed
192
+
193
+ The host LLM (you) should build its final report from the brief rather than re-reading every source — the brief is the structured scaffold this tool produces when it cannot synthesize internally.
191
194
 
192
- Returns report (markdown), citations array, sources with full content, sub_queries used, depth level, and total_time_ms.`,
195
+ Returns report (markdown), citations array, sources with full content, sub_queries used, depth level, total_time_ms, sampling_supported flag, and optional brief.`,
193
196
  agent: `Execute a natural-language data gathering task. Plans search queries and URLs from a prompt, executes them in parallel, and synthesizes results. Full step transparency.
194
197
 
195
198
  Key parameters:
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mMAyFgK,CAAC;AAEpM,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE;;;;;;;;;;;;6LAYoL;IAE3L,MAAM,EAAE;;;;;;;;;;;;;;;;4JAgBkJ;IAE1J,KAAK,EAAE;;;;;;;;uLAQ8K;IAErL,KAAK,EAAE;;;;;;;;;0GASiG;IAExG,OAAO,EAAE;;;;;;;;4LAQiL;IAE1L,YAAY,EAAE;;;;;;;;;;;uEAWuD;IAErE,QAAQ,EAAE;;;;;;;;;;;;;;yHAc6G;IAEvH,KAAK,EAAE;;;;;;;;;;;;;;;;sKAgB6J;CAC5J,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GAkF4E,CAAC;AAEhH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE;;;;;;;;;;;;oFAY2E;IAElF,MAAM,EAAE;;;;;;;;;;;;;uMAa6L;IAErM,KAAK,EAAE;;;;;;;;uLAQ8K;IAErL,KAAK,EAAE;;;;;;;;;0GASiG;IAExG,OAAO,EAAE;;;;;;;;;;;;;4LAaiL;IAE1L,YAAY,EAAE;;;;;;;;;;;;;kJAakI;IAEhJ,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;kKAoBsJ;IAEhK,KAAK,EAAE;;;;;;;;;;;;;;;;sKAgB6J;CAC5J,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ResearchBrief, ResearchSource } from '../types.js';
2
+ export declare function buildResearchBrief(question: string, sources: ResearchSource[], subQueries: string[], perSourceCharCap: number, totalSourcesCharCap: number): Promise<ResearchBrief>;
3
+ //# sourceMappingURL=brief.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../../src/research/brief.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAoB,MAAM,aAAa,CAAC;AAUnF,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,EAAE,EACzB,UAAU,EAAE,MAAM,EAAE,EACpB,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,aAAa,CAAC,CAyBxB"}
@@ -0,0 +1,79 @@
1
+ import { extractHighlights } from '../search/highlights.js';
2
+ const MAX_HIGHLIGHTS = 12;
3
+ const MAX_KEY_FINDING_LEN = 280;
4
+ const MAX_TOPICS = 8;
5
+ // Build a host-LLM-friendly structured brief when internal sampling is
6
+ // unavailable. The host model (Claude Code / Cursor / etc.) consumes this
7
+ // shape to produce the final report without needing to re-read raw sources.
8
+ export async function buildResearchBrief(question, sources, subQueries, perSourceCharCap, totalSourcesCharCap) {
9
+ const fetched = sources.filter((s) => s.fetched && s.markdown_content.length > 0);
10
+ // Highlights reuse the FlashRank-or-paragraph scorer so briefs align with
11
+ // whatever format='highlights' produces for single-query searches.
12
+ const searchItems = fetched.map((s) => ({
13
+ title: s.title,
14
+ url: s.url,
15
+ snippet: s.markdown_content.slice(0, 200),
16
+ markdown_content: s.markdown_content,
17
+ relevance_score: s.relevance_score,
18
+ }));
19
+ const { highlights } = await extractHighlights(question, searchItems, MAX_HIGHLIGHTS);
20
+ const topics = buildTopics(subQueries, fetched);
21
+ const keyFindings = buildKeyFindings(fetched);
22
+ return {
23
+ topics,
24
+ highlights,
25
+ key_findings: keyFindings,
26
+ per_source_char_cap: perSourceCharCap,
27
+ total_sources_char_cap: totalSourcesCharCap,
28
+ };
29
+ }
30
+ // Prefer sub-queries (planner's view of the topic space) when available;
31
+ // otherwise derive compact topic labels from source titles.
32
+ function buildTopics(subQueries, sources) {
33
+ if (subQueries.length > 0) {
34
+ return dedupe(subQueries).slice(0, MAX_TOPICS);
35
+ }
36
+ const labels = sources
37
+ .map((s) => s.title.split(/[–|:·-]/)[0].trim())
38
+ .filter((t) => t.length >= 5 && t.length <= 100);
39
+ return dedupe(labels).slice(0, MAX_TOPICS);
40
+ }
41
+ // First substantive paragraph per source, trimmed to a finding-sized blurb.
42
+ // Ordered by source relevance so the most-weighted finding is first.
43
+ function buildKeyFindings(sources) {
44
+ const out = [];
45
+ for (const s of [...sources].sort((a, b) => b.relevance_score - a.relevance_score)) {
46
+ const first = firstSubstantiveParagraph(s.markdown_content);
47
+ if (!first)
48
+ continue;
49
+ const trimmed = first.length > MAX_KEY_FINDING_LEN
50
+ ? first.slice(0, MAX_KEY_FINDING_LEN - 1).trimEnd() + '…'
51
+ : first;
52
+ out.push(trimmed);
53
+ }
54
+ return dedupe(out);
55
+ }
56
+ function firstSubstantiveParagraph(markdown) {
57
+ const paragraphs = markdown.split(/\n\n+/).map((p) => p.trim());
58
+ for (const p of paragraphs) {
59
+ if (p.length < 80)
60
+ continue;
61
+ if (p.startsWith('#') || p.startsWith('|') || p.startsWith('```'))
62
+ continue;
63
+ return p.replace(/\s+/g, ' ');
64
+ }
65
+ return null;
66
+ }
67
+ function dedupe(list) {
68
+ const seen = new Set();
69
+ const out = [];
70
+ for (const item of list) {
71
+ const key = item.toLowerCase();
72
+ if (seen.has(key))
73
+ continue;
74
+ seen.add(key);
75
+ out.push(item);
76
+ }
77
+ return out;
78
+ }
79
+ //# sourceMappingURL=brief.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.js","sourceRoot":"","sources":["../../src/research/brief.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,uEAAuE;AACvE,0EAA0E;AAC1E,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,OAAyB,EACzB,UAAoB,EACpB,gBAAwB,EACxB,mBAA2B;IAE3B,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EA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AAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,SAAS;QAC5E,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,IAAc;IAC5B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/research/pipeline.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAatD,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,YAAY,EAAE,EACvB,MAAM,EAAE,WAAW,EACnB,MAAM,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAoGzB"}
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/research/pipeline.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAatD,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,YAAY,EAAE,EACvB,MAAM,EAAE,WAAW,EACnB,MAAM,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAkHzB"}
@@ -1,6 +1,7 @@
1
1
  import { createLogger } from '../logger.js';
2
2
  import { decomposeQuestion } from './decompose.js';
3
3
  import { synthesizeReport } from './synthesize.js';
4
+ import { buildResearchBrief } from './brief.js';
4
5
  import { deduplicateResults } from '../search/dedup.js';
5
6
  import { rerankResults } from '../search/rerank.js';
6
7
  import { applyAllFilters } from '../search/filters.js';
@@ -68,6 +69,12 @@ export async function runResearchPipeline(input, engines, router, server) {
68
69
  // Phase 5: Synthesize report
69
70
  const synthesisResult = await synthesizeReport(input.question, sources, depth, server);
70
71
  log.info('synthesis complete', { samplingUsed: synthesisResult.samplingUsed, reportLength: synthesisResult.report.length });
72
+ // Phase 6: Structured brief — populated when internal sampling is
73
+ // unavailable so the host LLM has well-shaped data to write the report
74
+ // from without re-reading raw markdown.
75
+ const brief = !synthesisResult.samplingUsed
76
+ ? await buildResearchBrief(input.question, sources, subQueries, PER_SOURCE_CHAR_CAP, TOTAL_SOURCES_CHAR_CAP)
77
+ : undefined;
71
78
  return {
72
79
  report: synthesisResult.report,
73
80
  citations: synthesisResult.citations,
@@ -76,6 +83,7 @@ export async function runResearchPipeline(input, engines, router, server) {
76
83
  depth,
77
84
  total_time_ms: Date.now() - start,
78
85
  sampling_supported: !!server,
86
+ ...(brief ? { brief } : {}),
79
87
  };
80
88
  }
81
89
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/research/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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ACH,CAAC"}
@@ -38,7 +38,7 @@ export async function synthesizeReport(question, sources, depth, server) {
38
38
  const report = buildFallbackReport(question, fetchedSources, limits.reportChars);
39
39
  return { report, citations, samplingUsed: false };
40
40
  }
41
- async function synthesizeWithSampling(question, sources, citations, limits, server) {
41
+ async function synthesizeWithSampling(question, sources, _citations, limits, server) {
42
42
  try {
43
43
  if (!checkSamplingSupport(server)) {
44
44
  log.debug('client does not support sampling for synthesis');