@intentic/fileq 1.337.0 → 1.338.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +29 -3
  2. package/bin/fileq-rg-pre +66 -0
  3. package/dist/app.d.ts.map +1 -1
  4. package/dist/app.js +6 -0
  5. package/dist/app.js.map +1 -1
  6. package/dist/commands/derive.command.d.ts.map +1 -1
  7. package/dist/commands/derive.command.js +10 -0
  8. package/dist/commands/derive.command.js.map +1 -1
  9. package/dist/commands/read.command.js +1 -1
  10. package/dist/commands/read.command.js.map +1 -1
  11. package/dist/commands/ripgrep-config.command.d.ts +3 -0
  12. package/dist/commands/ripgrep-config.command.d.ts.map +1 -0
  13. package/dist/commands/ripgrep-config.command.js +24 -0
  14. package/dist/commands/ripgrep-config.command.js.map +1 -0
  15. package/dist/commands/stamps.command.d.ts +3 -0
  16. package/dist/commands/stamps.command.d.ts.map +1 -0
  17. package/dist/commands/stamps.command.js +13 -0
  18. package/dist/commands/stamps.command.js.map +1 -0
  19. package/dist/lib/check/check-pdf.d.ts.map +1 -1
  20. package/dist/lib/check/check-pdf.js +2 -1
  21. package/dist/lib/check/check-pdf.js.map +1 -1
  22. package/dist/lib/check/package.d.ts.map +1 -1
  23. package/dist/lib/check/package.js +2 -1
  24. package/dist/lib/check/package.js.map +1 -1
  25. package/dist/lib/derive.d.ts.map +1 -1
  26. package/dist/lib/derive.js +39 -8
  27. package/dist/lib/derive.js.map +1 -1
  28. package/dist/lib/derivers/pdf.d.ts +1 -0
  29. package/dist/lib/derivers/pdf.d.ts.map +1 -1
  30. package/dist/lib/derivers/pdf.js +17 -9
  31. package/dist/lib/derivers/pdf.js.map +1 -1
  32. package/dist/lib/formats.d.ts +4 -0
  33. package/dist/lib/formats.d.ts.map +1 -1
  34. package/dist/lib/formats.js +15 -0
  35. package/dist/lib/formats.js.map +1 -1
  36. package/dist/lib/render/render.d.ts.map +1 -1
  37. package/dist/lib/render/render.js +5 -7
  38. package/dist/lib/render/render.js.map +1 -1
  39. package/dist/lib/sidecar.d.ts +14 -0
  40. package/dist/lib/sidecar.d.ts.map +1 -1
  41. package/dist/lib/sidecar.js +40 -4
  42. package/dist/lib/sidecar.js.map +1 -1
  43. package/dist/skill.d.ts.map +1 -1
  44. package/dist/skill.js +23 -2
  45. package/dist/skill.js.map +1 -1
  46. package/package.json +9 -7
  47. package/src/app.ts +6 -0
  48. package/src/cli.integration.test.ts +9 -0
  49. package/src/commands/derive.command.ts +12 -0
  50. package/src/commands/read.command.ts +3 -1
  51. package/src/commands/ripgrep-config.command.ts +31 -0
  52. package/src/commands/stamps.command.ts +14 -0
  53. package/src/lib/check/check-pdf.ts +2 -1
  54. package/src/lib/check/package.ts +2 -1
  55. package/src/lib/derive.test.ts +27 -1
  56. package/src/lib/derive.ts +68 -8
  57. package/src/lib/derivers/pdf.ts +25 -10
  58. package/src/lib/formats.ts +32 -0
  59. package/src/lib/render/render.ts +7 -7
  60. package/src/lib/sidecar.test.ts +32 -1
  61. package/src/lib/sidecar.ts +67 -4
  62. package/src/rg-preprocessor.integration.test.ts +139 -0
  63. package/src/skill.ts +27 -2
package/src/skill.ts CHANGED
@@ -47,9 +47,34 @@ diff; do not convert both versions by hand.
47
47
 
48
48
  `;
49
49
 
50
+ // Searching documents: in the sandbox the daemon keeps every document's shadow current and points ripgrep at fileq's
51
+ // preprocessor (RIPGREP_CONFIG_PATH, while the "Search documents" setting is on), and iq indexes the shadows under the
52
+ // documents' own paths. Elsewhere the same preprocessor is one config line away.
53
+ const SEARCH = {
54
+ sandbox: `## Searching documents
55
+ The text of every pdf, docx, xlsx, pptx, odt, ods, odp, rtf and epub in the workspace is searchable under the
56
+ document's own path, kept current as files change:
57
+ - \`rg <pattern>\` in the shell searches documents along with code, through fileq's preprocessor. A hit reads
58
+ \`docs/terms.pdf:345:[p. 12] … wniosek …\`: the line number counts lines of the document's text, and
59
+ \`[p. 12] \` (or \`[slide 3] \`) is the page or slide that line is on. Use \`rg\` in the shell for documents:
60
+ a Grep tool that runs its own bundled ripgrep may skip them.
61
+ - \`iq "<question>"\` finds documents by meaning too; their passages carry the same page marks.
62
+ - When you answer from a document, cite it as file and page: "docs/terms.pdf, p. 12". Read the page around a hit
63
+ with \`fileq read <file>\` (or the sidecar it names) rather than guessing from one line.
64
+ - Scans are OCR'd only where the image carries the OCR models, and the shadow notes it when they are missing.
65
+
66
+ `,
67
+ standalone: `## Searching documents
68
+ \`fileq ripgrep-config > ~/.config/fileq.ripgreprc\` and \`RIPGREP_CONFIG_PATH=~/.config/fileq.ripgreprc\` make plain
69
+ \`rg\` search pdf, docx, xlsx, pptx, odt, ods, odp, rtf and epub as text, each hit cited by page
70
+ (\`docs/terms.pdf:345:[p. 12] …\`). Cite answers from a document as file and page.
71
+
72
+ `,
73
+ } satisfies Record<FileqSkillHost["host"], string>;
74
+
50
75
  export const fileqSkill = ({ host }: FileqSkillHost): string => `---
51
76
  name: fileq
52
- description: Read binary files (docx, xlsx, pptx, pdf, odt, epub, ipynb, images, audio, archives, V8 profiles) as budgeted markdown with \`fileq\`, size up csv, json or logs too big to cat, and check and render a docx, pptx, xlsx or pdf you made. Use instead of guessing from a filename, ad-hoc converters, or delivering it unseen.
77
+ description: Read binary files (docx, xlsx, pptx, pdf, odt, epub, ipynb, images, audio, archives, V8 profiles) as budgeted markdown with \`fileq\`, search documents' text cited by page, size up csv, json or logs too big to cat, and check and render a docx, pptx, xlsx or pdf you made. Use instead of guessing from a filename, ad-hoc converters, or delivering it unseen.
53
78
  ---
54
79
 
55
80
  # fileq: binary files as markdown
@@ -82,7 +107,7 @@ ${OCR_REFUSAL[host]}
82
107
  - Plain text (md, csv, txt, code) is not fileq's business: Read it directly — but see below for the big ones.
83
108
  - Web pages belong to \`webq\`; images for a vision model belong to the Read tool, which shows the pixels.
84
109
 
85
- ${host === "sandbox" ? TEXTCONV : ""}Exit codes: 0 content, 1 nothing derivable, 2 broken invocation or install.
110
+ ${SEARCH[host]}${host === "sandbox" ? TEXTCONV : ""}Exit codes: 0 content, 1 nothing derivable, 2 broken invocation or install.
86
111
 
87
112
  ## After you produce a document
88
113
  A deck, report, spreadsheet or PDF made for someone is not finished until you have checked it and looked at it.